Fix issue about label filter #4636

This commit is contained in:
pfh 2018-04-13 09:49:17 +08:00
parent 946b4b4ad8
commit 9ebe8d64da
2 changed files with 8 additions and 7 deletions

View File

@ -294,12 +294,11 @@ export class TagComponent implements OnInit, AfterViewInit {
selectedChange(tag?: Tag[]): void { selectedChange(tag?: Tag[]): void {
if (tag && tag[0].labels && tag[0].labels.length) { if (tag && tag[0].labels && tag[0].labels.length) {
tag[0].labels.forEach((labelInfo: Label) => {
this.imageStickLabels.forEach(data => { this.imageStickLabels.forEach(data => {
if (labelInfo.id === data['label'].id) { data.iconsShow = false;
data.iconsShow = true; })
} tag[0].labels.forEach((labelInfo: Label) => {
}); this.imageStickLabels.find(data => labelInfo.id === data['label'].id).iconsShow = true;
}); });
} }
} }
@ -355,6 +354,8 @@ export class TagComponent implements OnInit, AfterViewInit {
this.imageFilterLabels.filter(data => { this.imageFilterLabels.filter(data => {
if (data.label.name !== labelName) { if (data.label.name !== labelName) {
data.iconsShow = false; data.iconsShow = false;
}else {
data.iconsShow = true;
} }
}); });
@ -380,7 +381,7 @@ export class TagComponent implements OnInit, AfterViewInit {
unFilterLabel(labelInfo: {[key: string]: any | string[]}): void { unFilterLabel(labelInfo: {[key: string]: any | string[]}): void {
this.filterOneLabel = this.initFilter; this.filterOneLabel = this.initFilter;
labelInfo.iconsShow = false;
// reload datagu // reload datagu
this.currentPage = 1; this.currentPage = 1;
let st: State = this.currentState; let st: State = this.currentState;

View File

@ -30,7 +30,7 @@
"clarity-icons": "0.10.24", "clarity-icons": "0.10.24",
"clarity-ui": "0.10.24", "clarity-ui": "0.10.24",
"core-js": "^2.4.1", "core-js": "^2.4.1",
"harbor-ui": "0.6.73", "harbor-ui": "0.6.74",
"intl": "^1.2.5", "intl": "^1.2.5",
"mutationobserver-shim": "^0.3.2", "mutationobserver-shim": "^0.3.2",
"ngx-cookie": "^1.0.0", "ngx-cookie": "^1.0.0",