// 数据缓存
import Vue from 'vue';
import { parameterPageList } from '@/api/system/params-data';

const state = {
  paramsData: []
};

const mutations = {
  // 获取当前登录参数配置数据
  setParamsData(state, info) {
    state.paramsData = info;
  }
};

const actions = {
  setParamsDataInfo({ commit }) {
    console.log('我是参数设置');
    parameterPageList({
      pageNum: 1,
      size: 999
    })
      .then((res) => {
        console.log(res.list);
        commit('setParamsData', res.list);
      })
      .catch((e) => {
        commit('setParamsData', []);
      });
  }
};

export default {
  namespaced: true,
  state,
  mutations,
  actions
};
