tnx-shared 5.3.330 → 5.3.332
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.
- package/bundles/tnx-shared.umd.js +27 -49
- package/bundles/tnx-shared.umd.js.map +1 -1
- package/bundles/tnx-shared.umd.min.js +1 -1
- package/bundles/tnx-shared.umd.min.js.map +1 -1
- package/classes/base/list-component-base.d.ts +1 -0
- package/classes/base/list-component-base.d.ts.map +1 -1
- package/esm2015/classes/base/list-component-base.js +15 -40
- package/esm2015/services/canbo-hoso.service.js +11 -10
- package/fesm2015/tnx-shared.js +24 -48
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
- package/services/canbo-hoso.service.d.ts.map +1 -1
- package/tnx-shared.metadata.json +1 -1
|
@@ -20838,10 +20838,13 @@
|
|
|
20838
20838
|
return __generator(this, function (_d) {
|
|
20839
20839
|
switch (_d.label) {
|
|
20840
20840
|
case 0:
|
|
20841
|
+
if (!(dataSource === null || dataSource === void 0 ? void 0 : dataSource.length))
|
|
20842
|
+
return [2 /*return*/];
|
|
20841
20843
|
selectedValue = element.selectedValue;
|
|
20842
|
-
if (!!selectedValue) return [3 /*break*/,
|
|
20844
|
+
if (!!selectedValue) return [3 /*break*/, 3];
|
|
20843
20845
|
lstIdDoiTac = this._commonService.distinct(dataSource.filter(function (item) { return !!item.idDoiTac; }).flatMap(function (item) { return item.idDoiTac.split(','); }));
|
|
20844
|
-
return [
|
|
20846
|
+
if (!lstIdDoiTac.length) return [3 /*break*/, 2];
|
|
20847
|
+
return [4 /*yield*/, this._hoSoDoiTacService.getAllWithIgnore([this.newFilter('id', exports.Operator.in, lstIdDoiTac.filter(function (id) { return !!id; }))], 'id,ten')];
|
|
20845
20848
|
case 1:
|
|
20846
20849
|
lstDoiTac_1 = (_c = (_b = (_d.sent())) === null || _b === void 0 ? void 0 : _b.data) !== null && _c !== void 0 ? _c : [];
|
|
20847
20850
|
if (lstDoiTac_1.length) {
|
|
@@ -20849,8 +20852,9 @@
|
|
|
20849
20852
|
item.tenDoiTac = lstDoiTac_1.filter(function (x) { return item.idDoiTac.includes(x.id); }).map(function (x) { return x.ten; }).join(', ');
|
|
20850
20853
|
});
|
|
20851
20854
|
}
|
|
20852
|
-
|
|
20853
|
-
case 2:
|
|
20855
|
+
_d.label = 2;
|
|
20856
|
+
case 2: return [3 /*break*/, 4];
|
|
20857
|
+
case 3:
|
|
20854
20858
|
dataSource.forEach(function (x) {
|
|
20855
20859
|
var _a;
|
|
20856
20860
|
if (typeof selectedValue == 'object' && x.id == (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.id)) {
|
|
@@ -20859,8 +20863,8 @@
|
|
|
20859
20863
|
else if (isArray(selectedValue) && selectedValue.includes(x.id))
|
|
20860
20864
|
(x.tenDoiTac = (_a = selectedValue.find(function (y) { return y.id == x.id; })) === null || _a === void 0 ? void 0 : _a.stridDoiTac);
|
|
20861
20865
|
});
|
|
20862
|
-
_d.label =
|
|
20863
|
-
case
|
|
20866
|
+
_d.label = 4;
|
|
20867
|
+
case 4:
|
|
20864
20868
|
this.getTenDonVi(dataSource);
|
|
20865
20869
|
return [2 /*return*/];
|
|
20866
20870
|
}
|
|
@@ -20908,15 +20912,12 @@
|
|
|
20908
20912
|
result.fieldPlus += ',idNgachVienChuc';
|
|
20909
20913
|
}
|
|
20910
20914
|
}
|
|
20911
|
-
|
|
20915
|
+
if (!result.isOverrideColumns)
|
|
20912
20916
|
result.fieldPlus = 'idNgachVienChuc,ngaySinh,ngaySinh2,chucDanhs,idHocHam,idHocVi,dienThoaiDiDong,code';
|
|
20913
|
-
}
|
|
20914
20917
|
return result;
|
|
20915
20918
|
};
|
|
20916
20919
|
CanBoHoSoService.prototype.getTenDonVi = function (dataSource) {
|
|
20917
20920
|
var e_1, _d;
|
|
20918
|
-
if (!(dataSource === null || dataSource === void 0 ? void 0 : dataSource.length))
|
|
20919
|
-
return;
|
|
20920
20921
|
try {
|
|
20921
20922
|
for (var dataSource_1 = __values(dataSource), dataSource_1_1 = dataSource_1.next(); !dataSource_1_1.done; dataSource_1_1 = dataSource_1.next()) {
|
|
20922
20923
|
var item = dataSource_1_1.value;
|
|
@@ -22457,6 +22458,7 @@
|
|
|
22457
22458
|
_this.isSuperUser = false;
|
|
22458
22459
|
_this.showFormWorkflow = false;
|
|
22459
22460
|
_this.headerWorkflow = '';
|
|
22461
|
+
_this.componentKey = '';
|
|
22460
22462
|
_this.lstBtnAuthorizeMenu = [];
|
|
22461
22463
|
_this.popupSizeWorkflow = new PopupSize({ width: 950, height: 540 });
|
|
22462
22464
|
_this.showHistoryWorkflow = false;
|
|
@@ -22964,6 +22966,7 @@
|
|
|
22964
22966
|
}
|
|
22965
22967
|
};
|
|
22966
22968
|
ListComponentBase.prototype.initColumnSchema = function (cols) {
|
|
22969
|
+
var _a, _b, _c, _d;
|
|
22967
22970
|
if (!cols || !cols.length)
|
|
22968
22971
|
return;
|
|
22969
22972
|
var colFunction = null, colGroup = null, colHasToggleIcon = null;
|
|
@@ -22986,6 +22989,7 @@
|
|
|
22986
22989
|
colHasToggleIcon = this.setting.cols[0];
|
|
22987
22990
|
}
|
|
22988
22991
|
colHasToggleIcon.colHasToggleIcon = true;
|
|
22992
|
+
this.componentKey = location.pathname + "/" + (((_d = (_c = (_b = (_a = this.container) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.closest('crud-list').parentNode) === null || _c === void 0 ? void 0 : _c.tagName) === null || _d === void 0 ? void 0 : _d.toLowerCase()) || '') + (this.setting.settingKey ? '/' + this.setting.settingKey : '');
|
|
22989
22993
|
this.getColorSetting();
|
|
22990
22994
|
this.getColumnSetting(colGroup);
|
|
22991
22995
|
this.getPageSetting();
|
|
@@ -23202,16 +23206,12 @@
|
|
|
23202
23206
|
var dataSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.COLUMN_SETTING);
|
|
23203
23207
|
var jsonData = this.tryParseJson(dataSetting);
|
|
23204
23208
|
if (dataSetting && jsonData.valid && jsonData.value.length > 0) {
|
|
23205
|
-
var pathName = location.pathname;
|
|
23206
|
-
if (this.setting.settingKey) {
|
|
23207
|
-
pathName += '/' + this.setting.settingKey;
|
|
23208
|
-
}
|
|
23209
23209
|
var settings = jsonData.value;
|
|
23210
23210
|
try {
|
|
23211
23211
|
for (var settings_1 = __values(settings), settings_1_1 = settings_1.next(); !settings_1_1.done; settings_1_1 = settings_1.next()) {
|
|
23212
23212
|
var element = settings_1_1.value;
|
|
23213
23213
|
// const element = settings[i];
|
|
23214
|
-
if (element.pathname ===
|
|
23214
|
+
if (element.pathname === this.componentKey) {
|
|
23215
23215
|
this.setting.columnSetting.sortField = element.setting.sortField;
|
|
23216
23216
|
this.setting.columnSetting.sortDir = element.setting.sortDir ? element.setting.sortDir : 0;
|
|
23217
23217
|
if (this.setting.columnSetting.sortDir == 0) {
|
|
@@ -23249,16 +23249,13 @@
|
|
|
23249
23249
|
}
|
|
23250
23250
|
};
|
|
23251
23251
|
ListComponentBase.prototype.saveColumnSetting = function () {
|
|
23252
|
-
var
|
|
23253
|
-
if (this.setting.settingKey) {
|
|
23254
|
-
pathName += '/' + this.setting.settingKey;
|
|
23255
|
-
}
|
|
23252
|
+
var _this = this;
|
|
23256
23253
|
var columnSetting = [];
|
|
23257
23254
|
var checkExist = false;
|
|
23258
23255
|
var dataSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.COLUMN_SETTING);
|
|
23259
23256
|
if (dataSetting) {
|
|
23260
23257
|
columnSetting = JSON.parse(dataSetting);
|
|
23261
|
-
var itemSetting = columnSetting.find(function (q) { return q.pathname ==
|
|
23258
|
+
var itemSetting = columnSetting.find(function (q) { return q.pathname == _this.componentKey; });
|
|
23262
23259
|
if (itemSetting) {
|
|
23263
23260
|
itemSetting.setting.sortField = this.setting.columnSetting.sortField;
|
|
23264
23261
|
itemSetting.setting.sortDir = this.setting.columnSetting.sortDir;
|
|
@@ -23269,20 +23266,17 @@
|
|
|
23269
23266
|
}
|
|
23270
23267
|
}
|
|
23271
23268
|
if (!checkExist) {
|
|
23272
|
-
columnSetting.push({ pathname:
|
|
23269
|
+
columnSetting.push({ pathname: this.componentKey, setting: this.setting.columnSetting });
|
|
23273
23270
|
}
|
|
23274
23271
|
localStorage.setItem(ComCtxConstants.LOCALSTORAGE_KEY.COLUMN_SETTING, JSON.stringify(columnSetting));
|
|
23275
23272
|
};
|
|
23276
23273
|
ListComponentBase.prototype.deleteColumnSetting = function () {
|
|
23277
|
-
var
|
|
23278
|
-
if (this.setting.settingKey) {
|
|
23279
|
-
pathName += '/' + this.setting.settingKey;
|
|
23280
|
-
}
|
|
23274
|
+
var _this = this;
|
|
23281
23275
|
var columnSetting = [];
|
|
23282
23276
|
var dataSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.COLUMN_SETTING);
|
|
23283
23277
|
if (dataSetting) {
|
|
23284
23278
|
columnSetting = JSON.parse(dataSetting);
|
|
23285
|
-
var index = columnSetting.findIndex(function (q) { return q.pathname ==
|
|
23279
|
+
var index = columnSetting.findIndex(function (q) { return q.pathname == _this.componentKey; });
|
|
23286
23280
|
if (index > -1)
|
|
23287
23281
|
columnSetting.splice(index, 1);
|
|
23288
23282
|
}
|
|
@@ -23292,14 +23286,10 @@
|
|
|
23292
23286
|
ListComponentBase.prototype.getColorSetting = function () {
|
|
23293
23287
|
var dataPageSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.COLOR_SETTING);
|
|
23294
23288
|
if (dataPageSetting) {
|
|
23295
|
-
var pathName = location.pathname;
|
|
23296
|
-
if (this.setting.settingKey) {
|
|
23297
|
-
pathName += '/' + this.setting.settingKey;
|
|
23298
|
-
}
|
|
23299
23289
|
var settings = JSON.parse(dataPageSetting);
|
|
23300
23290
|
for (var i = 0; i < settings.length; i++) {
|
|
23301
23291
|
var element = settings[i];
|
|
23302
|
-
if (element.pathname ===
|
|
23292
|
+
if (element.pathname === this.componentKey) {
|
|
23303
23293
|
this.setting.colorFilterField = element.colorFilterField;
|
|
23304
23294
|
this.setting.colorFilterTable = element.colorFilterTable;
|
|
23305
23295
|
break;
|
|
@@ -23324,17 +23314,13 @@
|
|
|
23324
23314
|
};
|
|
23325
23315
|
ListComponentBase.prototype.setColorSetting = function () {
|
|
23326
23316
|
var _this = this;
|
|
23327
|
-
var pathName = location.pathname;
|
|
23328
|
-
if (this.setting.settingKey) {
|
|
23329
|
-
pathName += '/' + this.setting.settingKey;
|
|
23330
|
-
}
|
|
23331
23317
|
var colorSetting = [];
|
|
23332
23318
|
var checkExist = false;
|
|
23333
23319
|
var dataColorSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.COLOR_SETTING);
|
|
23334
23320
|
if (dataColorSetting) {
|
|
23335
23321
|
colorSetting = JSON.parse(dataColorSetting);
|
|
23336
23322
|
colorSetting.forEach(function (element) {
|
|
23337
|
-
if (element.pathname ===
|
|
23323
|
+
if (element.pathname === _this.componentKey) {
|
|
23338
23324
|
element.colorFilterField = _this.setting.colorFilterField;
|
|
23339
23325
|
element.colorFilterTable = _this.setting.colorFilterTable;
|
|
23340
23326
|
checkExist = true;
|
|
@@ -23343,7 +23329,7 @@
|
|
|
23343
23329
|
}
|
|
23344
23330
|
if (!checkExist) {
|
|
23345
23331
|
colorSetting.push({
|
|
23346
|
-
pathname:
|
|
23332
|
+
pathname: this.componentKey,
|
|
23347
23333
|
colorFilterField: this.setting.colorFilterField,
|
|
23348
23334
|
colorFilterTable: this.setting.colorFilterTable
|
|
23349
23335
|
});
|
|
@@ -23353,14 +23339,10 @@
|
|
|
23353
23339
|
ListComponentBase.prototype.getPageSetting = function () {
|
|
23354
23340
|
var dataPageSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.PAGE_SETTING);
|
|
23355
23341
|
if (dataPageSetting) {
|
|
23356
|
-
var pathName = location.pathname;
|
|
23357
|
-
if (this.setting.settingKey) {
|
|
23358
|
-
pathName += '/' + this.setting.settingKey;
|
|
23359
|
-
}
|
|
23360
23342
|
var pageSettings = JSON.parse(dataPageSetting);
|
|
23361
23343
|
for (var i = 0; i < pageSettings.length; i++) {
|
|
23362
23344
|
var element = pageSettings[i];
|
|
23363
|
-
if (element.pathname ===
|
|
23345
|
+
if (element.pathname === this.componentKey) {
|
|
23364
23346
|
this.setting.pageSetting.pageSize = element.pageSize;
|
|
23365
23347
|
break;
|
|
23366
23348
|
}
|
|
@@ -23369,24 +23351,20 @@
|
|
|
23369
23351
|
};
|
|
23370
23352
|
ListComponentBase.prototype.savePageSetting = function () {
|
|
23371
23353
|
var _this = this;
|
|
23372
|
-
var pathName = location.pathname;
|
|
23373
|
-
if (this.setting.settingKey) {
|
|
23374
|
-
pathName += '/' + this.setting.settingKey;
|
|
23375
|
-
}
|
|
23376
23354
|
var pageSetting = [];
|
|
23377
23355
|
var checkExist = false;
|
|
23378
23356
|
var dataPageSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.PAGE_SETTING);
|
|
23379
23357
|
if (dataPageSetting) {
|
|
23380
23358
|
pageSetting = JSON.parse(dataPageSetting);
|
|
23381
23359
|
pageSetting.forEach(function (element) {
|
|
23382
|
-
if (element.pathname ===
|
|
23360
|
+
if (element.pathname === _this.componentKey) {
|
|
23383
23361
|
element.pageSize = _this.setting.pageSetting.pageSize;
|
|
23384
23362
|
checkExist = true;
|
|
23385
23363
|
}
|
|
23386
23364
|
});
|
|
23387
23365
|
}
|
|
23388
23366
|
if (!checkExist) {
|
|
23389
|
-
pageSetting.push({ pathname:
|
|
23367
|
+
pageSetting.push({ pathname: this.componentKey, pageSize: this.setting.pageSetting.pageSize });
|
|
23390
23368
|
}
|
|
23391
23369
|
localStorage.setItem(ComCtxConstants.LOCALSTORAGE_KEY.PAGE_SETTING, JSON.stringify(pageSetting));
|
|
23392
23370
|
};
|
|
@@ -23659,7 +23637,7 @@
|
|
|
23659
23637
|
}
|
|
23660
23638
|
}
|
|
23661
23639
|
}
|
|
23662
|
-
return transformed.map(function (row) { return row.map(function (cell) { return cell ||
|
|
23640
|
+
return transformed.map(function (row) { return row.map(function (cell) { return cell || ''; }); });
|
|
23663
23641
|
};
|
|
23664
23642
|
ListComponentBase.prototype.getValueRow = function (rowData, index, value) {
|
|
23665
23643
|
if (rowData[index] != null) {
|