tnx-shared 5.1.499 → 5.1.500

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -929,6 +929,7 @@
929
929
  this.checkPermisionTrinhKy = false;
930
930
  this.useWorkflowButton = false;
931
931
  this.showEditLink = true;
932
+ this.showConfirmExport = false;
932
933
  this.showEditLinkOnlyView = false;
933
934
  this.mdWidthCommonSearch = 3;
934
935
  this.useCommonSearch = false;
@@ -22414,30 +22415,66 @@
22414
22415
  this.onAdd.emit();
22415
22416
  };
22416
22417
  ListComponentBase.prototype.xuatCacMucDaChon = function () {
22417
- switch (this.setting.exportItemsMode) {
22418
- case exports.ExportItemsMode.FromHtml:
22419
- this.exportByReadingHtml();
22420
- break;
22421
- case exports.ExportItemsMode.ManualGetData:
22422
- case exports.ExportItemsMode.AutoGetData:
22423
- default:
22424
- this._notifierService.showWarning('The function haven\'t supported yet');
22425
- break;
22426
- }
22418
+ return __awaiter(this, void 0, void 0, function () {
22419
+ var rs;
22420
+ return __generator(this, function (_b) {
22421
+ switch (_b.label) {
22422
+ case 0:
22423
+ if (!this.setting.showConfirmExport) return [3 /*break*/, 2];
22424
+ return [4 /*yield*/, this._notifierService.showConfirm('Bạn có chắc chắn muốn xuất bản ghi đã chọn (Và các bản ghi con tương ứng)', 'Xác nhận xuất file')];
22425
+ case 1:
22426
+ rs = _b.sent();
22427
+ if (!rs) {
22428
+ return [2 /*return*/];
22429
+ }
22430
+ _b.label = 2;
22431
+ case 2:
22432
+ switch (this.setting.exportItemsMode) {
22433
+ case exports.ExportItemsMode.FromHtml:
22434
+ this.exportByReadingHtml();
22435
+ break;
22436
+ case exports.ExportItemsMode.ManualGetData:
22437
+ case exports.ExportItemsMode.AutoGetData:
22438
+ default:
22439
+ this._notifierService.showWarning('The function haven\'t supported yet');
22440
+ break;
22441
+ }
22442
+ return [2 /*return*/];
22443
+ }
22444
+ });
22445
+ });
22427
22446
  };
22428
22447
  ListComponentBase.prototype.printByReadingHtml = function () {
22429
- var header = 'Danh sách ' + this.setting.objectName;
22430
- var element = this.table.el.nativeElement;
22431
- var tableEle = element.querySelector('table');
22432
- var headEle = tableEle.querySelector('thead');
22433
- var bodyEle = tableEle.querySelector('tbody');
22434
- var arrHeadEle = this.getArrHeadByHtml(headEle);
22435
- var arrRowData = this.getArrRowDataByHtml(bodyEle, arrHeadEle);
22436
- var strHeadEle = this.headHtmlToString(arrHeadEle);
22437
- var strBodyEle = this.rowDataHtmlToString(arrRowData);
22438
- var css = '<style type="text/css">table th, table td {border:1px solid #000;} table th {text-align: center;} table {width: 100%;border-collapse: collapse;} table td:first-child {text-align: center;}</style>';
22439
- var table = css + "<table>" + strHeadEle + strBodyEle + "</table>";
22440
- this._printService.printHtmlContent(table, header.toUpperCase());
22448
+ return __awaiter(this, void 0, void 0, function () {
22449
+ var rs, header, element, tableEle, headEle, bodyEle, arrHeadEle, arrRowData, strHeadEle, strBodyEle, css, table;
22450
+ return __generator(this, function (_b) {
22451
+ switch (_b.label) {
22452
+ case 0:
22453
+ if (!this.setting.showConfirmExport) return [3 /*break*/, 2];
22454
+ return [4 /*yield*/, this._notifierService.showConfirm('Bạn có chắc chắn muốn in bản ghi đã chọn (Và các bản ghi con tương ứng)', 'Xác nhận in file')];
22455
+ case 1:
22456
+ rs = _b.sent();
22457
+ if (!rs) {
22458
+ return [2 /*return*/];
22459
+ }
22460
+ _b.label = 2;
22461
+ case 2:
22462
+ header = 'Danh sách ' + this.setting.objectName;
22463
+ element = this.table.el.nativeElement;
22464
+ tableEle = element.querySelector('table');
22465
+ headEle = tableEle.querySelector('thead');
22466
+ bodyEle = tableEle.querySelector('tbody');
22467
+ arrHeadEle = this.getArrHeadByHtml(headEle);
22468
+ arrRowData = this.getArrRowDataByHtml(bodyEle, arrHeadEle);
22469
+ strHeadEle = this.headHtmlToString(arrHeadEle);
22470
+ strBodyEle = this.rowDataHtmlToString(arrRowData);
22471
+ css = '<style type="text/css">table th, table td {border:1px solid #000;} table th {text-align: center;} table {width: 100%;border-collapse: collapse;} table td:first-child {text-align: center;}</style>';
22472
+ table = css + "<table>" + strHeadEle + strBodyEle + "</table>";
22473
+ this._printService.printHtmlContent(table, header.toUpperCase());
22474
+ return [2 /*return*/];
22475
+ }
22476
+ });
22477
+ });
22441
22478
  };
22442
22479
  ListComponentBase.prototype.printByReadingHtmlHasRowSpan = function () {
22443
22480
  var header = 'Danh sách ' + this.setting.objectName;