28 lines
1.5 KiB
TypeScript
28 lines
1.5 KiB
TypeScript
import 'virtual:svg-icons-register'
|
|
import 'element-plus/dist/index.css'
|
|
import 'element-plus/theme-chalk/dark/css-vars.css'
|
|
import '@/styles/index.scss'
|
|
import '@/install/plugins/echart'
|
|
import { createApp, watch } from 'vue'
|
|
import ElementPlus from 'element-plus'
|
|
import installIcons from '@/install/plugins/element'
|
|
import perms from '@/install/directives/perms'
|
|
import store from '@/stores'
|
|
import useAppStore from '@/stores/modules/app'
|
|
import useUserStore from '@/stores/modules/user'
|
|
import useTabsStore from '@/stores/modules/multipleTabs'
|
|
import useSettingStore from '@/stores/modules/setting'
|
|
import Root from './Root.vue'
|
|
import router, { pages } from './router'
|
|
import classicLogo from './preview-mark.svg'
|
|
import artLogo from './preview-mark-art.svg'
|
|
const app = createApp(Root)
|
|
app.use(store); app.use(ElementPlus); installIcons(app); app.directive('perms', perms)
|
|
useUserStore().$patch({ token: '', userInfo: { name: '本地预览', role_ids: [] }, perms: ['order.order/lists','order.order/detail','user.user/lists','user.user/detail'], routes: pages.map(({ path, name, meta }) => ({ path, name, meta })) as any })
|
|
const appState = useAppStore(), settings = useSettingStore()
|
|
appState.$patch({ configFetchAttempted: true, config: { web_name: '甄养堂' } })
|
|
settings.$patch({ showLogo: true })
|
|
watch(() => settings.adminUi, mode => { appState.config.web_logo = mode === 'v2' ? artLogo : classicLogo }, { immediate: true })
|
|
useTabsStore().setRouteName('preview-workbench')
|
|
app.use(router); router.isReady().then(() => app.mount('#app'))
|