/** * @program: kicc-ui * @description: 微应用配置存储中心 * @author: entfrm开发团队-王翔 * @create: 2023/7/22 */ import { defineStore } from 'pinia'; import { store } from '/@/store'; interface MicroAppState { formDesignApp: Recordable; workflowDesignApp: Recordable; } export const useMicroAppStore = defineStore({ id: 'micro-app', state: (): MicroAppState => ({ formDesignApp: {}, workflowDesignApp: {} }), getters: { getFormDesignApp(): Recordable { return this.formDesignApp; }, getWorkflowDesignApp(): Recordable { return this.workflowDesignApp; } }, actions: { setFormDesignApp(data: Recordable): void { this.formDesignApp = { ...this.formDesignApp, ...data }; }, setWorkflowDesignApp(data: Recordable): void { this.workflowDesignApp = { ...this.workflowDesignApp, ...data }; } } }); // 需要在设置之外使用 export function useMicroAppStoreWithOut() { return useMicroAppStore(store); }