You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
135 lines
4.9 KiB
135 lines
4.9 KiB
const http = uni.$u.http |
|
|
|
// 此处第二个参数vm,就是我们在页面使用的this,你可以通过vm获取vuex等操作,更多内容详见uView对拦截器的介绍部分: |
|
// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F |
|
const install = (Vue, vm) => { |
|
// 此处没有使用传入的params参数 |
|
let getTenantInfo = (params, config = {}) => http.get('/blade-system/tenant/info', params, config) |
|
// 此处使用了传入的params参数,一切自定义即可 |
|
let login = (params) => http.post('/blade-auth/oauth/token?' + params) |
|
// 退出 |
|
let logout = () => http.get('/blade-auth/oauth/logout') |
|
let register = (params, config = {}) => http.post('/blade-auth/oauth/token', params, config) |
|
|
|
// 首页 |
|
let getworkbench = () => http.post('/blade-auth/oauth/token', params, config) |
|
|
|
// 登录记录 |
|
let getLoginRecords = (params) => http.get('/blade-log/api/logOnList', params, { |
|
authorization: false, |
|
isparams: true |
|
}) |
|
// 修改记录 |
|
let getEditRecords = () => http.get('/blade-auth/oauth/token', params, config) |
|
// 意见反馈提交 |
|
let subEditRecords = (params) => http.post('/feedback/save', params) |
|
// 获取意见反馈类型 |
|
|
|
// 业务类型查询 |
|
let getChildList = (params) => http.get('/blade-system/dict-biz/child-list', { ...params }, { |
|
authorization: false, |
|
isparams: true |
|
}) |
|
// 获取设备列表 |
|
let getDeviceList = (params) => http.get('/device/list', { ...params }, { |
|
authorization: false, |
|
isparams: true |
|
}) |
|
|
|
// 需求提报 提交接口 |
|
let workOrderSave = (params) => http.post('/workOrder/save', params, { |
|
authorization: false, |
|
isparams: false |
|
}) |
|
// 需求提报 列表 /lab/workOrder/list |
|
let getWorkOrderRecords = (params) => http.get('/workOrder/list', { ...params }, { |
|
authorization: false, |
|
isparams: false |
|
}) |
|
// 根据id查询故障详情 |
|
let getBreakdownInfo = (params) => http.get('/workOrder/detail', { ...params }, { |
|
authorization: false, |
|
isparams: false |
|
}) |
|
// 修改白送 /lab/workOrder/update |
|
let workOrderupdate = (params) => http.post('/workOrder/update', params, { |
|
authorization: false, |
|
isparams: true |
|
}) |
|
|
|
// 评价提交 |
|
let evaluateSign = (params) => http.post('/workOrder/evaluateSign', params, { |
|
authorization: false, |
|
isparams: false |
|
}) |
|
|
|
// 获取维修人员 / |
|
let getRepairPersons = (params) => http.get('/blade-system/user/repairPersons', { ...params }, { |
|
authorization: false, |
|
isparams: false |
|
}) |
|
|
|
|
|
// 获取物料列表数据 goods/list |
|
let getGoodsList = (params) => http.get('/goods/list', params, { |
|
authorization: false, |
|
isparams: false |
|
}) |
|
|
|
// 巡检计划列表 / |
|
let getDictionaryList = (params) => http.get('/blade-system/dict/dictionary?code=flow', params, { |
|
authorization: false, |
|
isparams: false |
|
}) |
|
|
|
// 获取人员列表 |
|
let getUserList = (params) => http.get('/blade-system/user/page', { ...params }, { |
|
authorization: false, |
|
isparams: true |
|
}) |
|
|
|
// 工作台 |
|
// 实验室巡检 /workBenches/workList |
|
let workList = (params) => http.get('/workBenches/workList', { ...params }, { |
|
authorization: false, |
|
isparams: true |
|
}) |
|
// 设备报警 |
|
let deviceList = (params) => http.get('/workBenches/deviceList', { ...params }, { |
|
authorization: false, |
|
isparams: true |
|
}) |
|
// 维修柱状图 |
|
let upkeepStat = (params) => http.get('/workBenches/upkeepStat', { ...params }, { |
|
authorization: false, |
|
isparams: true |
|
}) |
|
// 故障现象分类 workBenches/pieStat |
|
let pieStat = (params) => http.get('/workBenches/pieStat', { ...params }, { |
|
authorization: false, |
|
isparams: true |
|
}) |
|
// 工作台 workBenches/overview |
|
let overview = (params) => http.get('/workBenches/overview', { ...params }, { |
|
authorization: false, |
|
isparams: true |
|
}) |
|
|
|
// 获取用户信息 / |
|
let getUserInfo = (params) => http.get('/blade-system/user/info', { ...params }, { |
|
authorization: false, |
|
isparams: true |
|
}) |
|
|
|
// 派单 /lab/workOrder/update |
|
let sendOrders = (params) => http.get('/workOrder/update', { ...params }, { |
|
authorization: false, |
|
isparams: true |
|
}) |
|
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下 |
|
vm.$u.api = { getTenantInfo, login, logout, register, getworkbench, getLoginRecords, getEditRecords, subEditRecords, getChildList, getDeviceList, workOrderSave, getWorkOrderRecords, getBreakdownInfo, workOrderupdate, evaluateSign, getRepairPersons, getGoodsList, getDictionaryList, getUserList, workList, deviceList,upkeepStat,pieStat,getUserInfo,overview }; |
|
} |
|
|
|
export default { |
|
install |
|
} |