v3.7.2 版本代码合并

This commit is contained in:
JEECG
2024-12-09 15:10:46 +08:00
parent 64b29f47e0
commit b0c4194602
118 changed files with 12729 additions and 1596 deletions

View File

@ -1,9 +1,19 @@
import type { App } from 'vue';
import type { Pinia } from 'pinia';
import { createPinia } from 'pinia';
const store = createPinia();
let store: Nullable<Pinia> = null;
export function setupStore(app: App<Element>) {
if (store == null) {
store = createPinia();
}
app.use(store);
}
// 销毁store
export function destroyStore() {
store = null;
}
export { store };

View File

@ -1,3 +1,4 @@
import type { MainAppProps } from "#/main";
import type { ProjectConfig, HeaderSetting, MenuSetting, TransitionSetting, MultiTabsSetting } from '/#/config';
import type { BeforeMiniState } from '/#/store';
@ -20,7 +21,9 @@ interface AppState {
// When the window shrinks, remember some states, and restore these states when the window is restored
beforeMiniInfo: BeforeMiniState;
// 页面跳转临时参数存储
messageHrefParams: any
messageHrefParams: any,
// 应用参数
mainAppProps: MainAppProps,
}
let timeId: TimeoutHandle;
export const useAppStore = defineStore({
@ -30,7 +33,8 @@ export const useAppStore = defineStore({
pageLoading: false,
projectConfig: Persistent.getLocal(PROJ_CFG_KEY),
beforeMiniInfo: {},
messageHrefParams: {}
messageHrefParams: {},
mainAppProps: {},
}),
getters: {
getPageLoading(): boolean {
@ -62,7 +66,10 @@ export const useAppStore = defineStore({
},
getMessageHrefParams():any{
return this.messageHrefParams;
}
},
getMainAppProps(): MainAppProps {
return this.mainAppProps;
},
},
actions: {
setPageLoading(loading: boolean): void {
@ -104,7 +111,14 @@ export const useAppStore = defineStore({
setMessageHrefParams(params: any): void {
this.messageHrefParams = params;
},
// 设置主应用参数
setMainAppProps(args: MainAppProps) {
this.mainAppProps.hideHeader = args.hideHeader ?? false;
this.mainAppProps.hideSider = args.hideSider ?? false;
this.mainAppProps.hideMultiTabs = args.hideMultiTabs ?? false;
},
},
});