From 940e2f55e13ea6b1fe2cc055ec9603f37d870f98 Mon Sep 17 00:00:00 2001
From: Z-WICK <2289431216@qq.com>
Date: Sat, 10 Jan 2026 11:22:11 +0800
Subject: [PATCH] sync changes
---
src/views/martial/competition/index.vue | 221 +++++++-----------------
1 file changed, 67 insertions(+), 154 deletions(-)
diff --git a/src/views/martial/competition/index.vue b/src/views/martial/competition/index.vue
index 21542a4..2a46229 100644
--- a/src/views/martial/competition/index.vue
+++ b/src/views/martial/competition/index.vue
@@ -646,124 +646,51 @@
项目列表
-
-
-
- 添加项目
-
-
-
-
-
-
-
- {{ scope.row.projectName }}
-
-
-
-
-
-
- {{ scope.row.projectCode }}
-
-
-
-
-
-
- {{ scope.row.category }}
-
-
-
-
-
-
-
- ¥{{ scope.row.price || 0 }}
-
-
-
-
-
-
- {{ scope.row.description }}
-
-
-
-
-
-
- 删除
-
-
-
-
+
+ 请先保存赛事基本信息,然后前往 项目管理 功能配置比赛项目。
+
+ 前往项目管理
+
+
+
+
+
+
+
+
+
+
+
+ 套路
+ 散打
+ 器械
+ 对练
+ -
+
+
+
+
+ ¥{{ scope.row.price || 0 }}
+
+
+
+
+
+
@@ -1274,18 +1201,7 @@ export default {
console.log('项目列表长度:', projectList.length);
if (projectList.length > 0) {
- this.formData.projects = projectList.map(item => ({
- id: item.id,
- projectName: item.projectName,
- projectCode: item.projectCode,
- category: item.category,
- type: item.type,
- minParticipants: item.minParticipants,
- maxParticipants: item.maxParticipants,
- estimatedDuration: item.estimatedDuration,
- price: item.price,
- description: item.description
- }));
+ this.formData.projects = projectList.map(item => ({ ...item }));
console.log('✅ 加载的项目列表:', this.formData.projects);
console.log('✅ 项目数量:', this.formData.projects.length);
} else {
@@ -1645,20 +1561,16 @@ export default {
this.formData.schedule.splice(index, 1);
},
- // 项目列表管理
- handleAddProject() {
- this.formData.projects.push({
- projectName: '',
- projectCode: '',
- category: '',
- maxParticipants: null,
- price: 0,
- description: ''
- });
- },
-
- handleDeleteProject(index) {
- this.formData.projects.splice(index, 1);
+ // 项目列表管理 - 跳转到项目管理页面
+ goToProjectManagement() {
+ if (this.competitionId) {
+ this.$router.push({
+ path: '/martial/project/list',
+ query: { competitionId: this.competitionId }
+ });
+ } else {
+ this.$message.warning('请先保存赛事基本信息');
+ }
},
// 场地配置管理
@@ -1707,10 +1619,10 @@ export default {
savePromises.push(this.saveActivitySchedules(savedCompetitionId));
}
- // 2. 保存项目列表
- if (this.formData.projects && this.formData.projects.length > 0) {
- savePromises.push(this.saveProjects(savedCompetitionId));
- }
+ // 2. 项目列表 - 已移至项目管理功能配置
+ // if (this.formData.projects && this.formData.projects.length > 0) {
+ // savePromises.push(this.saveProjects(savedCompetitionId));
+ // }
// 3. 保存场地配置
if (this.formData.venues && this.formData.venues.length > 0) {
@@ -1794,9 +1706,7 @@ export default {
},
async saveProjects(competitionId) {
- const projects = this.formData.projects.filter(item =>
- item.projectName && item.projectCode
- );
+ const projects = this.formData.projects.filter(item => item.projectName);
if (projects.length === 0) {
return Promise.resolve();
@@ -1814,16 +1724,19 @@ export default {
const promises = projects.map(project => {
const projectData = {
+ ...project,
competitionId: finalCompetitionId,
projectName: project.projectName,
- projectCode: project.projectCode,
category: project.category || '',
- type: project.type || 1, // 默认个人项目
+ eventType: project.eventType || 1,
+ type: project.type || 1,
minParticipants: project.minParticipants || 1,
- maxParticipants: project.maxParticipants || 1,
+ maxParticipants: project.maxParticipants || 100,
estimatedDuration: project.estimatedDuration || 5,
price: project.price || 0,
- description: project.description || ''
+ sortOrder: project.sortOrder || 0,
+ description: project.description || '',
+ rules: project.rules || ''
};
// 如果有 id,说明是编辑已有的项目