Commit 63603e2a authored by yating.lin's avatar yating.lin

传感器详情-运行状态页面: 在主题的下拉选项中,过滤掉topicType=4(REPORT) 的主题

parent 5fd3ca2a
Pipeline #1092 passed with stage
in 0 seconds
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
</nz-col> </nz-col>
<nz-col [nzSpan]="5"> <nz-col [nzSpan]="5">
<nz-select [(ngModel)]="selectedTopicValue" nzAllowClear nzPlaceHolder="Choose" style="min-width: 300px"> <nz-select [(ngModel)]="selectedTopicValue" nzAllowClear nzPlaceHolder="Choose" style="min-width: 300px">
<nz-option *ngFor="let one of deviceData" [nzValue]="one.topicName" [nzLabel]="one.topicName"></nz-option> <nz-option *ngFor="let one of topicOption" [nzValue]="one.topicName" [nzLabel]="one.topicName"></nz-option>
</nz-select> </nz-select>
</nz-col> </nz-col>
......
...@@ -17,6 +17,7 @@ export class SensorDetailComponent implements OnInit { ...@@ -17,6 +17,7 @@ export class SensorDetailComponent implements OnInit {
isLoading = false; isLoading = false;
deviceData = []; deviceData = [];
topicOption = [];
deviceNo = ''; deviceNo = '';
name = ''; name = '';
req: any = {}; req: any = {};
...@@ -79,7 +80,7 @@ export class SensorDetailComponent implements OnInit { ...@@ -79,7 +80,7 @@ export class SensorDetailComponent implements OnInit {
this.getCurrent(); this.getCurrent();
} }
}); });
this.topicOption = [];
this.getAllPolicies(); this.getAllPolicies();
} }
...@@ -117,6 +118,8 @@ export class SensorDetailComponent implements OnInit { ...@@ -117,6 +118,8 @@ export class SensorDetailComponent implements OnInit {
this.api.topic.getByDeviceNo([{deviceNo: this.deviceNo}, (data) => { this.api.topic.getByDeviceNo([{deviceNo: this.deviceNo}, (data) => {
if (data && data.constructor === Array) { if (data && data.constructor === Array) {
this.deviceData = data; this.deviceData = data;
// 在主题的下拉选项中,过滤掉topicType=4(REPORT) 的主题
this.updateTopicSelection();
} else { } else {
this.message.error(data && data.message ? data.message : '获取数据失败'); this.message.error(data && data.message ? data.message : '获取数据失败');
} }
...@@ -506,4 +509,15 @@ export class SensorDetailComponent implements OnInit { ...@@ -506,4 +509,15 @@ export class SensorDetailComponent implements OnInit {
refresh() { refresh() {
this.getCurrent(); this.getCurrent();
} }
updateTopicSelection() {
this.topicOption = [];
if (this.deviceData) {
this.deviceData.forEach(one => {
if (one.topicType !== 4) {
this.topicOption.push(one);
}
});
}
}
} }
...@@ -200,5 +200,6 @@ ...@@ -200,5 +200,6 @@
"selectInfluxDBTable": "选择InfluxDB数据库", "selectInfluxDBTable": "选择InfluxDB数据库",
"selectCompanyInfluxDBTable": "选择InfluxDB数据库", "selectCompanyInfluxDBTable": "选择InfluxDB数据库",
"noUserInfo": "用户信息不存在", "noUserInfo": "用户信息不存在",
"belongCompany": "所属公司" "belongCompany": "所属公司",
"isToSeeModel": "查看数据"
} }
...@@ -200,5 +200,6 @@ ...@@ -200,5 +200,6 @@
"selectInfluxDBTable": "选择InfluxDB数据库", "selectInfluxDBTable": "选择InfluxDB数据库",
"selectCompanyInfluxDBTable": "选择InfluxDB数据库", "selectCompanyInfluxDBTable": "选择InfluxDB数据库",
"noUserInfo": "用户信息不存在", "noUserInfo": "用户信息不存在",
"belongCompany": "所属公司" "belongCompany": "所属公司",
"isToSeeModel": "查看数据"
} }
...@@ -200,5 +200,6 @@ ...@@ -200,5 +200,6 @@
"selectInfluxDBTable": "选择InfluxDB数据库", "selectInfluxDBTable": "选择InfluxDB数据库",
"selectCompanyInfluxDBTable": "选择InfluxDB数据库", "selectCompanyInfluxDBTable": "选择InfluxDB数据库",
"noUserInfo": "用户信息不存在", "noUserInfo": "用户信息不存在",
"belongCompany": "所属公司" "belongCompany": "所属公司",
"isToSeeModel": "查看数据"
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment