refactor: 系统管理页面重构和ts类型声明优化

Former-commit-id: 40263bbb072596ada41ef33d9170841e7e66cd01
This commit is contained in:
郝先瑞
2022-06-15 00:48:17 +08:00
parent 928ba2dbd8
commit 321b584f9f
116 changed files with 1692 additions and 1485 deletions

View File

@@ -9,7 +9,7 @@ import 'element-plus/theme-chalk/index.css';
import Pagination from '@/components/Pagination/index.vue';
import '@/permission';
import 'default-passive-events'
import 'default-passive-events';
// 引入svg注册脚本
import 'virtual:svg-icons-register';
@@ -21,25 +21,25 @@ import i18n from '@/lang/index';
import '@/styles/index.scss';
// 根据字典编码获取字典列表全局方法
import { listDictsByCode } from '@/api/system/dict';
import { getDictItemsByTypeCode } from '@/api/system/dict';
const app = createApp(App);
// 自定义指令
import * as directive from '@/directive';
Object.keys(directive).forEach(key => {
Object.keys(directive).forEach((key) => {
app.directive(key, (directive as { [key: string]: Directive })[key]);
});
// 全局方法
app.config.globalProperties.$listDictsByCode = listDictsByCode;
app.config.globalProperties.$getDictItemsByTypeCode = getDictItemsByTypeCode;
// 注册全局组件
app
.component('Pagination', Pagination)
.use(createPinia() as any)
.use(router as any)
.use(createPinia())
.use(router)
.use(ElementPlus)
.use(i18n as any)
.use(i18n)
.mount('#app');