From e5e5ae1281b3c680efb16657f4c4f0124fdcce56 Mon Sep 17 00:00:00 2001 From: zwq Date: Wed, 19 Feb 2025 14:16:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Navbar.vue | 14 +- src/layout/index.vue | 47 ++++- src/views/asrs/delivery/add-or-updatab.vue | 5 +- src/views/asrs/deliveryHis/indexb.vue | 3 +- src/views/asrs/jobMainTaskHistory/indexb.vue | 16 +- src/views/asrs/rollMessage/index.vue | 22 +++ src/views/asrs/rollMessage/indexb.vue | 22 +++ src/views/wcsAlarm/real1.vue | 192 +++++++++++++++++++ src/views/wcsAlarm/{real.vue => real2.vue} | 0 9 files changed, 305 insertions(+), 16 deletions(-) create mode 100644 src/views/wcsAlarm/real1.vue rename src/views/wcsAlarm/{real.vue => real2.vue} (100%) diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 8e2f8ba..90a486a 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -33,6 +33,9 @@ + + {{alarmTip?'关闭报警':'打开报警'}} + 退出登录 @@ -64,6 +67,12 @@ export default { Search, NotifyMessage }, + props:{ + alarmTip:{ + type: Boolean, + default: false, + }, + }, computed: { ...mapGetters([ 'sidebar', @@ -89,7 +98,7 @@ export default { }, data() { return { - nickname: '' + nickname: '', }; }, created() { @@ -101,6 +110,9 @@ export default { toggleSideBar() { this.$store.dispatch('app/toggleSideBar') }, + alarmSet(){ + this.$emit('refreshAlarm'); + }, async logout() { this.$modal.confirm('确定注销并退出系统吗?', '提示').then(() => { this.$store.dispatch('LogOut').then(() => { diff --git a/src/layout/index.vue b/src/layout/index.vue index 55a672d..1803791 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -12,7 +12,7 @@ :class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }" class="main-container">
- +
@@ -82,6 +82,8 @@ export default { instance: { closed: true, }, // 通知弹窗实例 + timer: null, + alarmTip: true, }; }, created() { @@ -89,7 +91,6 @@ export default { axios .post('http://172.22.22.190/wcs-njlm/business/wcsTask/isonline') .then((res) => { - console.log(res); if (res.data.code == 500) { this.$notify({ title: '设备异常', @@ -102,7 +103,6 @@ export default { } }) .catch((error) => { - console.error('There was an error!', error); this.$notify({ title: '通知', message: '设备不在线,请稍后重试', @@ -112,11 +112,22 @@ export default { }); }, methods: { + refreshAlarm() { + if (this.alarmTip) { + clearInterval(this.timer); + this.timer = null; + } else { + this.startFun(); + } + this.alarmTip = !this.alarmTip; + }, handleClickOutside() { this.$store.dispatch('app/closeSideBar', { withoutAnimation: false }); }, startFun() { - setInterval(() => { + clearInterval(this.timer); + this.timer = null; + this.timer = setInterval(() => { this.getRealAlarm(); }, 10000); }, @@ -149,6 +160,34 @@ export default { .catch((error) => { console.error('There was an error!', error); }); + axios + .post('http://172.22.22.14:8080/wcs-njlm/business/wcsTask/isAlarm') + .then((res) => { + res.data.forEach((item, index) => { + if (index < 4) { + if (item.code !== 0) { + this.$notify({ + title: '异常', + message: item.msg, + type: 'warning', + duration: 8000, + }); + } + } else { + if (item.code > 30) { + this.$notify({ + title: '异常', + message: item.msg, + type: 'warning', + duration: 9000, + }); + } + } + }); + }) + .catch((error) => { + console.error('There was an error!', error); + }); }, }, }; diff --git a/src/views/asrs/delivery/add-or-updatab.vue b/src/views/asrs/delivery/add-or-updatab.vue index a4e12d7..012777b 100644 --- a/src/views/asrs/delivery/add-or-updatab.vue +++ b/src/views/asrs/delivery/add-or-updatab.vue @@ -2,7 +2,7 @@ * @Author: zwq * @Date: 2021-11-18 14:16:25 * @LastEditors: zwq - * @LastEditTime: 2024-12-26 11:20:46 + * @LastEditTime: 2025-01-07 15:48:54 * @Description: -->