Browse Source

修改bug

修改bug
dangyunlong 3 tháng trước cách đây
mục cha
commit
e41c614878
1 tập tin đã thay đổi với 9 bổ sung3 xóa
  1. 9 3
      src/views/chat/topic.vue

+ 9 - 3
src/views/chat/topic.vue

@@ -65,9 +65,7 @@
             <el-table-column prop="title" label="课题标题" width=""></el-table-column>
             <el-table-column prop="type" label="课题分类" width="">
               <template slot-scope="scope">
-                <div v-if="scope.row.type==1">科研</div>
-                <div v-if="scope.row.type==2">维权</div>
-                <div v-if="scope.row.type==3">讨论</div>
+                <el-option :label="item.label" :value="item.value" v-for="item in topicType"></el-option>
               </template>
             </el-table-column>
             <el-table-column prop="author" label="作者" width=""></el-table-column>
@@ -167,6 +165,14 @@ export default {
       this.$store.dispatch('chat/getTopicsList',this.getApiData).then(res=> {
         this.tableData = res.data.data; //给与内容
         this.allCount = res.data.total; //给与总条数
+        //把数字转换为汉字
+        for(let item of res.data.data){
+          for(let item2 of this.topicType){
+            if(item.type == item2.value){
+              item.type = item2.label;
+            }
+          }
+        }
       }).catch(() => {
         this.$message({
           type: 'warning',