<template>
  <ele-modal
    title="AdminWorker错误"
    :width="480"
    v-model="visible"
    :modal-penetrable="false"
    :append-to-body="true"
    :lock-scroll="true"
    center
    :close-on-press-escape="false"
    :close-on-click-modal="false"
    :show-close="false"
  >
    <h1 style="color: red">错误！admin:worker未正确连接！</h1>
  </ele-modal>
</template>

<script setup lang="ts">
  import { computed } from 'vue';
  import { useUserStore } from '@/store/modules/user';
  import { WsConnectionStatus, wsInstance } from '@/plugins/websocket';
  const userStore = useUserStore();

  // const visible = ref(false);
  const visible = computed<boolean>(() => {
    return (
      wsInstance.connectionStatus.value != WsConnectionStatus.CONNECTED &&
      userStore.info
    );
  });
</script>
