fix(日志): 标识符的字段修改

This commit is contained in:
Zhunianya
2025-12-17 15:09:52 +08:00
parent e0e9f19d85
commit 9aca5ea467

View File

@@ -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-option v-for="dict in dict.type.iot_event_type" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="标识符" prop="identity"> <el-form-item label="标识符" prop="identify">
<el-input v-model="queryParams.identity" placeholder="请输入标识符" clearable size="small" @keyup.enter.native="handleQuery" /> <el-input v-model="queryParams.identify" placeholder="请输入标识符" clearable size="small" @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item label="时间范围"> <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> <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> <span>{{ scope.row.createTime }}</span>
</template> </template>
</el-table-column> </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"> <el-table-column label="动作" align="left" header-align="center" prop="logValue">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-html="formatValueDisplay(scope.row)"></div> <div v-html="formatValueDisplay(scope.row)"></div>
@@ -103,7 +103,7 @@ export default {
deviceId: null, deviceId: null,
serialNumber: null, serialNumber: null,
deviceName: null, deviceName: null,
identity: null, identify: null,
isMonitor: null, isMonitor: null,
}, },
// 时间范围 // 时间范围
@@ -145,7 +145,7 @@ export default {
formatValueDisplay(row) { formatValueDisplay(row) {
// 类型1=属性上报2=调用功能3=事件上报4=设备升级5=设备上线6=设备离线) // 类型1=属性上报2=调用功能3=事件上报4=设备升级5=设备上线6=设备离线)
if (row.logType == 1) { if (row.logType == 1) {
let propertyItem = this.getThingsModelItem(1, row.identity); let propertyItem = this.getThingsModelItem(1, row.identify);
if (propertyItem != "") { if (propertyItem != "") {
return (propertyItem.parentName ? '[' + propertyItem.parentName + (propertyItem.arrayIndex ? propertyItem.arrayIndex : '') + '] ' : '') + return (propertyItem.parentName ? '[' + propertyItem.parentName + (propertyItem.arrayIndex ? propertyItem.arrayIndex : '') + '] ' : '') +
propertyItem.name + propertyItem.name +
@@ -153,7 +153,7 @@ export default {
(propertyItem.datatype.unit != undefined ? propertyItem.datatype.unit : '') + '</span>'; (propertyItem.datatype.unit != undefined ? propertyItem.datatype.unit : '') + '</span>';
} }
} else if (row.logType == 2) { } else if (row.logType == 2) {
let functionItem = this.getThingsModelItem(2, row.identity); let functionItem = this.getThingsModelItem(2, row.identify);
if (functionItem != "") { if (functionItem != "") {
return (functionItem.parentName ? '[' + functionItem.parentName + (functionItem.arrayIndex ? functionItem.arrayIndex : '') + '] ' : '') + return (functionItem.parentName ? '[' + functionItem.parentName + (functionItem.arrayIndex ? functionItem.arrayIndex : '') + '] ' : '') +
functionItem.name + functionItem.name +
@@ -161,7 +161,7 @@ export default {
(functionItem.datatype.unit != undefined ? functionItem.datatype.unit : '') + '</span>'; (functionItem.datatype.unit != undefined ? functionItem.datatype.unit : '') + '</span>';
} }
} else if (row.logType == 3) { } else if (row.logType == 3) {
let eventItem = this.getThingsModelItem(3, row.identity); let eventItem = this.getThingsModelItem(3, row.identify);
if (eventItem != "") { if (eventItem != "") {
return (eventItem.parentName ? '[' + eventItem.parentName + (eventItem.arrayIndex ? eventItem.arrayIndex : '') + '] ' : '') + return (eventItem.parentName ? '[' + eventItem.parentName + (eventItem.arrayIndex ? eventItem.arrayIndex : '') + '] ' : '') +
eventItem.name + eventItem.name +
@@ -199,17 +199,17 @@ export default {
return oldValue; return oldValue;
}, },
/** 获取物模型中的项*/ /** 获取物模型中的项*/
getThingsModelItem(type, identity) { getThingsModelItem(type, identify) {
if (type == 1 && this.thingsModel.properties) { if (type == 1 && this.thingsModel.properties) {
for (let i = 0; i < this.thingsModel.properties.length; i++) { for (let i = 0; i < this.thingsModel.properties.length; i++) {
//普通类型 integer/decimal/string/emum//bool //普通类型 integer/decimal/string/emum//bool
if (this.thingsModel.properties[i].id == identity) { if (this.thingsModel.properties[i].id == identify) {
return this.thingsModel.properties[i]; return this.thingsModel.properties[i];
} }
// 对象 object // 对象 object
if (this.thingsModel.properties[i].datatype.type == "object") { if (this.thingsModel.properties[i].datatype.type == "object") {
for (let j = 0; j < this.thingsModel.properties[i].datatype.params.length; j++) { 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; this.thingsModel.properties[i].datatype.params[j].parentName = this.thingsModel.properties[i].name;
return this.thingsModel.properties[i].datatype.params[j]; 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.type == "array" && this.thingsModel.properties[i].datatype.arrayType) {
if (this.thingsModel.properties[i].datatype.arrayType == "object") { if (this.thingsModel.properties[i].datatype.arrayType == "object") {
// 数组元素格式array_01_parentId_humidity,array_01_前缀终端上报时加上物模型中没有 // 数组元素格式array_01_parentId_humidity,array_01_前缀终端上报时加上物模型中没有
let realIdentity = identity; let realidentify = identify;
let arrayIndex = 0; let arrayIndex = 0;
if (identity.indexOf("array_") > -1) { if (identify.indexOf("array_") > -1) {
arrayIndex = identity.substring(6, 8); arrayIndex = identify.substring(6, 8);
realIdentity = identity.substring(9); realidentify = identify.substring(9);
} }
for (let j = 0; j < this.thingsModel.properties[i].datatype.params.length; j++) { 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].arrayIndex = Number(arrayIndex) + 1;
this.thingsModel.properties[i].datatype.params[j].parentName = this.thingsModel.properties[i].name; this.thingsModel.properties[i].datatype.params[j].parentName = this.thingsModel.properties[i].name;
@@ -236,7 +236,7 @@ export default {
} else { } else {
// 普通类型 // 普通类型
for (let j = 0; j < this.thingsModel.properties[i].datatype.arrayCount.length; j++) { 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].arrayIndex = Number(arrayIndex) + 1;
this.thingsModel.properties[i].parentName = "元素"; this.thingsModel.properties[i].parentName = "元素";
return this.thingsModel.properties[i]; return this.thingsModel.properties[i];
@@ -249,13 +249,13 @@ export default {
} else if (type == 2 && this.thingsModel.functions) { } else if (type == 2 && this.thingsModel.functions) {
for (let i = 0; i < this.thingsModel.functions.length; i++) { for (let i = 0; i < this.thingsModel.functions.length; i++) {
//普通类型 integer/decimal/string/emum/bool //普通类型 integer/decimal/string/emum/bool
if (this.thingsModel.functions[i].id == identity) { if (this.thingsModel.functions[i].id == identify) {
return this.thingsModel.functions[i]; return this.thingsModel.functions[i];
} }
// 对象 object // 对象 object
if (this.thingsModel.functions[i].datatype.type == "object") { if (this.thingsModel.functions[i].datatype.type == "object") {
for (let j = 0; j < this.thingsModel.functions[i].datatype.params.length; j++) { 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; this.thingsModel.functions[i].datatype.params[j].parentName = this.thingsModel.functions[i].name;
return this.thingsModel.functions[i].datatype.params[j]; return this.thingsModel.functions[i].datatype.params[j];
} }
@@ -264,15 +264,15 @@ export default {
// 数组 array // 数组 array
if (this.thingsModel.functions[i].datatype.type == "array" && this.thingsModel.functions[i].datatype.arrayType) { if (this.thingsModel.functions[i].datatype.type == "array" && this.thingsModel.functions[i].datatype.arrayType) {
// 数组元素格式array_01_parentId_humidity,array_01_前缀终端上报时加上物模型中没有 // 数组元素格式array_01_parentId_humidity,array_01_前缀终端上报时加上物模型中没有
let realIdentity = identity; let realidentify = identify;
let arrayIndex = 0; let arrayIndex = 0;
if (identity.indexOf("array_") > -1) { if (identify.indexOf("array_") > -1) {
arrayIndex = identity.substring(6, 8); arrayIndex = identify.substring(6, 8);
realIdentity = identity.substring(9); realidentify = identify.substring(9);
} }
if (this.thingsModel.functions[i].datatype.arrayType == "object") { if (this.thingsModel.functions[i].datatype.arrayType == "object") {
for (let j = 0; j < this.thingsModel.functions[i].datatype.params.length; j++) { 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].arrayIndex = Number(arrayIndex) + 1;
this.thingsModel.functions[i].datatype.params[j].parentName = this.thingsModel.functions[i].name; this.thingsModel.functions[i].datatype.params[j].parentName = this.thingsModel.functions[i].name;
@@ -282,7 +282,7 @@ export default {
} else { } else {
// 普通类型 // 普通类型
for (let j = 0; j < this.thingsModel.functions[i].datatype.arrayCount.length; j++) { 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].arrayIndex = Number(arrayIndex) + 1;
this.thingsModel.functions[i].parentName = "元素"; this.thingsModel.functions[i].parentName = "元素";
return this.thingsModel.functions[i]; return this.thingsModel.functions[i];
@@ -294,7 +294,7 @@ export default {
} }
} else if (type == 3 && this.thingsModel.events) { } else if (type == 3 && this.thingsModel.events) {
for (let i = 0; i < this.thingsModel.events.length; i++) { 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]; return this.thingsModel.events[i];
} }
} }