tnx-shared 5.3.318 → 5.3.320

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.
@@ -4944,6 +4944,16 @@
4944
4944
  return '';
4945
4945
  }
4946
4946
  };
4947
+ CommonService.prototype.mathRound = function (value, digits) {
4948
+ if (digits === void 0) { digits = 0; }
4949
+ var pn = 1;
4950
+ var i = 0;
4951
+ while (digits > 0 && i < digits) {
4952
+ pn = pn * 10;
4953
+ i += 1;
4954
+ }
4955
+ return Math.round(value * pn) / pn;
4956
+ };
4947
4957
  return CommonService;
4948
4958
  }());
4949
4959
  CommonService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function CommonService_Factory() { return new CommonService(i0__namespace.ɵɵinject(ModuleConfigService)); }, token: CommonService, providedIn: "root" });
@@ -19392,7 +19402,7 @@
19392
19402
  valueBefore: valueBefore,
19393
19403
  valueAfter: valueAfter,
19394
19404
  enumLogType: (control instanceof EditorControlSchema || control instanceof TextAreaControlSchema)
19395
- ? exports.EnumLogType.Table
19405
+ ? exports.EnumLogType.Html
19396
19406
  : exports.EnumLogType.Normal
19397
19407
  }));
19398
19408
  }
@@ -26994,7 +27004,7 @@
26994
27004
  };
26995
27005
  ListBase.prototype.mergeInfoToColumnSchema = function () {
26996
27006
  var _this = this;
26997
- var i = 0, constWidth = 83, sumWidth = 0, widthColBefore = 0; // 83 tổng chiều dài checkbox + stt crud-list
27007
+ var i = 0, constWidth = this.constWidthCol || 83, sumWidth = 0, widthColBefore = 0; // 83 tổng chiều dài checkbox + stt crud-list
26998
27008
  if (this.setting.hiddenCheckbox)
26999
27009
  constWidth -= 35;
27000
27010
  if (this.setting.hiddenOrderColumn)
@@ -28239,6 +28249,60 @@
28239
28249
  });
28240
28250
  });
28241
28251
  };
28252
+ ListBase.prototype._exportAllDataWithTemplateCode = function (templateCode, isViewOnline) {
28253
+ if (isViewOnline === void 0) { isViewOnline = false; }
28254
+ var _a;
28255
+ return __awaiter(this, void 0, void 0, function () {
28256
+ var lstRawData, lstVisibleField, lstData, data, sheet, file, _templateInstanceService;
28257
+ var _this = this;
28258
+ return __generator(this, function (_b) {
28259
+ switch (_b.label) {
28260
+ case 0: return [4 /*yield*/, this.setting.baseService.getDataCustomRoute(this.plusUrl, this.currentGridInfo.filters, this.currentGridInfo.fields, this.currentGridInfo.sorts, -1, 1)];
28261
+ case 1:
28262
+ lstRawData = (_a = (_b.sent()).data) !== null && _a !== void 0 ? _a : [];
28263
+ lstVisibleField = this.setting.cols
28264
+ .filter(function (item) { return item.visible && item.dataType !== 'trangThaiV5'; })
28265
+ .map(function (item) { return item.field; });
28266
+ return [4 /*yield*/, this.beforeExportAllData(lstRawData, lstVisibleField)];
28267
+ case 2:
28268
+ _b.sent();
28269
+ return [4 /*yield*/, this._crudService.getRefDataInDatasource(lstRawData, this.setting.fieldNeedGetRef)];
28270
+ case 3:
28271
+ _b.sent();
28272
+ lstData = lstRawData.map(function (rowData) { return _this.modifyRowDataForExport(rowData); });
28273
+ data = {
28274
+ lstData: lstData
28275
+ };
28276
+ sheet = new ExportItem({
28277
+ type: exports.ExportItemType.ExcelSheet,
28278
+ templateCode: templateCode,
28279
+ data: this.stringifyData(data),
28280
+ name: 'Sheet1'
28281
+ });
28282
+ file = new ExportItem({
28283
+ type: exports.ExportItemType.ExcelFile,
28284
+ name: this.setting.title ? this.setting.title : "Danh s\u00E1ch " + this.setting.objectName.toLocaleLowerCase()
28285
+ });
28286
+ file.children = [sheet];
28287
+ return [4 /*yield*/, this.modifyDataForExportAll(data)];
28288
+ case 4:
28289
+ _b.sent();
28290
+ _templateInstanceService = this._injector.get(TemplateInstanceService);
28291
+ return [2 /*return*/, _templateInstanceService.exportNormal(file)];
28292
+ }
28293
+ });
28294
+ });
28295
+ };
28296
+ ListBase.prototype.modifyDataForExportAll = function (data) {
28297
+ return __awaiter(this, void 0, void 0, function () {
28298
+ return __generator(this, function (_b) {
28299
+ return [2 /*return*/];
28300
+ });
28301
+ });
28302
+ };
28303
+ ListBase.prototype.modifyRowDataForExport = function (rowData) {
28304
+ return rowData;
28305
+ };
28242
28306
  return ListBase;
28243
28307
  }(ComponentBaseWithButton));
28244
28308
  ListBase.decorators = [