| | |
| | | import { createApp } from 'vue'; |
| | | import website from './config/website'; |
| | | import axios from './axios'; |
| | | import router from './router/'; |
| | | import store from './store'; |
| | | import i18n from './lang/'; |
| | | import { language, messages } from './lang/'; |
| | | import * as ElementPlusIconsVue from '@element-plus/icons-vue'; |
| | | import ElementPlus from 'element-plus'; |
| | | import 'element-plus/dist/index.css'; |
| | | import Avue from '@smallwei/avue'; |
| | | import '@smallwei/avue/lib/index.css'; |
| | | import crudCommon from '@/mixins/crud.js'; |
| | | import { getScreen } from './utils/util'; |
| | | /* |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2025-04-10 11:19:47 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2025-04-10 12:19:47 |
| | | * @FilePath: \drone-web-manage\src\main.js |
| | | * @Description: |
| | | * |
| | | * Copyright (c) 2025 by shuishen, All Rights Reserved. |
| | | */ |
| | | import { createApp } from 'vue' |
| | | import website from './config/website' |
| | | import axios from './axios' |
| | | import router from './router/' |
| | | import store from './store' |
| | | import i18n from './lang/' |
| | | import { language, messages } from './lang/' |
| | | import * as ElementPlusIconsVue from '@element-plus/icons-vue' |
| | | import ElementPlus from 'element-plus' |
| | | import 'element-plus/dist/index.css' |
| | | import Avue from '@smallwei/avue' |
| | | import '@smallwei/avue/lib/index.css' |
| | | import crudCommon from '@/mixins/crud.js' |
| | | import { getScreen } from './utils/util' |
| | | import { getUrlParams, validatenull } from './utils/validate' |
| | | import { setToken, setRefreshToken } from './utils/auth'; |
| | | import { setStore } from './utils/store'; |
| | | import './permission'; |
| | | import error from './error'; |
| | | import avueUeditor from 'avue-plugin-ueditor'; |
| | | import basicBlock from 'components/basic-block/main.vue'; |
| | | import basicContainer from 'components/basic-container/main.vue'; |
| | | import thirdRegister from './components/third-register/main.vue'; |
| | | import NfDesignBase from '@saber/nf-design-base-elp'; |
| | | import flowDesign from './components/flow-design/main.vue'; |
| | | import App from './App.vue'; |
| | | import 'animate.css'; |
| | | import dayjs from 'dayjs'; |
| | | import 'styles/common.scss'; |
| | | import { setToken, setRefreshToken } from './utils/auth' |
| | | import { setStore } from './utils/store' |
| | | import './permission' |
| | | import error from './error' |
| | | import avueUeditor from 'avue-plugin-ueditor' |
| | | import basicBlock from 'components/basic-block/main.vue' |
| | | import basicContainer from 'components/basic-container/main.vue' |
| | | import welContainer from 'components/wel-container/main.vue' |
| | | import basicMainContent from 'components/basic-main-content/main.vue' |
| | | |
| | | import thirdRegister from './components/third-register/main.vue' |
| | | import NfDesignBase from '@saber/nf-design-base-elp' |
| | | import flowDesign from './components/flow-design/main.vue' |
| | | import App from './App.vue' |
| | | import 'animate.css' |
| | | import dayjs from 'dayjs' |
| | | import 'styles/common.scss' |
| | | import * as Cesium from 'cesium' |
| | | |
| | | // 业务组件 |
| | | import tenantPackage from './views/system/tenantpackage.vue'; |
| | | import tenantPackage from './views/system/tenantpackage.vue' |
| | | // 地图依赖 |
| | | import mapContainer from './components/map-container/mapContainer.vue' |
| | | |
| | | import * as DC from '@dvgis/dc-sdk' |
| | | import '@dvgis/dc-sdk/dist/dc.min.css' |
| | | window.DC = Object.create(DC) |
| | | import { onResize } from '@/utils/rem' |
| | | onResize() |
| | | const { VITE_APP_BASE, VITE_APP_CESIUM_TOKEN } = import.meta.env |
| | | window.CESIUM_BASE_URL = `${VITE_APP_BASE}/cesiumPu` |
| | | Cesium.Ion.defaultAccessToken = VITE_APP_CESIUM_TOKEN |
| | | |
| | | // 获取url中是否存在token |
| | | const urlParams = getUrlParams(window.location.href) |
| | | if (urlParams?.token && !localStorage.getItem("isReload")) { |
| | | localStorage.setItem("isReload", true) |
| | | // 设置cookie和localStorage |
| | | setStore('saber-token', urlParams.token) |
| | | setToken(urlParams.token) |
| | | setRefreshToken(urlParams.token) |
| | | // 设置用户信息,把大屏用户信息保存到localStorage |
| | | let obj = {}; |
| | | obj = localStorage.getItem("bs_userInfo"); |
| | | if (obj instanceof Object) { |
| | | obj = obj.content |
| | | } else { |
| | | obj = JSON.parse(obj).content |
| | | } |
| | | setStore({ name: 'userInfo', content: obj }); |
| | | location.reload() |
| | | localStorage.setItem("isReload", true) |
| | | // 设置cookie和localStorage |
| | | setStore('saber-token', urlParams.token) |
| | | setToken(urlParams.token) |
| | | setRefreshToken(urlParams.token) |
| | | // 设置用户信息,把大屏用户信息保存到localStorage |
| | | let obj = {} |
| | | obj = localStorage.getItem("bs_userInfo") |
| | | obj = obj ? obj : localStorage.getItem("saber-userInfo") |
| | | if (obj instanceof Object) { |
| | | obj = obj.content |
| | | } else { |
| | | obj = JSON.parse(obj).content |
| | | } |
| | | setStore({ name: 'userInfo', content: obj }) |
| | | location.reload() |
| | | } else { |
| | | if (localStorage.getItem("isReload")) { |
| | | localStorage.removeItem("isReload") |
| | | } |
| | | } |
| | | |
| | | |
| | | window.$crudCommon = crudCommon; |
| | | window.axios = axios; |
| | | const app = createApp(App); |
| | | window.$crudCommon = crudCommon |
| | | window.axios = axios |
| | | const app = createApp(App) |
| | | for (const [key, component] of Object.entries(ElementPlusIconsVue)) { |
| | | app.component(key, component); |
| | | app.component(key, component) |
| | | } |
| | | app.component('basicContainer', basicContainer); |
| | | app.component('basicBlock', basicBlock); |
| | | app.component('thirdRegister', thirdRegister); |
| | | app.component('flowDesign', flowDesign); |
| | | app.component('tenantPackage', tenantPackage); |
| | | app.config.globalProperties.$dayjs = dayjs; |
| | | app.config.globalProperties.website = website; |
| | | app.config.globalProperties.getScreen = getScreen; |
| | | app.use(error); |
| | | app.use(i18n); |
| | | app.use(store); |
| | | app.use(router); |
| | | app.component('basicContainer', basicContainer) |
| | | app.component('welContainer', welContainer) |
| | | app.component('basicMainContent', basicMainContent) |
| | | |
| | | app.component('basicBlock', basicBlock) |
| | | app.component('thirdRegister', thirdRegister) |
| | | app.component('flowDesign', flowDesign) |
| | | app.component('tenantPackage', tenantPackage) |
| | | app.component('mapContainer', mapContainer) |
| | | |
| | | app.config.globalProperties.$dayjs = dayjs |
| | | app.config.globalProperties.website = website |
| | | app.config.globalProperties.getScreen = getScreen |
| | | app.config.globalProperties.pxToVh = height => height / 10.8 + 'vh' |
| | | app.config.globalProperties.pxToRem = width => width * 0.1 + 'rem' |
| | | |
| | | app.use(error) |
| | | app.use(i18n) |
| | | app.use(store) |
| | | app.use(router) |
| | | app.use(ElementPlus, { |
| | | locale: messages[language], |
| | | }); |
| | | locale: messages[language], |
| | | }) |
| | | app.use(Avue, { |
| | | axios, |
| | | calcHeight: 10, |
| | | locale: messages[language], |
| | | }); |
| | | axios, |
| | | calcHeight: 10, |
| | | locale: messages[language], |
| | | }) |
| | | app.use(avueUeditor, { axios }) |
| | | app.use(NfDesignBase); |
| | | app.mount('#app'); |
| | | app.use(NfDesignBase) |
| | | app.mount('#app') |