whx 5 kuukautta sitten
vanhempi
commit
1a025438c9
39 muutettua tiedostoa jossa 850 lisäystä ja 68 poistoa
  1. BIN
      virgo.wzfrontend/.DS_Store
  2. 10 0
      virgo.wzfrontend/console/package-lock.json
  3. 3 1
      virgo.wzfrontend/console/package.json
  4. 200 0
      virgo.wzfrontend/console/src/components/common/uniDateformat/date-format.js
  5. 88 0
      virgo.wzfrontend/console/src/components/common/uniDateformat/index.vue
  6. 25 0
      virgo.wzfrontend/console/src/httpApi/chat.js
  7. 135 0
      virgo.wzfrontend/console/src/layout/components/chat.vue
  8. 54 3
      virgo.wzfrontend/console/src/layout/work.vue
  9. 4 0
      virgo.wzfrontend/console/src/main.js
  10. 1 0
      virgo.wzfrontend/console/src/store/getters.js
  11. 10 1
      virgo.wzfrontend/console/src/store/modules/app.js
  12. 232 0
      virgo.wzfrontend/console/src/uitls/chat.js
  13. 2 1
      virgo.wzfrontend/console/src/views/login/index.vue
  14. 8 6
      virgo.wzfrontend/console/src/views/show/index.vue
  15. BIN
      virgo.wzfrontend/src/.DS_Store
  16. BIN
      virgo.wzfrontend/src/main/.DS_Store
  17. BIN
      virgo.wzfrontend/src/main/resources/.DS_Store
  18. BIN
      virgo.wzfrontend/src/main/resources/static/.DS_Store
  19. 1 1
      virgo.wzfrontend/src/main/resources/static/console/index.html
  20. 0 0
      virgo.wzfrontend/src/main/resources/static/console/static/css/1275.3f9acf7e.css
  21. 0 0
      virgo.wzfrontend/src/main/resources/static/console/static/css/3369.3f9acf7e.css
  22. 0 0
      virgo.wzfrontend/src/main/resources/static/console/static/css/4859.818775fa.css
  23. 1 0
      virgo.wzfrontend/src/main/resources/static/console/static/css/app.ab4dcab7.css
  24. 0 1
      virgo.wzfrontend/src/main/resources/static/console/static/css/app.adfd33a8.css
  25. 17 6
      virgo.wzfrontend/src/main/resources/static/console/static/js/5945-legacy.e06c1839.js
  26. 53 0
      virgo.wzfrontend/src/main/resources/static/console/static/js/3369-legacy.e4239068.js
  27. 0 42
      virgo.wzfrontend/src/main/resources/static/console/static/js/459.397c373d.js
  28. 1 1
      virgo.wzfrontend/src/main/resources/static/console/static/js/4962-legacy.78f7b5e8.js
  29. 1 1
      virgo.wzfrontend/src/main/resources/static/console/static/js/4962.a7e825ae.js
  30. 1 0
      virgo.wzfrontend/src/main/resources/static/console/static/js/5352-legacy.dd8dc7b9.js
  31. 1 0
      virgo.wzfrontend/src/main/resources/static/console/static/js/5352.97d0e1b3.js
  32. 0 1
      virgo.wzfrontend/src/main/resources/static/console/static/js/9794-legacy.2cbeaea9.js
  33. 0 1
      virgo.wzfrontend/src/main/resources/static/console/static/js/9794.0e34e0b2.js
  34. 1 0
      virgo.wzfrontend/src/main/resources/static/console/static/js/app-legacy.34c2e64e.js
  35. 0 1
      virgo.wzfrontend/src/main/resources/static/console/static/js/app-legacy.9588ef5d.js
  36. 1 0
      virgo.wzfrontend/src/main/resources/static/console/static/js/app.b8c224d6.js
  37. 0 1
      virgo.wzfrontend/src/main/resources/static/console/static/js/app.ebe0acf1.js
  38. BIN
      virgo.wzfrontend/yui_wx/.DS_Store
  39. BIN
      virgo.wzfrontend/yui_wx/unpackage/dist/.DS_Store

BIN
virgo.wzfrontend/.DS_Store


+ 10 - 0
virgo.wzfrontend/console/package-lock.json

