From b475c178133b866e57152560a720b62ac6c0d133 Mon Sep 17 00:00:00 2001 From: zyn Date: Thu, 6 Apr 2023 03:10:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E7=AD=942=E6=97=A0=E6=B3=95=E5=BD=92?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/questionItemInfo.vue | 4 +- .../personal/pages/my-questions/index2.vue | 44 +++++++++++++------ 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/src/pages/personal/pages/my-questions/components/questionItemInfo.vue b/src/pages/personal/pages/my-questions/components/questionItemInfo.vue index a6a033a1e..5965c5d88 100644 --- a/src/pages/personal/pages/my-questions/components/questionItemInfo.vue +++ b/src/pages/personal/pages/my-questions/components/questionItemInfo.vue @@ -87,7 +87,9 @@ export default { this.$preview(attId) } }, - answerChang(){} + answerChang(val){ + this.$emit('answerCheckedChange',this.answer) + } }, mounted () { }, diff --git a/src/pages/personal/pages/my-questions/index2.vue b/src/pages/personal/pages/my-questions/index2.vue index c5ed5ae48..ea96ba414 100644 --- a/src/pages/personal/pages/my-questions/index2.vue +++ b/src/pages/personal/pages/my-questions/index2.vue @@ -24,7 +24,8 @@ + :questionerForm="form" + @answerCheckedChange="answerCheckedChange"> @@ -77,6 +78,16 @@ export default { this.getData() }, methods:{ + answerCheckedChange(answer){ + this.answerList = this.answerList.filter(item=>{ + if(item.askId === answer.id){ + return answer + }else{ + return item + } + }) + this.aiKey++ + }, getData(){ let taskId = this.$route.query.taskIds this.$http.get('lawss/activiti/selectAskId',{ @@ -92,21 +103,26 @@ export default { { _this: this }, res => { - this.form=res.data[0] + if(res.data.length === 0){ + this.dataLoading = false + }else{ + this.form=res.data[0] - if(res.data[1].length){ - res.data[1].forEach(item => { - item.checkedShow = true - if(item.state && item.state === 'yes'){ - item.checked = true - }else { - item.checked = false - } - }) + if(res.data[1].length){ + res.data[1].forEach(item => { + item.checkedShow = true + if(item.state && item.state === 'yes'){ + item.checked = true + }else { + item.checked = false + } + }) + } + + this.answerList = res.data[1] + this.aiKey++ + this.dataLoading = false } - - this.answerList = res.data[1] - this.dataLoading = false }, e => { }) }, e => {