|
|
@@ -12,7 +12,7 @@ import {
|
|
|
export function getRatios () {
|
|
|
return request({
|
|
|
url: '/device/resolutionRatio',
|
|
|
- method: 'get'
|
|
|
+ method: 'GET'
|
|
|
}).then(({ data }) => {
|
|
|
return Object.keys(data).map(key => {
|
|
|
return {
|
|
|
@@ -26,7 +26,7 @@ export function getRatios () {
|
|
|
export function addDevice (data) {
|
|
|
return add({
|
|
|
url: '/device',
|
|
|
- method: 'post',
|
|
|
+ method: 'POST',
|
|
|
data
|
|
|
})
|
|
|
}
|
|
|
@@ -42,7 +42,7 @@ export function updateDevice (data) {
|
|
|
export function deleteDevice ({ id, name }) {
|
|
|
return send({
|
|
|
url: `/device/${id}/standbyDevice`,
|
|
|
- method: 'get',
|
|
|
+ method: 'GET',
|
|
|
params: { pageNum: 1, pageSize: 1 }
|
|
|
}).then(({ data }) => {
|
|
|
return confirm(data.length
|
|
|
@@ -50,7 +50,7 @@ export function deleteDevice ({ id, name }) {
|
|
|
: `确定删除 ${name}?`
|
|
|
).then(() => messageSend({
|
|
|
url: `/device/${id}`,
|
|
|
- method: 'delete'
|
|
|
+ method: 'DELETE'
|
|
|
}, '删除'))
|
|
|
})
|
|
|
}
|
|
|
@@ -59,7 +59,7 @@ export function getDevices (query) {
|
|
|
const { pageNum: pageIndex, pageSize, ...params } = query
|
|
|
return request({
|
|
|
url: '/device/list',
|
|
|
- method: 'get',
|
|
|
+ method: 'GET',
|
|
|
params: {
|
|
|
pageIndex, pageSize,
|
|
|
...params
|
|
|
@@ -86,7 +86,7 @@ export function deactivateDevice ({ id, name }) {
|
|
|
export function getDevice (id) {
|
|
|
return request({
|
|
|
url: `/device/${id}`,
|
|
|
- method: 'get'
|
|
|
+ method: 'GET'
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -94,7 +94,7 @@ export function getSubDevices (query) {
|
|
|
const { id, pageNum: pageIndex, pageSize, ...params } = query
|
|
|
return request({
|
|
|
url: `/device/${id}/standbyDevice`,
|
|
|
- method: 'get',
|
|
|
+ method: 'GET',
|
|
|
params: {
|
|
|
pageIndex, pageSize,
|
|
|
...params
|
|
|
@@ -105,7 +105,7 @@ export function getSubDevices (query) {
|
|
|
export function addSubDevice ({ id }, data) {
|
|
|
return add({
|
|
|
url: `/device/${id}/addStandby`,
|
|
|
- method: 'post',
|
|
|
+ method: 'POST',
|
|
|
data
|
|
|
})
|
|
|
}
|
|
|
@@ -113,7 +113,7 @@ export function addSubDevice ({ id }, data) {
|
|
|
export function addProductType (data) {
|
|
|
return add({
|
|
|
url: '/productType',
|
|
|
- method: 'post',
|
|
|
+ method: 'POST',
|
|
|
data
|
|
|
})
|
|
|
}
|
|
|
@@ -129,7 +129,7 @@ export function updateProductType (data) {
|
|
|
export function deleteProductType ({ id, name }) {
|
|
|
return del({
|
|
|
url: `/productType/${id}`,
|
|
|
- method: 'delete'
|
|
|
+ method: 'DELETE'
|
|
|
}, name)
|
|
|
}
|
|
|
|
|
|
@@ -137,7 +137,7 @@ export function getProductTypes (query) {
|
|
|
const { pageNum: pageIndex, pageSize, ...params } = query
|
|
|
return request({
|
|
|
url: '/productType/list',
|
|
|
- method: 'get',
|
|
|
+ method: 'GET',
|
|
|
params: {
|
|
|
pageIndex, pageSize,
|
|
|
...params
|
|
|
@@ -148,7 +148,7 @@ export function getProductTypes (query) {
|
|
|
export function addProduct (data) {
|
|
|
return add({
|
|
|
url: '/product',
|
|
|
- method: 'post',
|
|
|
+ method: 'POST',
|
|
|
data
|
|
|
})
|
|
|
}
|
|
|
@@ -164,7 +164,7 @@ export function updateProduct (data) {
|
|
|
export function deleteProduct ({ id, name }) {
|
|
|
return del({
|
|
|
url: `/product/${id}`,
|
|
|
- method: 'delete'
|
|
|
+ method: 'DELETE'
|
|
|
}, name)
|
|
|
}
|
|
|
|
|
|
@@ -172,7 +172,7 @@ export function getProducts (query) {
|
|
|
const { pageNum: pageIndex, pageSize, ...params } = query
|
|
|
return request({
|
|
|
url: '/product/list',
|
|
|
- method: 'get',
|
|
|
+ method: 'GET',
|
|
|
params: {
|
|
|
pageIndex, pageSize,
|
|
|
...params
|
|
|
@@ -183,7 +183,7 @@ export function getProducts (query) {
|
|
|
export function addDeviceGroup (data) {
|
|
|
return add({
|
|
|
url: '/deviceGroup',
|
|
|
- method: 'post',
|
|
|
+ method: 'POST',
|
|
|
data
|
|
|
})
|
|
|
}
|
|
|
@@ -199,7 +199,7 @@ export function updateDeviceGroup (data) {
|
|
|
export function deleteDeviceGroup ({ id, name }) {
|
|
|
return del({
|
|
|
url: `/deviceGroup/${id}`,
|
|
|
- method: 'delete'
|
|
|
+ method: 'DELETE'
|
|
|
}, name)
|
|
|
}
|
|
|
|
|
|
@@ -207,7 +207,7 @@ export function getDeviceGroups (query) {
|
|
|
const { pageNum: pageIndex, pageSize, ...params } = query
|
|
|
return request({
|
|
|
url: '/deviceGroup/list',
|
|
|
- method: 'get',
|
|
|
+ method: 'GET',
|
|
|
params: {
|
|
|
pageIndex, pageSize,
|
|
|
...params
|
|
|
@@ -218,21 +218,21 @@ export function getDeviceGroups (query) {
|
|
|
export function getDevicesByGroup (id) {
|
|
|
return request({
|
|
|
url: `/deviceGroup/${id}/device`,
|
|
|
- method: 'get'
|
|
|
+ method: 'GET'
|
|
|
})
|
|
|
}
|
|
|
|
|
|
export function getDeviceTree () {
|
|
|
return request({
|
|
|
url: '/deviceGroup/deviceTree',
|
|
|
- method: 'get'
|
|
|
+ method: 'GET'
|
|
|
})
|
|
|
}
|
|
|
|
|
|
export function addDeviceToGroup (id, deviceId) {
|
|
|
return add({
|
|
|
url: `/deviceGroup/${id}/device`,
|
|
|
- method: 'post',
|
|
|
+ method: 'POST',
|
|
|
data: [].concat(deviceId)
|
|
|
})
|
|
|
}
|
|
|
@@ -240,7 +240,7 @@ export function addDeviceToGroup (id, deviceId) {
|
|
|
export function deleteDeviceFromGroup (id, { id: deviceId, name }) {
|
|
|
return confirmAndSend('移除', name, {
|
|
|
url: `/deviceGroup/${id}/device`,
|
|
|
- method: 'delete',
|
|
|
+ method: 'DELETE',
|
|
|
params: { deviceId }
|
|
|
})
|
|
|
}
|
|
|
@@ -248,7 +248,7 @@ export function deleteDeviceFromGroup (id, { id: deviceId, name }) {
|
|
|
export function getDeviceStatistics (productId) {
|
|
|
return request({
|
|
|
url: '/device/listDeviceTotal',
|
|
|
- method: 'post',
|
|
|
+ method: 'POST',
|
|
|
data: { productId }
|
|
|
})
|
|
|
}
|
|
|
@@ -257,7 +257,7 @@ export function getDeviceAlarms (query) {
|
|
|
const { pageNum: pageIndex, pageSize, ...params } = query
|
|
|
return request({
|
|
|
url: '/deviceException/list',
|
|
|
- method: 'get',
|
|
|
+ method: 'GET',
|
|
|
params: {
|
|
|
pageIndex, pageSize,
|
|
|
...params
|
|
|
@@ -268,7 +268,7 @@ export function getDeviceAlarms (query) {
|
|
|
export function getSensors (options) {
|
|
|
return request({
|
|
|
url: '/device/sensorType',
|
|
|
- method: 'get',
|
|
|
+ method: 'GET',
|
|
|
...options
|
|
|
})
|
|
|
}
|