| | |
| | | * @version: |
| | | * @Date: 2024-05-30 13:28:20 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-07-20 05:21:44 |
| | | * @LastEditTime: 2024-07-24 23:47:07 |
| | | --> |
| | | <template> |
| | | <div> |
| | |
| | | </div> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { Ref, defineAsyncComponent, h, onMounted, provide, ref, unref } from 'vue'; |
| | | import { Ref, defineAsyncComponent, h, onMounted, provide, ref, unref, watch } from 'vue'; |
| | | import mainTable from './mainTable.vue'; |
| | | import { DeleteEntity, GetEnum, getEntity, getListByPage } from '/@/api/tigerapi/system'; |
| | | import { useRoute, useRouter } from 'vue-router'; |
| | |
| | | import { useGo } from '/@/hooks/web/usePage'; |
| | | import { useI18n } from '/@/hooks/web/useI18n'; |
| | | import { getRoleButtons } from '/@/api/sys/menu'; |
| | | import { useWebSocketStore } from '/@/store/modules/websocket'; |
| | | |
| | | const { getLocale } = useLocale(); |
| | | const webSocketStore = useWebSocketStore(); |
| | | const { t } = useI18n(); |
| | | const route = useRoute(); |
| | | const { currentRoute } = useRouter(); |
| | |
| | | const custImport = ref<any>(null); |
| | | const isMounted = ref(false); |
| | | const buttons = ref([]); |
| | | const readyState = ref<number>(WebSocket.CONNECTING); |
| | | const AuthOption = ref({ |
| | | BY_ORG: '', |
| | | BY_PROD: '', |
| | |
| | | provide<Ref<string>>('isExistSql', isExistSql); |
| | | provide<Ref<{}>>('AuthOption', AuthOption); |
| | | provide<Ref<any>>('keyFieldValues', keyFieldValues); |
| | | |
| | | // 监听readyState变化 |
| | | watch(readyState, (newState) => { |
| | | if (newState === WebSocket.CLOSED || newState === WebSocket.CLOSING) { |
| | | // 尝试重连 |
| | | setTimeout(webSocketStore.connectWebSocket, 3000); |
| | | } |
| | | }); |
| | | onMounted(async () => { |
| | | /* 用json获取列 */ |
| | | // _searchFormSchema.value = await fetchJson( |
| | |
| | | // } |
| | | // _columns.value = objs; |
| | | |
| | | webSocketStore.connectWebSocket(); |
| | | isMounted.value = false; |
| | | /* 动态import实体名.ts的自定义方法 */ |
| | | try { |
| | |
| | | }; |
| | | } |
| | | } |
| | | |
| | | </script> |