feat: 顶部右侧内容移除冗余代码,封装为组件

This commit is contained in:
TsMask
2025-06-12 10:43:47 +08:00
parent 4d171b0d06
commit 4e4b4bc2b7
8 changed files with 376 additions and 264 deletions

31
src/store/modules/core.ts Normal file
View File

@@ -0,0 +1,31 @@
import { defineStore } from 'pinia';
/**核心网信息类型 */
type Core = {
/**当前选择 */
current: string;
/**核心网选择 */
coreOptions: Record<string, any>[];
};
const useCoreStore = defineStore('core', {
state: (): Core => ({
current: 'Global',
coreOptions: [
{ label: 'Core', value: 'Core' },
{ label: 'Core2', value: 'Core2' },
],
}),
getters: {
getCoreOptions(): Record<string, any>[] {
return this.coreOptions;
},
},
actions: {
setCurrent(value: string = 'Global') {
this.current = value;
},
},
});
export default useCoreStore;