diff --git a/project/qujing/app/AppQuestionBank/components/Add.vue b/project/qujing/app/AppQuestionBank/components/Add.vue index 49284e16..818cff9b 100644 --- a/project/qujing/app/AppQuestionBank/components/Add.vue +++ b/project/qujing/app/AppQuestionBank/components/Add.vue @@ -1,7 +1,7 @@ @@ -30,32 +37,29 @@ props: { instance: Function, dict: Object, - params: Object, - moduleId: String + params: Object }, data () { return { - info: {}, - id: '' + info: {} } }, created () { - if (this.params && this.params.id) { - this.id = this.params.id + this.dict.load('qjQBType').then(() => { this.getInfo(this.params.id) - } + }) }, methods: { getInfo (id) { - this.instance.post(`/app/appcontentinfo/queryDetailById?id=${id}`).then(res => { + this.instance.post(`/app/appquestionbank/queryDetailById?id=${id}`).then(res => { if (res.code === 0) { - this.info = res.data - this.info.pictureUrl = res.data.pictureUrl ? [{ - url: res.data.pictureUrl - }] : [] + this.info = { + ...res.data, + answer: res.data.items.filter(v => v.checked === '1').map(v => v.content).join(',') + } } }) }, diff --git a/project/qujing/app/AppQuestionBank/components/List.vue b/project/qujing/app/AppQuestionBank/components/List.vue index 06299692..ad66faf4 100644 --- a/project/qujing/app/AppQuestionBank/components/List.vue +++ b/project/qujing/app/AppQuestionBank/components/List.vue @@ -29,7 +29,7 @@ :current.sync="search.current" :size.sync="search.size" @getList="getList"> - +