chenjingyu 4 years ago
parent
commit
24a83c7390
  1. 6
      src/app/data-collection/fire-force/fire-force.component.ts
  2. 2
      src/app/data-collection/linkage-forces/linkage-forces.component.ts
  3. 1
      src/app/data-collection/water-collection/water-collection.component.ts
  4. 54
      src/app/plan-audit/fireforce-audit/fireforce-audit.component.ts
  5. 2
      src/app/plan-audit/wait-examineer/wait-examineer.component.html
  6. 19
      src/app/plan-audit/wait-examineer/wait-examineer.component.ts
  7. 46
      src/app/ui/collection-tools-building/collection-tools.component.html
  8. 19
      src/app/ui/collection-tools-building/collection-tools.component.ts
  9. 12
      src/app/ui/collection-tools-building/panel.scss
  10. 43
      src/app/ui/collection-tools-plan/collection-tools.component.html
  11. 17
      src/app/ui/collection-tools-plan/collection-tools.component.ts
  12. 12
      src/app/ui/collection-tools-plan/panel.scss
  13. 44
      src/app/ui/collection-tools/collection-tools.component.html
  14. 17
      src/app/ui/collection-tools/collection-tools.component.ts
  15. 12
      src/app/ui/collection-tools/panel.scss

6
src/app/data-collection/fire-force/fire-force.component.ts

@ -6,7 +6,6 @@ import { Component, OnInit } from '@angular/core';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'; import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
import { NzTreeNode } from 'ng-zorro-antd/tree';
import { TreeService } from 'src/app/http-interceptors/tree.service'; import { TreeService } from 'src/app/http-interceptors/tree.service';
import Viewer from 'viewerjs' import Viewer from 'viewerjs'
declare var CryptoJS declare var CryptoJS
@ -45,8 +44,8 @@ export class FireForceComponent implements OnInit {
{id:3,name:'中队(消防站)',isChecked:false}, {id:3,name:'中队(消防站)',isChecked:false},
{id:4,name:'其他消防队伍',isChecked:false} {id:4,name:'其他消防队伍',isChecked:false}
] ]
//勾选力量类型checkbox在地图上显示marker //勾选力量类型checkbox在地图上显示marker
checkBoxChange(){ checkBoxChange(){
let Levels = [] let Levels = []
this.checkBoxList.forEach(item =>{ this.checkBoxList.forEach(item =>{
if(item.isChecked){ if(item.isChecked){
@ -559,6 +558,7 @@ export class FireForceComponent implements OnInit {
// this.positionLngLat.x = 0 // this.positionLngLat.x = 0
// this.positionLngLat.y = 0 // this.positionLngLat.y = 0
// this.map.setCity('上海市'); // this.map.setCity('上海市');
this.selectedFireForce.contentVerify = null
this.clearData() this.clearData()
} }
} }

2
src/app/data-collection/linkage-forces/linkage-forces.component.ts

@ -401,7 +401,7 @@ export class LinkageForcesComponent implements OnInit {
this.LinkageForceDetailInfo.linkageForceType = data this.LinkageForceDetailInfo.linkageForceType = data
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
this.map.setCity('上海市'); this.map.setCity('上海市');
this.LinkageForceDetailInfo.contentVerify = null
} }
} }
) )

1
src/app/data-collection/water-collection/water-collection.component.ts

@ -402,6 +402,7 @@ export class WaterCollectionComponent implements OnInit {
this.positionLngLat.y = 0 this.positionLngLat.y = 0
this.map.setCity('上海市'); this.map.setCity('上海市');
this.clearData() this.clearData()
this.waterData.contentVerify = null
} }
} }
); );

54
src/app/plan-audit/fireforce-audit/fireforce-audit.component.ts

