App.vue 544 B

1234567891011121314151617181920
  1. <template>
  2. <router-view />
  3. </template>
  4. <script setup>
  5. import useSettingsStore from '@/store/modules/settings'
  6. import { handleThemeStyle } from '@/utils/theme'
  7. import { startWorkOrderReminder } from '@/utils/deviceStatusWebSocket'
  8. import { connectSse } from '@/utils/dispatchSse'
  9. onMounted(() => {
  10. startWorkOrderReminder()
  11. // 应急调度:SSE 实时消息(催办提醒等),登录后自动建立连接
  12. connectSse()
  13. nextTick(() => {
  14. // 初始化主题样式
  15. handleThemeStyle(useSettingsStore().theme)
  16. })
  17. })
  18. </script>