import Vue from 'vue'
// import { ONL_AUTH_FIELDS } from "@/store/mutation-types"
// import { getAction } from '@/api/manage'


const interLock = {
  state: {
    //存储数据，用于组件之间的数据传输
    summaryEditInfo: {},
    summaryType: '新增',
    clickSystemNode: {}, // 左侧装置系统选择的联锁信息--用于新增联锁
    treeSelectKeys: [], // 装置系统树选择的树节点--用于回退页面时显示
    treeExpandedKeys: [], // 装置系统树展开的树节点--用于回退页面时显示
  },
  // （大概）区别：mutations用来修改state数据 同步
  mutations: {
    SET_SUMMARYEDITINFO: (state, infos) => {
      // console.log('fields',fields)
      // Vue.set(state, 'baseInfos', fields)
      state.summaryEditInfo = infos
    },
    SET_SUMMARYTYPE: (state, infos) => {
      // console.log('fields',fields)
      // Vue.set(state, 'baseInfos', fields)
      state.summaryType = infos
    },
    SET_CLICKSYSTEMNODE: (state, infos) => {
      // console.log('fields',fields)
      // Vue.set(state, 'baseInfos', fields)
      state.clickSystemNode = infos
    },
    SET_TREESELECTKEYS: (state, infos) => {
      // console.log('fields',fields)
      // Vue.set(state, 'baseInfos', fields)
      state.treeSelectKeys = infos
    },
    SET_TREEEXPANDEKEYS: (state, infos) => {
      // console.log('fields',fields)
      // Vue.set(state, 'baseInfos', fields)
      state.treeExpandedKeys = infos
    },
  },
  // （大概）区别：actions用来设计复杂逻辑 异步
  actions: {
    setSummaryEditInfo({ commit }, record) {
      commit('SET_SUMMARYEDITINFO', record)
    }
    // this.$store.state.kzksInfo.baseInfos
    // this.$store.dispatch('setWeituoBaseInfos', data)
  }
}

export default interLock