@@ -53,8 +53,12 @@ export default {
searchKeyword: "",
};
},
- created() {},
- mounted() {},
+ created() {
+ },
+ mounted() {
+ console.log(this.$route.path, 'this.$router');
+
+ },
watch: {
// $route: {
// handler: function (route) {
@@ -66,10 +70,14 @@ export default {
computed: {},
methods: {
toSearchInfoList() {
- this.$router.push({
- path: "/baseSystemInfo/index.vue",
- query: { keyword: this.searchKeyword },
- });
+ if(this.$route.path == '/baseSystemInfo/index.vue') {
+ this.$refs.info.search();
+ } else {
+ this.$router.push({
+ path: "/baseSystemInfo/index.vue",
+ query: { keyword: this.searchKeyword },
+ });
+ }
},
},
};
diff --git a/src/views/homePage/components/news/NewsDialog.vue b/src/views/homePage/components/news/NewsDialog.vue
index b4ee51f..7fa840d 100644
--- a/src/views/homePage/components/news/NewsDialog.vue
+++ b/src/views/homePage/components/news/NewsDialog.vue
@@ -3,7 +3,7 @@
@@ -18,7 +18,9 @@
发送人:{{v.creatorUser}}
-
时间:{{v.lastModifyTime}}
+
+
+
时间:{{ncc.dateFormat(v.lastModifyTime)}}
@@ -61,11 +63,17 @@ export default {
this.loading = true;
getMessageList(this.searchList).then(({data}) => {
this.messageList = this.messageList.concat(data.list);
- console.log(this.messageList);
this.total = data.pagination.total;
this.loading = false;
+ this.searchList.pageIndex += 1
+ this.$emit('changeMagNum', data.pagination.total);
});
},
+ toReadAll() {
+ MessageAllRead().then(() => {
+ this.load();
+ })
+ }
},
};
diff --git a/src/views/homePage/components/news/index.vue b/src/views/homePage/components/news/index.vue
index baf833c..5b18e14 100644
--- a/src/views/homePage/components/news/index.vue
+++ b/src/views/homePage/components/news/index.vue
@@ -4,16 +4,14 @@
placement="left"
width="300"
trigger="click"
- v-for="(item, index) in itemList"
- :key="index"
>
-
-
+
+
-
{{ item.title }}
+
我的消息
@@ -27,10 +25,7 @@ export default {
components: { NewsDialog },
data() {
return {
- itemList: [
- // { icon: "el-icon-s-order", title: "我的待办", hasInfo: false },
- { icon: "el-icon-message-solid", title: "我的消息", hasInfo: true },
- ],
+ isHaveMsg: false
};
},
created() {
@@ -38,15 +33,19 @@ export default {
},
computed: {},
mounted() {},
+ watch: {},
destroyed() {
if (this.socket) {
//离开路由之后断开websocket连接
- this.socket.close()
- this.socket = null
- this.$store.commit('SET_SOCKET', this.socket)
+ this.socket.close();
+ this.socket = null;
+ this.$store.commit("SET_SOCKET", this.socket);
}
},
methods: {
+ changeMagNum(val) {
+ this.isHaveMsg = val ? true : false;
+ },
initWebSocket() {
this.socket = this.$store.getters.socket || null;
if ("WebSocket" in window) {
@@ -79,7 +78,7 @@ export default {
}
//消息推送(消息公告用的)
if (data.method == "messagePush") {
- console.log('messagePush', '消息推送(消息公告用的)', data);
+ console.log("messagePush", "消息推送(消息公告用的)", data);
this.messageCount += data.unreadNoticeCount;
if (this.$refs.MessageList.visible) this.$refs.MessageList.init();
}
@@ -98,7 +97,7 @@ export default {
}
//接收对方发送的消息
if (data.method == "receiveMessage") {
- console.log('receiveMessage', '接收对方发送的消息', data);
+ console.log("receiveMessage", "接收对方发送的消息", data);
//判断是否打开窗口
if (
this.$refs.UserList &&
@@ -132,7 +131,7 @@ export default {
}
//显示自己发送的消息
if (data.method == "sendMessage") {
- console.log('sendMessage', '显示自己发送的消息', data);
+ console.log("sendMessage", "显示自己发送的消息", data);
if (this.$refs.UserList.$refs.NCCIm.info.id !== data.toUserId)
return;
//添加到客户端
@@ -147,7 +146,7 @@ export default {
}
//消息列表
if (data.method == "messageList") {
- console.log('messageList', '消息列表', data);
+ console.log("messageList", "消息列表", data);
this.$refs.UserList.$refs.NCCIm.getList(data);
}
};