Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	main.js
This commit is contained in:
wuzhimiao
2025-11-03 09:33:53 +08:00

19
main.js
View File

@@ -75,6 +75,7 @@ const storeRc = createStore({
} }
}) })
import storeRc from './utilsRc/store/index.js'
// const foldFeature = window.visualViewport && 'segments' in window.visualViewport // const foldFeature = window.visualViewport && 'segments' in window.visualViewport
// console.log('是否支持多段屏幕:', foldFeature) // console.log('是否支持多段屏幕:', foldFeature)
@@ -88,7 +89,7 @@ async function getDict(dictType, forceRefresh = false) {
if (dictCache.has(dictType) && !forceRefresh) { if (dictCache.has(dictType) && !forceRefresh) {
return dictCache.get(dictType); return dictCache.get(dictType);
} }
try { try {
// 使用packageRc/utils/request.js中的请求方法 // 使用packageRc/utils/request.js中的请求方法
// 注意这里使用的baseURL是 http://10.160.0.5:8907/ // 注意这里使用的baseURL是 http://10.160.0.5:8907/
@@ -97,14 +98,14 @@ async function getDict(dictType, forceRefresh = false) {
method: 'GET', method: 'GET',
load: true load: true
}); });
// 处理响应数据 // 处理响应数据
if (response.code === 200 && response.data) { if (response.code === 200 && response.data) {
// 缓存数据 // 缓存数据
dictCache.set(dictType, response.data); dictCache.set(dictType, response.data);
return response.data; return response.data;
} }
return []; return [];
} catch (error) { } catch (error) {
console.error(`获取字典[${dictType}]失败:`, error); console.error(`获取字典[${dictType}]失败:`, error);
@@ -122,7 +123,7 @@ export function createApp() {
app.component('RenderJobs', RenderJobs) app.component('RenderJobs', RenderJobs)
app.component('RenderCompanys', RenderCompanys) app.component('RenderCompanys', RenderCompanys)
// app.component('tabbar-custom', Tabbar) // app.component('tabbar-custom', Tabbar)
// 注册已安装的uni-ui组件 // 注册已安装的uni-ui组件
app.component('uni-icons', uniIcons) app.component('uni-icons', uniIcons)
app.component('uni-popup', uniPopup) app.component('uni-popup', uniPopup)
@@ -146,10 +147,10 @@ export function createApp() {
app.use(Pinia.createPinia()); app.use(Pinia.createPinia());
// 注册vuex // 注册vuex
app.use(storeRc); app.use(storeRc);
// 注册其他插件 // 注册其他插件
app.use(SelectPopupPlugin); app.use(SelectPopupPlugin);
// Vue 3 中挂载全局属性 - 字典获取方法 // Vue 3 中挂载全局属性 - 字典获取方法
app.config.globalProperties.$getDict = getDict; app.config.globalProperties.$getDict = getDict;
app.config.globalProperties.$store = storeRc; app.config.globalProperties.$store = storeRc;
@@ -161,11 +162,11 @@ export function createApp() {
...item ...item
})); }));
}; };
return { return {
app, app,
Pinia Pinia
} }
} }