@@ -8758,6 +8758,11 @@
 			"resolved": "https://registry.npmmirror.com/js-base64/-/js-base64-2.6.4.tgz",
 			"integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ=="
 		},
+		"js-md5": {
+			"version": "0.8.3",
+			"resolved": "https://registry.npmmirror.com/js-md5/-/js-md5-0.8.3.tgz",
+			"integrity": "sha512-qR0HB5uP6wCuRMrWPTrkMaev7MJZwJuuw4fnwAzRgP4J4/F8RwtodOKpGp4XpqsLBFzzgqIO42efFAyz2Et6KQ=="
+		},
 		"js-message": {
 			"version": "1.0.7",
 			"resolved": "https://registry.npmmirror.com/js-message/-/js-message-1.0.7.tgz",
@@ -14934,6 +14939,11 @@
 			"integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==",
 			"dev": true
 		},
+		"yeim-uni-sdk": {
+			"version": "1.2.81",
+			"resolved": "https://registry.npmmirror.com/yeim-uni-sdk/-/yeim-uni-sdk-1.2.81.tgz",
+			"integrity": "sha512-QTRR4js0mEz2zI4LW6vaLN3hpzoCmiz15fTH6ECuB6bIh/MYp264EqgpTZghzLR1BBQr8Up4Mst3PE69pWFrzg=="
+		},
 		"yocto-queue": {
 			"version": "0.1.0",
 			"resolved": "https://registry.npmmirror.com/yocto-queue/-/yocto-queue-0.1.0.tgz",

+ 3 - 1
virgo.wzfrontend/console/package.json

@@ -15,6 +15,7 @@
 		"element-ui": "^2.15.13",
 		"ezuikit-js": "^7.7.0",
 		"jquery": "^3.7.1",
+		"js-md5": "^0.8.3",
 		"luckyexcel": "^1.0.1",
 		"path-browserify": "^1.0.1",
 		"pinyin-pro": "^3.25.0",
@@ -26,7 +27,8 @@
 		"vue": "^2.6.10",
 		"vue-organization-chart": "^1.1.6",
 		"vue-router": "^3.1.3",
-		"vuex": "^3.0.1"
+		"vuex": "^3.0.1",
+		"yeim-uni-sdk": "^1.2.81"
 	},
 	"devDependencies": {
 		"@vue/cli-plugin-babel": "^5.0.8",

+ 200 - 0
virgo.wzfrontend/console/src/components/common/uniDateformat/date-format.js

@@ -0,0 +1,200 @@
+// yyyy-MM-dd hh:mm:ss.SSS 所有支持的类型
+function pad(str, length = 2) {
+	str += ''
+	while (str.length < length) {
+		str = '0' + str
+	}
+	return str.slice(-length)
+}
+
+const parser = {
+	yyyy: (dateObj) => {
+		return pad(dateObj.year, 4)
+	},
+	yy: (dateObj) => {
+		return pad(dateObj.year)
+	},
+	MM: (dateObj) => {
+		return pad(dateObj.month)
+	},
+	M: (dateObj) => {
+		return dateObj.month
+	},
+	dd: (dateObj) => {
+		return pad(dateObj.day)
+	},
+	d: (dateObj) => {
+		return dateObj.day
+	},
+	hh: (dateObj) => {
+		return pad(dateObj.hour)
+	},
+	h: (dateObj) => {
+		return dateObj.hour
+	},
+	mm: (dateObj) => {
+		return pad(dateObj.minute)
+	},
+	m: (dateObj) => {
+		return dateObj.minute
+	},
+	ss: (dateObj) => {
+		return pad(dateObj.second)
+	},
+	s: (dateObj) => {
+		return dateObj.second
+	},
+	SSS: (dateObj) => {
+		return pad(dateObj.millisecond, 3)
+	},
+	S: (dateObj) => {
+		return dateObj.millisecond
+	},
+}
+
+// 这都n年了iOS依然不认识2020-12-12,需要转换为2020/12/12
+function getDate(time) {
+	if (time instanceof Date) {
+		return time
+	}
+	switch (typeof time) {
+		case 'string':
+			{
+				// 2020-12-12T12:12:12.000Z、2020-12-12T12:12:12.000
+				if (time.indexOf('T') > -1) {
+					return new Date(time)
+				}
+				return new Date(time.replace(/-/g, '/'))
+			}
+		default:
+			return new Date(time)
+	}
+}
+
+export function formatDate(date, format = 'yyyy/MM/dd hh:mm:ss') {
+	if (!date && date !== 0) {
+		return ''
+	}
+	date = getDate(date)
+	const dateObj = {
+		year: date.getFullYear(),
+		month: date.getMonth() + 1,
+		day: date.getDate(),
+		hour: date.getHours(),
+		minute: date.getMinutes(),
+		second: date.getSeconds(),
+		millisecond: date.getMilliseconds()
+	}
+	const tokenRegExp = /yyyy|yy|MM|M|dd|d|hh|h|mm|m|ss|s|SSS|SS|S/
+	let flag = true
+	let result = format
+	while (flag) {
+		flag = false
+		result = result.replace(tokenRegExp, function(matched) {
+			flag = true
+			return parser[matched](dateObj)
+		})
+	}
+	return result
+}
+
+export function friendlyDate(time, {
+	locale = 'zh',
+	threshold = [60000, 3600000],
+	format = 'yyyy/MM/dd hh:mm:ss'
+}) {
+	if (time === '-') {
+		return time
+	}
+	if (!time && time !== 0) {
+		return ''
+	}
+	const localeText = {
+		zh: {
+			year: '年',
+			month: '月',
+			day: '天',
+			hour: '小时',
+			minute: '分钟',
+			second: '秒',
+			ago: '前',
+			later: '后',
+			justNow: '刚刚',
+			soon: '刚刚',
+			template: '{num}{unit}{suffix}'
+		},
+		en: {
+			year: 'year',
+			month: 'month',
+			day: 'day',
+			hour: 'hour',
+			minute: 'minute',
+			second: 'second',
+			ago: 'ago',
+			later: 'later',
+			justNow: 'just now',
+			soon: 'soon',
+			template: '{num} {unit} {suffix}'
+		}
+	}
+	const text = localeText[locale] || localeText.zh
+	let date = getDate(time)
+	let ms = date.getTime() - Date.now()
+	let absMs = Math.abs(ms)
+	if (absMs < threshold[0]) {
+		return ms < 0 ? text.justNow : text.soon
+	}
+	if (absMs >= threshold[1]) {
+		return formatDate(date, format)
+	}
+	let num
+	let unit
+	let suffix = text.later
+	if (ms < 0) {
+		suffix = text.ago
+		ms = -ms
+	}
+	const seconds = Math.floor((ms) / 1000)
+	const minutes = Math.floor(seconds / 60)
+	const hours = Math.floor(minutes / 60)
+	const days = Math.floor(hours / 24)
+	const months = Math.floor(days / 30)
+	const years = Math.floor(months / 12)
+	switch (true) {
+		case years > 0:
+			num = years
+			unit = text.year
+			break
+		case months > 0:
+			num = months
+			unit = text.month
+			break
+		case days > 0:
+			num = days
+			unit = text.day
+			break
+		case hours > 0:
+			num = hours
+			unit = text.hour
+			break
+		case minutes > 0:
+			num = minutes
+			unit = text.minute
+			break
+		default:
+			num = seconds
+			unit = text.second
+			break
+	}
+
+	if (locale === 'en') {
+		if (num === 1) {
+			num = 'a'
+		} else {
+			unit += 's'
+		}
+	}
+
+	return text.template.replace(/{\s*num\s*}/g, num + '').replace(/{\s*unit\s*}/g, unit).replace(/{\s*suffix\s*}/g,
+		suffix)
+}

+ 88 - 0
virgo.wzfrontend/console/src/components/common/uniDateformat/index.vue

@@ -0,0 +1,88 @@
+<template>
+	<span>{{dateShow}}</span>
+</template>
+
+<script>
+	import {friendlyDate} from './date-format.js'
+	/**
+	 * Dateformat 日期格式化
+	 * @description 日期格式化组件
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=3279
+	 * @property {Object|String|Number} date 日期对象/日期字符串/时间戳
+	 * @property {String} locale 格式化使用的语言
+	 * 	@value zh 中文
+	 * 	@value en 英文
+	 * @property {Array} threshold 应用不同类型格式化的阈值
+	 * @property {String} format 输出日期字符串时的格式
+	 */
+	export default {
+		name: 'uniDateformat',
+		props: {
+			date: {
+				type: [Object, String, Number],
+				default () {
+					return '-'
+				}
+			},
+			locale: {
+				type: String,
+				default: 'zh',
+			},
+			threshold: {
+				type: Array,
+				default () {
+					return [0, 0]
+				}
+			},
+			format: {
+				type: String,
+				default: 'yyyy/MM/dd hh:mm:ss'
+			},
+			// refreshRate使用不当可能导致性能问题,谨慎使用
+			refreshRate: {
+				type: [Number, String],
+				default: 0
+			}
+		},
+		data() {
+			return {
+				refreshMark: 0
+			}
+		},
+		computed: {
+			dateShow() {
+				this.refreshMark
+				return friendlyDate(this.date, {
+					locale: this.locale,
+					threshold: this.threshold,
+					format: this.format
+				})
+			}
+		},
+		watch: {
+			refreshRate: {
+				handler() {
+					this.setAutoRefresh()
+				},
+				immediate: true
+			}
+		},
+		methods: {
+			refresh() {
+				this.refreshMark++
+			},
+			setAutoRefresh() {
+				clearInterval(this.refreshInterval)
+				if (this.refreshRate) {
+					this.refreshInterval = setInterval(() => {
+						this.refresh()
+					}, parseInt(this.refreshRate))
+				}
+			}
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 25 - 0
virgo.wzfrontend/console/src/httpApi/chat.js

@@ -0,0 +1,25 @@
+import request from '@/axios'
+/* 
+ * 聊天登录
+ * 
+ * 
+ */
+export function login(data) {
+	return request({
+		url: `/im/user/token/get`,
+		method: 'post',
+		data: data
+	})
+}
+/* 
+ * 发送聊天消息
+ * 
+ * 
+ */
+export function sendSystem(data) {
+	return request({
+		url: `/im/message/save`,
+		method: 'post',
+		data: data
+	})
+}

+ 135 - 0
virgo.wzfrontend/console/src/layout/components/chat.vue

@@ -0,0 +1,135 @@
+<template>
+	<div class="chat-index">
+		<div class="message-list">
+			<div :class="nowChat.conversationId === item.conversationId ? 'message-item active': 'message-item'"
+				v-for="(item,index) in chatData" :key="index" @click="linkTo(item)">
+				<el-badge :value="item.unread" class="item" :hidden="!item.unread">
+					<el-image :src="item.userInfo.avatarUrl" class="message-image" fit="fit">
+						<div slot="error" class="image-slot">
+							<i class="el-icon-picture-outline"></i>
+						</div>
+					</el-image>
+				</el-badge>
+				<div class="message-content">
+					<div class="message-title">{{item.userInfo.nickname}}</div>
+					<div class="message-sub-content">
+						{{item.lastMessage.type === 'image'?'[图片]':item.lastMessage.body.text}}
+					</div>
+				</div>
+				<div class="message-date">
+					<uni-dateformat class="visitor-time" :date="item.updatedAt || item.createdAt"
+						:threshold="[60000,3600000 * 24 * 365]">
+					</uni-dateformat>
+				</div>
+			</div>
+		</div>
+	</div>
+</template>
+
+<script>
+	import uniDateformat from '@/components/common/uniDateformat'
+	export default {
+		data() {
+			return {
+				chatData: [],
+				nowChat: {}
+			}
+		},
+		created() {
+			this.chatData = this.$store.getters.chatList;
+			if (this.chatData.length > 0) this.nowChat = this.chatData[0];
+		},
+		methods: {
+			linkTo(item) {
+				this.nowChat = item;
+			}
+		},
+		components: {
+			uniDateformat
+		}
+	}
+</script>
+
+<style lang="scss">
+	.chat-index {
+		display: flex;
+		height: 100%;
+		width: 100%;
+
+		.image-slot {
+			width: 100%;
+			height: 100%;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			background: #60656e;
+		}
+
+		.el-badge__content {
+			border: none;
+		}
+
+		.message-list {
+			width: 300px;
+			border-right: 1px solid $--color-border;
+			height: 100%;
+			overflow-y: auto;
+
+			.message-item {
+				display: flex;
+				padding: 12px 15px;
+				position: relative;
+				cursor: pointer;
+
+				&::before {
+					content: '';
+					position: absolute;
+					bottom: 0;
+					right: 0;
+					left: 15px;
+					height: 1px;
+					background: $--color-border;
+				}
+
+				&:hover,
+				&.active {
+					background: $--color-background-hover;
+				}
+			}
+
+			.message-image {
+				width: 50px;
+				height: 50px;
+				border-radius: 8px;
+				overflow: hidden;
+			}
+
+			.message-content {
+				flex: 1;
+				width: 0;
+				margin-left: 10px;
+				display: flex;
+				flex-direction: column;
+				justify-content: center;
+			}
+
+			.message-title {
+				font-size: 16px;
+				font-weight: 600;
+				margin-bottom: 5px;
+			}
+
+			.message-sub-content {
+				font-weight: 300;
+			}
+
+			.message-date {
+				position: absolute;
+				top: 17px;
+				right: 15px;
+				font-size: 12px;
+				font-weight: 300;
+			}
+		}
+	}
+</style>

+ 54 - 3
virgo.wzfrontend/console/src/layout/work.vue

@@ -21,6 +21,17 @@
 				<router-view :key="key" />
 			</transition>
 		</div>
+		<div class="chat-box">
+			<el-badge :value="badge" :hidden="!badge" class="item">
+				<div class="chat" @click="visible = true">
+					<i class="el-icon-s-comment"></i>
+				</div>
+			</el-badge>
+		</div>
+		<el-dialog :close-on-click-modal="false" title="聊天列表" :visible.sync="visible" width="900px"
+			:append-to-body="true">
+			<chat></chat>
+		</el-dialog>
 	</div>
 </template>
 
@@ -28,6 +39,7 @@
 	import subMenu from './components/subMenu'
 	import topNav from './components/topNav'
 	import breadCrumb from './components/breadCrumb'
+	import chat from './components/chat'
 	import {
 		mapGetters
 	} from 'vuex';
@@ -36,7 +48,10 @@
 			return {
 				menuList: [],
 				isCollapse: false,
-				crumbKey: false
+				crumbKey: false,
+				visible: false,
+				chatData: [],
+				badge: 0
 			}
 		},
 		created() {
@@ -45,6 +60,18 @@
 		methods: {
 			init() {
 				this.menuList = this.$store.getters.menuData.filter(node => node.title !== '系统设置');
+				this.$chat.getConversationList(data => {
+					this.countNumber(data.data)
+				});
+			},
+			countNumber(data) {
+				this.chatData = data.filter(node => node.conversationId !== 'system');
+				let badge = 0;
+				let list = this.chatList;
+				for (let i = 0; i < list.length; i++) {
+					badge += list[i].unread
+				}
+				this.badge = badge;
 			},
 			set() {
 				let list = this.$store.getters.menuData.filter(node => node.title === '系统设置');
@@ -56,7 +83,8 @@
 		components: {
 			subMenu,
 			topNav,
-			breadCrumb
+			breadCrumb,
+			chat
 		},
 		computed: {
 			key() {
@@ -64,12 +92,15 @@
 				if (this.$route.path.indexOf('/work/system') > -1) return list[0].children[0].index;
 				return this.$route.path;
 			},
-			...mapGetters(['menuData'])
+			...mapGetters(['menuData', 'chatList'])
 		},
 		watch: {
 			menuData() {
 				this.menuList = this.$store.getters.menuData.filter(node => node.title !== '系统设置');
 				this.crumbKey = !this.crumbKey;
+			},
+			chatList() {
+				this.countNumber(this.$store.getters.chatList)
 			}
 		},
 	}
@@ -83,6 +114,26 @@
 		position: relative;
 		background: $--background;
 
+		.chat-box {
+			position: fixed;
+			bottom: 40px;
+			right: 20px;
+			font-size: 26px;
+			cursor: pointer;
+			z-index: 999;
+
+			.chat {
+				width: 50px;
+				height: 50px;
+				background: $--color-primary;
+				color: #fff;
+				border-radius: 50px;
+				display: flex;
+				align-items: center;
+				justify-content: center;
+			}
+		}
+
 		.work-layout-main {
 			position: fixed;
 			left: 0;

+ 4 - 0
virgo.wzfrontend/console/src/main.js

@@ -32,6 +32,10 @@ Vue.prototype.$msg = message;
 
 import device from './uitls/device.js'
 Vue.prototype.$device = device;
+
+import chat from './uitls/chat.js'
+chat.init();
+Vue.prototype.$chat = chat;
 
 Vue.prototype.$confirm = (title, callback) => {
 	return ElementUI.MessageBox.confirm(title, '红链提示', {

+ 1 - 0
virgo.wzfrontend/console/src/store/getters.js

@@ -13,5 +13,6 @@ const getters = {
 	contractData: state => state.projectBase.contractData, //合同缓存
 	city: state => state.app.city, //当前位置
 	event: state => state.app.event, //事件
+	chatList: state => state.app.chatList //消息列表
 }
 export default getters

+ 10 - 1
virgo.wzfrontend/console/src/store/modules/app.js

@@ -11,7 +11,8 @@ const state = {
 	document: {},
 	identity: {},
 	city: {},
-	event: {}
+	event: {},
+	chatList: []
 }
 
 const mutations = {
@@ -41,6 +42,9 @@ const mutations = {
 	},
 	CHANGE_EVENT: (state, event) => {
 		state.event = event;
+	},
+	CHANGE_CHAT_LIST: (state, chatList) => {
+		state.chatList = chatList;
 	}
 }
 
@@ -89,6 +93,11 @@ const actions = {
 		commit
 	}, event) {
 		commit('CHANGE_EVENT', event);
+	},
+	changeChatList({
+		commit
+	}, chatList) {
+		commit('CHANGE_CHAT_LIST', chatList);
 	}
 }
 

+ 232 - 0
virgo.wzfrontend/console/src/uitls/chat.js

@@ -0,0 +1,232 @@
+import {
+	YeIMUniSDK, // SDK
+	YeIMUniSDKDefines // 预定义常量
+} from 'yeim-uni-sdk'
+import {
+	login,
+	sendSystem
+} from '@/httpApi/chat.js'
+import md5 from 'js-md5'
+import config from "@/config";
+import store from '@/store'
+let isListenerChatList = false;
+const connect = success => {
+	if (!store.getters.user.userId) return;
+	let code = YeIMUniSDK.getInstance().readyState();
+	if (code !== 3) {
+		if (success) success();
+		return;
+	}
+	YeIMUniSDK.getInstance().connect({
+		userId: store.getters.user.userId,
+		token: localStorage.getItem('chatToken'),
+		success: (response) => {
+			if (response.code === 200) {
+				$chat.listenerList();
+				if (success) success();
+			}
+		},
+		fail: (err) => {
+			console.log('error');
+			logins();
+		}
+	});
+}
+const logins = () => {
+	let timestamp = (new Date()).getTime() + 86400 * 1000; //1000天后过期
+	let sign = md5(String(store.getters.user.userId) + timestamp + "50abd47112ebe8c5a73f4694c96a49ce");
+	login({
+		userId: store.getters.user.userId,
+		timestamp: timestamp,
+		sign: sign
+	}).then(res => {
+		if (res.state) {
+			localStorage.setItem('chatToken', res.data.token);
+			connect();
+		}
+	})
+}
+const $chat = {
+	init() {
+		YeIMUniSDK.init({
+			baseURL: config.baseURL + '/im', // YeIMServer http url (如无特殊需求,服务端启动后仅需修改ip或者域名即可)
+			socketURL: 'wss://www.waywish.com/im/im', // YeIMServer socket url(如无特殊需求,服务端启动后仅需修改ip或者域名即可)
+			/**
+			 * 	日志等级
+			 *  0 普通日志,日志量较多,接入时建议使用
+			 *	1 关键性日志,日志量较少,生产环境时建议使用 
+			 *	2 无日志级别,SDK 将不打印任何日志
+			 */
+			logLevel: 0, // 日志等级, 
+			reConnectInterval: 3000, // 重连时间间隔
+			reConnectTotal: 99, // 最大重连次数,0不限制一直重连 
+			heartInterval: 35000, //心跳时间间隔(默认30s) 
+		});
+	},
+	connect() {
+		if (!localStorage.getItem('chatToken')) {
+			logins()
+		} else {
+			connect();
+		}
+	},
+	getConversationList(success) {
+		connect(() => {
+			YeIMUniSDK.getInstance().getConversationList({
+				page: 1, //页码
+				limit: 100, //每页数量
+				success: success,
+				fail: (err) => {
+					console.log('error');
+				}
+			});
+		});
+	},
+	getHistoryMessageList(nextMessageId, userId, success, fail) {
+		connect(() => {
+			YeIMUniSDK.getInstance().getHistoryMessageList({
+				nextMessageId: nextMessageId,
+				conversationId: userId,
+				success: success,
+				fail: fail
+			});
+		});
+	},
+	sendImage(userId, success) {
+		connect(() => {
+			uni.chooseImage({
+				count: 1, //图片数量
+				sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+				sourceType: ['album'], //从相册选择
+				success: res => {
+					uni.getImageInfo({
+						src: res.tempFilePaths[0],
+						success: image => {
+							//创建图片消息
+							let message = YeIMUniSDK.getInstance()
+								.createImageMessage({
+									toId: userId, //接收者用户ID字符串
+									conversationType: YeIMUniSDKDefines
+										.CONVERSATION_TYPE
+										.PRIVATE, //会话类型:私聊
+									body: {
+										file: {
+											tempFilePath: res.tempFilePaths[
+												0], //本地图片临时路径
+											width: image.width, //图片宽度
+											height: image.height //图片高度
+										}
+									},
+									extra: "",
+									onProgress: (progress) => {
+										// console.log(progress);
+									}
+								});
+							//发送消息
+							uni.showLoading();
+							YeIMUniSDK.getInstance().sendMessage({
+								message: message,
+								success: success,
+								fail: (err) => {
+									uni.hideLoading();
+									uni.showToast({
+										title: '发送失败',
+										icon: "none"
+									});
+								}
+							});
+						}
+					});
+				}
+			});
+		});
+	},
+	sendText(userId, content, success) {
+		connect(() => {
+			//创建文字消息
+			let message = YeIMUniSDK.getInstance().createTextMessage({
+				toId: userId, //接收者用户ID字符串
+				conversationType: YeIMUniSDKDefines.CONVERSATION_TYPE.PRIVATE, //会话类型:私聊
+				body: {
+					text: content //文本消息内容字符串
+				},
+				extra: ""
+			});
+			//发送消息
+			YeIMUniSDK.getInstance().sendMessage({
+				message: message,
+				success: success,
+				fail: (err) => {
+					uni.hideLoading();
+					uni.showToast({
+						title: '发送失败',
+						icon: "none"
+					});
+				}
+			});
+		});
+	},
+	disConnect() {
+		YeIMUniSDK.getInstance().disConnect();
+	},
+	listenerLogin() {
+		//监听登陆互踢,当同一用户重复登录时触发
+		YeIMUniSDK.getInstance().addEventListener(YeIMUniSDKDefines.EVENT.KICKED_OUT, () => {
+			// uni.removeStorageSync('token');
+			// uni.removeStorageSync('chatToken');
+			// uni.showToast({
+			// 	title: '该用户已在其他设备登录',
+			// 	icon: 'none'
+			// })
+			// uni.switchTab({
+			// 	url: '/pages/highseas/highseas'
+			// });
+		});
+	},
+	listenerList() {
+		if (isListenerChatList) return;
+		connect(() => {
+			isListenerChatList = true;
+			//监听会话列表更新
+			YeIMUniSDK.getInstance().addEventListener(YeIMUniSDKDefines.EVENT.CONVERSATION_LIST_CHANGED, (
+				list) => {
+				store.dispatch('app/changeChatList', list);
+			});
+		})
+	},
+	clearConversationUnread(conversationId) {
+		//清除指定会话未读数,并给对方发送已读回执
+		YeIMUniSDK.getInstance().clearConversationUnread(conversationId);
+	},
+	sendSystemMessage() {
+		let timestamp = (new Date()).getTime() + 86400 * 1000; //1000天后过期
+		let sign = md5('system' + timestamp + "50abd47112ebe8c5a73f4694c96a49ce");
+		login({
+			userId: 'system',
+			timestamp: timestamp,
+			sign: sign
+		}).then(res => {
+			if (res.code === 200) {
+				localStorage.setItem('systemChatToken', res.data.token);
+				sendSystem({
+					body: {
+						text: "2"
+					},
+					conversationId: "4",
+					conversationType: "private",
+					extra: "",
+					from: 'system',
+					fromUserInfo: {},
+					isDeleted: 0,
+					isRead: 0,
+					isRevoke: 0,
+					status: "unSend",
+					time: new Date().getTime(),
+					to: 1,
+					type: "text",
+				})
+			}
+		})
+	}
+}
+export default $chat;

+ 2 - 1
virgo.wzfrontend/console/src/views/login/index.vue

@@ -89,7 +89,8 @@
 				},
 			};
 		},
-		created() {
+		created() {
+			localStorage.removeItem('chatToken')
 			this.imgCodeFunc();
 			if (this.$store.getters.codeNumber != 60) this.codeReset();
 		},

+ 8 - 6
virgo.wzfrontend/console/src/views/show/index.vue

@@ -24,15 +24,15 @@
 			<div class="img-box">
 				<img src="https://file-node.oss-cn-shanghai.aliyuncs.com/youji/782a1b2730864af58b4f0cd76c53bb4f"
 					alt="bg.jpeg" />
-			</div>
-		<!-- 	<div class="chart-tops">
-				<page-data type="top"></page-data>
+			</div>
+			<!-- 	<div class="chart-tops">
+				<page-data type="top"></page-data>
 			</div> -->
 			<div class="chart-left">
 				<page-data type="left"></page-data>
 			</div>
-			<div class="chart-right">
-				<page-data type="right"></page-data>
+			<div class="chart-right">
+				<page-data type="right"></page-data>
 			</div>
 		</div>
 	</div>
@@ -68,7 +68,9 @@
 				}, false)
 			})
 		},
