diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index 883887d..c38bd52 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -13,5 +13,6 @@ export class AppComponent {
//调用服务中的function刷新token
this.token.startUp()
}
+ console.log('更新日期:20230814')
}
}
diff --git a/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.html b/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.html
index 2452983..82ae63f 100644
--- a/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.html
+++ b/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.html
@@ -12,6 +12,7 @@
\ No newline at end of file
diff --git a/src/app/system-management/analysis-of-the-host/worker-tag/worker-tag.component.scss b/src/app/system-management/analysis-of-the-host/worker-tag/worker-tag.component.scss
new file mode 100644
index 0000000..cab3666
--- /dev/null
+++ b/src/app/system-management/analysis-of-the-host/worker-tag/worker-tag.component.scss
@@ -0,0 +1,28 @@
+.tagbox {
+ max-height: 600px;
+ display: flex;
+ flex-direction: column;
+}
+
+.content {
+ flex: 1;
+ overflow-y: auto;
+
+ .inputbox {
+ .inputItem {
+ display: flex;
+ margin:6px 0px;
+ }
+ }
+
+}
+
+.btnbox {
+ display: flex;
+ justify-content: flex-end;
+ align-items: center;
+ margin-top: 16px;
+ button{
+ margin-left: 6px;
+ }
+}
diff --git a/src/app/system-management/analysis-of-the-host/worker-tag/worker-tag.component.spec.ts b/src/app/system-management/analysis-of-the-host/worker-tag/worker-tag.component.spec.ts
new file mode 100644
index 0000000..a0e8296
--- /dev/null
+++ b/src/app/system-management/analysis-of-the-host/worker-tag/worker-tag.component.spec.ts
@@ -0,0 +1,25 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { WorkerTagComponent } from './worker-tag.component';
+
+describe('WorkerTagComponent', () => {
+ let component: WorkerTagComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ declarations: [ WorkerTagComponent ]
+ })
+ .compileComponents();
+ });
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(WorkerTagComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/system-management/analysis-of-the-host/worker-tag/worker-tag.component.ts b/src/app/system-management/analysis-of-the-host/worker-tag/worker-tag.component.ts
new file mode 100644
index 0000000..28e0f46
--- /dev/null
+++ b/src/app/system-management/analysis-of-the-host/worker-tag/worker-tag.component.ts
@@ -0,0 +1,132 @@
+import { HttpClient } from '@angular/common/http';
+import { Component, Input, OnInit, ViewChild } from '@angular/core';
+import { NzMessageService } from 'ng-zorro-antd/message';
+import { NzTreeComponent } from 'ng-zorro-antd/tree';
+import { TreeService } from 'src/app/service/tree.service';
+
+@Component({
+ selector: 'app-worker-tag',
+ templateUrl: './worker-tag.component.html',
+ styleUrls: ['./worker-tag.component.scss'],
+})
+export class WorkerTagComponent implements OnInit {
+ @Input() tree: any;
+ @ViewChild('nzTreeComponent', { static: false })
+ nzTreeComponent!: NzTreeComponent;
+ defaultCheckedKeys = [];
+ defaultExpandedKeys = [];
+ constructor(
+ private http: HttpClient,
+ private message: NzMessageService,
+ private toTree: TreeService
+ ) {}
+
+ nodes = [];
+
+ inputList = [{ value: '' }];
+
+ step = 1;
+ ngOnInit(): void {
+ this.getAllOrganization();
+ }
+
+ getAllOrganization() {
+ let params = {
+ ContainsChildren: true,
+ PageSize: 9999,
+ };
+ this.http
+ .get('/api/Organizations', {
+ params: params,
+ })
+ .subscribe((data: any) => {
+ data.items.forEach((element) => {
+ element.key = element.id;
+ element.title = element.name;
+ element.selectable = false;
+ if (element.isGasStation) {
+ element.isLeaf = true;
+ element.disableCheckbox = false;
+ } else {
+ element.disableCheckbox = true;
+ }
+ });
+ this.nodes = [...this.toTree.toTree(data.items)];
+ // this.defaultExpandedKeys = [this.nodes[0].id];
+ // this.defaultExpandedKeys = [...this.defaultExpandedKeys];
+ });
+ }
+
+ nextStep() {
+ this.step = 2;
+ }
+ back() {
+ this.step = 1;
+ }
+ addInput() {
+ this.inputList.push({ value: '' });
+ }
+ ok() {
+ let ids =
+ this.nzTreeComponent.getCheckedNodeList().map((item) => {
+ return item.key;
+ }) || [];
+
+ let workerTags =
+ this.inputList.map((item) => {
+ return item.value;
+ }) || [];
+ if (ids.length === 0) {
+ this.message.create('info', '请至少选择一个加油站');
+ return;
+ }
+ if (this.inputList.find((v) => !v.value)) {
+ this.message.create('info', '请将所有输入框填写完整');
+ return;
+ }
+ let _this = this;
+ function BatchModifyWorkerTags() {
+ var a = new Promise((resolve, reject) => {
+ _this.http
+ .put('/api/EdgeDevices/BatchModifyWorkerTags', ids, {
+ params: { workerTags: workerTags },
+ })
+ .subscribe({
+ next: (data: any) => {
+ _this.message.create('success', '批量修改成功');
+ resolve(data);
+ },
+ error: (err) => {
+ _this.message.create('error', '批量修改失败,请重试');
+ reject(err);
+ },
+ });
+ });
+ return a;
+ }
+ function BatchPushFile() {
+ let b = new Promise((resolve, reject) => {
+ _this.http
+ .put('/api/EdgeDevices/Commands/BatchPushFile', ids, {
+ params: { fileName: 'data.yaml' },
+ })
+ .subscribe({
+ next: (data: any) => {
+ _this.message.create('success', '批量推送成功');
+ resolve(data);
+ },
+ error: (err) => {
+ _this.message.create('error', '批量推送失败');
+ reject(err);
+ },
+ });
+ });
+ return b;
+ }
+ BatchModifyWorkerTags()
+ .then((data) => {
+ BatchPushFile();
+ })
+ .catch((err) => {});
+ }
+}
diff --git a/src/app/system-management/system-management.module.ts b/src/app/system-management/system-management.module.ts
index eb0bd52..026f6a0 100644
--- a/src/app/system-management/system-management.module.ts
+++ b/src/app/system-management/system-management.module.ts
@@ -51,6 +51,7 @@ import { ImageLabelAnxinComponent } from './image-label-anxin/image-label-anxin.
import { AnxinConfigComponent } from './host-config/anxin-config/anxin-config.component';
import { DragDropModule } from '@angular/cdk/drag-drop';
import { IframeComponent } from './iframe/iframe.component';
+import { WorkerTagComponent } from './analysis-of-the-host/worker-tag/worker-tag.component';
@NgModule({
declarations: [
OrganizationComponent,
@@ -82,6 +83,7 @@ import { IframeComponent } from './iframe/iframe.component';
ImageLabelAnxinComponent,
AnxinConfigComponent,
IframeComponent,
+ WorkerTagComponent,
],
imports: [
CommonModule,
diff --git a/src/index.html b/src/index.html
index 3adda8c..b0838a7 100644
--- a/src/index.html
+++ b/src/index.html
@@ -12,10 +12,5 @@
-