Browse Source

Merge branch 'iteration-im-tencet' into 11/24SAAS

lex 1 năm trước cách đây
mục cha
commit
d2249917c8

+ 1 - 1
package.json

@@ -21,6 +21,7 @@
     "@rongcloud/imlib-next": "^5.4.3",
     "@shopify/draggable": "^1.0.0-beta.8",
     "@vant/touch-emulator": "^1.4.0",
+    "JSONPath": "^0.11.2",
     "axios": "0.18.1",
     "browserslist": "^4.18.1",
     "caniuse-lite": "^1.0.30001286",
@@ -36,7 +37,6 @@
     "i": "^0.3.6",
     "js-base64": "^3.6.0",
     "js-cookie": "2.2.0",
-    "JSONPath": "^0.11.2",
     "linq": "^3.2.2",
     "lodash": "^4.17.20",
     "mammoth": "^1.4.19",

+ 5 - 3
src/components/singe-file-upload/index.vue

@@ -144,9 +144,11 @@ export default {
           ];
           this.$emit("update:value", url);
           this.$emit("input", url);
-          this.$emit("inputFile", file);
-          this.$emit("success");
-          // val.data.name
+          this.$emit("inputFile", info.file);
+          this.$emit("success", {
+            fileName: this.dataObj.name,
+            fileSize: info.file.size
+          });
 
           let res = {
             data: {

+ 161 - 80
src/layout/components/AppMain.vue

@@ -56,17 +56,16 @@
         </div>
       </el-dialog>
     </div>
-    <div  class="draggable-item"  v-draggable ref="draggableItem">
+    <div class="draggable-item" v-draggable ref="draggableItem">
       <div
-      class="optionBtn"
-      v-if="!outOptionvisible && isShowBtn"
-      @click.stop.prevent="openOptionMual"
-    >
-      操作手册
-    </div>
+        class="optionBtn"
+        v-if="!outOptionvisible && isShowBtn"
+        @click.stop.prevent="openOptionMual"
+      >
+        操作手册
+      </div>
     </div>
 
-
     <!-- <div class="chart-join">
       <el-badge :is-dot="noReadNum > 0 ? true : false" class="item">
         <svg
@@ -91,7 +90,6 @@
     <el-drawer
       title="操作手册"
       :visible.sync="outOptionvisible"
-
       size="410px"
       :append-to-body="true"
     >
@@ -156,7 +154,7 @@
       </el-tabs>
     </el-drawer>
 
-    <el-drawer
+    <!-- <el-drawer
       :append-to-body="true"
       :visible.sync="chatVisible"
       size="910px"
@@ -165,7 +163,22 @@
       :withHeader="false"
     >
       <chat-model ref="chatModel" @close="chatVisible = false" />
-    </el-drawer>
+    </el-drawer> -->
+
+    <!-- <el-dialog
+      :append-to-body="true"
+      :class="(loadChatDom ? '' : 'drawer-container', 'dialogImChat')"
+      :visible.sync="chatVisible"
+      :show-close="false"
+    > -->
+    <div
+      v-show="chatVisible"
+      :class="(loadChatDom ? '' : 'drawer-container', 'imDialogPopup')"
+    >
+      <div class="dialogImChat" @click="chatVisible = false">
+        <imChatTencet @close="chatVisible = false" />
+      </div>
+    </div>
   </section>
 </template>
 
@@ -174,7 +187,7 @@ import notKeepAliveList from "@/router/notKeepAliveList";
 import serviceRemind from "@/components/serviceRemind"; // 续费弹窗
 import { permission } from "@/utils/directivePage";
 import { guideList } from "@/constant/guide";
-import chatModel from "./modal/chat-model";
+// import chatModel from "./modal/chat-model";
 import {
   getSysManualList,
   getSysManualMenuIds
@@ -182,22 +195,22 @@ import {
 import "quill/dist/quill.core.css";
 import "quill/dist/quill.snow.css";
 import "quill/dist/quill.bubble.css";
-
-import { core, CoreEvent } from "./imkit";
-import * as RongIMLib from "@rongcloud/imlib-next";
-import { custom_service } from "./modal/chat.js";
-import draggable  from '@/utils/draggable'
+import imChatTencet from "./imChatTencet";
+// import { core, CoreEvent } from "./imkit";
+// import * as RongIMLib from "@rongcloud/imlib-next";
+// import { custom_service } from "./modal/chat.js";
+import draggable from "@/utils/draggable";
 // 接入时需要将 '请更换您应用的 appkey' 替换为您的应用的 appkey
 // let libOption = { appkey: "c9kqb3rdc451j" };
-let libOption = {
-  appkey: /online/.test(location.href) ? "6tnym1br6pv07" : "c9kqb3rdc451j"
-}; // 线上的
-// 初始化 SDK
-core.init({
-  service: custom_service,
-  libOption: libOption,
-  conversationPullCount: 20
-});
+// let libOption = {
+//   appkey: /online/.test(location.href) ? "6tnym1br6pv07" : "c9kqb3rdc451j"
+// }; // 线上的
+// // 初始化 SDK
+// core.init({
+//   service: custom_service,
+//   libOption: libOption,
+//   conversationPullCount: 20
+// });
 
 export default {
   name: "AppMain",
@@ -219,8 +232,8 @@ export default {
       noReadNum: 0 // 消息未读数
     };
   },
-  components: { serviceRemind, chatModel },
-  directives:{
+  components: { serviceRemind, imChatTencet },
+  directives: {
     draggable
   },
   computed: {
@@ -260,63 +273,86 @@ export default {
       this.allIdList = res.data.split(",");
     } catch (e) {}
 
-    this.init();
+    // this.init();
     // 获取未读数
-    this.$bus.$on("getNoReadNum", obj => {
-      this.getNoReadMessage(obj);
-    });
+    // this.$bus.$on("getNoReadNum", obj => {
+    //   this.getNoReadMessage(obj);
+    // });
 
     this.$bus.$on("openChart", status => {
       this.chatVisible = status || false;
+      if (status) {
+        document
+          .querySelector("#body")
+          .classList.add("el-popup-parent--hidden");
+      } else {
+        document
+          .querySelector("#body")
+          .classList.remove("el-popup-parent--hidden");
+      }
     });
+
+    window.addEventListener("message", this.onImMessage);
   },
   beforeDestroy() {
     this.$bus.$off("showguide", () => {});
-    this.$bus.$off("getNoReadNum", () => {});
-    // core.off(CoreEvent.MESSAGES, this.handleMessages);
-    const Events = RongIMLib.Events;
-    RongIMLib.removeEventListener(Events.MESSAGES, this.handleMessages);
+    window.removeEventListener("message", this.onImMessage);
+    // this.$bus.$off("getNoReadNum", () => {});
+    // // core.off(CoreEvent.MESSAGES, this.handleMessages);
+    // const Events = RongIMLib.Events;
+    // RongIMLib.removeEventListener(Events.MESSAGES, this.handleMessages);
   },
   methods: {
-    init() {
-      core.connect(this.$store.state.user.imToken).then(res => {
-        if (res.code === RongIMLib.ErrorCode.SUCCESS) {
-          // this.isConnect = true;
-          this.getNoReadMessage(true);
-        } else {
-          console.warn("链接失败, code:", res.code);
-        }
-      });
-
-      const Events = RongIMLib.Events;
-      RongIMLib.addEventListener(Events.MESSAGES, this.handleMessages);
-      // RongIMLib.addEventListener(Events.MESSAGE_RECEIPT_RESPONSE, message => {
-      //   console.log("121212", message);
-      // });
-    },
-
-    handleMessages(newMessage) {
-      this.getNoReadMessage(true);
-    },
-    onOpenChatRoom() {
-      this.chatVisible = true;
-      this.$bus.$emit("scrollToBottom");
-      this.getNoReadMessage(true);
+    onImMessage(evt) {
+      console.log("evt:", evt);
+      if (evt.data.api === "onImClose") {
+        this.chatVisible = false;
+        document
+          .querySelector("#body")
+          .classList.remove("el-popup-parent--hidden");
+      } else if (evt.data.api === "getNoReadMessageCount") {
+        console.log(evt, "onMessage");
+        this.noReadNum = evt.data.count || 0;
+        this.$bus.$emit("getShowNums", this.noReadNum);
+      }
     },
-    getNoReadMessage(status) {
-      if (status || this.chatVisible) {
-        RongIMLib.getTotalUnreadCount().then(res => {
-          if (res.code === 0) {
+    // init() {
+    //   core.connect(this.$store.state.user.imToken).then(res => {
+    //     if (res.code === RongIMLib.ErrorCode.SUCCESS) {
+    //       // this.isConnect = true;
+    //       this.getNoReadMessage(true);
+    //     } else {
+    //       console.warn("链接失败, code:", res.code);
+    //     }
+    //   });
 
-            this.noReadNum = res.data || 0;
+    //   const Events = RongIMLib.Events;
+    //   RongIMLib.addEventListener(Events.MESSAGES, this.handleMessages);
+    //   // RongIMLib.addEventListener(Events.MESSAGE_RECEIPT_RESPONSE, message => {
+    //   //   console.log("121212", message);
+    //   // });
+    // },
 
-            this.$bus.$emit("getShowNums", this.noReadNum);
-          } else {
+    // handleMessages(newMessage) {
+    //   this.getNoReadMessage(true);
+    // },
+    // onOpenChatRoom() {
+    //   this.chatVisible = true;
+    //   this.$bus.$emit("scrollToBottom");
+    //   this.getNoReadMessage(true);
+    // },
+    // getNoReadMessage(status) {
+    //   if (status || this.chatVisible) {
+    //     RongIMLib.getTotalUnreadCount().then(res => {
+    //       if (res.code === 0) {
+    //         this.noReadNum = res.data || 0;
 
-          }
-        });
-      }
-    },
+    //         this.$bus.$emit("getShowNums", this.noReadNum);
+    //       } else {
+    //       }
+    //     });
+    //   }
+    // },
     showInstructions() {
       this.isShow = !this.isShow;
     },
@@ -333,10 +369,10 @@ export default {
     },
     async openOptionMual() {
       // this.outOptionvisible = true;
-      let flag = this.$refs.draggableItem.getAttribute('data-flag')
-     if(flag == 'true'){
-      return
-     }
+      let flag = this.$refs.draggableItem.getAttribute("data-flag");
+      if (flag == "true") {
+        return;
+      }
 
       await this.getMUal();
       this.outOptionvisible = true;
@@ -351,7 +387,6 @@ export default {
           search: this.form.search
         });
         this.optionList = res.data.rows;
-
       } catch (e) {
         console.log(e);
       }
@@ -380,6 +415,13 @@ export default {
       if (!val) {
         this.activeName = "first";
       }
+    },
+    chatVisible(val) {
+      if (!val) {
+        document
+          .querySelector("#body")
+          .classList.remove("el-popup-parent--hidden");
+      }
     }
   }
 };
@@ -389,6 +431,46 @@ export default {
   display: none !important;
 }
 
+.dialogImChat {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  position: unset !important;
+  width: 100%;
+  height: 100%;
+}
+.imDialogPopup {
+  position: fixed;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  z-index: 3000;
+  height: 100%;
+  background-color: rgba(0, 0, 0, 0.5);
+  overflow: auto;
+  overflow: hidden;
+  transition: display 0.2s ease-in-out;
+}
+
+// .dialogImChat {
+//   display: flex;
+//   align-items: center;
+//   justify-content: center;
+//   width: 100%;
+//   height: 100%;
+// }
+// .dialogImChat ::v-deep .el-dialog {
+//   width: 968px;
+//   height: 640px;
+//   margin: 0 auto 0 !important;
+// }
+// .dialogImChat ::v-deep .el-dialog__body {
+//   padding: 0;
+// }
+// .dialogImChat ::v-deep .el-dialog__header {
+//   padding: 0;
+// }
 .previewImg {
 }
 ::v-deep .el-drawer__header {
@@ -551,17 +633,16 @@ export default {
   }
 }
 
-.draggable-box{
+.draggable-box {
   position: relative;
-  .draggable-item{
+  .draggable-item {
     right: 0;
-  top: 250px;
+    top: 250px;
     position: absolute;
     z-index: 5000;
   }
 }
 
-
 /*设置字体的大小*/
 </style>
 <style scoped>

+ 77 - 0
src/layout/components/imChatTencet.vue

@@ -0,0 +1,77 @@
+<template>
+  <div
+    class="imGroupContainer"
+    v-loading="isLoaded"
+    element-loading-spinner="iconfont icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.3)"
+    @click.stop="() => {}"
+  >
+    <!-- <NSpin show={!isLoaded.value}> -->
+    <iframe
+      ref="“iframeRef”"
+      @load="onLoad"
+      class="container"
+      frameborder="0"
+      :src="src"
+    ></iframe>
+    <!-- </NSpin> -->
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      isLoaded: true,
+      src: ""
+    };
+  },
+  mounted() {
+    console.log(this.$store.state.user, "user");
+    const users = this.$store.state.user;
+    const origin = /(localhost|192)/.test(location.host)
+      ? // ? "https://test.lexiaoya.cn"
+        "https://test.dayaedu.com"
+      : /online.dayaedu.com/.test(location.href)
+      ? "https://online.dayaedu.com"
+      : location.origin;
+    this.src = `${origin}/imChat/?platform=daya&userID=${
+      users.imUserId
+    }&Authorization=${users.token}`;
+  },
+  methods: {
+    onLoad() {
+      this.isLoaded = false;
+    }
+  },
+  destoryed() {}
+};
+</script>
+
+<style lang="scss" scoped>
+.imGroupContainer,
+.container {
+  background-color: #fff;
+  width: 968px;
+  height: 640px;
+  border-radius: 15px;
+}
+
+.hideModal {
+  visibility: hidden;
+}
+</style>
+<!--
+const userStore = useUserStore()
+    const { nickname, avatar, imToken, imUserId, jobType } = userStore?.info || {}
+    const isLoading = ref(false)
+    const iframeRef = ref()
+    const isLoaded = ref(false)
+    // const renderError = ref(false);
+    // const renderSuccess = ref(false);
+    const origin = /(localhost|192)/.test(location.host)
+      ? 'https://test.lexiaoya.cn'
+      : /online.lexiaoya.cn/.test(location.href)
+      ? 'https://kt.colexiu.com'
+      : location.origin
+    const src = `${origin}/classroom-im/?platform=orchestra&userID=${imUserId}&Authorization=${userStore.getToken}` -->

+ 24 - 16
src/store/modules/user.js

@@ -5,7 +5,7 @@ import {
   removeToken,
   removeCrossToken,
   setCrossToken,
-  removeTenant,
+  removeTenant
 } from "@/utils/auth";
 import { tenantInfoQueryPage, tenantInfoInfo } from "@/views/organManager/api";
 import { resetRouter } from "@/router";
@@ -18,6 +18,7 @@ const state = {
   positionName: "", // 职位
   organ: "",
   organName: "",
+  imUserId: "",
   phone: "",
   isSuperAdmin: false,
   roles: [],
@@ -25,7 +26,7 @@ const state = {
   tenantId: null,
   baseTenantId: null,
   imToken: "",
-  pwdflag: false,
+  pwdflag: false
 };
 
 let stateTenantId = null; // 机构编号
@@ -79,6 +80,9 @@ const mutations = {
   SET_RESETPWD: (state, pwdflag) => {
     state.pwdflag = pwdflag;
   },
+  SET_IMUSERID: (state, imUserId) => {
+    state.imUserId = imUserId;
+  }
 };
 
 async function tenantQueryPage(id) {
@@ -89,7 +93,7 @@ async function tenantQueryPage(id) {
         page: 1,
         rows: 1,
         payState: 1,
-        state: 1,
+        state: 1
       });
       const tenantList = res.data?.rows || [];
       tenantId = tenantList[0]?.id;
@@ -107,7 +111,7 @@ async function tenantQueryPage(id) {
           tenantId: data.id,
           tenantName: data.name,
           tenantLogo: data.logo,
-          tenantStatus: "on", // 判断是否此状态,没有的话,刷新页面会重新请求页面
+          tenantStatus: "on" // 判断是否此状态,没有的话,刷新页面会重新请求页面
         })
       );
     }
@@ -131,13 +135,15 @@ const actions = {
         username: username.trim(),
         password: password,
         clientId: "system",
-        clientSecret: "system",
+        clientSecret: "system"
       })
