Browse Source

now log

master
maochaoying 2 years ago
parent
commit
19c95d55ba
  1. 10
      src/components/LoginForm.vue
  2. 9
      src/components/Progress.vue
  3. 3
      src/mock/command.js
  4. 4
      src/store/modules/device.js
  5. 4
      src/store/modules/websocket.js

10
src/components/LoginForm.vue

@ -96,11 +96,10 @@ const handleLogin = () => {
tip.value = ''
webSocketStore?.sendCommandMsg(loginJSON(username.value, password.value))
//
let flag = false
setTimeout(() => {
userStore.allUserList?.map(item => {
if (item.uid == username.value && password.value == item.passwd) {
//
flag = true
userStore.updatePermission(item.permission_level)
userStore.updateLoginUser(item.uid)
if (props.modal) {
@ -110,12 +109,9 @@ const handleLogin = () => {
} else {
window.location.href = 'http://127.0.0.1/'
}
console.log(props.modal)
}
})
if (!flag) {
// tip.value = ''
}
})
}
</script>
@ -150,7 +146,7 @@ const handleLogin = () => {
border: none;
outline: none;
width: 253px;
height: 17px;
height: 20px;
position: absolute;
left: 120px;
top: 142px;

9
src/components/Progress.vue

@ -85,9 +85,14 @@
</g>
</g>
</svg>
<div class="left_log_wrap">
<div
class="left_log_wrap"
v-if="[1, 2, 3, 4].includes(operatorStore.disinfectStatus)"
>
<p class="text">当前剩余</p>
<p class="val">{{ deviceStore.nowlog?.toFixed(2) || 0 }}log</p>
<p class="val">
{{ deviceStore.targetlog - (deviceStore.nowlog?.toFixed(2) || 0) }}log
</p>
</div>
<div
class="btn"

3
src/mock/command.js

@ -286,8 +286,7 @@ export const updateSettingInRunInfectionJSON = (column, val) => {
return {
command: 'changeDisinfectionParameter',
messageId: 'changeDisinfectionParameter',
column,
val,
[column]: val,
}
}

4
src/store/modules/device.js

@ -29,10 +29,14 @@ export const useDeviceStore = defineStore({
binSaturation: 0,
// 剩余log
nowlog: 0,
targetlog: 0,
}
},
// actions
actions: {
updateTargetLog(targetlog) {
this.targetlog = targetlog
},
updateNowLog(nowlog) {
this.nowlog = nowlog
},

4
src/store/modules/websocket.js

@ -86,8 +86,8 @@ export const useWebSocketStore = defineStore({
sprinklerPumpRPM,
sprinklerPumpGPM,
} = sensor_data
const { nowlog } = disinfectionState || {}
const { nowlog, targetlog } = disinfectionState || {}
deviceStore.updateTargetLog(targetlog)
deviceStore.updateNowLog(nowlog)
if ([1, 2, 3, 4].includes(disinfectionWorkState)) {
operatorStore.updateShowStartReady(false)

Loading…
Cancel
Save