/*
 * @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"))
            : [
                {
                    pagename: "学习路径图",
                    href: "/learningpath",
                    active: true,
                },
            ],

        assessmentName: "",
        routerId: null,
        projectTemplateId: null,
        userInfo: {},
        orgtreeList: [],
        faceclassPic: null,
        faceclassClass: [],
        faceclassScene: [],
        projectLevel: [],//项目级别
        projectSys: [],//培训分类
        pathmapPic: [],//学习路径背景图
        memberInitInfo: [],//学员默认
        sysType: [],//学员默认
    },
    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_MEMBER_INFO(state, data) {
            state.memberInitInfo = data
        },
        SET_USER(state, userInfo) {
            state.userInfo = userInfo
        },
        SET_projectTemplateId(state, projectTemplateId) {
            state.projectTemplateId = projectTemplateId;
        }


    },
    actions: {},
    modules: {},
});
