修复部分bug

This commit is contained in:
LiuQAQQWQ 2025-11-28 16:59:32 +08:00
parent d4934c40da
commit 29849c7a24
2 changed files with 23 additions and 4 deletions

View File

@ -17,6 +17,7 @@
multiple
placeholder="请选择方案课程"
clearable
filterable
>
<el-option
v-for="(item, index) in optionsData.course.lists || []"
@ -51,6 +52,7 @@
</el-radio-group>
</el-form-item>
</el-form>
<el-button @click="constoleLog">log</el-button>
</popup>
</div>
</template>
@ -87,6 +89,10 @@ const formData = reactive({
assessmentType: '',
status: ''
})
const queryParams = reactive({
courseName: '',
courseCode: ''
})
const formRules = {
id: [
@ -102,7 +108,12 @@ const { optionsData } = useDictOptions<{
course: any
}>({
course: {
api: courseLists
api: courseLists,
params: {
status: 1,
courseName: queryParams.courseName,
courseCode: queryParams.courseCode
}
}
})
@ -115,6 +126,10 @@ const handleSubmit = async () => {
emit('success')
}
const constoleLog = async () => {
console.log('courseId:', formData.courseId)
}
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
@ -123,10 +138,15 @@ const open = (type = 'add') => {
const setFormData = async (data: Record<string, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
if (key === 'courseId') {
//@ts-ignore
formData[key] = Array.isArray(data[key]) ? data[key] : data[key] ? [data[key]] : []
} else {
//@ts-ignore
formData[key] = data[key]
}
}
}
}
const getDetail = async (row: Record<string, any>) => {

View File

@ -224,7 +224,6 @@ const fetchVersionLists = async (data: Record<string, any>) => {
const handleVersionChange = (versionId: string | number) => {
selectedVersion.value = getVersionLists.value.find((v) => v.id === versionId)
console.log('selectedVersion:', selectedVersion.value)
getLists()
}