tnx-shared 5.3.254 → 5.3.255
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 +1142 -1138
- 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 +5 -5
- package/classes/base/list-component-base.d.ts.map +1 -1
- package/esm2015/classes/base/list-component-base.js +18 -14
- package/fesm2015/tnx-shared.js +1040 -1036
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
|
@@ -19339,827 +19339,346 @@
|
|
|
19339
19339
|
onDataBinded: [{ type: i0.Output }]
|
|
19340
19340
|
};
|
|
19341
19341
|
|
|
19342
|
-
var
|
|
19343
|
-
|
|
19344
|
-
|
|
19345
|
-
this.
|
|
19346
|
-
|
|
19347
|
-
|
|
19348
|
-
|
|
19349
|
-
|
|
19350
|
-
|
|
19351
|
-
return SearchInfo;
|
|
19352
|
-
}());
|
|
19353
|
-
|
|
19354
|
-
var EXCEL_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8';
|
|
19355
|
-
var EXCEL_EXTENSION = '.xlsx';
|
|
19356
|
-
var ExportService = /** @class */ (function () {
|
|
19357
|
-
function ExportService(_http, _injector, _commonService, _moduleConfigService) {
|
|
19358
|
-
this._http = _http;
|
|
19359
|
-
this._injector = _injector;
|
|
19360
|
-
this._commonService = _commonService;
|
|
19361
|
-
this._moduleConfig = _moduleConfigService.getConfig();
|
|
19362
|
-
this.environment = this._moduleConfig.environment;
|
|
19363
|
-
this.serviceUri = this._moduleConfig.environment.apiDomain.templateEndpoint + "/Export";
|
|
19342
|
+
var CauHinhWorkflowService = /** @class */ (function (_super) {
|
|
19343
|
+
__extends(CauHinhWorkflowService, _super);
|
|
19344
|
+
function CauHinhWorkflowService(http, injector, _moduleConfigService) {
|
|
19345
|
+
var _this = _super.call(this, http, injector, _moduleConfigService.getConfig().environment.apiDomain.congviecEndpoint + "/" + _moduleConfigService.getConfig().environment.apiVersion + "/CauHinhWorkflow") || this;
|
|
19346
|
+
_this._moduleConfigService = _moduleConfigService;
|
|
19347
|
+
_this.serviceCode = 'congviec';
|
|
19348
|
+
_this.entityName = 'CauHinhWorkflow';
|
|
19349
|
+
_this.endPoint = _moduleConfigService.getConfig().environment.apiDomain.congviecEndpoint;
|
|
19350
|
+
return _this;
|
|
19364
19351
|
}
|
|
19365
|
-
|
|
19366
|
-
|
|
19367
|
-
|
|
19368
|
-
|
|
19369
|
-
.pipe(operators.catchError(function (err) { return _this._commonService.handleError(err, _this._injector); }))
|
|
19370
|
-
.subscribe(function (res) {
|
|
19371
|
-
_this.saveAsExcelFile(res, fileName);
|
|
19372
|
-
});
|
|
19373
|
-
};
|
|
19374
|
-
ExportService.prototype.saveAsExcelFile = function (buffer, fileName) {
|
|
19375
|
-
var data = new Blob([buffer], {
|
|
19376
|
-
type: EXCEL_TYPE
|
|
19377
|
-
});
|
|
19378
|
-
FileSaver__default["default"].saveAs(data, fileName + '_' + new Date().getTime() + EXCEL_EXTENSION);
|
|
19379
|
-
};
|
|
19380
|
-
ExportService.prototype.saveSpreadSheet = function (buffer, fileName) {
|
|
19381
|
-
var data = new Blob([buffer], {
|
|
19382
|
-
type: EXCEL_TYPE
|
|
19383
|
-
});
|
|
19384
|
-
FileSaver__default["default"].saveAs(data, new Date().getTime() + '_' + fileName);
|
|
19385
|
-
};
|
|
19386
|
-
return ExportService;
|
|
19387
|
-
}());
|
|
19388
|
-
ExportService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function ExportService_Factory() { return new ExportService(i0__namespace.ɵɵinject(i1__namespace$1.HttpClient), i0__namespace.ɵɵinject(i0__namespace.INJECTOR), i0__namespace.ɵɵinject(CommonService), i0__namespace.ɵɵinject(ModuleConfigService)); }, token: ExportService, providedIn: "root" });
|
|
19389
|
-
ExportService.decorators = [
|
|
19352
|
+
return CauHinhWorkflowService;
|
|
19353
|
+
}(BaseService));
|
|
19354
|
+
CauHinhWorkflowService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function CauHinhWorkflowService_Factory() { return new CauHinhWorkflowService(i0__namespace.ɵɵinject(i1__namespace$1.HttpClient), i0__namespace.ɵɵinject(i0__namespace.INJECTOR), i0__namespace.ɵɵinject(ModuleConfigService)); }, token: CauHinhWorkflowService, providedIn: "root" });
|
|
19355
|
+
CauHinhWorkflowService.decorators = [
|
|
19390
19356
|
{ type: i0.Injectable, args: [{
|
|
19391
19357
|
providedIn: 'root'
|
|
19392
19358
|
},] }
|
|
19393
19359
|
];
|
|
19394
|
-
|
|
19360
|
+
CauHinhWorkflowService.ctorParameters = function () { return [
|
|
19395
19361
|
{ type: i1$1.HttpClient },
|
|
19396
19362
|
{ type: i0.Injector },
|
|
19397
|
-
{ type: CommonService },
|
|
19398
19363
|
{ type: ModuleConfigService }
|
|
19399
19364
|
]; };
|
|
19400
19365
|
|
|
19401
|
-
var
|
|
19402
|
-
|
|
19403
|
-
|
|
19404
|
-
this.
|
|
19405
|
-
this.addPermissionIds = [];
|
|
19406
|
-
this.removePermissionIds = [];
|
|
19407
|
-
for (var key in init) {
|
|
19408
|
-
this[key] = init[key];
|
|
19409
|
-
}
|
|
19410
|
-
}
|
|
19411
|
-
return PhanQuyenModel;
|
|
19412
|
-
}());
|
|
19413
|
-
var PermissionService = /** @class */ (function (_super) {
|
|
19414
|
-
__extends(PermissionService, _super);
|
|
19415
|
-
function PermissionService(http, injector, _moduleConfigService, _userService, _oauthService, _appContext) {
|
|
19416
|
-
var _this = _super.call(this, http, injector, _moduleConfigService.getConfig().environment.apiDomain.authorizationEndpoint + "/" + _moduleConfigService.getConfig().environment.apiVersion + "/permission") || this;
|
|
19366
|
+
var StateMachinesService = /** @class */ (function (_super) {
|
|
19367
|
+
__extends(StateMachinesService, _super);
|
|
19368
|
+
function StateMachinesService(http, injector, _moduleConfigService) {
|
|
19369
|
+
var _this = _super.call(this, http, injector, _moduleConfigService.getConfig().environment.apiDomain.workflowEndpoint + "/" + _moduleConfigService.getConfig().environment.apiVersion + "/StateMachines") || this;
|
|
19417
19370
|
_this._moduleConfigService = _moduleConfigService;
|
|
19418
|
-
_this.
|
|
19419
|
-
_this.
|
|
19420
|
-
_this.
|
|
19421
|
-
_this.storage = sessionStorage;
|
|
19422
|
-
_this.ignoreAdmin = false;
|
|
19423
|
-
_this.delayCheckPermissions = [];
|
|
19424
|
-
_this.appCode = null;
|
|
19425
|
-
_this._config = _this._moduleConfigService.getConfig();
|
|
19426
|
-
_this.endPoint = _this._config.environment.apiDomain.authorizationEndpoint;
|
|
19427
|
-
_this.ignoreAdmin = _this._config.environment.isIgnoreAdmin;
|
|
19428
|
-
_this.appCode = _this._config.appCode;
|
|
19371
|
+
_this.entityName = 'StateMachines';
|
|
19372
|
+
_this.serviceCode = 'workflow';
|
|
19373
|
+
_this.endPoint = _moduleConfigService.getConfig().environment.apiDomain.workflowEndpoint;
|
|
19429
19374
|
return _this;
|
|
19430
19375
|
}
|
|
19431
|
-
|
|
19432
|
-
|
|
19433
|
-
var lstAppCodes = (_c = (_b = (_a = this._config.environment.appMetadata) === null || _a === void 0 ? void 0 : _a.appSwitcher) === null || _b === void 0 ? void 0 : _b.map(function (app) { return app.code; })) !== null && _c !== void 0 ? _c : [];
|
|
19434
|
-
var lstApiEndpoint = [];
|
|
19435
|
-
var apiDomain = this._config.environment.apiDomain;
|
|
19436
|
-
for (var domainName in apiDomain) {
|
|
19437
|
-
if (domainName.startsWith('-') || domainName.startsWith('1') || domainName == 'gateway')
|
|
19438
|
-
continue;
|
|
19439
|
-
var realDomainName = domainName.split('Endpoint') ? domainName.split('Endpoint')[0] : domainName;
|
|
19440
|
-
lstApiEndpoint.push(realDomainName.toUpperCase());
|
|
19441
|
-
}
|
|
19442
|
-
return this.clearPermissionCache(__spreadArray(__spreadArray([], __read(lstAppCodes)), __read(lstApiEndpoint)));
|
|
19376
|
+
StateMachinesService.prototype.changeState = function (itemWorkflowHistory) {
|
|
19377
|
+
return this.defaultPost(this.serviceUri + "/ChangeState", itemWorkflowHistory);
|
|
19443
19378
|
};
|
|
19444
|
-
|
|
19445
|
-
|
|
19446
|
-
return this.defaultPost(url, lstModule);
|
|
19379
|
+
StateMachinesService.prototype.rollback = function (rowData) {
|
|
19380
|
+
return this.defaultPost(this.serviceUri + "/Rollback/" + rowData.__workflowCode + "/" + rowData.id, {});
|
|
19447
19381
|
};
|
|
19448
|
-
|
|
19449
|
-
|
|
19450
|
-
return this.defaultGet(url);
|
|
19382
|
+
StateMachinesService.prototype.getUserInProcessForm = function (workflowCode, stateCode, actionCode, itemId) {
|
|
19383
|
+
return this.defaultPost(this.serviceUri + "/GetUserInProcessForm/" + workflowCode + "/" + stateCode + "/" + actionCode + "/" + itemId, {});
|
|
19451
19384
|
};
|
|
19452
|
-
|
|
19453
|
-
|
|
19454
|
-
|
|
19455
|
-
|
|
19456
|
-
|
|
19457
|
-
|
|
19458
|
-
|
|
19385
|
+
return StateMachinesService;
|
|
19386
|
+
}(BaseService));
|
|
19387
|
+
StateMachinesService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function StateMachinesService_Factory() { return new StateMachinesService(i0__namespace.ɵɵinject(i1__namespace$1.HttpClient), i0__namespace.ɵɵinject(i0__namespace.INJECTOR), i0__namespace.ɵɵinject(ModuleConfigService)); }, token: StateMachinesService, providedIn: "root" });
|
|
19388
|
+
StateMachinesService.decorators = [
|
|
19389
|
+
{ type: i0.Injectable, args: [{
|
|
19390
|
+
providedIn: 'root'
|
|
19391
|
+
},] }
|
|
19392
|
+
];
|
|
19393
|
+
StateMachinesService.ctorParameters = function () { return [
|
|
19394
|
+
{ type: i1$1.HttpClient },
|
|
19395
|
+
{ type: i0.Injector },
|
|
19396
|
+
{ type: ModuleConfigService }
|
|
19397
|
+
]; };
|
|
19398
|
+
|
|
19399
|
+
var DmLoaiCongViecService = /** @class */ (function (_super) {
|
|
19400
|
+
__extends(DmLoaiCongViecService, _super);
|
|
19401
|
+
function DmLoaiCongViecService(http, injector, _moduleConfigService) {
|
|
19402
|
+
var _this = _super.call(this, http, injector, _moduleConfigService.getConfig().environment.apiDomain.congviecEndpoint + "/" + _moduleConfigService.getConfig().environment.apiVersion + "/DM_LoaiCongViec") || this;
|
|
19403
|
+
_this._moduleConfigService = _moduleConfigService;
|
|
19404
|
+
_this.serviceCode = 'congviec';
|
|
19405
|
+
_this.entityName = 'DM_LoaiCongViec';
|
|
19406
|
+
_this.dicLoaiCongViec = {};
|
|
19407
|
+
_this.keyIdLoaiCongViecRoot = 'root';
|
|
19408
|
+
_this.getWorkflowSettingByIdLoaiCongViec = function (idLoaiCongViec) { return __awaiter(_this, void 0, void 0, function () {
|
|
19409
|
+
var result, idLoaiCongViecs, i;
|
|
19410
|
+
return __generator(this, function (_a) {
|
|
19411
|
+
switch (_a.label) {
|
|
19459
19412
|
case 0:
|
|
19460
|
-
|
|
19461
|
-
|
|
19462
|
-
// ko set local storage vì sẽ làm hỏng quyền của người dùng hiện tại
|
|
19463
|
-
if (userId && userId != '' && userId != this._commonService.guidEmpty()) {
|
|
19464
|
-
return [2 /*return*/, this.defaultGet(url + ("?userId=" + userId))];
|
|
19465
|
-
}
|
|
19466
|
-
if (i0.isDevMode()) {
|
|
19467
|
-
return [2 /*return*/];
|
|
19468
|
-
}
|
|
19469
|
-
user = this._userService.getCurrentUser();
|
|
19470
|
-
if (user
|
|
19471
|
-
&& (user.issuperuser && user.issuperuser.toLowerCase() == 'true')
|
|
19472
|
-
|| (user.isadmin && user.isadmin.toLowerCase() == 'true' && !this.ignoreAdmin)) {
|
|
19473
|
-
return [2 /*return*/];
|
|
19474
|
-
}
|
|
19475
|
-
return [4 /*yield*/, this.defaultGet(url)];
|
|
19413
|
+
if (!!this.dicWorkflowByLoaiCongViec) return [3 /*break*/, 2];
|
|
19414
|
+
return [4 /*yield*/, this.getDatasourceWorkflowCongViec()];
|
|
19476
19415
|
case 1:
|
|
19477
|
-
|
|
19478
|
-
|
|
19479
|
-
if (!(!res || !res.success || res.data == null)) return [3 /*break*/, 3];
|
|
19480
|
-
promiseArr = [];
|
|
19481
|
-
try {
|
|
19482
|
-
for (lstAppCodes_1 = __values(lstAppCodes), lstAppCodes_1_1 = lstAppCodes_1.next(); !lstAppCodes_1_1.done; lstAppCodes_1_1 = lstAppCodes_1.next()) {
|
|
19483
|
-
code = lstAppCodes_1_1.value;
|
|
19484
|
-
promiseArr.push(this.getServicePermission(code, true));
|
|
19485
|
-
}
|
|
19486
|
-
}
|
|
19487
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
19488
|
-
finally {
|
|
19489
|
-
try {
|
|
19490
|
-
if (lstAppCodes_1_1 && !lstAppCodes_1_1.done && (_d = lstAppCodes_1.return)) _d.call(lstAppCodes_1);
|
|
19491
|
-
}
|
|
19492
|
-
finally { if (e_1) throw e_1.error; }
|
|
19493
|
-
}
|
|
19494
|
-
return [4 /*yield*/, Promise.all(promiseArr)];
|
|
19416
|
+
_a.sent();
|
|
19417
|
+
_a.label = 2;
|
|
19495
19418
|
case 2:
|
|
19496
|
-
|
|
19497
|
-
|
|
19419
|
+
if (!idLoaiCongViec) {
|
|
19420
|
+
return [2 /*return*/, this.dicWorkflowByLoaiCongViec[this.keyIdLoaiCongViecRoot]];
|
|
19421
|
+
}
|
|
19422
|
+
result = this.dicWorkflowByLoaiCongViec[idLoaiCongViec];
|
|
19423
|
+
if (result)
|
|
19424
|
+
return [2 /*return*/, result];
|
|
19425
|
+
return [4 /*yield*/, this.getIdLoaiCongViecs(idLoaiCongViec)];
|
|
19498
19426
|
case 3:
|
|
19499
|
-
|
|
19500
|
-
|
|
19501
|
-
|
|
19502
|
-
|
|
19503
|
-
|
|
19504
|
-
|
|
19505
|
-
|
|
19506
|
-
|
|
19507
|
-
continue;
|
|
19508
|
-
}
|
|
19509
|
-
permissions = res.data[key_1];
|
|
19510
|
-
break;
|
|
19511
|
-
}
|
|
19512
|
-
key = "AUTHORIZATION." + serviceCode;
|
|
19513
|
-
storageItem = this.storage.getItem(key);
|
|
19514
|
-
if (storageItem != null) {
|
|
19515
|
-
this.storage.removeItem(key);
|
|
19516
|
-
}
|
|
19517
|
-
this.storage.setItem(key, JSON.stringify(permissions));
|
|
19427
|
+
idLoaiCongViecs = _a.sent();
|
|
19428
|
+
if (!Array.isArray(idLoaiCongViecs))
|
|
19429
|
+
return [2 /*return*/, null];
|
|
19430
|
+
if (idLoaiCongViecs.length > 1) {
|
|
19431
|
+
for (i = idLoaiCongViecs.length - 2; i >= 0; i--) {
|
|
19432
|
+
result = this.dicWorkflowByLoaiCongViec[idLoaiCongViecs[i]];
|
|
19433
|
+
if (result)
|
|
19434
|
+
return [2 /*return*/, result];
|
|
19518
19435
|
}
|
|
19519
19436
|
}
|
|
19520
|
-
|
|
19521
|
-
|
|
19522
|
-
try {
|
|
19523
|
-
if (lstAppCodes_2_1 && !lstAppCodes_2_1.done && (_e = lstAppCodes_2.return)) _e.call(lstAppCodes_2);
|
|
19524
|
-
}
|
|
19525
|
-
finally { if (e_2) throw e_2.error; }
|
|
19437
|
+
if (!result) {
|
|
19438
|
+
result = this.dicWorkflowByLoaiCongViec[this.keyIdLoaiCongViecRoot];
|
|
19526
19439
|
}
|
|
19527
|
-
return [2 /*return
|
|
19440
|
+
return [2 /*return*/, result];
|
|
19528
19441
|
}
|
|
19529
19442
|
});
|
|
19530
|
-
});
|
|
19531
|
-
|
|
19532
|
-
|
|
19533
|
-
|
|
19534
|
-
|
|
19535
|
-
|
|
19536
|
-
|
|
19537
|
-
|
|
19538
|
-
|
|
19539
|
-
|
|
19540
|
-
|
|
19541
|
-
|
|
19542
|
-
|
|
19543
|
-
switch (_e.label) {
|
|
19544
|
-
case 0: return [4 /*yield*/, this._userService.getCurrentUser()];
|
|
19545
|
-
case 1:
|
|
19546
|
-
user = (_e.sent());
|
|
19547
|
-
if (user && user.issuperuser.toLowerCase() == 'true') {
|
|
19548
|
-
resolve(lstPermissionCode);
|
|
19549
|
-
return [2 /*return*/];
|
|
19443
|
+
}); };
|
|
19444
|
+
_this.endPoint = _moduleConfigService.getConfig().environment.apiDomain.congviecEndpoint;
|
|
19445
|
+
return _this;
|
|
19446
|
+
}
|
|
19447
|
+
DmLoaiCongViecService.prototype.getDatasourceWorkflowCongViec = function () {
|
|
19448
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19449
|
+
var cauHinhWorkflowService, cauHinhWorkflows, notifierService, workflowCodes, stateMachinesService, workflows;
|
|
19450
|
+
var _this = this;
|
|
19451
|
+
return __generator(this, function (_a) {
|
|
19452
|
+
switch (_a.label) {
|
|
19453
|
+
case 0:
|
|
19454
|
+
if (!this.dicWorkflowByLoaiCongViec) {
|
|
19455
|
+
this.dicWorkflowByLoaiCongViec = {};
|
|
19550
19456
|
}
|
|
19551
|
-
|
|
19552
|
-
|
|
19553
|
-
|
|
19457
|
+
cauHinhWorkflowService = this._injector.get(CauHinhWorkflowService);
|
|
19458
|
+
return [4 /*yield*/, cauHinhWorkflowService.getAll([], 'idLoaiCongViec,workflowCodes,workflowCode')];
|
|
19459
|
+
case 1:
|
|
19460
|
+
cauHinhWorkflows = (_a.sent()).data;
|
|
19461
|
+
notifierService = this._injector.get(NotifierService);
|
|
19462
|
+
if (cauHinhWorkflows == null) {
|
|
19463
|
+
notifierService.showWarning('Dịch vụ workflow không phản hồi');
|
|
19464
|
+
return [2 /*return*/, []];
|
|
19554
19465
|
}
|
|
19555
|
-
|
|
19556
|
-
|
|
19466
|
+
workflowCodes = [];
|
|
19467
|
+
cauHinhWorkflows.forEach(function (itemWorkflowSetting) {
|
|
19468
|
+
if (itemWorkflowSetting.workflowCodes && !Array.isArray(itemWorkflowSetting.workflowCodes)) {
|
|
19469
|
+
itemWorkflowSetting.workflowCodes = itemWorkflowSetting.workflowCodes.split(',');
|
|
19470
|
+
}
|
|
19471
|
+
else {
|
|
19472
|
+
itemWorkflowSetting.workflowCodes = [];
|
|
19473
|
+
}
|
|
19474
|
+
itemWorkflowSetting.workflowCodes.forEach(function (workflowCode) {
|
|
19475
|
+
if (workflowCodes.indexOf(workflowCode) == -1) {
|
|
19476
|
+
workflowCodes.push(workflowCode);
|
|
19477
|
+
}
|
|
19478
|
+
});
|
|
19479
|
+
});
|
|
19480
|
+
stateMachinesService = this._injector.get(StateMachinesService);
|
|
19481
|
+
return [4 /*yield*/, stateMachinesService.getDataDropdownByFilter([
|
|
19482
|
+
this.newFilter('code', exports.Operator.in, workflowCodes)
|
|
19483
|
+
], new DropdownOptions({
|
|
19484
|
+
valueField: 'code',
|
|
19485
|
+
displayField: 'title',
|
|
19486
|
+
fieldPlus: 'data'
|
|
19487
|
+
}))];
|
|
19557
19488
|
case 2:
|
|
19558
|
-
|
|
19559
|
-
|
|
19560
|
-
|
|
19561
|
-
|
|
19562
|
-
|
|
19563
|
-
|
|
19564
|
-
|
|
19565
|
-
|
|
19566
|
-
|
|
19567
|
-
|
|
19568
|
-
|
|
19569
|
-
|
|
19570
|
-
|
|
19571
|
-
|
|
19572
|
-
|
|
19573
|
-
|
|
19574
|
-
|
|
19575
|
-
|
|
19576
|
-
|
|
19577
|
-
|
|
19578
|
-
|
|
19579
|
-
|
|
19580
|
-
|
|
19581
|
-
|
|
19582
|
-
finally { if (e_3) throw e_3.error; }
|
|
19583
|
-
return [7 /*endfinally*/];
|
|
19584
|
-
case 9:
|
|
19585
|
-
resolve(result);
|
|
19586
|
-
return [2 /*return*/];
|
|
19489
|
+
workflows = (_a.sent());
|
|
19490
|
+
workflows.forEach(function (item) {
|
|
19491
|
+
item.data = JSON.parse(item.data);
|
|
19492
|
+
var stateMachineData = item.data;
|
|
19493
|
+
stateMachineData.actions = {};
|
|
19494
|
+
stateMachineData.machines.forEach(function (machine) {
|
|
19495
|
+
stateMachineData.actions[machine.code] = [];
|
|
19496
|
+
stateMachineData.connections.forEach(function (conn) {
|
|
19497
|
+
if (conn.source == machine.id) {
|
|
19498
|
+
stateMachineData.actions[machine.code].push(conn);
|
|
19499
|
+
}
|
|
19500
|
+
});
|
|
19501
|
+
});
|
|
19502
|
+
});
|
|
19503
|
+
cauHinhWorkflows.forEach(function (itemWorkflowSetting) {
|
|
19504
|
+
itemWorkflowSetting.workflows = workflows.filter(function (q) { return itemWorkflowSetting.workflowCodes.indexOf(q.code) > -1; });
|
|
19505
|
+
if (!itemWorkflowSetting.idLoaiCongViec) {
|
|
19506
|
+
_this.dicWorkflowByLoaiCongViec[_this.keyIdLoaiCongViecRoot] = itemWorkflowSetting;
|
|
19507
|
+
}
|
|
19508
|
+
else {
|
|
19509
|
+
_this.dicWorkflowByLoaiCongViec[itemWorkflowSetting.idLoaiCongViec] = itemWorkflowSetting;
|
|
19510
|
+
}
|
|
19511
|
+
});
|
|
19512
|
+
return [2 /*return*/, workflows];
|
|
19587
19513
|
}
|
|
19588
19514
|
});
|
|
19589
|
-
});
|
|
19515
|
+
});
|
|
19590
19516
|
};
|
|
19591
|
-
|
|
19517
|
+
DmLoaiCongViecService.prototype.getIdLoaiCongViecs = function (idLoaiCongViec) {
|
|
19592
19518
|
return __awaiter(this, void 0, void 0, function () {
|
|
19593
|
-
var
|
|
19594
|
-
return __generator(this, function (
|
|
19595
|
-
switch (
|
|
19519
|
+
var notifierService, itemLoaiCongViec, idLoaiCongViecs;
|
|
19520
|
+
return __generator(this, function (_a) {
|
|
19521
|
+
switch (_a.label) {
|
|
19596
19522
|
case 0:
|
|
19597
|
-
|
|
19598
|
-
|
|
19523
|
+
notifierService = this._injector.get(NotifierService);
|
|
19524
|
+
return [4 /*yield*/, this.getItemLoaiCongViec(idLoaiCongViec)];
|
|
19599
19525
|
case 1:
|
|
19600
|
-
|
|
19601
|
-
|
|
19602
|
-
|
|
19603
|
-
|
|
19604
|
-
retryCount++;
|
|
19605
|
-
if (retryCount > 50) {
|
|
19606
|
-
return [3 /*break*/, 3];
|
|
19526
|
+
itemLoaiCongViec = _a.sent();
|
|
19527
|
+
if (itemLoaiCongViec == null) {
|
|
19528
|
+
notifierService.showWarning('Loại công việc không tồn tại');
|
|
19529
|
+
return [2 /*return*/, null];
|
|
19607
19530
|
}
|
|
19608
|
-
|
|
19609
|
-
|
|
19610
|
-
case 4: return [2 /*return*/, _d.sent()];
|
|
19531
|
+
idLoaiCongViecs = itemLoaiCongViec.idDuongDan.split(';').filter(function (q) { return !!q; });
|
|
19532
|
+
return [2 /*return*/, idLoaiCongViecs];
|
|
19611
19533
|
}
|
|
19612
19534
|
});
|
|
19613
19535
|
});
|
|
19614
19536
|
};
|
|
19615
|
-
|
|
19616
|
-
if (checForMenu === void 0) { checForMenu = false; }
|
|
19537
|
+
DmLoaiCongViecService.prototype.getItemLoaiCongViec = function (idLoaiCongViec) {
|
|
19617
19538
|
return __awaiter(this, void 0, void 0, function () {
|
|
19618
|
-
var
|
|
19619
|
-
return __generator(this, function (
|
|
19620
|
-
switch (
|
|
19539
|
+
var _a, _b;
|
|
19540
|
+
return __generator(this, function (_c) {
|
|
19541
|
+
switch (_c.label) {
|
|
19621
19542
|
case 0:
|
|
19622
|
-
this.
|
|
19623
|
-
|
|
19624
|
-
|
|
19543
|
+
if (!!this.dicLoaiCongViec[idLoaiCongViec]) return [3 /*break*/, 2];
|
|
19544
|
+
_a = this.dicLoaiCongViec;
|
|
19545
|
+
_b = idLoaiCongViec;
|
|
19546
|
+
return [4 /*yield*/, this.getDetail(idLoaiCongViec)];
|
|
19625
19547
|
case 1:
|
|
19626
|
-
|
|
19627
|
-
|
|
19628
|
-
case 2:
|
|
19629
|
-
_d.sent();
|
|
19630
|
-
retryCount++;
|
|
19631
|
-
if (retryCount > 50) {
|
|
19632
|
-
return [3 /*break*/, 3];
|
|
19633
|
-
}
|
|
19634
|
-
return [3 /*break*/, 1];
|
|
19635
|
-
case 3: return [4 /*yield*/, this.checkPermission(service, permission, checForMenu)];
|
|
19636
|
-
case 4: return [2 /*return*/, _d.sent()];
|
|
19548
|
+
_a[_b] = (_c.sent()).data;
|
|
19549
|
+
_c.label = 2;
|
|
19550
|
+
case 2: return [2 /*return*/, this.dicLoaiCongViec[idLoaiCongViec]];
|
|
19637
19551
|
}
|
|
19638
19552
|
});
|
|
19639
19553
|
});
|
|
19640
19554
|
};
|
|
19641
|
-
|
|
19642
|
-
|
|
19555
|
+
return DmLoaiCongViecService;
|
|
19556
|
+
}(BaseService));
|
|
19557
|
+
DmLoaiCongViecService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function DmLoaiCongViecService_Factory() { return new DmLoaiCongViecService(i0__namespace.ɵɵinject(i1__namespace$1.HttpClient), i0__namespace.ɵɵinject(i0__namespace.INJECTOR), i0__namespace.ɵɵinject(ModuleConfigService)); }, token: DmLoaiCongViecService, providedIn: "root" });
|
|
19558
|
+
DmLoaiCongViecService.decorators = [
|
|
19559
|
+
{ type: i0.Injectable, args: [{
|
|
19560
|
+
providedIn: 'root'
|
|
19561
|
+
},] }
|
|
19562
|
+
];
|
|
19563
|
+
DmLoaiCongViecService.ctorParameters = function () { return [
|
|
19564
|
+
{ type: i1$1.HttpClient },
|
|
19565
|
+
{ type: i0.Injector },
|
|
19566
|
+
{ type: ModuleConfigService }
|
|
19567
|
+
]; };
|
|
19568
|
+
|
|
19569
|
+
var CongViecService = /** @class */ (function (_super) {
|
|
19570
|
+
__extends(CongViecService, _super);
|
|
19571
|
+
function CongViecService(http, injector, _moduleConfigService, _dmLoaiCongViecService) {
|
|
19572
|
+
var _this = _super.call(this, http, injector, _moduleConfigService.getConfig().environment.apiDomain.congviecEndpoint + "/" + _moduleConfigService.getConfig().environment.apiVersion + "/CongViec_Chinh") || this;
|
|
19573
|
+
_this._dmLoaiCongViecService = _dmLoaiCongViecService;
|
|
19574
|
+
_this.serviceCode = 'congviec';
|
|
19575
|
+
_this.entityName = 'CongViec_Chinh';
|
|
19576
|
+
_this.objectName = 'công việc';
|
|
19577
|
+
_this.endPoint = _moduleConfigService.getConfig().environment.apiDomain.congviecEndpoint;
|
|
19578
|
+
_this._moduleConfig = _moduleConfigService.getConfig();
|
|
19579
|
+
return _this;
|
|
19580
|
+
}
|
|
19581
|
+
CongViecService.prototype.adjustSettingWorkflowForCrudList = function (setting) {
|
|
19582
|
+
this.useWorkflow = true;
|
|
19583
|
+
setting.isWorkflowTree = true;
|
|
19584
|
+
setting.baseService = this;
|
|
19585
|
+
setting.displayField = function (item) { return item.ten; };
|
|
19586
|
+
setting.baseService.useWorkflow = true;
|
|
19587
|
+
setting.workflowConfigAdvance = {
|
|
19588
|
+
getWorkflowSetting: this.getWorkflowConfig.bind(this)
|
|
19589
|
+
};
|
|
19590
|
+
};
|
|
19591
|
+
CongViecService.prototype.getWorkflowConfig = function (rowData) {
|
|
19643
19592
|
return __awaiter(this, void 0, void 0, function () {
|
|
19644
|
-
|
|
19645
|
-
|
|
19646
|
-
|
|
19647
|
-
case
|
|
19648
|
-
_d.trys.push([0, 2, , 3]);
|
|
19649
|
-
user = this._userService.getCurrentUser();
|
|
19650
|
-
valueIsDevMode = true;
|
|
19651
|
-
if (i0.isDevMode() && valueIsDevMode) {
|
|
19652
|
-
return [2 /*return*/, true];
|
|
19653
|
-
}
|
|
19654
|
-
if (user && user.issuperuser && user.issuperuser.toLowerCase() == 'true' && valueIsDevMode) {
|
|
19655
|
-
return [2 /*return*/, true];
|
|
19656
|
-
}
|
|
19657
|
-
if (user && user.isadmin && user.isadmin.toLowerCase() == 'true' && !this.ignoreAdmin && valueIsDevMode) {
|
|
19658
|
-
return [2 /*return*/, true];
|
|
19659
|
-
}
|
|
19660
|
-
return [4 /*yield*/, this.getServicePermission(service)];
|
|
19661
|
-
case 1:
|
|
19662
|
-
userPermissions = _d.sent();
|
|
19663
|
-
if (userPermissions && userPermissions.length > 0) {
|
|
19664
|
-
return [2 /*return*/, checkForMenu
|
|
19665
|
-
? userPermissions.includes(permissionToCheck)
|
|
19666
|
-
: this._checkPermission(userPermissions, permissionToCheck)];
|
|
19667
|
-
}
|
|
19668
|
-
else {
|
|
19669
|
-
// console.log(`Không có quyền với phân hệ [${service}]`);
|
|
19670
|
-
return [2 /*return*/, false];
|
|
19671
|
-
}
|
|
19672
|
-
return [3 /*break*/, 3];
|
|
19673
|
-
case 2:
|
|
19674
|
-
_a_1 = _d.sent();
|
|
19675
|
-
return [2 /*return*/, false];
|
|
19676
|
-
case 3: return [2 /*return*/];
|
|
19593
|
+
return __generator(this, function (_a) {
|
|
19594
|
+
switch (_a.label) {
|
|
19595
|
+
case 0: return [4 /*yield*/, this._dmLoaiCongViecService.getWorkflowSettingByIdLoaiCongViec(rowData.idLoaiCongViec)];
|
|
19596
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19677
19597
|
}
|
|
19678
19598
|
});
|
|
19679
19599
|
});
|
|
19680
19600
|
};
|
|
19681
|
-
|
|
19682
|
-
|
|
19683
|
-
var isAuthorized = false;
|
|
19684
|
-
try {
|
|
19685
|
-
// check permission của người dùng
|
|
19686
|
-
// duyệt qua từng permission của người dùng
|
|
19687
|
-
for (var userPermissions_1 = __values(userPermissions), userPermissions_1_1 = userPermissions_1.next(); !userPermissions_1_1.done; userPermissions_1_1 = userPermissions_1.next()) {
|
|
19688
|
-
var userPermission = userPermissions_1_1.value;
|
|
19689
|
-
// biến để break khỏi vòng khi người dùng được authorized
|
|
19690
|
-
var breakOuterLoop = false;
|
|
19691
|
-
// pointer permission của người dùng
|
|
19692
|
-
var userPermissionPointer = 0;
|
|
19693
|
-
// pointer permission đang check
|
|
19694
|
-
var permissionToCheckPointer = 0;
|
|
19695
|
-
// mark co the check query param
|
|
19696
|
-
var aboutToCheckQueryParam = false;
|
|
19697
|
-
// check từng char của 2 mảng
|
|
19698
|
-
for (; permissionToCheckPointer < permissionToCheck.length;) {
|
|
19699
|
-
// nếu char là ký tự bắt đầu template => tịnh tiến pointer của 2 mảng
|
|
19700
|
-
var needRecheck = false;
|
|
19701
|
-
if (userPermission[userPermissionPointer] == '{') {
|
|
19702
|
-
// cho đến khi tìm được ký tự '/' tiếp theo thì dừng lại
|
|
19703
|
-
for (; userPermissionPointer < userPermission.length; userPermissionPointer++) {
|
|
19704
|
-
if (userPermissionPointer == userPermission.length - 1) {
|
|
19705
|
-
break;
|
|
19706
|
-
}
|
|
19707
|
-
if (userPermission[userPermissionPointer] != '}') {
|
|
19708
|
-
continue;
|
|
19709
|
-
}
|
|
19710
|
-
if (userPermission[userPermissionPointer] === '?') {
|
|
19711
|
-
aboutToCheckQueryParam = true;
|
|
19712
|
-
}
|
|
19713
|
-
++userPermissionPointer; // tiến tiến đến ký tự sau kết thúc template
|
|
19714
|
-
// check trường hợp trường hợp chuỗi template có dạng "{template}acsekjf"
|
|
19715
|
-
// => cần check các ký tự sau template và trước ký tự '/'
|
|
19716
|
-
if (userPermission[userPermissionPointer] != '/' && (aboutToCheckQueryParam && userPermission[userPermissionPointer] != '&')) {
|
|
19717
|
-
needRecheck = true;
|
|
19718
|
-
for (; userPermissionPointer < userPermission.length; userPermissionPointer++) {
|
|
19719
|
-
if (userPermissionPointer == userPermission.length - 1) {
|
|
19720
|
-
break;
|
|
19721
|
-
}
|
|
19722
|
-
if (userPermission[userPermissionPointer] != '/') {
|
|
19723
|
-
continue;
|
|
19724
|
-
}
|
|
19725
|
-
break;
|
|
19726
|
-
}
|
|
19727
|
-
}
|
|
19728
|
-
break;
|
|
19729
|
-
}
|
|
19730
|
-
for (; permissionToCheckPointer < permissionToCheck.length; permissionToCheckPointer++) {
|
|
19731
|
-
if (permissionToCheckPointer == permissionToCheck.length - 1) {
|
|
19732
|
-
break;
|
|
19733
|
-
}
|
|
19734
|
-
if (permissionToCheck[permissionToCheckPointer] == '/' || (aboutToCheckQueryParam && permissionToCheck[permissionToCheckPointer] == '&')) {
|
|
19735
|
-
break;
|
|
19736
|
-
}
|
|
19737
|
-
}
|
|
19738
|
-
}
|
|
19739
|
-
var breakInnerLoop = false;
|
|
19740
|
-
if (needRecheck) {
|
|
19741
|
-
// check lại cho trường hợp chuỗi template có dạng "{template}acslekfj"
|
|
19742
|
-
// duyệt ngược lại cho đến khi gặp ký tự kết thúc template
|
|
19743
|
-
var tempUserPointer = userPermissionPointer;
|
|
19744
|
-
var tempToCheckPointer = permissionToCheckPointer;
|
|
19745
|
-
while (userPermission[tempUserPointer] != '}') {
|
|
19746
|
-
// ký tự khác nhau => break khỏi vòng kiểm tra trong
|
|
19747
|
-
if (userPermission[tempUserPointer].toLowerCase() != permissionToCheck[tempToCheckPointer].toLowerCase()) {
|
|
19748
|
-
breakInnerLoop = true;
|
|
19749
|
-
break;
|
|
19750
|
-
}
|
|
19751
|
-
tempUserPointer--;
|
|
19752
|
-
tempToCheckPointer--;
|
|
19753
|
-
}
|
|
19754
|
-
}
|
|
19755
|
-
if (breakInnerLoop) {
|
|
19756
|
-
break;
|
|
19757
|
-
}
|
|
19758
|
-
var userChar = userPermission[userPermissionPointer].toLowerCase();
|
|
19759
|
-
var toCheckChar = permissionToCheck[permissionToCheckPointer].toLowerCase();
|
|
19760
|
-
// nếu userPermission đang ở index cuối
|
|
19761
|
-
if (userPermissionPointer == userPermission.length - 1) {
|
|
19762
|
-
// check char cuối của 2 mảng (trừ khi là ký tự kết thúc template)
|
|
19763
|
-
// và cũng phải là char cuối của mảng permission cần check
|
|
19764
|
-
// => người dùng authorized và break khỏi vòng lặp ngoài cùng
|
|
19765
|
-
if ((userChar == '}' || userChar == toCheckChar)
|
|
19766
|
-
&& permissionToCheckPointer == permissionToCheck.length - 1) {
|
|
19767
|
-
breakOuterLoop = true;
|
|
19768
|
-
isAuthorized = true;
|
|
19769
|
-
}
|
|
19770
|
-
break;
|
|
19771
|
-
}
|
|
19772
|
-
// check char có giống nhau không, không giống thì break khỏi vòng check
|
|
19773
|
-
if (userChar != toCheckChar) {
|
|
19774
|
-
break;
|
|
19775
|
-
}
|
|
19776
|
-
// nếu char giống nhau thì tiếp tục vòng lăp
|
|
19777
|
-
permissionToCheckPointer++;
|
|
19778
|
-
userPermissionPointer++;
|
|
19779
|
-
}
|
|
19780
|
-
if (breakOuterLoop) {
|
|
19781
|
-
break;
|
|
19782
|
-
}
|
|
19783
|
-
}
|
|
19784
|
-
}
|
|
19785
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
19786
|
-
finally {
|
|
19787
|
-
try {
|
|
19788
|
-
if (userPermissions_1_1 && !userPermissions_1_1.done && (_d = userPermissions_1.return)) _d.call(userPermissions_1);
|
|
19789
|
-
}
|
|
19790
|
-
finally { if (e_4) throw e_4.error; }
|
|
19791
|
-
}
|
|
19792
|
-
return isAuthorized;
|
|
19601
|
+
CongViecService.prototype.countByMenuState = function (data) {
|
|
19602
|
+
return this.defaultPost(this.serviceUri + "/CountByMenuState", data);
|
|
19793
19603
|
};
|
|
19794
|
-
|
|
19795
|
-
|
|
19796
|
-
|
|
19797
|
-
|
|
19798
|
-
|
|
19799
|
-
|
|
19800
|
-
}
|
|
19801
|
-
try {
|
|
19802
|
-
for (var userPermissions_2 = __values(userPermissions), userPermissions_2_1 = userPermissions_2.next(); !userPermissions_2_1.done; userPermissions_2_1 = userPermissions_2.next()) {
|
|
19803
|
-
var userPermission = userPermissions_2_1.value;
|
|
19804
|
-
// Cắt chuỗi permission thành mảng để xem mỗi fragement có khớp nhau không
|
|
19805
|
-
var userPermissionFragments = userPermission.split('/');
|
|
19806
|
-
var permissionFragments = permissionToCheck.split('/');
|
|
19807
|
-
// Mảng khác độ dài thì thoát sớm
|
|
19808
|
-
if (userPermissionFragments.length != permissionFragments.length) {
|
|
19809
|
-
continue;
|
|
19810
|
-
}
|
|
19811
|
-
// biến flag ra hiệu người dùng authorized và out vòng
|
|
19812
|
-
var breakLoop = false;
|
|
19813
|
-
// nếu tất cả phần tử khớp nhau => permission này trùng và người dùng được authorized
|
|
19814
|
-
for (var index = 0; index < permissionFragments.length; index++) {
|
|
19815
|
-
var userFragement = userPermissionFragments[index];
|
|
19816
|
-
var permissionFragment = permissionFragments[index];
|
|
19817
|
-
// skip qua các phần tử có ký tự bắt đầu là '{'
|
|
19818
|
-
if (userFragement[0] == '{') {
|
|
19819
|
-
if (index == permissionFragments.length - 1) {
|
|
19820
|
-
isAuthorized = true;
|
|
19821
|
-
breakLoop = true;
|
|
19822
|
-
}
|
|
19823
|
-
continue;
|
|
19824
|
-
}
|
|
19825
|
-
if (userFragement.toLowerCase() != permissionFragment.toLowerCase()) {
|
|
19826
|
-
break;
|
|
19827
|
-
}
|
|
19828
|
-
if (index == permissionFragments.length - 1) {
|
|
19829
|
-
isAuthorized = true;
|
|
19830
|
-
breakLoop = true;
|
|
19831
|
-
}
|
|
19832
|
-
}
|
|
19833
|
-
if (breakLoop) {
|
|
19834
|
-
break;
|
|
19835
|
-
}
|
|
19836
|
-
}
|
|
19837
|
-
}
|
|
19838
|
-
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
19839
|
-
finally {
|
|
19840
|
-
try {
|
|
19841
|
-
if (userPermissions_2_1 && !userPermissions_2_1.done && (_d = userPermissions_2.return)) _d.call(userPermissions_2);
|
|
19842
|
-
}
|
|
19843
|
-
finally { if (e_5) throw e_5.error; }
|
|
19844
|
-
}
|
|
19845
|
-
return isAuthorized;
|
|
19604
|
+
CongViecService.prototype.getDicIdByMenuState = function (data, tuNgay, denNgay) {
|
|
19605
|
+
return this.defaultPost(this.serviceUri + "/GetDicIdByMenuState", {
|
|
19606
|
+
lstTrangThai: data,
|
|
19607
|
+
tuNgay: tuNgay,
|
|
19608
|
+
denNgay: denNgay
|
|
19609
|
+
});
|
|
19846
19610
|
};
|
|
19847
|
-
|
|
19848
|
-
var
|
|
19849
|
-
|
|
19850
|
-
if (ignoreAdmin === void 0) { ignoreAdmin = false; }
|
|
19851
|
-
return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
19852
|
-
var user, isAuthorized;
|
|
19853
|
-
var _this = this;
|
|
19854
|
-
return __generator(this, function (_d) {
|
|
19855
|
-
switch (_d.label) {
|
|
19856
|
-
case 0: return [4 /*yield*/, this._userService.getCurrentUser()];
|
|
19857
|
-
case 1:
|
|
19858
|
-
user = (_d.sent());
|
|
19859
|
-
if (user && user.issuperuser.toLowerCase() == 'true') {
|
|
19860
|
-
resolve(true);
|
|
19861
|
-
return [2 /*return*/];
|
|
19862
|
-
}
|
|
19863
|
-
if (user && user.isadmin.toLowerCase() == 'true' && !this.ignoreAdmin) {
|
|
19864
|
-
resolve(true);
|
|
19865
|
-
return [2 /*return*/];
|
|
19866
|
-
}
|
|
19867
|
-
isAuthorized = true;
|
|
19868
|
-
if (operator.toUpperCase() == 'OR') {
|
|
19869
|
-
isAuthorized = false;
|
|
19870
|
-
}
|
|
19871
|
-
permissions.forEach(function (item) {
|
|
19872
|
-
_this.getServicePermission(item.service).then(function (permissionResult) {
|
|
19873
|
-
if (operator.toUpperCase() == 'OR') {
|
|
19874
|
-
if (permissionResult.includes(item.permission)) {
|
|
19875
|
-
isAuthorized = true;
|
|
19876
|
-
return;
|
|
19877
|
-
}
|
|
19878
|
-
}
|
|
19879
|
-
else {
|
|
19880
|
-
if (!permissionResult.includes(item.permission)) {
|
|
19881
|
-
isAuthorized = false;
|
|
19882
|
-
return;
|
|
19883
|
-
}
|
|
19884
|
-
}
|
|
19885
|
-
}, function (error) {
|
|
19886
|
-
reject(false);
|
|
19887
|
-
});
|
|
19888
|
-
});
|
|
19889
|
-
resolve(isAuthorized);
|
|
19890
|
-
return [2 /*return*/];
|
|
19891
|
-
}
|
|
19892
|
-
});
|
|
19893
|
-
}); });
|
|
19611
|
+
CongViecService.prototype.updateBulkIdCha = function (model) {
|
|
19612
|
+
var url = this.serviceUri + "/UpdateBulkIdCha";
|
|
19613
|
+
return this.defaultPost(url, model);
|
|
19894
19614
|
};
|
|
19895
|
-
|
|
19896
|
-
|
|
19897
|
-
return
|
|
19898
|
-
var key, storageItem, result, url, response;
|
|
19899
|
-
return __generator(this, function (_d) {
|
|
19900
|
-
switch (_d.label) {
|
|
19901
|
-
case 0:
|
|
19902
|
-
key = "AUTHORIZATION." + service.toUpperCase();
|
|
19903
|
-
if (!overrideLocalStorage) {
|
|
19904
|
-
storageItem = this.storage.getItem(key);
|
|
19905
|
-
if (storageItem && storageItem !== 'null') {
|
|
19906
|
-
result = JSON.parse(storageItem);
|
|
19907
|
-
return [2 /*return*/, result];
|
|
19908
|
-
}
|
|
19909
|
-
}
|
|
19910
|
-
url = this.serviceUri + "/GetPermissionsByService?service=" + service;
|
|
19911
|
-
return [4 /*yield*/, this.defaultGet(url)];
|
|
19912
|
-
case 1:
|
|
19913
|
-
response = _d.sent();
|
|
19914
|
-
if (!response || !response.success) {
|
|
19915
|
-
return [2 /*return*/, []];
|
|
19916
|
-
}
|
|
19917
|
-
if (overrideLocalStorage) {
|
|
19918
|
-
this.storage.removeItem(key);
|
|
19919
|
-
}
|
|
19920
|
-
this.storage.setItem(key, JSON.stringify(response.data));
|
|
19921
|
-
return [2 /*return*/, response.data];
|
|
19922
|
-
}
|
|
19923
|
-
});
|
|
19924
|
-
});
|
|
19615
|
+
CongViecService.prototype.deleteBulkCongViecCon = function (ids) {
|
|
19616
|
+
var url = this.serviceUri + "/DeleteBulkCongViecCon";
|
|
19617
|
+
return this.defaultPost(url, ids);
|
|
19925
19618
|
};
|
|
19926
|
-
|
|
19927
|
-
var url = this.serviceUri + "/
|
|
19928
|
-
return this.
|
|
19619
|
+
CongViecService.prototype.getDataDashboardCaNhan = function (inputData) {
|
|
19620
|
+
var url = this.serviceUri + "/GetDataDashboardCaNhan";
|
|
19621
|
+
return this.defaultPost(url, inputData);
|
|
19929
19622
|
};
|
|
19930
|
-
|
|
19931
|
-
var url = this.serviceUri + "/
|
|
19932
|
-
return this.defaultPost(url,
|
|
19623
|
+
CongViecService.prototype.getDataDashboardByDonVi = function (inputData) {
|
|
19624
|
+
var url = this.serviceUri + "/GetDataDashboardByDonVi";
|
|
19625
|
+
return this.defaultPost(url, inputData);
|
|
19933
19626
|
};
|
|
19934
|
-
|
|
19627
|
+
CongViecService.prototype.getListTasksDashboard = function (dataFilter) {
|
|
19628
|
+
var url = this.serviceUri + "/getListTasksDashboard";
|
|
19629
|
+
return this.defaultPost(url, dataFilter);
|
|
19630
|
+
};
|
|
19631
|
+
return CongViecService;
|
|
19935
19632
|
}(BaseService));
|
|
19936
|
-
|
|
19937
|
-
|
|
19633
|
+
CongViecService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function CongViecService_Factory() { return new CongViecService(i0__namespace.ɵɵinject(i1__namespace$1.HttpClient), i0__namespace.ɵɵinject(i0__namespace.INJECTOR), i0__namespace.ɵɵinject(ModuleConfigService), i0__namespace.ɵɵinject(DmLoaiCongViecService)); }, token: CongViecService, providedIn: "root" });
|
|
19634
|
+
CongViecService.decorators = [
|
|
19938
19635
|
{ type: i0.Injectable, args: [{
|
|
19939
19636
|
providedIn: 'root'
|
|
19940
19637
|
},] }
|
|
19941
19638
|
];
|
|
19942
|
-
|
|
19639
|
+
CongViecService.ctorParameters = function () { return [
|
|
19943
19640
|
{ type: i1$1.HttpClient },
|
|
19944
19641
|
{ type: i0.Injector },
|
|
19945
19642
|
{ type: ModuleConfigService },
|
|
19946
|
-
{ type:
|
|
19947
|
-
{ type: i4.OAuthService },
|
|
19948
|
-
{ type: ApplicationContextService }
|
|
19643
|
+
{ type: DmLoaiCongViecService }
|
|
19949
19644
|
]; };
|
|
19950
19645
|
|
|
19951
|
-
var
|
|
19952
|
-
|
|
19953
|
-
|
|
19954
|
-
|
|
19955
|
-
|
|
19956
|
-
|
|
19957
|
-
|
|
19958
|
-
var getCompareFunc = function (primer, reverse) {
|
|
19959
|
-
var defaultCompare = defaultCompareFunc;
|
|
19960
|
-
var compare = defaultCompareFunc;
|
|
19961
|
-
if (primer) {
|
|
19962
|
-
compare = function (a, b) {
|
|
19963
|
-
return defaultCompare(primer(a), primer(b));
|
|
19964
|
-
};
|
|
19965
|
-
}
|
|
19966
|
-
if (reverse) {
|
|
19967
|
-
return function (a, b) {
|
|
19968
|
-
return -1 * compare(a, b);
|
|
19969
|
-
};
|
|
19970
|
-
}
|
|
19971
|
-
return compare;
|
|
19972
|
-
};
|
|
19973
|
-
sort_by = function () {
|
|
19974
|
-
var args = [];
|
|
19975
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
19976
|
-
args[_i] = arguments[_i];
|
|
19977
|
-
}
|
|
19978
|
-
var fields = [], n_fields = args.length;
|
|
19979
|
-
var field, name, cmp;
|
|
19980
|
-
// preprocess sorting options
|
|
19981
|
-
for (var i = 0; i < n_fields; i++) {
|
|
19982
|
-
field = args[i];
|
|
19983
|
-
if (typeof field === 'string') {
|
|
19984
|
-
name = field;
|
|
19985
|
-
cmp = defaultCompareFunc;
|
|
19986
|
-
}
|
|
19987
|
-
else {
|
|
19988
|
-
name = field.name;
|
|
19989
|
-
cmp = getCompareFunc(field.primer, field.reverse);
|
|
19990
|
-
}
|
|
19991
|
-
fields.push({
|
|
19992
|
-
name: name,
|
|
19993
|
-
cmp: cmp
|
|
19994
|
-
});
|
|
19646
|
+
var SearchInfo = /** @class */ (function () {
|
|
19647
|
+
function SearchInfo(init) {
|
|
19648
|
+
this.fieldSearchText = [];
|
|
19649
|
+
this.tooltipSearchText = '';
|
|
19650
|
+
this.fieldDropdown = {};
|
|
19651
|
+
for (var key in init) {
|
|
19652
|
+
this[key] = init[key];
|
|
19995
19653
|
}
|
|
19996
|
-
|
|
19997
|
-
|
|
19998
|
-
var name, result;
|
|
19999
|
-
for (var i = 0; i < n_fields; i++) {
|
|
20000
|
-
result = 0;
|
|
20001
|
-
field = fields[i];
|
|
20002
|
-
name = field.name;
|
|
20003
|
-
result = field.cmp(A[name], B[name]);
|
|
20004
|
-
if (result !== 0)
|
|
20005
|
-
break;
|
|
20006
|
-
}
|
|
20007
|
-
return result;
|
|
20008
|
-
};
|
|
20009
|
-
};
|
|
19654
|
+
}
|
|
19655
|
+
return SearchInfo;
|
|
20010
19656
|
}());
|
|
20011
|
-
// multipleSort('idTinhThanh', 'idQuanHuyen')
|
|
20012
|
-
// multipleSort({name: 'idTinhThanh', reverse: true}, 'idQuanHuyen')
|
|
20013
|
-
// multipleSort({name: 'soThuTu', primer: parseInt}, 'idQuanHuyen') // parseInt là function
|
|
20014
|
-
var multipleSort = sort_by;
|
|
20015
19657
|
|
|
20016
|
-
var
|
|
20017
|
-
|
|
20018
|
-
|
|
20019
|
-
|
|
20020
|
-
|
|
20021
|
-
|
|
20022
|
-
|
|
20023
|
-
|
|
20024
|
-
|
|
20025
|
-
script.onerror = reject;
|
|
20026
|
-
script.onload = function () {
|
|
20027
|
-
moduleMap[remoteEntry] = true;
|
|
20028
|
-
resolve(); // window is the global namespace
|
|
20029
|
-
};
|
|
20030
|
-
document.body.append(script);
|
|
20031
|
-
});
|
|
20032
|
-
}
|
|
20033
|
-
function lookupExposedModule(remoteName, exposedModule) {
|
|
20034
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
20035
|
-
var container, factory, Module;
|
|
20036
|
-
return __generator(this, function (_a) {
|
|
20037
|
-
switch (_a.label) {
|
|
20038
|
-
case 0:
|
|
20039
|
-
// Initializes the share scope. This fills it with known provided modules from this build and all remotes
|
|
20040
|
-
return [4 /*yield*/, __webpack_init_sharing__('default')];
|
|
20041
|
-
case 1:
|
|
20042
|
-
// Initializes the share scope. This fills it with known provided modules from this build and all remotes
|
|
20043
|
-
_a.sent();
|
|
20044
|
-
container = window[remoteName];
|
|
20045
|
-
// Initialize the container, it may provide shared modules
|
|
20046
|
-
return [4 /*yield*/, container.init(__webpack_share_scopes__.default)];
|
|
20047
|
-
case 2:
|
|
20048
|
-
// Initialize the container, it may provide shared modules
|
|
20049
|
-
_a.sent();
|
|
20050
|
-
return [4 /*yield*/, container.get(exposedModule)];
|
|
20051
|
-
case 3:
|
|
20052
|
-
factory = _a.sent();
|
|
20053
|
-
Module = factory();
|
|
20054
|
-
return [2 /*return*/, Module];
|
|
20055
|
-
}
|
|
20056
|
-
});
|
|
20057
|
-
});
|
|
20058
|
-
}
|
|
20059
|
-
function loadRemoteModule(options) {
|
|
20060
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
20061
|
-
return __generator(this, function (_a) {
|
|
20062
|
-
switch (_a.label) {
|
|
20063
|
-
case 0: return [4 /*yield*/, loadRemoteEntry(options.remoteEntry)];
|
|
20064
|
-
case 1:
|
|
20065
|
-
_a.sent();
|
|
20066
|
-
return [4 /*yield*/, lookupExposedModule(options.remoteName, options.exposedModule)];
|
|
20067
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
20068
|
-
}
|
|
20069
|
-
});
|
|
20070
|
-
});
|
|
20071
|
-
}
|
|
20072
|
-
function loadRemotePageModule(remoteName, module, environment) {
|
|
20073
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
20074
|
-
var remoteEntry, options;
|
|
20075
|
-
return __generator(this, function (_a) {
|
|
20076
|
-
switch (_a.label) {
|
|
20077
|
-
case 0:
|
|
20078
|
-
remoteEntry = environment.clientDomain.appDomain + "/" + remoteName + "/remoteEntry.js";
|
|
20079
|
-
if (!environment.production) {
|
|
20080
|
-
remoteEntry = environment.clientDomain[remoteName] + "/remoteEntry.js";
|
|
20081
|
-
}
|
|
20082
|
-
options = {
|
|
20083
|
-
remoteName: remoteName,
|
|
20084
|
-
remoteEntry: remoteEntry,
|
|
20085
|
-
exposedModule: module,
|
|
20086
|
-
};
|
|
20087
|
-
return [4 /*yield*/, loadRemoteModule(options)];
|
|
20088
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
20089
|
-
}
|
|
20090
|
-
});
|
|
20091
|
-
});
|
|
20092
|
-
}
|
|
20093
|
-
|
|
20094
|
-
var FederationService = /** @class */ (function () {
|
|
20095
|
-
function FederationService(resolver, _moduleConfigService) {
|
|
20096
|
-
this.resolver = resolver;
|
|
20097
|
-
this._moduleConfigService = _moduleConfigService;
|
|
20098
|
-
this.environment = _moduleConfigService.getConfig().environment;
|
|
19658
|
+
var BasePermissionService = /** @class */ (function (_super) {
|
|
19659
|
+
__extends(BasePermissionService, _super);
|
|
19660
|
+
function BasePermissionService(http, injector, _moduleConfigService) {
|
|
19661
|
+
var _this = _super.call(this, http, injector, _moduleConfigService.getConfig().environment.apiDomain.authorizationEndpoint + "/" + _moduleConfigService.getConfig().environment.apiVersion + "/BasePermission") || this;
|
|
19662
|
+
_this._moduleConfigService = _moduleConfigService;
|
|
19663
|
+
_this.entityName = 'BasePermission';
|
|
19664
|
+
_this.serviceCode = 'Authorization';
|
|
19665
|
+
_this.endPoint = _moduleConfigService.getConfig().environment.apiDomain.authorizationEndpoint;
|
|
19666
|
+
return _this;
|
|
20099
19667
|
}
|
|
20100
|
-
|
|
20101
|
-
return
|
|
20102
|
-
var remoteEntry, options, component, componentFactory, viewContainer, compRef;
|
|
20103
|
-
return __generator(this, function (_a) {
|
|
20104
|
-
switch (_a.label) {
|
|
20105
|
-
case 0:
|
|
20106
|
-
remoteEntry = this.environment.clientDomain.appDomain + "/" + remoteName + "/remoteEntry.js";
|
|
20107
|
-
if (!this.environment.production) {
|
|
20108
|
-
remoteEntry = this.environment.clientDomain[remoteName] + "/remoteEntry.js";
|
|
20109
|
-
}
|
|
20110
|
-
options = {
|
|
20111
|
-
remoteName: remoteName,
|
|
20112
|
-
remoteEntry: remoteEntry,
|
|
20113
|
-
exposedModule: componentName,
|
|
20114
|
-
};
|
|
20115
|
-
return [4 /*yield*/, loadRemoteModule(options)];
|
|
20116
|
-
case 1:
|
|
20117
|
-
component = _a.sent();
|
|
20118
|
-
componentFactory = this.resolver.resolveComponentFactory(component[componentName]);
|
|
20119
|
-
viewContainer = viewContainerRef.viewContainerRef;
|
|
20120
|
-
viewContainer.clear();
|
|
20121
|
-
compRef = viewContainer.createComponent(componentFactory);
|
|
20122
|
-
return [2 /*return*/, compRef];
|
|
20123
|
-
}
|
|
20124
|
-
});
|
|
20125
|
-
});
|
|
20126
|
-
};
|
|
20127
|
-
FederationService.prototype.loadRemoteNewComponent = function (remoteName, componentName, viewContainerRef) {
|
|
20128
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
20129
|
-
var remoteEntry, options, component, componentFactory, compRef;
|
|
20130
|
-
return __generator(this, function (_a) {
|
|
20131
|
-
switch (_a.label) {
|
|
20132
|
-
case 0:
|
|
20133
|
-
remoteEntry = this.environment.clientDomain.appDomain + "/" + remoteName + "/remoteEntry.js";
|
|
20134
|
-
if (!this.environment.production) {
|
|
20135
|
-
remoteEntry = this.environment.clientDomain[remoteName] + "/remoteEntry.js";
|
|
20136
|
-
}
|
|
20137
|
-
options = {
|
|
20138
|
-
remoteName: remoteName,
|
|
20139
|
-
remoteEntry: remoteEntry,
|
|
20140
|
-
exposedModule: componentName,
|
|
20141
|
-
};
|
|
20142
|
-
return [4 /*yield*/, loadRemoteModule(options)];
|
|
20143
|
-
case 1:
|
|
20144
|
-
component = _a.sent();
|
|
20145
|
-
componentFactory = this.resolver.resolveComponentFactory(component[componentName]);
|
|
20146
|
-
viewContainerRef.clear();
|
|
20147
|
-
compRef = viewContainerRef.createComponent(componentFactory);
|
|
20148
|
-
return [2 /*return*/, compRef];
|
|
20149
|
-
}
|
|
20150
|
-
});
|
|
20151
|
-
});
|
|
19668
|
+
BasePermissionService.prototype.getPermissionByCode = function (code) {
|
|
19669
|
+
return this.defaultGet(this.serviceUri + "/GetPermissionByCode?code=" + code);
|
|
20152
19670
|
};
|
|
20153
|
-
return
|
|
20154
|
-
}());
|
|
20155
|
-
|
|
20156
|
-
|
|
19671
|
+
return BasePermissionService;
|
|
19672
|
+
}(BaseService));
|
|
19673
|
+
BasePermissionService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function BasePermissionService_Factory() { return new BasePermissionService(i0__namespace.ɵɵinject(i1__namespace$1.HttpClient), i0__namespace.ɵɵinject(i0__namespace.INJECTOR), i0__namespace.ɵɵinject(ModuleConfigService)); }, token: BasePermissionService, providedIn: "root" });
|
|
19674
|
+
BasePermissionService.decorators = [
|
|
20157
19675
|
{ type: i0.Injectable, args: [{
|
|
20158
19676
|
providedIn: 'root'
|
|
20159
19677
|
},] }
|
|
20160
19678
|
];
|
|
20161
|
-
|
|
20162
|
-
{ type:
|
|
19679
|
+
BasePermissionService.ctorParameters = function () { return [
|
|
19680
|
+
{ type: i1$1.HttpClient },
|
|
19681
|
+
{ type: i0.Injector },
|
|
20163
19682
|
{ type: ModuleConfigService }
|
|
20164
19683
|
]; };
|
|
20165
19684
|
|
|
@@ -21141,380 +20660,881 @@
|
|
|
21141
20660
|
var url = this.serviceUri + "/GetDanhSachUserCapTren";
|
|
21142
20661
|
return this.defaultPost(url, idsDonVi);
|
|
21143
20662
|
};
|
|
21144
|
-
return CanBoHoSoService;
|
|
21145
|
-
}(BaseService));
|
|
21146
|
-
CanBoHoSoService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function CanBoHoSoService_Factory() { return new CanBoHoSoService(i0__namespace.ɵɵinject(i1__namespace$1.HttpClient), i0__namespace.ɵɵinject(i0__namespace.INJECTOR), i0__namespace.ɵɵinject(ModuleConfigService), i0__namespace.ɵɵinject(UserService), i0__namespace.ɵɵinject(CanBo_HoSo_CoCauToChucService), i0__namespace.ɵɵinject(CoCauToChucService), i0__namespace.ɵɵinject(HoSoDoiTacService), i0__namespace.ɵɵinject(CrudService)); }, token: CanBoHoSoService, providedIn: "root" });
|
|
21147
|
-
CanBoHoSoService.decorators = [
|
|
20663
|
+
return CanBoHoSoService;
|
|
20664
|
+
}(BaseService));
|
|
20665
|
+
CanBoHoSoService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function CanBoHoSoService_Factory() { return new CanBoHoSoService(i0__namespace.ɵɵinject(i1__namespace$1.HttpClient), i0__namespace.ɵɵinject(i0__namespace.INJECTOR), i0__namespace.ɵɵinject(ModuleConfigService), i0__namespace.ɵɵinject(UserService), i0__namespace.ɵɵinject(CanBo_HoSo_CoCauToChucService), i0__namespace.ɵɵinject(CoCauToChucService), i0__namespace.ɵɵinject(HoSoDoiTacService), i0__namespace.ɵɵinject(CrudService)); }, token: CanBoHoSoService, providedIn: "root" });
|
|
20666
|
+
CanBoHoSoService.decorators = [
|
|
20667
|
+
{ type: i0.Injectable, args: [{
|
|
20668
|
+
providedIn: 'root'
|
|
20669
|
+
},] }
|
|
20670
|
+
];
|
|
20671
|
+
CanBoHoSoService.ctorParameters = function () { return [
|
|
20672
|
+
{ type: i1$1.HttpClient },
|
|
20673
|
+
{ type: i0.Injector },
|
|
20674
|
+
{ type: ModuleConfigService },
|
|
20675
|
+
{ type: UserService },
|
|
20676
|
+
{ type: CanBo_HoSo_CoCauToChucService },
|
|
20677
|
+
{ type: CoCauToChucService },
|
|
20678
|
+
{ type: HoSoDoiTacService },
|
|
20679
|
+
{ type: CrudService }
|
|
20680
|
+
]; };
|
|
20681
|
+
|
|
20682
|
+
var EntityWorkflowHistoryService = /** @class */ (function (_super) {
|
|
20683
|
+
__extends(EntityWorkflowHistoryService, _super);
|
|
20684
|
+
function EntityWorkflowHistoryService(http, injector, _moduleConfigService) {
|
|
20685
|
+
var _this = _super.call(this, http, injector, _moduleConfigService.getConfig().environment.apiDomain.userOrgEndpoint + "/" + _moduleConfigService.getConfig().environment.apiVersion + "/EntityWorkflowHistory") || this;
|
|
20686
|
+
_this.entityName = 'EntityWorkflowHistory';
|
|
20687
|
+
_this.serviceManagers = {};
|
|
20688
|
+
_this.endPoint = _moduleConfigService.getConfig().environment.apiDomain.userOrgEndpoint;
|
|
20689
|
+
_this._moduleConfig = _moduleConfigService.getConfig();
|
|
20690
|
+
return _this;
|
|
20691
|
+
}
|
|
20692
|
+
EntityWorkflowHistoryService.prototype.registerService = function (entityName, service) {
|
|
20693
|
+
this.serviceManagers[entityName] = service;
|
|
20694
|
+
};
|
|
20695
|
+
EntityWorkflowHistoryService.prototype.getEndpointByService = function (service) {
|
|
20696
|
+
return service.endPoint + "/" + this._moduleConfig.environment.apiVersion;
|
|
20697
|
+
};
|
|
20698
|
+
EntityWorkflowHistoryService.prototype.setCurrentServiceUri = function (tableName) {
|
|
20699
|
+
var service = this.serviceManagers[tableName];
|
|
20700
|
+
if (service == undefined) {
|
|
20701
|
+
(this._injector.get(NotifierService)).showWarning('Bạn chưa đăng ký base service cho entity workflow history');
|
|
20702
|
+
}
|
|
20703
|
+
this.serviceUri = this.getEndpointByService(service) + "/EntityWorkflowHistory";
|
|
20704
|
+
};
|
|
20705
|
+
EntityWorkflowHistoryService.prototype.getLastHistory = function (tableName, filters) {
|
|
20706
|
+
if (filters === void 0) { filters = []; }
|
|
20707
|
+
var service = this.serviceManagers[tableName];
|
|
20708
|
+
if (service == undefined) {
|
|
20709
|
+
(this._injector.get(NotifierService)).showWarning('Bạn chưa đăng ký base service cho entity workflow history');
|
|
20710
|
+
}
|
|
20711
|
+
var url = this.getEndpointByService(service) + "/EntityWorkflowHistory/GetLastByFilter";
|
|
20712
|
+
var gridInfo = {
|
|
20713
|
+
pageInfo: {
|
|
20714
|
+
page: 1,
|
|
20715
|
+
pageSize: 1
|
|
20716
|
+
},
|
|
20717
|
+
filters: filters,
|
|
20718
|
+
sorts: [
|
|
20719
|
+
new Sort({ field: 'created', dir: 1 })
|
|
20720
|
+
]
|
|
20721
|
+
};
|
|
20722
|
+
return this.defaultPost(url, gridInfo);
|
|
20723
|
+
};
|
|
20724
|
+
return EntityWorkflowHistoryService;
|
|
20725
|
+
}(BaseService));
|
|
20726
|
+
EntityWorkflowHistoryService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function EntityWorkflowHistoryService_Factory() { return new EntityWorkflowHistoryService(i0__namespace.ɵɵinject(i1__namespace$1.HttpClient), i0__namespace.ɵɵinject(i0__namespace.INJECTOR), i0__namespace.ɵɵinject(ModuleConfigService)); }, token: EntityWorkflowHistoryService, providedIn: "root" });
|
|
20727
|
+
EntityWorkflowHistoryService.decorators = [
|
|
20728
|
+
{ type: i0.Injectable, args: [{
|
|
20729
|
+
providedIn: 'root'
|
|
20730
|
+
},] }
|
|
20731
|
+
];
|
|
20732
|
+
EntityWorkflowHistoryService.ctorParameters = function () { return [
|
|
20733
|
+
{ type: i1$1.HttpClient },
|
|
20734
|
+
{ type: i0.Injector },
|
|
20735
|
+
{ type: ModuleConfigService }
|
|
20736
|
+
]; };
|
|
20737
|
+
|
|
20738
|
+
var EXCEL_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8';
|
|
20739
|
+
var EXCEL_EXTENSION = '.xlsx';
|
|
20740
|
+
var ExportService = /** @class */ (function () {
|
|
20741
|
+
function ExportService(_http, _injector, _commonService, _moduleConfigService) {
|
|
20742
|
+
this._http = _http;
|
|
20743
|
+
this._injector = _injector;
|
|
20744
|
+
this._commonService = _commonService;
|
|
20745
|
+
this._moduleConfig = _moduleConfigService.getConfig();
|
|
20746
|
+
this.environment = this._moduleConfig.environment;
|
|
20747
|
+
this.serviceUri = this._moduleConfig.environment.apiDomain.templateEndpoint + "/Export";
|
|
20748
|
+
}
|
|
20749
|
+
ExportService.prototype.objectToExcel = function (data, fileName, numOfHeaderRow) {
|
|
20750
|
+
var _this = this;
|
|
20751
|
+
return this._http
|
|
20752
|
+
.post(this.serviceUri + "/ObjectToExcel?numOfHeaderRow=" + numOfHeaderRow, data, { responseType: 'blob' })
|
|
20753
|
+
.pipe(operators.catchError(function (err) { return _this._commonService.handleError(err, _this._injector); }))
|
|
20754
|
+
.subscribe(function (res) {
|
|
20755
|
+
_this.saveAsExcelFile(res, fileName);
|
|
20756
|
+
});
|
|
20757
|
+
};
|
|
20758
|
+
ExportService.prototype.saveAsExcelFile = function (buffer, fileName) {
|
|
20759
|
+
var data = new Blob([buffer], {
|
|
20760
|
+
type: EXCEL_TYPE
|
|
20761
|
+
});
|
|
20762
|
+
FileSaver__default["default"].saveAs(data, fileName + '_' + new Date().getTime() + EXCEL_EXTENSION);
|
|
20763
|
+
};
|
|
20764
|
+
ExportService.prototype.saveSpreadSheet = function (buffer, fileName) {
|
|
20765
|
+
var data = new Blob([buffer], {
|
|
20766
|
+
type: EXCEL_TYPE
|
|
20767
|
+
});
|
|
20768
|
+
FileSaver__default["default"].saveAs(data, new Date().getTime() + '_' + fileName);
|
|
20769
|
+
};
|
|
20770
|
+
return ExportService;
|
|
20771
|
+
}());
|
|
20772
|
+
ExportService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function ExportService_Factory() { return new ExportService(i0__namespace.ɵɵinject(i1__namespace$1.HttpClient), i0__namespace.ɵɵinject(i0__namespace.INJECTOR), i0__namespace.ɵɵinject(CommonService), i0__namespace.ɵɵinject(ModuleConfigService)); }, token: ExportService, providedIn: "root" });
|
|
20773
|
+
ExportService.decorators = [
|
|
20774
|
+
{ type: i0.Injectable, args: [{
|
|
20775
|
+
providedIn: 'root'
|
|
20776
|
+
},] }
|
|
20777
|
+
];
|
|
20778
|
+
ExportService.ctorParameters = function () { return [
|
|
20779
|
+
{ type: i1$1.HttpClient },
|
|
20780
|
+
{ type: i0.Injector },
|
|
20781
|
+
{ type: CommonService },
|
|
20782
|
+
{ type: ModuleConfigService }
|
|
20783
|
+
]; };
|
|
20784
|
+
|
|
20785
|
+
var moduleMap = {};
|
|
20786
|
+
function loadRemoteEntry(remoteEntry) {
|
|
20787
|
+
return new Promise(function (resolve, reject) {
|
|
20788
|
+
if (moduleMap[remoteEntry]) {
|
|
20789
|
+
resolve();
|
|
20790
|
+
return;
|
|
20791
|
+
}
|
|
20792
|
+
var script = document.createElement('script');
|
|
20793
|
+
script.src = remoteEntry;
|
|
20794
|
+
script.onerror = reject;
|
|
20795
|
+
script.onload = function () {
|
|
20796
|
+
moduleMap[remoteEntry] = true;
|
|
20797
|
+
resolve(); // window is the global namespace
|
|
20798
|
+
};
|
|
20799
|
+
document.body.append(script);
|
|
20800
|
+
});
|
|
20801
|
+
}
|
|
20802
|
+
function lookupExposedModule(remoteName, exposedModule) {
|
|
20803
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
20804
|
+
var container, factory, Module;
|
|
20805
|
+
return __generator(this, function (_a) {
|
|
20806
|
+
switch (_a.label) {
|
|
20807
|
+
case 0:
|
|
20808
|
+
// Initializes the share scope. This fills it with known provided modules from this build and all remotes
|
|
20809
|
+
return [4 /*yield*/, __webpack_init_sharing__('default')];
|
|
20810
|
+
case 1:
|
|
20811
|
+
// Initializes the share scope. This fills it with known provided modules from this build and all remotes
|
|
20812
|
+
_a.sent();
|
|
20813
|
+
container = window[remoteName];
|
|
20814
|
+
// Initialize the container, it may provide shared modules
|
|
20815
|
+
return [4 /*yield*/, container.init(__webpack_share_scopes__.default)];
|
|
20816
|
+
case 2:
|
|
20817
|
+
// Initialize the container, it may provide shared modules
|
|
20818
|
+
_a.sent();
|
|
20819
|
+
return [4 /*yield*/, container.get(exposedModule)];
|
|
20820
|
+
case 3:
|
|
20821
|
+
factory = _a.sent();
|
|
20822
|
+
Module = factory();
|
|
20823
|
+
return [2 /*return*/, Module];
|
|
20824
|
+
}
|
|
20825
|
+
});
|
|
20826
|
+
});
|
|
20827
|
+
}
|
|
20828
|
+
function loadRemoteModule(options) {
|
|
20829
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
20830
|
+
return __generator(this, function (_a) {
|
|
20831
|
+
switch (_a.label) {
|
|
20832
|
+
case 0: return [4 /*yield*/, loadRemoteEntry(options.remoteEntry)];
|
|
20833
|
+
case 1:
|
|
20834
|
+
_a.sent();
|
|
20835
|
+
return [4 /*yield*/, lookupExposedModule(options.remoteName, options.exposedModule)];
|
|
20836
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
20837
|
+
}
|
|
20838
|
+
});
|
|
20839
|
+
});
|
|
20840
|
+
}
|
|
20841
|
+
function loadRemotePageModule(remoteName, module, environment) {
|
|
20842
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
20843
|
+
var remoteEntry, options;
|
|
20844
|
+
return __generator(this, function (_a) {
|
|
20845
|
+
switch (_a.label) {
|
|
20846
|
+
case 0:
|
|
20847
|
+
remoteEntry = environment.clientDomain.appDomain + "/" + remoteName + "/remoteEntry.js";
|
|
20848
|
+
if (!environment.production) {
|
|
20849
|
+
remoteEntry = environment.clientDomain[remoteName] + "/remoteEntry.js";
|
|
20850
|
+
}
|
|
20851
|
+
options = {
|
|
20852
|
+
remoteName: remoteName,
|
|
20853
|
+
remoteEntry: remoteEntry,
|
|
20854
|
+
exposedModule: module,
|
|
20855
|
+
};
|
|
20856
|
+
return [4 /*yield*/, loadRemoteModule(options)];
|
|
20857
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
20858
|
+
}
|
|
20859
|
+
});
|
|
20860
|
+
});
|
|
20861
|
+
}
|
|
20862
|
+
|
|
20863
|
+
var FederationService = /** @class */ (function () {
|
|
20864
|
+
function FederationService(resolver, _moduleConfigService) {
|
|
20865
|
+
this.resolver = resolver;
|
|
20866
|
+
this._moduleConfigService = _moduleConfigService;
|
|
20867
|
+
this.environment = _moduleConfigService.getConfig().environment;
|
|
20868
|
+
}
|
|
20869
|
+
FederationService.prototype.loadRemoteComponent = function (remoteName, componentName, viewContainerRef) {
|
|
20870
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
20871
|
+
var remoteEntry, options, component, componentFactory, viewContainer, compRef;
|
|
20872
|
+
return __generator(this, function (_a) {
|
|
20873
|
+
switch (_a.label) {
|
|
20874
|
+
case 0:
|
|
20875
|
+
remoteEntry = this.environment.clientDomain.appDomain + "/" + remoteName + "/remoteEntry.js";
|
|
20876
|
+
if (!this.environment.production) {
|
|
20877
|
+
remoteEntry = this.environment.clientDomain[remoteName] + "/remoteEntry.js";
|
|
20878
|
+
}
|
|
20879
|
+
options = {
|
|
20880
|
+
remoteName: remoteName,
|
|
20881
|
+
remoteEntry: remoteEntry,
|
|
20882
|
+
exposedModule: componentName,
|
|
20883
|
+
};
|
|
20884
|
+
return [4 /*yield*/, loadRemoteModule(options)];
|
|
20885
|
+
case 1:
|
|
20886
|
+
component = _a.sent();
|
|
20887
|
+
componentFactory = this.resolver.resolveComponentFactory(component[componentName]);
|
|
20888
|
+
viewContainer = viewContainerRef.viewContainerRef;
|
|
20889
|
+
viewContainer.clear();
|
|
20890
|
+
compRef = viewContainer.createComponent(componentFactory);
|
|
20891
|
+
return [2 /*return*/, compRef];
|
|
20892
|
+
}
|
|
20893
|
+
});
|
|
20894
|
+
});
|
|
20895
|
+
};
|
|
20896
|
+
FederationService.prototype.loadRemoteNewComponent = function (remoteName, componentName, viewContainerRef) {
|
|
20897
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
20898
|
+
var remoteEntry, options, component, componentFactory, compRef;
|
|
20899
|
+
return __generator(this, function (_a) {
|
|
20900
|
+
switch (_a.label) {
|
|
20901
|
+
case 0:
|
|
20902
|
+
remoteEntry = this.environment.clientDomain.appDomain + "/" + remoteName + "/remoteEntry.js";
|
|
20903
|
+
if (!this.environment.production) {
|
|
20904
|
+
remoteEntry = this.environment.clientDomain[remoteName] + "/remoteEntry.js";
|
|
20905
|
+
}
|
|
20906
|
+
options = {
|
|
20907
|
+
remoteName: remoteName,
|
|
20908
|
+
remoteEntry: remoteEntry,
|
|
20909
|
+
exposedModule: componentName,
|
|
20910
|
+
};
|
|
20911
|
+
return [4 /*yield*/, loadRemoteModule(options)];
|
|
20912
|
+
case 1:
|
|
20913
|
+
component = _a.sent();
|
|
20914
|
+
componentFactory = this.resolver.resolveComponentFactory(component[componentName]);
|
|
20915
|
+
viewContainerRef.clear();
|
|
20916
|
+
compRef = viewContainerRef.createComponent(componentFactory);
|
|
20917
|
+
return [2 /*return*/, compRef];
|
|
20918
|
+
}
|
|
20919
|
+
});
|
|
20920
|
+
});
|
|
20921
|
+
};
|
|
20922
|
+
return FederationService;
|
|
20923
|
+
}());
|
|
20924
|
+
FederationService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function FederationService_Factory() { return new FederationService(i0__namespace.ɵɵinject(i0__namespace.ComponentFactoryResolver), i0__namespace.ɵɵinject(ModuleConfigService)); }, token: FederationService, providedIn: "root" });
|
|
20925
|
+
FederationService.decorators = [
|
|
21148
20926
|
{ type: i0.Injectable, args: [{
|
|
21149
20927
|
providedIn: 'root'
|
|
21150
20928
|
},] }
|
|
21151
20929
|
];
|
|
21152
|
-
|
|
21153
|
-
{ type:
|
|
21154
|
-
{ type:
|
|
21155
|
-
{ type: ModuleConfigService },
|
|
21156
|
-
{ type: UserService },
|
|
21157
|
-
{ type: CanBo_HoSo_CoCauToChucService },
|
|
21158
|
-
{ type: CoCauToChucService },
|
|
21159
|
-
{ type: HoSoDoiTacService },
|
|
21160
|
-
{ type: CrudService }
|
|
20930
|
+
FederationService.ctorParameters = function () { return [
|
|
20931
|
+
{ type: i0.ComponentFactoryResolver },
|
|
20932
|
+
{ type: ModuleConfigService }
|
|
21161
20933
|
]; };
|
|
21162
20934
|
|
|
21163
|
-
var
|
|
21164
|
-
|
|
21165
|
-
|
|
21166
|
-
|
|
20935
|
+
var PhanQuyenModel = /** @class */ (function () {
|
|
20936
|
+
function PhanQuyenModel(init) {
|
|
20937
|
+
this.addRoleIds = [];
|
|
20938
|
+
this.removeRoleIds = [];
|
|
20939
|
+
this.addPermissionIds = [];
|
|
20940
|
+
this.removePermissionIds = [];
|
|
20941
|
+
for (var key in init) {
|
|
20942
|
+
this[key] = init[key];
|
|
20943
|
+
}
|
|
20944
|
+
}
|
|
20945
|
+
return PhanQuyenModel;
|
|
20946
|
+
}());
|
|
20947
|
+
var PermissionService = /** @class */ (function (_super) {
|
|
20948
|
+
__extends(PermissionService, _super);
|
|
20949
|
+
function PermissionService(http, injector, _moduleConfigService, _userService, _oauthService, _appContext) {
|
|
20950
|
+
var _this = _super.call(this, http, injector, _moduleConfigService.getConfig().environment.apiDomain.authorizationEndpoint + "/" + _moduleConfigService.getConfig().environment.apiVersion + "/permission") || this;
|
|
21167
20951
|
_this._moduleConfigService = _moduleConfigService;
|
|
21168
|
-
_this.
|
|
21169
|
-
_this.
|
|
21170
|
-
_this.
|
|
20952
|
+
_this._userService = _userService;
|
|
20953
|
+
_this._oauthService = _oauthService;
|
|
20954
|
+
_this._appContext = _appContext;
|
|
20955
|
+
_this.storage = sessionStorage;
|
|
20956
|
+
_this.ignoreAdmin = false;
|
|
20957
|
+
_this.delayCheckPermissions = [];
|
|
20958
|
+
_this.appCode = null;
|
|
20959
|
+
_this._config = _this._moduleConfigService.getConfig();
|
|
20960
|
+
_this.endPoint = _this._config.environment.apiDomain.authorizationEndpoint;
|
|
20961
|
+
_this.ignoreAdmin = _this._config.environment.isIgnoreAdmin;
|
|
20962
|
+
_this.appCode = _this._config.appCode;
|
|
21171
20963
|
return _this;
|
|
21172
20964
|
}
|
|
21173
|
-
|
|
21174
|
-
|
|
20965
|
+
PermissionService.prototype.clearPermissionCacheAll = function () {
|
|
20966
|
+
var _a, _b, _c;
|
|
20967
|
+
var lstAppCodes = (_c = (_b = (_a = this._config.environment.appMetadata) === null || _a === void 0 ? void 0 : _a.appSwitcher) === null || _b === void 0 ? void 0 : _b.map(function (app) { return app.code; })) !== null && _c !== void 0 ? _c : [];
|
|
20968
|
+
var lstApiEndpoint = [];
|
|
20969
|
+
var apiDomain = this._config.environment.apiDomain;
|
|
20970
|
+
for (var domainName in apiDomain) {
|
|
20971
|
+
if (domainName.startsWith('-') || domainName.startsWith('1') || domainName == 'gateway')
|
|
20972
|
+
continue;
|
|
20973
|
+
var realDomainName = domainName.split('Endpoint') ? domainName.split('Endpoint')[0] : domainName;
|
|
20974
|
+
lstApiEndpoint.push(realDomainName.toUpperCase());
|
|
20975
|
+
}
|
|
20976
|
+
return this.clearPermissionCache(__spreadArray(__spreadArray([], __read(lstAppCodes)), __read(lstApiEndpoint)));
|
|
21175
20977
|
};
|
|
21176
|
-
|
|
21177
|
-
|
|
20978
|
+
PermissionService.prototype.clearPermissionCache = function (lstModule) {
|
|
20979
|
+
var url = this.serviceUri + "/ClearPermissionCache";
|
|
20980
|
+
return this.defaultPost(url, lstModule);
|
|
20981
|
+
};
|
|
20982
|
+
PermissionService.prototype.getCurrentUserPermission = function () {
|
|
20983
|
+
var url = this.serviceUri + "/GetCurrentUserPermission";
|
|
20984
|
+
return this.defaultGet(url);
|
|
20985
|
+
};
|
|
20986
|
+
PermissionService.prototype.getAllBasePermission = function (userId) {
|
|
20987
|
+
var _a, _b, _c;
|
|
20988
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
20989
|
+
var url, user, res, lstAppCodes, promiseArr, lstAppCodes_1, lstAppCodes_1_1, code, lstAppCodes_2, lstAppCodes_2_1, service, permissions, serviceCode, key_1, key, storageItem;
|
|
20990
|
+
var e_1, _d, e_2, _e;
|
|
20991
|
+
return __generator(this, function (_f) {
|
|
20992
|
+
switch (_f.label) {
|
|
20993
|
+
case 0:
|
|
20994
|
+
url = this.serviceUri + "/GetAllBasePermission";
|
|
20995
|
+
// return sớm vì đây là trường hợp lấy permission theo Id của User
|
|
20996
|
+
// ko set local storage vì sẽ làm hỏng quyền của người dùng hiện tại
|
|
20997
|
+
if (userId && userId != '' && userId != this._commonService.guidEmpty()) {
|
|
20998
|
+
return [2 /*return*/, this.defaultGet(url + ("?userId=" + userId))];
|
|
20999
|
+
}
|
|
21000
|
+
if (i0.isDevMode()) {
|
|
21001
|
+
return [2 /*return*/];
|
|
21002
|
+
}
|
|
21003
|
+
user = this._userService.getCurrentUser();
|
|
21004
|
+
if (user
|
|
21005
|
+
&& (user.issuperuser && user.issuperuser.toLowerCase() == 'true')
|
|
21006
|
+
|| (user.isadmin && user.isadmin.toLowerCase() == 'true' && !this.ignoreAdmin)) {
|
|
21007
|
+
return [2 /*return*/];
|
|
21008
|
+
}
|
|
21009
|
+
return [4 /*yield*/, this.defaultGet(url)];
|
|
21010
|
+
case 1:
|
|
21011
|
+
res = _f.sent();
|
|
21012
|
+
lstAppCodes = (_c = (_b = (_a = this._config.environment.appMetadata) === null || _a === void 0 ? void 0 : _a.appSwitcher) === null || _b === void 0 ? void 0 : _b.map(function (app) { return app.code; })) !== null && _c !== void 0 ? _c : [];
|
|
21013
|
+
if (!(!res || !res.success || res.data == null)) return [3 /*break*/, 3];
|
|
21014
|
+
promiseArr = [];
|
|
21015
|
+
try {
|
|
21016
|
+
for (lstAppCodes_1 = __values(lstAppCodes), lstAppCodes_1_1 = lstAppCodes_1.next(); !lstAppCodes_1_1.done; lstAppCodes_1_1 = lstAppCodes_1.next()) {
|
|
21017
|
+
code = lstAppCodes_1_1.value;
|
|
21018
|
+
promiseArr.push(this.getServicePermission(code, true));
|
|
21019
|
+
}
|
|
21020
|
+
}
|
|
21021
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
21022
|
+
finally {
|
|
21023
|
+
try {
|
|
21024
|
+
if (lstAppCodes_1_1 && !lstAppCodes_1_1.done && (_d = lstAppCodes_1.return)) _d.call(lstAppCodes_1);
|
|
21025
|
+
}
|
|
21026
|
+
finally { if (e_1) throw e_1.error; }
|
|
21027
|
+
}
|
|
21028
|
+
return [4 /*yield*/, Promise.all(promiseArr)];
|
|
21029
|
+
case 2:
|
|
21030
|
+
_f.sent();
|
|
21031
|
+
return [2 /*return*/];
|
|
21032
|
+
case 3:
|
|
21033
|
+
try {
|
|
21034
|
+
// Set local storage cho permission của người dùng
|
|
21035
|
+
for (lstAppCodes_2 = __values(lstAppCodes), lstAppCodes_2_1 = lstAppCodes_2.next(); !lstAppCodes_2_1.done; lstAppCodes_2_1 = lstAppCodes_2.next()) {
|
|
21036
|
+
service = lstAppCodes_2_1.value;
|
|
21037
|
+
permissions = [];
|
|
21038
|
+
serviceCode = service.toUpperCase();
|
|
21039
|
+
for (key_1 in res.data) {
|
|
21040
|
+
if (key_1.toUpperCase() != serviceCode) {
|
|
21041
|
+
continue;
|
|
21042
|
+
}
|
|
21043
|
+
permissions = res.data[key_1];
|
|
21044
|
+
break;
|
|
21045
|
+
}
|
|
21046
|
+
key = "AUTHORIZATION." + serviceCode;
|
|
21047
|
+
storageItem = this.storage.getItem(key);
|
|
21048
|
+
if (storageItem != null) {
|
|
21049
|
+
this.storage.removeItem(key);
|
|
21050
|
+
}
|
|
21051
|
+
this.storage.setItem(key, JSON.stringify(permissions));
|
|
21052
|
+
}
|
|
21053
|
+
}
|
|
21054
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
21055
|
+
finally {
|
|
21056
|
+
try {
|
|
21057
|
+
if (lstAppCodes_2_1 && !lstAppCodes_2_1.done && (_e = lstAppCodes_2.return)) _e.call(lstAppCodes_2);
|
|
21058
|
+
}
|
|
21059
|
+
finally { if (e_2) throw e_2.error; }
|
|
21060
|
+
}
|
|
21061
|
+
return [2 /*return*/];
|
|
21062
|
+
}
|
|
21063
|
+
});
|
|
21064
|
+
});
|
|
21065
|
+
};
|
|
21066
|
+
/**
|
|
21067
|
+
* Truyền vào danh sách permision cần check
|
|
21068
|
+
* @param lstPermissionCode những perrmision code cần check => nên dùng trong trường hợp check các button trong code
|
|
21069
|
+
* @returns trả ra các perrmisionCode có quyền
|
|
21070
|
+
*/
|
|
21071
|
+
PermissionService.prototype.getPermissionAuthorized = function (lstPermissionCode) {
|
|
21072
|
+
var _this = this;
|
|
21073
|
+
return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
21074
|
+
var user, result, lstPermissionCode_1, lstPermissionCode_1_1, item, e_3_1;
|
|
21075
|
+
var e_3, _d;
|
|
21076
|
+
return __generator(this, function (_e) {
|
|
21077
|
+
switch (_e.label) {
|
|
21078
|
+
case 0: return [4 /*yield*/, this._userService.getCurrentUser()];
|
|
21079
|
+
case 1:
|
|
21080
|
+
user = (_e.sent());
|
|
21081
|
+
if (user && user.issuperuser.toLowerCase() == 'true') {
|
|
21082
|
+
resolve(lstPermissionCode);
|
|
21083
|
+
return [2 /*return*/];
|
|
21084
|
+
}
|
|
21085
|
+
if (user && user.isadmin.toLowerCase() == 'true' && !this.ignoreAdmin) {
|
|
21086
|
+
resolve(lstPermissionCode);
|
|
21087
|
+
return [2 /*return*/];
|
|
21088
|
+
}
|
|
21089
|
+
result = [];
|
|
21090
|
+
_e.label = 2;
|
|
21091
|
+
case 2:
|
|
21092
|
+
_e.trys.push([2, 7, 8, 9]);
|
|
21093
|
+
lstPermissionCode_1 = __values(lstPermissionCode), lstPermissionCode_1_1 = lstPermissionCode_1.next();
|
|
21094
|
+
_e.label = 3;
|
|
21095
|
+
case 3:
|
|
21096
|
+
if (!!lstPermissionCode_1_1.done) return [3 /*break*/, 6];
|
|
21097
|
+
item = lstPermissionCode_1_1.value;
|
|
21098
|
+
return [4 /*yield*/, this.isAuthorizedPermission(item)];
|
|
21099
|
+
case 4:
|
|
21100
|
+
if (_e.sent()) {
|
|
21101
|
+
result.push(item);
|
|
21102
|
+
}
|
|
21103
|
+
_e.label = 5;
|
|
21104
|
+
case 5:
|
|
21105
|
+
lstPermissionCode_1_1 = lstPermissionCode_1.next();
|
|
21106
|
+
return [3 /*break*/, 3];
|
|
21107
|
+
case 6: return [3 /*break*/, 9];
|
|
21108
|
+
case 7:
|
|
21109
|
+
e_3_1 = _e.sent();
|
|
21110
|
+
e_3 = { error: e_3_1 };
|
|
21111
|
+
return [3 /*break*/, 9];
|
|
21112
|
+
case 8:
|
|
21113
|
+
try {
|
|
21114
|
+
if (lstPermissionCode_1_1 && !lstPermissionCode_1_1.done && (_d = lstPermissionCode_1.return)) _d.call(lstPermissionCode_1);
|
|
21115
|
+
}
|
|
21116
|
+
finally { if (e_3) throw e_3.error; }
|
|
21117
|
+
return [7 /*endfinally*/];
|
|
21118
|
+
case 9:
|
|
21119
|
+
resolve(result);
|
|
21120
|
+
return [2 /*return*/];
|
|
21121
|
+
}
|
|
21122
|
+
});
|
|
21123
|
+
}); });
|
|
21124
|
+
};
|
|
21125
|
+
PermissionService.prototype.isAuthorizedPermission = function (permission) {
|
|
21126
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
21127
|
+
var retryCount;
|
|
21128
|
+
return __generator(this, function (_d) {
|
|
21129
|
+
switch (_d.label) {
|
|
21130
|
+
case 0:
|
|
21131
|
+
retryCount = 0;
|
|
21132
|
+
_d.label = 1;
|
|
21133
|
+
case 1:
|
|
21134
|
+
if (!!this._oauthService.hasValidAccessToken()) return [3 /*break*/, 3];
|
|
21135
|
+
return [4 /*yield*/, this._commonService.delay(100)];
|
|
21136
|
+
case 2:
|
|
21137
|
+
_d.sent();
|
|
21138
|
+
retryCount++;
|
|
21139
|
+
if (retryCount > 50) {
|
|
21140
|
+
return [3 /*break*/, 3];
|
|
21141
|
+
}
|
|
21142
|
+
return [3 /*break*/, 1];
|
|
21143
|
+
case 3: return [4 /*yield*/, this.checkPermission(this.appCode, permission)];
|
|
21144
|
+
case 4: return [2 /*return*/, _d.sent()];
|
|
21145
|
+
}
|
|
21146
|
+
});
|
|
21147
|
+
});
|
|
21178
21148
|
};
|
|
21179
|
-
|
|
21180
|
-
|
|
21149
|
+
PermissionService.prototype.isAuthorized = function (service, permission, checForMenu) {
|
|
21150
|
+
if (checForMenu === void 0) { checForMenu = false; }
|
|
21151
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
21152
|
+
var retryCount;
|
|
21153
|
+
return __generator(this, function (_d) {
|
|
21154
|
+
switch (_d.label) {
|
|
21155
|
+
case 0:
|
|
21156
|
+
this.root = this._appContext.getRootContext();
|
|
21157
|
+
retryCount = 0;
|
|
21158
|
+
_d.label = 1;
|
|
21159
|
+
case 1:
|
|
21160
|
+
if (!!this._oauthService.hasValidAccessToken()) return [3 /*break*/, 3];
|
|
21161
|
+
return [4 /*yield*/, this._commonService.delay(100)];
|
|
21162
|
+
case 2:
|
|
21163
|
+
_d.sent();
|
|
21164
|
+
retryCount++;
|
|
21165
|
+
if (retryCount > 50) {
|
|
21166
|
+
return [3 /*break*/, 3];
|
|
21167
|
+
}
|
|
21168
|
+
return [3 /*break*/, 1];
|
|
21169
|
+
case 3: return [4 /*yield*/, this.checkPermission(service, permission, checForMenu)];
|
|
21170
|
+
case 4: return [2 /*return*/, _d.sent()];
|
|
21171
|
+
}
|
|
21172
|
+
});
|
|
21173
|
+
});
|
|
21181
21174
|
};
|
|
21182
|
-
|
|
21183
|
-
|
|
21184
|
-
|
|
21185
|
-
|
|
21186
|
-
|
|
21187
|
-
|
|
21188
|
-
},] }
|
|
21189
|
-
];
|
|
21190
|
-
StateMachinesService.ctorParameters = function () { return [
|
|
21191
|
-
{ type: i1$1.HttpClient },
|
|
21192
|
-
{ type: i0.Injector },
|
|
21193
|
-
{ type: ModuleConfigService }
|
|
21194
|
-
]; };
|
|
21195
|
-
|
|
21196
|
-
var CauHinhWorkflowService = /** @class */ (function (_super) {
|
|
21197
|
-
__extends(CauHinhWorkflowService, _super);
|
|
21198
|
-
function CauHinhWorkflowService(http, injector, _moduleConfigService) {
|
|
21199
|
-
var _this = _super.call(this, http, injector, _moduleConfigService.getConfig().environment.apiDomain.congviecEndpoint + "/" + _moduleConfigService.getConfig().environment.apiVersion + "/CauHinhWorkflow") || this;
|
|
21200
|
-
_this._moduleConfigService = _moduleConfigService;
|
|
21201
|
-
_this.serviceCode = 'congviec';
|
|
21202
|
-
_this.entityName = 'CauHinhWorkflow';
|
|
21203
|
-
_this.endPoint = _moduleConfigService.getConfig().environment.apiDomain.congviecEndpoint;
|
|
21204
|
-
return _this;
|
|
21205
|
-
}
|
|
21206
|
-
return CauHinhWorkflowService;
|
|
21207
|
-
}(BaseService));
|
|
21208
|
-
CauHinhWorkflowService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function CauHinhWorkflowService_Factory() { return new CauHinhWorkflowService(i0__namespace.ɵɵinject(i1__namespace$1.HttpClient), i0__namespace.ɵɵinject(i0__namespace.INJECTOR), i0__namespace.ɵɵinject(ModuleConfigService)); }, token: CauHinhWorkflowService, providedIn: "root" });
|
|
21209
|
-
CauHinhWorkflowService.decorators = [
|
|
21210
|
-
{ type: i0.Injectable, args: [{
|
|
21211
|
-
providedIn: 'root'
|
|
21212
|
-
},] }
|
|
21213
|
-
];
|
|
21214
|
-
CauHinhWorkflowService.ctorParameters = function () { return [
|
|
21215
|
-
{ type: i1$1.HttpClient },
|
|
21216
|
-
{ type: i0.Injector },
|
|
21217
|
-
{ type: ModuleConfigService }
|
|
21218
|
-
]; };
|
|
21219
|
-
|
|
21220
|
-
var DmLoaiCongViecService = /** @class */ (function (_super) {
|
|
21221
|
-
__extends(DmLoaiCongViecService, _super);
|
|
21222
|
-
function DmLoaiCongViecService(http, injector, _moduleConfigService) {
|
|
21223
|
-
var _this = _super.call(this, http, injector, _moduleConfigService.getConfig().environment.apiDomain.congviecEndpoint + "/" + _moduleConfigService.getConfig().environment.apiVersion + "/DM_LoaiCongViec") || this;
|
|
21224
|
-
_this._moduleConfigService = _moduleConfigService;
|
|
21225
|
-
_this.serviceCode = 'congviec';
|
|
21226
|
-
_this.entityName = 'DM_LoaiCongViec';
|
|
21227
|
-
_this.dicLoaiCongViec = {};
|
|
21228
|
-
_this.keyIdLoaiCongViecRoot = 'root';
|
|
21229
|
-
_this.getWorkflowSettingByIdLoaiCongViec = function (idLoaiCongViec) { return __awaiter(_this, void 0, void 0, function () {
|
|
21230
|
-
var result, idLoaiCongViecs, i;
|
|
21231
|
-
return __generator(this, function (_a) {
|
|
21232
|
-
switch (_a.label) {
|
|
21175
|
+
PermissionService.prototype.checkPermission = function (service, permissionToCheck, checkForMenu) {
|
|
21176
|
+
if (checkForMenu === void 0) { checkForMenu = false; }
|
|
21177
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
21178
|
+
var user, valueIsDevMode, userPermissions, _a_1;
|
|
21179
|
+
return __generator(this, function (_d) {
|
|
21180
|
+
switch (_d.label) {
|
|
21233
21181
|
case 0:
|
|
21234
|
-
|
|
21235
|
-
|
|
21182
|
+
_d.trys.push([0, 2, , 3]);
|
|
21183
|
+
user = this._userService.getCurrentUser();
|
|
21184
|
+
valueIsDevMode = true;
|
|
21185
|
+
if (i0.isDevMode() && valueIsDevMode) {
|
|
21186
|
+
return [2 /*return*/, true];
|
|
21187
|
+
}
|
|
21188
|
+
if (user && user.issuperuser && user.issuperuser.toLowerCase() == 'true' && valueIsDevMode) {
|
|
21189
|
+
return [2 /*return*/, true];
|
|
21190
|
+
}
|
|
21191
|
+
if (user && user.isadmin && user.isadmin.toLowerCase() == 'true' && !this.ignoreAdmin && valueIsDevMode) {
|
|
21192
|
+
return [2 /*return*/, true];
|
|
21193
|
+
}
|
|
21194
|
+
return [4 /*yield*/, this.getServicePermission(service)];
|
|
21236
21195
|
case 1:
|
|
21237
|
-
|
|
21238
|
-
|
|
21196
|
+
userPermissions = _d.sent();
|
|
21197
|
+
if (userPermissions && userPermissions.length > 0) {
|
|
21198
|
+
return [2 /*return*/, checkForMenu
|
|
21199
|
+
? userPermissions.includes(permissionToCheck)
|
|
21200
|
+
: this._checkPermission(userPermissions, permissionToCheck)];
|
|
21201
|
+
}
|
|
21202
|
+
else {
|
|
21203
|
+
// console.log(`Không có quyền với phân hệ [${service}]`);
|
|
21204
|
+
return [2 /*return*/, false];
|
|
21205
|
+
}
|
|
21206
|
+
return [3 /*break*/, 3];
|
|
21239
21207
|
case 2:
|
|
21240
|
-
|
|
21241
|
-
|
|
21208
|
+
_a_1 = _d.sent();
|
|
21209
|
+
return [2 /*return*/, false];
|
|
21210
|
+
case 3: return [2 /*return*/];
|
|
21211
|
+
}
|
|
21212
|
+
});
|
|
21213
|
+
});
|
|
21214
|
+
};
|
|
21215
|
+
PermissionService.prototype._checkPermission = function (userPermissions, permissionToCheck) {
|
|
21216
|
+
var e_4, _d;
|
|
21217
|
+
var isAuthorized = false;
|
|
21218
|
+
try {
|
|
21219
|
+
// check permission của người dùng
|
|
21220
|
+
// duyệt qua từng permission của người dùng
|
|
21221
|
+
for (var userPermissions_1 = __values(userPermissions), userPermissions_1_1 = userPermissions_1.next(); !userPermissions_1_1.done; userPermissions_1_1 = userPermissions_1.next()) {
|
|
21222
|
+
var userPermission = userPermissions_1_1.value;
|
|
21223
|
+
// biến để break khỏi vòng khi người dùng được authorized
|
|
21224
|
+
var breakOuterLoop = false;
|
|
21225
|
+
// pointer permission của người dùng
|
|
21226
|
+
var userPermissionPointer = 0;
|
|
21227
|
+
// pointer permission đang check
|
|
21228
|
+
var permissionToCheckPointer = 0;
|
|
21229
|
+
// mark co the check query param
|
|
21230
|
+
var aboutToCheckQueryParam = false;
|
|
21231
|
+
// check từng char của 2 mảng
|
|
21232
|
+
for (; permissionToCheckPointer < permissionToCheck.length;) {
|
|
21233
|
+
// nếu char là ký tự bắt đầu template => tịnh tiến pointer của 2 mảng
|
|
21234
|
+
var needRecheck = false;
|
|
21235
|
+
if (userPermission[userPermissionPointer] == '{') {
|
|
21236
|
+
// cho đến khi tìm được ký tự '/' tiếp theo thì dừng lại
|
|
21237
|
+
for (; userPermissionPointer < userPermission.length; userPermissionPointer++) {
|
|
21238
|
+
if (userPermissionPointer == userPermission.length - 1) {
|
|
21239
|
+
break;
|
|
21240
|
+
}
|
|
21241
|
+
if (userPermission[userPermissionPointer] != '}') {
|
|
21242
|
+
continue;
|
|
21243
|
+
}
|
|
21244
|
+
if (userPermission[userPermissionPointer] === '?') {
|
|
21245
|
+
aboutToCheckQueryParam = true;
|
|
21246
|
+
}
|
|
21247
|
+
++userPermissionPointer; // tiến tiến đến ký tự sau kết thúc template
|
|
21248
|
+
// check trường hợp trường hợp chuỗi template có dạng "{template}acsekjf"
|
|
21249
|
+
// => cần check các ký tự sau template và trước ký tự '/'
|
|
21250
|
+
if (userPermission[userPermissionPointer] != '/' && (aboutToCheckQueryParam && userPermission[userPermissionPointer] != '&')) {
|
|
21251
|
+
needRecheck = true;
|
|
21252
|
+
for (; userPermissionPointer < userPermission.length; userPermissionPointer++) {
|
|
21253
|
+
if (userPermissionPointer == userPermission.length - 1) {
|
|
21254
|
+
break;
|
|
21255
|
+
}
|
|
21256
|
+
if (userPermission[userPermissionPointer] != '/') {
|
|
21257
|
+
continue;
|
|
21258
|
+
}
|
|
21259
|
+
break;
|
|
21260
|
+
}
|
|
21261
|
+
}
|
|
21262
|
+
break;
|
|
21242
21263
|
}
|
|
21243
|
-
|
|
21244
|
-
|
|
21245
|
-
|
|
21246
|
-
|
|
21247
|
-
|
|
21248
|
-
|
|
21249
|
-
if (!Array.isArray(idLoaiCongViecs))
|
|
21250
|
-
return [2 /*return*/, null];
|
|
21251
|
-
if (idLoaiCongViecs.length > 1) {
|
|
21252
|
-
for (i = idLoaiCongViecs.length - 2; i >= 0; i--) {
|
|
21253
|
-
result = this.dicWorkflowByLoaiCongViec[idLoaiCongViecs[i]];
|
|
21254
|
-
if (result)
|
|
21255
|
-
return [2 /*return*/, result];
|
|
21264
|
+
for (; permissionToCheckPointer < permissionToCheck.length; permissionToCheckPointer++) {
|
|
21265
|
+
if (permissionToCheckPointer == permissionToCheck.length - 1) {
|
|
21266
|
+
break;
|
|
21267
|
+
}
|
|
21268
|
+
if (permissionToCheck[permissionToCheckPointer] == '/' || (aboutToCheckQueryParam && permissionToCheck[permissionToCheckPointer] == '&')) {
|
|
21269
|
+
break;
|
|
21256
21270
|
}
|
|
21257
21271
|
}
|
|
21258
|
-
|
|
21259
|
-
|
|
21272
|
+
}
|
|
21273
|
+
var breakInnerLoop = false;
|
|
21274
|
+
if (needRecheck) {
|
|
21275
|
+
// check lại cho trường hợp chuỗi template có dạng "{template}acslekfj"
|
|
21276
|
+
// duyệt ngược lại cho đến khi gặp ký tự kết thúc template
|
|
21277
|
+
var tempUserPointer = userPermissionPointer;
|
|
21278
|
+
var tempToCheckPointer = permissionToCheckPointer;
|
|
21279
|
+
while (userPermission[tempUserPointer] != '}') {
|
|
21280
|
+
// ký tự khác nhau => break khỏi vòng kiểm tra trong
|
|
21281
|
+
if (userPermission[tempUserPointer].toLowerCase() != permissionToCheck[tempToCheckPointer].toLowerCase()) {
|
|
21282
|
+
breakInnerLoop = true;
|
|
21283
|
+
break;
|
|
21284
|
+
}
|
|
21285
|
+
tempUserPointer--;
|
|
21286
|
+
tempToCheckPointer--;
|
|
21287
|
+
}
|
|
21288
|
+
}
|
|
21289
|
+
if (breakInnerLoop) {
|
|
21290
|
+
break;
|
|
21291
|
+
}
|
|
21292
|
+
var userChar = userPermission[userPermissionPointer].toLowerCase();
|
|
21293
|
+
var toCheckChar = permissionToCheck[permissionToCheckPointer].toLowerCase();
|
|
21294
|
+
// nếu userPermission đang ở index cuối
|
|
21295
|
+
if (userPermissionPointer == userPermission.length - 1) {
|
|
21296
|
+
// check char cuối của 2 mảng (trừ khi là ký tự kết thúc template)
|
|
21297
|
+
// và cũng phải là char cuối của mảng permission cần check
|
|
21298
|
+
// => người dùng authorized và break khỏi vòng lặp ngoài cùng
|
|
21299
|
+
if ((userChar == '}' || userChar == toCheckChar)
|
|
21300
|
+
&& permissionToCheckPointer == permissionToCheck.length - 1) {
|
|
21301
|
+
breakOuterLoop = true;
|
|
21302
|
+
isAuthorized = true;
|
|
21303
|
+
}
|
|
21304
|
+
break;
|
|
21305
|
+
}
|
|
21306
|
+
// check char có giống nhau không, không giống thì break khỏi vòng check
|
|
21307
|
+
if (userChar != toCheckChar) {
|
|
21308
|
+
break;
|
|
21309
|
+
}
|
|
21310
|
+
// nếu char giống nhau thì tiếp tục vòng lăp
|
|
21311
|
+
permissionToCheckPointer++;
|
|
21312
|
+
userPermissionPointer++;
|
|
21313
|
+
}
|
|
21314
|
+
if (breakOuterLoop) {
|
|
21315
|
+
break;
|
|
21316
|
+
}
|
|
21317
|
+
}
|
|
21318
|
+
}
|
|
21319
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
21320
|
+
finally {
|
|
21321
|
+
try {
|
|
21322
|
+
if (userPermissions_1_1 && !userPermissions_1_1.done && (_d = userPermissions_1.return)) _d.call(userPermissions_1);
|
|
21323
|
+
}
|
|
21324
|
+
finally { if (e_4) throw e_4.error; }
|
|
21325
|
+
}
|
|
21326
|
+
return isAuthorized;
|
|
21327
|
+
};
|
|
21328
|
+
PermissionService.prototype._checkPermissionOld = function (userPermissions, permissionToCheck) {
|
|
21329
|
+
var e_5, _d;
|
|
21330
|
+
var isAuthorized = false;
|
|
21331
|
+
// check quyền theo cách cũ nếu trường họp là phân quyền module
|
|
21332
|
+
if (permissionToCheck.includes('MODULE')) {
|
|
21333
|
+
return userPermissions.includes(permissionToCheck);
|
|
21334
|
+
}
|
|
21335
|
+
try {
|
|
21336
|
+
for (var userPermissions_2 = __values(userPermissions), userPermissions_2_1 = userPermissions_2.next(); !userPermissions_2_1.done; userPermissions_2_1 = userPermissions_2.next()) {
|
|
21337
|
+
var userPermission = userPermissions_2_1.value;
|
|
21338
|
+
// Cắt chuỗi permission thành mảng để xem mỗi fragement có khớp nhau không
|
|
21339
|
+
var userPermissionFragments = userPermission.split('/');
|
|
21340
|
+
var permissionFragments = permissionToCheck.split('/');
|
|
21341
|
+
// Mảng khác độ dài thì thoát sớm
|
|
21342
|
+
if (userPermissionFragments.length != permissionFragments.length) {
|
|
21343
|
+
continue;
|
|
21344
|
+
}
|
|
21345
|
+
// biến flag ra hiệu người dùng authorized và out vòng
|
|
21346
|
+
var breakLoop = false;
|
|
21347
|
+
// nếu tất cả phần tử khớp nhau => permission này trùng và người dùng được authorized
|
|
21348
|
+
for (var index = 0; index < permissionFragments.length; index++) {
|
|
21349
|
+
var userFragement = userPermissionFragments[index];
|
|
21350
|
+
var permissionFragment = permissionFragments[index];
|
|
21351
|
+
// skip qua các phần tử có ký tự bắt đầu là '{'
|
|
21352
|
+
if (userFragement[0] == '{') {
|
|
21353
|
+
if (index == permissionFragments.length - 1) {
|
|
21354
|
+
isAuthorized = true;
|
|
21355
|
+
breakLoop = true;
|
|
21260
21356
|
}
|
|
21261
|
-
|
|
21357
|
+
continue;
|
|
21358
|
+
}
|
|
21359
|
+
if (userFragement.toLowerCase() != permissionFragment.toLowerCase()) {
|
|
21360
|
+
break;
|
|
21361
|
+
}
|
|
21362
|
+
if (index == permissionFragments.length - 1) {
|
|
21363
|
+
isAuthorized = true;
|
|
21364
|
+
breakLoop = true;
|
|
21365
|
+
}
|
|
21262
21366
|
}
|
|
21263
|
-
|
|
21264
|
-
|
|
21265
|
-
|
|
21266
|
-
|
|
21267
|
-
|
|
21268
|
-
|
|
21269
|
-
|
|
21270
|
-
|
|
21367
|
+
if (breakLoop) {
|
|
21368
|
+
break;
|
|
21369
|
+
}
|
|
21370
|
+
}
|
|
21371
|
+
}
|
|
21372
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
21373
|
+
finally {
|
|
21374
|
+
try {
|
|
21375
|
+
if (userPermissions_2_1 && !userPermissions_2_1.done && (_d = userPermissions_2.return)) _d.call(userPermissions_2);
|
|
21376
|
+
}
|
|
21377
|
+
finally { if (e_5) throw e_5.error; }
|
|
21378
|
+
}
|
|
21379
|
+
return isAuthorized;
|
|
21380
|
+
};
|
|
21381
|
+
PermissionService.prototype.isAuthorizedByPermissions = function (permissions, operator, ignoreAdmin) {
|
|
21382
|
+
var _this = this;
|
|
21383
|
+
if (operator === void 0) { operator = 'OR'; }
|
|
21384
|
+
if (ignoreAdmin === void 0) { ignoreAdmin = false; }
|
|
21385
|
+
return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
21386
|
+
var user, isAuthorized;
|
|
21271
21387
|
var _this = this;
|
|
21272
|
-
return __generator(this, function (
|
|
21273
|
-
switch (
|
|
21274
|
-
case 0:
|
|
21275
|
-
if (!this.dicWorkflowByLoaiCongViec) {
|
|
21276
|
-
this.dicWorkflowByLoaiCongViec = {};
|
|
21277
|
-
}
|
|
21278
|
-
cauHinhWorkflowService = this._injector.get(CauHinhWorkflowService);
|
|
21279
|
-
return [4 /*yield*/, cauHinhWorkflowService.getAll([], 'idLoaiCongViec,workflowCodes,workflowCode')];
|
|
21388
|
+
return __generator(this, function (_d) {
|
|
21389
|
+
switch (_d.label) {
|
|
21390
|
+
case 0: return [4 /*yield*/, this._userService.getCurrentUser()];
|
|
21280
21391
|
case 1:
|
|
21281
|
-
|
|
21282
|
-
|
|
21283
|
-
|
|
21284
|
-
|
|
21285
|
-
return [2 /*return*/, []];
|
|
21392
|
+
user = (_d.sent());
|
|
21393
|
+
if (user && user.issuperuser.toLowerCase() == 'true') {
|
|
21394
|
+
resolve(true);
|
|
21395
|
+
return [2 /*return*/];
|
|
21286
21396
|
}
|
|
21287
|
-
|
|
21288
|
-
|
|
21289
|
-
|
|
21290
|
-
|
|
21291
|
-
|
|
21292
|
-
|
|
21293
|
-
|
|
21294
|
-
|
|
21295
|
-
|
|
21296
|
-
|
|
21297
|
-
|
|
21397
|
+
if (user && user.isadmin.toLowerCase() == 'true' && !this.ignoreAdmin) {
|
|
21398
|
+
resolve(true);
|
|
21399
|
+
return [2 /*return*/];
|
|
21400
|
+
}
|
|
21401
|
+
isAuthorized = true;
|
|
21402
|
+
if (operator.toUpperCase() == 'OR') {
|
|
21403
|
+
isAuthorized = false;
|
|
21404
|
+
}
|
|
21405
|
+
permissions.forEach(function (item) {
|
|
21406
|
+
_this.getServicePermission(item.service).then(function (permissionResult) {
|
|
21407
|
+
if (operator.toUpperCase() == 'OR') {
|
|
21408
|
+
if (permissionResult.includes(item.permission)) {
|
|
21409
|
+
isAuthorized = true;
|
|
21410
|
+
return;
|
|
21411
|
+
}
|
|
21298
21412
|
}
|
|
21299
|
-
|
|
21300
|
-
|
|
21301
|
-
|
|
21302
|
-
|
|
21303
|
-
this.newFilter('code', exports.Operator.in, workflowCodes)
|
|
21304
|
-
], new DropdownOptions({
|
|
21305
|
-
valueField: 'code',
|
|
21306
|
-
displayField: 'title',
|
|
21307
|
-
fieldPlus: 'data'
|
|
21308
|
-
}))];
|
|
21309
|
-
case 2:
|
|
21310
|
-
workflows = (_a.sent());
|
|
21311
|
-
workflows.forEach(function (item) {
|
|
21312
|
-
item.data = JSON.parse(item.data);
|
|
21313
|
-
var stateMachineData = item.data;
|
|
21314
|
-
stateMachineData.actions = {};
|
|
21315
|
-
stateMachineData.machines.forEach(function (machine) {
|
|
21316
|
-
stateMachineData.actions[machine.code] = [];
|
|
21317
|
-
stateMachineData.connections.forEach(function (conn) {
|
|
21318
|
-
if (conn.source == machine.id) {
|
|
21319
|
-
stateMachineData.actions[machine.code].push(conn);
|
|
21413
|
+
else {
|
|
21414
|
+
if (!permissionResult.includes(item.permission)) {
|
|
21415
|
+
isAuthorized = false;
|
|
21416
|
+
return;
|
|
21320
21417
|
}
|
|
21321
|
-
}
|
|
21418
|
+
}
|
|
21419
|
+
}, function (error) {
|
|
21420
|
+
reject(false);
|
|
21322
21421
|
});
|
|
21323
21422
|
});
|
|
21324
|
-
|
|
21325
|
-
|
|
21326
|
-
if (!itemWorkflowSetting.idLoaiCongViec) {
|
|
21327
|
-
_this.dicWorkflowByLoaiCongViec[_this.keyIdLoaiCongViecRoot] = itemWorkflowSetting;
|
|
21328
|
-
}
|
|
21329
|
-
else {
|
|
21330
|
-
_this.dicWorkflowByLoaiCongViec[itemWorkflowSetting.idLoaiCongViec] = itemWorkflowSetting;
|
|
21331
|
-
}
|
|
21332
|
-
});
|
|
21333
|
-
return [2 /*return*/, workflows];
|
|
21423
|
+
resolve(isAuthorized);
|
|
21424
|
+
return [2 /*return*/];
|
|
21334
21425
|
}
|
|
21335
21426
|
});
|
|
21336
|
-
});
|
|
21427
|
+
}); });
|
|
21337
21428
|
};
|
|
21338
|
-
|
|
21429
|
+
PermissionService.prototype.getServicePermission = function (service, overrideLocalStorage) {
|
|
21430
|
+
if (overrideLocalStorage === void 0) { overrideLocalStorage = false; }
|
|
21339
21431
|
return __awaiter(this, void 0, void 0, function () {
|
|
21340
|
-
var
|
|
21341
|
-
return __generator(this, function (
|
|
21342
|
-
switch (
|
|
21432
|
+
var key, storageItem, result, url, response;
|
|
21433
|
+
return __generator(this, function (_d) {
|
|
21434
|
+
switch (_d.label) {
|
|
21343
21435
|
case 0:
|
|
21344
|
-
|
|
21345
|
-
|
|
21346
|
-
|
|
21347
|
-
|
|
21348
|
-
|
|
21349
|
-
|
|
21350
|
-
|
|
21436
|
+
key = "AUTHORIZATION." + service.toUpperCase();
|
|
21437
|
+
if (!overrideLocalStorage) {
|
|
21438
|
+
storageItem = this.storage.getItem(key);
|
|
21439
|
+
if (storageItem && storageItem !== 'null') {
|
|
21440
|
+
result = JSON.parse(storageItem);
|
|
21441
|
+
return [2 /*return*/, result];
|
|
21442
|
+
}
|
|
21351
21443
|
}
|
|
21352
|
-
|
|
21353
|
-
return [
|
|
21354
|
-
}
|
|
21355
|
-
});
|
|
21356
|
-
});
|
|
21357
|
-
};
|
|
21358
|
-
DmLoaiCongViecService.prototype.getItemLoaiCongViec = function (idLoaiCongViec) {
|
|
21359
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
21360
|
-
var _a, _b;
|
|
21361
|
-
return __generator(this, function (_c) {
|
|
21362
|
-
switch (_c.label) {
|
|
21363
|
-
case 0:
|
|
21364
|
-
if (!!this.dicLoaiCongViec[idLoaiCongViec]) return [3 /*break*/, 2];
|
|
21365
|
-
_a = this.dicLoaiCongViec;
|
|
21366
|
-
_b = idLoaiCongViec;
|
|
21367
|
-
return [4 /*yield*/, this.getDetail(idLoaiCongViec)];
|
|
21444
|
+
url = this.serviceUri + "/GetPermissionsByService?service=" + service;
|
|
21445
|
+
return [4 /*yield*/, this.defaultGet(url)];
|
|
21368
21446
|
case 1:
|
|
21369
|
-
|
|
21370
|
-
|
|
21371
|
-
|
|
21372
|
-
|
|
21373
|
-
|
|
21374
|
-
|
|
21375
|
-
|
|
21376
|
-
|
|
21377
|
-
|
|
21378
|
-
|
|
21379
|
-
|
|
21380
|
-
{ type: i0.Injectable, args: [{
|
|
21381
|
-
providedIn: 'root'
|
|
21382
|
-
},] }
|
|
21383
|
-
];
|
|
21384
|
-
DmLoaiCongViecService.ctorParameters = function () { return [
|
|
21385
|
-
{ type: i1$1.HttpClient },
|
|
21386
|
-
{ type: i0.Injector },
|
|
21387
|
-
{ type: ModuleConfigService }
|
|
21388
|
-
]; };
|
|
21389
|
-
|
|
21390
|
-
var CongViecService = /** @class */ (function (_super) {
|
|
21391
|
-
__extends(CongViecService, _super);
|
|
21392
|
-
function CongViecService(http, injector, _moduleConfigService, _dmLoaiCongViecService) {
|
|
21393
|
-
var _this = _super.call(this, http, injector, _moduleConfigService.getConfig().environment.apiDomain.congviecEndpoint + "/" + _moduleConfigService.getConfig().environment.apiVersion + "/CongViec_Chinh") || this;
|
|
21394
|
-
_this._dmLoaiCongViecService = _dmLoaiCongViecService;
|
|
21395
|
-
_this.serviceCode = 'congviec';
|
|
21396
|
-
_this.entityName = 'CongViec_Chinh';
|
|
21397
|
-
_this.objectName = 'công việc';
|
|
21398
|
-
_this.endPoint = _moduleConfigService.getConfig().environment.apiDomain.congviecEndpoint;
|
|
21399
|
-
_this._moduleConfig = _moduleConfigService.getConfig();
|
|
21400
|
-
return _this;
|
|
21401
|
-
}
|
|
21402
|
-
CongViecService.prototype.adjustSettingWorkflowForCrudList = function (setting) {
|
|
21403
|
-
this.useWorkflow = true;
|
|
21404
|
-
setting.isWorkflowTree = true;
|
|
21405
|
-
setting.baseService = this;
|
|
21406
|
-
setting.displayField = function (item) { return item.ten; };
|
|
21407
|
-
setting.baseService.useWorkflow = true;
|
|
21408
|
-
setting.workflowConfigAdvance = {
|
|
21409
|
-
getWorkflowSetting: this.getWorkflowConfig.bind(this)
|
|
21410
|
-
};
|
|
21411
|
-
};
|
|
21412
|
-
CongViecService.prototype.getWorkflowConfig = function (rowData) {
|
|
21413
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
21414
|
-
return __generator(this, function (_a) {
|
|
21415
|
-
switch (_a.label) {
|
|
21416
|
-
case 0: return [4 /*yield*/, this._dmLoaiCongViecService.getWorkflowSettingByIdLoaiCongViec(rowData.idLoaiCongViec)];
|
|
21417
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
21418
|
-
}
|
|
21419
|
-
});
|
|
21420
|
-
});
|
|
21421
|
-
};
|
|
21422
|
-
CongViecService.prototype.countByMenuState = function (data) {
|
|
21423
|
-
return this.defaultPost(this.serviceUri + "/CountByMenuState", data);
|
|
21424
|
-
};
|
|
21425
|
-
CongViecService.prototype.getDicIdByMenuState = function (data, tuNgay, denNgay) {
|
|
21426
|
-
return this.defaultPost(this.serviceUri + "/GetDicIdByMenuState", {
|
|
21427
|
-
lstTrangThai: data,
|
|
21428
|
-
tuNgay: tuNgay,
|
|
21429
|
-
denNgay: denNgay
|
|
21447
|
+
response = _d.sent();
|
|
21448
|
+
if (!response || !response.success) {
|
|
21449
|
+
return [2 /*return*/, []];
|
|
21450
|
+
}
|
|
21451
|
+
if (overrideLocalStorage) {
|
|
21452
|
+
this.storage.removeItem(key);
|
|
21453
|
+
}
|
|
21454
|
+
this.storage.setItem(key, JSON.stringify(response.data));
|
|
21455
|
+
return [2 /*return*/, response.data];
|
|
21456
|
+
}
|
|
21457
|
+
});
|
|
21430
21458
|
});
|
|
21431
21459
|
};
|
|
21432
|
-
|
|
21433
|
-
var url = this.serviceUri + "/
|
|
21434
|
-
return this.
|
|
21435
|
-
};
|
|
21436
|
-
CongViecService.prototype.deleteBulkCongViecCon = function (ids) {
|
|
21437
|
-
var url = this.serviceUri + "/DeleteBulkCongViecCon";
|
|
21438
|
-
return this.defaultPost(url, ids);
|
|
21439
|
-
};
|
|
21440
|
-
CongViecService.prototype.getDataDashboardCaNhan = function (inputData) {
|
|
21441
|
-
var url = this.serviceUri + "/GetDataDashboardCaNhan";
|
|
21442
|
-
return this.defaultPost(url, inputData);
|
|
21443
|
-
};
|
|
21444
|
-
CongViecService.prototype.getDataDashboardByDonVi = function (inputData) {
|
|
21445
|
-
var url = this.serviceUri + "/GetDataDashboardByDonVi";
|
|
21446
|
-
return this.defaultPost(url, inputData);
|
|
21460
|
+
PermissionService.prototype.getPermissionIdsByModule = function (moduleCode, userId) {
|
|
21461
|
+
var url = this.serviceUri + "/GetPermissionIdsByModule/" + moduleCode + "/" + userId;
|
|
21462
|
+
return this.defaultGet(url);
|
|
21447
21463
|
};
|
|
21448
|
-
|
|
21449
|
-
var url = this.serviceUri + "/
|
|
21450
|
-
return this.defaultPost(url,
|
|
21464
|
+
PermissionService.prototype.phanQuyenNguoiDung = function (model) {
|
|
21465
|
+
var url = this.serviceUri + "/PhanQuyenNguoiDung";
|
|
21466
|
+
return this.defaultPost(url, model);
|
|
21451
21467
|
};
|
|
21452
|
-
return
|
|
21468
|
+
return PermissionService;
|
|
21453
21469
|
}(BaseService));
|
|
21454
|
-
|
|
21455
|
-
|
|
21470
|
+
PermissionService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function PermissionService_Factory() { return new PermissionService(i0__namespace.ɵɵinject(i1__namespace$1.HttpClient), i0__namespace.ɵɵinject(i0__namespace.INJECTOR), i0__namespace.ɵɵinject(ModuleConfigService), i0__namespace.ɵɵinject(UserService), i0__namespace.ɵɵinject(i4__namespace.OAuthService), i0__namespace.ɵɵinject(ApplicationContextService)); }, token: PermissionService, providedIn: "root" });
|
|
21471
|
+
PermissionService.decorators = [
|
|
21456
21472
|
{ type: i0.Injectable, args: [{
|
|
21457
21473
|
providedIn: 'root'
|
|
21458
21474
|
},] }
|
|
21459
21475
|
];
|
|
21460
|
-
|
|
21476
|
+
PermissionService.ctorParameters = function () { return [
|
|
21461
21477
|
{ type: i1$1.HttpClient },
|
|
21462
21478
|
{ type: i0.Injector },
|
|
21463
21479
|
{ type: ModuleConfigService },
|
|
21464
|
-
{ type:
|
|
21480
|
+
{ type: UserService },
|
|
21481
|
+
{ type: i4.OAuthService },
|
|
21482
|
+
{ type: ApplicationContextService }
|
|
21465
21483
|
]; };
|
|
21466
21484
|
|
|
21467
|
-
var
|
|
21468
|
-
__extends(
|
|
21469
|
-
function
|
|
21470
|
-
var _this = _super.call(this, http, injector, _moduleConfigService.getConfig().environment.apiDomain.
|
|
21471
|
-
_this.entityName = 'EntityWorkflowHistory';
|
|
21485
|
+
var WorkflowHistoryService = /** @class */ (function (_super) {
|
|
21486
|
+
__extends(WorkflowHistoryService, _super);
|
|
21487
|
+
function WorkflowHistoryService(http, injector, _moduleConfigService) {
|
|
21488
|
+
var _this = _super.call(this, http, injector, _moduleConfigService.getConfig().environment.apiDomain.workflowEndpoint + "/" + _moduleConfigService.getConfig().environment.apiVersion + "/WorkflowHistory") || this;
|
|
21472
21489
|
_this.serviceManagers = {};
|
|
21473
|
-
_this.
|
|
21490
|
+
_this.entityName = 'WorkflowHistory';
|
|
21491
|
+
_this.serviceCode = 'workflow';
|
|
21492
|
+
_this.apiDomain = _moduleConfigService.getConfig().environment.apiDomain;
|
|
21493
|
+
_this.endPoint = _moduleConfigService.getConfig().environment.apiDomain.workflowEndpoint;
|
|
21474
21494
|
_this._moduleConfig = _moduleConfigService.getConfig();
|
|
21495
|
+
_this.apiVersion = _moduleConfigService.getConfig().environment.apiVersion;
|
|
21475
21496
|
return _this;
|
|
21476
21497
|
}
|
|
21477
|
-
|
|
21478
|
-
this.serviceManagers[
|
|
21498
|
+
WorkflowHistoryService.prototype.registerService = function (settingKey, service) {
|
|
21499
|
+
this.serviceManagers[settingKey] = service;
|
|
21479
21500
|
};
|
|
21480
|
-
|
|
21501
|
+
WorkflowHistoryService.prototype.getEndpointByService = function (service) {
|
|
21481
21502
|
return service.endPoint + "/" + this._moduleConfig.environment.apiVersion;
|
|
21482
21503
|
};
|
|
21483
|
-
|
|
21484
|
-
|
|
21485
|
-
|
|
21486
|
-
(this._injector.get(NotifierService)).showWarning('Bạn chưa đăng ký base service cho entity workflow history');
|
|
21487
|
-
}
|
|
21488
|
-
this.serviceUri = this.getEndpointByService(service) + "/EntityWorkflowHistory";
|
|
21504
|
+
WorkflowHistoryService.prototype.changeEndpoint = function (baseService) {
|
|
21505
|
+
this.serviceUri = this.getEndpointByService(baseService) + "/WorkflowHistory";
|
|
21506
|
+
return this;
|
|
21489
21507
|
};
|
|
21490
|
-
|
|
21491
|
-
|
|
21492
|
-
|
|
21493
|
-
|
|
21494
|
-
|
|
21508
|
+
WorkflowHistoryService.prototype.getLastByItemId = function (itemId) {
|
|
21509
|
+
// return this.getDetailByFilter(
|
|
21510
|
+
// [
|
|
21511
|
+
// this.newFilter('itemId', Operator.equal, itemId)
|
|
21512
|
+
// ],
|
|
21513
|
+
// [{ field: 'time', dir: -1 }]
|
|
21514
|
+
// );
|
|
21515
|
+
return this.defaultPost(this.serviceUri + "/GetLastByItemIdInMainThread/" + itemId, {});
|
|
21516
|
+
};
|
|
21517
|
+
WorkflowHistoryService.prototype.choYKien = function (model) {
|
|
21518
|
+
return this.defaultPost(this.serviceUri + "/ChoYKien", model);
|
|
21519
|
+
};
|
|
21520
|
+
WorkflowHistoryService.prototype.getAllObjectRelated = function (serviceCode, entity, entityKey, fullApiUrl) {
|
|
21521
|
+
if (fullApiUrl === void 0) { fullApiUrl = null; }
|
|
21522
|
+
var apiUrl = fullApiUrl || this.apiDomain[serviceCode + "Endpoint"];
|
|
21523
|
+
if (!apiUrl) {
|
|
21524
|
+
throw new Error("Kh\u00F4ng t\u00ECm th\u1EA5y api endpoint \u1EE9ng v\u1EDBi service " + serviceCode);
|
|
21495
21525
|
}
|
|
21496
|
-
|
|
21497
|
-
|
|
21498
|
-
pageInfo: {
|
|
21499
|
-
page: 1,
|
|
21500
|
-
pageSize: 1
|
|
21501
|
-
},
|
|
21502
|
-
filters: filters,
|
|
21503
|
-
sorts: [
|
|
21504
|
-
new Sort({ field: 'created', dir: 1 })
|
|
21505
|
-
]
|
|
21506
|
-
};
|
|
21507
|
-
return this.defaultPost(url, gridInfo);
|
|
21526
|
+
apiUrl = apiUrl + "/" + this.apiVersion + "/WorkflowHistory/GetAllObjectRelated/" + entity + "/" + entityKey;
|
|
21527
|
+
return this.defaultGet(apiUrl);
|
|
21508
21528
|
};
|
|
21509
|
-
return
|
|
21529
|
+
return WorkflowHistoryService;
|
|
21510
21530
|
}(BaseService));
|
|
21511
|
-
|
|
21512
|
-
|
|
21531
|
+
WorkflowHistoryService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function WorkflowHistoryService_Factory() { return new WorkflowHistoryService(i0__namespace.ɵɵinject(i1__namespace$1.HttpClient), i0__namespace.ɵɵinject(i0__namespace.INJECTOR), i0__namespace.ɵɵinject(ModuleConfigService)); }, token: WorkflowHistoryService, providedIn: "root" });
|
|
21532
|
+
WorkflowHistoryService.decorators = [
|
|
21513
21533
|
{ type: i0.Injectable, args: [{
|
|
21514
21534
|
providedIn: 'root'
|
|
21515
21535
|
},] }
|
|
21516
21536
|
];
|
|
21517
|
-
|
|
21537
|
+
WorkflowHistoryService.ctorParameters = function () { return [
|
|
21518
21538
|
{ type: i1$1.HttpClient },
|
|
21519
21539
|
{ type: i0.Injector },
|
|
21520
21540
|
{ type: ModuleConfigService }
|
|
@@ -21688,90 +21708,70 @@
|
|
|
21688
21708
|
{ type: ModuleConfigService }
|
|
21689
21709
|
]; };
|
|
21690
21710
|
|
|
21691
|
-
var
|
|
21692
|
-
|
|
21693
|
-
function
|
|
21694
|
-
|
|
21695
|
-
|
|
21696
|
-
|
|
21697
|
-
_this.serviceCode = 'workflow';
|
|
21698
|
-
_this.apiDomain = _moduleConfigService.getConfig().environment.apiDomain;
|
|
21699
|
-
_this.endPoint = _moduleConfigService.getConfig().environment.apiDomain.workflowEndpoint;
|
|
21700
|
-
_this._moduleConfig = _moduleConfigService.getConfig();
|
|
21701
|
-
_this.apiVersion = _moduleConfigService.getConfig().environment.apiVersion;
|
|
21702
|
-
return _this;
|
|
21703
|
-
}
|
|
21704
|
-
WorkflowHistoryService.prototype.registerService = function (settingKey, service) {
|
|
21705
|
-
this.serviceManagers[settingKey] = service;
|
|
21706
|
-
};
|
|
21707
|
-
WorkflowHistoryService.prototype.getEndpointByService = function (service) {
|
|
21708
|
-
return service.endPoint + "/" + this._moduleConfig.environment.apiVersion;
|
|
21709
|
-
};
|
|
21710
|
-
WorkflowHistoryService.prototype.changeEndpoint = function (baseService) {
|
|
21711
|
-
this.serviceUri = this.getEndpointByService(baseService) + "/WorkflowHistory";
|
|
21712
|
-
return this;
|
|
21713
|
-
};
|
|
21714
|
-
WorkflowHistoryService.prototype.getLastByItemId = function (itemId) {
|
|
21715
|
-
// return this.getDetailByFilter(
|
|
21716
|
-
// [
|
|
21717
|
-
// this.newFilter('itemId', Operator.equal, itemId)
|
|
21718
|
-
// ],
|
|
21719
|
-
// [{ field: 'time', dir: -1 }]
|
|
21720
|
-
// );
|
|
21721
|
-
return this.defaultPost(this.serviceUri + "/GetLastByItemIdInMainThread/" + itemId, {});
|
|
21722
|
-
};
|
|
21723
|
-
WorkflowHistoryService.prototype.choYKien = function (model) {
|
|
21724
|
-
return this.defaultPost(this.serviceUri + "/ChoYKien", model);
|
|
21711
|
+
var sort_by;
|
|
21712
|
+
(function () {
|
|
21713
|
+
var defaultCompareFunc = function (a, b) {
|
|
21714
|
+
if (a == b)
|
|
21715
|
+
return 0;
|
|
21716
|
+
return a < b ? -1 : 1;
|
|
21725
21717
|
};
|
|
21726
|
-
|
|
21727
|
-
|
|
21728
|
-
var
|
|
21729
|
-
if (
|
|
21730
|
-
|
|
21718
|
+
var getCompareFunc = function (primer, reverse) {
|
|
21719
|
+
var defaultCompare = defaultCompareFunc;
|
|
21720
|
+
var compare = defaultCompareFunc;
|
|
21721
|
+
if (primer) {
|
|
21722
|
+
compare = function (a, b) {
|
|
21723
|
+
return defaultCompare(primer(a), primer(b));
|
|
21724
|
+
};
|
|
21731
21725
|
}
|
|
21732
|
-
|
|
21733
|
-
|
|
21726
|
+
if (reverse) {
|
|
21727
|
+
return function (a, b) {
|
|
21728
|
+
return -1 * compare(a, b);
|
|
21729
|
+
};
|
|
21730
|
+
}
|
|
21731
|
+
return compare;
|
|
21734
21732
|
};
|
|
21735
|
-
|
|
21736
|
-
|
|
21737
|
-
|
|
21738
|
-
|
|
21739
|
-
|
|
21740
|
-
|
|
21741
|
-
|
|
21742
|
-
|
|
21743
|
-
|
|
21744
|
-
|
|
21745
|
-
|
|
21746
|
-
|
|
21747
|
-
|
|
21748
|
-
|
|
21749
|
-
|
|
21750
|
-
|
|
21751
|
-
|
|
21752
|
-
|
|
21753
|
-
|
|
21754
|
-
|
|
21755
|
-
|
|
21756
|
-
|
|
21757
|
-
|
|
21758
|
-
|
|
21759
|
-
|
|
21760
|
-
|
|
21733
|
+
sort_by = function () {
|
|
21734
|
+
var args = [];
|
|
21735
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
21736
|
+
args[_i] = arguments[_i];
|
|
21737
|
+
}
|
|
21738
|
+
var fields = [], n_fields = args.length;
|
|
21739
|
+
var field, name, cmp;
|
|
21740
|
+
// preprocess sorting options
|
|
21741
|
+
for (var i = 0; i < n_fields; i++) {
|
|
21742
|
+
field = args[i];
|
|
21743
|
+
if (typeof field === 'string') {
|
|
21744
|
+
name = field;
|
|
21745
|
+
cmp = defaultCompareFunc;
|
|
21746
|
+
}
|
|
21747
|
+
else {
|
|
21748
|
+
name = field.name;
|
|
21749
|
+
cmp = getCompareFunc(field.primer, field.reverse);
|
|
21750
|
+
}
|
|
21751
|
+
fields.push({
|
|
21752
|
+
name: name,
|
|
21753
|
+
cmp: cmp
|
|
21754
|
+
});
|
|
21755
|
+
}
|
|
21756
|
+
// final comparison function
|
|
21757
|
+
return function (A, B) {
|
|
21758
|
+
var name, result;
|
|
21759
|
+
for (var i = 0; i < n_fields; i++) {
|
|
21760
|
+
result = 0;
|
|
21761
|
+
field = fields[i];
|
|
21762
|
+
name = field.name;
|
|
21763
|
+
result = field.cmp(A[name], B[name]);
|
|
21764
|
+
if (result !== 0)
|
|
21765
|
+
break;
|
|
21766
|
+
}
|
|
21767
|
+
return result;
|
|
21768
|
+
};
|
|
21761
21769
|
};
|
|
21762
|
-
|
|
21763
|
-
|
|
21764
|
-
|
|
21765
|
-
|
|
21766
|
-
|
|
21767
|
-
providedIn: 'root'
|
|
21768
|
-
},] }
|
|
21769
|
-
];
|
|
21770
|
-
BasePermissionService.ctorParameters = function () { return [
|
|
21771
|
-
{ type: i1$1.HttpClient },
|
|
21772
|
-
{ type: i0.Injector },
|
|
21773
|
-
{ type: ModuleConfigService }
|
|
21774
|
-
]; };
|
|
21770
|
+
}());
|
|
21771
|
+
// multipleSort('idTinhThanh', 'idQuanHuyen')
|
|
21772
|
+
// multipleSort({name: 'idTinhThanh', reverse: true}, 'idQuanHuyen')
|
|
21773
|
+
// multipleSort({name: 'soThuTu', primer: parseInt}, 'idQuanHuyen') // parseInt là function
|
|
21774
|
+
var multipleSort = sort_by;
|
|
21775
21775
|
|
|
21776
21776
|
var ListComponentBase = /** @class */ (function (_super) {
|
|
21777
21777
|
__extends(ListComponentBase, _super);
|
|
@@ -23185,15 +23185,15 @@
|
|
|
23185
23185
|
var result = newArr.reduce(function (x, y) { return y.colSpan + x; }, 0);
|
|
23186
23186
|
return result > a ? result : a;
|
|
23187
23187
|
}, 0);
|
|
23188
|
-
var startIndex = this.setting.hiddenCheckbox ? 0 : 1;
|
|
23189
23188
|
var endIndex = maxColSize - (this.setting.hiddenFunctionColumn ? 1 : 2);
|
|
23190
23189
|
for (var ind = 0; ind < lstRow.length; ind++) {
|
|
23191
23190
|
var arrTh = __spreadArray([], __read(allTh[ind]));
|
|
23191
|
+
var startIndex = arrTh[0].className.includes('chkbox') ? 1 : 0;
|
|
23192
23192
|
if (startIndex > endIndex) {
|
|
23193
23193
|
return null;
|
|
23194
23194
|
}
|
|
23195
23195
|
result[ind] = (_a = result[ind]) !== null && _a !== void 0 ? _a : [];
|
|
23196
|
-
var colIndex =
|
|
23196
|
+
var colIndex = result[ind].length;
|
|
23197
23197
|
var numOfColSpan = arrTh.reduce(function (x, y) { return x + y.colSpan - 1; }, 0);
|
|
23198
23198
|
for (var i = startIndex; i <= endIndex - numOfColSpan; i++) {
|
|
23199
23199
|
if (arrTh[i]) {
|
|
@@ -23358,6 +23358,7 @@
|
|
|
23358
23358
|
};
|
|
23359
23359
|
ListComponentBase.prototype.getValueCheckboxFormat = function (data) {
|
|
23360
23360
|
var checkBox = data.querySelector('p-checkbox');
|
|
23361
|
+
var input = data.querySelector('input');
|
|
23361
23362
|
if (checkBox) {
|
|
23362
23363
|
var value = data.querySelector('span.pi-check');
|
|
23363
23364
|
if (value) {
|
|
@@ -23367,6 +23368,9 @@
|
|
|
23367
23368
|
return 'Không';
|
|
23368
23369
|
}
|
|
23369
23370
|
}
|
|
23371
|
+
if (input) {
|
|
23372
|
+
return input.value;
|
|
23373
|
+
}
|
|
23370
23374
|
return '';
|
|
23371
23375
|
};
|
|
23372
23376
|
ListComponentBase.prototype.view = function (rowData) {
|