Skip to content

Commit 6a44ae6

Browse files
committed
Fix the query result is not displayed in the column data under certain circumstances
1 parent beadcb6 commit 6a44ae6

2 files changed

Lines changed: 22 additions & 8 deletions

File tree

src/renderer/components/table/basic/basic.table.component.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
<button nz-button nzType="primary" (click)="handlerDialog(true)" style="margin-top: -22px; float: right;">
33
<i class="fa fa-external-link-square"></i>&nbsp;{{'common.export'|translate}}
44
</button>
5-
<!-- <nz-dropdown-menu #export="nzDropdownMenu">-->
6-
<!-- <ul nz-menu>-->
7-
<!-- <li nz-menu-item >{{'common.csv'|translate}}</li>-->
8-
<!-- </ul>-->
9-
<!-- </nz-dropdown-menu>-->
10-
<ngx-table [id]="id" [data]="value.columns"
11-
[configuration]="configuration" [columns]="headers">
5+
<ngx-table [id]="id" [data]="value.columns" [configuration]="configuration" [columns]="headers">
6+
<ng-template let-row let-index="index">
7+
<td *ngFor="let header of headers" style="max-width: 300px;"
8+
ellipsis [ellipsis-content]="row[header.key]"
9+
(ellipsis-click-more)="handlerShowMoreEllipsis(row[header.key])">
10+
{{row[header.key]}}
11+
</td>
12+
</ng-template>
1213
</ngx-table>
1314
</div>
1415
<ng-template #notHasValues>

src/renderer/components/table/basic/basic.table.component.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { ExportToCsv } from 'export-to-csv';
55
import { Md5 } from 'ts-md5';
66
import { TableExportModel } from "@renderer/components/table/basic/table.export.model";
77
import { StringUtils } from "@renderer/utils/string.utils";
8+
import { TranslateService } from "@ngx-translate/core";
9+
import { NzModalService } from "ng-zorro-antd/modal";
810

911
@Component({
1012
selector: 'app-component-basic-table',
@@ -18,7 +20,8 @@ export class BasicTableComponent extends BaseComponent implements AfterViewInit
1820
public id: string;
1921
exportInfo: TableExportModel;
2022

21-
constructor() {
23+
constructor(private translateService: TranslateService,
24+
private modalService: NzModalService) {
2225
super();
2326
this.configuration = {...DefaultConfig};
2427
this.configuration.horizontalScroll = true;
@@ -68,4 +71,14 @@ export class BasicTableComponent extends BaseComponent implements AfterViewInit
6871
const csvExporter = new ExportToCsv(options);
6972
csvExporter.generateCsv(this.value.columns);
7073
}
74+
75+
handlerShowMoreEllipsis(value: any): void {
76+
this.modalService.info({
77+
nzWidth: '80%',
78+
nzKeyboard: false,
79+
nzMaskClosable: false,
80+
nzOkText: this.translateService.instant('common.ok'),
81+
nzContent: value.toString()
82+
});
83+
}
7184
}

0 commit comments

Comments
 (0)