mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-20 01:45:55 +08:00
fix(日志): 标识符的字段修改
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
<el-option v-for="dict in dict.type.iot_event_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="标识符" prop="identity">
|
||||
<el-input v-model="queryParams.identity" placeholder="请输入标识符" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
<el-form-item label="标识符" prop="identify">
|
||||
<el-input v-model="queryParams.identify" placeholder="请输入标识符" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="时间范围">
|
||||
<el-date-picker v-model="daterangeTime" size="small" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
@@ -36,7 +36,7 @@
|
||||
<span>{{ scope.row.createTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="标识符" align="center" prop="identity" />
|
||||
<el-table-column label="标识符" align="center" prop="identify" />
|
||||
<el-table-column label="动作" align="left" header-align="center" prop="logValue">
|
||||
<template slot-scope="scope">
|
||||
<div v-html="formatValueDisplay(scope.row)"></div>
|
||||
@@ -103,7 +103,7 @@ export default {
|
||||
deviceId: null,
|
||||
serialNumber: null,
|
||||
deviceName: null,
|
||||
identity: null,
|
||||
identify: null,
|
||||
isMonitor: null,
|
||||
},
|
||||
// 时间范围
|
||||
@@ -145,7 +145,7 @@ export default {
|
||||
formatValueDisplay(row) {
|
||||
// 类型(1=属性上报,2=调用功能,3=事件上报,4=设备升级,5=设备上线,6=设备离线)
|
||||
if (row.logType == 1) {
|
||||
let propertyItem = this.getThingsModelItem(1, row.identity);
|
||||
let propertyItem = this.getThingsModelItem(1, row.identify);
|
||||
if (propertyItem != "") {
|
||||
return (propertyItem.parentName ? '[' + propertyItem.parentName + (propertyItem.arrayIndex ? propertyItem.arrayIndex : '') + '] ' : '') +
|
||||
propertyItem.name +
|
||||
@@ -153,7 +153,7 @@ export default {
|
||||
(propertyItem.datatype.unit != undefined ? propertyItem.datatype.unit : '') + '</span>';
|
||||
}
|
||||
} else if (row.logType == 2) {
|
||||
let functionItem = this.getThingsModelItem(2, row.identity);
|
||||
let functionItem = this.getThingsModelItem(2, row.identify);
|
||||
if (functionItem != "") {
|
||||
return (functionItem.parentName ? '[' + functionItem.parentName + (functionItem.arrayIndex ? functionItem.arrayIndex : '') + '] ' : '') +
|
||||
functionItem.name +
|
||||
@@ -161,7 +161,7 @@ export default {
|
||||
(functionItem.datatype.unit != undefined ? functionItem.datatype.unit : '') + '</span>';
|
||||
}
|
||||
} else if (row.logType == 3) {
|
||||
let eventItem = this.getThingsModelItem(3, row.identity);
|
||||
let eventItem = this.getThingsModelItem(3, row.identify);
|
||||
if (eventItem != "") {
|
||||
return (eventItem.parentName ? '[' + eventItem.parentName + (eventItem.arrayIndex ? eventItem.arrayIndex : '') + '] ' : '') +
|
||||
eventItem.name +
|
||||
@@ -199,17 +199,17 @@ export default {
|
||||
return oldValue;
|
||||
},
|
||||
/** 获取物模型中的项*/
|
||||
getThingsModelItem(type, identity) {
|
||||
getThingsModelItem(type, identify) {
|
||||
if (type == 1 && this.thingsModel.properties) {
|
||||
for (let i = 0; i < this.thingsModel.properties.length; i++) {
|
||||
//普通类型 integer/decimal/string/emum//bool
|
||||
if (this.thingsModel.properties[i].id == identity) {
|
||||
if (this.thingsModel.properties[i].id == identify) {
|
||||
return this.thingsModel.properties[i];
|
||||
}
|
||||
// 对象 object
|
||||
if (this.thingsModel.properties[i].datatype.type == "object") {
|
||||
for (let j = 0; j < this.thingsModel.properties[i].datatype.params.length; j++) {
|
||||
if (this.thingsModel.properties[i].datatype.params[j].id == identity) {
|
||||
if (this.thingsModel.properties[i].datatype.params[j].id == identify) {
|
||||
this.thingsModel.properties[i].datatype.params[j].parentName = this.thingsModel.properties[i].name;
|
||||
return this.thingsModel.properties[i].datatype.params[j];
|
||||
}
|
||||
@@ -219,14 +219,14 @@ export default {
|
||||
if (this.thingsModel.properties[i].datatype.type == "array" && this.thingsModel.properties[i].datatype.arrayType) {
|
||||
if (this.thingsModel.properties[i].datatype.arrayType == "object") {
|
||||
// 数组元素格式:array_01_parentId_humidity,array_01_前缀终端上报时加上,物模型中没有
|
||||
let realIdentity = identity;
|
||||
let realidentify = identify;
|
||||
let arrayIndex = 0;
|
||||
if (identity.indexOf("array_") > -1) {
|
||||
arrayIndex = identity.substring(6, 8);
|
||||
realIdentity = identity.substring(9);
|
||||
if (identify.indexOf("array_") > -1) {
|
||||
arrayIndex = identify.substring(6, 8);
|
||||
realidentify = identify.substring(9);
|
||||
}
|
||||
for (let j = 0; j < this.thingsModel.properties[i].datatype.params.length; j++) {
|
||||
if (this.thingsModel.properties[i].datatype.params[j].id == realIdentity) {
|
||||
if (this.thingsModel.properties[i].datatype.params[j].id == realidentify) {
|
||||
// 标注索引和父级名称
|
||||
this.thingsModel.properties[i].datatype.params[j].arrayIndex = Number(arrayIndex) + 1;
|
||||
this.thingsModel.properties[i].datatype.params[j].parentName = this.thingsModel.properties[i].name;
|
||||
@@ -236,7 +236,7 @@ export default {
|
||||
} else {
|
||||
// 普通类型
|
||||
for (let j = 0; j < this.thingsModel.properties[i].datatype.arrayCount.length; j++) {
|
||||
if (this.thingsModel.properties[i].id == realIdentity) {
|
||||
if (this.thingsModel.properties[i].id == realidentify) {
|
||||
this.thingsModel.properties[i].arrayIndex = Number(arrayIndex) + 1;
|
||||
this.thingsModel.properties[i].parentName = "元素";
|
||||
return this.thingsModel.properties[i];
|
||||
@@ -249,13 +249,13 @@ export default {
|
||||
} else if (type == 2 && this.thingsModel.functions) {
|
||||
for (let i = 0; i < this.thingsModel.functions.length; i++) {
|
||||
//普通类型 integer/decimal/string/emum/bool
|
||||
if (this.thingsModel.functions[i].id == identity) {
|
||||
if (this.thingsModel.functions[i].id == identify) {
|
||||
return this.thingsModel.functions[i];
|
||||
}
|
||||
// 对象 object
|
||||
if (this.thingsModel.functions[i].datatype.type == "object") {
|
||||
for (let j = 0; j < this.thingsModel.functions[i].datatype.params.length; j++) {
|
||||
if (this.thingsModel.functions[i].datatype.params[j].id == identity) {
|
||||
if (this.thingsModel.functions[i].datatype.params[j].id == identify) {
|
||||
this.thingsModel.functions[i].datatype.params[j].parentName = this.thingsModel.functions[i].name;
|
||||
return this.thingsModel.functions[i].datatype.params[j];
|
||||
}
|
||||
@@ -264,15 +264,15 @@ export default {
|
||||
// 数组 array
|
||||
if (this.thingsModel.functions[i].datatype.type == "array" && this.thingsModel.functions[i].datatype.arrayType) {
|
||||
// 数组元素格式:array_01_parentId_humidity,array_01_前缀终端上报时加上,物模型中没有
|
||||
let realIdentity = identity;
|
||||
let realidentify = identify;
|
||||
let arrayIndex = 0;
|
||||
if (identity.indexOf("array_") > -1) {
|
||||
arrayIndex = identity.substring(6, 8);
|
||||
realIdentity = identity.substring(9);
|
||||
if (identify.indexOf("array_") > -1) {
|
||||
arrayIndex = identify.substring(6, 8);
|
||||
realidentify = identify.substring(9);
|
||||
}
|
||||
if (this.thingsModel.functions[i].datatype.arrayType == "object") {
|
||||
for (let j = 0; j < this.thingsModel.functions[i].datatype.params.length; j++) {
|
||||
if (this.thingsModel.functions[i].datatype.params[j].id == realIdentity) {
|
||||
if (this.thingsModel.functions[i].datatype.params[j].id == realidentify) {
|
||||
// 标注索引和父级名称
|
||||
this.thingsModel.functions[i].datatype.params[j].arrayIndex = Number(arrayIndex) + 1;
|
||||
this.thingsModel.functions[i].datatype.params[j].parentName = this.thingsModel.functions[i].name;
|
||||
@@ -282,7 +282,7 @@ export default {
|
||||
} else {
|
||||
// 普通类型
|
||||
for (let j = 0; j < this.thingsModel.functions[i].datatype.arrayCount.length; j++) {
|
||||
if (this.thingsModel.functions[i].id == realIdentity) {
|
||||
if (this.thingsModel.functions[i].id == realidentify) {
|
||||
this.thingsModel.functions[i].arrayIndex = Number(arrayIndex) + 1;
|
||||
this.thingsModel.functions[i].parentName = "元素";
|
||||
return this.thingsModel.functions[i];
|
||||
@@ -294,7 +294,7 @@ export default {
|
||||
}
|
||||
} else if (type == 3 && this.thingsModel.events) {
|
||||
for (let i = 0; i < this.thingsModel.events.length; i++) {
|
||||
if (this.thingsModel.events[i].id == identity) {
|
||||
if (this.thingsModel.events[i].id == identify) {
|
||||
return this.thingsModel.events[i];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user