import request from '@/utils/request';

export default {
  //列表
  list: async (params) => {
    const res = await request.get('/main/workcenter/page', { params });
    if (res.data.code == 0) {
      return res.data.data;
    }
  },
  //获取人员列表
  getUserPage: async () => {
    const res = await request.get('/main/user/getUserPage', {
      params: {
        pageNum: 1,
        size: -1
      }
    });
    if (res.data.code == 0) {
      return res.data.data;
    }
  },

  //保存
  save: async (data) => {
    const res = await request.post('/main/workcenter/save', data);
    if (res.data.code == 0) {
      return res.data.message;
    }
  },
  //保存
  update: async (data) => {
    const res = await request.put('/main/workcenter/update', data);
    if (res.data.code == 0) {
      return res.data.message;
    }
  },
  //删除
  delete: async (data) => {
    const res = await request.delete('/main/workcenter/delete', { data });
    if (res.data.code == 0) {
      return res.data.message;
    }
  }
};
