From 879ec183bcb15e10db304f2d67955d7d6b83ef31 Mon Sep 17 00:00:00 2001 From: LiLongLong <13717757313@163.com> Date: Mon, 23 Jun 2025 21:24:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=B7=E5=BC=8F=E5=8F=8ALI?= =?UTF-8?q?S=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 1 + src/assets/alarm/default-normal.svg | 1 + src/assets/alarm/default-status.svg | 1 + src/assets/alarm/error-1.svg | 1 + src/assets/alarm/error.svg | 2 +- src/assets/alarm/light.svg | 1 + src/assets/alarm/normal-2.svg | 1 + src/assets/alarm/normal.svg | 2 +- src/assets/alarm/warn.svg | 1 + src/assets/pre.svg | 4 +- src/assets/un-pre.svg | 3 + src/components/SoftKeyboard.vue | 4 +- src/components/dialogs/AlarmModal.vue | 26 +- src/components/dialogs/AlarmModalHistory.vue | 8 +- src/components/dialogs/PreReactionBall.vue | 43 +- src/main.ts | 2 +- src/pages/Index/History.vue | 53 ++- src/pages/Index/Index.vue | 40 +- src/pages/Index/Regular/Consumables.vue | 3 +- src/pages/Index/Regular/Running.vue | 1 + src/pages/Index/Settings/Device.vue | 37 -- src/pages/Index/Settings/EditLis.vue | 357 +++++++++++++++ src/pages/Index/Settings/Lis.vue | 242 ++-------- src/pages/Index/Settings/NavBar.vue | 7 +- src/pages/Index/Settings/Network.vue | 501 +++++++++++++++++++++ src/pages/Index/Settings/Version.vue | 4 + .../Index/components/Consumables/SpttingPlates.vue | 1 + .../components/Running/LittleBufferDisplay.vue | 34 +- src/pages/Index/components/TestTube/Tube.vue | 1 - src/router/router.ts | 4 + src/services/Index/settings/settings.ts | 2 +- src/services/osControl/os.ts | 1 + src/store/modules/consumables.ts | 6 + src/store/modules/device.ts | 4 +- src/store/modules/running.ts | 7 +- src/store/modules/useSystemStore.ts | 1 - src/utils/getServerInfo.ts | 8 +- src/websocket/socket.ts | 1 + 38 files changed, 1101 insertions(+), 315 deletions(-) create mode 100644 src/assets/alarm/default-normal.svg create mode 100644 src/assets/alarm/default-status.svg create mode 100644 src/assets/alarm/error-1.svg create mode 100644 src/assets/alarm/light.svg create mode 100644 src/assets/alarm/normal-2.svg create mode 100644 src/assets/alarm/warn.svg create mode 100644 src/assets/un-pre.svg create mode 100644 src/pages/Index/Settings/EditLis.vue create mode 100644 src/pages/Index/Settings/Network.vue diff --git a/components.d.ts b/components.d.ts index e7d4bb9..2144ab7 100644 --- a/components.d.ts +++ b/components.d.ts @@ -32,6 +32,7 @@ declare module 'vue' { ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRow: typeof import('element-plus/es')['ElRow'] ElSelect: typeof import('element-plus/es')['ElSelect'] + ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTag: typeof import('element-plus/es')['ElTag'] diff --git a/src/assets/alarm/default-normal.svg b/src/assets/alarm/default-normal.svg new file mode 100644 index 0000000..9192f50 --- /dev/null +++ b/src/assets/alarm/default-normal.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/alarm/default-status.svg b/src/assets/alarm/default-status.svg new file mode 100644 index 0000000..de81af5 --- /dev/null +++ b/src/assets/alarm/default-status.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/alarm/error-1.svg b/src/assets/alarm/error-1.svg new file mode 100644 index 0000000..cfe5f22 --- /dev/null +++ b/src/assets/alarm/error-1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/alarm/error.svg b/src/assets/alarm/error.svg index cfe5f22..4bbeda8 100644 --- a/src/assets/alarm/error.svg +++ b/src/assets/alarm/error.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/alarm/light.svg b/src/assets/alarm/light.svg new file mode 100644 index 0000000..91cc14d --- /dev/null +++ b/src/assets/alarm/light.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/alarm/normal-2.svg b/src/assets/alarm/normal-2.svg new file mode 100644 index 0000000..6e6fc12 --- /dev/null +++ b/src/assets/alarm/normal-2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/alarm/normal.svg b/src/assets/alarm/normal.svg index 6e6fc12..7270835 100644 --- a/src/assets/alarm/normal.svg +++ b/src/assets/alarm/normal.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/alarm/warn.svg b/src/assets/alarm/warn.svg new file mode 100644 index 0000000..f9b54f4 --- /dev/null +++ b/src/assets/alarm/warn.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/pre.svg b/src/assets/pre.svg index 5876893..58c7dca 100644 --- a/src/assets/pre.svg +++ b/src/assets/pre.svg @@ -1,3 +1,3 @@ - - + + diff --git a/src/assets/un-pre.svg b/src/assets/un-pre.svg new file mode 100644 index 0000000..091ef0e --- /dev/null +++ b/src/assets/un-pre.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/SoftKeyboard.vue b/src/components/SoftKeyboard.vue index be40a9b..dcaa0f0 100644 --- a/src/components/SoftKeyboard.vue +++ b/src/components/SoftKeyboard.vue @@ -63,7 +63,9 @@ const handleKeyPress = (key: string) => { }, 150) if (key === 'del') { - emits('update:modelValue', props.modelValue.slice(0, -1)) + const value = props.modelValue.slice(0, -1) + console.log('value--------', value) + emits('update:modelValue', value) } else if (key === 'enter') { emits('confirm', props.modelValue) diff --git a/src/components/dialogs/AlarmModal.vue b/src/components/dialogs/AlarmModal.vue index 6934735..b884d94 100644 --- a/src/components/dialogs/AlarmModal.vue +++ b/src/components/dialogs/AlarmModal.vue @@ -8,10 +8,19 @@ :key="index" class="alarm-item" > -
+
+
+ + +
+
+
{{ alarm.state ? alarm.notTriggeredDisName : alarm.triggeredStateName }}
+
+
+
- +
@@ -35,13 +44,15 @@ diff --git a/src/components/dialogs/AlarmModalHistory.vue b/src/components/dialogs/AlarmModalHistory.vue index a7b6343..8ddb2ee 100644 --- a/src/components/dialogs/AlarmModalHistory.vue +++ b/src/components/dialogs/AlarmModalHistory.vue @@ -20,7 +20,7 @@ diff --git a/src/components/dialogs/PreReactionBall.vue b/src/components/dialogs/PreReactionBall.vue index f349d40..1ffe46a 100644 --- a/src/components/dialogs/PreReactionBall.vue +++ b/src/components/dialogs/PreReactionBall.vue @@ -6,15 +6,19 @@ :key="index" class="ball" > -
+
{{ item.sampleInfo.userid }} {{ formatRemainTime(item.reactionRemainingTime) }}
+
- empty +
+
+ empty
+
{{ ballStateMap[item.state] }}
@@ -23,12 +27,14 @@ diff --git a/src/pages/Index/Settings/Lis.vue b/src/pages/Index/Settings/Lis.vue index aa5ed88..1936faf 100644 --- a/src/pages/Index/Settings/Lis.vue +++ b/src/pages/Index/Settings/Lis.vue @@ -4,12 +4,9 @@ 类型
@@ -17,33 +14,19 @@ 协议
- - - - - - - -
接口
@@ -53,15 +36,7 @@ > Host's IP
- - + {{ lisSettings.lisNetIp }}
Host's Port
- - + {{ lisSettings.LISNetPortStr }}
传输速度
-
- 导出 -
- - -
+
+
+ + +
@@ -139,42 +89,19 @@ + + diff --git a/src/pages/Index/Settings/Version.vue b/src/pages/Index/Settings/Version.vue index 43402d3..d41cc75 100644 --- a/src/pages/Index/Settings/Version.vue +++ b/src/pages/Index/Settings/Version.vue @@ -5,6 +5,10 @@ {{ info?.sn }}
+ 资产ID + {{ info?.assetId }} +
+
App {{ info?.appVersion }}
diff --git a/src/pages/Index/components/Consumables/SpttingPlates.vue b/src/pages/Index/components/Consumables/SpttingPlates.vue index 668ec93..37e6d80 100644 --- a/src/pages/Index/components/Consumables/SpttingPlates.vue +++ b/src/pages/Index/components/Consumables/SpttingPlates.vue @@ -233,6 +233,7 @@ const updateSliderEndVal = async (plateNum, order) => { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + width: 1.5rem; } .project-number { flex: 0 0 auto; diff --git a/src/pages/Index/components/Running/LittleBufferDisplay.vue b/src/pages/Index/components/Running/LittleBufferDisplay.vue index 7c53e12..5d46c7e 100644 --- a/src/pages/Index/components/Running/LittleBufferDisplay.vue +++ b/src/pages/Index/components/Running/LittleBufferDisplay.vue @@ -1,21 +1,13 @@ @@ -39,13 +31,16 @@ import { ref, watchEffect } from 'vue'; import { useRunningStore } from '@/store/modules/running'; import PreReactionModal from '@/components/dialogs/PreReactionBall.vue' import PreSvg from '@/assets/pre.svg' +import UnPreSvg from '@/assets/un-pre.svg' const consumableStore = useConsumablesStore() // 定义组件接收的 props -const props = defineProps<{ bufferData: LittleBottleGroup[] }>() +// const props = defineProps<{ bufferData: LittleBottleGroup[] }>() const runningStore = useRunningStore() const preReactoinGroupMap = ref(runningStore.preReactoinGroupMap) const preVisible = ref(false) +const bufferData = ref([]) +const currentSelectColor = ref() // 计算填充样式 const getFillStyle = (item: LittleBottleGroup) => { //@ts-ignore @@ -57,11 +52,16 @@ const getFillStyle = (item: LittleBottleGroup) => { watchEffect(() => { preReactoinGroupMap.value = runningStore.preReactoinGroupMap + if (consumableStore.consumableData && consumableStore.consumableData.littBottleGroup) { + bufferData.value = consumableStore.consumableData.littBottleGroup + console.log('bufferData.value--littBottleGroup-', bufferData.value) + } }) const showPreReactoinModal = (item) => { - console.log('-----', preReactoinGroupMap.value[item.group]) runningStore.setPreReactoinGroup(preReactoinGroupMap.value[item.group]) + consumableStore.setBallColor(getFillStyle(item).background) + currentSelectColor.value = consumableStore.projIdColorMap[item.projId!] preVisible.value = true } @@ -90,10 +90,8 @@ const showPreReactoinModal = (item) => { } .pre-img{ - position: absolute; - width: 20px; - left:0.5rem; - top: 1rem; + margin-top:5px; + width: 1.2rem; } .buffer-item { position: relative; diff --git a/src/pages/Index/components/TestTube/Tube.vue b/src/pages/Index/components/TestTube/Tube.vue index f53c460..032fbc6 100644 --- a/src/pages/Index/components/TestTube/Tube.vue +++ b/src/pages/Index/components/TestTube/Tube.vue @@ -82,7 +82,6 @@ watch( (newVal) => { tubeData.value = props.tube const projIds = projIdsOfTube(props.tube) - console.log('projIds===', projIds, props.tube) if (projIds.length > 0) { nextTick(() => { if (canvas.value) { diff --git a/src/router/router.ts b/src/router/router.ts index 10b845f..f8a2c45 100644 --- a/src/router/router.ts +++ b/src/router/router.ts @@ -58,6 +58,10 @@ const routes = [ redirect: '/index/setting/device', }, { + path: 'network', + component: () => import('@/pages/Index/Settings/Network.vue'), + }, + { path: 'device', //设备 component: () => import('@/pages/Index/Settings/Device.vue'), }, diff --git a/src/services/Index/settings/settings.ts b/src/services/Index/settings/settings.ts index 44c0a74..9f87244 100644 --- a/src/services/Index/settings/settings.ts +++ b/src/services/Index/settings/settings.ts @@ -163,8 +163,8 @@ export const setLISType = async (data: LISType) => { export type LISSerialBaudrate = 'B9600' | 'B12800' | 'B19200' | 'B115200' export const LISSerialBaudrateMap = { B9600: '9,600bps', - B12800: '12,800bps', B19200: '19,200bps', + B38400: '38,400bps', B115200: '115,200bps', } // 设置LIS串口波特率 diff --git a/src/services/osControl/os.ts b/src/services/osControl/os.ts index 904fe82..bcdb147 100644 --- a/src/services/osControl/os.ts +++ b/src/services/osControl/os.ts @@ -64,6 +64,7 @@ export type DeviceInfo = { mcuVersion: string; sn: string; ip: string; + assetId: string; } export const getDeviceInfo = async () => { try { diff --git a/src/store/modules/consumables.ts b/src/store/modules/consumables.ts index ca643a2..e718a89 100644 --- a/src/store/modules/consumables.ts +++ b/src/store/modules/consumables.ts @@ -175,6 +175,11 @@ export const useConsumablesStore = defineStore( return color } + const setBallColor = (color: string) => { + console.log('color--', color) + ballColor.value = color + } + return { setIdCardInserted, isIdCardInserted, @@ -196,6 +201,7 @@ export const useConsumablesStore = defineStore( ballColor, getBallColor, + setBallColor, } }, // { diff --git a/src/store/modules/device.ts b/src/store/modules/device.ts index 45be764..0737071 100644 --- a/src/store/modules/device.ts +++ b/src/store/modules/device.ts @@ -27,13 +27,13 @@ export const useDeviceStore = defineStore('device', () => { } } - const sensorState = ref({ + const sensorState = ref>({ pboxTemperature: 20, incubateBoxTemperature: 20, wasteBinFullFlag: false, }) const setSensorState = (data: SensorStateMessage['data']) => { - if (!R.equals(data, sensorState.value)) { + if (data && !R.equals(data, sensorState.value)) { sensorState.value = {...data} } } diff --git a/src/store/modules/running.ts b/src/store/modules/running.ts index 91ae25c..29ca4ff 100644 --- a/src/store/modules/running.ts +++ b/src/store/modules/running.ts @@ -64,8 +64,11 @@ export const useRunningStore = defineStore('running', () => { } const setPreReactoinGroupMap = (data: PreReactionPosGroupStateMessage['data']) => { - const key = data.group - preReactoinGroupMap.value[key] = data + if(data){ + const key = data.group + preReactoinGroupMap.value[key] = data + } + } const setPreReactoinGroup = (data: PreReactionPosGroupStateMessage['data']) => { diff --git a/src/store/modules/useSystemStore.ts b/src/store/modules/useSystemStore.ts index 6ae5f00..e613c84 100644 --- a/src/store/modules/useSystemStore.ts +++ b/src/store/modules/useSystemStore.ts @@ -21,7 +21,6 @@ export const useSystemStore = defineStore('system', () => { const statusList = ref[]>([]) const updateStatusList = (status) => { - console.log('status--', status) statusList.value.push(status) } diff --git a/src/utils/getServerInfo.ts b/src/utils/getServerInfo.ts index bd3dd80..96bd3d6 100644 --- a/src/utils/getServerInfo.ts +++ b/src/utils/getServerInfo.ts @@ -8,12 +8,12 @@ export function getServerInfo(wsPath: string = '/api/v1/app/ws/state') { const host = window.location.hostname; // const host = window.location.host; // const host = "192.168.8.175"; - const port = '8082' // 使用固定的后端端口;由于本地开发时,8080被占用导致ws连接失败,所以使用8082 - // const port = "80" + // const port = '8082' // 使用固定的后端端口;由于本地开发时,8080被占用导致ws连接失败,所以使用8082 + const port = "80" // 构建 WebSocket URL const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:' - const wsUrl = `${wsProtocol}//${host}:${port}${wsPath}` - // const wsUrl = `${wsProtocol}//${host}${wsPath}` + // const wsUrl = `${wsProtocol}//${host}:${port}${wsPath}` + const wsUrl = `${wsProtocol}//${host}${wsPath}` // 构建 HTTP URL const httpUrl = `${window.location.protocol}//${host}:${port}` // 例如: "http://192.168.1.100:8082" 或 "http://localhost:8082" diff --git a/src/websocket/socket.ts b/src/websocket/socket.ts index f362fbf..73fa2b9 100644 --- a/src/websocket/socket.ts +++ b/src/websocket/socket.ts @@ -443,6 +443,7 @@ class WebSocketClient { ) this.messageHandlers.set(messageType, new Set()) } + console.log('messageType---', messageType) this.messageHandlers.get(messageType)?.add(handler) }