From 29d33ee06b2924f293bafe096eb1c0d481bd56b4 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Wed, 26 Apr 2023 16:41:44 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E5=90=8C=E6=AD=A5=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../analysis-of-the-host.component.ts | 9 +-- .../host-config/host-config.component.ts | 56 ++++++++++--------- .../organization/organization.component.ts | 13 ++++- 3 files changed, 43 insertions(+), 35 deletions(-) diff --git a/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts b/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts index 6ddec57..68d1ef3 100644 --- a/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts +++ b/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts @@ -119,16 +119,13 @@ export class AnalysisOfTheHostComponent implements OnInit { } refresh() { - if (!this.selectedOilStation.id) { - return; - } - this.http.put('/api/GasStations/SyncAllGasStations', null).subscribe({ + this.http.put('/api/EdgeDevices/SyncAllEdgeDevices', null).subscribe({ next: (data) => { - this.message.success('同步成功'); + this.message.success('同步边缘设备成功'); this.getHost(); }, error: (err) => { - this.message.error('同步失败'); + this.message.error('同步边缘设备失败'); }, }); } diff --git a/src/app/system-management/host-config/host-config.component.ts b/src/app/system-management/host-config/host-config.component.ts index ee3485a..887304a 100644 --- a/src/app/system-management/host-config/host-config.component.ts +++ b/src/app/system-management/host-config/host-config.component.ts @@ -1504,7 +1504,7 @@ ${newstr}class-id=0 //安信配置文件 configToAx() { let data = this.configJsonToAx(); - console.log(data) + console.log(data); // return; const modal = this.modal.create({ nzTitle: '下发安信config.json配置', @@ -1559,40 +1559,42 @@ ${newstr}class-id=0 user: '', password: '', }, - caps:[], + caps: [], }; console.log(this.listOfData); this.listOfData.forEach((item: any) => { - let type = null; - item.type === 0 - ? (type = 2) - : item.type === 1 - ? (type = 1) - : item.type === 2 - ? (type = 0) - : item.type === 3 - ? (type = 4) - : null; + if (item.isEnabled) { + let type = null; + item.type === 0 + ? (type = 2) + : item.type === 1 + ? (type = 1) + : item.type === 2 + ? (type = 0) + : item.type === 3 + ? (type = 4) + : null; - let areas = []; - if (item.dimensionedPointsAnxinObj) { - if (item.dimensionedPointsAnxinObj.yamlData.length !== 0) { - areas = item.dimensionedPointsAnxinObj.yamlData; + let areas = []; + if (item.dimensionedPointsAnxinObj) { + if (item.dimensionedPointsAnxinObj.yamlData.length !== 0) { + areas = item.dimensionedPointsAnxinObj.yamlData; + } } - } - let obj:any = { - id: item.id, - type: type, - url: item.uri, - name: item.name, - }; - if(areas.length !== 0){ - obj.areas = areas + let obj: any = { + id: item.id, + type: type, + url: item.uri, + name: item.name, + }; + if (areas.length !== 0) { + obj.areas = areas; + } + data.caps.push(obj); } - data.caps.push(obj); }); - return data + return data; } } diff --git a/src/app/system-management/organization/organization.component.ts b/src/app/system-management/organization/organization.component.ts index 761822c..3088d15 100644 --- a/src/app/system-management/organization/organization.component.ts +++ b/src/app/system-management/organization/organization.component.ts @@ -48,11 +48,20 @@ export class OrganizationComponent implements OnInit { refresh() { this.http.put('/api/Organizations/SyncAllOrganizations', null).subscribe({ next: (data) => { - this.message.success('同步成功'); + this.message.success('同步组织机构成功'); this.getAllOrganization(); }, error: (err) => { - this.message.error('同步失败'); + this.message.error('同步组织机构失败'); + }, + }); + this.http.put('/api/GasStations/SyncAllGasStations', null).subscribe({ + next: (data) => { + this.message.success('同步油站成功'); + this.getAllOrganization(); + }, + error: (err) => { + this.message.error('同步油站失败'); }, }); }