|
@@ -146,6 +146,12 @@
|
|
|
:value="project.projectId"
|
|
:value="project.projectId"
|
|
|
/>
|
|
/>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
|
|
+ <div v-if="form.projectId" style="margin-top: 5px;">
|
|
|
|
|
+ <span style="font-size: 13px; color: #606266;">当前参赛人数:</span>
|
|
|
|
|
+ <el-link type="primary" :underline="false" @click="handleViewAthletes" style="font-size: 13px; font-weight: bold;">
|
|
|
|
|
+ {{ athleteCount }} 人
|
|
|
|
|
+ </el-link>
|
|
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
@@ -242,6 +248,13 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 运动员列表对话框组件 -->
|
|
|
|
|
+ <athlete-list-dialog
|
|
|
|
|
+ v-model:visible="athleteDialogVisible"
|
|
|
|
|
+ :project-id="athleteProjectId"
|
|
|
|
|
+ :event-id="form.eventId"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -250,6 +263,8 @@ import { nextTick, ref, onMounted, computed } from 'vue';
|
|
|
import { useRouter } from 'vue-router';
|
|
import { useRouter } from 'vue-router';
|
|
|
import { listGameEventGroup, getGameEventGroup, delGameEventGroup, addGameEventGroup, updateGameEventGroup } from '@/api/system/gameEventGroup';
|
|
import { listGameEventGroup, getGameEventGroup, delGameEventGroup, addGameEventGroup, updateGameEventGroup } from '@/api/system/gameEventGroup';
|
|
|
import { listGameEventProject } from '@/api/system/gameEventProject';
|
|
import { listGameEventProject } from '@/api/system/gameEventProject';
|
|
|
|
|
+import { listGameAthlete, getAthleteCount as getAthleteCountApi } from '@/api/system/gameAthlete';
|
|
|
|
|
+import AthleteListDialog from '@/components/AthleteListDialog/index.vue';
|
|
|
import { GameEventGroupVO, GameEventGroupQuery, GameEventGroupForm } from '@/api/system/gameEventGroup/types';
|
|
import { GameEventGroupVO, GameEventGroupQuery, GameEventGroupForm } from '@/api/system/gameEventGroup/types';
|
|
|
import { GameEventProjectVO } from '@/api/system/gameEventProject/types';
|
|
import { GameEventProjectVO } from '@/api/system/gameEventProject/types';
|
|
|
|
|
|
|
@@ -269,6 +284,11 @@ const single = ref(true);
|
|
|
const multiple = ref(true);
|
|
const multiple = ref(true);
|
|
|
const total = ref(0);
|
|
const total = ref(0);
|
|
|
|
|
|
|
|
|
|
+// 参赛人数及运动员列表相关
|
|
|
|
|
+const athleteCount = ref(0);
|
|
|
|
|
+const athleteDialogVisible = ref(false);
|
|
|
|
|
+const athleteProjectId = ref<string | number>('');
|
|
|
|
|
+
|
|
|
// 项目类型过滤器(用于查询和表单,不存储在数据中)
|
|
// 项目类型过滤器(用于查询和表单,不存储在数据中)
|
|
|
const projectTypeFilter = ref<string>('');
|
|
const projectTypeFilter = ref<string>('');
|
|
|
const formProjectTypeFilter = ref<string>('');
|
|
const formProjectTypeFilter = ref<string>('');
|
|
@@ -501,9 +521,26 @@ const handleFormProjectChange = () => {
|
|
|
// 可以在这里设置一些默认值或者进行其他处理
|
|
// 可以在这里设置一些默认值或者进行其他处理
|
|
|
console.log('选中的项目:', selectedProject);
|
|
console.log('选中的项目:', selectedProject);
|
|
|
}
|
|
}
|
|
|
|
|
+ getAthleteCount();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ athleteCount.value = 0;
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+/** 获取运动员人数 */
|
|
|
|
|
+const getAthleteCount = async () => {
|
|
|
|
|
+ if (!form.value.projectId) return;
|
|
|
|
|
+ const res = await getAthleteCountApi(form.value.projectId, form.value.eventId);
|
|
|
|
|
+ athleteCount.value = res.data || 0;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+/** 查看运动员列表 */
|
|
|
|
|
+const handleViewAthletes = () => {
|
|
|
|
|
+ if (athleteCount.value === 0) return;
|
|
|
|
|
+ athleteProjectId.value = form.value.projectId!;
|
|
|
|
|
+ athleteDialogVisible.value = true;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
/** 取消按钮 */
|
|
/** 取消按钮 */
|
|
|
const cancel = () => {
|
|
const cancel = () => {
|
|
|
reset();
|
|
reset();
|
|
@@ -560,6 +597,9 @@ const handleUpdate = async (row?: GameEventGroupVO) => {
|
|
|
const _groupId = row?.groupId || ids.value[0];
|
|
const _groupId = row?.groupId || ids.value[0];
|
|
|
const res = await getGameEventGroup(_groupId);
|
|
const res = await getGameEventGroup(_groupId);
|
|
|
Object.assign(form.value, res.data);
|
|
Object.assign(form.value, res.data);
|
|
|
|
|
+
|
|
|
|
|
+ // 获取项目参赛人数
|
|
|
|
|
+ getAthleteCount();
|
|
|
|
|
|
|
|
// 根据项目ID设置项目类型过滤器
|
|
// 根据项目ID设置项目类型过滤器
|
|
|
if (res.data.projectId) {
|
|
if (res.data.projectId) {
|