diff --git a/src/views/registrationGroup/index.vue b/src/views/registrationGroup/index.vue index fcc268c..c239ac5 100644 --- a/src/views/registrationGroup/index.vue +++ b/src/views/registrationGroup/index.vue @@ -127,10 +127,7 @@ - + (null) const loading = ref(false) const submit = () => { + if(!ruleForm.teamName) return ElMessage.warning('请输入队伍名称') + if(!ruleForm.topicId) return ElMessage.warning('请选择题目') ruleForm.instructorSheetList = [...teaRef.value.submit()] ruleForm.teamManagementList = [...stuRef.value.submit()] loading.value = true @@ -241,32 +240,19 @@ const submit = () => { }) .finally(() => (loading.value = false)) } -const options = [ - { - value: 'Option1', - label: 'Option1', - }, - { - value: 'Option2', - label: 'Option2', - }, - { - value: 'Option3', - label: 'Option3', - }, - { - value: 'Option4', - label: 'Option4', - }, - { - value: 'Option5', - label: 'Option5', - }, -] -const getTopicListApi = async() => { - const res = await getTopicList({annualCompid:route.query.id}) - console.log(res); - +const options = ref([]) +const getTopicListApi = async () => { + const res: any = await getTopicList({ annualCompid: route.query.id }) + console.log(res) + if(!(res.result.length == 0)){ + ruleForm.topicId = res.result[0].id + } + options.value = res.result.map((item) => { + return { + value: item.id, + label: item.name, + } + }) } getTopicListApi()