From 7c4b3620c933f7a4716564fe0b6710473fa3871e Mon Sep 17 00:00:00 2001 From: maochaoying <925670706@qq.com> Date: Sun, 10 Sep 2023 09:17:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A1=E8=AE=A1=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Audit.vue | 34 +++++++++++++++++++++++++++------- src/mock/command.js | 9 +++++++++ src/pages/Home.vue | 8 ++++---- src/store/index.js | 2 ++ src/store/modules/audit.js | 16 ++++++++++++++++ src/store/modules/websocket.js | 11 +++++++++-- 6 files changed, 67 insertions(+), 13 deletions(-) create mode 100644 src/store/modules/audit.js diff --git a/src/components/Audit.vue b/src/components/Audit.vue index d5f8c6f..27fc4a7 100644 --- a/src/components/Audit.vue +++ b/src/components/Audit.vue @@ -6,12 +6,22 @@

操作时间

-
-
Admin
-
修改注射泵速率
-
2023-06-29 13:59
+
+
{{ item?.uid }}
+
{{ item?.behaviorZH }}
+
+ {{ moment(item?.date).format('YYYY-MM-DD HH:mm:ss') }} +

排液

- +
设置

- + { + return { + auditInfoList: [], + } + }, + // actions + actions: { + updateAuditList(auditInfoList) { + this.auditInfoList = auditInfoList + }, + }, +}) diff --git a/src/store/modules/websocket.js b/src/store/modules/websocket.js index c806edd..5078cf3 100644 --- a/src/store/modules/websocket.js +++ b/src/store/modules/websocket.js @@ -6,6 +6,7 @@ import { useUserStore } from './user' import { useOperatorStore } from './operator' import { useDeviceStore } from './device' import { useTestStore } from './test' +import { useAuditStore } from './audit' import { useEchartsStore } from './echarts' import { showSuccessToast, showFailToast } from 'vant' import { saveEchartsDataToLocal } from '@/utils' @@ -32,6 +33,7 @@ export const useWebSocketStore = defineStore({ const deviceStore = useDeviceStore() const operatorStore = useOperatorStore() const echartsStore = useEchartsStore() + const auditStore = useAuditStore() init.connect() init.ws.onmessage = function (ev) { const { ackcode, messageId, timeStamp } = JSON.parse(ev.data) @@ -171,12 +173,17 @@ export const useWebSocketStore = defineStore({ break case 'stopDisinfection': break - case 'exportUserBehaviorRecordJSON': + case 'exportUserBehaviorRecord': settingStore.updateExportLoading(false) break - case 'exportDisinfectionRecordJSON': + case 'exportDisinfectionRecord': settingStore.updateExportLoading(false) break + case 'getUserBehaviorRecordDescJson': + const { records } = JSON.parse(ev.data) || {} + const { iterms } = records || {} + auditStore.updateAuditList(iterms || []) + break case 'login': if (ackcode == 0) { window.location.href = 'http://127.0.0.1/'