5 changed files with 100 additions and 116 deletions
-
40src/App.vue
-
39src/components/dialogs/ClearRecordByKeysModal.vue
-
39src/components/dialogs/DelPreModal.vue
-
59src/components/dialogs/DisinfectModal.vue
-
39src/components/dialogs/UserModal.vue
@ -1,7 +1,41 @@ |
|||||
<script setup></script> |
|
||||
|
|
||||
<template> |
<template> |
||||
<router-view></router-view> |
<router-view></router-view> |
||||
|
<my-modal type="info" icon="warning" |
||||
|
v-model:visible="deviceAlert.visible" |
||||
|
:content="deviceAlert.content" |
||||
|
@ok="actionDeviceAlertOk" |
||||
|
></my-modal> |
||||
</template> |
</template> |
||||
|
<script setup> |
||||
|
import { useWebSocketStore } from '@/store' |
||||
|
import { onMounted, ref } from 'vue'; |
||||
|
/** @var {webSocketStore} */ |
||||
|
const webSocketStore = useWebSocketStore(); |
||||
|
/** @var {Object} */ |
||||
|
const deviceAlert = ref({ |
||||
|
visible: false, |
||||
|
content: '', |
||||
|
key : null, |
||||
|
}); |
||||
|
// on mounted |
||||
|
onMounted(mounted); |
||||
|
|
||||
|
// on mounted |
||||
|
function mounted() { |
||||
|
webSocketStore.registerEventHandler('AlertEvent', handleAlertEvent); |
||||
|
} |
||||
|
|
||||
|
// handle alert event |
||||
|
async function handleAlertEvent(data) { |
||||
|
deviceAlert.value.visible = true; |
||||
|
deviceAlert.value.content = data.displayInfo; |
||||
|
deviceAlert.value.key = data.alertContext; |
||||
|
await webSocketStore.call('AlertEventFrontEndConfirm', {alertContext:data.alertContext}); |
||||
|
} |
||||
|
|
||||
|
// action device alert ok |
||||
|
async function actionDeviceAlertOk() { |
||||
|
await webSocketStore.call('AlertEventUsrConfirm', {alertContext:deviceAlert.value.key}); |
||||
|
} |
||||
|
|
||||
<style scoped></style> |
|
||||
|
</script> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue