Browse Source

增加聊天

增加聊天
Sean 3 months ago
parent
commit
1404444073
6 changed files with 1103 additions and 1217 deletions
  1. 27 0
      src/api/chat.js
  2. 29 1
      src/store/modules/chat.js
  3. 155 699
      src/views/chat/contacts.vue
  4. 79 182
      src/views/chat/creatTopic.vue
  5. 702 260
      src/views/chat/hall.vue
  6. 111 75
      src/views/chat/topic.vue

+ 27 - 0
src/api/chat.js

@@ -190,6 +190,15 @@ export function updateGroup(data) {
     data
   })
 }
+
+//5.8 编辑群成员
+export function updateGroupMembers(data) {
+  return request({
+    url: '/chat/updateGroupMembers',
+    method: 'post',
+    data
+  })
+}
 //5.群聊 end ------------------------------------->
 
 //6.商圈 start ------------------------------------->
@@ -255,4 +264,22 @@ export function getTopicReply(data) {
     data
   })
 }
+
+//6.8 获取话题分类
+export function topicType(data) {
+  return request({
+    url: '/chat/topicType',
+    method: 'post',
+    data
+  })
+}
+
+//6.9 获取话题状态
+export function topicStatus(data) {
+  return request({
+    url: '/chat/topicStatus',
+    method: 'post',
+    data
+  })
+}
 //6.商圈 end ------------------------------------->

+ 29 - 1
src/store/modules/chat.js

@@ -1,7 +1,8 @@
 import {getTalkSessionList,addFriend,getFriendsList,delFriend,updateFriend,getFriendsApplyList,
   applyFriend,isFriend,getConversation,getChatRecords,addGroup,getGroupMembers,searchFriend,getFriendInfo,
   getGroupList,getGroupInfo,joinGroup,getGroupChatRecords,delGroup,updateGroup,
-  getTopicsList,addTopic,getTopicInfo,updateTopic,delTopic,addReply,getTopicReply
+  getTopicsList,addTopic,getTopicInfo,updateTopic,delTopic,addReply,getTopicReply,topicType,
+  topicStatus,updateGroupMembers
 } from '@/api/chat'
 
 const state = {
@@ -214,6 +215,15 @@ const actions = {
       })
     })
   },
+  updateGroupMembers({commit},data) {
+    return new Promise((resolve, reject) => {
+      updateGroupMembers(data).then(response => {
+        resolve(response)
+      }).catch(error => {
+        reject(error)
+      })
+    })
+  },
   //5.群聊 end ------------------------------------->
 
   //6.商圈 start ------------------------------------->
@@ -279,6 +289,24 @@ const actions = {
         reject(error)
       })
     })
+  },
+  topicType({commit},data) {
+    return new Promise((resolve, reject) => {
+      topicType(data).then(response => {
+        resolve(response)
+      }).catch(error => {
+        reject(error)
+      })
+    })
+  },
+  topicStatus({commit},data) {
+    return new Promise((resolve, reject) => {
+      topicStatus(data).then(response => {
+        resolve(response)
+      }).catch(error => {
+        reject(error)
+      })
+    })
   }
   //6.商圈 end ------------------------------------->
 }

File diff suppressed because it is too large
+ 155 - 699
src/views/chat/contacts.vue


+ 79 - 182
src/views/chat/creatTopic.vue

@@ -5,11 +5,15 @@
       <el-form :model="form" ref="form" :rules="formRules" label-position="left" label-width="120px">
         <div class="formDiv">
           <div>
-            <el-form-item label="课题名称:" prop="cat_arr_id" class="custom-align-right">
-              <el-cascader :key="parentKey" v-model="form.cat_arr_id" placeholder="请选择课题名称" :props="parentData" filterable clearable></el-cascader>
+            <el-form-item label="课题分类:" prop="type" class="custom-align-right">
+              <el-select v-model="form.type" placeholder="请选择课题分类..">
+                <!-- <el-option label="科研" value="1"></el-option>
+                <el-option label="维权" value="2"></el-option> -->
+                <el-option :label="item.label" :value="item.value" v-for="item in topicType"></el-option>
+              </el-select>
             </el-form-item>  