-        .then((response) => {
+        .then(response => {
           const { data } = response;
           if (response.code == 200) {
             let token =
-              data.authentication.token_type + " " + data.authentication.access_token;
+              data.authentication.token_type +
+              " " +
+              data.authentication.access_token;
             commit("SET_REFRESH_TOKEN", data.authentication.refresh_token);
             commit("SET_EXPIRES_IN", data.authentication.expires_in);
             commit("SET_TOKEN", token);
@@ -146,7 +152,7 @@ const actions = {
             resolve();
           }
         })
-        .catch((error) => {
+        .catch(error => {
           reject(error);
           console.log("登录错误", error);
         });
@@ -157,7 +163,7 @@ const actions = {
     return new Promise(async (resolve, reject) => {
       try {
         await getInfo(state.token)
-          .then(async (response) => {
+          .then(async response => {
             if (response.code == 200) {
               const data = response;
               if (!data.data) {
@@ -174,6 +180,7 @@ const actions = {
               const tenantId = data.data.tenantId;
               const positionName = data.data.positionName;
               const imToken = data.data.imToken;
+              const imUserId = data.data.imUserId;
               sessionStorage.setItem("baseTenantId", tenantId);
               commit("SET_BASETENANTID", tenantId);
               let tenantConfig = sessionStorage.getItem("tenantConfig");
@@ -204,7 +211,8 @@ const actions = {
               commit("SET_SUPERADMIN", isSuperAdmin);
               commit("SET_ROLES", roles);
               commit("SET_NEWROLES", newRoles);
-              newRoles;
+              commit("SET_IMUSERID", imUserId);
+              // newRoles;
               commit("SET_POSITIONNAME", positionName);
               commit("SET_IMTOKEN", imToken);
               resolve(data);
@@ -212,7 +220,7 @@ const actions = {
               reject("获取用户信息错误,请重新登录");
             }
           })
-          .catch((error) => {
+          .catch(error => {
             reject("获取用户信息错误,请重新登录");
           });
       } catch (e) {
@@ -224,7 +232,7 @@ const actions = {
   logout({ commit }) {
     return new Promise((resolve, reject) => {
       logout()
-        .then((res) => {
+        .then(res => {
           commit("SET_TOKEN", "");
           removeToken();
           setToken("");
@@ -234,7 +242,7 @@ const actions = {
           commit("SET_NAME", "");
           resolve();
         })
-        .catch((error) => {
+        .catch(error => {
           reject(error);
         });
     });
@@ -242,7 +250,7 @@ const actions = {
 
   // remove token
   resetToken({ commit }) {
-    return new Promise((resolve) => {
+    return new Promise(resolve => {
       commit("SET_TOKEN", "");
       removeToken();
       removeCrossToken();
@@ -250,12 +258,12 @@ const actions = {
       resolve();
       setToken("");
     });
-  },
+  }
 };
 
 export default {
   namespaced: true,
   state,
   mutations,
-  actions,
+  actions
 };

+ 75 - 22
src/views/groupChatManager/component/chatList.vue

@@ -1,19 +1,40 @@
 <!--  -->
 <template>
   <div class="m-container">
-    <save-form :inline="true" :model="searchForm" @submit="search" @reset="onReSet" ref="searchForm">
+    <save-form
+      :inline="true"
+      :model="searchForm"
+      @submit="search"
+      @reset="onReSet"
+      ref="searchForm"
+    >
       <el-form-item>
-        <el-input v-model.trim="searchForm.search" clearable @keyup.enter.native="e => {
-            e.target.blur();
-            $refs.searchForm.save();
-            search();
-          }
-          " placeholder="群聊名称"></el-input>
+        <el-input
+          v-model.trim="searchForm.search"
+          clearable
+          @keyup.enter.native="
+            e => {
+              e.target.blur();
+              $refs.searchForm.save();
+              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
+          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>
@@ -35,12 +56,30 @@
     </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
+        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="memo" label="群备注"></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="memo"
+          label="群备注"
+        ></el-table-column>
         <el-table-column align="center" prop="groupType" label="群聊类型">
           <template slot-scope="scope">
             <div>
@@ -55,22 +94,36 @@
             </div>
           </template>
         </el-table-column>
-        <el-table-column align="center" prop="memberNum" label="人数"></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="/chatDetail">
-                <el-button type="text" @click="gotoCatDetail(scope.row)">详情</el-button>
+                <el-button type="text" @click="gotoCatDetail(scope.row)"
+                  >详情</el-button
+                >
               </auth>
               <auth auths="imGroup/updateImGroup">
-                <el-button type="text" @click="cancelCat(scope.row)">解散</el-button>
+                <el-button type="text" @click="cancelCat(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" />
+      <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" />
@@ -113,7 +166,7 @@ export default {
     };
   },
   //生命周期 - 创建完成(可以访问当前this实例)
-  created() { },
+  created() {},
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
     // 获取分部
@@ -195,7 +248,7 @@ export default {
           });
           this.chioseIdList = this.$helpers.lodash.remove(
             this.chioseIdList,
-            function (item) {
+            function(item) {
               return tableIdList.indexOf(item.id) == -1;
             }
           );

+ 21 - 22
src/views/groupChatManager/component/sysChatList.vue

@@ -12,13 +12,13 @@
         <el-input
           v-model.trim="searchForm.search"
           clearable
-           @keyup.enter.native="
-              (e) => {
-                e.target.blur();
-                $refs.searchForm.save();
-                search();
-              }
-            "
+          @keyup.enter.native="
+            e => {
+              e.target.blur();
+              $refs.searchForm.save();
+              search();
+            }
+          "
           placeholder="群聊名称"
         ></el-input>
       </el-form-item>
@@ -147,7 +147,7 @@ export default {
     return {
       searchForm: {
         search: null,
-        groupType: "",
+        groupType: ""
       },
       catgGoupTypeList,
       tableList: [],
@@ -157,12 +157,12 @@ export default {
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 0, // 总条数
-        page_size: [10, 20, 40, 50], // 选择限制显示条数
+        page_size: [10, 20, 40, 50] // 选择限制显示条数
       },
       addMuiscVisible: false,
       multipleSelection: [],
       chioseIdList: [],
-      isNewPage: false,
+      isNewPage: false
     };
   },
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -189,16 +189,16 @@ export default {
         const res = await getSysGroupList({
           ...this.searchForm,
           page: this.rules.page,
-          rows: this.rules.limit,
+          rows: this.rules.limit
         });
         this.tableList = res.data.rows;
         this.rules.total = res.data.total;
-        let idList = this.chioseIdList.map((group) => {
+        let idList = this.chioseIdList.map(group => {
           return group.id;
         });
         this.isNewPage = true;
         this.$nextTick(() => {
-          this.tableList.forEach((course) => {
+          this.tableList.forEach(course => {
             if (idList.indexOf(course.id) != -1) {
               this.$refs.multipleSelection.toggleRowSelection(course, true);
             }
@@ -235,12 +235,12 @@ export default {
         );
       } else {
         if (this.isNewPage) return;
-        let idList = this.chioseIdList.map((group) => {
+        let idList = this.chioseIdList.map(group => {
           return group.id;
         });
         this.$nextTick(() => {
           let tableIdList = [];
-          this.tableList.forEach((group) => {
+          this.tableList.forEach(group => {
             tableIdList.push(group.id);
             if (idList.indexOf(group.id) != -1) {
               this.$refs.multipleSelection.toggleRowSelection(group, false);
@@ -248,7 +248,7 @@ export default {
           });
           this.chioseIdList = this.$helpers.lodash.remove(
             this.chioseIdList,
-            function (item) {
+            function(item) {
               return tableIdList.indexOf(item.id) == -1;
             }
           );
@@ -263,7 +263,7 @@ export default {
       this.$refs.multipleSelection.clearSelection();
     },
     onTableSelect(rows, row) {
-      let idList = this.chioseIdList.map((group) => {
+      let idList = this.chioseIdList.map(group => {
         return group.id;
       });
       if (idList.indexOf(row.id) != -1) {
@@ -279,15 +279,14 @@ export default {
     gotoCatDetail(row) {
       this.$router.push({
         path: "/operateManager/chatDetail",
-        query: { imGroupId: row.id, name: row.name },
+        query: { imGroupId: row.id, name: row.name }
       });
       console.log(row);
     },
     addChat() {
       this.$refs.addChatForm.openDioag();
-    },
-  },
+    }
+  }
 };
 </script>
-<style lang='scss' scoped>
-</style>
+<style lang="scss" scoped></style>

+ 14 - 6
src/views/groupChatManager/model/eidtPostMsg.vue

@@ -59,6 +59,7 @@
               () => {
                 formes.fileUrl = '';
                 formes.fileName = '';
+                formes.fileSize = 0;
               }
             "
           >
@@ -76,7 +77,7 @@
             tips="仅支持上传 PNG/JPG"
             accept=".png, .jpg"
             v-model="formes.fileUrl"
-            @getName="getName"
+            @success="onFileSuccess"
           />
         </el-form-item>
         <el-form-item
@@ -89,7 +90,7 @@
             tips="仅支持上传PDF文件"
             accept=".pdf"
             v-model="formes.fileUrl"
-            @getName="getName"
+            @success="onFileSuccess"
           />
         </el-form-item>
       </el-form>
@@ -112,7 +113,8 @@ export default {
         sendTime: "",
         messageContent: "",
         messageType: "TXT",
-        fileName: ""
+        fileName: "",
+        fileSize: 0
       },
       lookVisible: false,
       chioseIdList: null,
@@ -149,7 +151,8 @@ export default {
         sendTime: "",
         messageContent: "",
         messageType: "",
-        fileName: ""
+        fileName: "",
+        fileSize: 0
       };
       this.$refs["eidtPostMsg"].resetFields();
       this.lookVisible = false;
@@ -189,8 +192,13 @@ export default {
         }
       });
     },
-    getName(val) {
-      this.formes.fileName = val.data.name;
+    // getName(val) {
+    //   this.formes.fileName = val.data.name;
+    //   console.log(val, "fileName");
+    // },
+    onFileSuccess(val) {
+      this.formes.fileName = val.fileName;
+      this.formes.fileSize = val.fileSize;
     },
     payDate() {
       let self = this;

+ 20 - 4
src/views/resetTeaming/modals/member.vue

@@ -1,5 +1,10 @@
 <template>
-  <div class="courseModel" style="margin-top: 12px;">
+  <div
+    class="courseModel"
+    style="margin-top: 12px;"
+    v-if="toolsPackage.length > 0"
+    key="toolsPackage"
+  >
     <template>
       <div class="yunTrain">
         <img :src="trainBg" />
@@ -17,7 +22,8 @@
       </div>
     </template>
 
-    <div class="section">
+    <slot></slot>
+    <!-- <div class="section" v-if="toolsPackage.length > 0" key="toolsPackage">
       <el-row class="title-row">
         <el-col :span="isShowSalePrice ? 9 : 14"
           >练习系统{{
@@ -40,6 +46,7 @@
                 item.optionalFlag ? 'disabled' : ''
               ]"
             ></i>
+            {{ item.isStatus ? "true" : "false" }}
             <span style="display: flex; align-items: center;">
               <template>{{ item.name }}</template>
             </span>
@@ -72,7 +79,7 @@
           </el-col>
         </el-row>
       </div>
-    </div>
+    </div> -->
     <el-dialog
       title="视频"
       :visible.sync="videoStatus"
@@ -95,7 +102,7 @@
 
 <script>
 export default {
-  name: "courseModel",
+  name: "memberModal",
   props: {
     courseViewType: [Number, String],
     toolsPackage: Array,
@@ -110,6 +117,15 @@ export default {
       videoStatus: false
     };
   },
+  watch: {
+    toolsPackage: {
+      handler(newValue) {
+        console.log(newValue, "heandler");
+      },
+      immediate: true,
+      deep: true
+    }
+  },
   methods: {
     onTrainChange(item) {
       // 云教练点击时

+ 80 - 2
src/views/resetTeaming/modals/subject-preview.vue

@@ -31,7 +31,64 @@
       :isGiveAccessories="isGiveAccessories"
       :accessStatus="accessOries.length > 0"
       @onCheckItem="onCheckItem"
-    />
+    >
+      <div class="section" v-if="toolsPackage.length > 0" key="toolsPackage">
+        <el-row class="title-row">
+          <el-col :span="isShowSalePrice ? 9 : 14"
+            >练习系统{{
+              isGiveAccessories && accessStatus ? "(赠送辅件一套)" : null
+            }}</el-col
+          >
+          <el-col :span="5" style="text-align: right;">时长</el-col>
+          <el-col :span="5" style="text-align: right;">原价</el-col>
+          <el-col :span="5" style="text-align: right;" v-if="isShowSalePrice"
+            >售价</el-col
+          >
+        </el-row>
+        <div v-for="(item, index) in toolsPackage" :key="index">
+          <el-row class="option-row" @click.native="onCheckItem(item, 'train')">
+            <el-col :span="isShowSalePrice ? 9 : 14">
+              <i
+                class="check_default"
+                :class="[
+                  item.isStatus ? 'check_active' : '',
+                  item.optionalFlag ? 'disabled' : ''
+                ]"
+              ></i>
+              <span style="display: flex; align-items: center;">
+                <template>{{ item.name }}</template>
+              </span>
+            </el-col>
+            <el-col :span="5">
+              <span style="color: #AAA; font-size: 12px;"
+                >{{ item.num }}({{ item.period | unitFormat }})</span
+              >
+            </el-col>
+            <el-col :span="5">
+              <del style="color: #AAA; font-size: 12px;"
+                >¥{{ item.originalAmount | moneyFormat }}</del
+              >
+            </el-col>
+            <el-col :span="5" v-if="isShowSalePrice">
+              <span style="color: #1A1A1A"
+                >¥{{ item.actualAmount | moneyFormat }}</span
+              >
+            </el-col>
+          </el-row>
+          <el-row style="padding-left: 24px;" v-if="item.childGoodsList">
+            <el-col
+              v-for="(child, index) in item.childGoodsList"
+              :key="child.name"
+            >
+              <span style="font-size: 12px; color: #808080;"
+                >{{ child.name }}
+                {{ item.childGoodsList.length - 1 == index ? "" : "、" }}</span
+              >
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+    </member>
 
     <instrument-model
       :isShowSalePrice="isShowSalePrice"
@@ -341,8 +398,8 @@ export default {
         paymentCalender && paymentCalender.member ? paymentCalender.member : {};
 
       member.isStatus = true;
-
       this.toolsPackage = member && !member.memberRankSettingId ? [] : [member];
+      console.log(this.toolsPackage, "this.toolsPackage");
 
       // 乐器保养
       const repair =
@@ -503,6 +560,8 @@ export default {
         accessOries: this.accessOries,
         musicGroupSubject: this.musicGroupSubject
       });
+
+      this.$forceUpdate();
     },
     groupBy(array, f) {
       var groups = {};
@@ -538,6 +597,11 @@ export default {
         );
       }
     },
+    // onTrainChange(item) {
+    //   // 云教练点击时
+    //   // this.$emit("onCheckItem", item, "train");
+
+    // },
     onCheckItem(item, type) {
       // 默认选中不可改
       if (item.optionalFlag) return;
@@ -557,6 +621,7 @@ export default {
         });
       }
       item.isStatus = !item.isStatus;
+      console.log(item.isStatus, "onCheckItem");
       if (type == "train") {
         // 如果选择的是乐保,则把所有辅件价格设置为0
         this.giveAccessoriesSetStatus();
@@ -567,6 +632,7 @@ export default {
       this.setLeBaoStatus();
       // 重新计算金额
       this.calcPrice();
+      this.$forceUpdate();
     },
     giveAccessoriesSetStatus() {
       let status = false; // 是否有选中云教练
@@ -578,6 +644,7 @@ export default {
         }
       });
       this.giveAccessoriesStatus = this.isGiveAccessories && status;
+      this.$forceUpdate();
     },
     instrumentGetStatus() {
       let childItem = {};
@@ -808,6 +875,17 @@ export default {
     permission(str) {
       return permission(str);
     }
+  },
+  filters: {
+    unitFormat(val) {
+      let template = {
+        YEAR: "年",
+        MONTH: "月",
+        QUARTERLY: "季度",
+        YEAR_HALF: "半年"
+      };
+      return template[val];
+    }
   }
 };
 </script>