You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1008 B
42 lines
1008 B
/** |
|
* @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); |
|
}
|
|
|