-            <el-form-item label="课题标题:" prop="keyword" class="custom-align-right">
-              <el-input v-model="form.keyword" autocomplete="off" placeholder="请输入资讯关键词"></el-input>
+            <el-form-item label="课题标题:" prop="title" class="custom-align-right">
+              <el-input v-model="form.title" autocomplete="off" placeholder="请输入课题标题"></el-input>
             </el-form-item>
             <div class="QuillTitle">
               <span>* </span>课题内容:
@@ -17,7 +21,7 @@
                 {{ showHtml ? '切换到编辑模式' : '切换到源码模式' }}
               </div>
             </div>
-            <el-form-item label="" prop="content">
+            <el-form-item label="">
               <div class="editor-container">
                 <div v-if="showHtml">
                   <textarea v-model="editorHtml" style="width: 100%; height: 400px;"></textarea>
@@ -29,18 +33,18 @@
                 <input type="file" ref="multiFileInput" @change="handleMultipleFiles" multiple hidden accept="image/jpeg, image/png" />
               </div>
             </el-form-item>
-            <el-form-item label="建立群聊:" prop="is_original" class="custom-align-right">
-              <el-radio-group v-model="form.is_original">
-                <el-radio :label="1">是</el-radio>
-                <el-radio :label="0">否</el-radio>
+            <el-form-item label="建立群聊:" prop="is_group" class="custom-align-right">
+              <el-radio-group v-model="form.is_group" :disabled="groupStatus">
+                <el-radio :label="'1'">是</el-radio>
+                <el-radio :label="'0'">否</el-radio>
               </el-radio-group>
             </el-form-item>
             <div>
-              <el-form-item label="群聊名称:" prop="copyfrom" class="custom-align-right">
-                <el-input v-model="form.copyfrom" autocomplete="off" placeholder="请输入来源名称"></el-input>
+              <el-form-item label="群聊名称:" prop="group_name" class="custom-align-right" v-if="form.is_group=='1'">
+                <el-input v-model="form.group_name" autocomplete="off" placeholder="请输入群聊名称" :disabled="groupStatus"></el-input>
               </el-form-item>
-              <el-form-item label="作者:" prop="linkurl" class="custom-align-right">
-                <el-input v-model="form.linkurl" autocomplete="off" placeholder="请输入来源链接"></el-input>
+              <el-form-item label="作者:" class="custom-align-right">
+                <el-input v-model="form.author" autocomplete="off" placeholder="请输入作者名"></el-input>
               </el-form-item>
             </div>
           </div>
@@ -49,8 +53,8 @@
     </div>
     <div class="bottomBtnBox">
       <el-button type="info" @click="returnPage">返回</el-button>
-      <el-button type="primary" @click="editToServe" v-if="editStatus==true">确定</el-button>
-      <el-button type="primary" @click="addToServe" v-else>发布</el-button>
+      <el-button type="primary" @click="editToServe" v-if="editStatus==true">修改</el-button>
+      <el-button type="primary" @click="addToServe" v-else>创建</el-button>
     </div>
   </div>
 </template>
