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('同步油站失败'); }, }); }