diff --git a/src/components/SearchCom/index.vue b/src/components/SearchCom/index.vue index 39d5e84..e168b82 100644 --- a/src/components/SearchCom/index.vue +++ b/src/components/SearchCom/index.vue @@ -7,15 +7,18 @@ - + {{ j.name }} - + {{ j.name }} + + + diff --git a/src/views/course/CourseList.vue b/src/views/course/CourseList.vue index fdd5323..ce41fdb 100644 --- a/src/views/course/CourseList.vue +++ b/src/views/course/CourseList.vue @@ -32,6 +32,7 @@ import { STable, SearchCom } from '@/components' import { getCourseList, deleteCourse } from '@/api/course/course' import { dictionaryDropDown } from '@/api/sys/dictionaryItem' +import { dictToTree } from '@/utils/util' export default { components: { @@ -44,7 +45,8 @@ export default { queryParam: { courseName: this.$route.query.courseName || '' }, queryOptions: [ { type: 'input', placeholder: '课程名称', key: 'courseName' }, - { type: 'select', placeholder: '请选择标签', key: 'tag', options: [] }, + { type: 'select-dic-tree', placeholder: '请选择课程类别', key: 'courseType' , options: [] }, + { type: 'select-dic', placeholder: '请选择标签', key: 'tag', mode: 'multiple', options: [] }, ], loadData: (parameter) => { return getCourseList(Object.assign(parameter, this.queryParam)).then((res) => { @@ -68,13 +70,14 @@ export default { dictionaryDropDown() { this.formLoading = false + //课程类别 + dictionaryDropDown({ dictionaryCode: '0006' }).then((res) => { + this.queryOptions[1].options = dictToTree(res.data, [], 0); + }) + //课程标签字典 dictionaryDropDown({ dictionaryCode: '0008' }).then((res) => { - const tagList = res.data - for (let i = 0; i < tagList.length; i++) { - tagList[i].id = tagList[i].value.toString() - } - this.queryOptions[1].options = tagList + this.queryOptions[2].options = res.data }) }, handleRefresh() {