tnx-shared 5.3.429 → 5.3.431
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 +402 -253
- package/bundles/tnx-shared.umd.js.map +1 -1
- package/bundles/tnx-shared.umd.min.js +1 -1
- package/bundles/tnx-shared.umd.min.js.map +1 -1
- package/classes/base/component-base-with-button.d.ts +2 -0
- package/classes/base/component-base-with-button.d.ts.map +1 -1
- package/classes/base/data-form-base.d.ts +32 -0
- package/classes/base/data-form-base.d.ts.map +1 -1
- package/classes/base/list-component-base.d.ts.map +1 -1
- package/classes/form-schema.d.ts +1 -0
- package/classes/form-schema.d.ts.map +1 -1
- package/components/crud/crud-form/crud-form.component.d.ts +1 -1
- package/components/crud/crud-form/crud-form.component.d.ts.map +1 -1
- package/esm2015/classes/base/component-base-with-button.js +6 -1
- package/esm2015/classes/base/data-form-base.js +150 -20
- package/esm2015/classes/base/list-component-base.js +2 -1
- package/esm2015/classes/form-schema.js +3 -1
- package/esm2015/components/crud/crud-form/crud-form.component.js +1 -1
- package/esm2015/components/entity-picker/entity-picker-dialog/components/entity-picker-data/entity-picker-data.component.js +3 -3
- package/esm2015/components/tn-dialog/tn-dialog.component.js +2 -2
- package/fesm2015/tnx-shared.js +317 -180
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
- package/tnx-shared.metadata.json +1 -1
package/fesm2015/tnx-shared.js
CHANGED
|
@@ -1151,6 +1151,8 @@ class EntityPickerControlSchema extends FormControlBaseWithService {
|
|
|
1151
1151
|
this.ignoreWorkflow = false;
|
|
1152
1152
|
this.rowButtonTemplate = null;
|
|
1153
1153
|
this.rowButtonBeforeTemplate = null;
|
|
1154
|
+
// true: hiển thị templateFilterHeader thành cột bên trái danh sách (giống popup user-picker), thay vì ở trên
|
|
1155
|
+
this.filterHeaderAsLeftPanel = false;
|
|
1154
1156
|
this.hiddenPageSetting = false;
|
|
1155
1157
|
this.showEditLink = true;
|
|
1156
1158
|
this.titleUnPicked = 'Danh sách các mục chưa chọn';
|
|
@@ -9651,6 +9653,11 @@ ComponentBase.propDecorators = {
|
|
|
9651
9653
|
class ComponentBaseWithButton extends ComponentBase {
|
|
9652
9654
|
constructor(_injector) {
|
|
9653
9655
|
super(_injector);
|
|
9656
|
+
// Danh sách nút hành động quy trình. Được render TỰ ĐỘNG ở footer của tn-dialog,
|
|
9657
|
+
// nên form không cần tự khai báo *ngFor trong #buttonTemplate.
|
|
9658
|
+
this.buttons = [];
|
|
9659
|
+
// Tiền tố nhãn cho các nút quy trình tự động (vd 'Lưu và'); để rỗng nếu không cần.
|
|
9660
|
+
this.workflowButtonLabelPrefix = 'Lưu và ';
|
|
9654
9661
|
}
|
|
9655
9662
|
}
|
|
9656
9663
|
ComponentBaseWithButton.decorators = [
|
|
@@ -15941,6 +15948,164 @@ EntityMetadataService.ctorParameters = () => [
|
|
|
15941
15948
|
{ type: StorageUpdatedService }
|
|
15942
15949
|
];
|
|
15943
15950
|
|
|
15951
|
+
class WorkflowPermissionDetailService extends BaseService {
|
|
15952
|
+
constructor(http, injector, _moduleConfigService) {
|
|
15953
|
+
super(http, injector, `${_moduleConfigService.getConfig().environment.apiDomain.workflowEndpoint}/${_moduleConfigService.getConfig().environment.apiVersion}/WorkflowPermissionDetail`);
|
|
15954
|
+
this.serviceManagers = {};
|
|
15955
|
+
this.entityName = 'WorkflowPermissionDetail';
|
|
15956
|
+
this.tableName = '';
|
|
15957
|
+
this.guidEmpty = '00000000-0000-0000-0000-000000000000';
|
|
15958
|
+
this.endPoint = _moduleConfigService.getConfig().environment.apiDomain.workflowEndpoint;
|
|
15959
|
+
this._moduleConfig = _moduleConfigService.getConfig();
|
|
15960
|
+
}
|
|
15961
|
+
registerService(settingKey, service) {
|
|
15962
|
+
this.serviceManagers[settingKey] = service;
|
|
15963
|
+
}
|
|
15964
|
+
getEndpointByService(service) {
|
|
15965
|
+
return `${service.endPoint}/${this._moduleConfig.environment.apiVersion}`;
|
|
15966
|
+
}
|
|
15967
|
+
changeEndpoint(baseService) {
|
|
15968
|
+
this.serviceUri = `${this.getEndpointByService(baseService)}/WorkflowPermissionDetail`;
|
|
15969
|
+
this.tableName = baseService.entityName;
|
|
15970
|
+
return this;
|
|
15971
|
+
}
|
|
15972
|
+
appendInfoForWorkflowSingle(userIdCurrent, data, fieldKey = 'id', ignoreWorkflow = false, callBackWhenNotHaveStatus = null) {
|
|
15973
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15974
|
+
if (callBackWhenNotHaveStatus == null) {
|
|
15975
|
+
callBackWhenNotHaveStatus = (itemStatus, rowItem) => {
|
|
15976
|
+
if (rowItem[fieldKey]
|
|
15977
|
+
&& rowItem.workflowCode
|
|
15978
|
+
&& rowItem.currentStateCode) {
|
|
15979
|
+
itemStatus.textTrangThai = 'Đã bắt đầu quy trình';
|
|
15980
|
+
itemStatus.trangThai = rowItem.currentStateCode;
|
|
15981
|
+
itemStatus.workflowCode = rowItem.workflowCode;
|
|
15982
|
+
itemStatus.permission = PermissionBase.READ;
|
|
15983
|
+
}
|
|
15984
|
+
};
|
|
15985
|
+
}
|
|
15986
|
+
const itemId = data[fieldKey];
|
|
15987
|
+
const filters = [
|
|
15988
|
+
this.newFilter('itemId', Operator.equal, itemId),
|
|
15989
|
+
this.newFilter('notInWorkflow', Operator.equal, false),
|
|
15990
|
+
];
|
|
15991
|
+
const sorts = [];
|
|
15992
|
+
if (!ignoreWorkflow) {
|
|
15993
|
+
filters.push(this.newFilter('userId', Operator.equal, userIdCurrent));
|
|
15994
|
+
}
|
|
15995
|
+
else {
|
|
15996
|
+
sorts.push(new Sort({ field: 'permission', dir: -1 }), new Sort({ field: 'inComing', dir: -1 }), new Sort({ field: 'isCOEdit', dir: -1 }));
|
|
15997
|
+
}
|
|
15998
|
+
const dataStatus = (yield this.getAll(filters, 'itemId,userId,trangThai,textTrangThai,workflowCode,permission,isCOEdit', sorts, 'ForCrudList')).data;
|
|
15999
|
+
if (dataStatus == null) {
|
|
16000
|
+
const notifierService = this._injector.get(NotifierService);
|
|
16001
|
+
return notifierService.showWarning('Không lấy được thông tin trạng thái hiện tại của bản ghi');
|
|
16002
|
+
}
|
|
16003
|
+
this.appendWorkflowInfoToItem(data, itemId, userIdCurrent, ignoreWorkflow, dataStatus, callBackWhenNotHaveStatus);
|
|
16004
|
+
return true;
|
|
16005
|
+
});
|
|
16006
|
+
}
|
|
16007
|
+
appendWorkflowInfoToItem(data, itemId, userIdCurrent, ignoreWorkflow, dataStatus, callBackWhenNotHaveStatus = null) {
|
|
16008
|
+
let itemStatus = {
|
|
16009
|
+
textTrangThai: 'Chưa chạy quy trình'
|
|
16010
|
+
};
|
|
16011
|
+
if (itemId) {
|
|
16012
|
+
// const lstItemStatus = dataStatus.filter(q => q.itemId == itemId && q.userId == userIdCurrent);
|
|
16013
|
+
// if (ignoreWorkflow === true && lstItemStatus.length === 0) {
|
|
16014
|
+
// lstItemStatus.push(...dataStatus.filter(q => q.itemId === itemId));
|
|
16015
|
+
// }
|
|
16016
|
+
const lstItemStatus = dataStatus.filter(q => q.itemId === itemId);
|
|
16017
|
+
// let itemStatus = null;
|
|
16018
|
+
if (lstItemStatus.length) {
|
|
16019
|
+
itemStatus = lstItemStatus.find(q => (q.permission & PermissionBase.EDIT) == PermissionBase.EDIT);
|
|
16020
|
+
if (itemStatus == null) {
|
|
16021
|
+
itemStatus = lstItemStatus[0];
|
|
16022
|
+
}
|
|
16023
|
+
}
|
|
16024
|
+
}
|
|
16025
|
+
// Nếu không có bản ghi trạng thái
|
|
16026
|
+
// Nhưng đã tạo task rồi thì hiển thị trạng thái "đã tạo công việc" để tránh trường hợp hiển thị nút bắt đầu thừa trên giao diện
|
|
16027
|
+
if (!itemStatus.trangThai) {
|
|
16028
|
+
callBackWhenNotHaveStatus(itemStatus, data);
|
|
16029
|
+
}
|
|
16030
|
+
data.__isCoEdit = dataStatus.some(x => x.itemId === itemId && x.userId != this.guidEmpty && x.isCOEdit);
|
|
16031
|
+
data.__trangThai = itemStatus.trangThai;
|
|
16032
|
+
data.__textTrangThai = itemStatus.textTrangThai;
|
|
16033
|
+
if (itemStatus.workflowCode == DummyWorkflowCode) {
|
|
16034
|
+
data.hiddenWorkflowAction = true;
|
|
16035
|
+
}
|
|
16036
|
+
data.__workflowCode = itemStatus.workflowCode;
|
|
16037
|
+
data.__permission = itemStatus.permission;
|
|
16038
|
+
data.__disableEdit = true;
|
|
16039
|
+
data.__disableDelete = true;
|
|
16040
|
+
if (data.basePermission & PermissionBase.EDIT
|
|
16041
|
+
|| data.__permission & PermissionBase.EDIT) {
|
|
16042
|
+
data.__disableEdit = false;
|
|
16043
|
+
}
|
|
16044
|
+
else {
|
|
16045
|
+
data.__disablePermissionEdit = true;
|
|
16046
|
+
}
|
|
16047
|
+
if (data.basePermission & PermissionBase.DELETE
|
|
16048
|
+
|| data.__permission & PermissionBase.DELETE) {
|
|
16049
|
+
data.__disableDelete = false;
|
|
16050
|
+
}
|
|
16051
|
+
else {
|
|
16052
|
+
data.__disablePermissionDelete = true;
|
|
16053
|
+
}
|
|
16054
|
+
}
|
|
16055
|
+
/**
|
|
16056
|
+
* Lấy thêm các thông tin cần cho quy trình nghiệp vụ cho các bản ghi trong data
|
|
16057
|
+
*/
|
|
16058
|
+
appendInfoForWorkflow(userIdCurrent, data, fieldKey = 'id', ignoreWorkflow = false, callBackWhenNotHaveStatus = null) {
|
|
16059
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16060
|
+
if (callBackWhenNotHaveStatus == null) {
|
|
16061
|
+
callBackWhenNotHaveStatus = (itemStatus, rowItem) => {
|
|
16062
|
+
if (rowItem[fieldKey]
|
|
16063
|
+
&& rowItem.workflowCode
|
|
16064
|
+
&& rowItem.currentStateCode) {
|
|
16065
|
+
itemStatus.textTrangThai = 'Đã bắt đầu quy trình';
|
|
16066
|
+
itemStatus.trangThai = rowItem.currentStateCode;
|
|
16067
|
+
itemStatus.workflowCode = rowItem.workflowCode;
|
|
16068
|
+
itemStatus.permission = PermissionBase.READ;
|
|
16069
|
+
}
|
|
16070
|
+
};
|
|
16071
|
+
}
|
|
16072
|
+
const lstItemId = data.filter(q => q[fieldKey]).map(q => q[fieldKey]);
|
|
16073
|
+
let filters = [
|
|
16074
|
+
this.newFilter('itemId', Operator.in, lstItemId),
|
|
16075
|
+
this.newFilter('notInWorkflow', Operator.equal, false),
|
|
16076
|
+
];
|
|
16077
|
+
if (this.tableName) {
|
|
16078
|
+
filters.push(this.newFilter('tableName', Operator.equal, this.tableName));
|
|
16079
|
+
}
|
|
16080
|
+
const sorts = [];
|
|
16081
|
+
// if (!ignoreWorkflow) {
|
|
16082
|
+
// filters.push(this.newFilter('userId', Operator.equal, userIdCurrent));
|
|
16083
|
+
// }
|
|
16084
|
+
sorts.push(new Sort({ field: 'permission', dir: -1 }), new Sort({ field: 'inComing', dir: -1 }), new Sort({ field: 'isCOEdit', dir: -1 }));
|
|
16085
|
+
const dataStatus = (yield this.getAll(filters, 'itemId,userId,trangThai,textTrangThai,workflowCode,permission,isCOEdit', sorts, 'ForCrudList')).data;
|
|
16086
|
+
if (dataStatus == null) {
|
|
16087
|
+
const notifierService = this._injector.get(NotifierService);
|
|
16088
|
+
return notifierService.showWarning('Không lấy được thông tin trạng thái hiện tại của bản ghi');
|
|
16089
|
+
}
|
|
16090
|
+
data.forEach(rowItem => {
|
|
16091
|
+
this.appendWorkflowInfoToItem(rowItem, rowItem[fieldKey], userIdCurrent, ignoreWorkflow, dataStatus, callBackWhenNotHaveStatus);
|
|
16092
|
+
});
|
|
16093
|
+
return true;
|
|
16094
|
+
});
|
|
16095
|
+
}
|
|
16096
|
+
}
|
|
16097
|
+
WorkflowPermissionDetailService.ɵprov = i0.ɵɵdefineInjectable({ factory: function WorkflowPermissionDetailService_Factory() { return new WorkflowPermissionDetailService(i0.ɵɵinject(i1$1.HttpClient), i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(ModuleConfigService)); }, token: WorkflowPermissionDetailService, providedIn: "root" });
|
|
16098
|
+
WorkflowPermissionDetailService.decorators = [
|
|
16099
|
+
{ type: Injectable, args: [{
|
|
16100
|
+
providedIn: 'root'
|
|
16101
|
+
},] }
|
|
16102
|
+
];
|
|
16103
|
+
WorkflowPermissionDetailService.ctorParameters = () => [
|
|
16104
|
+
{ type: HttpClient },
|
|
16105
|
+
{ type: Injector },
|
|
16106
|
+
{ type: ModuleConfigService }
|
|
16107
|
+
];
|
|
16108
|
+
|
|
15944
16109
|
class DataFormBase extends ComponentBaseWithButton {
|
|
15945
16110
|
constructor(_injector) {
|
|
15946
16111
|
super(_injector);
|
|
@@ -15964,6 +16129,8 @@ class DataFormBase extends ComponentBaseWithButton {
|
|
|
15964
16129
|
this.autoGetDetail = true;
|
|
15965
16130
|
this.autoSave = true;
|
|
15966
16131
|
this.isCloseForm = true;
|
|
16132
|
+
// Khi lưu bằng workflow action: tạm chặn đóng form lúc lưu, chỉ đóng sau khi action chạy xong
|
|
16133
|
+
this._suppressOnSaved = false;
|
|
15967
16134
|
this.saving = false;
|
|
15968
16135
|
this.getDetailPlusUrl = null;
|
|
15969
16136
|
this.insertPlusUrl = null;
|
|
@@ -15988,6 +16155,7 @@ class DataFormBase extends ComponentBaseWithButton {
|
|
|
15988
16155
|
this._entityMetadataService = this._injector.get(EntityMetadataService);
|
|
15989
16156
|
this._userService = this._injector.get(UserService);
|
|
15990
16157
|
this._commonService = this._injector.get(CommonService);
|
|
16158
|
+
this._workflowPermissionDetailService = this._injector.get(WorkflowPermissionDetailService);
|
|
15991
16159
|
}
|
|
15992
16160
|
ngOnInit() {
|
|
15993
16161
|
// this.checkPermission(this.model.data.basePermission);
|
|
@@ -16102,6 +16270,110 @@ class DataFormBase extends ComponentBaseWithButton {
|
|
|
16102
16270
|
evt.rootModel[FieldWorkflowCodeInCrudForm] = workflowSetting.workflowCode;
|
|
16103
16271
|
}
|
|
16104
16272
|
}
|
|
16273
|
+
/**
|
|
16274
|
+
* Lấy trạng thái quy trình hiện tại của bản ghi, gắn các field __trangThai/__textTrangThai/__workflowCode/__permission
|
|
16275
|
+
* vào data và sinh danh sách nút hành động quy trình (this.buttons) khi bản ghi đã chạy quy trình.
|
|
16276
|
+
* Yêu cầu: this.setting.baseService đã được cấu hình và this.crudList được truyền từ crud-list cha.
|
|
16277
|
+
*/
|
|
16278
|
+
generateWorkflowButton(data) {
|
|
16279
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16280
|
+
// Lấy ra trạng thái quy trình
|
|
16281
|
+
const lstItemStatus = (yield this._workflowPermissionDetailService.changeEndpoint(this.setting.baseService).getAll([
|
|
16282
|
+
this.newFilter('itemId', Operator.equal, data.id),
|
|
16283
|
+
], 'itemId,userId,trangThai,textTrangThai,workflowCode,permission', [], 'ForCrudList')).data;
|
|
16284
|
+
if (lstItemStatus == null) {
|
|
16285
|
+
return this._notifierService.showWarning('Không lấy được thông tin trạng thái hiện tại của bản ghi');
|
|
16286
|
+
}
|
|
16287
|
+
let itemStatus = null;
|
|
16288
|
+
if (!lstItemStatus.length) {
|
|
16289
|
+
itemStatus = {
|
|
16290
|
+
textTrangThai: 'Chưa chạy quy trình'
|
|
16291
|
+
};
|
|
16292
|
+
}
|
|
16293
|
+
else {
|
|
16294
|
+
data.startedWorkflow = true;
|
|
16295
|
+
itemStatus = lstItemStatus.find(q => (q.permission & PermissionBase.EDIT) == PermissionBase.EDIT);
|
|
16296
|
+
if (itemStatus == null) {
|
|
16297
|
+
itemStatus = lstItemStatus[0];
|
|
16298
|
+
}
|
|
16299
|
+
}
|
|
16300
|
+
data.__trangThai = itemStatus.trangThai;
|
|
16301
|
+
data.__textTrangThai = itemStatus.textTrangThai;
|
|
16302
|
+
data.__workflowCode = itemStatus.workflowCode;
|
|
16303
|
+
data.__permission = itemStatus.permission;
|
|
16304
|
+
if (data.startedWorkflow && this.crudList) {
|
|
16305
|
+
const actions = yield this.crudList.getActionWorkflow(data);
|
|
16306
|
+
if (!Array.isArray(actions))
|
|
16307
|
+
return;
|
|
16308
|
+
// Chỉ bọc các action lấy từ getActionAllow; các nút phụ (Thu hồi, Cho ý kiến,
|
|
16309
|
+
// Xem lịch sử, Chuyển xử lý) giữ nguyên hành vi gốc
|
|
16310
|
+
actions.filter(b => b.isActionAllow).forEach(b => this._decorateWorkflowActionButton(b));
|
|
16311
|
+
this.buttons = actions;
|
|
16312
|
+
}
|
|
16313
|
+
});
|
|
16314
|
+
}
|
|
16315
|
+
/**
|
|
16316
|
+
* Gắn hành vi cho 1 nút action quy trình (lấy từ getActionAllow):
|
|
16317
|
+
* - Khi form đang sửa: thêm tiền tố nhãn; nếu dữ liệu thay đổi thì lưu trước (không đóng form), lưu lỗi thì dừng.
|
|
16318
|
+
* - Chạy action gốc, và đóng form sau khi action thực sự hoàn tất.
|
|
16319
|
+
*/
|
|
16320
|
+
_decorateWorkflowActionButton(button) {
|
|
16321
|
+
const isEdit = this._isFormEdit();
|
|
16322
|
+
const runAction = button.command;
|
|
16323
|
+
if (isEdit) {
|
|
16324
|
+
button.label = this.workflowButtonLabelPrefix + button.label;
|
|
16325
|
+
}
|
|
16326
|
+
button.command = () => __awaiter(this, void 0, void 0, function* () {
|
|
16327
|
+
if (this.model.submitting)
|
|
16328
|
+
return;
|
|
16329
|
+
if (isEdit && this._isWorkflowDataChanged()) {
|
|
16330
|
+
this.model.submitting = true;
|
|
16331
|
+
this._suppressOnSaved = true; // không đóng form khi lưu
|
|
16332
|
+
const saved = yield this.save();
|
|
16333
|
+
this._suppressOnSaved = false;
|
|
16334
|
+
if (!saved)
|
|
16335
|
+
return;
|
|
16336
|
+
}
|
|
16337
|
+
if (!runAction)
|
|
16338
|
+
return;
|
|
16339
|
+
this._closeFormWhenWorkflowProcessed();
|
|
16340
|
+
yield runAction();
|
|
16341
|
+
});
|
|
16342
|
+
}
|
|
16343
|
+
/**
|
|
16344
|
+
* Đóng form (phát onSaved) đúng một lần khi crudList báo action quy trình đã xử lý xong.
|
|
16345
|
+
*/
|
|
16346
|
+
_closeFormWhenWorkflowProcessed() {
|
|
16347
|
+
var _a;
|
|
16348
|
+
const processed = (_a = this.crudList) === null || _a === void 0 ? void 0 : _a.onProcessedWorkflow;
|
|
16349
|
+
if (!processed)
|
|
16350
|
+
return;
|
|
16351
|
+
const sub = processed.subscribe(() => {
|
|
16352
|
+
sub.unsubscribe();
|
|
16353
|
+
this.onSaved.emit({ id: this.model.data.id, insert: false, isCloseForm: true });
|
|
16354
|
+
});
|
|
16355
|
+
}
|
|
16356
|
+
/**
|
|
16357
|
+
* So sánh dữ liệu hiện tại với snapshot lúc tải (logSetting.valueBeforeUpdate) để biết form có thay đổi không.
|
|
16358
|
+
* Chuẩn hoá cả 2 qua crudForm.getMinimizeData (bỏ _status/_errors/_source, resolve dropdown object về giá trị thô)
|
|
16359
|
+
* để so sánh ổn định. Nếu không có snapshot thì coi như có thay đổi (luôn lưu) cho an toàn.
|
|
16360
|
+
*/
|
|
16361
|
+
/**
|
|
16362
|
+
* Form có tham gia quy trình hay không (dựa trên cấu hình parentSetting) - cùng điều kiện với biến hasWorkflow trong addSchemaBase.
|
|
16363
|
+
*/
|
|
16364
|
+
_hasWorkflow() {
|
|
16365
|
+
var _a;
|
|
16366
|
+
return !!(this.parentSetting
|
|
16367
|
+
&& ((this.parentSetting.workflowSettingNew && ((_a = this.parentSetting.workflowSettingNew.workflows) === null || _a === void 0 ? void 0 : _a.length) > 0)
|
|
16368
|
+
|| this.parentSetting.isWorkflowTree));
|
|
16369
|
+
}
|
|
16370
|
+
_isWorkflowDataChanged() {
|
|
16371
|
+
if (!this.logSetting.valueBeforeUpdate || !this.crudForm)
|
|
16372
|
+
return true;
|
|
16373
|
+
const current = JSON.stringify(this.crudForm.getMinimizeData(this.model.data));
|
|
16374
|
+
const before = JSON.stringify(this.crudForm.getMinimizeData(this.logSetting.valueBeforeUpdate));
|
|
16375
|
+
return current !== before;
|
|
16376
|
+
}
|
|
16105
16377
|
_handleFormReady(formEvent) {
|
|
16106
16378
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16107
16379
|
yield this.__handleFormReady(formEvent);
|
|
@@ -16163,7 +16435,9 @@ class DataFormBase extends ComponentBaseWithButton {
|
|
|
16163
16435
|
}
|
|
16164
16436
|
yield this._processAfterGetData(response.data);
|
|
16165
16437
|
yield this.onAfterGetDetail(response.data);
|
|
16166
|
-
|
|
16438
|
+
// Lưu snapshot dữ liệu trước khi sửa khi: bật log HOẶC form có quy trình
|
|
16439
|
+
// (để so sánh thay đổi, quyết định có cần lưu trước khi chạy action quy trình hay không)
|
|
16440
|
+
if (this.logSetting.isEnableLog || this._hasWorkflow()) {
|
|
16167
16441
|
this.logSetting.valueBeforeUpdate = this._commonService.cloneObject(response.data);
|
|
16168
16442
|
}
|
|
16169
16443
|
}
|
|
@@ -16274,6 +16548,11 @@ class DataFormBase extends ComponentBaseWithButton {
|
|
|
16274
16548
|
if (this.logSetting.isEnableLog) {
|
|
16275
16549
|
this.getLogValueAfterLoadDetail();
|
|
16276
16550
|
}
|
|
16551
|
+
// Sinh nút hành động quy trình tập trung: form chỉ cần được truyền [crudList] và có cấu hình workflow,
|
|
16552
|
+
// không cần tự gọi generateWorkflowButton trong modifyDetailData.
|
|
16553
|
+
if (this._hasWorkflow() && this.crudList) {
|
|
16554
|
+
yield this.generateWorkflowButton(data);
|
|
16555
|
+
}
|
|
16277
16556
|
});
|
|
16278
16557
|
}
|
|
16279
16558
|
getLogValueAfterLoadDetail() {
|
|
@@ -16582,21 +16861,24 @@ class DataFormBase extends ComponentBaseWithButton {
|
|
|
16582
16861
|
this.triggerSaveFileUpload();
|
|
16583
16862
|
if (this.autoSave) {
|
|
16584
16863
|
if (this._isFormEdit() || this._isFormView()) {
|
|
16585
|
-
yield this.onUpdate();
|
|
16864
|
+
return yield this.onUpdate();
|
|
16586
16865
|
}
|
|
16587
16866
|
else if (this._isFormAddNew()) {
|
|
16588
|
-
yield this.onInsert();
|
|
16867
|
+
return yield this.onInsert();
|
|
16589
16868
|
}
|
|
16590
16869
|
else {
|
|
16591
16870
|
// form view, do nothing
|
|
16871
|
+
return false;
|
|
16592
16872
|
}
|
|
16593
16873
|
}
|
|
16594
16874
|
else {
|
|
16595
16875
|
this.handleManualSave();
|
|
16876
|
+
return true;
|
|
16596
16877
|
}
|
|
16597
16878
|
}
|
|
16598
16879
|
else {
|
|
16599
16880
|
this.model.submitting = false;
|
|
16881
|
+
return false;
|
|
16600
16882
|
}
|
|
16601
16883
|
});
|
|
16602
16884
|
}
|
|
@@ -16668,8 +16950,8 @@ class DataFormBase extends ComponentBaseWithButton {
|
|
|
16668
16950
|
}
|
|
16669
16951
|
const confirmed = yield this.createConfirmIfRequire();
|
|
16670
16952
|
if (!confirmed)
|
|
16671
|
-
return;
|
|
16672
|
-
yield this._insert();
|
|
16953
|
+
return false;
|
|
16954
|
+
return yield this._insert();
|
|
16673
16955
|
});
|
|
16674
16956
|
}
|
|
16675
16957
|
createConfirmIfRequire() {
|
|
@@ -16691,29 +16973,34 @@ class DataFormBase extends ComponentBaseWithButton {
|
|
|
16691
16973
|
}
|
|
16692
16974
|
_insert() {
|
|
16693
16975
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16694
|
-
this.getPromiseActionInsert()
|
|
16976
|
+
return this.getPromiseActionInsert()
|
|
16695
16977
|
.then((response) => __awaiter(this, void 0, void 0, function* () {
|
|
16696
16978
|
this.model.submitting = false;
|
|
16697
16979
|
this.showMessageAfterInsert(response.success, response);
|
|
16698
16980
|
if (response.success) {
|
|
16699
16981
|
this.model.data.id = response.data;
|
|
16700
16982
|
yield this.onAfterSave(response);
|
|
16701
|
-
this.
|
|
16702
|
-
|
|
16703
|
-
|
|
16704
|
-
|
|
16705
|
-
|
|
16983
|
+
if (!this._suppressOnSaved) {
|
|
16984
|
+
this.onSaved.emit({
|
|
16985
|
+
id: this.model.data.id,
|
|
16986
|
+
insert: true,
|
|
16987
|
+
isCloseForm: this.isCloseForm
|
|
16988
|
+
});
|
|
16989
|
+
}
|
|
16990
|
+
return true;
|
|
16706
16991
|
}
|
|
16707
16992
|
else {
|
|
16708
16993
|
this.handleInsertError(response);
|
|
16994
|
+
return false;
|
|
16709
16995
|
}
|
|
16710
16996
|
}), error => {
|
|
16711
16997
|
if (!error.error.success && error.error.errorCheckExist) {
|
|
16712
16998
|
this.model.submitting = false;
|
|
16713
|
-
return;
|
|
16999
|
+
return false;
|
|
16714
17000
|
}
|
|
16715
17001
|
this.model.submitting = false;
|
|
16716
17002
|
this.showMessageAfterInsert(false, error);
|
|
17003
|
+
return false;
|
|
16717
17004
|
});
|
|
16718
17005
|
});
|
|
16719
17006
|
}
|
|
@@ -16725,32 +17012,38 @@ class DataFormBase extends ComponentBaseWithButton {
|
|
|
16725
17012
|
onUpdate() {
|
|
16726
17013
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16727
17014
|
this.setDefaultValue(this.model.data);
|
|
16728
|
-
this.getPromiseActionUpdate()
|
|
17015
|
+
const updatePromise = this.getPromiseActionUpdate()
|
|
16729
17016
|
.then((response) => __awaiter(this, void 0, void 0, function* () {
|
|
16730
17017
|
this.model.submitting = false;
|
|
16731
17018
|
this.showMessageAfterUpdate(response.success, response);
|
|
16732
17019
|
if (response.success) {
|
|
16733
17020
|
yield this.onAfterSave(response);
|
|
16734
|
-
this.
|
|
16735
|
-
|
|
16736
|
-
|
|
16737
|
-
|
|
16738
|
-
|
|
17021
|
+
if (!this._suppressOnSaved) {
|
|
17022
|
+
this.onSaved.emit({
|
|
17023
|
+
id: this.model.data.id,
|
|
17024
|
+
insert: false,
|
|
17025
|
+
isCloseForm: this.isCloseForm
|
|
17026
|
+
});
|
|
17027
|
+
}
|
|
17028
|
+
return true;
|
|
16739
17029
|
}
|
|
16740
17030
|
else {
|
|
16741
17031
|
this.handleUpdateError(response);
|
|
17032
|
+
return false;
|
|
16742
17033
|
}
|
|
16743
17034
|
}), error => {
|
|
16744
17035
|
if (!error.error.success && error.error.errorCheckExist) {
|
|
16745
17036
|
this.model.submitting = false;
|
|
16746
|
-
return;
|
|
17037
|
+
return false;
|
|
16747
17038
|
}
|
|
16748
17039
|
this.model.submitting = false;
|
|
16749
17040
|
this.showMessageAfterUpdate(false, error);
|
|
17041
|
+
return false;
|
|
16750
17042
|
});
|
|
16751
17043
|
if (this.logSetting.isEnableLog) {
|
|
16752
17044
|
this.logSetting.arrValueAfterUpdate = [];
|
|
16753
17045
|
}
|
|
17046
|
+
return updatePromise;
|
|
16754
17047
|
});
|
|
16755
17048
|
}
|
|
16756
17049
|
handleUpdateError(response) {
|
|
@@ -16861,6 +17154,7 @@ DataFormBase.propDecorators = {
|
|
|
16861
17154
|
parentSetting: [{ type: Input }],
|
|
16862
17155
|
model: [{ type: Input }],
|
|
16863
17156
|
forceOnlyView: [{ type: Input }],
|
|
17157
|
+
crudList: [{ type: Input }],
|
|
16864
17158
|
onSave: [{ type: Output }],
|
|
16865
17159
|
onSaved: [{ type: Output }],
|
|
16866
17160
|
onCancel: [{ type: Output }],
|
|
@@ -18964,164 +19258,6 @@ WorkflowHistoryService.ctorParameters = () => [
|
|
|
18964
19258
|
{ type: ModuleConfigService }
|
|
18965
19259
|
];
|
|
18966
19260
|
|
|
18967
|
-
class WorkflowPermissionDetailService extends BaseService {
|
|
18968
|
-
constructor(http, injector, _moduleConfigService) {
|
|
18969
|
-
super(http, injector, `${_moduleConfigService.getConfig().environment.apiDomain.workflowEndpoint}/${_moduleConfigService.getConfig().environment.apiVersion}/WorkflowPermissionDetail`);
|
|
18970
|
-
this.serviceManagers = {};
|
|
18971
|
-
this.entityName = 'WorkflowPermissionDetail';
|
|
18972
|
-
this.tableName = '';
|
|
18973
|
-
this.guidEmpty = '00000000-0000-0000-0000-000000000000';
|
|
18974
|
-
this.endPoint = _moduleConfigService.getConfig().environment.apiDomain.workflowEndpoint;
|
|
18975
|
-
this._moduleConfig = _moduleConfigService.getConfig();
|
|
18976
|
-
}
|
|
18977
|
-
registerService(settingKey, service) {
|
|
18978
|
-
this.serviceManagers[settingKey] = service;
|
|
18979
|
-
}
|
|
18980
|
-
getEndpointByService(service) {
|
|
18981
|
-
return `${service.endPoint}/${this._moduleConfig.environment.apiVersion}`;
|
|
18982
|
-
}
|
|
18983
|
-
changeEndpoint(baseService) {
|
|
18984
|
-
this.serviceUri = `${this.getEndpointByService(baseService)}/WorkflowPermissionDetail`;
|
|
18985
|
-
this.tableName = baseService.entityName;
|
|
18986
|
-
return this;
|
|
18987
|
-
}
|
|
18988
|
-
appendInfoForWorkflowSingle(userIdCurrent, data, fieldKey = 'id', ignoreWorkflow = false, callBackWhenNotHaveStatus = null) {
|
|
18989
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
18990
|
-
if (callBackWhenNotHaveStatus == null) {
|
|
18991
|
-
callBackWhenNotHaveStatus = (itemStatus, rowItem) => {
|
|
18992
|
-
if (rowItem[fieldKey]
|
|
18993
|
-
&& rowItem.workflowCode
|
|
18994
|
-
&& rowItem.currentStateCode) {
|
|
18995
|
-
itemStatus.textTrangThai = 'Đã bắt đầu quy trình';
|
|
18996
|
-
itemStatus.trangThai = rowItem.currentStateCode;
|
|
18997
|
-
itemStatus.workflowCode = rowItem.workflowCode;
|
|
18998
|
-
itemStatus.permission = PermissionBase.READ;
|
|
18999
|
-
}
|
|
19000
|
-
};
|
|
19001
|
-
}
|
|
19002
|
-
const itemId = data[fieldKey];
|
|
19003
|
-
const filters = [
|
|
19004
|
-
this.newFilter('itemId', Operator.equal, itemId),
|
|
19005
|
-
this.newFilter('notInWorkflow', Operator.equal, false),
|
|
19006
|
-
];
|
|
19007
|
-
const sorts = [];
|
|
19008
|
-
if (!ignoreWorkflow) {
|
|
19009
|
-
filters.push(this.newFilter('userId', Operator.equal, userIdCurrent));
|
|
19010
|
-
}
|
|
19011
|
-
else {
|
|
19012
|
-
sorts.push(new Sort({ field: 'permission', dir: -1 }), new Sort({ field: 'inComing', dir: -1 }), new Sort({ field: 'isCOEdit', dir: -1 }));
|
|
19013
|
-
}
|
|
19014
|
-
const dataStatus = (yield this.getAll(filters, 'itemId,userId,trangThai,textTrangThai,workflowCode,permission,isCOEdit', sorts, 'ForCrudList')).data;
|
|
19015
|
-
if (dataStatus == null) {
|
|
19016
|
-
const notifierService = this._injector.get(NotifierService);
|
|
19017
|
-
return notifierService.showWarning('Không lấy được thông tin trạng thái hiện tại của bản ghi');
|
|
19018
|
-
}
|
|
19019
|
-
this.appendWorkflowInfoToItem(data, itemId, userIdCurrent, ignoreWorkflow, dataStatus, callBackWhenNotHaveStatus);
|
|
19020
|
-
return true;
|
|
19021
|
-
});
|
|
19022
|
-
}
|
|
19023
|
-
appendWorkflowInfoToItem(data, itemId, userIdCurrent, ignoreWorkflow, dataStatus, callBackWhenNotHaveStatus = null) {
|
|
19024
|
-
let itemStatus = {
|
|
19025
|
-
textTrangThai: 'Chưa chạy quy trình'
|
|
19026
|
-
};
|
|
19027
|
-
if (itemId) {
|
|
19028
|
-
// const lstItemStatus = dataStatus.filter(q => q.itemId == itemId && q.userId == userIdCurrent);
|
|
19029
|
-
// if (ignoreWorkflow === true && lstItemStatus.length === 0) {
|
|
19030
|
-
// lstItemStatus.push(...dataStatus.filter(q => q.itemId === itemId));
|
|
19031
|
-
// }
|
|
19032
|
-
const lstItemStatus = dataStatus.filter(q => q.itemId === itemId);
|
|
19033
|
-
// let itemStatus = null;
|
|
19034
|
-
if (lstItemStatus.length) {
|
|
19035
|
-
itemStatus = lstItemStatus.find(q => (q.permission & PermissionBase.EDIT) == PermissionBase.EDIT);
|
|
19036
|
-
if (itemStatus == null) {
|
|
19037
|
-
itemStatus = lstItemStatus[0];
|
|
19038
|
-
}
|
|
19039
|
-
}
|
|
19040
|
-
}
|
|
19041
|
-
// Nếu không có bản ghi trạng thái
|
|
19042
|
-
// Nhưng đã tạo task rồi thì hiển thị trạng thái "đã tạo công việc" để tránh trường hợp hiển thị nút bắt đầu thừa trên giao diện
|
|
19043
|
-
if (!itemStatus.trangThai) {
|
|
19044
|
-
callBackWhenNotHaveStatus(itemStatus, data);
|
|
19045
|
-
}
|
|
19046
|
-
data.__isCoEdit = dataStatus.some(x => x.itemId === itemId && x.userId != this.guidEmpty && x.isCOEdit);
|
|
19047
|
-
data.__trangThai = itemStatus.trangThai;
|
|
19048
|
-
data.__textTrangThai = itemStatus.textTrangThai;
|
|
19049
|
-
if (itemStatus.workflowCode == DummyWorkflowCode) {
|
|
19050
|
-
data.hiddenWorkflowAction = true;
|
|
19051
|
-
}
|
|
19052
|
-
data.__workflowCode = itemStatus.workflowCode;
|
|
19053
|
-
data.__permission = itemStatus.permission;
|
|
19054
|
-
data.__disableEdit = true;
|
|
19055
|
-
data.__disableDelete = true;
|
|
19056
|
-
if (data.basePermission & PermissionBase.EDIT
|
|
19057
|
-
|| data.__permission & PermissionBase.EDIT) {
|
|
19058
|
-
data.__disableEdit = false;
|
|
19059
|
-
}
|
|
19060
|
-
else {
|
|
19061
|
-
data.__disablePermissionEdit = true;
|
|
19062
|
-
}
|
|
19063
|
-
if (data.basePermission & PermissionBase.DELETE
|
|
19064
|
-
|| data.__permission & PermissionBase.DELETE) {
|
|
19065
|
-
data.__disableDelete = false;
|
|
19066
|
-
}
|
|
19067
|
-
else {
|
|
19068
|
-
data.__disablePermissionDelete = true;
|
|
19069
|
-
}
|
|
19070
|
-
}
|
|
19071
|
-
/**
|
|
19072
|
-
* Lấy thêm các thông tin cần cho quy trình nghiệp vụ cho các bản ghi trong data
|
|
19073
|
-
*/
|
|
19074
|
-
appendInfoForWorkflow(userIdCurrent, data, fieldKey = 'id', ignoreWorkflow = false, callBackWhenNotHaveStatus = null) {
|
|
19075
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
19076
|
-
if (callBackWhenNotHaveStatus == null) {
|
|
19077
|
-
callBackWhenNotHaveStatus = (itemStatus, rowItem) => {
|
|
19078
|
-
if (rowItem[fieldKey]
|
|
19079
|
-
&& rowItem.workflowCode
|
|
19080
|
-
&& rowItem.currentStateCode) {
|
|
19081
|
-
itemStatus.textTrangThai = 'Đã bắt đầu quy trình';
|
|
19082
|
-
itemStatus.trangThai = rowItem.currentStateCode;
|
|
19083
|
-
itemStatus.workflowCode = rowItem.workflowCode;
|
|
19084
|
-
itemStatus.permission = PermissionBase.READ;
|
|
19085
|
-
}
|
|
19086
|
-
};
|
|
19087
|
-
}
|
|
19088
|
-
const lstItemId = data.filter(q => q[fieldKey]).map(q => q[fieldKey]);
|
|
19089
|
-
let filters = [
|
|
19090
|
-
this.newFilter('itemId', Operator.in, lstItemId),
|
|
19091
|
-
this.newFilter('notInWorkflow', Operator.equal, false),
|
|
19092
|
-
];
|
|
19093
|
-
if (this.tableName) {
|
|
19094
|
-
filters.push(this.newFilter('tableName', Operator.equal, this.tableName));
|
|
19095
|
-
}
|
|
19096
|
-
const sorts = [];
|
|
19097
|
-
// if (!ignoreWorkflow) {
|
|
19098
|
-
// filters.push(this.newFilter('userId', Operator.equal, userIdCurrent));
|
|
19099
|
-
// }
|
|
19100
|
-
sorts.push(new Sort({ field: 'permission', dir: -1 }), new Sort({ field: 'inComing', dir: -1 }), new Sort({ field: 'isCOEdit', dir: -1 }));
|
|
19101
|
-
const dataStatus = (yield this.getAll(filters, 'itemId,userId,trangThai,textTrangThai,workflowCode,permission,isCOEdit', sorts, 'ForCrudList')).data;
|
|
19102
|
-
if (dataStatus == null) {
|
|
19103
|
-
const notifierService = this._injector.get(NotifierService);
|
|
19104
|
-
return notifierService.showWarning('Không lấy được thông tin trạng thái hiện tại của bản ghi');
|
|
19105
|
-
}
|
|
19106
|
-
data.forEach(rowItem => {
|
|
19107
|
-
this.appendWorkflowInfoToItem(rowItem, rowItem[fieldKey], userIdCurrent, ignoreWorkflow, dataStatus, callBackWhenNotHaveStatus);
|
|
19108
|
-
});
|
|
19109
|
-
return true;
|
|
19110
|
-
});
|
|
19111
|
-
}
|
|
19112
|
-
}
|
|
19113
|
-
WorkflowPermissionDetailService.ɵprov = i0.ɵɵdefineInjectable({ factory: function WorkflowPermissionDetailService_Factory() { return new WorkflowPermissionDetailService(i0.ɵɵinject(i1$1.HttpClient), i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(ModuleConfigService)); }, token: WorkflowPermissionDetailService, providedIn: "root" });
|
|
19114
|
-
WorkflowPermissionDetailService.decorators = [
|
|
19115
|
-
{ type: Injectable, args: [{
|
|
19116
|
-
providedIn: 'root'
|
|
19117
|
-
},] }
|
|
19118
|
-
];
|
|
19119
|
-
WorkflowPermissionDetailService.ctorParameters = () => [
|
|
19120
|
-
{ type: HttpClient },
|
|
19121
|
-
{ type: Injector },
|
|
19122
|
-
{ type: ModuleConfigService }
|
|
19123
|
-
];
|
|
19124
|
-
|
|
19125
19261
|
var sort_by;
|
|
19126
19262
|
(function () {
|
|
19127
19263
|
const defaultCompareFunc = function (a, b) {
|
|
@@ -22153,6 +22289,7 @@ class ListComponentBase extends ComponentBase {
|
|
|
22153
22289
|
buttonContexts.push({
|
|
22154
22290
|
soThuTu: action.soThuTu,
|
|
22155
22291
|
actionCode: action.code,
|
|
22292
|
+
isActionAllow: true,
|
|
22156
22293
|
icon: this.sourceIcon[action.icon],
|
|
22157
22294
|
label: action.name,
|
|
22158
22295
|
command: () => this.processWorkflow(crudListSetting, itemWorkflowSetting, action)
|
|
@@ -40966,9 +41103,9 @@ class EntityPickerDataComponent extends DataListBase {
|
|
|
40966
41103
|
EntityPickerDataComponent.decorators = [
|
|
40967
41104
|
{ type: Component, args: [{
|
|
40968
41105
|
selector: 'app-entity-picker-data',
|
|
40969
|
-
template: "<crud-list #crudList [templates]=\"templates\" [menuButtons]=\"getMenuButtons\"
|
|
41106
|
+
template: "<div class=\"entity-picker-data-body\"\n [class.has-left-filter]=\"control.filterHeaderAsLeftPanel && control.templateFilterHeader\">\n <div class=\"left-filter-panel\" *ngIf=\"control.filterHeaderAsLeftPanel && control.templateFilterHeader\">\n <ng-container *ngTemplateOutlet=\"control.templateFilterHeader; context: filterHeaderContext\"></ng-container>\n </div>\n <crud-list class=\"entity-picker-data-list\" #crudList [templates]=\"templates\" [menuButtons]=\"getMenuButtons\"\n [model]=\"model\" [setting]=\"setting\"\n [dataSource]=\"model.dataSource\" [showScrollHorizontal]=\"true\" (onContentInit)=\"onContentInit.emit($event)\"\n (onReload)=\"_triggerProcessData($event)\" (onAdd)=\"_add($event)\" (onRowSelect)=\"handleRowSelect($event)\"\n (onEdit)=\"_edit($event)\" (onView)=\"_view($event)\" (onDelete)=\"_delete($event)\"\n (onDeleteMultiple)=\"_deleteMultiple($event)\" (onReloaded)=\"_unmarkLoading()\">\n <ng-template #customTitle>\n <h1 [innerHTML]=\"dom.bypassSecurityTrustHtml(control.titleUnPicked)\"></h1>\n <div class=\"header-search-box\" *ngIf=\"control.templateFilterHeader && !control.filterHeaderAsLeftPanel\">\n <ng-container *ngTemplateOutlet=\"control.templateFilterHeader; context: filterHeaderContext\">\n </ng-container>\n </div>\n </ng-template>\n\n <ng-template #toolbar let-crudList=\"crudList\" let-selectedItems=\"selectedItems\">\n <button\n *ngIf=\"(isSingleSelection || model.total <= 0) && !model.dataSource.length && setting.hiddenAdvanceSearch\"\n pButton style=\"visibility: hidden\"></button>\n <button *ngIf=\"!isSingleSelection && model.total > 0\" type=\"button\" pButton pRipple\n label=\"L\u1EA5y t\u1EA5t c\u1EA3 ({{model.total}})\" icon=\"pi pi-angle-double-right\" class=\"p-button-text p-button-success\"\n [disabled]=\"model.loading\" (click)=\"pickAll()\"></button>\n <button *ngIf=\"!isSingleSelection && selectedItems.length > 0\" type=\"button\" pButton pRipple\n label=\"L\u1EA5y m\u1EE5c \u0111\u00E3 ch\u1ECDn ({{selectedItems.length}})\" icon=\"pi pi-angle-right\"\n class=\"p-button-text p-button-success\" [disabled]=\"model.loading\"\n (click)=\"pickSelected(selectedItems)\"></button>\n <button *ngIf=\"datasourceFieldFilter.length\" type=\"button\" pButton pRipple label=\"T\u00ECm ki\u1EBFm nhi\u1EC1u ng\u01B0\u1EDDi d\u00F9ng\"\n icon=\"pi pi-search\" class=\"p-button-text p-button-primary\" [disabled]=\"model.loading\"\n (click)=\"handleAdvansearch()\"></button>\n <button *ngIf=\"datasourceFieldFilter.length && searchData\" type=\"button\" pButton pRipple\n label=\"X\u00F3a danh s\u00E1ch t\u00ECm ki\u1EBFm\" pTooltip=\"X\u00F3a t\u1EA5t c\u1EA3 ng\u01B0\u1EDDi d\u00F9ng \u1EDF Danh s\u00E1ch t\u00ECm ki\u1EBFm\" icon=\"pi pi-times\"\n class=\"p-button-text p-button-primary\" [disabled]=\"model.loading\" (click)=\"handleSearch(null)\"></button>\n </ng-template>\n <ng-template let-crudList=\"crudList\" #function let-rowData=\"rowData\">\n <button pButton type=\"button\" class=\"link-or-action p-button-success p-button-text p-button-rounded\"\n icon=\"pi pi-check\" pTooltip=\"Ch\u1ECDn m\u1EE5c n\u00E0y\" tooltipPosition=\"top\" [disabled]=\"rowData.disabled\"\n (click)=\"pickEntity(rowData)\"></button>\n </ng-template>\n</crud-list>\n</div>\n\n\n<tn-dialog *ngIf=\"showFormAdvancedSearch\" #dialog [styleClass]=\"'address-form'\" [header]=\"'T\u00ECm ki\u1EBFm nhi\u1EC1u ng\u01B0\u1EDDi d\u00F9ng'\"\n [popupSize]=\"popupSizeSearchForm\" [maskClass]=\"setting.maskClass\" (onHide)=\"showFormAdvancedSearch = false\">\n <entity-picker-search-form #formBase [parentModel]=\"model\" [parentContext]=\"context\" [parentSetting]=\"setting\"\n [datasourceFieldFilter]=\"datasourceFieldFilter\" [lstDataNotExist]=\"lstDataNotExist\" [model]=\"formModel\"\n (onSearch)=\"handleSearch($event)\" (onCancel)=\"showFormAdvancedSearch = false;\">\n </entity-picker-search-form>\n</tn-dialog>",
|
|
40970
41107
|
providers: [ComponentContextService],
|
|
40971
|
-
styles: ["::ng-deep app-entity-picker-data .custom-card{padding:.5em!important}::ng-deep app-entity-picker-data .header-search-box{padding:1rem 0}::ng-deep app-entity-picker-data .header-search-box p-dropdown .p-dropdown{min-width:300px}"]
|
|
41108
|
+
styles: ["::ng-deep app-entity-picker-data .custom-card{padding:.5em!important}::ng-deep app-entity-picker-data .header-search-box{padding:1rem 0}::ng-deep app-entity-picker-data .header-search-box p-dropdown .p-dropdown{min-width:300px}::ng-deep app-entity-picker-data .entity-picker-data-body{display:contents}::ng-deep app-entity-picker-data .entity-picker-data-body.has-left-filter{display:flex;align-items:stretch;gap:12px;height:72vh}::ng-deep app-entity-picker-data .entity-picker-data-body.has-left-filter .left-filter-panel{flex:0 0 320px;max-width:320px;border-right:1px solid #e5e7eb;padding-right:8px;overflow:hidden}::ng-deep app-entity-picker-data .entity-picker-data-body.has-left-filter .entity-picker-data-list{flex:1 1 auto;min-width:0;height:100%}"]
|
|
40972
41109
|
},] }
|
|
40973
41110
|
];
|
|
40974
41111
|
EntityPickerDataComponent.ctorParameters = () => [
|
|
@@ -49059,7 +49196,7 @@ class TnDialogComponent {
|
|
|
49059
49196
|
TnDialogComponent.decorators = [
|
|
49060
49197
|
{ type: Component, args: [{
|
|
49061
49198
|
selector: 'tn-dialog',
|
|
49062
|
-
template: "<p-dialog #dialog [closeOnEscape]=\"closeOnEscape\" [appendTo]=\"'body'\" [focusOnShow]=\"false\" [focusTrap]=\"false\"\n [(visible)]=\"visible\" [modal]=\"modal\" [responsive]=\"true\" [maximizable]=\"maximizable\" [autoZIndex]=\"true\"\n [styleClass]=\"styleClass\" [maskStyleClass]=\"maskClass\" [showHeader]=\"showHeader\"\n [style]=\"{'width': popupSize.width + 'px', 'min-width': popupSize.width + 'px', 'height': popupSize.height + 'px', 'min-height': popupSize.height + 'px'}\"\n (onShow)=\"handleShowDialog($event)\" (onHide)=\"handleHideDialog($event)\">\n <tn-custom-scrollbar #scrollbar [useDefaultScrollBar]=\"useDefaultScrollBar\" [class]=\"scrollBarStyleClass\"\n [config]=\"scrollConfig\" [style]=\"scrollStyle\" class=\"tn-dialog-scrollbar\">\n <ng-content></ng-content>\n </tn-custom-scrollbar>\n <p-header *ngIf=\"showHeader\">\n <ng-container *ngIf=\"header && !headerTemplate\">\n <div>{{header | translate}}</div>\n </ng-container>\n <ng-container *ngIf=\"headerTemplate\">\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n </ng-container>\n </p-header>\n <p-footer *ngIf=\"showFooter\">\n <p-footer *ngIf=\"formBase && formBase.buttonTemplate\" style=\"display: flex;float: right\">\n <ng-container *ngTemplateOutlet=\"formBase.buttonTemplate\">\n </ng-container>\n </p-footer>\n <ng-container *ngIf=\"!formBase || !formBase.buttonTemplate\">\n <p-footer *ngIf=\"footer\">\n <ng-container *ngTemplateOutlet=\"footer\"></ng-container>\n </p-footer>\n <p-footer *ngIf=\"buttonTemplateInput\">\n <ng-container *ngTemplateOutlet=\"buttonTemplateInput\"></ng-container>\n </p-footer>\n <p-footer *ngIf=\"!footer && !buttonTemplateInput\">\n <button pButton preventTab type=\"button\" icon=\"pi pi-replay\" class=\"p-button-text p-button-secondary\"\n [label]=\"'FORM.CANCEL' | translate\" (click)=\"handleHideDialog($event)\"></button>\n </p-footer>\n </ng-container>\n </p-footer>\n</p-dialog>",
|
|
49199
|
+
template: "<p-dialog #dialog [closeOnEscape]=\"closeOnEscape\" [appendTo]=\"'body'\" [focusOnShow]=\"false\" [focusTrap]=\"false\"\n [(visible)]=\"visible\" [modal]=\"modal\" [responsive]=\"true\" [maximizable]=\"maximizable\" [autoZIndex]=\"true\"\n [styleClass]=\"styleClass\" [maskStyleClass]=\"maskClass\" [showHeader]=\"showHeader\"\n [style]=\"{'width': popupSize.width + 'px', 'min-width': popupSize.width + 'px', 'height': popupSize.height + 'px', 'min-height': popupSize.height + 'px'}\"\n (onShow)=\"handleShowDialog($event)\" (onHide)=\"handleHideDialog($event)\">\n <tn-custom-scrollbar #scrollbar [useDefaultScrollBar]=\"useDefaultScrollBar\" [class]=\"scrollBarStyleClass\"\n [config]=\"scrollConfig\" [style]=\"scrollStyle\" class=\"tn-dialog-scrollbar\">\n <ng-content></ng-content>\n </tn-custom-scrollbar>\n <p-header *ngIf=\"showHeader\">\n <ng-container *ngIf=\"header && !headerTemplate\">\n <div>{{header | translate}}</div>\n </ng-container>\n <ng-container *ngIf=\"headerTemplate\">\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n </ng-container>\n </p-header>\n <p-footer *ngIf=\"showFooter\">\n <p-footer *ngIf=\"formBase && formBase.buttonTemplate\" style=\"display: flex;float: right\">\n <button *ngFor=\"let butt of formBase.buttons\" pButton [icon]=\"butt.icon\" class=\"p-button-text\"\n [label]=\"butt.label\" (click)=\"butt.command()\"></button>\n <ng-container *ngTemplateOutlet=\"formBase.buttonTemplate\">\n </ng-container>\n </p-footer>\n <ng-container *ngIf=\"!formBase || !formBase.buttonTemplate\">\n <p-footer *ngIf=\"footer\">\n <ng-container *ngTemplateOutlet=\"footer\"></ng-container>\n </p-footer>\n <p-footer *ngIf=\"buttonTemplateInput\">\n <ng-container *ngTemplateOutlet=\"buttonTemplateInput\"></ng-container>\n </p-footer>\n <p-footer *ngIf=\"!footer && !buttonTemplateInput\">\n <button pButton preventTab type=\"button\" icon=\"pi pi-replay\" class=\"p-button-text p-button-secondary\"\n [label]=\"'FORM.CANCEL' | translate\" (click)=\"handleHideDialog($event)\"></button>\n </p-footer>\n </ng-container>\n </p-footer>\n</p-dialog>",
|
|
49063
49200
|
styles: [""]
|
|
49064
49201
|
},] }
|
|
49065
49202
|
];
|