Browse Source

[新增]同步功能

非煤矿业企业安全风险监测预警系统
邵佳豪 2 years ago
parent
commit
29d33ee06b
  1. 9
      src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts
  2. 8
      src/app/system-management/host-config/host-config.component.ts
  3. 13
      src/app/system-management/organization/organization.component.ts

9
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('同步边缘设备失败');
},
});
}

8
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配置',
@ -1563,6 +1563,7 @@ ${newstr}class-id=0
};
console.log(this.listOfData);
this.listOfData.forEach((item: any) => {
if (item.isEnabled) {
let type = null;
item.type === 0
? (type = 2)
@ -1588,11 +1589,12 @@ ${newstr}class-id=0
name: item.name,
};
if (areas.length !== 0) {
obj.areas = areas
obj.areas = areas;
}
data.caps.push(obj);
}
});
return data
return data;
}
}

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

Loading…
Cancel
Save