@@ -96,54 +100,27 @@ export default {
     //0.全局操作 end ------------------------------------------------------------>
     return {
       //1.表单项 start ------------------------------------------------------------>
-      editStatus:false,
+      editStatus:false,//是否为编辑状态
+      groupStatus:false,//是否可以编辑群信息
       tableDivTitle:"编辑课题",
       disclaimer:true,//免责声明
       //提交表单
       form: {
-        //1.1使用了外链
-        title: '',//资讯标题
-        islink:0,//是否使用外链 0非 1是
-        linkurl:"",//外链地址
-        //1.2没有使用外链
-        cat_arr_id:'',//导航池名称
-        level:"",//推荐等级
-        imgurl:"",//缩略图
-        keyword:"",//关键词
-        introduce:"",//描述
+        type:"",//课题分类
+        title:"",//课题标题
         content:"",//内容
+        is_group:"0",//是否创建群聊
+        group_name:"",//群聊名称
         author:"",//作者
-        hits:"",//浏览量
-        is_original:0,//是否为原创 0非 1是
-        copyfrom:"",//来源名称
-        fromurl:"",//来源地址
-        status:0//状态 0待发布 1已发布 404已删除
       },
+      topicType:[],//课题分类
+      topicStatus:[],//课题状态
       //1.2 表单验证规则
       formRules: {
-        //资讯名称不能为空
         title:[{required:true,trigger:'blur',validator:validateEmpty}],
-        //如果使用了外链,外链地址不能为空
-        linkurl:[{required:true,trigger:'blur',validator:validateEmpty}],
-        //导航池名称不能为空
-        cat_arr_id:[{required:true,trigger:'blur',validator:validateArray}],
-        //推荐等级不能为空
-        //level:[{required:true,trigger:'blur',validator:validateEmpty}],
-        //关键词不能为空
-        keyword:[{required:true,trigger:'blur',validator:validateEmpty}],
-        //描述不能为空
-        introduce:[{required:true,trigger:'blur',validator:validateEmpty}],
-        //内容不能为空
-        content:[{required:true,trigger:'blur',validator:validateEmpty}],
-        //作者不能为空
-        author:[{required:true,trigger:'blur',validator:validateEmpty}],
-        //是否原创不能为空
-        is_original:[{required:true,trigger:'blur',validator:validateEmpty}],
-        //来源名称和地址不能为空
-        copyfrom:[{required:true,trigger:'blur',validator:validateEmpty}],
-        fromurl:[{required:true,trigger:'blur',validator:validateEmpty}],
-        //缩略图不能为空
-        imgUrl:[{required:true,trigger:'blur',validator:validateEmpty}]
+        type:[{required:true,trigger:'blur',validator:validateArray}],
+        is_group:[{required:true,trigger:'blur',validator:validateEmpty}],
+        group_name:[{required:true,trigger:'blur',validator:validateEmpty}],
       },
       //1.3富文本编辑器配置
       showHtml: false, //用于保存源码内容
@@ -187,36 +164,6 @@ export default {
           }
         }
       },
-      //1.4图片上传
-      imgUrl:"",//在页面上显示缩略图
-      //获取父级导航池
-      parentKey:0,//获取父级导航
-      parentData: {
-        checkStrictly: true,
-        lazy: true,
-        async lazyLoad (node, resolve) {
-          const { level, data } = node;
-          if (data && data.children && data.children.length !== 0) {
-            return resolve(node)
-          }
-          console.log(level)
-          let parentId = level == 0 ? 0 : data.value
-          let parames = {
-            'pid':parentId
-          }
-          self.$store.dispatch('pool/categoryList',parames).then(res=> {
-            if (res.data) {
-              const nodes = res.data.map(item => ({
-                value: item.id,
-                label: item.name,
-                leaf: level >= 3,
-                children: []
-              }))
-              resolve(nodes)
-            }
-          })
-        }
-      },
       //表单项 end ------------------------------------------------------------>
     };
   },
@@ -250,32 +197,22 @@ export default {
           message: '网络错误,请重试!'
         });
       })
