mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-09 02:46:45 +08:00
80 lines
2.2 KiB
JavaScript
80 lines
2.2 KiB
JavaScript
/*
|
|
* @Author: lixg lixg@dongwu-inc.com
|
|
* @Date: 2022-11-09 09:26:26
|
|
* @LastEditors: lixg lixg@dongwu-inc.com
|
|
* @LastEditTime: 2022-12-02 14:09:43
|
|
* @FilePath: /fe-manage/src/store/index.js
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
*/
|
|
import {createStore} from "vuex";
|
|
// import * as api from '../api/index1'
|
|
export default createStore({
|
|
state: {
|
|
openpages: localStorage.getItem("openpages")
|
|
? JSON.parse(localStorage.getItem("openpages"))
|
|
: [],
|
|
assessmentName: "",
|
|
routerId: null,
|
|
projectTemplateId: null,
|
|
userInfo: {},
|
|
userInfoOrgs: [],
|
|
orgtreeList: [],
|
|
faceclassPic: null,
|
|
faceclassClass: [],
|
|
faceclassScene: [],
|
|
projectLevel: [],//项目级别
|
|
projectSys: [],//培训分类
|
|
pathmapPic: [],//学习路径背景图
|
|
memberInitInfo: [],//学员默认
|
|
sysType: [],//学员默认
|
|
menus: [],
|
|
sysTypeMap:null
|
|
},
|
|
getters: {},
|
|
mutations: {
|
|
chengeOpenpages(state, list) {
|
|
// console.log('list', list)
|
|
state.openpages = list;
|
|
},
|
|
chengeRouterId(state, routerId) {
|
|
// console.log('list', list)
|
|
state.routerId = routerId;
|
|
},
|
|
|
|
SET_assessmentName(state, name) {
|
|
state.assessmentName = name;
|
|
console.log("state.assessmentName");
|
|
console.log(state.assessmentName);
|
|
},
|
|
//获取组织树
|
|
getOrgtreeList(state, data) {
|
|
state.orgtreeList = data;
|
|
},
|
|
SET_DICT(state, { key, data }) {
|
|
state[key] = data;
|
|
},
|
|
SET_SYSTYPEMAP(state, map) {
|
|
state.sysTypeMap = map;
|
|
},
|
|
SET_MEMBER_INFO(state, data) {
|
|
state.memberInitInfo = data;
|
|
},
|
|
SET_USER(state, userInfo) {
|
|
userInfo.avatar = userInfo.avatar?.includes(process.env.VUE_APP_AVATAR_PATH) ? userInfo.avatar : (process.env.VUE_APP_AVATAR_PATH + userInfo.avatar);
|
|
state.userInfo = userInfo;
|
|
},
|
|
SET_USER_ORGS(state,orgs){
|
|
state.userInfoOrgs = orgs;
|
|
},
|
|
SET_projectTemplateId(state, projectTemplateId) {
|
|
state.projectTemplateId = projectTemplateId;
|
|
},
|
|
SET_PERMISSION(state, permissions) {
|
|
state.menus = permissions;
|
|
}
|
|
|
|
},
|
|
actions: {},
|
|
modules: {},
|
|
});
|