diff --git a/src/views/course/CourseAdd.vue b/src/views/course/CourseAdd.vue index 4a45dbc..8b76014 100644 --- a/src/views/course/CourseAdd.vue +++ b/src/views/course/CourseAdd.vue @@ -1,9 +1,10 @@ @@ -133,14 +140,17 @@ export default { dataValue: 1, form: { coverPath: '', + tags:[], + courseTags:[] }, url: '', previewVisible: false, fileList: [], previewImage: [], - dictPerson:[], - dictCourseType:[], - industry:[] + dictPerson: [], + dictCourseType: [], + industry: [], + dictCourseTag:[], } }, components: { @@ -148,28 +158,21 @@ export default { getCourseDetails, }, created() { + this.dictionaryDropDown() if (this.$route.query.id) { getCourseDetails({ id: this.$route.query.id }).then((res) => { - this.form = res.data + this.form = res.data; + this.form.isRequired = this.form.isRequired + ''; - // this.form.courseType = this.form.courseType + '' - // this.form.industryInvolved = this.form.industryInvolved + '' - this.form.isRequired = this.form.isRequired + '' - // this.form.is - this.dictEcho(); + this.form.tags = []; + this.form.courseTags.forEach((item,index) => { + this.form.tags.push(item.dictValue.toString()); + }); }) } - - this.dictionaryDropDown() }, methods: { - // getPersonType() { - // return dictGet(Object.assign(parameter)).then((res) => { - // return res - // }) - // }, - //显示页面上的数字 onChange(dataValue) { console.log('changed', dataValue) @@ -185,31 +188,32 @@ export default { }) }, - dictionaryDropDown () { - this.formLoading = true - // 行业 - dictionaryDropDown({ dictionaryCode: '0007' }).then((res) => { - this.industry = res.data - this.formLoading = false - }) - // 课程类别 - dictionaryDropDown({ dictionaryCode: '0006' }).then((res) => { - this.dictCourseType = res.data - this.formLoading = false - }) - // 人员类型 - dictionaryDropDown({ dictionaryCode: '0005' }).then((res) => { - this.dictPerson = res.data - this.formLoading = false - }) - }, - - // 编辑回显字典项 - dictEcho(){ - console.log("form___",this.form) + dictionaryDropDown() { + this.formLoading = false + // 行业 + dictionaryDropDown({ dictionaryCode: '0007' }).then((res) => { + this.industry = res.data + }) + // 课程类别 + dictionaryDropDown({ dictionaryCode: '0006' }).then((res) => { + this.dictCourseType = res.data + }) + // 人员类型 + dictionaryDropDown({ dictionaryCode: '0005' }).then((res) => { + this.dictPerson = res.data + }) + // 标签项 默认选中的多选框 + dictionaryDropDown({dictionaryCode: '0008'}).then((res) => { + const tagList = res.data + console.log(tagList) + for ( let i = 0; i < tagList.length; i++) { + console.log(tagList[i]); + tagList[i].value = tagList[i].value.toString() + } + console.log(tagList) + this.dictCourseTag = tagList + }) }, - - //返回 goback() { @@ -239,11 +243,18 @@ export default { this.previewImage = file.url || file.preview this.previewVisible = true }, + // 处理文件上传,并且获取图片路径 handleChange({ fileList }) { this.fileList = fileList this.fileList.file = fileList[0] this.form.coverPath = this.fileList.file.response.url }, + + //标签选择器 + handleTagChange(value) { + console.log('value------' ,value); + this.form.tags = value; + }, }, } diff --git a/src/views/course/CourseDetail.vue b/src/views/course/CourseDetail.vue index 3adc129..7469c30 100644 --- a/src/views/course/CourseDetail.vue +++ b/src/views/course/CourseDetail.vue @@ -54,6 +54,7 @@ export default { //获取数据字典 dictionaryDropDown() { + this.formLoading = true // 课程类别 dictionaryDropDown({ dictionaryCode: '0006' }).then((res) => { this.dictCourseType = res.data diff --git a/src/views/course/CourseList.vue b/src/views/course/CourseList.vue index e0854dc..3e46e67 100644 --- a/src/views/course/CourseList.vue +++ b/src/views/course/CourseList.vue @@ -43,6 +43,7 @@ \ No newline at end of file diff --git a/src/views/course/CoursewareAddOrUpdate.vue b/src/views/course/CoursewareAddOrUpdate.vue index a158d0c..0523cea 100644 --- a/src/views/course/CoursewareAddOrUpdate.vue +++ b/src/views/course/CoursewareAddOrUpdate.vue @@ -1,154 +1,273 @@ + \ No newline at end of file diff --git a/src/views/course/CoursewareList.vue b/src/views/course/CoursewareList.vue index 5aaa09d..4cad3a3 100644 --- a/src/views/course/CoursewareList.vue +++ b/src/views/course/CoursewareList.vue @@ -44,8 +44,8 @@ export default { columns: [ { title: '课件名称', width: '160px', align: 'center', dataIndex: 'name', key: 'name' }, { title: '课件分类',width: '300px',align: 'center', dataIndex: 'coursewareClassifyId', key: 'coursewareClassifyId',}, - { title: '课时/分', width: '160px', align: 'center', dataIndex: 'hour', key: 'hour' }, - { title: '课件大小', width: '160px', align: 'center', dataIndex: 'coursewareSize', key: 'coursewareSize' }, + { title: '课时/分', width: '160px', align: 'center', dataIndex: 'duration', key: 'duration' }, + { title: '课件大小(MB)', width: '160px', align: 'center', dataIndex: 'sizeStr', key: 'sizeStr'}, { title: '操作', key: 'operation', width: '200px', align: 'center', scopedSlots: { customRender: 'action' } }, ], } @@ -53,7 +53,8 @@ export default { methods: { //新增课件 coursewareAdd(){ - this.$router.push({path:"/course/CoursewareAddOrUpdate",query:{}}) + this.$router.push({path:"/course/CoursewareAddOrUpdate",query:{courseId: this.$route.query.id}}) + console.log('IDIDIDID',this.$route.query.id) }, //返回 diff --git a/src/views/course/question/QuestionAdd.vue b/src/views/course/question/QuestionAdd.vue index a2270b0..48bb8d8 100644 --- a/src/views/course/question/QuestionAdd.vue +++ b/src/views/course/question/QuestionAdd.vue @@ -249,7 +249,6 @@ export default { } else if (this.tabKey === '5') { from = this.CompletionV() if (typeof from == 'boolean' && !from) return - console.log('5---', this.Completion) } from.courseId = this.$route.query.courseId