// import http from '@/utils/http'
// import request from '@/utils/request'
export default {
  //上传
  upload: function (params) {
    return http.syncUploadCall('/common/file/uploadFile', params);
  },
  //上传
  invoice: function (params) {
    return http.asyncCall('/data/invoice/list', params);
  },
  //菜单栏
  getMenu: function (params) {
    return http.asyncCall('/common/menu/tree', params, 'get');
  },
  //单据批复
  approve: function (data) {
    return http.asyncCall('/system/workflow/approve', data, 'post');
  },
  //流程(审批)详情
  recordList: function (data) {
    return http.asyncCall('/system/workflow/recordList', data, 'post');
  },
  // 上传外部链接
  uploadExteriorFile: function (params) {
    return http.asyncCall('/common/file/uploadExteriorFile', params);
  },
  //多个上传
  uploadMultipleFiles: function (params) {
    return http.syncUploadCall('/common/file/uploadMultipleFiles', params);
  },
  //数字字典(可换通用加data)
  getSource: function (params) {
    return http.asyncCall('/data/dict/source', params, 'get');
  },
  //根据组织code获取用户
  userListByOrg: function (params) {
    return http.asyncCall('/eam/main/user/userListByOrg', params, 'get');
  },
  //获取计划单流程
  workflow: function (url) {
    return http.asyncCall(url + '/workflow', {}, 'get');
  },
  //获取仓库下拉列表(需登录仓库账号)
  simpleList: function () {
    return http.asyncCall('/wms/warehouse/simpleList', {}, 'get');
  },
  //根据仓库id获取用户
  userListByWh: function (params) {
    return http.asyncCall('/eam/main/user/userListByWh', params, 'get');
  },
  //获取来源列表
  sourceList: function (url, params) {
    return http.asyncCall(url + '/sources', params, 'post');
  },

  //资产列表查询
  propertyList: function (url, params) {
    return http.asyncCall(url, params, 'post');
  },
  //json数据
  jsonData: function (params) {
    return request({
      // url: '/static/data/asset_type.json',
      url: '/data/json/asset_type.json',
      method: 'get'
    });
  },
  //根据组织code获取用户
  // userListByOrg: function (params) {
  //     return request({
  //         url: '/eam/main/user/userListByOrg',
  //         method: 'get',
  //         params
  //     })
  // },
  //资产基本信息详情
  simple: function (params) {
    return http.asyncCall('/eam/main/property/simple', params, 'get');
  },
  //条件查询人员
  users: function (params) {
    return http.asyncCall('/main/user/users', params, 'post', 'json');
  },
  // 角色下拉数据
  roleList: function (data) {
    return http.asyncCall('/base/role/list', data, 'post');
  },
  // 封装枚举定义数据字典方法
  getEnumDefinitionList: function (params) {
    return http.asyncCall(
      `/shareUtils/enumerationKeyvalue/${params.key}`,
      undefined,
      'get',
      'json'
    );
  },
  // 封装枚举定义数据字典方法
  getDictListByMainCode: function (mainCode) {
    return http.asyncCall(
      `/enumerationKeyvalue/getListByMainCode/${mainCode}`,
      undefined,
      'get'
    );
  },
  // 获取台账分类
  getClassify: function (params) {
    return http.asyncCall(`/classify/getClassify`, params, 'get');
  },
  // 根据父级id 获取所有子集
  getSubListByParentId: function (id = 0) {
    return http.asyncCall(`/classify/getSubListByParentId/${id}`, {}, 'get');
  }
};
