Browse Source

临界

master
maochaoying 2 years ago
parent
commit
36fb984f06
  1. 30
      src/components/AddPreSetting.vue
  2. 3
      src/components/LiquidHandle.vue
  3. 30
      src/components/Setting/components/Device.vue
  4. 6
      src/components/Test.vue
  5. 30
      src/components/UpdatePreSetting.vue
  6. 14
      src/store/modules/websocket.js

30
src/components/AddPreSetting.vue

@ -428,6 +428,9 @@ const formatter1 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -446,6 +449,9 @@ const formatter2 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -464,6 +470,9 @@ const formatter3 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -482,6 +491,9 @@ const formatter4 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -500,6 +512,9 @@ const formatter5 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -518,6 +533,9 @@ const formatter6 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -536,6 +554,9 @@ const formatter7 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -554,6 +575,9 @@ const formatter8 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -572,6 +596,9 @@ const formatter9 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -590,6 +617,9 @@ const formatter10 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}

3
src/components/LiquidHandle.vue

@ -199,6 +199,9 @@ const formatter = value => {
if (parseInt(value) <= 0) {
return '0'
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}

30
src/components/Setting/components/Device.vue

@ -380,6 +380,9 @@ const formatter1 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -398,6 +401,9 @@ const formatter2 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -416,6 +422,9 @@ const formatter3 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -434,6 +443,9 @@ const formatter4 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -452,6 +464,9 @@ const formatter5 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -470,6 +485,9 @@ const formatter6 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -488,6 +506,9 @@ const formatter7 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -506,6 +527,9 @@ const formatter8 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -524,6 +548,9 @@ const formatter9 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -542,6 +569,9 @@ const formatter10 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}

6
src/components/Test.vue

@ -313,6 +313,9 @@ const formatter6 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value
}
@ -328,6 +331,9 @@ const formatter7 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value
}

30
src/components/UpdatePreSetting.vue

@ -449,6 +449,9 @@ const formatter1 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -467,6 +470,9 @@ const formatter2 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -485,6 +491,9 @@ const formatter3 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -503,6 +512,9 @@ const formatter4 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -521,6 +533,9 @@ const formatter5 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -539,6 +554,9 @@ const formatter6 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -557,6 +575,9 @@ const formatter7 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -575,6 +596,9 @@ const formatter8 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -593,6 +617,9 @@ const formatter9 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}
@ -611,6 +638,9 @@ const formatter10 = value => {
return arr[0].val_lower_limit + ''
}
}
if (value == '') {
return '0'
}
return value.replace(/^0+/gi, '')
}

14
src/store/modules/websocket.js

@ -40,7 +40,7 @@ export const useWebSocketStore = defineStore({
const runningStore = useRunningStore()
init.connect()
init.ws.onmessage = function (ev) {
const { ackcode, messageId, timeStamp } = JSON.parse(ev.data)
const { messageId, timeStamp } = JSON.parse(ev.data)
console.log(JSON.parse(ev.data))
switch (messageId) {
case 'getState':
@ -168,11 +168,13 @@ export const useWebSocketStore = defineStore({
}
break
case 'startReplenishingFluids':
if (ackcode == 0) {
const { ackcode: startReplenishingCode } = JSON.parse(ev.data)
if (startReplenishingCode == 0) {
operatorStore.updateReplenishingFluidsWorkState(1)
}
case 'startDraining':
if (ackcode == 0) {
const { ackcode: startDrainingCode } = JSON.parse(ev.data)
if (startDrainingCode == 0) {
operatorStore.updateDrainingWorkState(1)
}
case 'startDisinfection':
@ -181,11 +183,11 @@ export const useWebSocketStore = defineStore({
break
case 'exportUserBehaviorRecord':
settingStore.updateExportLoading(false)
const { ackcode } = JSON.parse(ev.data) || {}
if (ackcode == 3000) {
const { ackcode: exportUserCode } = JSON.parse(ev.data) || {}
if (exportUserCode == 3000) {
showFailToast('未检测到U盘')
}
if (ackcode != 0 && ackcode != 3000) {
if (exportUserCode != 0 && exportUserCode != 3000) {
showFailToast('导出错误')
}
break

Loading…
Cancel
Save