From 32252167c487d9ee051c76625ba56f08ba9d80c4 Mon Sep 17 00:00:00 2001 From: JayChou Date: Wed, 27 Nov 2024 22:17:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/registrationGroup/index.vue | 45 +++++++++------------------ 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/src/views/registrationGroup/index.vue b/src/views/registrationGroup/index.vue index de793fb..3ab0fb7 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,16 @@ 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) + options.value = res.result.map((item) => { + return { + value: item.id, + label: item.name, + } + }) } getTopicListApi() From b669f00d92ee4daa5becc4042d0bfa138ffad415 Mon Sep 17 00:00:00 2001 From: JayChou Date: Wed, 27 Nov 2024 22:20:37 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=80=89=E9=A2=98?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/registrationGroup/index.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/views/registrationGroup/index.vue b/src/views/registrationGroup/index.vue index 3ab0fb7..a04e5d9 100644 --- a/src/views/registrationGroup/index.vue +++ b/src/views/registrationGroup/index.vue @@ -244,6 +244,9 @@ 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,