修复部分bug
This commit is contained in:
parent
d4934c40da
commit
29849c7a24
|
|
@ -17,6 +17,7 @@
|
||||||
multiple
|
multiple
|
||||||
placeholder="请选择方案课程"
|
placeholder="请选择方案课程"
|
||||||
clearable
|
clearable
|
||||||
|
filterable
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(item, index) in optionsData.course.lists || []"
|
v-for="(item, index) in optionsData.course.lists || []"
|
||||||
|
|
@ -51,6 +52,7 @@
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
<el-button @click="constoleLog">log</el-button>
|
||||||
</popup>
|
</popup>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -87,6 +89,10 @@ const formData = reactive({
|
||||||
assessmentType: '',
|
assessmentType: '',
|
||||||
status: ''
|
status: ''
|
||||||
})
|
})
|
||||||
|
const queryParams = reactive({
|
||||||
|
courseName: '',
|
||||||
|
courseCode: ''
|
||||||
|
})
|
||||||
|
|
||||||
const formRules = {
|
const formRules = {
|
||||||
id: [
|
id: [
|
||||||
|
|
@ -102,7 +108,12 @@ const { optionsData } = useDictOptions<{
|
||||||
course: any
|
course: any
|
||||||
}>({
|
}>({
|
||||||
course: {
|
course: {
|
||||||
api: courseLists
|
api: courseLists,
|
||||||
|
params: {
|
||||||
|
status: 1,
|
||||||
|
courseName: queryParams.courseName,
|
||||||
|
courseCode: queryParams.courseCode
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -115,6 +126,10 @@ const handleSubmit = async () => {
|
||||||
emit('success')
|
emit('success')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const constoleLog = async () => {
|
||||||
|
console.log('courseId:', formData.courseId)
|
||||||
|
}
|
||||||
|
|
||||||
const open = (type = 'add') => {
|
const open = (type = 'add') => {
|
||||||
mode.value = type
|
mode.value = type
|
||||||
popupRef.value?.open()
|
popupRef.value?.open()
|
||||||
|
|
@ -123,11 +138,16 @@ const open = (type = 'add') => {
|
||||||
const setFormData = async (data: Record<string, any>) => {
|
const setFormData = async (data: Record<string, any>) => {
|
||||||
for (const key in formData) {
|
for (const key in formData) {
|
||||||
if (data[key] != null && data[key] != undefined) {
|
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
|
//@ts-ignore
|
||||||
formData[key] = data[key]
|
formData[key] = data[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const getDetail = async (row: Record<string, any>) => {
|
const getDetail = async (row: Record<string, any>) => {
|
||||||
const data = await curriculumDetail({
|
const data = await curriculumDetail({
|
||||||
|
|
|
||||||
|
|
@ -224,7 +224,6 @@ const fetchVersionLists = async (data: Record<string, any>) => {
|
||||||
|
|
||||||
const handleVersionChange = (versionId: string | number) => {
|
const handleVersionChange = (versionId: string | number) => {
|
||||||
selectedVersion.value = getVersionLists.value.find((v) => v.id === versionId)
|
selectedVersion.value = getVersionLists.value.find((v) => v.id === versionId)
|
||||||
console.log('selectedVersion:', selectedVersion.value)
|
|
||||||
getLists()
|
getLists()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue