Browse Source

获取设备轨道数据 分页

lincl 2 years ago
parent
commit
d321583218
1 changed files with 36 additions and 1 deletions
  1. 36 1
      mini-pro-web/src/api/api-medicineAbinet.js

+ 36 - 1
mini-pro-web/src/api/api-medicineAbinet.js

@ -464,8 +464,43 @@ let service = {
	// 根据设备id查询设备轨道数据
	findMediicinecabinetInventoryByDeviceId: function(params) {
		return new Promise((resolve, reject)=>{
			var req = [
				service.findMediicinecabinetInventoryByDeviceIdPage(_.assign({start: 1, end: 2}, params)),
				service.findMediicinecabinetInventoryByDeviceIdPage(_.assign({start: 3, end: 4}, params)),
				service.findMediicinecabinetInventoryByDeviceIdPage(_.assign({start: 5, end: 999}, params)),
			]
			Promise.all(req)
				.then(res=>{
					if(res[0].status==200 && res[1].status==200 && res[2].status==200){
						var list = (res[0].detailModelList || [])
							.concat(res[1].detailModelList || [])
							.concat(res[2].detailModelList || [])
						return resolve({
							message: "success",
							status: 200,
							detailModelList: list
						})
					} else {
						reject("获取设备轨道数据失败")
					}
				})
				.catch(err=>{
					reject(err)
				})
		})
		
		// return request({
		// 	url: `${BASE}/baseDevice/findMediicinecabinetInventoryByDeviceId`,
		// 	method: "get",
		// 	params
		// });
    },
	// 根据设备id查询设备轨道数据
	findMediicinecabinetInventoryByDeviceIdPage: function(params) {
		return request({
			url: `${BASE}/baseDevice/findMediicinecabinetInventoryByDeviceId`,
			url: `${BASE}/baseDevice/findMediicinecabinetInventoryByDeviceIdPage`,
			method: "get",
			params
		});