Browse Source

[完善]搜索高亮

develop
邵佳豪 2 years ago
parent
commit
41f73a2827
  1. 22
      src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.html
  2. 6
      src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts
  3. 10
      src/app/system-management/organization/organization.component.html
  4. 3
      src/app/system-management/organization/organization.component.ts

22
src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.html

@ -14,25 +14,11 @@
<span>组织机构</span>
</div>
<div class="treebox">
<nz-tree [nzSearchValue]="searchValue" #nzTreeComponent [nzData]="nodes" [nzExpandAll]="nzExpandAll"
[nzExpandedKeys]="defaultExpandedKeys" [nzSelectedKeys]='nzSelectedKeys' (nzClick)="nzClick($event)"
[nzTreeTemplate]="nzTreeTemplate" [nzExpandedIcon]="multiExpandedIconTpl">
<nz-tree [nzHideUnMatched]='true' [nzSearchValue]="searchValue" #nzTreeComponent [nzData]="nodes"
[nzExpandAll]="nzExpandAll" [nzExpandedKeys]="defaultExpandedKeys" [nzSelectedKeys]='nzSelectedKeys'
(nzClick)="nzClick($event)">
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="nodebox">
<span class="name">{{ node.title }}</span>
</div>
</ng-template>
<ng-template #multiExpandedIconTpl let-node let-origin="origin">
<ng-container *ngIf="node.children.length == 0; else elseTemplate">
</ng-container>
<ng-template #elseTemplate>
<i nz-icon [nzType]="node.isExpanded ? 'caret-down' : 'caret-right'" class="ant-tree-switcher-line-icon"></i>
</ng-template>
</ng-template>
</div>
</div>
<div class="hostListbox">
<div class="topbox">
@ -70,4 +56,4 @@
</nz-table>
</div>
</div>
</div>
</div>

6
src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts

@ -35,10 +35,14 @@ export class AnalysisOfTheHostComponent implements OnInit {
params: params
}).subscribe((data: any) => {
this.totalCount = data.totalCount
console.log(data.items)
data.items.forEach(element => {
element.key = element.id
element.title = element.name
element.selectable = false
if (element.isGasStation) {
element.isLeaf = true
}
});
this.nodes = [...this.toTree.toTree(data.items)]
this.defaultExpandedKeys = [this.nodes[0].id]
@ -185,7 +189,7 @@ export class AnalysisOfTheHostComponent implements OnInit {
};
this.http.get(`/api/EdgeDevices/IdentityDigest/File`, httpOptions).subscribe({
next: (data: any) => {
console.log('文件',data)
console.log('文件', data)
// 文件名中有中文 则对文件名进行转码
const link = document.createElement('a');
const blob = new Blob([data], { type: 'application/octet-stream' });

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

@ -19,7 +19,7 @@
</div>
<nz-tree [nzHideUnMatched]='true' [nzSearchValue]="searchValue" #nzTreeComponent [nzData]="nodes"
[nzExpandAll]="nzExpandAll" [nzExpandedKeys]="defaultExpandedKeys" [nzTreeTemplate]="nzTreeTemplate" nzDraggable
nzBlockNode (nzOnDrop)="nzEvent($event)" [nzBeforeDrop]="beforeDrop" [nzExpandedIcon]="multiExpandedIconTpl">
nzBlockNode (nzOnDrop)="nzEvent($event)" [nzBeforeDrop]="beforeDrop">
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="nodebox">
@ -31,12 +31,4 @@
</span>
</div>
</ng-template>
<ng-template #multiExpandedIconTpl let-node let-origin="origin">
<ng-container *ngIf="node.children.length == 0; else elseTemplate">
</ng-container>
<ng-template #elseTemplate>
<i nz-icon [nzType]="node.isExpanded ? 'caret-down' : 'caret-right'" class="ant-tree-switcher-line-icon"></i>
</ng-template>
</ng-template>
</div>

3
src/app/system-management/organization/organization.component.ts

@ -63,6 +63,9 @@ export class OrganizationComponent implements OnInit {
element.key = element.id
element.title = element.name
element.selectable = false
if (element.isGasStation) {
element.isLeaf = true
}
});
this.allOrList = data.items
this.nodes = [...this.toTree.toTree(data.items)]

Loading…
Cancel
Save