喻忠伟 6 months ago
commit 594663d377
  1. 48
      src/views/registrationGroup/index.vue

@ -127,10 +127,7 @@
<el-input v-model.number="ruleForm.teamName" />
</el-form-item>
<el-form-item label="选择题目" prop="teamName">
<el-select
v-model="ruleForm.topicId"
placeholder="请选择题目"
>
<el-select v-model="ruleForm.topicId" placeholder="请选择题目">
<el-option
v-for="item in options"
:key="item.value"
@ -175,7 +172,7 @@ import { getSignUpApi } from '@/api/person'
import stuList from './components/stuList.vue'
import teaList from './components/teaList.vue'
import { getNdbswxqList, getComppxqList } from '@/api/person'
import {getTopicList} from '@/api/race'
import { getTopicList } from '@/api/race'
const user = userStore()
const route = useRoute()
const router = useRouter()
@ -222,6 +219,8 @@ const teaRef = ref<any>(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()
</script>

Loading…
Cancel
Save