tnx-shared 5.3.291 → 5.3.292
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 +99 -91
- 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.map +1 -1
- package/classes/form-schema.d.ts +1 -0
- package/classes/form-schema.d.ts.map +1 -1
- package/components/autocomplete-picker/autocomplete-picker.component.d.ts.map +1 -1
- package/components/common-search-form/common-search-form.component.d.ts.map +1 -1
- package/components/dropdown/dropdown.component.d.ts +2 -0
- package/components/dropdown/dropdown.component.d.ts.map +1 -1
- package/components/entity-picker/entity-picker-dialog/components/entity-picker-data/entity-picker-data.component.d.ts.map +1 -1
- package/components/entity-picker/entity-picker-dialog/components/entity-picker-selected/entity-picker-selected.component.d.ts.map +1 -1
- package/esm2015/classes/base/list-component-base.js +3 -3
- package/esm2015/classes/form-schema.js +2 -1
- package/esm2015/components/autocomplete-picker/autocomplete-picker.component.js +7 -5
- package/esm2015/components/common-search-form/common-search-form.component.js +5 -2
- package/esm2015/components/dropdown/dropdown.component.js +19 -23
- package/esm2015/components/entity-picker/entity-picker-dialog/components/entity-picker-data/entity-picker-data.component.js +2 -1
- package/esm2015/components/entity-picker/entity-picker-dialog/components/entity-picker-selected/entity-picker-selected.component.js +2 -1
- package/esm2015/services/base.service.js +5 -3
- package/esm2015/services/canbo-hoso.service.js +7 -3
- package/esm2015/services/dm-chucvu.service.js +1 -2
- package/fesm2015/tnx-shared.js +40 -32
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
- package/services/base.service.d.ts +0 -2
- package/services/base.service.d.ts.map +1 -1
- package/services/canbo-hoso.service.d.ts.map +1 -1
- package/services/dm-chucvu.service.d.ts.map +1 -1
- package/tnx-shared.metadata.json +1 -1
|
@@ -2063,6 +2063,7 @@
|
|
|
2063
2063
|
_this.insertPlusUrl = '';
|
|
2064
2064
|
_this.loadInFirstDisplay = true;
|
|
2065
2065
|
_this.autoGetData = true;
|
|
2066
|
+
_this.isAllowDisabled = true;
|
|
2066
2067
|
_this.valueField = 'id';
|
|
2067
2068
|
_this.displayField = 'ten';
|
|
2068
2069
|
_this.autoDisplayFirst = false;
|
|
@@ -8015,6 +8016,7 @@
|
|
|
8015
8016
|
var EXCEL_EXTENSION$1 = '.xlsx';
|
|
8016
8017
|
var BaseService = /** @class */ (function () {
|
|
8017
8018
|
function BaseService(http, injector, serviceUri) {
|
|
8019
|
+
var _a, _b;
|
|
8018
8020
|
this.serviceUri = '';
|
|
8019
8021
|
this.endPoint = '';
|
|
8020
8022
|
this.serviceCode = '';
|
|
@@ -8024,8 +8026,6 @@
|
|
|
8024
8026
|
this.apiGetData = 'GetData';
|
|
8025
8027
|
this.apiGetAll = 'GetAllByFilter';
|
|
8026
8028
|
this.apiGetDetailByFilter = 'GetByFilter';
|
|
8027
|
-
this.fieldSort = '';
|
|
8028
|
-
this.fieldSuDung = '';
|
|
8029
8029
|
this.disableFieldNotUse = false;
|
|
8030
8030
|
this.RETRY_COUNT = 0;
|
|
8031
8031
|
this.REPLAY_COUNT = 1;
|
|
@@ -8035,6 +8035,8 @@
|
|
|
8035
8035
|
this.serviceUri = serviceUri;
|
|
8036
8036
|
this._commonService = injector.get(CommonService);
|
|
8037
8037
|
this._signalrServicePrivate = injector.get(SignalRService);
|
|
8038
|
+
var environment = this._injector.get(ModuleConfigService).getConfig().environment;
|
|
8039
|
+
this.disableFieldNotUse = (_b = (_a = environment === null || environment === void 0 ? void 0 : environment.cauHinhNghiepVu) === null || _a === void 0 ? void 0 : _a.disableFieldNotUse) !== null && _b !== void 0 ? _b : false;
|
|
8038
8040
|
}
|
|
8039
8041
|
BaseService.prototype.setCurrentServiceUri = function (key) {
|
|
8040
8042
|
};
|
|
@@ -8273,8 +8275,8 @@
|
|
|
8273
8275
|
BaseService.prototype.checkDuplicatedByField = function (field, value, id) {
|
|
8274
8276
|
return __awaiter(this, void 0, void 0, function () {
|
|
8275
8277
|
var filters, result;
|
|
8276
|
-
return __generator(this, function (
|
|
8277
|
-
switch (
|
|
8278
|
+
return __generator(this, function (_c) {
|
|
8279
|
+
switch (_c.label) {
|
|
8278
8280
|
case 0:
|
|
8279
8281
|
filters = [
|
|
8280
8282
|
new Filter({
|
|
@@ -8290,7 +8292,7 @@
|
|
|
8290
8292
|
];
|
|
8291
8293
|
return [4 /*yield*/, this.checkExistByFilter(filters)];
|
|
8292
8294
|
case 1:
|
|
8293
|
-
result =
|
|
8295
|
+
result = _c.sent();
|
|
8294
8296
|
if (!result.success)
|
|
8295
8297
|
return [2 /*return*/, true];
|
|
8296
8298
|
return [2 /*return*/, result.data];
|
|
@@ -8384,7 +8386,7 @@
|
|
|
8384
8386
|
* @private
|
|
8385
8387
|
*/
|
|
8386
8388
|
BaseService.prototype.getTreeModelBase = function (rawData, fieldParent, fieldParentTreeItem) {
|
|
8387
|
-
var e_1,
|
|
8389
|
+
var e_1, _c;
|
|
8388
8390
|
if (rawData == null || rawData.length == 0) {
|
|
8389
8391
|
return [];
|
|
8390
8392
|
}
|
|
@@ -8418,7 +8420,7 @@
|
|
|
8418
8420
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
8419
8421
|
finally {
|
|
8420
8422
|
try {
|
|
8421
|
-
if (rawData_1_1 && !rawData_1_1.done && (
|
|
8423
|
+
if (rawData_1_1 && !rawData_1_1.done && (_c = rawData_1.return)) _c.call(rawData_1);
|
|
8422
8424
|
}
|
|
8423
8425
|
finally { if (e_1) throw e_1.error; }
|
|
8424
8426
|
}
|
|
@@ -8432,7 +8434,7 @@
|
|
|
8432
8434
|
* @private
|
|
8433
8435
|
*/
|
|
8434
8436
|
BaseService.prototype.getTreeData = function (rawData, fieldParent, fieldParentTreeItem) {
|
|
8435
|
-
var e_2,
|
|
8437
|
+
var e_2, _c, e_3, _d, e_4, _e;
|
|
8436
8438
|
if (rawData == null)
|
|
8437
8439
|
return [];
|
|
8438
8440
|
// let count = 0;
|
|
@@ -8519,12 +8521,12 @@
|
|
|
8519
8521
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
8520
8522
|
finally {
|
|
8521
8523
|
try {
|
|
8522
|
-
if (rawData_2_1 && !rawData_2_1.done && (
|
|
8524
|
+
if (rawData_2_1 && !rawData_2_1.done && (_c = rawData_2.return)) _c.call(rawData_2);
|
|
8523
8525
|
}
|
|
8524
8526
|
finally { if (e_2) throw e_2.error; }
|
|
8525
8527
|
}
|
|
8526
8528
|
var funcSetPrefix = function (node, parentNode, prefix) {
|
|
8527
|
-
var e_5,
|
|
8529
|
+
var e_5, _c;
|
|
8528
8530
|
// count++;
|
|
8529
8531
|
node.data._prefix = prefix;
|
|
8530
8532
|
node.data._level = parentNode.data._level + 1;
|
|
@@ -8533,15 +8535,15 @@
|
|
|
8533
8535
|
return;
|
|
8534
8536
|
}
|
|
8535
8537
|
try {
|
|
8536
|
-
for (var
|
|
8537
|
-
var child =
|
|
8538
|
+
for (var _d = __values(node.children), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
8539
|
+
var child = _e.value;
|
|
8538
8540
|
funcSetPrefix(child, node, prefix + '---');
|
|
8539
8541
|
}
|
|
8540
8542
|
}
|
|
8541
8543
|
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
8542
8544
|
finally {
|
|
8543
8545
|
try {
|
|
8544
|
-
if (
|
|
8546
|
+
if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
|
|
8545
8547
|
}
|
|
8546
8548
|
finally { if (e_5) throw e_5.error; }
|
|
8547
8549
|
}
|
|
@@ -8561,15 +8563,15 @@
|
|
|
8561
8563
|
continue;
|
|
8562
8564
|
}
|
|
8563
8565
|
try {
|
|
8564
|
-
for (var
|
|
8565
|
-
var child =
|
|
8566
|
+
for (var _f = (e_4 = void 0, __values(node.children)), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
8567
|
+
var child = _g.value;
|
|
8566
8568
|
funcSetPrefix(child, node, '|--');
|
|
8567
8569
|
}
|
|
8568
8570
|
}
|
|
8569
8571
|
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
8570
8572
|
finally {
|
|
8571
8573
|
try {
|
|
8572
|
-
if (
|
|
8574
|
+
if (_g && !_g.done && (_e = _f.return)) _e.call(_f);
|
|
8573
8575
|
}
|
|
8574
8576
|
finally { if (e_4) throw e_4.error; }
|
|
8575
8577
|
}
|
|
@@ -8578,7 +8580,7 @@
|
|
|
8578
8580
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
8579
8581
|
finally {
|
|
8580
8582
|
try {
|
|
8581
|
-
if (roots_1_1 && !roots_1_1.done && (
|
|
8583
|
+
if (roots_1_1 && !roots_1_1.done && (_d = roots_1.return)) _d.call(roots_1);
|
|
8582
8584
|
}
|
|
8583
8585
|
finally { if (e_3) throw e_3.error; }
|
|
8584
8586
|
}
|
|
@@ -8737,13 +8739,13 @@
|
|
|
8737
8739
|
BaseService.prototype.getWorkflowSettingByCode = function (workflowCode) {
|
|
8738
8740
|
return __awaiter(this, void 0, void 0, function () {
|
|
8739
8741
|
var workflowSetting, jsonSchema, stateMachineData;
|
|
8740
|
-
return __generator(this, function (
|
|
8741
|
-
switch (
|
|
8742
|
+
return __generator(this, function (_c) {
|
|
8743
|
+
switch (_c.label) {
|
|
8742
8744
|
case 0: return [4 /*yield*/, this.getDetailByFilter([
|
|
8743
8745
|
this.newFilter('code', exports.Operator.equal, workflowCode)
|
|
8744
8746
|
])];
|
|
8745
8747
|
case 1:
|
|
8746
|
-
workflowSetting = (
|
|
8748
|
+
workflowSetting = (_c.sent()).data;
|
|
8747
8749
|
if (workflowSetting == null)
|
|
8748
8750
|
return [2 /*return*/, null];
|
|
8749
8751
|
jsonSchema = workflowSetting['data'];
|
|
@@ -8835,11 +8837,11 @@
|
|
|
8835
8837
|
FileSaver__namespace.saveAs(res, fileName);
|
|
8836
8838
|
}).catch(function (err) { return __awaiter(_this, void 0, void 0, function () {
|
|
8837
8839
|
var errorText;
|
|
8838
|
-
return __generator(this, function (
|
|
8839
|
-
switch (
|
|
8840
|
+
return __generator(this, function (_c) {
|
|
8841
|
+
switch (_c.label) {
|
|
8840
8842
|
case 0: return [4 /*yield*/, err.error.text()];
|
|
8841
8843
|
case 1:
|
|
8842
|
-
errorText =
|
|
8844
|
+
errorText = _c.sent();
|
|
8843
8845
|
console.error(errorText);
|
|
8844
8846
|
return [2 /*return*/];
|
|
8845
8847
|
}
|
|
@@ -8933,8 +8935,8 @@
|
|
|
8933
8935
|
if (sortDir === void 0) { sortDir = null; }
|
|
8934
8936
|
return __awaiter(this, void 0, void 0, function () {
|
|
8935
8937
|
var arrFilter, arrSort, arrResult;
|
|
8936
|
-
return __generator(this, function (
|
|
8937
|
-
switch (
|
|
8938
|
+
return __generator(this, function (_c) {
|
|
8939
|
+
switch (_c.label) {
|
|
8938
8940
|
case 0:
|
|
8939
8941
|
arrValue = (arrValue || []).filter(function (val, ind, arr) { return (val === 0 || val) && arr.indexOf(val) === ind; });
|
|
8940
8942
|
if (!arrValue || !arrValue.length)
|
|
@@ -8953,7 +8955,7 @@
|
|
|
8953
8955
|
}
|
|
8954
8956
|
return [4 /*yield*/, this.getAll(arrFilter, getFields, arrSort)];
|
|
8955
8957
|
case 1:
|
|
8956
|
-
arrResult = (
|
|
8958
|
+
arrResult = (_c.sent()).data;
|
|
8957
8959
|
return [2 /*return*/, (arrResult || [])];
|
|
8958
8960
|
}
|
|
8959
8961
|
});
|
|
@@ -8964,11 +8966,11 @@
|
|
|
8964
8966
|
if (valueField === void 0) { valueField = null; }
|
|
8965
8967
|
return __awaiter(this, void 0, void 0, function () {
|
|
8966
8968
|
var arrResult, rsDic;
|
|
8967
|
-
return __generator(this, function (
|
|
8968
|
-
switch (
|
|
8969
|
+
return __generator(this, function (_c) {
|
|
8970
|
+
switch (_c.label) {
|
|
8969
8971
|
case 0: return [4 /*yield*/, this.getByField(field, arrValue, getFields)];
|
|
8970
8972
|
case 1:
|
|
8971
|
-
arrResult =
|
|
8973
|
+
arrResult = _c.sent();
|
|
8972
8974
|
rsDic = {};
|
|
8973
8975
|
if (!arrResult.length) {
|
|
8974
8976
|
return [2 /*return*/, rsDic];
|
|
@@ -9017,7 +9019,7 @@
|
|
|
9017
9019
|
};
|
|
9018
9020
|
BaseService.prototype.getDataTrinhKy = function (item, rowData) {
|
|
9019
9021
|
return __awaiter(this, void 0, void 0, function () {
|
|
9020
|
-
return __generator(this, function (
|
|
9022
|
+
return __generator(this, function (_c) {
|
|
9021
9023
|
return [2 /*return*/, []];
|
|
9022
9024
|
});
|
|
9023
9025
|
});
|
|
@@ -20177,6 +20179,8 @@
|
|
|
20177
20179
|
}),
|
|
20178
20180
|
new ColumnSchemaBase({
|
|
20179
20181
|
field: 'email',
|
|
20182
|
+
operator: exports.Operator.equal,
|
|
20183
|
+
isOverrideFilter: true,
|
|
20180
20184
|
width: '180px'
|
|
20181
20185
|
}),
|
|
20182
20186
|
new ColumnSchemaBase({
|
|
@@ -20746,7 +20750,8 @@
|
|
|
20746
20750
|
new EntityPickerColumn({
|
|
20747
20751
|
label: 'Email',
|
|
20748
20752
|
code: 'email',
|
|
20749
|
-
|
|
20753
|
+
operator: exports.Operator.equal,
|
|
20754
|
+
isOverrideFilter: true,
|
|
20750
20755
|
width: '170px',
|
|
20751
20756
|
}),
|
|
20752
20757
|
new EntityPickerColumn({
|
|
@@ -20816,7 +20821,8 @@
|
|
|
20816
20821
|
new EntityPickerColumn({
|
|
20817
20822
|
label: 'Email',
|
|
20818
20823
|
code: 'email',
|
|
20819
|
-
|
|
20824
|
+
operator: exports.Operator.equal,
|
|
20825
|
+
isOverrideFilter: true,
|
|
20820
20826
|
width: '170px',
|
|
20821
20827
|
})
|
|
20822
20828
|
];
|
|
@@ -24440,7 +24446,7 @@
|
|
|
24440
24446
|
isArrayField: col.isArrayField ? true : false
|
|
24441
24447
|
});
|
|
24442
24448
|
templateFilter.push(filter);
|
|
24443
|
-
_this.filterSchema.dropdown[col.field] = new DropdownControlSchema(Object.assign(Object.assign({}, col), { appendTo: 'body', placeholder: "Ch\u1ECDn " + col.label, multiple: filterMuliple.includes(filter.operator), loadOnInit: true, isServerLoad: col.isServerLoad }));
|
|
24449
|
+
_this.filterSchema.dropdown[col.field] = new DropdownControlSchema(Object.assign(Object.assign({}, col), { appendTo: 'body', placeholder: "Ch\u1ECDn " + col.label, multiple: filterMuliple.includes(filter.operator), loadOnInit: true, isServerLoad: col.isServerLoad, isAllowDisabled: false }));
|
|
24444
24450
|
}
|
|
24445
24451
|
else {
|
|
24446
24452
|
_this._notifierService.showWarning("Ch\u01B0a c\u1EA5u h\u00ECnh baseService ho\u1EB7c dataSource cho c\u1ED9t " + col.field + ": " + col.label);
|
|
@@ -24869,7 +24875,7 @@
|
|
|
24869
24875
|
}
|
|
24870
24876
|
else {
|
|
24871
24877
|
if (col.baseService || (col.dataSource && col.dataSource.length > 0)) {
|
|
24872
|
-
searchInfo.fieldDropdown[col.field] = new DropdownControlSchema(Object.assign(Object.assign({}, col), { label: col.label, operator: col.multiple ? exports.Operator.in : exports.Operator.equal, mdWidth: col.mdWidth ? col.mdWidth : 10, loadOnInit: true }));
|
|
24878
|
+
searchInfo.fieldDropdown[col.field] = new DropdownControlSchema(Object.assign(Object.assign({}, col), { label: col.label, operator: col.multiple ? exports.Operator.in : exports.Operator.equal, mdWidth: col.mdWidth ? col.mdWidth : 10, loadOnInit: true, isAllowDisabled: false }));
|
|
24873
24879
|
searchInfo.schema.push(searchInfo.fieldDropdown[col.field]);
|
|
24874
24880
|
}
|
|
24875
24881
|
else if (col.dataType == 'int') {
|
|
@@ -32468,6 +32474,9 @@
|
|
|
32468
32474
|
_this.handleSearch(null, evt.control.field);
|
|
32469
32475
|
};
|
|
32470
32476
|
}
|
|
32477
|
+
if (column instanceof DropdownControlSchema) {
|
|
32478
|
+
column.isAllowDisabled = false;
|
|
32479
|
+
}
|
|
32471
32480
|
if (column instanceof NumberRangeControlSchema) {
|
|
32472
32481
|
_this.lstNumberRangeControl.push(column.field);
|
|
32473
32482
|
}
|
|
@@ -32514,7 +32523,7 @@
|
|
|
32514
32523
|
if (isLazyLoad) {
|
|
32515
32524
|
_this.lstControlLazyLoad.push(column.field);
|
|
32516
32525
|
}
|
|
32517
|
-
result.push(new DropdownControlSchema(Object.assign(Object.assign({}, column), { placeholder: (_a = column.placeholder) !== null && _a !== void 0 ? _a : "Ch\u1ECDn " + column.label, multiple: !column.single, dataSource: dataSource, mdWidth: _this.mdWidth, isLazyLoad: isLazyLoad, showLabel: false, showClear: true, onChanged: function (evt) {
|
|
32526
|
+
result.push(new DropdownControlSchema(Object.assign(Object.assign({}, column), { placeholder: (_a = column.placeholder) !== null && _a !== void 0 ? _a : "Ch\u1ECDn " + column.label, isAllowDisabled: false, multiple: !column.single, dataSource: dataSource, mdWidth: _this.mdWidth, isLazyLoad: isLazyLoad, showLabel: false, showClear: true, onChanged: function (evt) {
|
|
32518
32527
|
var _a;
|
|
32519
32528
|
if (column.dataType == exports.DataType.boolean) {
|
|
32520
32529
|
evt.parentModel[column.field] = column.single ? (_a = evt.value.id) !== null && _a !== void 0 ? _a : evt.value : evt.value.map(function (p) { return p.id; });
|
|
@@ -32828,6 +32837,8 @@
|
|
|
32828
32837
|
_this.loading = false;
|
|
32829
32838
|
_this.page = 1;
|
|
32830
32839
|
_this.totalPage = 2;
|
|
32840
|
+
_this.fieldSuDung = 'suDung';
|
|
32841
|
+
_this.disableFieldNotUse = false;
|
|
32831
32842
|
_this.modifyOptionWhenFilter = function (options) {
|
|
32832
32843
|
_this.dropdownOptions = _this.dropdown._options;
|
|
32833
32844
|
_this._modifyOptionWhenFilter(options);
|
|
@@ -32959,13 +32970,14 @@
|
|
|
32959
32970
|
if (this.control.loadOnInit && !this.control.isLazyLoad) {
|
|
32960
32971
|
this._getData();
|
|
32961
32972
|
}
|
|
32973
|
+
if (this.control.baseService instanceof MasterDataService) {
|
|
32974
|
+
this.control.maxItemDisplay = 9999;
|
|
32975
|
+
}
|
|
32976
|
+
this.disableFieldNotUse = this.control.baseService['disableFieldNotUse'];
|
|
32962
32977
|
}
|
|
32963
32978
|
if (!this._deviceDetectorService.isDesktop()) {
|
|
32964
32979
|
this.hideTransitionOptions = this.showTransitionOptions = '';
|
|
32965
32980
|
}
|
|
32966
|
-
if (this.control.baseService instanceof MasterDataService) {
|
|
32967
|
-
this.control.maxItemDisplay = 9999;
|
|
32968
|
-
}
|
|
32969
32981
|
if (this.control.onInit) {
|
|
32970
32982
|
this.control.onInit(this);
|
|
32971
32983
|
}
|
|
@@ -33129,6 +33141,7 @@
|
|
|
33129
33141
|
this._getData();
|
|
33130
33142
|
};
|
|
33131
33143
|
DropdownComponent.prototype.combineDataSource = function (dataSource, page) {
|
|
33144
|
+
var _this = this;
|
|
33132
33145
|
this.autofocusSelectedItem = true;
|
|
33133
33146
|
if (!dataSource)
|
|
33134
33147
|
dataSource = [];
|
|
@@ -33167,9 +33180,9 @@
|
|
|
33167
33180
|
this._hasLoadedDatasource = true;
|
|
33168
33181
|
}
|
|
33169
33182
|
}
|
|
33170
|
-
if (this.
|
|
33171
|
-
|
|
33172
|
-
this.dataSourceInternal.forEach(function (item) { return item.inactive = !item.value[
|
|
33183
|
+
if (this.disableFieldNotUse && this.control.isAllowDisabled
|
|
33184
|
+
&& this.dataSourceInternal.some(function (p) { return p.value.hasOwnProperty(_this.fieldSuDung); })) {
|
|
33185
|
+
this.dataSourceInternal.forEach(function (item) { return item.inactive = !item.value[_this.fieldSuDung]; });
|
|
33173
33186
|
}
|
|
33174
33187
|
};
|
|
33175
33188
|
DropdownComponent.prototype.appendDataSource = function (destSource, dataSource, direction) {
|
|
@@ -33473,25 +33486,13 @@
|
|
|
33473
33486
|
if (page === void 0) { page = 1; }
|
|
33474
33487
|
if (pageSize === void 0) { pageSize = null; }
|
|
33475
33488
|
return __awaiter(this, void 0, void 0, function () {
|
|
33476
|
-
var dataSource, totalPage,
|
|
33489
|
+
var dataSource, totalPage, dropdownOptions, response, result, dataSource_3, dataSource_3_1, item;
|
|
33477
33490
|
var e_5, _a;
|
|
33478
|
-
var _this = this;
|
|
33479
33491
|
return __generator(this, function (_b) {
|
|
33480
33492
|
switch (_b.label) {
|
|
33481
33493
|
case 0:
|
|
33482
33494
|
dataSource = null;
|
|
33483
33495
|
totalPage = 1;
|
|
33484
|
-
if (this.control.baseService['fieldSort']) {
|
|
33485
|
-
this.control.sorts = [this.newSort(this.control.baseService['fieldSort'])];
|
|
33486
|
-
}
|
|
33487
|
-
fieldSuDung = this.control.baseService['fieldSuDung'];
|
|
33488
|
-
if (fieldSuDung) {
|
|
33489
|
-
this.control.sorts.splice(0, 0, this.newSort(fieldSuDung, -1));
|
|
33490
|
-
this.control.fieldPlus += "," + fieldSuDung;
|
|
33491
|
-
this.control.funcGetLabel = function (item) {
|
|
33492
|
-
return item[fieldSuDung] ? item[_this.control.displayField] : item[_this.control.displayField] + " (Kh\u00F4ng s\u1EED d\u1EE5ng)";
|
|
33493
|
-
};
|
|
33494
|
-
}
|
|
33495
33496
|
dropdownOptions = this._crudService.createDropdownOptions(this.control);
|
|
33496
33497
|
dropdownOptions.page = page;
|
|
33497
33498
|
if (pageSize) {
|
|
@@ -33626,14 +33627,18 @@
|
|
|
33626
33627
|
var _this = this;
|
|
33627
33628
|
if (this.control.multiple) {
|
|
33628
33629
|
if (!event.itemValue) {
|
|
33629
|
-
// Trường hợp select all
|
|
33630
|
-
if (event.value.length) {
|
|
33631
|
-
this._value = this.dataSourceInternal.map(function (q) { return q.value; });
|
|
33632
|
-
}
|
|
33633
33630
|
// Trường hợp unselect all
|
|
33634
|
-
|
|
33631
|
+
if (!event.value.length || event.value.every(function (p) { return p.hasOwnProperty(_this.fieldSuDung) && !p[_this.fieldSuDung]; })) {
|
|
33635
33632
|
this._value = [];
|
|
33636
33633
|
}
|
|
33634
|
+
// Trường hợp select all
|
|
33635
|
+
else {
|
|
33636
|
+
var tmpDataSource = __spreadArray([], __read(this.dataSourceInternal));
|
|
33637
|
+
if (this.dataSourceInternal.some(function (p) { return p.hasOwnProperty('inactive'); })) {
|
|
33638
|
+
tmpDataSource = tmpDataSource.filter(function (p) { return !p.inactive; });
|
|
33639
|
+
}
|
|
33640
|
+
this._value = tmpDataSource.map(function (q) { return q.value; });
|
|
33641
|
+
}
|
|
33637
33642
|
}
|
|
33638
33643
|
else if (this.control.selectDescendant) {
|
|
33639
33644
|
var parentIds_1 = [event.itemValue[this.control.valueField]];
|
|
@@ -40337,7 +40342,6 @@
|
|
|
40337
40342
|
_this.entityName = 'DM_ChucVu';
|
|
40338
40343
|
_this.endPoint = _moduleConfigService.getConfig().environment.apiDomain.canboEndpoint;
|
|
40339
40344
|
_this._moduleConfig = _moduleConfigService.getConfig();
|
|
40340
|
-
_this.fieldSuDung = 'trangThai';
|
|
40341
40345
|
return _this;
|
|
40342
40346
|
}
|
|
40343
40347
|
return DmChucVuService;
|
|
@@ -43844,26 +43848,28 @@
|
|
|
43844
43848
|
};
|
|
43845
43849
|
AutoCompletePickerComponent.prototype.buildFilterKeyword = function () {
|
|
43846
43850
|
var _this = this;
|
|
43851
|
+
var _a;
|
|
43852
|
+
var operator = (_a = this.control.operatorFieldSearchText) !== null && _a !== void 0 ? _a : exports.Operator.contain;
|
|
43847
43853
|
if (this.fieldSearchText.length == 1) {
|
|
43848
|
-
this.getFilterOnSearch = function (value) { return _this.newFilter(_this.control.displayField,
|
|
43854
|
+
this.getFilterOnSearch = function (value) { return _this.newFilter(_this.control.displayField, operator, value); };
|
|
43849
43855
|
}
|
|
43850
43856
|
else {
|
|
43851
43857
|
this.getFilterOnSearch = function (value) {
|
|
43852
|
-
var e_1,
|
|
43858
|
+
var e_1, _b;
|
|
43853
43859
|
var result = new Filter({
|
|
43854
43860
|
logic: 'or',
|
|
43855
43861
|
filters: []
|
|
43856
43862
|
});
|
|
43857
43863
|
try {
|
|
43858
|
-
for (var
|
|
43859
|
-
var fieldSearch =
|
|
43860
|
-
result.filters.push(_this.newFilter(fieldSearch,
|
|
43864
|
+
for (var _c = __values(_this.fieldSearchText), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
43865
|
+
var fieldSearch = _d.value;
|
|
43866
|
+
result.filters.push(_this.newFilter(fieldSearch, operator, value));
|
|
43861
43867
|
}
|
|
43862
43868
|
}
|
|
43863
43869
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
43864
43870
|
finally {
|
|
43865
43871
|
try {
|
|
43866
|
-
if (
|
|
43872
|
+
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
43867
43873
|
}
|
|
43868
43874
|
finally { if (e_1) throw e_1.error; }
|
|
43869
43875
|
}
|
|
@@ -43925,14 +43931,14 @@
|
|
|
43925
43931
|
};
|
|
43926
43932
|
AutoCompletePickerComponent.prototype.showPickForm = function () {
|
|
43927
43933
|
return __awaiter(this, void 0, void 0, function () {
|
|
43928
|
-
return __generator(this, function (
|
|
43929
|
-
switch (
|
|
43934
|
+
return __generator(this, function (_b) {
|
|
43935
|
+
switch (_b.label) {
|
|
43930
43936
|
case 0:
|
|
43931
43937
|
if (!this.control.modifyInitSearchData) return [3 /*break*/, 2];
|
|
43932
43938
|
return [4 /*yield*/, this.control.modifyInitSearchData(this)];
|
|
43933
43939
|
case 1:
|
|
43934
|
-
|
|
43935
|
-
|
|
43940
|
+
_b.sent();
|
|
43941
|
+
_b.label = 2;
|
|
43936
43942
|
case 2:
|
|
43937
43943
|
this.dirty = false;
|
|
43938
43944
|
this.showFormPicker = true;
|
|
@@ -43944,8 +43950,8 @@
|
|
|
43944
43950
|
AutoCompletePickerComponent.prototype.getData = function () {
|
|
43945
43951
|
return __awaiter(this, void 0, void 0, function () {
|
|
43946
43952
|
var filters, allow, dataSource;
|
|
43947
|
-
return __generator(this, function (
|
|
43948
|
-
switch (
|
|
43953
|
+
return __generator(this, function (_b) {
|
|
43954
|
+
switch (_b.label) {
|
|
43949
43955
|
case 0:
|
|
43950
43956
|
filters = [];
|
|
43951
43957
|
if (this.control.multiple) {
|
|
@@ -43960,22 +43966,22 @@
|
|
|
43960
43966
|
}
|
|
43961
43967
|
return [4 /*yield*/, appendDefaultFilter(filters, this.control.defaultFilters)];
|
|
43962
43968
|
case 1:
|
|
43963
|
-
|
|
43969
|
+
_b.sent();
|
|
43964
43970
|
if (this.keyword && this.keyword.length > 0) {
|
|
43965
43971
|
filters.push(this.getFilterOnSearch(this.keyword));
|
|
43966
43972
|
}
|
|
43967
43973
|
if (!this.control.modifyFilter) return [3 /*break*/, 3];
|
|
43968
43974
|
return [4 /*yield*/, this.control.modifyFilter(filters, this, this.currentNode)];
|
|
43969
43975
|
case 2:
|
|
43970
|
-
allow =
|
|
43976
|
+
allow = _b.sent();
|
|
43971
43977
|
if (allow === false) {
|
|
43972
43978
|
this.results = [];
|
|
43973
43979
|
return [2 /*return*/];
|
|
43974
43980
|
}
|
|
43975
|
-
|
|
43981
|
+
_b.label = 3;
|
|
43976
43982
|
case 3: return [4 /*yield*/, this.control.baseService.getDataDropdownByFilter(filters, this.getDropdownOptions())];
|
|
43977
43983
|
case 4:
|
|
43978
|
-
dataSource =
|
|
43984
|
+
dataSource = _b.sent();
|
|
43979
43985
|
this.fireEventAfterGetDataDropDown(dataSource);
|
|
43980
43986
|
this.reStructureDataSource(dataSource);
|
|
43981
43987
|
this.results = this.dataSource;
|
|
@@ -44167,8 +44173,8 @@
|
|
|
44167
44173
|
AutoCompletePickerComponent.prototype.handleHide = function (evt) {
|
|
44168
44174
|
return __awaiter(this, void 0, void 0, function () {
|
|
44169
44175
|
var dataSource, dataSource;
|
|
44170
|
-
return __generator(this, function (
|
|
44171
|
-
switch (
|
|
44176
|
+
return __generator(this, function (_b) {
|
|
44177
|
+
switch (_b.label) {
|
|
44172
44178
|
case 0:
|
|
44173
44179
|
this.showFormPicker = false;
|
|
44174
44180
|
if (!this.dirty) return [3 /*break*/, 7];
|
|
@@ -44179,9 +44185,9 @@
|
|
|
44179
44185
|
this.newFilter(this.control.valueField, exports.Operator.in, this.value)
|
|
44180
44186
|
], this.getDropdownOptions(this.value.length))];
|
|
44181
44187
|
case 1:
|
|
44182
|
-
dataSource =
|
|
44188
|
+
dataSource = _b.sent();
|
|
44183
44189
|
this.fireEventAfterGetDataDropDown(dataSource);
|
|
44184
|
-
|
|
44190
|
+
_b.label = 2;
|
|
44185
44191
|
case 2:
|
|
44186
44192
|
this.reStructureDataSource(dataSource);
|
|
44187
44193
|
this.selectedValueObject = this.dataSource;
|
|
@@ -44193,9 +44199,9 @@
|
|
|
44193
44199
|
this.newFilter(this.control.valueField, exports.Operator.equal, this.value)
|
|
44194
44200
|
], this.getDropdownOptions(1))];
|
|
44195
44201
|
case 4:
|
|
44196
|
-
dataSource =
|
|
44202
|
+
dataSource = _b.sent();
|
|
44197
44203
|
this.fireEventAfterGetDataDropDown(dataSource);
|
|
44198
|
-
|
|
44204
|
+
_b.label = 5;
|
|
44199
44205
|
case 5:
|
|
44200
44206
|
this.reStructureDataSource(dataSource);
|
|
44201
44207
|
if (this.dataSource.length > 0) {
|
|
@@ -44204,10 +44210,10 @@
|
|
|
44204
44210
|
else {
|
|
44205
44211
|
this.selectedValueObject = null;
|
|
44206
44212
|
}
|
|
44207
|
-
|
|
44213
|
+
_b.label = 6;
|
|
44208
44214
|
case 6:
|
|
44209
44215
|
this.updateSelectedValue();
|
|
44210
|
-
|
|
44216
|
+
_b.label = 7;
|
|
44211
44217
|
case 7: return [2 /*return*/];
|
|
44212
44218
|
}
|
|
44213
44219
|
});
|
|
@@ -44225,7 +44231,7 @@
|
|
|
44225
44231
|
}
|
|
44226
44232
|
};
|
|
44227
44233
|
AutoCompletePickerComponent.prototype.reStructureDataSource = function (sources) {
|
|
44228
|
-
var e_2,
|
|
44234
|
+
var e_2, _b;
|
|
44229
44235
|
if (sources != null && sources.length > 0) {
|
|
44230
44236
|
var arr = [];
|
|
44231
44237
|
try {
|
|
@@ -44238,7 +44244,7 @@
|
|
|
44238
44244
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
44239
44245
|
finally {
|
|
44240
44246
|
try {
|
|
44241
|
-
if (sources_1_1 && !sources_1_1.done && (
|
|
44247
|
+
if (sources_1_1 && !sources_1_1.done && (_b = sources_1.return)) _b.call(sources_1);
|
|
44242
44248
|
}
|
|
44243
44249
|
finally { if (e_2) throw e_2.error; }
|
|
44244
44250
|
}
|
|
@@ -44264,8 +44270,8 @@
|
|
|
44264
44270
|
return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
44265
44271
|
var filters;
|
|
44266
44272
|
var _this = this;
|
|
44267
|
-
return __generator(this, function (
|
|
44268
|
-
switch (
|
|
44273
|
+
return __generator(this, function (_b) {
|
|
44274
|
+
switch (_b.label) {
|
|
44269
44275
|
case 0:
|
|
44270
44276
|
if (!this.control.multiple) return [3 /*break*/, 4];
|
|
44271
44277
|
if (!(obj != null && obj.length > 0)) return [3 /*break*/, 2];
|
|
@@ -44273,7 +44279,7 @@
|
|
|
44273
44279
|
filters.push(this.newFilter(this.control.valueField, exports.Operator.in, obj));
|
|
44274
44280
|
return [4 /*yield*/, appendDefaultFilter(filters, this.control.defaultFilters)];
|
|
44275
44281
|
case 1:
|
|
44276
|
-
|
|
44282
|
+
_b.sent();
|
|
44277
44283
|
this.control.baseService.getDataDropdownByFilter(filters, this.getDropdownOptions(obj.length)).then(function (res) {
|
|
44278
44284
|
_this.fireEventAfterGetDataDropDown(res);
|
|
44279
44285
|
_this.reStructureDataSource(res);
|
|
@@ -44286,7 +44292,7 @@
|
|
|
44286
44292
|
this.results = [];
|
|
44287
44293
|
this.selectedValueObject = [];
|
|
44288
44294
|
resolve(this.selectedValueObject);
|
|
44289
|
-
|
|
44295
|
+
_b.label = 3;
|
|
44290
44296
|
case 3: return [3 /*break*/, 5];
|
|
44291
44297
|
case 4:
|
|
44292
44298
|
if (obj != null) {
|
|
@@ -44308,7 +44314,7 @@
|
|
|
44308
44314
|
this.selectedValueObject = null;
|
|
44309
44315
|
resolve(this.selectedValueObject);
|
|
44310
44316
|
}
|
|
44311
|
-
|
|
44317
|
+
_b.label = 5;
|
|
44312
44318
|
case 5: return [2 /*return*/];
|
|
44313
44319
|
}
|
|
44314
44320
|
});
|
|
@@ -45991,6 +45997,7 @@
|
|
|
45991
45997
|
funcSetValueRow: column.funcSetValueRow,
|
|
45992
45998
|
dataSource: column.dataSource,
|
|
45993
45999
|
groupCode: column.groupCode,
|
|
46000
|
+
isOverrideFilter: column.isOverrideFilter,
|
|
45994
46001
|
order: column.order
|
|
45995
46002
|
});
|
|
45996
46003
|
if (column.dataType == 'custom') {
|
|
@@ -46246,6 +46253,7 @@
|
|
|
46246
46253
|
funcSetValueRow: column.funcSetValueRow,
|
|
46247
46254
|
dataSource: column.dataSource,
|
|
46248
46255
|
groupCode: column.groupCode,
|
|
46256
|
+
isOverrideFilter: column.isOverrideFilter,
|
|
46249
46257
|
order: column.order
|
|
46250
46258
|
});
|
|
46251
46259
|
if (column.dataType == 'custom') {
|