From 089bf5d2378b3c4a61d795b2a92bede2c193b771 Mon Sep 17 00:00:00 2001
From: admin <344137771@qq.com>
Date: Tue, 06 Jan 2026 11:22:58 +0800
Subject: [PATCH] 1
---
src/views/message/index.vue | 852 +++++++++++++++++++++++++++-----------------------------
1 files changed, 405 insertions(+), 447 deletions(-)
diff --git a/src/views/message/index.vue b/src/views/message/index.vue
index cada279..a610cf1 100644
--- a/src/views/message/index.vue
+++ b/src/views/message/index.vue
@@ -1,133 +1,93 @@
<template>
<div class="mod-transport">
- <el-container slot="container" class="full-height mod-transport">
- <!-- 左侧侧边栏 -->
- <el-aside width="320px" class="aside-box full-height">
- <el-container class="full-height" direction="vertical">
- <!-- 搜索栏 -->
- <div class="header" style="height: 87px;">
- <div class="from-search">
- <el-input
- v-model="input"
- prefix-icon="el-icon-search"
- placeholder="搜索成功后接手该用户"
- size="small"
- />
- </div>
-
- <!-- 工具栏 -->
- <div class="tools">
- <el-button
- circle
- plain
- size="small"
- icon="el-icon-search"
- @click="search()"
- />
- </div>
+ <el-container slot="container" class="full-height mod-transport">
+ <!-- 左侧侧边栏 -->
+ <el-aside width="320px" class="aside-box full-height">
+ <el-container class="full-height" direction="vertical">
+ <!-- 搜索栏 -->
+ <div class="header" style="height: 87px;">
+ <div class="from-search">
+ <el-input v-model="input" prefix-icon="el-icon-search" placeholder="搜索成功后接手该用户" size="small" />
</div>
- <!-- 对话列表栏 -->
- <el-scrollbar
- tag="section"
- ref="menusScrollbar"
- :native="false"
- :style="{'height': (this.documentClientHeight-87)+'px','max-height': (this.documentClientHeight-87)+'px'}"
- >
- <el-main class="main">
+ <!-- 工具栏 -->
+ <div class="tools">
+ <el-button circle plain size="small" icon="el-icon-search" @click="search()" />
+ </div>
+ </div>
- <!-- 对话列表 -->
- <template>
- <div
- v-for="item in talks"
- :key="item.id"
- class="talk-item pointer"
- :class="{ active: index_name == item.id }"
- @click="clickTab(item)"
- >
- <div class="">
- <img v-if="index_name == item.id"
- style="width: 50px; height: 50px"
- src=".././../assets/img/avatar1.png"
- alt=""
- />
- <img v-if="index_name != item.id"
- style="width: 50px; height: 50px"
- src=".././../assets/img/avatar2.png"
- alt=""
- />
+ <!-- 对话列表栏 -->
+ <el-scrollbar tag="section" ref="menusScrollbar" :native="false"
+ :style="{ 'height': (this.documentClientHeight - 87) + 'px', 'max-height': (this.documentClientHeight - 87) + 'px' }">
+ <el-main class="main">
+
+ <!-- 对话列表 -->
+ <template>
+ <div v-for="item in talks" :key="item.id" class="talk-item pointer"
+ :class="{ active: index_name == item.id }" @click="clickTab(item)">
+ <div class="">
+ <img v-if="index_name == item.id" style="width: 50px; height: 50px"
+ src=".././../assets/img/avatar1.png" alt="" />
+ <img v-if="index_name != item.id" style="width: 50px; height: 50px"
+ src=".././../assets/img/avatar2.png" alt="" />
+ </div>
+ <div class="card-box">
+ <div class="title">
+ <div class="card-name">
+ <p class="nickname">
+ {{ item.remarks ? "(" + item.remarks + ")" + item.username : item.username }}
+ </p>
+ </div>
+
+
+
+ <div style="margin-top: 20px;margin-right: 25px;">
+ <el-badge class="mark" :value="item.unreadmsg" v-if="item.unreadmsg > 0" />
+ </div>
+
</div>
- <div class="card-box">
- <div class="title">
- <div class="card-name">
- <p class="nickname">
- {{
- item.remarks ? item.username+"("+item.remarks+")" : item.username
- }}
- </p>
- </div>
-
-
-
- <div style="margin-top: 20px;margin-right: 25px;">
- <el-badge class="mark" :value="item.unreadmsg" v-if="item.unreadmsg > 0"/>
- </div>
-
+ <div class="title">
+ <div class="card-name">
+ <p class="nickname-1">
+ {{
+ item.content
+ }}
+ </p>
</div>
- <div class="title">
- <div class="card-name">
- <p class="nickname-1">
- {{
- item.content
- }}
- </p>
- </div>
- <div class="card-time">
- <p>{{ item.updatetime }}</p>
- </div>
-
+ <div class="card-time">
+ <p>{{ item.updatetime }}</p>
</div>
+
</div>
</div>
- </template>
- </el-main>
- </el-scrollbar>
- </el-container>
- </el-aside>
+ </div>
+ </template>
+ </el-main>
+ </el-scrollbar>
+ </el-container>
+ </el-aside>
- <!-- 聊天面板容器 -->
- <el-main class="ov-hidden full-height no-padding padding0">
- <TalkPanel
- ref="talkPanel"
- class="full-height"
- :params="params"
- :is-online="isFriendOnline"
- @change-talk="changeTalk"
- @close-talk="closeTalk"
- @event="handleTalkPanelEvent"
- />
- </el-main>
+ <!-- 聊天面板容器 -->
+ <el-main class="ov-hidden full-height no-padding padding0">
+ <TalkPanel ref="talkPanel" class="full-height" :params="params" :is-online="isFriendOnline"
+ @change-talk="changeTalk" @close-talk="closeTalk" @event="handleTalkPanelEvent" />
+ </el-main>
- <el-dialog title="" v-show="imageViewer.isShow">
- <!-- 图片查看器 -->
- <MeEditorImageView
- ref="imageViewer"
- v-model="imageViewer.isShow"
- :file="imageViewer.file"
- @confirm="confirmUploadImage"
- @close="handleClose"
- />
- </el-dialog>
+ <el-dialog title="" v-show="imageViewer.isShow">
+ <!-- 图片查看器 -->
+ <MeEditorImageView ref="imageViewer" v-model="imageViewer.isShow" :file="imageViewer.file"
+ @confirm="confirmUploadImage" @close="handleClose" />
+ </el-dialog>
- </el-container>
- <!-- <div v-if="this.$store.state.talks.clinkStatus == 1" style="background-color: white;width: 100%;height:100%;
+ </el-container>
+ <!-- <div v-if="this.$store.state.talks.clinkStatus == 1" style="background-color: white;width: 100%;height:100%;
top:0;left:0;opacity: 0.8;
z-index: 3000;position:fixed;">
<div class="loading"></div>
<div class="loadingText">消息加载中...</div>
</div> -->
-
+
</div>
</template>
<script>
@@ -191,258 +151,258 @@
// 消息未读数计时器
interval: null,
- loadStatus:0,
- index_name:1,
+ loadStatus: 0,
+ index_name: 1,
talks: [],
talks1: [
- {
- "index_name":0,
- "avatar": "",
- "gender": 0,
- "group_id": 0,
- "id": 5,
- "is_online": 0,
- "motto": "",
- "nickname": "test0",
- "remark": "test0",
- "avatar": "",
- "friend_apply": 0,
- "friend_status": 2,
- "gender": 0,
- "id": 5,
- "mobile": "18798272053",
- "motto": "",
- "nickname": "test0",
- "nickname_remark": "test0",
- "remark_name":"test0",
- "updated_at":"2023-07-03 07:33:06"
- },
- {
- "index_name":1,
- "avatar": "",
- "gender": 0,
- "group_id": 0,
- "id": 5,
- "is_online": 0,
- "motto": "",
- "nickname": "test3",
- "remark": "test3",
- "avatar": "",
- "friend_apply": 0,
- "friend_status": 2,
- "gender": 0,
- "id": 5,
- "mobile": "18798272053",
- "motto": "",
- "nickname": "test3",
- "nickname_remark": "test3",
- "remark_name":"test3",
- "updated_at":"2023-07-03 07:33:06"
- },
- {
- "index_name":2,
- "avatar": "",
- "gender": 0,
- "group_id": 0,
- "id": 5,
- "is_online": 0,
- "motto": "",
- "nickname": "test3",
- "remark": "test3",
- "avatar": "",
- "friend_apply": 0,
- "friend_status": 2,
- "gender": 0,
- "id": 5,
- "mobile": "18798272053",
- "motto": "",
- "nickname": "test3",
- "nickname_remark": "test3",
- "remark_name":"test3",
- "updated_at":"2023-07-03 07:33:06"
- },
- {
- "index_name":3,
- "avatar": "",
- "gender": 0,
- "group_id": 0,
- "id": 5,
- "is_online": 0,
- "motto": "",
- "nickname": "test3",
- "remark": "test3",
- "avatar": "",
- "friend_apply": 0,
- "friend_status": 2,
- "gender": 0,
- "id": 5,
- "mobile": "18798272053",
- "motto": "",
- "nickname": "test3",
- "nickname_remark": "test3",
- "remark_name":"test3",
- "updated_at":"2023-07-03 07:33:06"
- },
- {
- "index_name":4,
- "avatar": "",
- "gender": 0,
- "group_id": 0,
- "id": 5,
- "is_online": 0,
- "motto": "",
- "nickname": "test3",
- "remark": "test3",
- "avatar": "",
- "friend_apply": 0,
- "friend_status": 2,
- "gender": 0,
- "id": 5,
- "mobile": "18798272053",
- "motto": "",
- "nickname": "test3",
- "nickname_remark": "test3",
- "remark_name":"test3",
- "updated_at":"2023-07-03 07:33:06"
- },
- {
- "index_name":5,
- "avatar": "",
- "gender": 0,
- "group_id": 0,
- "id": 5,
- "is_online": 0,
- "motto": "",
- "nickname": "test3",
- "remark": "test3",
- "avatar": "",
- "friend_apply": 0,
- "friend_status": 2,
- "gender": 0,
- "id": 5,
- "mobile": "18798272053",
- "motto": "",
- "nickname": "test3",
- "nickname_remark": "test3",
- "remark_name":"test3",
- "updated_at":"2023-07-03 07:33:06"
- },
- {
- "index_name":6,
- "avatar": "",
- "gender": 0,
- "group_id": 0,
- "id": 5,
- "is_online": 0,
- "motto": "",
- "nickname": "test3",
- "remark": "test3",
- "avatar": "",
- "friend_apply": 0,
- "friend_status": 2,
- "gender": 0,
- "id": 5,
- "mobile": "18798272053",
- "motto": "",
- "nickname": "test3",
- "nickname_remark": "test3",
- "remark_name":"test3",
- "updated_at":"2023-07-03 07:33:06"
- },
- {
- "index_name":7,
- "avatar": "",
- "gender": 0,
- "group_id": 0,
- "id": 5,
- "is_online": 0,
- "motto": "",
- "nickname": "test3",
- "remark": "test3",
- "avatar": "",
- "friend_apply": 0,
- "friend_status": 2,
- "gender": 0,
- "id": 5,
- "mobile": "18798272053",
- "motto": "",
- "nickname": "test3",
- "nickname_remark": "test3",
- "remark_name":"test3",
- "updated_at":"2023-07-03 07:33:06"
- },
- {
- "index_name":8,
- "avatar": "",
- "gender": 0,
- "group_id": 0,
- "id": 5,
- "is_online": 0,
- "motto": "",
- "nickname": "test3",
- "remark": "test3",
- "avatar": "",
- "friend_apply": 0,
- "friend_status": 2,
- "gender": 0,
- "id": 5,
- "mobile": "18798272053",
- "motto": "",
- "nickname": "test3",
- "nickname_remark": "test3",
- "remark_name":"test3",
- "updated_at":"2023-07-03 07:33:06"
- },
- {
- "index_name":9,
- "avatar": "",
- "gender": 0,
- "group_id": 0,
- "id": 5,
- "is_online": 0,
- "motto": "",
- "nickname": "test3",
- "remark": "test3",
- "avatar": "",
- "friend_apply": 0,
- "friend_status": 2,
- "gender": 0,
- "id": 5,
- "mobile": "18798272053",
- "motto": "",
- "nickname": "test3",
- "nickname_remark": "test3",
- "remark_name":"test3",
- "updated_at":"2023-07-03 07:33:06"
- },
- {
- "index_name":10,
- "avatar": "",
- "gender": 0,
- "group_id": 0,
- "id": 5,
- "is_online": 0,
- "motto": "",
- "nickname": "test33",
- "remark": "test33",
- "avatar": "",
- "friend_apply": 0,
- "friend_status": 2,
- "gender": 0,
- "id": 5,
- "mobile": "18798272053",
- "motto": "",
- "nickname": "test33",
- "nickname_remark": "test33",
- "remark_name":"test33",
- "updated_at":"2023-07-03 07:33:06"
- }
+ {
+ "index_name": 0,
+ "avatar": "",
+ "gender": 0,
+ "group_id": 0,
+ "id": 5,
+ "is_online": 0,
+ "motto": "",
+ "nickname": "test0",
+ "remark": "test0",
+ "avatar": "",
+ "friend_apply": 0,
+ "friend_status": 2,
+ "gender": 0,
+ "id": 5,
+ "mobile": "18798272053",
+ "motto": "",
+ "nickname": "test0",
+ "nickname_remark": "test0",
+ "remark_name": "test0",
+ "updated_at": "2023-07-03 07:33:06"
+ },
+ {
+ "index_name": 1,
+ "avatar": "",
+ "gender": 0,
+ "group_id": 0,
+ "id": 5,
+ "is_online": 0,
+ "motto": "",
+ "nickname": "test3",
+ "remark": "test3",
+ "avatar": "",
+ "friend_apply": 0,
+ "friend_status": 2,
+ "gender": 0,
+ "id": 5,
+ "mobile": "18798272053",
+ "motto": "",
+ "nickname": "test3",
+ "nickname_remark": "test3",
+ "remark_name": "test3",
+ "updated_at": "2023-07-03 07:33:06"
+ },
+ {
+ "index_name": 2,
+ "avatar": "",
+ "gender": 0,
+ "group_id": 0,
+ "id": 5,
+ "is_online": 0,
+ "motto": "",
+ "nickname": "test3",
+ "remark": "test3",
+ "avatar": "",
+ "friend_apply": 0,
+ "friend_status": 2,
+ "gender": 0,
+ "id": 5,
+ "mobile": "18798272053",
+ "motto": "",
+ "nickname": "test3",
+ "nickname_remark": "test3",
+ "remark_name": "test3",
+ "updated_at": "2023-07-03 07:33:06"
+ },
+ {
+ "index_name": 3,
+ "avatar": "",
+ "gender": 0,
+ "group_id": 0,
+ "id": 5,
+ "is_online": 0,
+ "motto": "",
+ "nickname": "test3",
+ "remark": "test3",
+ "avatar": "",
+ "friend_apply": 0,
+ "friend_status": 2,
+ "gender": 0,
+ "id": 5,
+ "mobile": "18798272053",
+ "motto": "",
+ "nickname": "test3",
+ "nickname_remark": "test3",
+ "remark_name": "test3",
+ "updated_at": "2023-07-03 07:33:06"
+ },
+ {
+ "index_name": 4,
+ "avatar": "",
+ "gender": 0,
+ "group_id": 0,
+ "id": 5,
+ "is_online": 0,
+ "motto": "",
+ "nickname": "test3",
+ "remark": "test3",
+ "avatar": "",
+ "friend_apply": 0,
+ "friend_status": 2,
+ "gender": 0,
+ "id": 5,
+ "mobile": "18798272053",
+ "motto": "",
+ "nickname": "test3",
+ "nickname_remark": "test3",
+ "remark_name": "test3",
+ "updated_at": "2023-07-03 07:33:06"
+ },
+ {
+ "index_name": 5,
+ "avatar": "",
+ "gender": 0,
+ "group_id": 0,
+ "id": 5,
+ "is_online": 0,
+ "motto": "",
+ "nickname": "test3",
+ "remark": "test3",
+ "avatar": "",
+ "friend_apply": 0,
+ "friend_status": 2,
+ "gender": 0,
+ "id": 5,
+ "mobile": "18798272053",
+ "motto": "",
+ "nickname": "test3",
+ "nickname_remark": "test3",
+ "remark_name": "test3",
+ "updated_at": "2023-07-03 07:33:06"
+ },
+ {
+ "index_name": 6,
+ "avatar": "",
+ "gender": 0,
+ "group_id": 0,
+ "id": 5,
+ "is_online": 0,
+ "motto": "",
+ "nickname": "test3",
+ "remark": "test3",
+ "avatar": "",
+ "friend_apply": 0,
+ "friend_status": 2,
+ "gender": 0,
+ "id": 5,
+ "mobile": "18798272053",
+ "motto": "",
+ "nickname": "test3",
+ "nickname_remark": "test3",
+ "remark_name": "test3",
+ "updated_at": "2023-07-03 07:33:06"
+ },
+ {
+ "index_name": 7,
+ "avatar": "",
+ "gender": 0,
+ "group_id": 0,
+ "id": 5,
+ "is_online": 0,
+ "motto": "",
+ "nickname": "test3",
+ "remark": "test3",
+ "avatar": "",
+ "friend_apply": 0,
+ "friend_status": 2,
+ "gender": 0,
+ "id": 5,
+ "mobile": "18798272053",
+ "motto": "",
+ "nickname": "test3",
+ "nickname_remark": "test3",
+ "remark_name": "test3",
+ "updated_at": "2023-07-03 07:33:06"
+ },
+ {
+ "index_name": 8,
+ "avatar": "",
+ "gender": 0,
+ "group_id": 0,
+ "id": 5,
+ "is_online": 0,
+ "motto": "",
+ "nickname": "test3",
+ "remark": "test3",
+ "avatar": "",
+ "friend_apply": 0,
+ "friend_status": 2,
+ "gender": 0,
+ "id": 5,
+ "mobile": "18798272053",
+ "motto": "",
+ "nickname": "test3",
+ "nickname_remark": "test3",
+ "remark_name": "test3",
+ "updated_at": "2023-07-03 07:33:06"
+ },
+ {
+ "index_name": 9,
+ "avatar": "",
+ "gender": 0,
+ "group_id": 0,
+ "id": 5,
+ "is_online": 0,
+ "motto": "",
+ "nickname": "test3",
+ "remark": "test3",
+ "avatar": "",
+ "friend_apply": 0,
+ "friend_status": 2,
+ "gender": 0,
+ "id": 5,
+ "mobile": "18798272053",
+ "motto": "",
+ "nickname": "test3",
+ "nickname_remark": "test3",
+ "remark_name": "test3",
+ "updated_at": "2023-07-03 07:33:06"
+ },
+ {
+ "index_name": 10,
+ "avatar": "",
+ "gender": 0,
+ "group_id": 0,
+ "id": 5,
+ "is_online": 0,
+ "motto": "",
+ "nickname": "test33",
+ "remark": "test33",
+ "avatar": "",
+ "friend_apply": 0,
+ "friend_status": 2,
+ "gender": 0,
+ "id": 5,
+ "mobile": "18798272053",
+ "motto": "",
+ "nickname": "test33",
+ "nickname_remark": "test33",
+ "remark_name": "test33",
+ "updated_at": "2023-07-03 07:33:06"
+ }
],
- userInfo:{},
+ userInfo: {},
dialogTableVisible: false,
dialogFormVisible: false,
- imageViewer:{},
- talksMap:{}
+ imageViewer: {},
+ talksMap: {}
}
},
computed: {
@@ -467,27 +427,27 @@
return index >= 0 && this.talks[index].is_online == 1
},
documentClientHeight: {
- get () { return this.$store.state.common.documentClientHeight },
- set (val) { this.$store.commit('common/updateDocumentClientHeight', val) }
+ get() { return this.$store.state.common.documentClientHeight },
+ set(val) { this.$store.commit('common/updateDocumentClientHeight', val) }
},
},
watch: {
},
created() {
- unreadNewAdminOnlineChatAction({},(data)=>{});
+ unreadNewAdminOnlineChatAction({}, (data) => { });
this.userlist();
},
mounted() {
this.resetDocumentClientHeight()
this.scrollEvent()
// 为全局事件总线绑定自定义事件
- this.$bus.$on('SET_IMAGE_VIEWER', (data)=>{
+ this.$bus.$on('SET_IMAGE_VIEWER', (data) => {
console.log("data = " + JSON.stringify(data));
this.imageViewer.isShow = data.isShow;
this.imageViewer.file = data.file;
console.log("this.imageViewer => " + JSON.stringify(this.imageViewer));
})
- this.$bus.$on('updateCurrentUserChatList', (data)=>{
+ this.$bus.$on('updateCurrentUserChatList', (data) => {
this.updateCurrentUserChatList(data);
})
@@ -495,9 +455,9 @@
this.interval && clearInterval(this.interval)
this.interval = setInterval(() => {
console.log("this.$route.path => " + this.$route.path)
- if(!this.IS_DEBUG && this.$route.path == "/message"){
+ if (!this.IS_DEBUG && this.$route.path == "/message") {
this.userlistTime();
- this.updateCurrentUserChatList({flag:false});
+ this.updateCurrentUserChatList({ flag: false });
}
}, 5000)
},
@@ -512,14 +472,14 @@
},
methods: {
// 重置窗口可视高度
- resetDocumentClientHeight () {
+ resetDocumentClientHeight() {
this.documentClientHeight = document.documentElement['clientHeight'] - 80
window.onresize = () => {
this.documentClientHeight = document.documentElement['clientHeight'] - 80
}
document.documentElement.clientHeight
},
- handleClose(){
+ handleClose() {
store.commit('SET_IMAGE_VIEWER', {})
},
// 美化时间格式
@@ -573,129 +533,129 @@
// 切换聊天栏目
clickTab(data) {
- console.log(" this.$store.state.talks.status = " + this.$store.state.talks.status);
+ console.log(" this.$store.state.talks.status = " + this.$store.state.talks.status);
// if(this.$store.state.talks.status == 0){
- this.$store.commit('SET_CLINK_STATUS', 1)
- this.index_name = data.id;
- this.getUserInfo(data.partyid);
+ this.$store.commit('SET_CLINK_STATUS', 1)
+ this.index_name = data.id;
+ this.getUserInfo(data.partyid);
// }
return;
},
//用户信息
- getUserInfo(id){
+ getUserInfo(id) {
console.log("this.$store.state.talks.status = " + this.$store.state.talks.status);
// if(this.$store.state.talks.status == 0){
- this.$store.commit('SET_STATUS', 1)
- console.log(" this.$store.state.talks.status = " + this.$store.state.talks.status);
- getUserInfoNewAdminOnlineChatAction({partyId: id||""},(data)=>{
- if(data==undefined){
- this.$store.commit('SET_STATUS', 0)
- console.log(" this.$store.state.talks.status = " + this.$store.state.talks.status);
- return;
- }
- console.log("this.$store.state.talks.status = " + JSON.stringify(data));
- if(data.code == 0){
- this.$store.commit('SET_CLINK_STATUS', 0)
- this.userInfo = data.data || {};
- this.$refs.talkPanel.selectUser(this.userInfo,true);
- }
- })
- // }
-
-
- },
- userlist(){
- userlistNewAdminOnlineChatAction({},(data) => {
- if(data==undefined){
+ this.$store.commit('SET_STATUS', 1)
+ console.log(" this.$store.state.talks.status = " + this.$store.state.talks.status);
+ getUserInfoNewAdminOnlineChatAction({ partyId: id || "" }, (data) => {
+ if (data == undefined) {
this.$store.commit('SET_STATUS', 0)
- console.log(" this.$store.state.talks.status = " + this.$store.state.talks.status);
+ console.log(" this.$store.state.talks.status = " + this.$store.state.talks.status);
return;
}
- if(data.code == 0){
+ console.log("this.$store.state.talks.status = " + JSON.stringify(data));
+ if (data.code == 0) {
+ this.$store.commit('SET_CLINK_STATUS', 0)
+ this.userInfo = data.data || {};
+ this.$refs.talkPanel.selectUser(this.userInfo, true);
+ }
+ })
+ // }
+
+
+ },
+ userlist() {
+ userlistNewAdminOnlineChatAction({}, (data) => {
+ if (data == undefined) {
+ this.$store.commit('SET_STATUS', 0)
+ console.log(" this.$store.state.talks.status = " + this.$store.state.talks.status);
+ return;
+ }
+ if (data.code == 0) {
this.talks = data.data || [];
// console.log("this.talks2 => " + JSON.stringify(this.talks));
- if(this.talks.length > 0){
+ if (this.talks.length > 0) {
// console.log("data.data => "+JSON.stringify(data.data));
this.index_name = this.talks[0].id;
this.getUserInfo(this.talks[0].partyid);
- }else{
+ } else {
// this.$refs.panelHeader.selectUser({});
console.log("clear");
this.$refs.talkPanel.clearHeader();
this.userInfo = {}
}
- }else{
+ } else {
console.log("clear 2");
// this.$refs.panelHeader.selectUser({});
this.$refs.talkPanel.clearHeader();
this.userInfo = {}
}
-
+
});
},
- userlistTime(){
- userlistNewAdminOnlineChatAction({},(data) => {
- if(data==undefined){
+ userlistTime() {
+ userlistNewAdminOnlineChatAction({}, (data) => {
+ if (data == undefined) {
this.$store.commit('SET_STATUS', 0)
- console.log(" this.$store.state.talks.status = " + this.$store.state.talks.status);
+ console.log(" this.$store.state.talks.status = " + this.$store.state.talks.status);
return;
}
- if(data.code == 0){
+ if (data.code == 0) {
this.talks = data.data || [];
// console.log("this.talks1 => " + JSON.stringify(this.talks));
- if(this.talks.length <= 0){
+ if (this.talks.length <= 0) {
this.$refs.talkPanel.clearHeader();
this.userInfo = {}
- }else{
+ } else {
// console.log("this.talks3 => " + JSON.stringify(this.talks));
// this.index_name = this.talks[0].id;
// this.getUserInfo(this.talks[0].partyid);
let flag = false;
- for(let i = 0 ; i < this.talks.length ; i++){
- if(this.talks[i].unreadmsg > 0){
+ for (let i = 0; i < this.talks.length; i++) {
+ if (this.talks[i].unreadmsg > 0) {
- if(this.talksMap[this.talks[i].partyid]){
+ if (this.talksMap[this.talks[i].partyid]) {
let date1s = this.talks[i].order_updatetime;
let date2s = this.talksMap[this.talks[i].partyid].order_updatetime;
var date1 = new Date(date1s)
var date2 = new Date(date2s)
if (date1.getTime() > date2.getTime()) {
- console.log("新消息")
- flag = true;
+ console.log("新消息")
+ flag = true;
} else {
- console.log("旧消息")
+ console.log("旧消息")
}
- }else{
+ } else {
flag = true;
}
}
- if(flag){
+ if (flag) {
this.playAudioOfMute();
}
-
+
this.talksMap[this.talks[i].partyid] = this.talks[i];
}
}
- }else{
+ } else {
this.$refs.talkPanel.clearHeader();
this.userInfo = {}
}
-
+
});
},
//刷新当前聊天记录
- updateCurrentUserChatList(data){
+ updateCurrentUserChatList(data) {
// if(this.$store.state.talks.status == 0){
- this.$store.commit('SET_STATUS', 1)
- console.log(" this.$store.state.talks.status = " + this.$store.state.talks.status);
- this.$refs.talkPanel.selectUser(this.userInfo,data.flag);
+ this.$store.commit('SET_STATUS', 1)
+ console.log(" this.$store.state.talks.status = " + this.$store.state.talks.status);
+ this.$refs.talkPanel.selectUser(this.userInfo, data.flag);
// }
},
// 修改当前对话
@@ -859,16 +819,16 @@
}
})
- .catch(() => {})
+ .catch(() => { })
},
//搜索
- search(){
+ search() {
this.$store.commit('SET_STATUS', 0)
- console.log(" this.$store.state.talks.status = " + this.$store.state.talks.status);
+ console.log(" this.$store.state.talks.status = " + this.$store.state.talks.status);
console.log("search = " + this.input);
- createNewAdminOnlineChatAction({partyId: this.input},(data)=>{
- if(data.code == 0){
+ createNewAdminOnlineChatAction({ partyId: this.input }, (data) => {
+ if (data.code == 0) {
this.userlist();
}
})
@@ -883,8 +843,8 @@
case 'remarks':
this.userInfo.remarks = event_name.data;
// this.talks.forEach(item => {if (item.id == this.userInfo.id) {item.remark_name = event_name.data}});
- for(let i = 0 ; i < this.talks.length ; i++){
- if(this.talks[i].id == this.index_name){
+ for (let i = 0; i < this.talks.length; i++) {
+ if (this.talks[i].id == this.index_name) {
this.talks[i].remarks = event_name.data;
}
}
@@ -904,10 +864,10 @@
console.log("imageViewer.file = " + JSON.stringify(this.imageViewer.file));
const isLt2M = this.imageViewer.size / 1024 / 1024 < 2;
- if (!isLt2M) {
- Toast.fail('上传图片大小不能超过 2MB!');
- return false;
- }
+ if (!isLt2M) {
+ Toast.fail('上传图片大小不能超过 2MB!');
+ return false;
+ }
this.$http({
url: this.$http.adornUrl('/api/uploadFile'),
@@ -922,16 +882,16 @@
}).then(({ data }) => {
//
console.log("uploaded image = " + JSON.stringify(data));
- if(data.code == 0){
+ if (data.code == 0) {
- }else{
- this.$message(''+data.msg)
+ } else {
+ this.$message('' + data.msg)
}
//
})
- .finally(() => {
- ref.loading = false
- })
+ .finally(() => {
+ ref.loading = false
+ })
},
},
@@ -1049,7 +1009,7 @@
flex: 1 1;
margin-left: 10px;
overflow: hidden;
-
+
.title {
width: 100%;
height: 25px;
@@ -1080,8 +1040,6 @@
line-height: 22px;
letter-spacing: 0em;
text-align: left;
-
-
}
.nickname-1 {
@@ -1097,7 +1055,6 @@
line-height: 20px;
letter-spacing: 0em;
text-align: left;
-
}
.top {
@@ -1114,6 +1071,7 @@
.disturb {
color: #98999c !important;
background-color: #ecedf1 !important;
+
i {
font-size: 12px;
}
@@ -1153,6 +1111,7 @@
}
}
}
+
&:hover {
background-color: #f3f5fa;
@@ -1206,7 +1165,6 @@
background-color: #eff0f1;
}
}
-
</style>
@@ -1217,7 +1175,7 @@
padding: 0;
}
-.padding0{
+.padding0 {
padding: 0;
}
@@ -1241,12 +1199,13 @@
0% {
transform: rotate(0);
}
+
100% {
transform: rotate(360deg);
}
}
-.loadingText{
+.loadingText {
position: relative;
left: 50%;
top: 50%;
@@ -1255,5 +1214,4 @@
text-align: center;
line-height: 50px;
}
-
</style>
\ No newline at end of file
--
Gitblit v1.9.3