|
|
@@ -97,6 +97,9 @@ export default {
|
|
|
return ThirdPartyDeviceInfo[this.type]
|
|
|
},
|
|
|
sorted () {
|
|
|
+ if (this.type === ThirdPartyDevice.TRANSLOCATION_SENSOR) {
|
|
|
+ return this.list
|
|
|
+ }
|
|
|
return this.list.slice().sort((a, b) => Number(a.value) < Number(b.value) ? 1 : -1)
|
|
|
},
|
|
|
sensorType () {
|
|
|
@@ -139,7 +142,7 @@ export default {
|
|
|
getSensorRecords({
|
|
|
deviceId: this.deviceId,
|
|
|
sensorType: this.type,
|
|
|
- startTime: now - 30000,
|
|
|
+ startTime: now - 10000,
|
|
|
endTime: now
|
|
|
}, { custom: true }).then(({ data }) => {
|
|
|
this.list = this.transfromData(data)
|
|
|
@@ -165,13 +168,12 @@ export default {
|
|
|
transformSensorData (data) {
|
|
|
const { port, type, value, time } = data
|
|
|
return {
|
|
|
- port,
|
|
|
- value,
|
|
|
+ port, value,
|
|
|
time: parseTime(time, '{y}-{m}-{d} {h}:{i}:{s}'),
|
|
|
- info: this.transformValue(type, value)
|
|
|
+ info: this.transformValue(type, value, data)
|
|
|
}
|
|
|
},
|
|
|
- transformValue (type, value) {
|
|
|
+ transformValue (type, value, data) {
|
|
|
switch (type) {
|
|
|
case ThirdPartyDevice.SMOKE_SENSOR:
|
|
|
return `${value}ppm`
|
|
|
@@ -181,6 +183,9 @@ export default {
|
|
|
return `${value}Lux`
|
|
|
case ThirdPartyDevice.FLOODING_SENSOR:
|
|
|
return value ? '是' : '否'
|
|
|
+ case ThirdPartyDevice.TRANSLOCATION_SENSOR:
|
|
|
+ console.log(data)
|
|
|
+ return `x ${data.xvalue?.toFixed(3)} y ${data.yvalue?.toFixed(3)} z ${data.zvalue?.toFixed(3)}`
|
|
|
default:
|
|
|
return value
|
|
|
}
|
|
|
@@ -212,6 +217,10 @@ export default {
|
|
|
&.sensor_12 {
|
|
|
background-image: url("~@/assets/icon_flooding.png");
|
|
|
}
|
|
|
+
|
|
|
+ &.sensor_13 {
|
|
|
+ background-image: url("~@/assets/icon_shift.png");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.o-sensor {
|