From f46786f11c5c08ead7501a82e5a71430ad69b782 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期日, 27 四月 2025 17:39:24 +0800
Subject: [PATCH] 修复线索问题定位错误问题
---
model/device.js | 32 +++++++++++++++++++++++++++-----
1 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/model/device.js b/model/device.js
index 506b788..56888ad 100644
--- a/model/device.js
+++ b/model/device.js
@@ -5,9 +5,13 @@
import { toLabel as toLabelMonitor } from '../common/dataMonitorDeviceType';
import { toLabel as toLabelTreatment } from '../common/dataTreatmentDeviceType';
import { toLabel as toLabelProduction } from '../common/dataProductionDeviceType';
+import { inspectPicUrl } from '../config/index';
// 鐩戞祴璁惧
export function getMonitorDevice(data) {
+ data._id = data.diId
+ data._name = data.diName
+ data._deviceCode = data.diDeviceCode
data._updateTime = dayjs(data.diUpdateTime).format('YYYY骞碝M鏈圖D鏃�');
data._maintainFrequency = toLabelFreq(data.diMaintainFrequency);
data._ownership = toLabelOwner(data.diOwnership);
@@ -15,11 +19,14 @@
const labelArr = toLabelMonitor(data.diSceneTypeId, [data.diTypeId, data.diSubtypeId]);
data._type = labelArr[0];
data._subType = labelArr[1];
- return data
+ return data;
}
// 娌荤悊璁惧
export function getTreatmentDevice(data) {
+ data._id = data.piId
+ data._name = data.piName
+ data._deviceCode = data.piDeviceCode
data._updateTime = dayjs(data.piUpdateTime).format('YYYY骞碝M鏈圖D鏃�');
data._maintainFrequency = toLabelFreq(data.piMaintainFrequency);
data._ownership = toLabelOwner(data.piOwnership);
@@ -27,18 +34,21 @@
const labelArr = toLabelTreatment(data.piSceneTypeId, [data.piTypeId, data.piSubtypeId]);
data._type = labelArr[0];
data._subType = labelArr[1];
- return data
+ return data;
}
// 鐢熶骇璁惧
export function getProductionDevice(data) {
+ data._id = data.wiId
+ data._name = data.wiName
+ data._deviceCode = data.wiDeviceCode
data._updateTime = dayjs(data.wiUpdateTime).format('YYYY骞碝M鏈圖D鏃�');
data._ownership = toLabelOwner(data.wiOwnership);
data._runningStatus = toLabelStatus(data.wiRunningStatus);
const labelArr = toLabelProduction(data.wiSceneTypeId, [data.wiTypeId, data.wiSubtypeId]);
data._type = labelArr[0];
data._subType = labelArr[1];
- return data
+ return data;
}
export function getDeviceList(dataList, deviceType) {
@@ -46,14 +56,26 @@
// 鐩戞祴璁惧
if (deviceType == 0) {
return getMonitorDevice(item);
- }
+ }
// 娌荤悊璁惧
else if (deviceType == 1) {
return getTreatmentDevice(item);
- }
+ }
// 鐢熶骇璁惧
else if (deviceType == 2) {
return getProductionDevice(item);
}
});
}
+
+export function getDeviceStatus(data) {
+ data._createTime = dayjs(data.dlCreateTime).format('YYYY骞碝M鏈圖D鏃�');
+ data._imgPath = data.dlPicUrl.split(';').map(p => inspectPicUrl + p);
+ return data;
+}
+
+export function getDeviceStatusList(dataList) {
+ return dataList.map(item => {
+ return getDeviceStatus(item);
+ });
+}
--
Gitblit v1.9.3