tnx-shared 5.1.298 → 5.1.301
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 +22 -12
- 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/validators.d.ts +6 -1
- package/classes/base/validators.d.ts.map +1 -1
- package/classes/form-schema.d.ts.map +1 -1
- package/components/crud/crud-form/crud-form.component.d.ts +2 -1
- package/components/crud/crud-form/crud-form.component.d.ts.map +1 -1
- package/components/crud/crud-list/crud-list.component.d.ts.map +1 -1
- package/esm2015/classes/base/validators.js +17 -6
- package/esm2015/classes/form-schema.js +2 -2
- package/esm2015/components/crud/crud-form/crud-form.component.js +4 -4
- package/esm2015/components/crud/crud-list/crud-list.component.js +3 -2
- package/fesm2015/tnx-shared.js +22 -10
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
- package/tnx-shared.metadata.json +1 -1
|
@@ -720,7 +720,7 @@
|
|
|
720
720
|
this.hiddenTrinhKy = true;
|
|
721
721
|
this.useBaseTrinhKy = true;
|
|
722
722
|
this.disableShare = false;
|
|
723
|
-
this.disableViewWorkflowAttach =
|
|
723
|
+
this.disableViewWorkflowAttach = false;
|
|
724
724
|
this.hiddenWorkflowCoreStatus = true;
|
|
725
725
|
this.requiredVanBanDiAfterTrinhKy = false;
|
|
726
726
|
this.showExportAll = false;
|
|
@@ -13599,7 +13599,8 @@
|
|
|
13599
13599
|
* Kiểm tra giá trị một cột đã tồn tại trong db.
|
|
13600
13600
|
*/
|
|
13601
13601
|
var CheckDuplicateValidator = /** @class */ (function () {
|
|
13602
|
-
function CheckDuplicateValidator() {
|
|
13602
|
+
function CheckDuplicateValidator(defaultFilters) {
|
|
13603
|
+
this._defaultFilters = defaultFilters;
|
|
13603
13604
|
}
|
|
13604
13605
|
CheckDuplicateValidator.prototype.setBaseService = function (baseService) {
|
|
13605
13606
|
this._baseService = baseService;
|
|
@@ -13617,13 +13618,11 @@
|
|
|
13617
13618
|
this._label = event.currentNode.control.label;
|
|
13618
13619
|
}
|
|
13619
13620
|
this._value = event.currentNode.value.toString();
|
|
13620
|
-
filters = [
|
|
13621
|
-
{
|
|
13621
|
+
filters = [{
|
|
13622
13622
|
field: event.currentNode.control.field,
|
|
13623
13623
|
operator: exports.Operator.equal,
|
|
13624
13624
|
value: JSON.stringify(event.currentNode.value)
|
|
13625
|
-
}
|
|
13626
|
-
];
|
|
13625
|
+
}];
|
|
13627
13626
|
if (event.rootModel.id) {
|
|
13628
13627
|
filters.unshift({
|
|
13629
13628
|
field: 'id',
|
|
@@ -13631,6 +13630,9 @@
|
|
|
13631
13630
|
value: JSON.stringify(event.rootModel.id)
|
|
13632
13631
|
});
|
|
13633
13632
|
}
|
|
13633
|
+
if (this._defaultFilters) {
|
|
13634
|
+
filters.push.apply(filters, __spread(this._defaultFilters));
|
|
13635
|
+
}
|
|
13634
13636
|
return [4 /*yield*/, this._baseService.checkExistByFilter(filters)];
|
|
13635
13637
|
case 1:
|
|
13636
13638
|
resultCheckExist = _b.sent();
|
|
@@ -13651,12 +13653,13 @@
|
|
|
13651
13653
|
* Kiểm tra bộ gái trị của nhiều cột đã tồn tại trong db.
|
|
13652
13654
|
*/
|
|
13653
13655
|
var CheckDuplicateFieldsValidator = /** @class */ (function () {
|
|
13654
|
-
function CheckDuplicateFieldsValidator(duplicateFields, message) {
|
|
13656
|
+
function CheckDuplicateFieldsValidator(duplicateFields, message, defaultFilters) {
|
|
13655
13657
|
this._dicValue = {};
|
|
13656
13658
|
this._duplicateFields = duplicateFields;
|
|
13657
13659
|
if (this._duplicateFields.length == 0)
|
|
13658
13660
|
alert('Cấu hình CheckDuplicateFieldsValidator sai');
|
|
13659
13661
|
this._message = message;
|
|
13662
|
+
this._defaultFilters = defaultFilters;
|
|
13660
13663
|
}
|
|
13661
13664
|
CheckDuplicateFieldsValidator.prototype.setBaseService = function (baseService) {
|
|
13662
13665
|
this._baseService = baseService;
|
|
@@ -13664,6 +13667,9 @@
|
|
|
13664
13667
|
CheckDuplicateFieldsValidator.prototype.getDuplicateFields = function () {
|
|
13665
13668
|
return this._duplicateFields;
|
|
13666
13669
|
};
|
|
13670
|
+
CheckDuplicateFieldsValidator.prototype.getDefaultFilters = function () {
|
|
13671
|
+
return this._defaultFilters;
|
|
13672
|
+
};
|
|
13667
13673
|
CheckDuplicateFieldsValidator.prototype.getMessage = function () {
|
|
13668
13674
|
var reg = new RegExp('(?<={{)[^}]+(?=})', 'g');
|
|
13669
13675
|
var result = this._message.match(reg);
|
|
@@ -13733,6 +13739,9 @@
|
|
|
13733
13739
|
value: JSON.stringify(event.rootModel.id)
|
|
13734
13740
|
});
|
|
13735
13741
|
}
|
|
13742
|
+
if (this._defaultFilters) {
|
|
13743
|
+
filters.push.apply(filters, __spread(this._defaultFilters));
|
|
13744
|
+
}
|
|
13736
13745
|
return [4 /*yield*/, this._baseService.checkExistByFilter(filters)];
|
|
13737
13746
|
case 1:
|
|
13738
13747
|
resultCheckExist = _c.sent();
|
|
@@ -15083,7 +15092,7 @@
|
|
|
15083
15092
|
}
|
|
15084
15093
|
else if (validator instanceof CheckDuplicateFieldsValidator) {
|
|
15085
15094
|
validator.setBaseService(_this.setting.baseService);
|
|
15086
|
-
_this.createValidatorCheckDuplicate(schema, validator.getDuplicateFields(), validator.getMessage());
|
|
15095
|
+
_this.createValidatorCheckDuplicate(schema, validator.getDuplicateFields(), validator.getMessage(), validator.getDefaultFilters());
|
|
15087
15096
|
}
|
|
15088
15097
|
else if (validator instanceof RequiredFieldsValidator) {
|
|
15089
15098
|
_this.createValidatorRequireds(schema, validator.getRequiredFields(), validator.getMessage());
|
|
@@ -15120,7 +15129,7 @@
|
|
|
15120
15129
|
}
|
|
15121
15130
|
}
|
|
15122
15131
|
};
|
|
15123
|
-
CrudFormComponent.prototype.createValidatorCheckDuplicate = function (schema, fieldOther, message) {
|
|
15132
|
+
CrudFormComponent.prototype.createValidatorCheckDuplicate = function (schema, fieldOther, message, defaultFilters) {
|
|
15124
15133
|
var _this = this;
|
|
15125
15134
|
if (fieldOther.indexOf(schema.uniqueField) > -1) {
|
|
15126
15135
|
this._notifierService.showWarning('Schema cấu hình bị lỗi');
|
|
@@ -15132,7 +15141,7 @@
|
|
|
15132
15141
|
var tmpFields = fields_1.filter(function (p) { return p != schemaOther.field; });
|
|
15133
15142
|
if (!schemaOther.validators.some(function (p) { return p instanceof CheckDuplicateFieldsValidator
|
|
15134
15143
|
&& _this._commonService.isSameArray(tmpFields, p.getDuplicateFields()); })) {
|
|
15135
|
-
var _validator = new CheckDuplicateFieldsValidator(tmpFields, message);
|
|
15144
|
+
var _validator = new CheckDuplicateFieldsValidator(tmpFields, message, defaultFilters);
|
|
15136
15145
|
_validator.setBaseService(_this.setting.baseService);
|
|
15137
15146
|
schemaOther.validators.push(_validator);
|
|
15138
15147
|
}
|
|
@@ -20986,7 +20995,7 @@
|
|
|
20986
20995
|
};
|
|
20987
20996
|
CrudListComponent.prototype.showContextMenu = function (evt, rowData) {
|
|
20988
20997
|
return __awaiter(this, void 0, void 0, function () {
|
|
20989
|
-
var _b;
|
|
20998
|
+
var _b, showWorkflowAttach;
|
|
20990
20999
|
return __generator(this, function (_c) {
|
|
20991
21000
|
switch (_c.label) {
|
|
20992
21001
|
case 0:
|
|
@@ -20998,7 +21007,8 @@
|
|
|
20998
21007
|
if (!this.setting.disableShare) {
|
|
20999
21008
|
this.buttonContexts.push({ label: 'Chia sẻ', icon: 'pi pi-link', command: this.createShareLink.bind(this) }, { label: 'Danh sách chia sẻ', icon: 'pi pi-list', command: this.showLinkSharing.bind(this) });
|
|
21000
21009
|
}
|
|
21001
|
-
|
|
21010
|
+
showWorkflowAttach = localStorage.getItem('__showWorkflowAttach');
|
|
21011
|
+
if (showWorkflowAttach == 'true') {
|
|
21002
21012
|
this.buttonContexts.push({ label: 'Danh sách công việc', icon: 'pi pi-list', command: this.showAttachedTask.bind(this) });
|
|
21003
21013
|
}
|
|
21004
21014
|
if (this.buttonContexts.length > 0) {
|