|
@@ -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>
|