/**
 * long description for the file
 *
 * @summary 数据权限配置
 * @author wu <308822989@qq.com>
 *
 * Created at     : 2018-08-09 15:51:52
 * Last modified  : 2018-08-27 14:53:19
 */

import axios from '@/config/axios.js';
import {
  proPath
} from '@/config/config.js';

const state = {
  //  行操作类型
  operType: [{
    label: '浏览',
    value: '1'
  },
  {
    label: '读写',
    value: '2'
  },
  {
    label: '删除',
    value: '3'
  }
  ]
}

const getters = {}

const mutations = {}
const actions = {
  //  取用户列表
  list ({
    commit,
    state
  }, form) {
    let res = axios.get(proPath + 'v1/sysusers/', {
      params: form
    });
    return res;
  },
  //  删除
  delData ({
    commit,
    state
  }, id) {
    let res = axios.delete(proPath + 'v1/sysdatablepolicys/' + id);
    return res;
  }
  // //  添加
  // addUser ({ commit, state }, form) {
  //   let res = axios.post('v1/sysusers/', form);
  //   return res;
  // },
  // //  修改
  // editUser ({ commit, state }, obj) {
  //   let res = axios.put('v1/sysusers/' + obj.id, obj.form);
  //   return res;
  // },
  // //  删除
  // delUser ({ commit, state }, items) {
  //   if (!(items && items.length > 0)) {
  //     return false;
  //   }
  //   let arr = [];
  //   for (let item of items) {
  //     arr.push(item.userId);
  //   }
  //   items = arr.join(',');
  //   let res = axios.delete('v1/sysusers/' + items);
  //   return res;
  // }
}

//
export default {
  namespaced: true,
  state,
  getters,
  mutations,
  actions
}
