From de353df4ac4a9037fe2d0aeee4556bfeb8c545f9 Mon Sep 17 00:00:00 2001 From: Sjh <55341701@qq.com> Date: Fri, 24 Nov 2023 11:49:25 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E7=BB=84=E7=BB=87=E6=9C=BA?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../host-config/host-config.component.ts | 34 ++++++++++++++----- .../organization/organization.component.html | 2 +- 2 files changed, 26 insertions(+), 10 deletions(-) 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 9fee3a2..983c9ef 100644 --- a/src/app/system-management/host-config/host-config.component.ts +++ b/src/app/system-management/host-config/host-config.component.ts @@ -1536,7 +1536,15 @@ rule_threshold: new Promise((resolve, reject) => { console.log('表单信息', instance.validateForm); let body = { - configFiles: [{ name: 'data.yaml', content: instance.datacopy }], + configFiles: [ + { + name: + this.hostType === '北京展厅' + ? 'bjzhanting.yaml' + : 'data.yaml', + content: instance.datacopy, + }, + ], }; this.http.put(`/api/EdgeDevices/${this.hostId}`, body).subscribe({ next: (data) => { @@ -1545,7 +1553,10 @@ rule_threshold: this.getHostData(); let params = { edgeDeviceId: this.hostId, - fileName: 'data.yaml', + fileName: + this.hostType === '北京展厅' + ? 'bjzhanting.yaml' + : 'data.yaml', }; this.http .put('/api/EdgeDevices/Commands/PushFile', '', { @@ -1650,12 +1661,17 @@ rule_threshold: // console.log(this.hostData); //如果保存过安信的配置文件 + + let yamlname; + this.hostType === '北京展厅' + ? (yamlname = 'bjzhanting.yaml') + : (yamlname = 'data.yaml'); if ( this.hostData.configFiles && - this.hostData.configFiles.find((v) => v.name === 'data.yaml') + this.hostData.configFiles.find((v) => v.name === yamlname) ) { let oldFile = yaml.load( - this.hostData.configFiles.find((v) => v.name === 'data.yaml').content + this.hostData.configFiles.find((v) => v.name === yamlname).content ); // console.log('曾经保存过安信的配置文件', oldFile); for (const key in oldFile) { @@ -1697,15 +1713,15 @@ rule_threshold: if (item.isEnabled) { let type = null; item.type === 0 - ? (type = 2)//进出口 + ? (type = 2) //进出口 : item.type === 1 - ? (type = 1)//加油区 + ? (type = 1) //加油区 : item.type === 2 - ? (type = 0)//卸油区 + ? (type = 0) //卸油区 : item.type === 3 - ? (type = 4)//收银区 + ? (type = 4) //收银区 : item.type === 4 - ? (type = 5)//办公区 + ? (type = 5) //办公区 : null; let areas = []; diff --git a/src/app/system-management/organization/organization.component.html b/src/app/system-management/organization/organization.component.html index 697c9f2..fcdb68d 100644 --- a/src/app/system-management/organization/organization.component.html +++ b/src/app/system-management/organization/organization.component.html @@ -17,7 +17,7 @@ + (nzOnDrop)="nzEvent($event)" [nzBeforeDrop]="beforeDrop" [nzTreeTemplate]="nzTreeTemplate">