tnx-shared 5.1.401 → 5.1.404
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 +220 -89
- 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/component-base.d.ts +11 -2
- package/classes/base/component-base.d.ts.map +1 -1
- package/classes/base/data-form-base.d.ts +2 -1
- package/classes/base/data-form-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/add-news/add-news.component.d.ts.map +1 -1
- package/components/autocomplete-picker/autocomplete-picker.component.d.ts +1 -1
- package/components/autocomplete-picker/autocomplete-picker.component.d.ts.map +1 -1
- package/components/check-box-list/check-box-list.component.d.ts.map +1 -1
- package/components/crud/crud-form/crud-form.component.d.ts +7 -3
- package/components/crud/crud-form/crud-form.component.d.ts.map +1 -1
- package/components/file-explorer/file-picker-dialog/file-picker-dialog.component.d.ts.map +1 -1
- package/components/file-explorer/file-picker-dialog/file-picker-dialog.component.scss.shim.ngstyle.d.ts.map +1 -0
- package/components/file-explorer/services/file-object.service.d.ts +2 -0
- package/components/file-explorer/services/file-object.service.d.ts.map +1 -1
- package/components/radio-button-list/radio-button-list.component.d.ts.map +1 -1
- package/components/tn-app-notification/tn-app-notification.component.d.ts +1 -1
- package/components/tn-app-notification/tn-app-notification.component.d.ts.map +1 -1
- package/components/workflow/process-workflow-form/process-workflow-form.component.d.ts +0 -1
- package/components/workflow/process-workflow-form/process-workflow-form.component.d.ts.map +1 -1
- package/configs/component-context.constant.d.ts.map +1 -1
- package/esm2015/classes/base/component-base.js +50 -5
- package/esm2015/classes/base/data-form-base.js +6 -2
- package/esm2015/classes/form-schema.js +1 -1
- package/esm2015/components/add-news/add-news.component.js +2 -1
- package/esm2015/components/autocomplete-picker/autocomplete-picker.component.js +13 -9
- package/esm2015/components/check-box-list/check-box-list.component.js +18 -22
- package/esm2015/components/crud/crud-form/crud-form.component.js +52 -18
- package/esm2015/components/file-explorer/file-picker-dialog/file-picker-dialog.component.js +5 -3
- package/esm2015/components/file-explorer/services/file-object.service.js +7 -1
- package/esm2015/components/radio-button-list/radio-button-list.component.js +1 -1
- package/esm2015/components/tn-app-notification/tn-app-notification.component.js +31 -19
- package/esm2015/components/workflow/process-workflow-form/process-workflow-form.component.js +10 -19
- package/esm2015/configs/component-context.constant.js +1 -1
- package/esm2015/services/notification.service.js +17 -1
- package/fesm2015/tnx-shared.js +197 -86
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
- package/services/notification.service.d.ts +5 -1
- package/services/notification.service.d.ts.map +1 -1
- package/tnx-shared.metadata.json +1 -1
- package/components/file-explorer/file-picker-dialog/file-picker-dialog.component.css.shim.ngstyle.d.ts.map +0 -1
|
@@ -9189,8 +9189,8 @@
|
|
|
9189
9189
|
});
|
|
9190
9190
|
;
|
|
9191
9191
|
/**
|
|
9192
|
-
|
|
9193
|
-
|
|
9192
|
+
* On destroy
|
|
9193
|
+
*/
|
|
9194
9194
|
ComponentBase.prototype.ngOnDestroy = function () {
|
|
9195
9195
|
var e_1, _a;
|
|
9196
9196
|
// Unsubscribe from all subscriptions
|
|
@@ -9363,6 +9363,54 @@
|
|
|
9363
9363
|
show: false
|
|
9364
9364
|
});
|
|
9365
9365
|
};
|
|
9366
|
+
ComponentBase.prototype.addDistinct = function (lst, value) {
|
|
9367
|
+
if (lst.indexOf(value) == -1) {
|
|
9368
|
+
lst.push(value);
|
|
9369
|
+
}
|
|
9370
|
+
};
|
|
9371
|
+
ComponentBase.prototype.addDistinctList = function (lst, lstValue) {
|
|
9372
|
+
if (!lstValue || !lstValue.length)
|
|
9373
|
+
return;
|
|
9374
|
+
lstValue.forEach(function (value) {
|
|
9375
|
+
if (lst.indexOf(value) == -1) {
|
|
9376
|
+
lst.push(value);
|
|
9377
|
+
}
|
|
9378
|
+
});
|
|
9379
|
+
};
|
|
9380
|
+
/**
|
|
9381
|
+
* Convert 1 array => N array
|
|
9382
|
+
* @param lst Mảng phần tử
|
|
9383
|
+
* @param fields Mảng các field, nếu field là kiểu array thì nghĩa là mún map distinct
|
|
9384
|
+
* @returns N Array
|
|
9385
|
+
*/
|
|
9386
|
+
ComponentBase.prototype.multipleMap = function (lst) {
|
|
9387
|
+
var _this = this;
|
|
9388
|
+
var fields = [];
|
|
9389
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
9390
|
+
fields[_i - 1] = arguments[_i];
|
|
9391
|
+
}
|
|
9392
|
+
var result = [];
|
|
9393
|
+
var funcs = [];
|
|
9394
|
+
var rawFields = [];
|
|
9395
|
+
var _push = function (lst, value) { return lst.push(value); };
|
|
9396
|
+
fields.forEach(function (field) {
|
|
9397
|
+
result.push([]);
|
|
9398
|
+
if (Array.isArray(field)) {
|
|
9399
|
+
funcs.push(_this.addDistinct);
|
|
9400
|
+
rawFields.push(field[0]);
|
|
9401
|
+
}
|
|
9402
|
+
else {
|
|
9403
|
+
funcs.push(_push);
|
|
9404
|
+
rawFields.push(field);
|
|
9405
|
+
}
|
|
9406
|
+
});
|
|
9407
|
+
lst.forEach(function (item) {
|
|
9408
|
+
rawFields.forEach(function (field, index) {
|
|
9409
|
+
funcs[index](result[index], item[field]);
|
|
9410
|
+
});
|
|
9411
|
+
});
|
|
9412
|
+
return result;
|
|
9413
|
+
};
|
|
9366
9414
|
ComponentBase.prototype._printPdf = function (baseService, id, rowData) {
|
|
9367
9415
|
return __awaiter(this, void 0, void 0, function () {
|
|
9368
9416
|
var itemDetail, data;
|
|
@@ -9613,10 +9661,12 @@
|
|
|
9613
9661
|
value_2 = this_1._getValueFromDatasource(itemSelected, schema.multiple, tmpSchema.funcGetLabel);
|
|
9614
9662
|
}
|
|
9615
9663
|
else if (schema instanceof CheckboxControlSchema || schema instanceof SwitchControlSchema) {
|
|
9616
|
-
if (!value_2)
|
|
9664
|
+
if (!value_2) {
|
|
9617
9665
|
value_2 = 'Không';
|
|
9618
|
-
|
|
9666
|
+
}
|
|
9667
|
+
else {
|
|
9619
9668
|
value_2 = 'Có';
|
|
9669
|
+
}
|
|
9620
9670
|
}
|
|
9621
9671
|
_b.label = 19;
|
|
9622
9672
|
case 19:
|
|
@@ -13036,7 +13086,7 @@
|
|
|
13036
13086
|
_this.eventType = exports.EventType;
|
|
13037
13087
|
// Doc tu cau hinh tham so he thong
|
|
13038
13088
|
_this.limitSize = 0;
|
|
13039
|
-
_this.formControls =
|
|
13089
|
+
_this.formControls = {};
|
|
13040
13090
|
_this.funcCheckUniqueField = {};
|
|
13041
13091
|
_this.beforeData = {};
|
|
13042
13092
|
_this.cachedValues = {};
|
|
@@ -14262,18 +14312,22 @@
|
|
|
14262
14312
|
for (var field in model) {
|
|
14263
14313
|
if (field != '_errors' && field != '_status' && field != '_source') {
|
|
14264
14314
|
var subUniqueKeyControl = void 0;
|
|
14265
|
-
if (uniqueKeyControl != null && uniqueKeyControl !== '')
|
|
14315
|
+
if (uniqueKeyControl != null && uniqueKeyControl !== '') {
|
|
14266
14316
|
subUniqueKeyControl = uniqueKeyControl + '.' + field;
|
|
14267
|
-
|
|
14317
|
+
}
|
|
14318
|
+
else {
|
|
14268
14319
|
subUniqueKeyControl = field;
|
|
14320
|
+
}
|
|
14269
14321
|
var control = this.formControls[subUniqueKeyControl];
|
|
14270
14322
|
if (!control)
|
|
14271
14323
|
continue;
|
|
14272
14324
|
var subPath = void 0;
|
|
14273
|
-
if (path != null && path !== '')
|
|
14325
|
+
if (path != null && path !== '') {
|
|
14274
14326
|
subPath = path + '.' + field;
|
|
14275
|
-
|
|
14327
|
+
}
|
|
14328
|
+
else {
|
|
14276
14329
|
subPath = field;
|
|
14330
|
+
}
|
|
14277
14331
|
var subModel = model[field];
|
|
14278
14332
|
if (subModel instanceof Array) {
|
|
14279
14333
|
var index = 0;
|
|
@@ -15853,6 +15907,13 @@
|
|
|
15853
15907
|
ControlTreeNode.prototype.setCrudForm = function (crudForm) {
|
|
15854
15908
|
this._crudForm = crudForm;
|
|
15855
15909
|
};
|
|
15910
|
+
Object.defineProperty(ControlTreeNode.prototype, "crudForm", {
|
|
15911
|
+
get: function () {
|
|
15912
|
+
return this.rootNode._crudForm;
|
|
15913
|
+
},
|
|
15914
|
+
enumerable: false,
|
|
15915
|
+
configurable: true
|
|
15916
|
+
});
|
|
15856
15917
|
Object.defineProperty(ControlTreeNode.prototype, "parentModel", {
|
|
15857
15918
|
get: function () {
|
|
15858
15919
|
if (this.parentNode)
|
|
@@ -15882,32 +15943,40 @@
|
|
|
15882
15943
|
});
|
|
15883
15944
|
Object.defineProperty(ControlTreeNode.prototype, "model", {
|
|
15884
15945
|
get: function () {
|
|
15885
|
-
if (this.parentNode)
|
|
15946
|
+
if (this.parentNode) {
|
|
15886
15947
|
return this.parentNode.data[this.field];
|
|
15887
|
-
|
|
15948
|
+
}
|
|
15949
|
+
else {
|
|
15888
15950
|
return this.data;
|
|
15951
|
+
}
|
|
15889
15952
|
},
|
|
15890
15953
|
set: function (val) {
|
|
15891
|
-
if (this.parentNode)
|
|
15954
|
+
if (this.parentNode) {
|
|
15892
15955
|
this.parentNode.data[this.field] = val;
|
|
15893
|
-
|
|
15956
|
+
}
|
|
15957
|
+
else {
|
|
15894
15958
|
this.data = val;
|
|
15959
|
+
}
|
|
15895
15960
|
},
|
|
15896
15961
|
enumerable: false,
|
|
15897
15962
|
configurable: true
|
|
15898
15963
|
});
|
|
15899
15964
|
Object.defineProperty(ControlTreeNode.prototype, "value", {
|
|
15900
15965
|
get: function () {
|
|
15901
|
-
if (this.parentNode)
|
|
15966
|
+
if (this.parentNode) {
|
|
15902
15967
|
return this.parentNode.data[this.field];
|
|
15903
|
-
|
|
15968
|
+
}
|
|
15969
|
+
else {
|
|
15904
15970
|
return this.data;
|
|
15971
|
+
}
|
|
15905
15972
|
},
|
|
15906
15973
|
set: function (val) {
|
|
15907
|
-
if (this.parentNode)
|
|
15974
|
+
if (this.parentNode) {
|
|
15908
15975
|
this.parentNode.data[this.field] = val;
|
|
15909
|
-
|
|
15976
|
+
}
|
|
15977
|
+
else {
|
|
15910
15978
|
this.data = val;
|
|
15979
|
+
}
|
|
15911
15980
|
},
|
|
15912
15981
|
enumerable: false,
|
|
15913
15982
|
configurable: true
|
|
@@ -15974,8 +16043,9 @@
|
|
|
15974
16043
|
};
|
|
15975
16044
|
ControlTreeNode.prototype.findInTree = function (node, modelPath) {
|
|
15976
16045
|
var e_33, _d;
|
|
15977
|
-
if (node.modelPath != null && node.modelPath.toLowerCase() == modelPath.toLowerCase())
|
|
16046
|
+
if (node.modelPath != null && node.modelPath.toLowerCase() == modelPath.toLowerCase()) {
|
|
15978
16047
|
return node;
|
|
16048
|
+
}
|
|
15979
16049
|
else {
|
|
15980
16050
|
try {
|
|
15981
16051
|
for (var _e = __values(node.childNodes), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
@@ -15999,8 +16069,9 @@
|
|
|
15999
16069
|
};
|
|
16000
16070
|
ControlTreeNode.prototype.findSchemaInTree = function (node, schemaPath) {
|
|
16001
16071
|
var e_34, _d;
|
|
16002
|
-
if (node.schemaPath != null && node.schemaPath.toLowerCase() == schemaPath.toLowerCase())
|
|
16072
|
+
if (node.schemaPath != null && node.schemaPath.toLowerCase() == schemaPath.toLowerCase()) {
|
|
16003
16073
|
return node;
|
|
16074
|
+
}
|
|
16004
16075
|
else {
|
|
16005
16076
|
try {
|
|
16006
16077
|
for (var _e = __values(node.childNodes), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
@@ -16028,12 +16099,29 @@
|
|
|
16028
16099
|
tableNode.model = [];
|
|
16029
16100
|
}
|
|
16030
16101
|
tableNode.model.splice(0, tableNode.model.length);
|
|
16102
|
+
tableNode.setDataSourceInternal(dataSource);
|
|
16103
|
+
};
|
|
16104
|
+
ControlTreeNode.prototype.setDataSourceInternal = function (dataSource) {
|
|
16105
|
+
if (!(this.control instanceof TableSchema))
|
|
16106
|
+
return;
|
|
16031
16107
|
if (dataSource.length == 0) {
|
|
16032
|
-
|
|
16108
|
+
this.reinitChildNodes();
|
|
16033
16109
|
return;
|
|
16034
16110
|
}
|
|
16035
16111
|
for (var i = 0; i < dataSource.length; i++) {
|
|
16036
|
-
this.rootNode._crudForm.addNewRow(
|
|
16112
|
+
this.rootNode._crudForm.addNewRow(this.control, this.modelPath, null, true, dataSource[i], i == dataSource.length - 1);
|
|
16113
|
+
}
|
|
16114
|
+
};
|
|
16115
|
+
ControlTreeNode.prototype.setValue = function (value) {
|
|
16116
|
+
if (this.control instanceof TableSchema) {
|
|
16117
|
+
this.setDataSourceInternal(value);
|
|
16118
|
+
}
|
|
16119
|
+
else if (this.control instanceof ContainerSchema) {
|
|
16120
|
+
this.parentNode.data[this.control.field] = value;
|
|
16121
|
+
this.crudForm.initControlDefaultValue(this.parentNode.data, this.control, this.parentNode.modelPath);
|
|
16122
|
+
}
|
|
16123
|
+
else {
|
|
16124
|
+
this.model = value;
|
|
16037
16125
|
}
|
|
16038
16126
|
};
|
|
16039
16127
|
return ControlTreeNode;
|
|
@@ -17135,7 +17223,11 @@
|
|
|
17135
17223
|
schema.required = false;
|
|
17136
17224
|
};
|
|
17137
17225
|
DataFormBase.prototype._setModelValue = function (field, value) {
|
|
17138
|
-
this.crudForm.
|
|
17226
|
+
var node = this.crudForm._rootNode.getNodeByPath(field);
|
|
17227
|
+
this._setModelValueByNode(node, value);
|
|
17228
|
+
};
|
|
17229
|
+
DataFormBase.prototype._setModelValueByNode = function (node, value) {
|
|
17230
|
+
node.setValue(value);
|
|
17139
17231
|
this.crudForm.fireModelChanged();
|
|
17140
17232
|
};
|
|
17141
17233
|
DataFormBase.prototype.modifyDetailData = function (data) {
|
|
@@ -26599,9 +26691,17 @@
|
|
|
26599
26691
|
function FileObjectService(http, injector, _moduleConfigService) {
|
|
26600
26692
|
var _this = _super.call(this, http, injector, _moduleConfigService.getConfig().environment.apiDomain.fileEndpoint + "/" + _moduleConfigService.getConfig().environment.apiVersion + "/FileObject") || this;
|
|
26601
26693
|
_this._moduleConfigService = _moduleConfigService;
|
|
26694
|
+
_this.thumborEndpoint = '';
|
|
26602
26695
|
_this.endPoint = _moduleConfigService.getConfig().environment.apiDomain.fileEndpoint;
|
|
26696
|
+
_this.thumborEndpoint = _moduleConfigService.getConfig().environment.apiDomain.thumbor;
|
|
26603
26697
|
return _this;
|
|
26604
26698
|
}
|
|
26699
|
+
FileObjectService.prototype.getFileUrlWithThumbor = function (fileId, width, height) {
|
|
26700
|
+
if (width === void 0) { width = 0; }
|
|
26701
|
+
if (height === void 0) { height = 0; }
|
|
26702
|
+
var url = this.thumborEndpoint + "/unsafe/" + width + "x" + height + "/smart/" + this.endPoint + "/v5/FileObject/public/" + fileId + "/download";
|
|
26703
|
+
return url;
|
|
26704
|
+
};
|
|
26605
26705
|
FileObjectService.prototype.copyMultipleFile = function (idsFile, idDesFolder) {
|
|
26606
26706
|
var url = this.serviceUri + "/CopyMultipleFile?parentFolderId=" + idDesFolder;
|
|
26607
26707
|
return this.defaultPost(url, idsFile);
|
|
@@ -34325,7 +34425,9 @@
|
|
|
34325
34425
|
}
|
|
34326
34426
|
}
|
|
34327
34427
|
if (element.extension.toUpperCase() == '.PNG' || element.extension.toUpperCase() == '.JPG' || element.extension.toUpperCase() == '.JPEG') {
|
|
34328
|
-
result = '<div style="width:100%; margin-bottom: 15px;text-align: center;"><img style="display:block; margin:auto;" width="500" src="'
|
|
34428
|
+
result = '<div style="width:100%; margin-bottom: 15px;text-align: center;"><img style="display:block; margin:auto;" width="500" src="'
|
|
34429
|
+
+ this._fileObjectService.getFileUrlWithThumbor(element.id, 1080)
|
|
34430
|
+
+ '" /><p><em>Tiêu đề hình ảnh</em></p></div>';
|
|
34329
34431
|
}
|
|
34330
34432
|
else if (element.extension.toUpperCase() == '.MP3' || element.extension.toUpperCase() == '.WMA' || element.extension.toUpperCase() == '.FLAC' || element.extension.toUpperCase() == '.AAC' || element.extension.toUpperCase() == '.OGG') {
|
|
34331
34433
|
result = '<div style="width:100%; margin-bottom: 15px"><audio style="display: block;margin-left: auto;margin-right: auto;" controls><source src="' + this._fileObjectService.endPoint + '/v5/FileObject/public/' + element.id + '/download" type="audio/mpeg"></audio></div>';
|
|
@@ -34352,7 +34454,7 @@
|
|
|
34352
34454
|
FilePickerDialogComponent.decorators = [
|
|
34353
34455
|
{ type: i0.Component, args: [{
|
|
34354
34456
|
selector: 'file-picker-dialog',
|
|
34355
|
-
template: "<crud-form #crudForm [(data)]=\"model.data\" [setting]=\"setting\" [context]=\"context\" [disableCaching]=\"true\"\r\n (onFormReady)=\"_handleFormReady($event)\">\r\n <ng-template #fileManager let-control=\"control\">\r\n <file-manager serviceCode=\"user\" entity=\"user\" entityKey=\"entityKey\" label=\"My folder\"
|
|
34457
|
+
template: "<crud-form #crudForm [(data)]=\"model.data\" [setting]=\"setting\" [context]=\"context\" [disableCaching]=\"true\"\r\n (onFormReady)=\"_handleFormReady($event)\">\r\n <ng-template #fileManager let-control=\"control\">\r\n <file-manager serviceCode=\"user\" entity=\"user\" [entityKey]=\"entityKey\" label=\"My folder\"\r\n [dataType]=\"model.data.fileType\" (onSelected)=\"selectedFile($event)\"></file-manager>\r\n </ng-template>\r\n</crud-form>\r\n<ng-template #buttonTemplate>\r\n <button type=\"button\" pButton icon=\"pi pi-save\" class=\"p-button-text\" [label]=\"'FORM.SAVE' | translate\"\r\n (click)=\"chooseFiles($event)\"></button>\r\n\r\n <button type=\"button\" pButton icon=\"pi pi-replay\" class=\"p-button-text p-button-secondary\"\r\n [label]=\"'FORM.CANCEL' | translate\" preventTab (click)=\"_handleCancel($event)\"></button>\r\n</ng-template>",
|
|
34356
34458
|
providers: [ComponentContextService],
|
|
34357
34459
|
styles: [""]
|
|
34358
34460
|
},] }
|
|
@@ -38696,25 +38798,16 @@
|
|
|
38696
38798
|
roleIds: (_f = this.action.data.roleViewIds) !== null && _f !== void 0 ? _f : [],
|
|
38697
38799
|
type: exports.EnumProcessWorkflowType.VIEW
|
|
38698
38800
|
};
|
|
38699
|
-
this.
|
|
38700
|
-
this.
|
|
38701
|
-
this.
|
|
38702
|
-
this.
|
|
38703
|
-
this.
|
|
38704
|
-
this.
|
|
38705
|
-
this.
|
|
38706
|
-
this.
|
|
38801
|
+
this.addDistinctList(this.dataAllowEdit.userIds, this.initValueForTargetForm.lstUserId);
|
|
38802
|
+
this.addDistinctList(this.dataAllowEdit.departmentIds, this.initValueForTargetForm.lstDonViId);
|
|
38803
|
+
this.addDistinctList(this.dataAllowEdit.groupIds, this.initValueForTargetForm.lstGroupId);
|
|
38804
|
+
this.addDistinctList(this.dataAllowEdit.roleIds, this.initValueForTargetForm.lstRoleId);
|
|
38805
|
+
this.addDistinctList(this.dataOnlyView.userIds, this.initValueForTargetForm.lstUserViewId);
|
|
38806
|
+
this.addDistinctList(this.dataOnlyView.departmentIds, this.initValueForTargetForm.lstDonViViewId);
|
|
38807
|
+
this.addDistinctList(this.dataOnlyView.groupIds, this.initValueForTargetForm.lstGroupViewId);
|
|
38808
|
+
this.addDistinctList(this.dataOnlyView.roleIds, this.initValueForTargetForm.lstRoleViewId);
|
|
38707
38809
|
this.formReady = true;
|
|
38708
38810
|
};
|
|
38709
|
-
ProcessWorkflowFormComponent.prototype.addDistinct = function (dest, source) {
|
|
38710
|
-
if (!source || !source.length)
|
|
38711
|
-
return;
|
|
38712
|
-
source.forEach(function (item) {
|
|
38713
|
-
if (dest.indexOf(item) == -1) {
|
|
38714
|
-
dest.push(item);
|
|
38715
|
-
}
|
|
38716
|
-
});
|
|
38717
|
-
};
|
|
38718
38811
|
ProcessWorkflowFormComponent.prototype.onFormInitialized = function (evt) {
|
|
38719
38812
|
return __awaiter(this, void 0, void 0, function () {
|
|
38720
38813
|
return __generator(this, function (_g) {
|
|
@@ -42315,6 +42408,22 @@
|
|
|
42315
42408
|
_this.endPoint = _moduleConfigService.getConfig().environment.apiDomain.notificationCRUDEndpoint;
|
|
42316
42409
|
return _this;
|
|
42317
42410
|
}
|
|
42411
|
+
NotificationService.prototype.getAllUserReadNotification = function () {
|
|
42412
|
+
var url = this.serviceUri + "/AllUserReadNotification";
|
|
42413
|
+
return this.defaultGet(url);
|
|
42414
|
+
};
|
|
42415
|
+
NotificationService.prototype.getAllUserNotification = function () {
|
|
42416
|
+
var url = this.serviceUri + "/AllUserNotification";
|
|
42417
|
+
return this.defaultGet(url);
|
|
42418
|
+
};
|
|
42419
|
+
NotificationService.prototype.getReadUserNotification = function (gridInfo) {
|
|
42420
|
+
var url = this.serviceUri + "/UserReadNotification";
|
|
42421
|
+
return this.defaultPost(url, gridInfo);
|
|
42422
|
+
};
|
|
42423
|
+
NotificationService.prototype.getUserNotification = function (gridInfo) {
|
|
42424
|
+
var url = this.serviceUri + "/UserNotification";
|
|
42425
|
+
return this.defaultPost(url, gridInfo);
|
|
42426
|
+
};
|
|
42318
42427
|
NotificationService.prototype.sendNotification = function (data) {
|
|
42319
42428
|
return this.defaultPost(this.serviceUri + "/InsertToManyUser/", data);
|
|
42320
42429
|
};
|
|
@@ -43705,6 +43814,7 @@
|
|
|
43705
43814
|
AddNewsComponent.prototype.modifyGridInfo = function (gridInfo) {
|
|
43706
43815
|
return __awaiter(this, void 0, void 0, function () {
|
|
43707
43816
|
return __generator(this, function (_a) {
|
|
43817
|
+
gridInfo.fields = 'id,name,newsCategoryId,type,articleType,numberView,modified,releaseDate';
|
|
43708
43818
|
gridInfo.filters.splice(0, 0, this.newFilter('type', exports.Operator.equal, 'NEWS'));
|
|
43709
43819
|
gridInfo.filters.splice(0, 0, this.newFilter('statusView', exports.Operator.equal, ItemStatus.DaXuatBan));
|
|
43710
43820
|
gridInfo.filters.splice(0, 0, this.newFilter('releaseDate', exports.Operator.lowerThanEqual, new Date()));
|
|
@@ -44252,14 +44362,19 @@
|
|
|
44252
44362
|
this._commonService.addDistinct(arrDisplayField, arrField);
|
|
44253
44363
|
return arrField.toString();
|
|
44254
44364
|
};
|
|
44255
|
-
AutoCompletePickerComponent.prototype.getDropdownOptions = function () {
|
|
44256
|
-
|
|
44365
|
+
AutoCompletePickerComponent.prototype.getDropdownOptions = function (pageSize) {
|
|
44366
|
+
if (pageSize === void 0) { pageSize = null; }
|
|
44367
|
+
var result = new DropdownOptions({
|
|
44257
44368
|
displayField: this.control.displayField,
|
|
44258
44369
|
valueField: this.control.valueField,
|
|
44259
44370
|
fieldPlus: this.control.fieldPlus,
|
|
44260
44371
|
funcGetLabel: this.control.funcGetLabel,
|
|
44261
44372
|
plusUrl: this.control.plusUrl
|
|
44262
44373
|
});
|
|
44374
|
+
if (pageSize) {
|
|
44375
|
+
result.pageSize = pageSize;
|
|
44376
|
+
}
|
|
44377
|
+
return result;
|
|
44263
44378
|
};
|
|
44264
44379
|
AutoCompletePickerComponent.prototype.showPickForm = function () {
|
|
44265
44380
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -44515,7 +44630,7 @@
|
|
|
44515
44630
|
if (!(this.value && this.value.length > 0)) return [3 /*break*/, 2];
|
|
44516
44631
|
return [4 /*yield*/, this.control.baseService.getDataDropdownByFilter([
|
|
44517
44632
|
this.newFilter(this.control.valueField, exports.Operator.in, this.value)
|
|
44518
|
-
], this.getDropdownOptions())];
|
|
44633
|
+
], this.getDropdownOptions(this.value.length))];
|
|
44519
44634
|
case 1:
|
|
44520
44635
|
dataSource = _a.sent();
|
|
44521
44636
|
this.fireEventAfterGetDataDropDown(dataSource);
|
|
@@ -44529,7 +44644,7 @@
|
|
|
44529
44644
|
if (!this.value) return [3 /*break*/, 5];
|
|
44530
44645
|
return [4 /*yield*/, this.control.baseService.getDataDropdownByFilter([
|
|
44531
44646
|
this.newFilter(this.control.valueField, exports.Operator.equal, this.value)
|
|
44532
|
-
], this.getDropdownOptions())];
|
|
44647
|
+
], this.getDropdownOptions(1))];
|
|
44533
44648
|
case 4:
|
|
44534
44649
|
dataSource = _a.sent();
|
|
44535
44650
|
this.fireEventAfterGetDataDropDown(dataSource);
|
|
@@ -44612,7 +44727,7 @@
|
|
|
44612
44727
|
return [4 /*yield*/, appendDefaultFilter(filters, this.control.defaultFilters)];
|
|
44613
44728
|
case 1:
|
|
44614
44729
|
_a.sent();
|
|
44615
|
-
this.control.baseService.getDataDropdownByFilter(filters, this.getDropdownOptions()).then(function (res) {
|
|
44730
|
+
this.control.baseService.getDataDropdownByFilter(filters, this.getDropdownOptions(obj.length)).then(function (res) {
|
|
44616
44731
|
_this.fireEventAfterGetDataDropDown(res);
|
|
44617
44732
|
_this.reStructureDataSource(res);
|
|
44618
44733
|
_this.results = _this.dataSource;
|
|
@@ -44628,7 +44743,7 @@
|
|
|
44628
44743
|
case 3: return [3 /*break*/, 5];
|
|
44629
44744
|
case 4:
|
|
44630
44745
|
if (obj != null) {
|
|
44631
|
-
this.control.baseService.getDataDropdownByFilter([this.newFilter(this.control.valueField, exports.Operator.equal, obj)], this.getDropdownOptions()).then(function (res) {
|
|
44746
|
+
this.control.baseService.getDataDropdownByFilter([this.newFilter(this.control.valueField, exports.Operator.equal, obj)], this.getDropdownOptions(1)).then(function (res) {
|
|
44632
44747
|
if (res.length > 0) {
|
|
44633
44748
|
_this.fireEventAfterGetDataDropDown(res);
|
|
44634
44749
|
_this.reStructureDataSource(res);
|
|
@@ -44758,11 +44873,6 @@
|
|
|
44758
44873
|
this.fieldValue = this.control.valueField;
|
|
44759
44874
|
if (this.control.dataSource == null || this.control.dataSource.length == 0) {
|
|
44760
44875
|
this.bindDataSource(this.control.serviceUri, this.control.baseService);
|
|
44761
|
-
// if (this.control.serviceUri) {
|
|
44762
|
-
// }
|
|
44763
|
-
// else if(this.control.baseService) {
|
|
44764
|
-
//
|
|
44765
|
-
// }
|
|
44766
44876
|
}
|
|
44767
44877
|
else {
|
|
44768
44878
|
this.dataSourceInternal = this.control.dataSource;
|
|
@@ -44785,11 +44895,11 @@
|
|
|
44785
44895
|
var _this = this;
|
|
44786
44896
|
var _a, _b;
|
|
44787
44897
|
if (baseService) {
|
|
44898
|
+
var dropdownOptions = new DropdownOptions({
|
|
44899
|
+
displayField: (_a = this.control.displayField) !== null && _a !== void 0 ? _a : 'ten',
|
|
44900
|
+
valueField: (_b = this.control.valueField) !== null && _b !== void 0 ? _b : 'id',
|
|
44901
|
+
});
|
|
44788
44902
|
if (baseService instanceof BaseService) {
|
|
44789
|
-
var dropdownOptions = new DropdownOptions({
|
|
44790
|
-
displayField: (_a = this.control.displayField) !== null && _a !== void 0 ? _a : 'ten',
|
|
44791
|
-
valueField: (_b = this.control.valueField) !== null && _b !== void 0 ? _b : 'id',
|
|
44792
|
-
});
|
|
44793
44903
|
baseService.getDataDropdown(dropdownOptions).then(function (res) {
|
|
44794
44904
|
_this.dataSourceInternal = res;
|
|
44795
44905
|
_this.gotData = true;
|
|
@@ -44801,13 +44911,9 @@
|
|
|
44801
44911
|
console.log(err);
|
|
44802
44912
|
});
|
|
44803
44913
|
}
|
|
44804
|
-
|
|
44805
|
-
baseService.
|
|
44806
|
-
|
|
44807
|
-
// const valueField = this.control.valueField ?? 'code';
|
|
44808
|
-
_this.dataSourceInternal = res.map(function (item) {
|
|
44809
|
-
return { id: item.value, ten: item.label };
|
|
44810
|
-
});
|
|
44914
|
+
if (baseService instanceof MasterDataService) {
|
|
44915
|
+
baseService.getDataDropdown(this.control.groupCode, null, dropdownOptions).then(function (res) {
|
|
44916
|
+
_this.dataSourceInternal = res;
|
|
44811
44917
|
if (_this.wroteValue)
|
|
44812
44918
|
_this.fixValue();
|
|
44813
44919
|
_this.onReady.emit(_this.control.field);
|
|
@@ -44816,14 +44922,19 @@
|
|
|
44816
44922
|
_this.onReady.emit(_this.control.field);
|
|
44817
44923
|
});
|
|
44818
44924
|
}
|
|
44925
|
+
return;
|
|
44819
44926
|
}
|
|
44820
|
-
|
|
44927
|
+
if (serviceUri) {
|
|
44821
44928
|
this._dropDownService.getDataSource(serviceUri).then(function (rs) {
|
|
44822
44929
|
var arr = [];
|
|
44823
|
-
|
|
44824
|
-
|
|
44825
|
-
|
|
44826
|
-
|
|
44930
|
+
for (var i = 0; i < rs.data.length; i++) {
|
|
44931
|
+
arr.push({
|
|
44932
|
+
label: rs.data[i][_this.control.displayField],
|
|
44933
|
+
title: rs.data[i][_this.control.displayField],
|
|
44934
|
+
value: rs.data[i][_this.control.valueField]
|
|
44935
|
+
});
|
|
44936
|
+
}
|
|
44937
|
+
_this.dataSourceInternal = arr;
|
|
44827
44938
|
_this.gotData = true;
|
|
44828
44939
|
if (_this.wroteValue) {
|
|
44829
44940
|
_this.fixValue();
|
|
@@ -54609,15 +54720,15 @@
|
|
|
54609
54720
|
_this.url = '';
|
|
54610
54721
|
_this.urldetail = '';
|
|
54611
54722
|
_this.notifications = [];
|
|
54612
|
-
_this.rootContext.subscribe(
|
|
54723
|
+
_this.rootContext.subscribe(ComCtxConstants.NOTIFICATION.NOTIFICATION_CHANGE, function (rs) {
|
|
54613
54724
|
_this.refreshNotification();
|
|
54614
54725
|
});
|
|
54615
54726
|
_this._signalRService.start('NotificationHub', TopicReloadNotification, function (data) {
|
|
54616
54727
|
_this.refreshNotification();
|
|
54617
54728
|
});
|
|
54618
|
-
|
|
54619
|
-
|
|
54620
|
-
|
|
54729
|
+
_this.rootContext.subscribe(ComCtxConstants.NOTIFICATION.NOTIFICATION_RELOAD, function (res) {
|
|
54730
|
+
_this.refreshNotification();
|
|
54731
|
+
});
|
|
54621
54732
|
_this.environment = _this._moduleConfigService.getConfig().environment;
|
|
54622
54733
|
return _this;
|
|
54623
54734
|
}
|
|
@@ -54676,9 +54787,7 @@
|
|
|
54676
54787
|
return;
|
|
54677
54788
|
}
|
|
54678
54789
|
var gridInfo = new GridInfo({
|
|
54679
|
-
filters: [
|
|
54680
|
-
this.newFilter('userId', exports.Operator.equal, this.userId)
|
|
54681
|
-
],
|
|
54790
|
+
filters: [],
|
|
54682
54791
|
pageInfo: {
|
|
54683
54792
|
page: 1,
|
|
54684
54793
|
pageSize: this.maxNotification
|
|
@@ -54688,12 +54797,9 @@
|
|
|
54688
54797
|
],
|
|
54689
54798
|
fields: ''
|
|
54690
54799
|
});
|
|
54691
|
-
var readedFilters = [
|
|
54692
|
-
this.newFilter('userId', exports.Operator.equal, this.userId),
|
|
54693
|
-
this.newFilter('readedTime', exports.Operator.isNull, '1')
|
|
54694
|
-
];
|
|
54695
54800
|
Promise.all([
|
|
54696
|
-
this._notificationService.
|
|
54801
|
+
this._notificationService.getUserNotification(gridInfo)
|
|
54802
|
+
.then(function (res) { return _this.handleResponse(res, '', function (f) {
|
|
54697
54803
|
_this.notifications = res.data;
|
|
54698
54804
|
if (!res.success || res.data == null) {
|
|
54699
54805
|
_this._notifierService.showWarningByResponse(res);
|
|
@@ -54702,7 +54808,7 @@
|
|
|
54702
54808
|
_this.bounceNoti = true;
|
|
54703
54809
|
_this.afterGetNotication();
|
|
54704
54810
|
}); }),
|
|
54705
|
-
this._notificationService.
|
|
54811
|
+
this._notificationService.getAllUserReadNotification().then(function (res) {
|
|
54706
54812
|
if (res.data == null || !res.success) {
|
|
54707
54813
|
_this._notifierService.showWarningByResponse(res);
|
|
54708
54814
|
return;
|
|
@@ -54712,14 +54818,39 @@
|
|
|
54712
54818
|
]);
|
|
54713
54819
|
};
|
|
54714
54820
|
TnAppNotificationComponent.prototype.afterGetNotication = function () {
|
|
54715
|
-
|
|
54716
|
-
|
|
54717
|
-
|
|
54718
|
-
|
|
54719
|
-
|
|
54720
|
-
|
|
54721
|
-
|
|
54722
|
-
|
|
54821
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
54822
|
+
var idsUserCreated, userRes, lstUserInfo;
|
|
54823
|
+
return __generator(this, function (_a) {
|
|
54824
|
+
switch (_a.label) {
|
|
54825
|
+
case 0:
|
|
54826
|
+
idsUserCreated = [];
|
|
54827
|
+
this.notifications.forEach(function (element) {
|
|
54828
|
+
if (element.createdUserId == null) {
|
|
54829
|
+
return;
|
|
54830
|
+
}
|
|
54831
|
+
idsUserCreated.push(element.createdUserId);
|
|
54832
|
+
});
|
|
54833
|
+
if (idsUserCreated.length === 0) {
|
|
54834
|
+
return [2 /*return*/];
|
|
54835
|
+
}
|
|
54836
|
+
return [4 /*yield*/, this._userV5Service.getAll([this.newFilter('id', exports.Operator.in, idsUserCreated)], 'avatar,id')];
|
|
54837
|
+
case 1:
|
|
54838
|
+
userRes = _a.sent();
|
|
54839
|
+
if (!userRes.success || !userRes.data || userRes.data.length === 0) {
|
|
54840
|
+
return [2 /*return*/];
|
|
54841
|
+
}
|
|
54842
|
+
lstUserInfo = userRes.data;
|
|
54843
|
+
this.notifications.forEach(function (notification) {
|
|
54844
|
+
if (!notification.createdUserId) {
|
|
54845
|
+
return;
|
|
54846
|
+
}
|
|
54847
|
+
var userInfo = lstUserInfo.find(function (x) { return x.id === notification.createdUserId; });
|
|
54848
|
+
if (!userInfo) {
|
|
54849
|
+
return;
|
|
54850
|
+
}
|
|
54851
|
+
notification.avatar = userInfo.avatar;
|
|
54852
|
+
});
|
|
54853
|
+
return [2 /*return*/];
|
|
54723
54854
|
}
|
|
54724
54855
|
});
|
|
54725
54856
|
});
|