Browse Source

优化提示,防止提示过多

dev
zhangjiming 7 months ago
parent
commit
80e6f80f39
  1. 2
      package.json
  2. 9
      src/pages/Index/Regular/Consumables.vue

2
package.json

@ -22,6 +22,7 @@
"pinia": "^2.2.4",
"pinia-plugin-persistedstate": "^4.1.2",
"ramda": "^0.30.1",
"rxjs": "^7.8.1",
"sass": "^1.79.5",
"simple-keyboard": "^3.8.17",
"simple-keyboard-layouts": "^3.4.41",
@ -32,6 +33,7 @@
"@types/mockjs": "^1.0.10",
"@types/node": "^22.7.5",
"@types/ramda": "^0.30.2",
"@types/rx": "^4.1.4",
"@types/vue": "^2.0.0",
"@typescript-eslint/eslint-plugin": "^8.8.1",
"@typescript-eslint/parser": "^8.8.1",

9
src/pages/Index/Regular/Consumables.vue

@ -136,6 +136,7 @@ import InitWarn from '../components/Consumables/Warn/InitWarn.vue'
import { getServerInfo } from '@/utils/getServerInfo'
import { formatScanReports } from '@/utils/errorHandler'
import { ElMessage } from 'element-plus'
import { Subject, debounceTime } from 'rxjs'
const { wsUrl } = getServerInfo('/api/v1/app/ws/state')
const socket = createWebSocket(wsUrl)
@ -144,6 +145,10 @@ const consumableStore = useConsumablesStore()
const emergencyStore = useEmergencyStore()
const deviceStore = useDeviceStore()
const errMsg$ = new Subject<string>()
errMsg$.pipe(debounceTime(500)).subscribe((msg) => {
ElMessage.error(msg)
})
//
const isLoading = ref(false)
@ -317,7 +322,7 @@ const updateReactionPlateNum = async ({
isDragging.value = true
}
} else {
ElMessage.error('设备正在工作,无法修改数值')
errMsg$.next('设备正在工作,无法修改数值')
}
}
@ -347,7 +352,7 @@ const updateTipNum = async ({
isDragging.value = true
}
} else {
ElMessage.error('设备正在工作,无法修改数值')
errMsg$.next('设备正在工作,无法修改数值')
}
}
</script>

Loading…
Cancel
Save