|
|
@@ -2,7 +2,7 @@ import request from '@/utils/request';
|
|
|
import { download } from '@/utils/file';
|
|
|
|
|
|
// 获取类别实体分页
|
|
|
-export async function getBoatList (data) {
|
|
|
+export async function getBoatList(data) {
|
|
|
let par = new URLSearchParams(data);
|
|
|
const res = await request.get(`/main/category/pageSubstance?` + par, {});
|
|
|
if (res.data.code == 0) {
|
|
|
@@ -21,7 +21,7 @@ export async function getBoatList (data) {
|
|
|
// }
|
|
|
|
|
|
// 获取单个类别实体明细分页
|
|
|
-export async function getPageSingle (data) {
|
|
|
+export async function getPageSingle(data) {
|
|
|
let par = new URLSearchParams(data);
|
|
|
const res = await request.get(`/main/asset/pageSingleSubstance?` + par, {});
|
|
|
if (res.data.code == 0) {
|
|
|
@@ -31,7 +31,7 @@ export async function getPageSingle (data) {
|
|
|
}
|
|
|
|
|
|
// 获取实体列表分页
|
|
|
-export async function getAssetList (data) {
|
|
|
+export async function getAssetList(data) {
|
|
|
let par = new URLSearchParams(data);
|
|
|
const res = await request.get(`/main/asset/page?` + par, {});
|
|
|
if (res.data.code == 0) {
|
|
|
@@ -41,7 +41,7 @@ export async function getAssetList (data) {
|
|
|
}
|
|
|
|
|
|
// 查询实例详情
|
|
|
-export async function getAssetInfo (id) {
|
|
|
+export async function getAssetInfo(id) {
|
|
|
const res = await request.get(`main/asset/getById/${id}`);
|
|
|
if (res.data.code == 0) {
|
|
|
return res.data.data;
|
|
|
@@ -49,7 +49,7 @@ export async function getAssetInfo (id) {
|
|
|
return Promise.reject(new Error(res.data.message));
|
|
|
}
|
|
|
// 保存or更新
|
|
|
-export async function saveOrEdit (data) {
|
|
|
+export async function saveOrEdit(data) {
|
|
|
const res = await request.post(`/main/asset/saveOrEdit`, data);
|
|
|
if (res.data.code == 0) {
|
|
|
return res.data;
|
|
|
@@ -57,10 +57,9 @@ export async function saveOrEdit (data) {
|
|
|
return Promise.reject(new Error(res.data.message));
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 根据类别统计位置数量
|
|
|
-export async function getCount (data) {
|
|
|
- const res = await request.get(`/main/asset/countPosition` , { params: data } );
|
|
|
+export async function getCount(data) {
|
|
|
+ const res = await request.get(`/main/asset/countPosition`, { params: data });
|
|
|
if (res.data.code == 0) {
|
|
|
return res.data.data;
|
|
|
}
|
|
|
@@ -68,13 +67,36 @@ export async function getCount (data) {
|
|
|
}
|
|
|
|
|
|
// 导出实体
|
|
|
-export async function downloadAsset (params, fileName) {
|
|
|
- const res = await request.post('/main/asset/page/export', params, {responseType:'blob'} );
|
|
|
- download(res.data, fileName)
|
|
|
+export async function downloadAsset(params, fileName) {
|
|
|
+ const res = await request.post('/main/asset/page/export', params, {
|
|
|
+ responseType: 'blob'
|
|
|
+ });
|
|
|
+ download(res.data, fileName);
|
|
|
}
|
|
|
|
|
|
// 导出类别
|
|
|
-export async function downloadCategory (params, fileName) {
|
|
|
- const res = await request.post('/main/category/pageSubstance/export', params, {responseType:'blob'} );
|
|
|
- download(res.data, fileName)
|
|
|
+export async function downloadCategory(params, fileName) {
|
|
|
+ const res = await request.post(
|
|
|
+ '/main/category/pageSubstance/export',
|
|
|
+ params,
|
|
|
+ { responseType: 'blob' }
|
|
|
+ );
|
|
|
+ download(res.data, fileName);
|
|
|
+}
|
|
|
+// 设备网络状态统计
|
|
|
+export async function getNetworkCount(data) {
|
|
|
+ const res = await request.get(`/main/asset/networkCount`, { params: data });
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ return res.data.data;
|
|
|
+ }
|
|
|
+ return Promise.reject(new Error(res.data.message));
|
|
|
+}
|
|
|
+
|
|
|
+//移动分类
|
|
|
+export async function changeSubstanceCateId(data) {
|
|
|
+ const res = await request.post(`/main/asset/changeSubstanceCateId`, data);
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ return res.data;
|
|
|
+ }
|
|
|
+ return Promise.reject(new Error(res.data.message));
|
|
|
}
|