Browse Source

[新增]组织机构

beijing
邵佳豪 1 year ago
parent
commit
de353df4ac
  1. 34
      src/app/system-management/host-config/host-config.component.ts
  2. 2
      src/app/system-management/organization/organization.component.html

34
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 = [];

2
src/app/system-management/organization/organization.component.html

@ -17,7 +17,7 @@
</div>
<nz-tree [nzHideUnMatched]='true' [nzSearchValue]="searchValue" #nzTreeComponent [nzData]="nodes"
[nzExpandAll]="nzExpandAll" [nzExpandedKeys]="defaultExpandedKeys" nzDraggable nzBlockNode
(nzOnDrop)="nzEvent($event)" [nzBeforeDrop]="beforeDrop">
(nzOnDrop)="nzEvent($event)" [nzBeforeDrop]="beforeDrop" [nzTreeTemplate]="nzTreeTemplate">
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="nodebox">

Loading…
Cancel
Save