编辑返回的问题

This commit is contained in:
18571350067 2021-12-29 16:18:32 +08:00
parent d41cd2aa99
commit 21fb3385c8
1 changed files with 13 additions and 13 deletions

View File

@ -14,9 +14,9 @@
</div> </div>
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="标签"> <a-descriptions-item label="标签">
<a-tag color="blue" v-for="(item,index) in detailData.tags" :key="index "> <a-tag color="blue" v-for="(item,index) in detailData.tags" :key="index ">
{{item}} {{item}}
</a-tag> </a-tag>
</a-descriptions-item> </a-descriptions-item>
</a-descriptions> </a-descriptions>
<div class="buttonGroup"> <div class="buttonGroup">
@ -39,7 +39,7 @@ export default {
}, },
dictCourseType: [], dictCourseType: [],
dictCourseTag: [], dictCourseTag: [],
tags:[] // tags: [], //
} }
}, },
created: function () { created: function () {
@ -50,14 +50,14 @@ export default {
}) })
// //
this.dictionaryDropDown() this.dictionaryDropDown()
this.getTagName(); this.getTagName()
}, },
methods: { methods: {
close() { close() {
this.$router.push({ path: '/course/CourseList/'+this.$route.query.type, query: {} }) this.$router.push({ path: '/course/CourseList/' + this.$route.query.type, query: {} })
}, },
edit(record) { edit(record) {
this.$router.push({ path: '/course/CourseAdd', query: { id: this.queryParam.id } }) this.$router.push({ path: '/course/CourseAdd', query: { id: this.queryParam.id, type: this.$route.query.type } })
}, },
// //
@ -78,18 +78,18 @@ export default {
dictionaryDropDown({ dictionaryCode: '0008' }).then((res) => { dictionaryDropDown({ dictionaryCode: '0008' }).then((res) => {
this.dictCourseTag = res.data this.dictCourseTag = res.data
console.log(this.dictCourseTag); console.log(this.dictCourseTag)
let tags = []; let tags = []
for (let i = 0; i < this.dictCourseTag.length; i++) { for (let i = 0; i < this.dictCourseTag.length; i++) {
for (let j = 0; j < this.detailData.courseTags.length; j++) { for (let j = 0; j < this.detailData.courseTags.length; j++) {
if(this.dictCourseTag[i].value == this.detailData.courseTags[j].dictValue){ if (this.dictCourseTag[i].value == this.detailData.courseTags[j].dictValue) {
tags.push(this.dictCourseTag[i].name); tags.push(this.dictCourseTag[i].name)
} }
} }
} }
console.log('tagagagaga',tags); console.log('tagagagaga', tags)
this.detailData.tags = tags; this.detailData.tags = tags
}) })
}, },
}, },