ソースを参照

修改bug

修改bug
dangyunlong 1 ヶ月 前
コミット
867b54de9a
1 ファイル変更10 行追加2 行削除
  1. 10 2
      src/views/chat/topic.vue

+ 10 - 2
src/views/chat/topic.vue

@@ -64,11 +64,11 @@
             <el-table-column fixed prop="id" label="编号" width="50"></el-table-column>
             <el-table-column prop="title" label="课题标题" width=""></el-table-column>
             <el-table-column prop="type" label="课题分类" width="">
-              <template slot-scope="scope">
+              <!-- <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>
-              </template>
+              </template> -->
             </el-table-column>
             <el-table-column prop="author" label="作者" width=""></el-table-column>
             <el-table-column prop="created_at" label="创建时间" width=""></el-table-column>
@@ -167,6 +167,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',