Bläddra i källkod

提交 群聊完成

1
mo 3 år sedan
förälder
incheckning
a58895d4b1

+ 8 - 0
src/constant/index.js

@@ -479,6 +479,14 @@ export const catgGoupType = {
   TRAINING:'训练营'
 }
 
+export const catType = {
+  MUSIC:'乐团群',
+  CLASS:'班级群',
+  REPERTOIRE_PLAY:'曲目演奏课',
+  TRAINING:'训练营'
+}
+
+
 export const catRole = {
   '指导老师':'指导老师',
   '乐队指导':'乐队指导',

+ 2 - 0
src/router/index.js

@@ -556,6 +556,8 @@ export const asyncRoutes = {
   memberShareList:()=>import('@/views/agentManager/memberShareList'),
   // 群组管理
   groupChatManager:()=>import('@/views/groupChatManager'),
+  // 群聊公告
+  sysGroupCat:()=>import('@/views/groupChatManager/sysGroupCat'),
   // 小小艺术家训练营
   littleArtistCamp:()=>import('@/views/littleArtistCamp'),
   liveShopManger:()=>import('@/views/liveShopManger'),

+ 1 - 0
src/router/notKeepAliveList.js

@@ -124,4 +124,5 @@ export default [
   '/agentList',
   '/groupChatManager', // 群组管理
   '/littleArtistCamp', // 小小艺术家训练营
+  '/sysGroupCat'
 ]

+ 3 - 1
src/utils/searchArray.js

@@ -24,7 +24,8 @@ import {
   feedbackTypeDesc,
   campState,
   catgGoupType,
-  catRole
+  catRole,
+  catType
 } from '../constant'
 // 课程类型
 let tenantConfig = sessionStorage.getItem('tenantConfig')
@@ -814,6 +815,7 @@ export const feedbackTypeDescList = getValueForKey(feedbackTypeDesc)
 export const campStateList = getValueForKey(campState)
 export const catgGoupTypeList =  getValueForKey(catgGoupType)
 export const catRoleList = getValueForKey(catRole)
+export const catTypeList = getValueForKey(catType)
 //downListType
 function getValueForKey(obj) {
   let arr = []

+ 61 - 0
src/views/groupChatManager/api.js

@@ -163,3 +163,64 @@ export function addGroupMember(data) {
 }
 
 
+// 删除成员(退群)
+export function quitGroupMember(data) {
+  return request({
+    url: api + '/imGroup/quitGroup',
+    method: 'post',
+    params: data,
+    data: qs.stringify(data)
+  })
+}
+
+
+// 修改群成员信息
+export function resetGroupMemberRoleType(data) {
+  return request({
+    url: api + '/imGroup/updateRoleType',
+    method: 'post',
+    params: data,
+    data: qs.stringify(data)
+  })
+}
+
+// 添加群聊
+export function createGroup(data) {
+  return request({
+    url: api + '/imGroup/createGroup',
+    method: 'post',
+    // params: data, : qs.stringify(data)
+    data
+  })
+}
+
+
+// 解散群组
+export function dismissGroup(data) {
+  return request({
+    url: api + '/imGroup/dismissGroup',
+    method: 'post',
+    // params: data, : qs.stringify(data)
+    data
+  })
+}
+
+
+export function getSysGroupList(data) {
+  return request({
+    url: api + '/imSendGroupMessage/queryGroupAll',
+    method: 'POST',
+    // params: data,
+    requestType: 'form',
+    data
+  })
+}
+export function getSysGroupList1(data) {
+  return request({
+    url: api + '/imSendGroupMessage/queryGroupAll1',
+    method: 'POST',
+    // params: data,
+    requestType: 'form',
+    data
+  })
+}

+ 89 - 23
src/views/groupChatManager/chatDetail.vue

@@ -59,8 +59,13 @@
         </el-form-item>
       </save-form>
       <div class="bWrap">
-        <el-button type="primary" @click="addMembers">添加成员</el-button>
-        <el-button type="danger">删除成员</el-button>
+        <!--  -->
+        <auth auths="imGroupMember/addGroupMember">
+          <el-button type="primary" @click="addMembers">添加成员</el-button>
+        </auth>
+        <auth auths="imGroup/quitGroup" style="margin-left:10px;">
+          <el-button type="danger" @click="deteleMembers">移除成员</el-button>
+        </auth>
       </div>
       <div class="tableWrap">
         <el-table
@@ -88,24 +93,26 @@
             prop="user.phone"
             label="手机号"
           ></el-table-column>
-          <el-table-column
-            align="center"
-            prop="roleType"
-            label="角色"
-          ></el-table-column>
+          <el-table-column align="center" prop="roleType" label="角色">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.roleType ? scope.row.roleType : "学员" }}
+              </div>
+            </template>
+          </el-table-column>
           <el-table-column align="center" prop="roleType" label="操作">
             <template slot-scope="scope">
               <div>
                 <auth
-                  auths="imSendGroupMessage/update"
-                  v-if="!scope.row.sendFlag"
+                  auths="imGroup/updateRoleType"
+                  v-if="scope.row.roleType"
                 >
-                  <el-button type="text" @click="resetGroup(scope.row)"
+                  <el-button type="text" @click="resetroleType(scope.row)"
                     >修改角色</el-button
                   >
                 </auth>
                 <auth
-                  auths="imSendGroupMessage/delete"
+                  auths="imGroup/quitGroup"
                   v-if="!scope.row.sendFlag"
                 >
                   <el-button type="text" @click="deleteStudent(scope.row)"
@@ -126,8 +133,9 @@
         />
       </div>
     </div>
-      <eidtCatInfo ref="eidtCatInfo" @getList="getList" />
-      <addMember ref="addMember" @getList="getList" />
+    <eidtCatInfo ref="eidtCatInfo" @getList="getList" />
+    <addMember ref="addMember" @getList="getList" />
+    <resetRoleType ref="resetRoleType" @getList="getList" />
   </div>
 </template>
 
@@ -136,15 +144,22 @@ import axios from "axios";
 import { getToken } from "@/utils/auth";
 import pagination from "@/components/Pagination/index";
 import load from "@/utils/loading";
-import { getGroupMemberList, getGroupDetail } from "./api";
+import { getGroupMemberList, getGroupDetail, quitGroupMember } from "./api";
 import { getSubject } from "@/api/buildTeam";
 import countTo from "vue-count-to";
 import { catRoleList } from "@/utils/searchArray";
 import eidtCatInfo from "./model/eidtCatInfo";
-import addMember from './model/addMember'
+import resetRoleType from "./model/resetRoleType";
+import addMember from "./model/addMember";
 // catRoleFilter
 export default {
-  components: { pagination, "count-to": countTo ,eidtCatInfo,addMember},
+  components: {
+    pagination,
+    "count-to": countTo,
+    eidtCatInfo,
+    addMember,
+    resetRoleType,
+  },
   data() {
     return {
       catRoleList,
@@ -297,16 +312,67 @@ export default {
     onCancel() {
       this.$store.dispatch("delVisitedViews", this.$route);
       this.$router.push({
-        path: "/childrensDay",
+        path: "/groupChatManager",
       });
     },
-    deleteStudent(row) {},
-    reseDetail(type){
-        this.$refs.eidtCatInfo.openResetDioag(this.detail,type);
+    async deleteStudent(row) {
+      try {
+        await this.$confirm(
+          `是否确认移除成员 "${row.user.username}" ?`,
+          "提示",
+          {
+            type: "warning",
+          }
+        );
+        await quitGroupMember({
+          imGroupId: this.$route.query.imGroupId,
+          userId: row.userId,
+        });
+        this.$message.success("移除成功");
+        this.getList();
+      } catch (error) {
+        console.log(error);
+      }
+    },
+    reseDetail(type) {
+      this.$refs.eidtCatInfo.openResetDioag(this.detail, type);
+    },
+    addMembers() {
+      this.$refs.addMember.openDioag();
+    },
+    async deteleMembers() {
+      if (!this.chioseIdList || this.chioseIdList.length <= 0) {
+        this.$message.error(`请至少选择一位${str}`);
+        return;
+      }
+      try {
+        let idList = this.chioseIdList
+          .map((group) => {
+            return group.userId;
+          })
+          .join(",");
+        let strName = this.chioseIdList
+          .map((group) => {
+            return group.user.username;
+          })
+          .join(",");
+        strName.substring(0, strName.length - 1);
+        await this.$confirm(`是否确认移除成员 "${strName}" ?`, "提示", {
+          type: "warning",
+        });
+        await quitGroupMember({
+          imGroupId: this.$route.query.imGroupId,
+          userId: idList,
+        });
+        this.$message.success("移除成功");
+        this.getList();
+      } catch (error) {
+        console.log(error);
+      }
+    },
+    resetroleType(row) {
+      this.$refs.resetRoleType.openDioag(row);
     },
-    addMembers(){
-      this.$refs.addMember.openDioag()
-    }
   },
 };
 </script>

+ 50 - 17
src/views/groupChatManager/component/chatList.vue

@@ -35,11 +35,19 @@
         <el-button native-type="reset" type="danger">重置</el-button>
       </el-form-item>
     </save-form>
-    <auth auths="imSendGroupMessage/send">
-      <el-button @click="postMsg" type="primary" style="margin-bottom: 20px">
-        消息群发
-      </el-button>
-    </auth>
+    <div class="btnWraps">
+      <auth auths="imSendGroupMessage/send">
+        <el-button @click="postMsg" type="primary" style="margin-bottom: 20px">
+          消息群发
+        </el-button>
+      </auth>
+      <auth auths="imGroup/createGroup">
+        <el-button @click="addChat" type="primary" style="margin-bottom: 20px">
+          创建群聊
+        </el-button>
+      </auth>
+    </div>
+
     <div class="tableWrap">
       <el-table
         style="width: 100%"
@@ -60,6 +68,11 @@
           prop="name"
           label="群聊名称"
         ></el-table-column>
+        <el-table-column
+          align="center"
+          prop="tags"
+          label="群备注"
+        ></el-table-column>
         <el-table-column align="center" prop="groupType" label="群聊类型">
           <template slot-scope="scope">
             <div>
@@ -75,14 +88,14 @@
         <el-table-column align="center" prop="memberNum" label="操作">
           <template slot-scope="scope">
             <div>
-              <!-- <auth auths="imGroup/updateImGroup">
-                <el-button type="text" @click="resetCat(scope.row)"
-                  >修改</el-button
+              <auth auths="/chatDetail">
+                <el-button type="text" @click="gotoCatDetail(scope.row)"
+                  >详情</el-button
                 >
-              </auth> -->
+              </auth>
               <auth auths="imGroup/updateImGroup">
-                <el-button type="text" @click="gotoCatDetail(scope.row)"
-                  >成员管理</el-button
+                <el-button type="text" @click="cancelCat(scope.row)"
+                  >解散</el-button
                 >
               </auth>
             </div>
@@ -100,6 +113,7 @@
     </div>
     <eidtPostMsg ref="eidtPostMsg" @clear="clearCom" />
     <eidtCatInfo ref="eidtCatInfo" @getList="getList" />
+    <addChatForm ref="addChatForm" @getList="getList" />
   </div>
 </template>
 <script>
@@ -108,12 +122,13 @@ import { getToken } from "@/utils/auth";
 import pagination from "@/components/Pagination/index";
 import load from "@/utils/loading";
 import { getTimes } from "@/utils";
-import { getGroupList } from "../api";
+import { getGroupList, dismissGroup } from "../api";
 import { catgGoupTypeList } from "@/utils/searchArray";
 import eidtPostMsg from "../model/eidtPostMsg";
 import eidtCatInfo from "../model/eidtCatInfo";
+import addChatForm from "../model/addChatForm";
 export default {
-  components: { pagination, eidtPostMsg, eidtCatInfo },
+  components: { pagination, eidtPostMsg, eidtCatInfo, addChatForm },
   data() {
     return {
       searchForm: {
@@ -247,10 +262,28 @@ export default {
     resetCat(row) {
       this.$refs.eidtCatInfo.openResetDioag(row);
     },
-    gotoCatDetail(row){
-      this.$router.push({path:'/operateManager/chatDetail',query:{imGroupId:row.id,name:row.name}})
-      console.log(row)
-    }
+    gotoCatDetail(row) {
+      this.$router.push({
+        path: "/operateManager/chatDetail",
+        query: { imGroupId: row.id, name: row.name },
+      });
+      console.log(row);
+    },
+    addChat() {
+      this.$refs.addChatForm.openDioag();
+    },
+    async cancelCat(row) {
+      try {
+        await this.$confirm("是否解散群组" + row.name + "?", "提示", {
+          type: "warning",
+        });
+        const res = await dismissGroup({ imGroupId: row.id });
+        this.$message.success("取消成功");
+        this.getList();
+      } catch (e) {
+        console.log(e);
+      }
+    },
   },
 };
 </script>

+ 279 - 0
src/views/groupChatManager/component/sysChatList.vue

@@ -0,0 +1,279 @@
+<!--  -->
+<template>
+  <div class="m-container">
+    <save-form
+      :inline="true"
+      :model="searchForm"
+      @submit="search"
+      @reset="onReSet"
+    >
+      <el-form-item>
+        <el-input
+          v-model.trim="searchForm.search"
+          clearable
+          @keyup.enter.native="search"
+          placeholder="群聊名称"
+        ></el-input>
+      </el-form-item>
+      <el-form-item prop="groupType">
+        <el-select
+          v-model.trim="searchForm.groupType"
+          clearable
+          filterable
+          placeholder="群聊类型"
+        >
+          <el-option
+            v-for="(item, index) in catgGoupTypeList"
+            :key="index"
+            :value="item.value"
+            :label="item.label"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button native-type="submit" type="primary">搜索</el-button>
+        <el-button native-type="reset" type="danger">重置</el-button>
+      </el-form-item>
+    </save-form>
+    <div class="btnWraps">
+      <auth auths="imSendGroupMessage/send">
+        <el-button @click="postMsg" type="primary" style="margin-bottom: 20px">
+          消息群发
+        </el-button>
+      </auth>
+      <!-- <auth auths="imSendGroupMessage/send">
+        <el-button @click="addChat" type="primary" style="margin-bottom: 20px">
+          创建群聊
+        </el-button>
+      </auth> -->
+    </div>
+
+    <div class="tableWrap">
+      <el-table
+        style="width: 100%"
+        :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+        :data="tableList"
+        @selection-change="handleSelectionChange"
+        @select="onTableSelect"
+        ref="multipleSelection"
+      >
+        <el-table-column type="selection" width="55"> </el-table-column>
+        <el-table-column
+          align="center"
+          prop="id"
+          label="群聊"
+        ></el-table-column>
+        <el-table-column
+          align="center"
+          prop="name"
+          label="群聊名称"
+        ></el-table-column>
+        <el-table-column
+          align="center"
+          prop="tags"
+          label="群备注"
+        ></el-table-column>
+        <el-table-column align="center" prop="groupType" label="群聊类型">
+          <template slot-scope="scope">
+            <div>
+              {{ scope.row.groupType | catgGoupType }}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          prop="memberNum"
+          label="人数"
+        ></el-table-column>
+        <!-- <el-table-column align="center" prop="memberNum" label="操作">
+          <template slot-scope="scope">
+            <div>
+              <auth auths="imGroup/updateImGroup">
+                <el-button type="text" @click="resetCat(scope.row)"
+                  >修改</el-button
+                >
+              </auth>
+              <auth auths="imGroup/updateImGroup">
+                <el-button type="text" @click="gotoCatDetail(scope.row)"
+                  >成员管理</el-button
+                >
+              </auth>
+            </div>
+          </template>
+        </el-table-column> -->
+      </el-table>
+      <pagination
+        sync
+        :total.sync="rules.total"
+        :page.sync="rules.page"
+        :limit.sync="rules.limit"
+        :page-sizes="rules.page_size"
+        @pagination="getList"
+      />
+    </div>
+    <eidtPostMsg ref="eidtPostMsg" @clear="clearCom" />
+    <eidtCatInfo ref="eidtCatInfo" @getList="getList" />
+    <addChatForm ref="addChatForm" @getList="getList" />
+  </div>
+</template>
+<script>
+import axios from "axios";
+import { getToken } from "@/utils/auth";
+import pagination from "@/components/Pagination/index";
+import load from "@/utils/loading";
+import { getTimes } from "@/utils";
+import { getSysGroupList } from "../api";
+import { catgGoupTypeList } from "@/utils/searchArray";
+import eidtPostMsg from "../model/eidtPostMsg";
+import eidtCatInfo from "../model/eidtCatInfo";
+import addChatForm from "../model/addChatForm";
+export default {
+  components: { pagination, eidtPostMsg, eidtCatInfo, addChatForm },
+  data() {
+    return {
+      searchForm: {
+        search: null,
+        groupType: "",
+      },
+      catgGoupTypeList,
+      tableList: [],
+      organList: [],
+      rules: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
+      },
+      addMuiscVisible: false,
+      multipleSelection: [],
+      chioseIdList: [],
+      isNewPage: false,
+    };
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {},
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+    // 获取分部
+
+    this.init();
+  },
+  methods: {
+    init() {
+      this.getList();
+    },
+    async getList() {
+      // let { timer, ...rest } = this.searchForm;
+      // let params = {
+      //   ...rest,
+      //   page: this.rules.page,
+      //   rows: this.rules.limit,
+      //   ...getTimes(timer, ["startTime", "endTime"]),
+      // };
+      try {
+        const res = await getSysGroupList({
+          ...this.searchForm,
+          page: this.rules.page,
+          rows: this.rules.limit,
+        });
+        this.tableList = res.data.rows;
+        this.rules.total = res.data.total;
+        let idList = this.chioseIdList.map((group) => {
+          return group.id;
+        });
+        this.isNewPage = true;
+        this.$nextTick(() => {
+          this.tableList.forEach((course) => {
+            if (idList.indexOf(course.id) != -1) {
+              this.$refs.multipleSelection.toggleRowSelection(course, true);
+            }
+          });
+          this.isNewPage = false;
+        });
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    search() {
+      this.rules.page = 1;
+      this.getList();
+    },
+    onReSet() {
+      this.searchForm.search = "";
+      this.searchForm.groupType = "";
+      this.rules.page = 1;
+      this.getList();
+    },
+    postMsg() {
+      if (!this.chioseIdList || this.chioseIdList.length <= 0) {
+        this.$message.error("请至少选择一个群聊");
+        return;
+      }
+      this.$refs.eidtPostMsg.openDioag(this.chioseIdList,'0');
+    },
+    handleSelectionChange(val) {
+      if (val.length > 0) {
+        this.chioseIdList = this.chioseIdList.concat(val);
+        this.chioseIdList = this.$helpers.lodash.uniqBy(
+          this.chioseIdList,
+          "id"
+        );
+      } else {
+        if (this.isNewPage) return;
+        let idList = this.chioseIdList.map((group) => {
+          return group.id;
+        });
+        this.$nextTick(() => {
+          let tableIdList = [];
+          this.tableList.forEach((group) => {
+            tableIdList.push(group.id);
+            if (idList.indexOf(group.id) != -1) {
+              this.$refs.multipleSelection.toggleRowSelection(group, false);
+            }
+          });
+          this.chioseIdList = this.$helpers.lodash.remove(
+            this.chioseIdList,
+            function (item) {
+              return tableIdList.indexOf(item.id) == -1;
+            }
+          );
+          if (this.chioseIdList.length <= 0) {
+            this.clearCom();
+          }
+        });
+      }
+    },
+    clearCom() {
+      this.chioseIdList = [];
+      this.$refs.multipleSelection.clearSelection();
+    },
+    onTableSelect(rows, row) {
+      let idList = this.chioseIdList.map((group) => {
+        return group.id;
+      });
+      if (idList.indexOf(row.id) != -1) {
+        this.chioseIdList.splice(idList.indexOf(row.id), 1);
+        if (this.chioseIdList.length <= 0) {
+          this.clearCom();
+        }
+      }
+    },
+    resetCat(row) {
+      this.$refs.eidtCatInfo.openResetDioag(row);
+    },
+    gotoCatDetail(row) {
+      this.$router.push({
+        path: "/operateManager/chatDetail",
+        query: { imGroupId: row.id, name: row.name },
+      });
+      console.log(row);
+    },
+    addChat() {
+      this.$refs.addChatForm.openDioag();
+    },
+  },
+};
+</script>
+<style lang='scss' scoped>
+</style>

+ 207 - 0
src/views/groupChatManager/component/sysTimingMsgList.vue

@@ -0,0 +1,207 @@
+<!--  -->
+<template>
+  <div class="m-container">
+    <save-form
+      :inline="true"
+      :model="searchForm"
+      @submit="search"
+      @reset="onReSet"
+    >
+      <el-form-item>
+        <el-select v-model.trim="searchForm.sendType" placeholder="消息类型" clearable>
+          <el-option label="即时发送" value="NOW"></el-option>
+          <el-option label="定时发送" value="TIMING"> </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-select v-model.trim="searchForm.sendFlag" placeholder="状态" clearable>
+          <el-option label="已发送" :value="true"></el-option>
+          <el-option label="未发送" :value="false"> </el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item>
+        <el-button native-type="submit" type="primary">搜索</el-button>
+        <el-button native-type="reset" type="danger">重置</el-button>
+      </el-form-item>
+    </save-form>
+    <div class="tableWrap">
+      <el-table
+        style="width: 100%"
+        :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+        :data="tableList"
+      >
+        <el-table-column align="center" prop="sendTime" label="消息类型">
+          <template slot-scope="scope">
+            {{ scope.row.sendType == "NOW" ? "即时发送" : "定时发送" }}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" prop="sendTime" label="发送时间">
+          <template slot-scope="scope">
+            {{ scope.row.sendTime | dayjsFormat }}
+            {{ scope.row.sendTime | dayjsFormatMinute }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          prop="operator"
+          label="创建人"
+        ></el-table-column>
+        <el-table-column
+          align="center"
+          prop="messageContent"
+          label="发送内容"
+        ></el-table-column>
+        <el-table-column
+          align="center"
+          prop="fileName"
+          label="附件名称"
+        ></el-table-column>
+        <el-table-column align="center" prop="sendFlag" label="状态">
+          <template slot-scope="scope">
+            <div>
+              {{ scope.row.sendFlag ? "已发送" : "未发送" }}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" prop="id" label="操作">
+          <template slot-scope="scope">
+            <div>
+              <auth auths="imSendGroupMessage/queryGroupAll1">
+                <el-button type="text" @click="lookGroup(scope.row)"
+                  >查看群组</el-button
+                >
+              </auth>
+              <auth
+                auths="imSendGroupMessage/update"
+                v-if="!scope.row.sendFlag"
+              >
+                <el-button type="text" @click="resetGroup(scope.row)"
+                  >修改</el-button
+                >
+              </auth>
+              <auth
+                auths="imSendGroupMessage/delete"
+                v-if="!scope.row.sendFlag"
+              >
+                <el-button type="text" @click="deleteGroup(scope.row)"
+                  >删除</el-button
+                >
+              </auth>
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        sync
+        :total.sync="rules.total"
+        :page.sync="rules.page"
+        :limit.sync="rules.limit"
+        :page-sizes="rules.page_size"
+        @pagination="getList"
+      />
+      <lookGroup ref="lookGroup" />
+      <eidtPostMsg ref="eidtPostMsg" />
+    </div>
+  </div>
+</template>
+<script>
+import axios from "axios";
+import { getToken } from "@/utils/auth";
+import pagination from "@/components/Pagination/index";
+import load from "@/utils/loading";
+import { getTimes } from "@/utils";
+import { getGroupMessageList, deteleGroupMessage } from "../api";
+import lookGroup from "../model/lookGroup.vue";
+import eidtPostMsg from "../model/eidtPostMsg";
+export default {
+  components: { pagination, lookGroup, eidtPostMsg },
+  data() {
+    return {
+      searchForm: {
+        sendFlag: null,
+        sendType: "",
+      },
+
+      tableList: [],
+      organList: [],
+      rules: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
+      },
+    };
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {},
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+    // 获取分部
+
+    this.init();
+  },
+  methods: {
+    init() {
+      this.getList();
+    },
+    async getList() {
+      // let { timer, ...rest } = this.searchForm;
+      // let params = {
+      //   ...rest,
+      //   page: this.rules.page,
+      //   rows: this.rules.limit,
+      //   ...getTimes(timer, ["startTime", "endTime"]),
+      // };
+      try {
+        const res = await getGroupMessageList({
+          ...this.searchForm,
+          page: this.rules.page,
+          rows: this.rules.limit,
+          isIncludeSender:0
+        });
+        this.tableList = res.data.rows;
+        this.rules.total = res.data.total;
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    search() {
+      this.rules.page = 1;
+      this.getList();
+    },
+    onReSet() {
+      this.searchForm.sendFlag = null;
+      this.searchForm.sendType = "";
+      this.search();
+    },
+    lookGroup(row) {
+      this.$refs.lookGroup.openDioag(row,'0');
+    },
+    resetGroup(row) {
+      this.$refs.eidtPostMsg.openResetDioag(row,'0');
+    },
+    deleteGroup(row) {
+      // deteleGroupMessage
+      this.$confirm("确定删除?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          deteleGroupMessage({ id: row.id }).then((res) => {
+            if (res.code === 200) {
+              this.$message.success("删除成功");
+              this.getList();
+              // this.routeOrderStatus = false;
+            }
+          });
+        })
+        .catch();
+    },
+  },
+};
+</script>
+<style lang='scss' scoped>
+</style>

+ 1 - 1
src/views/groupChatManager/component/timingMsgList.vue

@@ -67,7 +67,7 @@
         <el-table-column align="center" prop="id" label="操作">
           <template slot-scope="scope">
             <div>
-              <auth auths="musicGroupQuestionnaire/get">
+              <auth auths="imSendGroupMessage/queryGroupPage1">
                 <el-button type="text" @click="lookGroup(scope.row)"
                   >查看群组</el-button
                 >

+ 147 - 0
src/views/groupChatManager/model/addChatForm.vue

@@ -0,0 +1,147 @@
+<template>
+  <div>
+    <el-dialog
+      width="500px"
+      title="新建群聊"
+      :visible.sync="lookVisible"
+      :before-close="onClose"
+    >
+      <el-form :model="formes" label-width="120px" ref="eidtPostMsg">
+        <el-form-item
+          label="群聊名称"
+          :rules="[{ required: true, message: '请输入群聊名称' }]"
+          prop="name"
+        >
+          <el-input class="w100" v-model="formes.name"></el-input>
+        </el-form-item>
+        <el-form-item
+          label="群聊类型"
+          :rules="[{ required: true, message: '请选择群聊类型' }]"
+          prop="groupType"
+        >
+          <el-select
+            class="w100"
+            v-model.trim="formes.groupType"
+            clearable
+            filterable
+            placeholder="群聊类型"
+          >
+            <el-option
+              v-for="(item, index) in catgGoupTypeList"
+              :key="index"
+              :value="item.value"
+              :label="item.label"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item
+          label="群类型"
+          :rules="[{ required: true, message: '请选择群类型' }]"
+          prop="groupType"
+        >
+          <el-select
+            class="w100"
+            v-model.trim="formes.type"
+            clearable
+            filterable
+            placeholder="群聊类型"
+          >
+            <el-option
+              v-for="(item, index) in catTypeList"
+              :key="index"
+              :value="item.value"
+              :label="item.label"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="onClose">取 消</el-button>
+        <el-button type="primary" @click="submitMsg">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { createGroup } from "../api";
+import { catgGoupTypeList,catTypeList } from "@/utils/searchArray";
+export default {
+  name: "eidtPostMsg",
+  data() {
+    return {
+      formes: {
+        id: "",
+        name: "",
+        groupType: "",
+      },
+      catgGoupTypeList,
+      catTypeList,
+      lookVisible: false,
+      chioseIdList: null,
+      activeRow: null,
+      type: "",
+      title: "",
+    };
+  },
+
+  mounted() {
+    this.init();
+  },
+  methods: {
+    init() {},
+    openDioag() {
+      this.lookVisible = true;
+    },
+    openResetDioag(row, type) {
+      this.type = type;
+      if (type == "name") {
+        this.title = "修改群聊名称";
+      } else {
+        this.title = "修改群聊类型";
+      }
+      // this.activeRow = row;
+      this.formes = { ...row };
+      this.lookVisible = true;
+    },
+    onClose() {
+      this.formes = {
+        name: "",
+        groupType: "",
+      };
+      this.$refs["eidtPostMsg"].resetFields();
+      this.lookVisible = false;
+    },
+    submitMsg() {
+      this.$refs.eidtPostMsg.validate(async (flag) => {
+        if (flag) {
+          try {
+            const res = await createGroup({ ...this.formes });
+            this.$message.success("新增成功");
+            this.$emit("getList");
+            this.onClose();
+          } catch (e) {
+            console.log(e);
+          }
+        }
+      });
+    },
+    getName(val) {
+      this.formes.fileName = val.data.name;
+    },
+    payDate() {
+      let self = this;
+      return {
+        firstDayOfWeek: 1,
+        disabledDate(time) {
+          return time.getTime() + 86400000 < new Date().getTime();
+        },
+      };
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.w100 {
+  width: 100% !important;
+}
+</style>

+ 55 - 28
src/views/groupChatManager/model/addGroupmsg.vue

@@ -7,7 +7,7 @@
       :before-close="onClose"
       append-to-body
     >
-      <div >
+      <div>
         <el-form :inline="true" :model="searchForm">
           <el-form-item>
             <el-input
@@ -65,7 +65,7 @@
   </div>
 </template>
 <script>
-import { getGroupList, addGroupMessageList } from "../api";
+import { getGroupList,getSysGroupList, addGroupMessageList } from "../api";
 import pagination from "@/components/Pagination/index";
 export default {
   name: "eidtPostMsg",
@@ -90,6 +90,7 @@ export default {
       isNewPage: false,
       lookVisible: false,
       activeRow: { sendFlag: false },
+      type: "",
     };
   },
 
@@ -97,26 +98,49 @@ export default {
   methods: {
     async getList() {
       try {
-        const res = await getGroupList({
-          ...this.searchForm,
-          page: this.rules.page,
-          rows: this.rules.limit,
-          imSendGroupMessageId: this.activeRow.id,
-        });
-        this.tableList = res.data.rows;
-        this.rules.total = res.data.total;
-        let idList = this.chioseIdList.map((group) => {
-          return group.id;
-        });
-        this.isNewPage = true;
-        this.$nextTick(() => {
-          this.tableList.forEach((course) => {
-            if (idList.indexOf(course.id) != -1) {
-              this.$refs.multipleSelection.toggleRowSelection(course, true);
-            }
+        if (this.type) {
+          const res = await getSysGroupList({
+            ...this.searchForm,
+            page: this.rules.page,
+            rows: this.rules.limit,
+            imSendGroupMessageId: this.activeRow.id,
           });
-          this.isNewPage = false;
-        });
+          this.tableList = res.data.rows;
+          this.rules.total = res.data.total;
+          let idList = this.chioseIdList.map((group) => {
+            return group.id;
+          });
+          this.isNewPage = true;
+          this.$nextTick(() => {
+            this.tableList.forEach((course) => {
+              if (idList.indexOf(course.id) != -1) {
+                this.$refs.multipleSelection.toggleRowSelection(course, true);
+              }
+            });
+            this.isNewPage = false;
+          });
+        } else {
+          const res = await getGroupList({
+            ...this.searchForm,
+            page: this.rules.page,
+            rows: this.rules.limit,
+            imSendGroupMessageId: this.activeRow.id,
+          });
+          this.tableList = res.data.rows;
+          this.rules.total = res.data.total;
+          let idList = this.chioseIdList.map((group) => {
+            return group.id;
+          });
+          this.isNewPage = true;
+          this.$nextTick(() => {
+            this.tableList.forEach((course) => {
+              if (idList.indexOf(course.id) != -1) {
+                this.$refs.multipleSelection.toggleRowSelection(course, true);
+              }
+            });
+            this.isNewPage = false;
+          });
+        }
       } catch (e) {
         console.log(e);
       }
@@ -131,7 +155,7 @@ export default {
       this.search();
     },
     async submit() {
-      console.log('添加')
+      console.log("添加");
       if (!this.chioseIdList || this.chioseIdList.length <= 0) {
         this.$message.error("请至少选择一个群组");
         return;
@@ -142,10 +166,13 @@ export default {
             return group.id;
           })
           .join(",");
-          const res = await addGroupMessageList({ groupIds: idList,imSendGroupMessageId: this.activeRow.id,})
-          this.$message.success('添加成功')
-          this.$emit('getList')
-          this.onClose()
+        const res = await addGroupMessageList({
+          groupIds: idList,
+          imSendGroupMessageId: this.activeRow.id,
+        });
+        this.$message.success("添加成功");
+        this.$emit("getList");
+        this.onClose();
       } catch (e) {
         console.log(e);
       }
@@ -208,10 +235,10 @@ export default {
       this.clearCom();
       this.lookVisible = false;
     },
-    openDioag(row) {
+    openDioag(row, type) {
       this.activeRow = row;
+      this.type = type;
       this.lookVisible = true;
-      console.log(row);
       this.getList();
     },
   },

+ 4 - 3
src/views/groupChatManager/model/addMember.vue

@@ -4,6 +4,7 @@
       width="1000px"
       title="添加成员"
       :visible.sync="lookVisible"
+      v-if="lookVisible"
       :before-close="onClose"
       append-to-body
     >
@@ -193,15 +194,15 @@ export default {
     },
     clearCom() {
       this.chioseIdList = [];
-      if (this.memberForm.chioseType == "role") {
+      if (this.memberForm.chioseType == "role"&&this.$refs.employeeList) {
          this.$refs.employeeList.chioseIdList = []
 
       }
-      if (this.memberForm.chioseType == "student") {
+      if (this.memberForm.chioseType == "student"&&this.$refs.studentList) {
         this.$refs.studentList.chioseIdList = [];
 
       }
-      if (this.memberForm.chioseType == "teacher") {
+      if (this.memberForm.chioseType == "teacher"&& this.$refs.teacherList) {
         this.$refs.teacherList.chioseIdList = [];
 
       }

+ 15 - 4
src/views/groupChatManager/model/eidtPostMsg.vue

@@ -117,6 +117,7 @@ export default {
       lookVisible: false,
       chioseIdList: null,
       activeRow: null,
+      type:''
     };
   },
 
@@ -125,17 +126,20 @@ export default {
   },
   methods: {
     init() {},
-    openDioag(chioseIdList) {
+    openDioag(chioseIdList,type) {
       this.chioseIdList = chioseIdList;
+
+      this.type = type
+
       this.lookVisible = true;
+
     },
-    openResetDioag(row) {
-      console.log(row);
+    openResetDioag(row,type) {
       if (row.sendTime) {
         row.postType = "1";
       }
       this.activeRow = row;
-
+       this.type = type
       this.formes = { ...row };
       this.lookVisible = true;
     },
@@ -157,6 +161,10 @@ export default {
           try {
             if (this.activeRow && this.activeRow.id) {
               let obj = { ...this.formes };
+              console.log(this.type,'type')
+              if(this.type){
+                obj.isIncludeSender = 0
+              }
               const res = await resetGroupMessageList({ ...obj });
               this.$message.success("修改成功");
               this.$emit("clear");
@@ -168,6 +176,9 @@ export default {
                 })
                 .join(",");
               let obj = { ...this.formes, targetIds: idList };
+                  if(this.type){
+                obj.isIncludeSender = 0
+              }
               const res = await sendGroupMsg({ ...obj });
               this.$message.success("发送成功");
               this.$emit("clear");

+ 66 - 35
src/views/groupChatManager/model/lookGroup.vue

@@ -6,7 +6,7 @@
       :visible.sync="lookVisible"
       :before-close="onClose"
     >
-      <div >
+      <div>
         <el-form :inline="true" :model="searchForm">
           <el-form-item>
             <el-input
@@ -21,20 +21,20 @@
             <el-button @click="onReSet" type="danger">重置</el-button>
           </el-form-item>
         </el-form>
-        <div class="btnWrap" v-if="!activeRow.sendFlag">
-          <auth auths="imSendGroupMessage/queryGroupPage">
+        <div class="btnWrap" v-if="!activeRow.sendFlag"   style="margin-bottom: 20px">
+            <auth auths="imSendGroupMessage/addGroupList">
             <el-button
               type="primary"
               @click="addMsg"
-              style="margin-bottom: 20px"
+              style="margin-bottom: 20px;"
             >
               添加
             </el-button>
-          </auth>
+              </auth>
           <auth auths="imSendGroupMessage/deleteGroupList">
             <el-button
               type="danger"
-              style="margin-bottom: 20px"
+
               @click="deleteGroups"
             >
               删除
@@ -91,7 +91,7 @@
             @pagination="getList"
           />
         </div>
-        <addGroupmsg ref="addGroupmsg" @clear="clearCom" @getList='getList'/>
+        <addGroupmsg ref="addGroupmsg" @clear="clearCom" @getList="getList" />
       </div>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="onClose">确 定</el-button>
@@ -100,12 +100,16 @@
   </div>
 </template>
 <script>
-import { getGroupList1, deteleGroupMessageList } from "../api";
+import {
+  getGroupList1,
+  getSysGroupList1,
+  deteleGroupMessageList,
+} from "../api";
 import pagination from "@/components/Pagination/index";
-import addGroupmsg from './addGroupmsg';
+import addGroupmsg from "./addGroupmsg";
 export default {
   name: "eidtPostMsg",
-  components: { pagination ,addGroupmsg},
+  components: { pagination, addGroupmsg },
   data() {
     return {
       searchForm: {
@@ -126,6 +130,7 @@ export default {
       isNewPage: false,
       lookVisible: false,
       activeRow: { sendFlag: false },
+      type: "",
     };
   },
 
@@ -133,26 +138,49 @@ export default {
   methods: {
     async getList() {
       try {
-        const res = await getGroupList1({
-          ...this.searchForm,
-          page: this.rules.page,
-          rows: this.rules.limit,
-          imSendGroupMessageId: this.activeRow.id,
-        });
-        this.tableList = res.data.rows;
-        this.rules.total = res.data.total;
-        let idList = this.chioseIdList.map((group) => {
-          return group.id;
-        });
-        this.isNewPage = true;
-        this.$nextTick(() => {
-          this.tableList.forEach((course) => {
-            if (idList.indexOf(course.id) != -1) {
-              this.$refs.multipleSelection.toggleRowSelection(course, true);
-            }
+        if (this.type) {
+          const res = await getSysGroupList1({
+            ...this.searchForm,
+            page: this.rules.page,
+            rows: this.rules.limit,
+            imSendGroupMessageId: this.activeRow.id,
           });
-          this.isNewPage = false;
-        });
+          this.tableList = res.data.rows;
+          this.rules.total = res.data.total;
+          let idList = this.chioseIdList.map((group) => {
+            return group.id;
+          });
+          this.isNewPage = true;
+          this.$nextTick(() => {
+            this.tableList.forEach((course) => {
+              if (idList.indexOf(course.id) != -1) {
+                this.$refs.multipleSelection.toggleRowSelection(course, true);
+              }
+            });
+            this.isNewPage = false;
+          });
+        } else {
+          const res = await getGroupList1({
+            ...this.searchForm,
+            page: this.rules.page,
+            rows: this.rules.limit,
+            imSendGroupMessageId: this.activeRow.id,
+          });
+          this.tableList = res.data.rows;
+          this.rules.total = res.data.total;
+          let idList = this.chioseIdList.map((group) => {
+            return group.id;
+          });
+          this.isNewPage = true;
+          this.$nextTick(() => {
+            this.tableList.forEach((course) => {
+              if (idList.indexOf(course.id) != -1) {
+                this.$refs.multipleSelection.toggleRowSelection(course, true);
+              }
+            });
+            this.isNewPage = false;
+          });
+        }
       } catch (e) {
         console.log(e);
       }
@@ -171,7 +199,7 @@ export default {
       //   this.$message.error("请至少选择一个群组");
       //   return;
       // }
-      this.$refs.addGroupmsg.openDioag(this.activeRow);
+      this.$refs.addGroupmsg.openDioag(this.activeRow, this.type);
     },
     handleSelectionChange(val) {
       if (val.length > 0) {
@@ -224,10 +252,11 @@ export default {
       this.clearCom();
       this.lookVisible = false;
     },
-    openDioag(row) {
+    openDioag(row, type) {
       this.activeRow = row;
+      this.type = type;
       this.lookVisible = true;
-      console.log(row);
+
       this.getList();
     },
     deleteGroup(row) {
@@ -262,9 +291,11 @@ export default {
         type: "warning",
       })
         .then(() => {
-          let idList = this.chioseIdList.map((group) => {
-            return group.id;
-          }).join(',');
+          let idList = this.chioseIdList
+            .map((group) => {
+              return group.id;
+            })
+            .join(",");
           deteleGroupMessageList({
             groupIds: idList,
             imSendGroupMessageId: this.activeRow.id,

+ 124 - 0
src/views/groupChatManager/model/resetRoleType.vue

@@ -0,0 +1,124 @@
+<template>
+  <div>
+    <el-dialog
+      width="500px"
+      title="修改角色"
+      :visible.sync="lookVisible"
+      :before-close="onClose"
+    >
+      <el-form :model="formes" label-width="120px" ref="eidtPostMsg">
+        <el-form-item
+          label="群聊角色"
+          :rules="[{ required: true, message: '请选择群聊角色' }]"
+          prop="roleType"
+        >
+          <el-select
+            class="w100"
+            v-model.trim="formes.roleType"
+            clearable
+            filterable
+            placeholder="群聊类型"
+          >
+            <el-option
+              v-for="(item, index) in catgGoupTypeList"
+              :key="index"
+              :value="item"
+              :label="item"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="onClose">取 消</el-button>
+        <el-button type="primary" @click="submitMsg">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { resetGroupMemberRoleType } from "../api";
+
+export default {
+  name: "eidtPostMsg",
+  data() {
+    return {
+      formes: {
+        id: "",
+        name: "",
+        groupType: "",
+      },
+      catgGoupTypeList: [],
+      lookVisible: false,
+      chioseIdList: null,
+      activeRow: null,
+      type: "",
+      title: "",
+    };
+  },
+
+  mounted() {
+    this.init();
+  },
+  methods: {
+    init() {},
+    openDioag(row) {
+      this.activeRow = row
+      this.formes = {
+        imGroupId: this.$route.query.imGroupId,
+        roleType: row.roleType,
+        userId: row.userId,
+      };
+      this.setRoleType()
+      this.lookVisible = true;
+    },
+    setRoleType() {
+      let teacherType = ['指导老师','乐队指导']
+      let employType = ['乐团主管','运营主管','衔接老师']
+      if(teacherType.indexOf(this.activeRow.roleType)!= -1){
+        this.catgGoupTypeList = teacherType
+      }else{
+        this.catgGoupTypeList = employType
+      }
+    },
+    onClose() {
+      this.formes = {
+        id: "",
+        groupType: "",
+      };
+      this.$refs["eidtPostMsg"].resetFields();
+      this.lookVisible = false;
+    },
+    submitMsg() {
+      this.$refs.eidtPostMsg.validate(async (flag) => {
+        if (flag) {
+          try {
+            const res = await resetGroupMemberRoleType({ ...this.formes });
+            this.$message.success("修改成功");
+            this.$emit("getList");
+            this.onClose();
+          } catch (e) {
+            console.log(e);
+          }
+        }
+      });
+    },
+    getName(val) {
+      this.formes.fileName = val.data.name;
+    },
+    payDate() {
+      let self = this;
+      return {
+        firstDayOfWeek: 1,
+        disabledDate(time) {
+          return time.getTime() + 86400000 < new Date().getTime();
+        },
+      };
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.w100 {
+  width: 100% !important;
+}
+</style>

+ 58 - 0
src/views/groupChatManager/sysGroupCat.vue

@@ -0,0 +1,58 @@
+
+<!--  -->
+<template>
+  <div class="m-container">
+    <h2>
+      <div class="squrt"></div>
+      群聊公告
+    </h2>
+
+    <div class="m-core">
+      <tab-router
+        v-model.trim="activeIndex"
+        type="card"
+        @tab-click="handleClick"
+      >
+        <el-tab-pane label="群聊公告" lazy name="1">
+          <sysChatList v-if="activeIndex === '1'&& permission('/sysChatListt')" />
+
+        </el-tab-pane>
+        <el-tab-pane label="公告列表" lazy name="2">
+          <sysTimingMsgList v-if="activeIndex === '2'&& permission('/sysTimingMsgList')"/>
+
+        </el-tab-pane>
+      </tab-router>
+    </div>
+  </div>
+</template>
+
+<script>
+import sysChatList from './component/sysChatList'
+import sysTimingMsgList from './component/sysTimingMsgList'
+import { permission } from "@/utils/directivePage";
+export default {
+  components:{
+    sysChatList,
+    sysTimingMsgList
+  },
+  data() {
+    return {
+      activeIndex: "1",
+    };
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {},
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+    // 获取分部
+  },
+  methods: {
+    permission,
+    handleClick(evt) {
+      // this.changeHash(evt.name);
+    },
+  },
+};
+</script>
+<style lang='scss' scoped>
+</style>