feat: 完成梦象虚拟电厂集中门户基础框架搭建
新增登录页、布局、路由、Pinia状态管理、Mock数据等核心模块,配置环境变量、Vite、ESLint、Prettier、CommitLint等开发工具,添加品牌资源与全局样式。
This commit is contained in:
commit
9ddecbdb9a
42 files changed
+10448
No files matched your search
@@ -0,0 +1,60 @@
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
/**
|
||||
* 多系统链接管理 Store
|
||||
* 预留:后续用于管理子系统列表、快捷跳转、权限关联等
|
||||
*/
|
||||
export const useSystemStore = defineStore("system", {
|
||||
state: () => ({
|
||||
/** 系统列表 */
|
||||
systemList: [],
|
||||
/** 当前选中的系统 */
|
||||
currentSystem: null,
|
||||
/** 系统分类 */
|
||||
categories: [],
|
||||
/** 加载状态 */
|
||||
loading: false,
|
||||
}),
|
||||
|
||||
getters: {
|
||||
/**
|
||||
* 按分类获取系统列表
|
||||
*/
|
||||
getSystemsByCategory: (state) => (categoryId) => {
|
||||
return state.systemList.filter((s) => s.categoryId === categoryId);
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取收藏的系统
|
||||
*/
|
||||
favoriteSystems: (state) => {
|
||||
return state.systemList.filter((s) => s.isFavorite);
|
||||
},
|
||||
},
|
||||
|
||||
actions: {
|
||||
/**
|
||||
* 设置系统列表
|
||||
*/
|
||||
setSystemList(list) {
|
||||
this.systemList = list;
|
||||
},
|
||||
|
||||
/**
|
||||
* 设置当前系统
|
||||
*/
|
||||
setCurrentSystem(system) {
|
||||
this.currentSystem = system;
|
||||
},
|
||||
|
||||
/**
|
||||
* 重置状态
|
||||
*/
|
||||
reset() {
|
||||
this.systemList = [];
|
||||
this.currentSystem = null;
|
||||
this.categories = [];
|
||||
this.loading = false;
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user