// 用户信息管理
let userManage = {
    state: {
        gradeClassListArr: [], // 年级班级结构数据表
        parentRelateListArr: [] // 家长关系列表
    },
    mutations: {
        // 保存年级班级数据结构
        saveGradeClassList (state, gradeClassListArr) {
            state.gradeClassListArr = gradeClassListArr
        },
        saveParentRelateList (state, parentRelateListArr) {
            state.parentRelateListArr = parentRelateListArr
        }
    }
}
let SQESystem = {
    state: {
        isAdmin: false,
        isExistsRole: false
    },
    mutations: {
        // 保存年级班级数据结构
        saveSQESystemPermission (state, permissionObj) {
            state.isAdmin = permissionObj.isAdmin
            state.isExistsRole = permissionObj.isExistsRole
        }
    }
}

// 家庭作业
let classHomeWork = {
    state: {
        addData: {},
        topicBankInfo: {}
    },
    mutations: {
        saveAddData (state, data) { // 作业新增页面信息保存
            state.addData = data
        },
        saveTopicBank (state, data) { // 保存题库信息
            state.topicBankInfo = data
        }
    }
}

// 场地管理 楼层列表
const SITES_MANAGE = {
    state: {
        floorList: [], // 楼层列表
        floorId: '' // 当前楼层id
    },
    mutations: {
        saveFloorList (state, data) {
            state.floorList = data
        },
        saveFloorId (state, data) {
            state.floorId = data
        }
    }
}

// 系统管理
const SYSTEM_MANAGE = {
    state: {
        organizeTree: []
    },
    mutations: {
        saveOrganize (state, data) {
            state.organizeTree = data
        }
    }
}

// 万能表单
const form = {
    state: {
        list: [],
        index: -1,
        subIndex: -1,
        formItem: {},
        titleAttr: {}
    },
    mutations: {
        saveList (state, payload) {
            state.list = payload
        },
        saveIndex (state, payload) {
            state.index = payload
        },
        saveSubIndex (state, payload) {
            state.subIndex = payload
        },
        saveFormItem (state, payload) {
            state.formItem = payload
        },
        saveTitleAttr (state, payload) {
            state.titleAttr = payload
        }
    }
}

// .....
export default {
    userManage,
    SQESystem,
    classHomeWork,
    SITES_MANAGE,
    SYSTEM_MANAGE,
    form
}