-
       // 阻止默认的上传行为
       return false;
     },
     //1.2 提交表单
     addToServe(){
-      //提交之前先判断是否为外链
-      //如果使用了外链,清理掉除了外链以外的内容
-      if(this.form.islink==true){
-        this.form.islink = 1;
-        this.cleatForm(1)
-      }else{
-        this.form.islink = 0;
-      }
-
       //先进行验证
       this.$refs.form.validate(valid => {
         if (valid) {
           //console.log(this.form)
-          this.$store.dispatch('news/addArticle',this.form).then(res=> {
+          this.$store.dispatch('chat/addTopic',this.form).then(res=> {
             //汇报结果
             this.$message({
               type: 'success',
-              message: '已成功添加资讯!'
+              message: '已成功创建商圈!'
             });
-            this.cleatForm(2);
+            this.cleatForm();
             //返回列表页
             this.returnPage()
           }).catch(() => {
@@ -288,47 +225,38 @@ export default {
       })
     },
     //1.3 清理表单
-    cleatForm(type){
-      if(type==1){
-        //使用了外链,进行部分表单清理
-        //this.form.cat_arr_id = "";
-        this.form.level = "";
-        this.form.imgurl = "";
-        this.form.keyword = "";
-        this.form.introduce = "";
-        this.form.content = "";
-        //this.form.author = "";
-        this.form.hits = "";
-        this.form.is_original = "";
-        this.form.copyfrom = "";
-        this.form.fromurl = "";
-        this.form.status = "";
-      }
-      if(type==2){
-        //完全清理表单
-        this.form.title = "";
-        this.form.islink = "";
-        this.form.linkurl = "";
-        this.form.cat_arr_id = "";
-        this.form.level = "";
-        this.form.imgurl = "";
-        this.form.keyword = "";
-        this.form.introduce = "";
-        this.form.content = "";
-        this.form.author = "";
-        this.form.hits = "";
-        this.form.is_original = "";
-        this.form.copyfrom = "";
-        this.form.fromurl = "";
-        this.form.status = "";
-      }
+    cleatForm(){
+      this.form.type = "";
+      this.form.title = "";
+      this.form.content = "";
+      this.form.is_group = "";
+      this.form.group_name = "";
+      this.form.author = "";
+    },
+    //1.4 查询商圈分类
+    getTopicType(){
+      this.$store.dispatch('chat/topicType',this.getApiData).then(res=> {
+        this.topicType = res.data;
+        console.log(this.topicType)
+      }).catch(() => {
+        this.$message.error("查询商圈分类失败!");
+      })
+    },
+    //1.5 查询商圈状态
+    getTopicStatus(){
+      this.$store.dispatch('chat/topicStatus',this.getApiData).then(res=> {
+        this.topicStatus = res.data;
+        console.log(res)
+      }).catch(() => {
+        this.$message.error("查询商圈状态失败!");
+      })
     },
     //提交表单 end ------------------------------------------------------------>
 
     //2.跳转操作 start ------------------------------------------------------------>
     returnPage(){
       this.$router.push({
-        path: '/articleList',
+        path: '/topic',
       });
     },
     //跳转操作 end ------------------------------------------------------------>
@@ -337,50 +265,20 @@ export default {
     //3.1回显数据
     getMainData() {
       let data = {
-        id: this.$route.query.id
+        id: this.$route.query.id + ""
       };
-      this.$store.dispatch('news/getArticleInfo', data).then(res => {
+      this.$store.dispatch('chat/getTopicInfo', data).then(res => {
         console.log(res);
         this.form.title = res.data.title;
-        //判断是否使用了外链
-        if(res.data.islink==1){
-          this.form.islink = true;
-        }else{  
-          this.form.islink = false;
-        }
-        //不是原创的时候显示来源
-        if(res.data.is_original==1){
-          this.form.is_original = 1;
-        }else{
-          this.form.is_original = 0;
-          this.$nextTick(() => {
-            this.form.is_original = 0;
-            console.log('is_original:', this.form.is_original); // 确保值已更新
-          });
-          // <el-radio v-model="form.is_original" label="1">是</el-radio>
-          // <el-radio v-model="form.is_original" label="0">不是</el-radio>
-          this.form.linkurl = res.data.linkurl;
-        }
-        
-
-
-        // 回显导航池
-        this.form.cat_arr_id = Array.isArray(res.data.cat_arr_id) ? res.data.cat_arr_id : JSON.parse(res.data.cat_arr_id);
-        this.parentKey += 1; // 触发级联选择器重新加载
-        this.loadCascaderPath(this.form.cat_arr_id); // 加载路径数据
-
-        this.form.level = res.data.level;
-        this.form.imgurl = res.data.imgurl;
-        this.imgUrl = res.data.imgurl;
-        this.form.keyword = res.data.keyword;
-        this.form.introduce = res.data.introduce;
+        this.form.type = res.data.type;
         this.form.content = res.data.content;
-        this.form.author = res.data.author;
-        this.form.hits = res.data.hits;
-        this.form.is_original = res.data.is_original;
-        this.form.copyfrom = res.data.copyfrom;
-        this.form.fromurl = res.data.fromurl;
-        this.form.status = res.data.status;
+        this.form.is_group = res.data.is_group;
+        this.form.group_name = res.data.group_name;
+        this.form.author = res.data.user_name;
+        //如果已经创建了群聊,阻止其修改
+        if(res.data.is_group=="1"){
+          this.groupStatus = true;
+        }
       }).catch(() => {
         this.$message({
           type: 'info',
@@ -411,24 +309,19 @@ export default {
     },
     //1.3提交修改
     editToServe(){
-      //提交之前先判断是否为外链
-      //如果使用了外链,清理掉除了外链以外的内容
-      if(this.form.islink==1){
-        this.cleatForm(1)
-      }
       //添加要修改的id
-      this.form.id = this.editId;
+      this.form.id = this.editId + "";
       //先进行验证
       this.$refs.form.validate(valid => {
         if (valid) {
           //console.log(this.form)
-          this.$store.dispatch('news/updateArticle',this.form).then(res=> {
+          this.$store.dispatch('chat/updateTopic',this.form).then(res=> {
             //汇报结果
             this.$message({
               type: 'success',
-              message: '已成功添加资讯!'
+              message: '已成功修改课题信息!'
             });
-            this.cleatForm(2);
+            this.cleatForm();
             //返回列表页
             this.returnPage()
           }).catch(() => {
@@ -549,15 +442,19 @@ export default {
 
   },
   mounted(){
+    //查询课题分类
+    this.getTopicType();
+
+    this.form.author = this.$store.state.user.name;
     //1.判断是新建还是回显
     if(this.$route.query.id!=undefined){
       this.editId = this.$route.query.id;
       this.editStatus = true;
-      console.log("编辑新闻!")
+      console.log("编辑商圈!")
       this.getMainData();
     }else{
       this.editStatus = false;
-      console.log("添加新闻!")
+      console.log("新建商圈!")
     }
 
     //复制内容到富文本 start ------------------------------------------------------------>

File diff suppressed because it is too large
+ 702 - 260
src/views/chat/hall.vue


+ 111 - 75
src/views/chat/topic.vue

@@ -7,19 +7,23 @@
           <el-col :span="8">
             <div class="searchBox">
               <div class="searchTitle">课题标题:</div>
-              <el-input placeholder="请输入资讯题目" autocomplete="off" v-model="getApiData.title"/>
+              <el-input placeholder="请输入课题标题" autocomplete="off" v-model="getApiData.title"/>
             </div>
           </el-col>
           <el-col :span="8">
             <div class="searchBox">
               <div class="searchTitle">课题分类:</div>
-              <el-input placeholder="请输入导航池名称" autocomplete="off" v-model="getApiData.category_name"/>
+              <el-select v-model="getApiData.type" placeholder="请选择课题分类..">
+                <!-- <el-option label="科研" value="1"></el-option>
+                <el-option label="维权" value="2"></el-option> -->
+                <el-option :label="item.label" :value="item.value" v-for="item in topicType"></el-option>
+              </el-select>
             </div>
           </el-col>
           <el-col :span="8">
             <div class="searchBox">
               <div class="searchTitle">作者:</div>
-              <el-input placeholder="请输入作者姓名" autocomplete="off" v-model="getApiData.author"/>
+              <el-input placeholder="请输入作者姓名" autocomplete="off" v-model="getApiData.nickname"/>
             </div>
           </el-col>
         </el-row>
@@ -29,9 +33,11 @@
           <el-col :span="8">
             <div class="searchBox">
               <div class="searchTitle">审核状态:</div>
-              <el-select v-model="getApiData.islink" placeholder="请选择..">
-                <el-option label="否" value="0"></el-option>
-                <el-option label="是" value="1"></el-option>
+              <el-select v-model="getApiData.status" placeholder="请选择审核状态..">
+                <!-- <el-option label="待审核" value="1"></el-option>
+                <el-option label="已通过" value="2"></el-option>
+                <el-option label="已拒绝" value="3"></el-option> -->
+                <el-option :label="item.label" :value="item.value" v-for="item in topicStatus"></el-option>
               </el-select>
             </div>
           </el-col>
@@ -57,28 +63,29 @@
           <el-table :data="tableData" style="width: 100%">
             <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="category_name" label="课题分类" width=""></el-table-column>
-            <el-table-column prop="islink" label="作者" width=""></el-table-column>
-            <el-table-column prop="fromurl" label="创建时间" width=""></el-table-column>
-            <el-table-column prop="author" 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>
+              </template>
+            </el-table-column>
+            <el-table-column prop="user_name" label="作者" width=""></el-table-column>
+            <el-table-column prop="created_at" label="创建时间" width=""></el-table-column>
+            <el-table-column prop="updated_at" label="修改时间" width=""></el-table-column>
             <el-table-column prop="status" label="状态" width="">
               <template slot-scope="scope">
-                <span v-if="scope.row.status==404">404</span>
-                <el-switch
-                  v-else
-                  v-model="scope.row.status"
-                  :active-value="1"
-                  :inactive-value="0"
-                  @change="upRow(scope.row.id,scope.row.status)"
-                ></el-switch>
+                <div v-if="scope.row.status==1" class="status1">待审核</div>
+                <div v-if="scope.row.status==2" class="status2">已通过</div>
+                <div v-if="scope.row.status==3" class="status3">已拒绝</div>
               </template>
             </el-table-column>
             <el-table-column fixed="right" label="操作" width="280" header-align="center">
               <template slot-scope="scope">
                 <div class="listBtnBox">
-                  <div class="listDeleteBtn" @click="deleteRow(scope.row.id, tableData)"><i class="el-icon-delete"></i>移除</div>
-                  <div class="listEditBtn" @click="goEdit(scope.row.id, tableData)"><i class="el-icon-edit-outline"></i>编辑</div>
-                  <div class="listMainBtn" @click="auditStatus=true"><i class="el-icon-edit-outline"></i>审核</div>
+                  <div class="listDeleteBtn" @click="deleteRow(scope.row.id)"><i class="el-icon-delete"></i>删除</div>
+                  <div class="listEditBtn" @click="goEdit(scope.row.id)"><i class="el-icon-edit-outline"></i>编辑</div>
+                  <div class="listMainBtn" @click="openEditWindow(scope.row.id)"><i class="el-icon-edit-outline"></i>审核</div>
                 </div>
               </template>
             </el-table-column>
@@ -100,20 +107,19 @@
     <!--审核状态弹出框 start------------------------------------------------------------>
     <el-dialog :visible.sync="auditStatus" title="审核状态" :close-on-click-modal="false" width="420px">
       <div>
-        <div>
-          <el-radio-group v-model="radio">
-            <el-radio :label="1">通过</el-radio>
-            <el-radio :label="2">拒绝</el-radio>
+        <div class="contentBox">
+          <el-radio-group v-model="form.radio">
+            <el-radio :label="2">通过</el-radio>
+            <el-radio :label="3">拒绝</el-radio>
           </el-radio-group>
         </div>
         <div class="footerButtonBox">
-          <el-button type="info">取消</el-button>
-          <el-button type="primary">确定</el-button>
+          <el-button type="info" @click="auditStatus = false">取消</el-button>
+          <el-button type="primary" @click="editStatus">确定</el-button>
         </div>
       </div>
     </el-dialog>
     <!--审核状态弹出框 end------------------------------------------------------------>
-
   </div>
 </template>
 
@@ -130,18 +136,24 @@ export default {
   data() {
     return {
       //1.列表和分页相关 start ------------------------------------------------------------>
-      tableDivTitle:"资讯列表",
+      tableDivTitle:"课题列表",
       tableData:[],//内容
       editId:0,//要修改的网站id
+      topicType:[],//课题分类
+      topicStatus:[],//课题状态
       getApiData:{
+        title:"",//标题
+        type:"",//课题分类
+        nickname:"",//作者
+        status:"",//审核状态
         page:1,//当前是第几页
         page_size:10,//一共多少条
       },
       allCount:0,//总条数
-      form:{
-        radio:1 //1=通过 2=拒绝
-      },
       auditStatus:false,//审核状态弹出框
+      form:{
+        radio:2 //1=通过 2=拒绝
+      }
       //分页相关 end ------------------------------------------------------------>
     }
   },
@@ -153,20 +165,8 @@ export default {
         this.getApiData.page = 1;
       }
       this.$store.dispatch('chat/getTopicsList',this.getApiData).then(res=> {
-        console.log(res)
-        //格式化:islink=0为不使用外面 islink=1为使用外链
-        //status=1为显示 status=2为不显示
-        // let data = [];
-        // for(let item of res.data.rows){
-        //   // if(item.status==0){item.status="隐藏"}
-        //   // if(item.status==1){item.status="显示"}
-        //   // if(item.status==404){item.status="已删除"}
-        //   if(item.islink==0){item.islink="否"}
-        //   if(item.islink==1){item.islink="是"}
-        //   data.push(item)
-        // }
-        // this.tableData = res.data.rows; //给与内容
-        // this.allCount = res.data.count; //给与总条数
+        this.tableData = res.data.data; //给与内容
+        this.allCount = res.data.total; //给与总条数
       }).catch(() => {
         this.$message({
           type: 'warning',
@@ -174,7 +174,7 @@ export default {
         });
       })
     },
-    //1.2 删除内容
+    //1.2 删除商圈
     deleteRow(id){
       this.$confirm('此操作将永久删除该条数据, 是否继续?', '提示', {
         confirmButtonText: '确定',
@@ -182,7 +182,10 @@ export default {
         type: 'warning'
       }).then(() => {
         console.log("当前删除:" + id)
-        this.$store.dispatch('news/delArticle',{id:id}).then(res=> {
+        let data = {
+          id:id+""
+        }
+        this.$store.dispatch('chat/delTopic',data).then(res=> {
           this.getData();
           this.$message({
             type: 'success',
@@ -201,26 +204,6 @@ export default {
         });
       });
     },
-    //1.3 修改网站状态
-    upRow(id,status){
-      let data = {
-        id:id,
-        status:status
-      }
-      this.$store.dispatch('news/upArticleStatus',data).then(res=> {
-        if(res.code==200){
-          this.$message({
-            type: 'success',
-            message: '资讯状态已修改!'
-          });
-        }
-      }).catch(() => {
-        this.$message({
-          type: 'warning',
-          message: '已取消删除'
-        });
-      });
-    },
     //1.4 列表内容分页
     //直接跳转
     handleSizeChange(val) {
@@ -236,17 +219,34 @@ export default {
     clearSearchList(){
       this.tableData = [];
       this.getApiData.title = "";
-      this.getApiData.category_name = "";
-      this.getApiData.author = "";
-      this.getApiData.islink = "";
+      this.getApiData.type = "";
+      this.getApiData.nickname = "";
       this.getApiData.status = "";
       this.getApiData.page = 1;
       this.getApiData.pageSize = 10;
       this.getData();
     },
+    //1.7 查询商圈分类
+    getTopicType(){
+      this.$store.dispatch('chat/topicType',this.getApiData).then(res=> {
+        this.topicType = res.data;
+        console.log(this.topicType)
+      }).catch(() => {
+        this.$message.error("查询商圈分类失败!");
+      })
+    },
+    //1.8 查询商圈状态
+    getTopicStatus(){
+      this.$store.dispatch('chat/topicStatus',this.getApiData).then(res=> {
+        this.topicStatus = res.data;
+        console.log(res)
+      }).catch(() => {
+        this.$message.error("查询商圈状态失败!");
+      })
+    },
     //列表和分页相关 end ------------------------------------------------------------>
 
-    //2.添加新闻 start ------------------------------------------------------------>
+    //2.添加商圈 start ------------------------------------------------------------>
     //跳转到资讯发布页面
     goCreat(){
       this.$router.push({
@@ -261,16 +261,52 @@ export default {
         path: '/creatTopic',
         query: data
       });
-    }
-    //添加新闻 end ------------------------------------------------------------>
+    },
+    //添加商圈 end ------------------------------------------------------------>
+
+    //3.审核 start ------------------------------------------------------------>
+    openEditWindow(id){
+      this.editId = id;
+      this.auditStatus = true;
+    },
+    editStatus(){
+      let data = {
+        id:this.editId + "",
+        status:this.form.radio + ""
+      }
+      this.$store.dispatch('chat/updateTopic',data).then(res=> {
+        console.log(res)
+        this.getData();
+        this.auditStatus = false;
+      });
+    },
+    //3.审核 end ------------------------------------------------------------>
   },
   mounted(){
     //1.获得初始数据
     this.getData();
+    //2.查询课题分类
+    this.getTopicType();
+    // //3.查询课题状态
+    this.getTopicStatus();
   }
 }
 </script>
 
 <style scoped lang="less">
-
+  .contentBox {
+    padding: 0 0 20px 0;
+  }
+  .footerButtonBox {
+    text-align: right;
+  }
+  .status1 {
+    color: #F19655;
+  }
+  .status2 {
+    color: #519C66;
+  }
+  .status3 {
+    color: #CC5F5F;
+  }
 </style>

Some files were not shown because too many files changed in this diff