sunlupeng 1 year ago
parent
commit
261223d216
1 changed files with 10 additions and 5 deletions
  1. 10 5
      src/views/HomeView/postInteract/detail.vue

+ 10 - 5
src/views/HomeView/postInteract/detail.vue

@@ -17,7 +17,7 @@
                             <div v-if="item.type == 'SCQ'">
                                 <div class="itemTitle">{{ index + 1 }}. {{ item.description }}(单选)</div>
                                 <el-radio-group v-model="item.comment">
-                                    <el-radio :disabled="data.interactUserStatus == null?false:true" v-for="(childItem, childIndex) in item.options" :key="childIndex"
+                                    <el-radio :disabled="data.interactUserStatus == 0?false:true" v-for="(childItem, childIndex) in item.options" :key="childIndex"
                                         :label="childItem.id">{{ childItem.name }}</el-radio>
                                 </el-radio-group>
                             </div>
@@ -25,16 +25,16 @@
                             <div v-if="item.type == 'MCQ'">
                                 <div class="itemTitle">{{ index + 1 }}. {{ item.description }}(多选)</div>
                                 <el-checkbox-group v-model="item.comment">
-                                    <el-checkbox :disabled="data.interactUserStatus == null?false:true" v-for="(childItem, childIndex) in item.options" :key="childIndex"
+                                    <el-checkbox :disabled="data.interactUserStatus == 0?false:true" v-for="(childItem, childIndex) in item.options" :key="childIndex"
                                         :label="childItem.id">{{ childItem.name }}</el-checkbox>
                                 </el-checkbox-group>
                             </div>
                             <div v-if="item.type == 'SAQ'">
                                 <div class="itemTitle">{{ index + 1 }}. {{ item.description }}(问答)</div>
-                                <el-input :disabled="data.interactUserStatus == null?false:true" type="textarea" :rows="4" placeholder="请输入内容" v-model="item.comment"></el-input>
+                                <el-input :disabled="data.interactUserStatus == 0?false:true" type="textarea" :rows="4" placeholder="请输入内容" v-model="item.comment"></el-input>
                             </div>
                         </div>
-                        <div v-if="data.interactUserStatus == null" class="footBut">
+                        <div v-if="data.interactUserStatus == 0" class="footBut">
                             <el-button style="width: 200px;" type="primary" @click="save()">提交</el-button>
                         </div>
 
@@ -118,10 +118,15 @@ export default {
                 let questions = response.data.data.data;
                 questions.forEach(item => {
                     if (item.type == "MCQ") {
-                        item.comment = [];
+                        if (item.comment) {
+                            item.comment = item.comment.split(',');
+                        }else{
+                            item.comment = [];
+                        }
                     }
                 });
                 this.dataList = questions;
+                console.log(this.dataList);
             }).catch(() => { })
         },
     },