2025-11-03 12:30:37 +08:00
|
|
|
/*
|
|
|
|
|
* @Date: 2025-11-03 10:52:09
|
|
|
|
|
* @LastEditors: shirlwang
|
2025-11-03 17:48:14 +08:00
|
|
|
* @LastEditTime: 2025-11-03 17:26:29
|
2025-11-03 12:30:37 +08:00
|
|
|
*/
|
2025-03-28 15:19:42 +08:00
|
|
|
import App from '@/App'
|
2024-11-08 11:55:23 +08:00
|
|
|
import * as Pinia from 'pinia'
|
2025-03-28 15:19:42 +08:00
|
|
|
import globalFunction from '@/common/globalFunction'
|
|
|
|
|
import '@/lib/string-similarity.min.js'
|
|
|
|
|
import similarityJobs from '@/utils/similarity_Job.js';
|
2025-09-29 11:53:10 +08:00
|
|
|
import config from '@/config.js';
|
2025-05-13 11:10:38 +08:00
|
|
|
// 组件
|
|
|
|
|
import AppLayout from './components/AppLayout/AppLayout.vue';
|
|
|
|
|
import Empty from './components/empty/empty.vue';
|
2025-03-28 15:19:42 +08:00
|
|
|
import NoBouncePage from '@/components/NoBouncePage/NoBouncePage.vue'
|
2025-04-16 14:24:06 +08:00
|
|
|
import MsgTips from '@/components/MsgTips/MsgTips.vue'
|
2025-05-13 11:10:38 +08:00
|
|
|
import SelectPopup from '@/components/selectPopup/selectPopup.vue'
|
|
|
|
|
import SelectPopupPlugin from '@/components/selectPopup/selectPopupPlugin';
|
|
|
|
|
import RenderJobs from '@/components/renderJobs/renderJobs.vue';
|
|
|
|
|
import RenderCompanys from '@/components/renderCompanys/renderCompanys.vue';
|
2025-11-03 12:30:37 +08:00
|
|
|
import uniIcons from './uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
|
|
|
|
|
import uniPopup from './uni_modules/uni-popup/components/uni-popup/uni-popup.vue'
|
|
|
|
|
import uniDataSelect from './uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue'
|
2025-11-03 17:48:14 +08:00
|
|
|
import uniSwipeAction from './uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.vue'
|
|
|
|
|
import uniSwipeActionItem from './uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.vue'
|
2025-11-03 12:30:37 +08:00
|
|
|
import storeRc from './utilsRc/store/index.js'
|
2025-10-20 16:15:29 +08:00
|
|
|
// iconfont.css 已在 App.vue 中通过 @import 引入,无需在此处重复引入
|
2025-04-10 10:59:25 +08:00
|
|
|
// import Tabbar from '@/components/tabbar/midell-box.vue'
|
2025-04-16 14:24:06 +08:00
|
|
|
// 自动导入 directives 目录下所有指令
|
|
|
|
|
const directives = import.meta.glob('./directives/*.js', {
|
|
|
|
|
eager: true
|
|
|
|
|
});
|
2025-03-29 11:51:48 +08:00
|
|
|
|
2024-11-08 11:55:23 +08:00
|
|
|
import {
|
2025-03-28 15:19:42 +08:00
|
|
|
createSSRApp,
|
2024-11-08 11:55:23 +08:00
|
|
|
} from 'vue'
|
|
|
|
|
|
2025-10-20 11:05:11 +08:00
|
|
|
// const foldFeature = window.visualViewport && 'segments' in window.visualViewport
|
|
|
|
|
// console.log('是否支持多段屏幕:', foldFeature)
|
2025-05-15 14:17:51 +08:00
|
|
|
|
2025-11-03 12:30:37 +08:00
|
|
|
import { getDict } from '@/apiRc/system/dict.js';
|
2025-03-28 15:19:42 +08:00
|
|
|
// 全局组件
|
2024-11-08 11:55:23 +08:00
|
|
|
export function createApp() {
|
|
|
|
|
const app = createSSRApp(App)
|
2025-03-28 15:19:42 +08:00
|
|
|
|
2025-05-13 11:10:38 +08:00
|
|
|
app.component('AppLayout', AppLayout)
|
|
|
|
|
app.component('Empty', Empty)
|
2025-03-28 15:19:42 +08:00
|
|
|
app.component('NoBouncePage', NoBouncePage)
|
2025-04-16 14:24:06 +08:00
|
|
|
app.component('MsgTips', MsgTips)
|
2025-05-13 11:10:38 +08:00
|
|
|
app.component('SelectPopup', SelectPopup)
|
|
|
|
|
app.component('RenderJobs', RenderJobs)
|
|
|
|
|
app.component('RenderCompanys', RenderCompanys)
|
2025-11-03 12:30:37 +08:00
|
|
|
app.component('uni-icons', uniIcons)
|
|
|
|
|
app.component('uni-popup', uniPopup)
|
|
|
|
|
app.component('uni-data-select', uniDataSelect)
|
2025-11-03 17:48:14 +08:00
|
|
|
app.component('uni-swipe-action', uniSwipeAction)
|
|
|
|
|
app.component('uni-swipe-action-item', uniSwipeActionItem)
|
2025-11-03 12:30:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
app.config.globalProperties.$getDict = getDict;
|
|
|
|
|
app.config.globalProperties.$store = storeRc;
|
|
|
|
|
app.config.globalProperties.$getDictSelectOption = async (dictType, isDigital = false, forceRefresh = false) => {
|
|
|
|
|
const dictData = await getDict(dictType, forceRefresh);
|
|
|
|
|
return dictData.map(item => ({
|
|
|
|
|
value: isDigital ? Number(item.dictValue || item.dictvalue) : (item.dictValue || item.dictvalue),
|
|
|
|
|
label: item.dictLabel || item.dictlabel,
|
|
|
|
|
...item
|
|
|
|
|
}));
|
|
|
|
|
};
|
2025-04-10 10:59:25 +08:00
|
|
|
// app.component('tabbar-custom', Tabbar)
|
2025-03-28 15:19:42 +08:00
|
|
|
|
2025-04-16 14:24:06 +08:00
|
|
|
for (const path in directives) {
|
|
|
|
|
const directiveModule = directives[path];
|
|
|
|
|
// 文件名作为指令名,./directives/fade.js => v-fade
|
|
|
|
|
const name = path.match(/\.\/directives\/(.*)\.js$/)[1];
|
|
|
|
|
app.directive(name, directiveModule.default);
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-28 15:19:42 +08:00
|
|
|
app.provide('globalFunction', {
|
|
|
|
|
...globalFunction,
|
2025-09-29 11:53:10 +08:00
|
|
|
similarityJobs,
|
|
|
|
|
config
|
2025-03-28 15:19:42 +08:00
|
|
|
});
|
2024-11-08 11:55:23 +08:00
|
|
|
app.provide('deviceInfo', globalFunction.getdeviceInfo());
|
2025-03-28 15:19:42 +08:00
|
|
|
|
2025-05-13 11:10:38 +08:00
|
|
|
app.use(SelectPopupPlugin);
|
2025-03-28 15:19:42 +08:00
|
|
|
app.use(Pinia.createPinia());
|
2025-11-03 12:30:37 +08:00
|
|
|
// 注册vuex
|
|
|
|
|
app.use(storeRc);
|
2025-05-13 11:10:38 +08:00
|
|
|
|
2024-11-08 11:55:23 +08:00
|
|
|
return {
|
|
|
|
|
app,
|
|
|
|
|
Pinia
|
|
|
|
|
}
|
|
|
|
|
}
|