| | |
| | | import "./assets/icons"; |
| | | import "./permission"; |
| | | import { getDicts } from "@/api/system/dict/data"; |
| | | import { getConfigKey, yidu } from "@/api/system/config"; |
| | | import { getConfigKey } from "@/api/system/config"; |
| | | import { |
| | | parseTime, |
| | | resetForm, |
| | |
| | | import DictData from "@/components/DictData"; |
| | | import * as echarts from "echarts"; |
| | | import VueBarcode from "vue-barcode"; |
| | | import { initWebSocket, closeWebSocket } from "@/utils/websocket"; |
| | | // import { initWebSocket, closeWebSocket } from "@/utils/websocket"; |
| | | import RightToolbar from "@/components/RightToolbar" |
| | | |
| | | // 注册全局组件 |
| | |
| | | Vue.prototype.$echarts = echarts; |
| | | |
| | | // 通知管理:跟踪当前通知和偏移量 |
| | | const notificationManager = { |
| | | /* const notificationManager = { |
| | | notifications: [], // 存储当前显示的通知实例 |
| | | baseOffset: 50, // 基础偏移量 |
| | | notificationHeight: 80, // 每个通知的估计高度(包括间距) |
| | |
| | | notification.customClass = notification.customClass.replace(/notification-\d+/, `notification-${index + 1}`); |
| | | }); |
| | | } |
| | | }; |
| | | }; */ |
| | | |
| | | // 全局通知方法,添加“已读”按钮 |
| | | Vue.prototype.$showNotification = function (type, title, message, onClick, noticeId) { |
| | | /* Vue.prototype.$showNotification = function (type, title, message, onClick, noticeId) { |
| | | console.log('触发通知:', { type, title, message, noticeId, noticeIdType: typeof noticeId }); // 调试:记录 noticeId 和类型 |
| | | const h = this.$createElement; |
| | | const notification = this.$notify({ |
| | |
| | | appendTo: document.body |
| | | }); |
| | | notificationManager.addNotification(notification); // 添加到通知管理 |
| | | }; |
| | | }; */ |
| | | |
| | | // 监听路由变化 |
| | | router.afterEach(() => { |
| | |
| | | }); |
| | | |
| | | // 定义 WebSocket 初始化标志,防止重复连接 |
| | | let isWebSocketInitialized = false; |
| | | // let isWebSocketInitialized = false; |
| | | |
| | | const app = new Vue({ |
| | | el: "#app", |
| | | router, |
| | | store, |
| | | render: (h) => h(App), |
| | | mounted() { |
| | | /* mounted() { |
| | | const token = store.state.user.token || Cookies.get('token') || ''; |
| | | if (token && !isWebSocketInitialized) { |
| | | console.log('初始化 WebSocket,Token:', token); |
| | |
| | | isWebSocketInitialized = false; |
| | | console.log('Vue 实例销毁,WebSocket 已清理'); |
| | | } |
| | | } |
| | | } */ |
| | | }); |
| | | |
| | | // 注册插件 |