import { createApp, reactive } from 'vue' import App from './App.vue' import router from './router' import store from './store' import ElementPlus from 'element-plus'; // import 'element-plus/lib/theme-chalk/index.css'; import 'element-plus/dist/index.css' import './assets/element-icon/icon.css' import base from './uitils/common' import http from './api/http' // import 'dayjs/locale/zh-cn' // import locale from 'element-plus/lib/locale/lang/zh-cn' import * as ElementPlusIconsVue from '@element-plus/icons-vue' // 引入空托预警服务 import emptyPalletWarning from './services/emptyPalletWarning' // 引入全局任务超时服务 import taskTimeoutService from './services/taskTimeout' import permission from './api/permission' import viewgird from './components/basic/ViewGrid'; const app = createApp(App); for (const [key, component] of Object.entries(ElementPlusIconsVue)) { app.component(key, component) } app.config.globalProperties.base = base; app.config.globalProperties.http = http; app.config.globalProperties.$tabs = {}; app.config.globalProperties.permission = permission; app.config.globalProperties.$store = store; // 创建响应式的全局对象 const globalState = reactive({ signalR: false, //是否开启signalR table: { //vol-table带数据源的单元格是否启用tag标签(下拉框等单元格以tag标签显示) useTag: true }, audit: { //审核选项 data: [ { text: '通过', value: 1 }, { text: '拒绝', value: 3 }, { text: '驳回', value: 4 } ], status:[0,2] //审核中的数据 // 待审核 = 0, // 审核通过 = 1, // 审核中 = 2, // 审核未通过 = 3, // 驳回 = 4 }, messageList: [], //全局消息列表 messageDeleted: [] //存储被删除的消息ID,用于通知组件重置定时器 }); app.config.globalProperties.$global = globalState; // 将store挂载到window对象上,方便在扩展组件中访问 window.$store = store; window.$global = app.config.globalProperties.$global; //2023.03.13, //修改见:volupload.vue,后台AliOSSController.cs,阿里云OSS配置.doc window.oss = { ali: { //阿里云 use: false,//使用阿里云上传文件 //阿里缩略图压缩大小 //.aliyuncs.com small: "?x-oss-process=image/resize,m_lfit,w_200" } } app.use(store) .use(ElementPlus, { size: 'default' }) .use(router) .use(viewgird) .mount('#app'); app.config.globalProperties.$Message = app.config.globalProperties.$message; // 初始化空托预警服务 emptyPalletWarning.init(app); // 初始化全局任务超时服务 taskTimeoutService.init(app); // 将任务超时服务挂载到全局属性上 app.config.globalProperties.$taskTimeoutService = taskTimeoutService; // 将任务超时服务挂载到window对象上,方便在扩展组件中访问 window.$taskTimeoutService = taskTimeoutService;