@ -1,5 +1,5 @@
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { MatSnackBar } from '@angular/material/snack-bar'; import { MatSnackBar } from '@angular/material/snack-bar';
import Viewer from 'viewerjs' import Viewer from 'viewerjs'
@ -12,36 +12,10 @@ declare var AMap: any;
styleUrls: ['./fireforce-audit.component.scss'] styleUrls: ['./fireforce-audit.component.scss']
}) })
export class FireforceAuditComponent implements OnInit { export class FireforceAuditComponent implements OnInit {
@Input() public FireForceDetailInfo: any;//data名字根据引用场景自定义
@Input() public level: any;//data名字根据引用场景自定义
constructor(public snackBar: MatSnackBar,private http:HttpClient,public dialog: MatDialog) { } constructor(public snackBar: MatSnackBar,private http:HttpClient,public dialog: MatDialog) { }
selectedFireForceLevel:any = 0 selectedFireForceLevel:any
FireForceDetailInfo:any = {
id: "600144ffe7036e11b8121684",
stationName: "上海总队",
isIndependentAlarm: true,
phoneNumber: "13864340193",
faxNumber: "120",
jurisdictionArea: 999,
remark: "暂无备注",
address: "齐鲁树谷",
location: {
x:0,
y:0
},
personCountData: "[{\"PropertyName\":\"现役官兵人数\",\"PropertyValue\":\"1\"},{\"PropertyName\":\"政府专职消防员数\",\"PropertyValue\":\"2\"},{\"PropertyName\":\"消防文员数\",\"PropertyValue\":\"3\"}]",
personCountItems: null,
contactData: "[{\"PropertyName\":\"总队长名称\",\"PropertyValue\":\"4\"},{\"PropertyName\":\"总队长联系方式\",\"PropertyValue\":\"5\"},{\"PropertyName\":\"总队政委名称\",\"PropertyValue\":\"6\"},{\"PropertyName\":\"总队政委联系方式\",\"PropertyValue\":\"7\"}]",
contactItems: null,
dutyForceData: null,
dutyForceItems: null,
relevantInfomationData: null,
integrityScore: 0,
integrityTotalCount: 0,
integrityNotEmptyCount: 0,
RelevantInfomationData:"[{\"objectName\":\"FireForce/1/601b69697cea2c03587c4c6d.png\",\"fileName\":\"楼层区域.png\",\"fileLength\":4079},{\"objectName\":\"FireForce/1/601b696e7cea2c03587c4c6e.mp4\",\"fileName\":\"李志 《天空之城》.mp4\",\"fileLength\":56362628},{\"objectName\":\"FireForce/1/601b69867cea2c03587c4c6f.docx\",\"fileName\":\"完整度规划20200724.docx\",\"fileLength\":16480}]"
}
ZongpersonCountData ZongpersonCountData
ZongcontactData ZongcontactData
ZhicontactData ZhicontactData
@ -51,15 +25,17 @@ export class FireforceAuditComponent implements OnInit {
otherpersonCountData otherpersonCountData
AttachmentArr AttachmentArr
ngOnInit(): void { ngOnInit(): void {
this.ZongpersonCountData = JSON.parse(this.FireForceDetailInfo.personCountData) // console.log(12345,this.FireForceDetailInfo)
this.ZongcontactData = JSON.parse(this.FireForceDetailInfo.contactData) this.selectedFireForceLevel = this.level
this.ZhicontactData = JSON.parse(this.FireForceDetailInfo.contactData) this.FireForceDetailInfo.personCountData ? this.ZongpersonCountData = JSON.parse(this.FireForceDetailInfo.personCountData): null
this.DaZhongpersonCountData = JSON.parse(this.FireForceDetailInfo.personCountData) this.FireForceDetailInfo.contactData ? this.ZongcontactData = JSON.parse(this.FireForceDetailInfo.contactData): null
this.DaZhongcontactData = JSON.parse(this.FireForceDetailInfo.contactData) this.FireForceDetailInfo.contactData ? this.ZhicontactData = JSON.parse(this.FireForceDetailInfo.contactData): null
this.othercontactData = JSON.parse(this.FireForceDetailInfo.contactData) this.FireForceDetailInfo.personCountData ? this.DaZhongpersonCountData = JSON.parse(this.FireForceDetailInfo.personCountData): null
this.otherpersonCountData = JSON.parse(this.FireForceDetailInfo.personCountData) this.FireForceDetailInfo.contactData ? this.DaZhongcontactData = JSON.parse(this.FireForceDetailInfo.contactData): null
this.AttachmentArr = JSON.parse(this.FireForceDetailInfo.RelevantInfomationData) this.FireForceDetailInfo.contactData ? this.othercontactData = JSON.parse(this.FireForceDetailInfo.contactData): null
this.FireForceDetailInfo.personCountData ? this.otherpersonCountData = JSON.parse(this.FireForceDetailInfo.personCountData): null
this.FireForceDetailInfo.RelevantInfomationData ? this.AttachmentArr = JSON.parse(this.FireForceDetailInfo.RelevantInfomationData) : null
console.log(789,this.ZongcontactData)
setTimeout(() => { setTimeout(() => {
this.map = new AMap.Map('container', { this.map = new AMap.Map('container', {
zoom:18 zoom:18

2
src/app/plan-audit/wait-examineer/wait-examineer.component.html

@ -274,7 +274,7 @@
</div> </div>
<!-- 消防力量审核 --> <!-- 消防力量审核 -->
<div class="fireForceAudit" *ngIf="showtype == 13"> <div class="fireForceAudit" *ngIf="showtype == 13">
<app-fireforce-audit></app-fireforce-audit> <app-fireforce-audit [FireForceDetailInfo]="fireForceDetailInfo" [level]="postlevel"></app-fireforce-audit>
</div> </div>
<!-- 联动力量审核 --> <!-- 联动力量审核 -->
<div class="LinkageForcesAudit" *ngIf="showtype == 14"> <div class="LinkageForcesAudit" *ngIf="showtype == 14">

19
src/app/plan-audit/wait-examineer/wait-examineer.component.ts

@ -155,9 +155,10 @@ export class WaitExamineerComponent implements OnInit {
viewer//全景图对象 viewer//全景图对象
waterData:any//需要传递给子组件的水源信息 waterData:any//需要传递给子组件的水源信息
LinkageForceDetailInfo:any//需要传递给子组件的联动力量信息 LinkageForceDetailInfo:any//需要传递给子组件的联动力量信息
fireForceDetailInfo:any//需要传递给子组件的消防力量信息
postlevel:any
radioClick(e,item){ radioClick(e,item){
this.showtype = -1 this.showtype = -1
console.log(item)
this.organizationName='' this.organizationName=''
this.id=item.id this.id=item.id
this.fetchUrl='' this.fetchUrl=''
@ -170,19 +171,26 @@ export class WaitExamineerComponent implements OnInit {
}else if(item.contentType == 12){ }else if(item.contentType == 12){
//水源 //水源
this.http.get(`/api/WaterSources/${item.itemId}`).subscribe((data)=>{ this.http.get(`/api/WaterSources/${item.itemId}`).subscribe((data)=>{
console.log('水源',data)
this.waterData = data this.waterData = data
this.showtype = 12 this.showtype = 12
}) })
}else if(item.contentType == 13){ }else if(item.contentType == 13){
//消防力量 //消防力量
this.http.get(`/api/LinkageForces/${item.itemId}`).subscribe((data)=>{ this.http.get(`/api/CustomFireForce/${item.itemId}`).subscribe((data:any)=>{
console.log('消防力量',data) if(data.forceType != 0){//如果是其他消防力量
this.postlevel = 4
}else{
this.postlevel = data.level
}
console.log('xxx',this.postlevel)
data.fireForceDetailInfo.location ? null : data.fireForceDetailInfo.location={x:null,y:null}
this.fireForceDetailInfo = data.fireForceDetailInfo
this.showtype = 13
}) })
}else if(item.contentType == 14){ }else if(item.contentType == 14){
//联动力量 //联动力量
this.http.get(`/api/LinkageForces/${item.itemId}`).subscribe((data:any)=>{ this.http.get(`/api/LinkageForces/${item.itemId}`).subscribe((data:any)=>{
console.log('联动力量',data)
data.location ? null : data.location={x:null,y:null} data.location ? null : data.location={x:null,y:null}
this.LinkageForceDetailInfo = data this.LinkageForceDetailInfo = data
this.showtype = 14 this.showtype = 14
@ -360,6 +368,7 @@ export class WaitExamineerComponent implements OnInit {
this.getAlltabledate() this.getAlltabledate()
}) })
}else if(this.shenheTable[0].contentType == 12 || this.shenheTable[0].contentType == 13 || this.shenheTable[0].contentType == 14){ }else if(this.shenheTable[0].contentType == 12 || this.shenheTable[0].contentType == 13 || this.shenheTable[0].contentType == 14){
console.log(1111,this.shenheTable[0])
let body:any = { let body:any = {
id:this.shenheTable[0].id, id:this.shenheTable[0].id,
itemId:this.shenheTable[0].itemId, itemId:this.shenheTable[0].itemId,

46
src/app/ui/collection-tools-building/collection-tools.component.html

@ -61,7 +61,7 @@
<!--功能区 --> <!--功能区 -->
<div class="functionalDomain"> <div class="functionalDomain">
<div class='functionalDomainContent' id="functionalDomainContent"> <div class='functionalDomainContent' id="functionalDomainContentTwo">
<!-- H5Canvas --> <!-- H5Canvas -->
<app-working-area #canvas [init]='this'></app-working-area> <app-working-area #canvas [init]='this'></app-working-area>
@ -125,23 +125,35 @@
<label class="overflowText" style="font-weight: 550;">素材库</label> <label class="overflowText" style="font-weight: 550;">素材库</label>
</div> </div>
<div [hidden]="!toggleMaterialBank" [ngClass]="{'materialBankDIV': pattern}"> <div [hidden]="!toggleMaterialBank" [ngClass]="{'materialBankDIV': pattern}">
<mat-accordion *ngFor="let item of allLibrary" id="panelLibrary"> <div>
<mat-expansion-panel (opened)='opened(item)'> <input type="text" class="searchLibrary" [(ngModel)]="searchInput" (ngModelChange)="libraryChange()">
<mat-expansion-panel-header> <div class="panelLibraryFlex" *ngIf="searchLibrary.length">
<label class="text">{{item.name}}</label> <div class="imgBox" *ngFor="let items of searchLibrary;let key = index" [title]="items.name"
</mat-expansion-panel-header> [ngClass]="{'selectImg': selectLibrary=='搜索' && selectImageIndex==key}" (click)='selectImg({name:"搜索"},items,key)'>
<img [src]="items.imageUrl" onerror="javascript:this.src='../../../assets/images/noImg.png'">
<div class="panelLibraryFlex"> <p class="overflowText">{{items.name}}</p>
<div class="imgBox" *ngFor="let items of item.images;let key = index" [title]="items.name"
(click)='selectImg(item,items,key)'
[ngClass]="{'selectImg': selectLibrary==item.name && selectImageIndex==key}">
<img [src]="items.imageUrl" onerror="javascript:this.src='../../../assets/images/noImg.png'">
<p class="overflowText">{{items.name}}</p>
</div>
</div> </div>
</div>
</mat-expansion-panel> </div>
</mat-accordion> <ng-container *ngIf="!searchLibrary.length">
<mat-accordion *ngFor="let item of allLibrary" id="panelLibrary">
<mat-expansion-panel (opened)='opened(item)'>
<mat-expansion-panel-header>
<label class="text">{{item.name}}</label>
</mat-expansion-panel-header>
<div class="panelLibraryFlex">
<div class="imgBox" *ngFor="let items of item.images;let key = index" [title]="items.name"
(click)='selectImg(item,items,key)'
[ngClass]="{'selectImg': selectLibrary==item.name && selectImageIndex==key}">
<img [src]="items.imageUrl" onerror="javascript:this.src='../../../assets/images/noImg.png'">
<p class="overflowText">{{items.name}}</p>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</ng-container>
</div> </div>
</div> </div>
<!-- 素材库 --> <!-- 素材库 -->

19
src/app/ui/collection-tools-building/collection-tools.component.ts

@ -692,7 +692,7 @@ export class CollectionToolsBuildingComponent implements OnInit {
let that = this let that = this
window.setTimeout(()=>{ window.setTimeout(()=>{
document.getElementById("functionalDomainContent").oncontextmenu = function (event) { document.getElementById("functionalDomainContentTwo").oncontextmenu = function (event) {
// that.canvas.cancelPaint() // that.canvas.cancelPaint()
that.selectImageIndex = -1 that.selectImageIndex = -1
event.preventDefault(); event.preventDefault();
@ -2039,6 +2039,23 @@ export class CollectionToolsBuildingComponent implements OnInit {
selectLibrary:any; //选中的素材库 selectLibrary:any; //选中的素材库
selectImage:any; //选中的素材库图片 selectImage:any; //选中的素材库图片
selectImageIndex:number; //选中的素材库图片index selectImageIndex:number; //选中的素材库图片index
searchSettimeout:any; //延时器
searchInput:string = null; //模糊搜索 input
searchLibrary:any = []; //模糊搜索 素材
//输入框 输入事件
libraryChange () {
window.clearTimeout(this.searchSettimeout)
this.searchSettimeout = window.setTimeout(()=>{
if (this.searchInput === "") {
this.searchLibrary = []
} else {
this.http.get(`/api/Assets?assetName=${this.searchInput}`).subscribe((data:any)=>{
this.searchLibrary = data
})
}
},500)
}
//获取素材库 //获取素材库
getAllLibrary (type:string='input') { getAllLibrary (type:string='input') {

12
src/app/ui/collection-tools-building/panel.scss

@ -212,6 +212,18 @@
box-sizing: border-box; box-sizing: border-box;
margin-left: 10px; margin-left: 10px;
} }
//模糊搜索 input
.searchLibrary {
display: block;
border: 1px solid rgb(219, 212, 212);
border-radius: 5px;
outline: none;
box-sizing: border-box;
margin: 5px auto;
padding-left: 5px;
width: 95%;
height: 30px;
}
.panelLibraryFlex { .panelLibraryFlex {
display: flex; display: flex;
flex-direction: row; flex-direction: row;

43
src/app/ui/collection-tools-plan/collection-tools.component.html

@ -103,23 +103,34 @@
<label class="overflowText" style="font-weight: 550;">素材库</label> <label class="overflowText" style="font-weight: 550;">素材库</label>
</div> </div>
<div [hidden]="!toggleMaterialBank" [ngClass]="{'materialBankDIV': pattern}"> <div [hidden]="!toggleMaterialBank" [ngClass]="{'materialBankDIV': pattern}">
<mat-accordion *ngFor="let item of allLibrary" id="panelLibrary"> <div>
<mat-expansion-panel (opened)='opened(item)'> <input type="text" class="searchLibrary" [(ngModel)]="searchInput" (ngModelChange)="libraryChange()">
<mat-expansion-panel-header> <div class="panelLibraryFlex" *ngIf="searchLibrary.length">
<label class="text">{{item.name}}</label> <div class="imgBox" *ngFor="let items of searchLibrary;let key = index" [title]="items.name"
</mat-expansion-panel-header> [ngClass]="{'selectImg': selectLibrary=='搜索' && selectImageIndex==key}" (click)='selectImg({name:"搜索"},items,key)'>
<img [src]="items.imageUrl" onerror="javascript:this.src='../../../assets/images/noImg.png'">
<div class="panelLibraryFlex"> <p class="overflowText">{{items.name}}</p>
<div class="imgBox" *ngFor="let items of item.images;let key = index" [title]="items.name"
(click)='selectImg(item,items,key)'
[ngClass]="{'selectImg': selectLibrary==item.name && selectImageIndex==key}">
<img [src]="items.imageUrl" onerror="javascript:this.src='../../../assets/images/noImg.png'">
<p class="overflowText">{{items.name}}</p>
</div>
</div> </div>
</div>
</mat-expansion-panel> </div>
</mat-accordion> <ng-container *ngIf="!searchLibrary.length">
<mat-accordion *ngFor="let item of allLibrary" id="panelLibrary">
<mat-expansion-panel (opened)='opened(item)'>
<mat-expansion-panel-header>
<label class="text">{{item.name}}</label>
</mat-expansion-panel-header>
<div class="panelLibraryFlex">
<div class="imgBox" *ngFor="let items of item.images;let key = index" [title]="items.name"
[ngClass]="{'selectImg': selectLibrary==item.name && selectImageIndex==key}" (click)='selectImg(item,items,key)'>
<img [src]="items.imageUrl" onerror="javascript:this.src='../../../assets/images/noImg.png'">
<p class="overflowText">{{items.name}}</p>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</ng-container>
</div> </div>
</div> </div>
<!-- 素材库 --> <!-- 素材库 -->

17
src/app/ui/collection-tools-plan/collection-tools.component.ts

@ -2043,6 +2043,23 @@ export class CollectionToolsPlanComponent implements OnInit {
selectLibrary:any; //选中的素材库 selectLibrary:any; //选中的素材库
selectImage:any; //选中的素材库图片 selectImage:any; //选中的素材库图片
selectImageIndex:number; //选中的素材库图片index selectImageIndex:number; //选中的素材库图片index
searchSettimeout:any; //延时器
searchInput:string = null; //模糊搜索 input
searchLibrary:any = []; //模糊搜索 素材
//输入框 输入事件
libraryChange () {
window.clearTimeout(this.searchSettimeout)
this.searchSettimeout = window.setTimeout(()=>{
if (this.searchInput === "") {
this.searchLibrary = []
} else {
this.http.get(`/api/Assets?assetName=${this.searchInput}`).subscribe((data:any)=>{
this.searchLibrary = data
})
}
},500)
}
//获取素材库 //获取素材库
getAllLibrary (type:string='input') { getAllLibrary (type:string='input') {

12
src/app/ui/collection-tools-plan/panel.scss

@ -212,6 +212,18 @@
box-sizing: border-box; box-sizing: border-box;
margin-left: 10px; margin-left: 10px;
} }
//模糊搜索 input
.searchLibrary {
display: block;
border: 1px solid rgb(219, 212, 212);
border-radius: 5px;
outline: none;
box-sizing: border-box;
margin: 5px auto;
padding-left: 5px;
width: 95%;
height: 30px;
}
.panelLibraryFlex { .panelLibraryFlex {
display: flex; display: flex;
flex-direction: row; flex-direction: row;

44
src/app/ui/collection-tools/collection-tools.component.html

@ -202,23 +202,35 @@
<label class="overflowText" style="font-weight: 550;">素材库</label> <label class="overflowText" style="font-weight: 550;">素材库</label>
</div> </div>
<div [hidden]="!toggleMaterialBank" [ngClass]="{'materialBankDIV': pattern}"> <div [hidden]="!toggleMaterialBank" [ngClass]="{'materialBankDIV': pattern}">
<mat-accordion *ngFor="let item of allLibrary" id="panelLibrary"> <div>
<mat-expansion-panel (opened)='opened(item)'> <input type="text" class="searchLibrary" [(ngModel)]="searchInput" (ngModelChange)="libraryChange()">
<mat-expansion-panel-header> <div class="panelLibraryFlex" *ngIf="searchLibrary.length">
<label class="text">{{item.name}}</label> <div class="imgBox" *ngFor="let items of searchLibrary;let key = index" [title]="items.name"
</mat-expansion-panel-header> [ngClass]="{'selectImg': selectLibrary=='搜索' && selectImageIndex==key}" (click)='selectImg({name:"搜索"},items,key)'>
<img [src]="items.imageUrl" onerror="javascript:this.src='../../../assets/images/noImg.png'">
<div class="panelLibraryFlex"> <p class="overflowText">{{items.name}}</p>
<div class="imgBox" *ngFor="let items of item.images;let key = index" [title]="items.name"
(click)='selectImg(item,items,key)'
[ngClass]="{'selectImg': selectLibrary==item.name && selectImageIndex==key}">
<img [src]="items.imageUrl" onerror="javascript:this.src='../../../assets/images/noImg.png'">
<p class="overflowText">{{items.name}}</p>
</div>
</div> </div>
</div>
</mat-expansion-panel> </div>
</mat-accordion> <ng-container *ngIf="!searchLibrary.length">
<mat-accordion *ngFor="let item of allLibrary" id="panelLibrary">
<mat-expansion-panel (opened)='opened(item)'>
<mat-expansion-panel-header>
<label class="text">{{item.name}}</label>
</mat-expansion-panel-header>
<div class="panelLibraryFlex">
<div class="imgBox" *ngFor="let items of item.images;let key = index" [title]="items.name"
(click)='selectImg(item,items,key)'
[ngClass]="{'selectImg': selectLibrary==item.name && selectImageIndex==key}">
<img [src]="items.imageUrl" onerror="javascript:this.src='../../../assets/images/noImg.png'">
<p class="overflowText">{{items.name}}</p>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</ng-container>
</div> </div>
</div> </div>
<!-- 素材库 --> <!-- 素材库 -->

17
src/app/ui/collection-tools/collection-tools.component.ts

@ -2092,6 +2092,23 @@ export class CollectionToolsComponent implements OnInit {
selectLibrary:any; //选中的素材库 selectLibrary:any; //选中的素材库
selectImage:any; //选中的素材库图片 selectImage:any; //选中的素材库图片
selectImageIndex:number; //选中的素材库图片index selectImageIndex:number; //选中的素材库图片index
searchSettimeout:any; //延时器
searchInput:string = null; //模糊搜索 input
searchLibrary:any = []; //模糊搜索 素材
//输入框 输入事件
libraryChange () {
window.clearTimeout(this.searchSettimeout)
this.searchSettimeout = window.setTimeout(()=>{
if (this.searchInput === "") {
this.searchLibrary = []
} else {
this.http.get(`/api/Assets?assetName=${this.searchInput}`).subscribe((data:any)=>{
this.searchLibrary = data
})
}
},500)
}
//获取素材库 //获取素材库
getAllLibrary (type:string='input') { getAllLibrary (type:string='input') {

12
src/app/ui/collection-tools/panel.scss

@ -209,6 +209,18 @@
box-sizing: border-box; box-sizing: border-box;
margin-left: 10px; margin-left: 10px;
} }
//模糊搜索 input
.searchLibrary {
display: block;
border: 1px solid rgb(219, 212, 212);
border-radius: 5px;
outline: none;
box-sizing: border-box;
margin: 5px auto;
padding-left: 5px;
width: 95%;
height: 30px;
}
.panelLibraryFlex { .panelLibraryFlex {
display: flex; display: flex;
flex-direction: row; flex-direction: row;

Loading…
Cancel
Save