Browse Source

审计loading

master
maochaoying 2 years ago
parent
commit
351cfb5faa
  1. 35
      src/components/Audit.vue
  2. 6
      src/components/Progress.vue
  3. 4
      src/store/modules/audit.js
  4. 1
      src/store/modules/websocket.js

35
src/components/Audit.vue

@ -68,6 +68,14 @@
@current-change="handleCurrentPageChange"
/>
</div>
<van-overlay :show="auditStore.auditLoading" z-index="3">
<div class="wrapper" @click.stop>
<div class="block">
<van-loading />
<p class="shutdown_text">加载中</p>
</div>
</div>
</van-overlay>
</div>
</template>
@ -83,11 +91,13 @@ const auditStore = useAuditStore()
onMounted(() => {
//
webSocketStore.sendCommandMsg(getUserBehaviorRecordDescJSON(0, 6))
auditStore.updateAuditLoading(true)
})
const handleCurrentPageChange = page => {
auditStore.updatePage(page - 1)
webSocketStore.sendCommandMsg(getUserBehaviorRecordDescJSON(page - 1, 6))
auditStore.updateAuditLoading(true)
}
</script>
@ -167,4 +177,29 @@ const handleCurrentPageChange = page => {
justify-content: flex-end;
}
}
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.block {
width: 120px;
height: 120px;
display: flex;
flex-direction: column;
padding: 16px;
align-items: center;
justify-content: center;
.shutdown_text {
margin-top: 24px;
font-family: Source Han Sans CN;
font-size: 18px;
font-weight: normal;
line-height: normal;
letter-spacing: 0.06em;
color: #fff;
white-space: nowrap;
}
}
</style>

6
src/components/Progress.vue

@ -98,7 +98,11 @@
{{
(deviceStore.targetlog - (deviceStore.nowlog || 0)).toFixed(2) < 0
? 0
: (deviceStore.targetlog - (deviceStore.nowlog || 0)).toFixed(2)
: Math.abs(
(deviceStore.targetlog - (deviceStore.nowlog || 0)).toFixed(
2,
),
)
}}log
</p>
</div>

4
src/store/modules/audit.js

@ -8,10 +8,14 @@ export const useAuditStore = defineStore({
totalPage: 0,
total: 0,
page: 1,
auditLoading: false,
}
},
// actions
actions: {
updateAuditLoading(auditLoading) {
this.auditLoading = auditLoading
},
updateTotalPage(totalPage) {
this.totalPage = totalPage
},

1
src/store/modules/websocket.js

@ -220,6 +220,7 @@ export const useWebSocketStore = defineStore({
auditStore.updateTotalPage(totalpage)
auditStore.updateTotal(total)
auditStore.updatePage(page)
auditStore.updateAuditLoading(false)
break
case 'getDisinfectionConfig':
const { disinfectionConfig } = JSON.parse(ev.data)

Loading…
Cancel
Save