-		created() {},
+		created() {
+			this.$chat.connect();
+		},
 		methods: {
 			selectItem() {
 				console.log(this.bimViewer.getCameraState());

BIN
virgo.wzfrontend/src/.DS_Store


BIN
virgo.wzfrontend/src/main/.DS_Store


BIN
virgo.wzfrontend/src/main/resources/.DS_Store


BIN
virgo.wzfrontend/src/main/resources/static/.DS_Store


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
virgo.wzfrontend/src/main/resources/static/console/index.html


virgo.wzfrontend/src/main/resources/static/console/static/css/459.3f9acf7e.css → virgo.wzfrontend/src/main/resources/static/console/static/css/1275.3f9acf7e.css


virgo.wzfrontend/src/main/resources/static/console/static/css/5945.3f9acf7e.css → virgo.wzfrontend/src/main/resources/static/console/static/css/3369.3f9acf7e.css


virgo.wzfrontend/src/main/resources/static/console/static/css/4962.818775fa.css → virgo.wzfrontend/src/main/resources/static/console/static/css/4859.818775fa.css


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
virgo.wzfrontend/src/main/resources/static/console/static/css/app.ab4dcab7.css


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 1
virgo.wzfrontend/src/main/resources/static/console/static/css/app.adfd33a8.css


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 17 - 6
virgo.wzfrontend/src/main/resources/static/console/static/js/5945-legacy.e06c1839.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 53 - 0
virgo.wzfrontend/src/main/resources/static/console/static/js/3369-legacy.e4239068.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 42
virgo.wzfrontend/src/main/resources/static/console/static/js/459.397c373d.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
virgo.wzfrontend/src/main/resources/static/console/static/js/4962-legacy.78f7b5e8.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
virgo.wzfrontend/src/main/resources/static/console/static/js/4962.a7e825ae.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
virgo.wzfrontend/src/main/resources/static/console/static/js/5352-legacy.dd8dc7b9.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
virgo.wzfrontend/src/main/resources/static/console/static/js/5352.97d0e1b3.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 1
virgo.wzfrontend/src/main/resources/static/console/static/js/9794-legacy.2cbeaea9.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 1
virgo.wzfrontend/src/main/resources/static/console/static/js/9794.0e34e0b2.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
virgo.wzfrontend/src/main/resources/static/console/static/js/app-legacy.34c2e64e.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 1
virgo.wzfrontend/src/main/resources/static/console/static/js/app-legacy.9588ef5d.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
virgo.wzfrontend/src/main/resources/static/console/static/js/app.b8c224d6.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 1
virgo.wzfrontend/src/main/resources/static/console/static/js/app.ebe0acf1.js


BIN
virgo.wzfrontend/yui_wx/.DS_Store


BIN
virgo.wzfrontend/yui_wx/unpackage/dist/.DS_Store