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.
@@ -4046,6 +4046,15 @@ class CommonService {
4046
4046
  return '';
4047
4047
  }
4048
4048
  }
4049
+ mathRound(value, digits = 0) {
4050
+ let pn = 1;
4051
+ let i = 0;
4052
+ while (digits > 0 && i < digits) {
4053
+ pn = pn * 10;
4054
+ i += 1;
4055
+ }
4056
+ return Math.round(value * pn) / pn;
4057
+ }
4049
4058
  }
4050
4059
  CommonService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CommonService_Factory() { return new CommonService(i0.ɵɵinject(ModuleConfigService)); }, token: CommonService, providedIn: "root" });
4051
4060
  CommonService.decorators = [
@@ -16216,7 +16225,7 @@ class DataFormBase extends ComponentBaseWithButton {
16216
16225
  valueBefore: valueBefore,
16217
16226
  valueAfter: valueAfter,
16218
16227
  enumLogType: (control instanceof EditorControlSchema || control instanceof TextAreaControlSchema)
16219
- ? EnumLogType.Table
16228
+ ? EnumLogType.Html
16220
16229
  : EnumLogType.Normal
16221
16230
  }));
16222
16231
  }
@@ -23197,7 +23206,7 @@ class ListBase extends ComponentBaseWithButton {
23197
23206
  this.getMenuButtons = this.getMenuButtons.bind(this);
23198
23207
  }
23199
23208
  mergeInfoToColumnSchema() {
23200
- let i = 0, constWidth = 83, sumWidth = 0, widthColBefore = 0; // 83 tổng chiều dài checkbox + stt crud-list
23209
+ let i = 0, constWidth = this.constWidthCol || 83, sumWidth = 0, widthColBefore = 0; // 83 tổng chiều dài checkbox + stt crud-list
23201
23210
  if (this.setting.hiddenCheckbox)
23202
23211
  constWidth -= 35;
23203
23212
  if (this.setting.hiddenOrderColumn)
@@ -24108,6 +24117,42 @@ class ListBase extends ComponentBaseWithButton {
24108
24117
  return __awaiter(this, void 0, void 0, function* () {
24109
24118
  });
24110
24119
  }
24120
+ _exportAllDataWithTemplateCode(templateCode, isViewOnline = false) {
24121
+ var _a;
24122
+ return __awaiter(this, void 0, void 0, function* () {
24123
+ const lstRawData = (_a = (yield this.setting.baseService.getDataCustomRoute(this.plusUrl, this.currentGridInfo.filters, this.currentGridInfo.fields, this.currentGridInfo.sorts, -1, 1)).data) !== null && _a !== void 0 ? _a : [];
24124
+ const lstVisibleField = this.setting.cols
24125
+ .filter(item => item.visible && item.dataType !== 'trangThaiV5')
24126
+ .map(item => item.field);
24127
+ yield this.beforeExportAllData(lstRawData, lstVisibleField);
24128
+ yield this._crudService.getRefDataInDatasource(lstRawData, this.setting.fieldNeedGetRef);
24129
+ const lstData = lstRawData.map(rowData => this.modifyRowDataForExport(rowData));
24130
+ const data = {
24131
+ lstData: lstData
24132
+ };
24133
+ const sheet = new ExportItem({
24134
+ type: ExportItemType.ExcelSheet,
24135
+ templateCode,
24136
+ data: this.stringifyData(data),
24137
+ name: 'Sheet1'
24138
+ });
24139
+ const file = new ExportItem({
24140
+ type: ExportItemType.ExcelFile,
24141
+ name: this.setting.title ? this.setting.title : `Danh sách ${this.setting.objectName.toLocaleLowerCase()}`
24142
+ });
24143
+ file.children = [sheet];
24144
+ yield this.modifyDataForExportAll(data);
24145
+ const _templateInstanceService = this._injector.get(TemplateInstanceService);
24146
+ return _templateInstanceService.exportNormal(file);
24147
+ });
24148
+ }
24149
+ modifyDataForExportAll(data) {
24150
+ return __awaiter(this, void 0, void 0, function* () {
24151
+ });
24152
+ }
24153
+ modifyRowDataForExport(rowData) {
24154
+ return rowData;
24155
+ }
24111
24156
  }
24112
24157
  ListBase.decorators = [
24113
24158
  { type: Directive }