tnx-shared 5.3.424 → 5.3.426

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.
Files changed (35) hide show
  1. package/bundles/tnx-shared.umd.js +1688 -411
  2. package/bundles/tnx-shared.umd.js.map +1 -1
  3. package/bundles/tnx-shared.umd.min.js +1 -1
  4. package/bundles/tnx-shared.umd.min.js.map +1 -1
  5. package/classes/base/list-component-base.d.ts.map +1 -1
  6. package/classes/form-schema.d.ts +2 -0
  7. package/classes/form-schema.d.ts.map +1 -1
  8. package/components/entity-picker/entity-picker-dialog/components/entity-picker-data/entity-picker-data.component.d.ts.map +1 -1
  9. package/components/entity-picker/entity-picker-dialog/components/entity-picker-search-form/entity-picker-search-form.component.d.ts.map +1 -1
  10. package/components/entity-picker/entity-picker.component.d.ts +1 -0
  11. package/components/entity-picker/entity-picker.component.d.ts.map +1 -1
  12. package/components/file-upload/file-upload.component.d.ts +31 -9
  13. package/components/file-upload/file-upload.component.d.ts.map +1 -1
  14. package/components/service-file-upload/service-file-upload.component.d.ts +28 -4
  15. package/components/service-file-upload/service-file-upload.component.d.ts.map +1 -1
  16. package/components/user-picker/models/user-picker-setting.d.ts +2 -0
  17. package/components/user-picker/models/user-picker-setting.d.ts.map +1 -1
  18. package/components/user-picker/user-picker-box/user-picker-box.component.d.ts +4 -1
  19. package/components/user-picker/user-picker-box/user-picker-box.component.d.ts.map +1 -1
  20. package/esm2015/classes/base/list-component-base.js +3 -2
  21. package/esm2015/classes/form-schema.js +2 -1
  22. package/esm2015/components/crud/crud-form/crud-form.component.js +2 -2
  23. package/esm2015/components/entity-picker/entity-picker-dialog/components/entity-picker-data/entity-picker-data.component.js +5 -2
  24. package/esm2015/components/entity-picker/entity-picker-dialog/components/entity-picker-search-form/entity-picker-search-form.component.js +4 -3
  25. package/esm2015/components/entity-picker/entity-picker.component.js +9 -1
  26. package/esm2015/components/file-upload/file-upload.component.js +543 -7
  27. package/esm2015/components/service-file-upload/service-file-upload.component.js +599 -63
  28. package/esm2015/components/user-picker/models/user-picker-setting.js +6 -6
  29. package/esm2015/components/user-picker/user-picker-box/user-picker-box.component.js +11 -3
  30. package/esm2015/tnx-shared.module.js +2 -1
  31. package/fesm2015/tnx-shared.js +1169 -78
  32. package/fesm2015/tnx-shared.js.map +1 -1
  33. package/package.json +2 -2
  34. package/tnx-shared.metadata.json +1 -1
  35. package/tnx-shared.module.d.ts.map +1 -1
@@ -1714,6 +1714,7 @@
1714
1714
  _this.titleUnPicked = 'Danh sách các mục chưa chọn';
1715
1715
  _this.titlePicked = 'Danh sách các mục đã chọn';
1716
1716
  _this.fieldsPicked = null;
1717
+ _this.datasourceFieldFilter = [];
1717
1718
  for (var key in init) {
1718
1719
  _this[key] = init[key];
1719
1720
  }
@@ -18023,7 +18024,7 @@
18023
18024
  CrudFormComponent.decorators = [
18024
18025
  { type: i0.Component, args: [{
18025
18026
  selector: 'crud-form',
18026
- template: "<div [class]=\"_styleClass\">\n <form #formElement autocomplete=\"off\" autocorrect=\"off\" spellcheck=\"false\"\n [class]=\"'p-grid form-group crud-form' + (formClass ? ' ' + formClass : '')\"\n (keydown.shift.tab)=\"preventBlur($event)\">\n <div class=\"p-grid p-col-12\" [class.grid]=\"useGridTemplate\" style=\"margin: 0\">\n <ng-container *ngFor=\"let control of setting.schema\">\n <ng-container *ngTemplateOutlet=\"customControl; context: {\n control: control, data: _modelData, parentPath: '', path: control.field, showLabel: control.showLabel,\n mdWidth: control.mdWidth, rowSpan: control.rowSpan\n }\">\n </ng-container>\n </ng-container>\n </div>\n </form>\n</div>\n<p-contextMenu #contextMenu [appendTo]=\"'body'\" [model]=\"buttonContexts\">\n</p-contextMenu>\n<ng-template #customControl let-data=\"data\" let-control=\"control\" let-showLabel=\"showLabel\" let-mdWidth=\"mdWidth\"\n let-rowSpan=\"rowSpan\" let-rowIndex=\"index\" let-path=\"path\" let-parentPath=\"parentPath\" let-tablePath=\"tablePath\">\n <div *ngIf=\"!checkHidden(control, data, path)\" id=\"{{path}}-holder\"\n class=\"p-col-{{control.gWidth}} p-md-{{mdWidth}} row-span-{{rowSpan}} {{control.class}} crud-form-control type-{{control.dataType}}\"\n [class.error]=\"data._errors[control.field].length > 0\"\n [class.not-show-in-box-holder]=\"control.showInBox === false\"\n [class.show-in-box-holder]=\"control.showInBox === true\" [ngStyle]=\"control.style\">\n <div class=\"label\" *ngIf=\"showLabel\">\n <label *ngIf=\"control.label && !control.isHtmlLabel\" [pTooltip]=\"control.fullLabel\"\n tooltipPosition=\"top\">{{control.label}}\n <span *ngIf=\"control.required || control.showIconRequired\" class=\"star-required\">*</span>\n </label>\n <ng-container *ngIf=\"control.label && control.isHtmlLabel\">\n <label [innerHTML]=\"control.label | safeHtml\" [pTooltip]=\"control.fullLabel\" tooltipPosition=\"top\">\n </label>\n <span *ngIf=\"control.required || control.showIconRequired\" class=\"star-required\">*</span>\n </ng-container>\n <span *ngIf=\"control.description\" class=\"control-description\">({{control.description}})</span>\n </div>\n <ng-container [ngSwitch]=\"control.controlType\">\n <ng-container *ngSwitchCase=\"'label'\">\n <ng-container [ngTemplateOutlet]=\"labelControl\"\n [ngTemplateOutletContext]=\"{control: control, data: data}\">\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'title'\">\n <label *ngIf=\"!control.isHtml\" [for]=\"control.for\">{{control.text | translate}}</label>\n <label *ngIf=\"control.isHtml\" [innerHTML]=\"control.text | safeHtml\"></label>\n </ng-container>\n <ng-container *ngSwitchCase=\"'text'\">\n <div class=\"p-inputgroup\" *ngIf=\"control.suffFix\">\n <input [placeholder]=\"control.placeholder\" [tooltipDisabled]=\"control.dataFormat == 'password'\"\n [required]=\"control.validators && control.validators.required\" [pTooltip]=\"data[control.field]\"\n tooltipPosition=\"top\" tooltipStyleClass=\"wrap\"\n [attr.disabled]=\" checkDisabled(data, control) ? true : null\" pInputText\n [type]=\"control.dataFormat\" [max]=\"control.max\" [min]=\"control.min\"\n [maxlength]=\"control.maxLength\" [(ngModel)]=\"data[control.field]\"\n (change)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (key.enter)=\"handleFieldValueChange(control, $event, eventType.ENTER, data, parentPath)\" />\n <span class=\"p-inputgroup-addon\">({{control.suffFix}})</span>\n </div>\n <input *ngIf=\"!control.suffFix\" [placeholder]=\"control.placeholder\"\n [tooltipDisabled]=\"control.dataFormat == 'password'\" [pTooltip]=\"data[control.field]\"\n tooltipPosition=\"top\" tooltipStyleClass=\"wrap\"\n [attr.disabled]=\"checkDisabled(data, control) ? true : null\" pInputText [type]=\"control.dataFormat\"\n [max]=\"control.max\" [min]=\"control.min\" [maxlength]=\"control.maxLength\"\n [(ngModel)]=\"data[control.field]\"\n (change)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (key.enter)=\"handleFieldValueChange(control, $event, eventType.ENTER, data, parentPath)\" />\n </ng-container>\n <ng-container *ngSwitchCase=\"'htmlPreview'\">\n <html-preview [control]=\"control\" [(ngModel)]=\"data[control.field]\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </html-preview>\n </ng-container>\n <ng-container *ngSwitchCase=\"'reference-text'\">\n <reference-textbox [control]=\"control\" [value]=\"data[control.field]\" [dataSource]=\"control.dataSource\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"></reference-textbox>\n </ng-container>\n <ng-container *ngSwitchCase=\"'template'\">\n <ng-container [ngTemplateOutlet]=\"control.template\"\n [ngTemplateOutletContext]=\"{$implicit: _rootNode, control: control, data: data, tablePath: tablePath, parentPath: parentPath, rowIndex: rowIndex, funcUpdateModel: updateModelFromExternal}\">\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'content'\">\n <div class=\"control-content label\">\n <span [innerHTML]=\"data[control.field] ? (data[control.field] | safeHtml) : ''\">\n </span>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'mask'\">\n <tn-mask [prefix]=\"control.prefix\" [decimalPlaces]=\"control.decimalPlaces\" [suffix]=\"control.suffix\"\n [placeholder]=\"control.placeholder\" [disabled]=\"checkDisabled(data, control)\" tooltipPosition=\"top\"\n [tooltipDisabled]=\"control.dataFormat == 'password'\" [pTooltip]=\"data[control.field]\"\n [maskType]=\"control.maskType\" [autoFormat]=\"control.autoFormat\" [min]=\"control.min\"\n [max]=\"control.max\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </tn-mask>\n </ng-container>\n <ng-container *ngSwitchCase=\"'numberrange'\">\n <tn-number-picker-range [decimalPlaces]=\"control.decimalPlaces\"\n [disabled]=\"checkDisabled(data, control)\" [maskType]=\"control.maskType\" [min]=\"control.min\"\n [max]=\"control.max\" [placeholder]=\"control.placeholder\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (change)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (blur)=\"handleFieldValueChange(control, $event, eventType.BLUR, data, parentPath)\">\n </tn-number-picker-range>\n </ng-container>\n <ng-container *ngSwitchCase=\"'money'\">\n <input currencyMask [attr.disabled]=\"checkDisabled(data, control) ? true : null\" pInputText type=\"tel\"\n tooltipPosition=\"top\" [pTooltip]=\"data[control.field] | number: '1.0-0'\"\n [options]=\"{prefix: '', thousands: '.', decimal: ',',precision:control.dataFormat === 'money'?0:0 }\"\n [(ngModel)]=\"data[control.field]\"\n (ngModelChange)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\" />\n </ng-container>\n <ng-container *ngSwitchCase=\"'phoneOrfax'\">\n <input [placeholder]=\"control.dataFormat==='phone'?'(999) 999-9999':'999-999-9999'\"\n [attr.disabled]=\"checkDisabled(data, control) ? true : null\" type=\"tel\" pInputText\n [(ngModel)]=\"data[control.field]\"\n (change)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\" />\n </ng-container>\n <ng-container *ngSwitchCase=\"'textarea'\">\n <textarea pInputTextarea [rows]=\"control.rows ? control.rows : 5\"\n [attr.disabled]=\"checkDisabled(data, control) ? true : null\" [(ngModel)]=\"data[control.field]\"\n [placeholder]=\"control.placeholder\"\n (keyup)=\"handleKeyUp(control, $event, eventType.CHANGE, data, parentPath)\"\n (change)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"></textarea>\n </ng-container>\n <ng-container *ngSwitchCase=\"'editor'\">\n <tn-tinymce *ngIf=\"!checkDisabled(data, control)\"\n [required]=\"control.validators && control.validators.required\" [mode]=\"control.mode\"\n [height]=\"control.height ? control.height : 250\" [languageCode]=\"control.languageCode\"\n [control]=\"control\"\n [disabled]=\"control.disabled || (control.disableCheck && control.disableCheck(model))\"\n [(ngModel)]=\"data[control.field]\" (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onKeyUp)=\"handleKeyUp(control, $event, eventType.CHANGE, data, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </tn-tinymce>\n <div *ngIf=\"checkDisabled(data, control)\" class=\"html-box\"\n [innerHTML]=\"data[control.field] ? (data[control.field] | safeHtml) : ''\">\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'datetime'\">\n <datetime-picker [disabled]=\"checkDisabled(data, control)\" [control]=\"control\"\n [(ngModel)]=\"data[control.field]\" (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </datetime-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"'autocomplete'\">\n <app-autocomplete-datasource [control]=\"control\"\n [suggestions]=\"data._source[control.field] || control.dataSource\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onValueChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </app-autocomplete-datasource>\n </ng-container>\n <ng-container *ngSwitchCase=\"'datetimerange'\">\n <tn-datetime-picker-range [disabled]=\"control.disabled\" [control]=\"control\"\n [(ngModel)]=\"data[control.field]\" (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </tn-datetime-picker-range>\n </ng-container>\n <ng-container *ngSwitchCase=\"'dropdown'\">\n <dropdown [control]=\"control\" [dataSource]=\"getControlDataSource(control, data)\" [data]=\"data\"\n [(value)]=\"data[control.field]\" (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleChangeDropdown(control, $event, eventType.CHANGE, data, parentPath)\"\n (onHideSmartEvent)=\"handleChangeDropdown(control, $event, eventType.HIDE, data, parentPath)\"\n (adjustValue)=\"handleAdjustValueDropdownEvent(control, parentPath)\"\n (onDataSourceLoaded)=\"handleDataSourceLoaded(control, parentPath, $event)\"\n (onReady)=\"handleControlReadyEvent(control, parentPath)\">\n </dropdown>\n </ng-container>\n <ng-container *ngSwitchCase=\"'imageuploader'\">\n <app-image-uploader [loadByEntityKey]=\"control.loadByEntityKey\" [entityKey]=\"control.entityKey\"\n [defaultNoImageUrl]=\"'/assets/images/no-image.jpg'\" [multiple]=\"control.multiple\"\n [disabled]=\"control.disabled\" [isAvatar]=\"control.isAvatar\" [(ngModel)]=\"data[control.field]\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\">\n <ng-template *ngIf=\"control.templateItems\" #items let-files>\n <ng-container *ngTemplateOutlet=\"control.templateItems; context: {\n $implicit: files\n }\"></ng-container>\n </ng-template>\n <ng-template *ngIf=\"control.templateItem\" #item let-file>\n <ng-container *ngTemplateOutlet=\"control.templateItem; context: {\n $implicit: file\n }\"></ng-container>\n </ng-template>\n </app-image-uploader>\n </ng-container>\n <ng-container *ngSwitchCase=\"'fileManager'\">\n <file-manager *ngIf=\"control.entityKey || data[control.entityKeyField] || control.rootFolderId\"\n [control]=\"control\" [serviceCode]=\"control.serviceCode\" [entity]=\"control.entity\"\n [hiddenCreateFolder]=\"control.hiddenCreateFolder\"\n [entityKey]=\"control.entityKey ? control.entityKey : data[control.entityKeyField]\"\n [readonly]=\"control.disabled\" [layout]=\"control.layout\" [rootFolderId]=\"control.rootFolderId\"\n [maxFileSize]=\"control.maxFileSize\" [inTaiLieu]=\"control.inTaiLieu\"\n [inTaiLieuChung]=\"control.inTaiLieuChung\" [copyToFolderId]=\"control.copyToFolderId\"\n [filePickerSetting]=\"control.filePickerSetting\" [dataForm]=\"data\"\n [invalidFileSizeMessageSummary]=\"control.invalidFileSizeMessageSummary\"\n [invalidFileSizeMessageDetail]=\"control.invalidFileSizeMessageDetail\"\n [invalidFileTypeMessageSummary]=\"control.invalidFileTypeMessageSummary\"\n [invalidFileTypeMessageDetail]=\"control.invalidFileTypeMessageDetail\"\n [invalidFileLimitMessageSummary]=\"control.invalidFileLimitMessageSummary\"\n [invalidFileLimitMessageDetail]=\"control.invalidFileLimitMessageDetail\" [parentSetting]=\"setting\"\n [noFileMessage]=\"control.noFileMessage\" [(value)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onSelected)=\"control.onSelected($event)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onReady)=\"handleControlReadyEvent(control, parentPath)\">\n </file-manager>\n </ng-container>\n <span *ngSwitchCase=\"'fileUpload'\">\n <file-upload [sharedFolderType]=\"control.sharedFolderType\" [maxFileSize]=\"control.maxFileSize\"\n [invalidFileSizeMessageSummary]=\"control.invalidFileSizeMessageSummary\"\n [invalidFileSizeMessageDetail]=\"control.invalidFileSizeMessageDetail\"\n [invalidFileTypeMessageSummary]=\"control.invalidFileTypeMessageSummary\"\n [invalidFileTypeMessageDetail]=\"control.invalidFileTypeMessageDetail\"\n [invalidFileLimitMessageSummary]=\"control.invalidFileLimitMessageSummary\"\n [invalidFileLimitMessageDetail]=\"control.invalidFileLimitMessageDetail\" [control]=\"control\"\n [showDeleteFile]=\"control.showDeleteFile\" [readonly]=\"control.readonly\" [accept]=\"control.accept\"\n [(ngModel)]=\"data[control.field]\" (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onRemove)=\"handleFieldValueChange(control, $event, eventType.DELETED, data, parentPath)\">\n </file-upload>\n </span>\n <span *ngSwitchCase=\"'serviceFileUpload'\">\n <service-file-upload *ngIf=\"control.entityKey || data[control.entityKeyField] || control.rootFolderId\"\n [parentContext]=\"context\" [serviceCode]=\"control.serviceCode\" [entity]=\"control.entity\"\n [entityKey]=\"control.entityKey ? control.entityKey : data[control.entityKeyField]\"\n [control]=\"control\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onRemove)=\"handleFieldValueChange(control, $event, eventType.DELETED, data, parentPath)\">\n </service-file-upload>\n </span>\n <ng-container *ngSwitchCase=\"'user-picker'\">\n <user-picker [control]=\"control\" [disabled]=\"checkDisabled(data, control)\"\n [readOnlyValues]=\"data[control.field + '_readOnly']\" [multiple]=\"control.multiple\"\n [(ngModel)]=\"data[control.field]\" (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onReady)=\"handleReadyControlPicker(control, parentPath)\">\n </user-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"'switch'\">\n <p-inputSwitch [disabled]=\"checkDisabled(data, control)\" [(ngModel)]=\"data[control.field]\"\n (onChange)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </p-inputSwitch>\n </ng-container>\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <div [class]=\"control.class\" role=\"checkbox-alone\">\n <p-checkbox [disabled]=\"checkDisabled(data, control)\" [binary]=\"true\"\n [label]=\"control.isCustomLabel ? control.displayLabel : (!control.hiddenLabel ? control.label : null)\"\n [(ngModel)]=\"data[control.field]\"\n (onChange)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </p-checkbox>\n <!-- <tn-checkbox [control]=\"control\" [disabled]=\"checkDisabled(data, control)\"\n [(ngModel)]=\"data[control.field]\"\n (onChange)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"></tn-checkbox> -->\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'button'\">\n <button type=\"button\" pButton [class]=\"control.btClass\" [icon]=\"control.icon\" [disabled]=\"control.disabled\"\n [label]=\"control.buttonText | translate\" [ngStyle]=\"control.btStyle\" [pTooltip]=\"control.fullLabel\"\n tooltipPosition=\"top\" (click)=\"handleButtonClick(control, $event, parentPath)\"></button>\n </ng-container>\n <ng-container *ngSwitchCase=\"'container'\">\n <div class=\"p-grid p-col-12\" style=\"margin: 0\" [class.not-show-in-box]=\"!control.showInBox\"\n [class.show-in-box]=\"control.showInBox\" [ngStyle]=\"control.boxStyle\">\n <ng-container *ngFor=\"let subControl of control.controls\">\n <ng-container *ngTemplateOutlet=\"customControl; context: {\n control: subControl,\n data: data[control.field],\n parentPath: path,\n rowIndex: rowIndex,\n path: path + '.' + subControl.field,\n showLabel: subControl.showLabel,\n mdWidth: subControl.mdWidth,\n rowSpan: subControl.rowSpan\n }\">\n </ng-container>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'checkboxlist'\">\n <check-box-list [control]=\"control\" [dataSource]=\"data._source[control.field] || control.dataSource\"\n [disabled]=\"checkDisabled(data, control)\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onSelect)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onReady)=\"handleControlReadyEvent(control, parentPath)\">\n </check-box-list>\n </ng-container>\n <ng-container *ngSwitchCase=\"'radiobuttonlist'\">\n <radio-button-list [control]=\"control\" [dataSource]=\"control.dataSource\"\n [disabled]=\"checkDisabled(data, control)\" [(value)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (adjustValue)=\"handleAdjustValueDropdownEvent(control, parentPath)\"\n (onReady)=\"handleReadyControlPicker(control, parentPath)\"\n (onDataSourceLoaded)=\"handleDataSourceLoaded(control, parentPath, $event)\">\n </radio-button-list>\n </ng-container>\n <ng-container *ngSwitchCase=\"'colorPicker'\">\n <tn-color-picker [disabled]=\"checkDisabled(data, control)\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (change)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </tn-color-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"'spanControl'\">\n <span *ngIf=\"!control.ishtml\">{{data[control.field]}}</span>\n <span *ngIf=\"control.ishtml\" [innerHTML]=\"data[control.field]\"></span>\n </ng-container>\n <ng-container *ngSwitchCase=\"'colorControl'\">\n <span class=\"show-color-control\" [ngStyle]=\"{ backgroundColor: data[control.sourceField]}\"></span>\n </ng-container>\n <ng-container *ngSwitchCase=\"'address-new'\">\n <address-picker-new [control]=\"control\" [showSubLabel]=\"control.showSubLabel\"\n [disabled]=\"checkDisabled(data, control)\" [(data)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onSelect)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onReady)=\"handleControlReadyEvent(control, parentPath)\">\n </address-picker-new>\n </ng-container>\n <ng-container *ngSwitchCase=\"'address'\">\n <address-picker [control]=\"control\" [showSubLabel]=\"control.showSubLabel\"\n [disabled]=\"checkDisabled(data, control)\" [(data)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onSelect)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onReady)=\"handleControlReadyEvent(control, parentPath)\">\n </address-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"'autocomplete-picker'\">\n <autocomplete-picker [control]=\"control\" [disabled]=\"checkDisabled(data, control)\"\n [required]=\"control.required\" [readOnlyValues]=\"data[control.field + '_readOnly']\"\n [(ngModel)]=\"data[control.field]\" (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onReady)=\"handleReadyControlPicker(control, parentPath)\">\n </autocomplete-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"'cocautochuc'\">\n <cocautochuc-picker [control]=\"control\" [parentOrgId]=\"control.parentOrgId\"\n [disabled]=\"checkDisabled(data, control)\" [parentOrgCode]=\"control.parentOrgCode\"\n [filter]=\"control.filter\" [multiple]=\"control.multiple\" [required]=\"control.required\"\n [isUsingId]=\"control.isUsingId\" [disabledParentItem]=\"control.disabledParentItem\"\n [rootParentId]=\"control.rootParentId\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </cocautochuc-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"'cocautochuc-picker'\">\n <cocautochuc-picker-list [control]=\"control\" [disabled]=\"checkDisabled(data, control)\"\n [required]=\"control.required\" [readOnlyValues]=\"data[control.field + '_readOnly']\"\n [(ngModel)]=\"data[control.field]\" (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onReady)=\"handleReadyControlPicker(control, parentPath)\">\n </cocautochuc-picker-list>\n </ng-container>\n <ng-container *ngSwitchCase=\"'cocautochuc-picker-new'\">\n <cocautochuc-picker-list-new [control]=\"control\" [disabled]=\"checkDisabled(data, control)\"\n [required]=\"control.required\" [readOnlyValues]=\"data[control.field + '_readOnly']\"\n [(ngModel)]=\"data[control.field]\" (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onReady)=\"handleReadyControlPicker(control, parentPath)\">\n </cocautochuc-picker-list-new>\n </ng-container>\n <ng-container *ngSwitchCase=\"'vanban'\">\n <vanban-picker [control]=\"control\" [disabled]=\"checkDisabled(data, control)\"\n [required]=\"control.required\" [readOnly]=\"control.readOnly\" [loaiVanBan]=\"control.loaiVanBan\"\n [(ngModel)]=\"data[control.field]\" (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </vanban-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"'congviec'\">\n <div>\n <congviec-picker [control]=\"control\" [disabled]=\"checkDisabled(data, control)\"\n [required]=\"control.required\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </congviec-picker>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'percent'\">\n <div>\n <tn-mask [suffix]=\"'%'\" [placeholder]=\"control.placeholder\" [maskType]=\"'int'\"\n [autoFormat]=\"control.autoFormat\" [min]=\"0\" [max]=\"100\"\n [disabled]=\"checkDisabled(data, control)\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </tn-mask>\n <p-slider [step]=\"1\" [min]=\"0\" [max]=\"100\" [disabled]=\"checkDisabled(data, control)\"\n [(ngModel)]=\"data[control.field]\"\n (onSlideEnd)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </p-slider>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'chips'\">\n <p-chips [disabled]=\"checkDisabled(data, control)\" [(ngModel)]=\"data[control.field]\"\n [placeholder]=\"control.placeholder\"\n (onAdd)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onRemove)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"></p-chips>\n </ng-container>\n <ng-container *ngSwitchCase=\"'entity-picker'\">\n <entity-picker [control]=\"control\" [children]=\"children\" [disabled]=\"checkDisabled(data, control)\"\n [required]=\"control.required\" [readOnly]=\"control.readOnly\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </entity-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"'table'\">\n <div [class]=\"control.class\">\n <tn-custom-scrollbar class=\"--has-border\" [showScrollHorizontal]=\"true\">\n <p-table class=\"new-table scr-table table-control\" [value]=\"data[control.field]\"\n [columns]=\"control.headerTemplate\" [responsive]=\"true\" [scrollable]=\"false\"\n [rowTrackBy]=\"trackByFuncId\"\n (onRowReorder)=\"handleRowOrdered(control, $event, eventType.ROW_REORDER, data, parentPath)\">\n <ng-template pTemplate=\"colgroup\">\n <colgroup>\n <col *ngIf=\"control.showNumber\" style=\"width: 40px\" />\n <ng-container *ngFor=\"let subControl of control.rowTemplate\">\n <col *ngIf=\"subControl && !subControl.hidden && subControl.visibleInList\"\n [style.width]=\"subControl.width\" />\n </ng-container>\n <col *ngIf=\"control.enableReorderRow\" style=\"width: 30px\" />\n <col *ngIf=\"control.showFunction\" [style.width]=\"control.widthFunctionColumn\" />\n </colgroup>\n </ng-template>\n <ng-template *ngIf=\"getComponentByType(_prefixCustomHeader + control.field)\"\n pTemplate=\"header\" let-columns>\n <ng-container\n *ngTemplateOutlet=\"getComponentByType(_prefixCustomHeader + control.field), context: {$implicit: control.headerTemplate, crudForm: this, containerSticky: containerSticky}\">\n </ng-container>\n </ng-template>\n <ng-template *ngIf=\"!getComponentByType(_prefixCustomHeader + control.field)\"\n pTemplate=\"header\" let-rowData let-columns>\n <tr>\n <th *ngIf=\"control.showNumber\" class=\"th-sticky stt\">\n {{ 'TT' |translate}}\n <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n </th>\n <ng-container *ngFor=\"let subControl of control.rowTemplate\">\n <th *ngIf=\"subControl && !subControl.hidden && subControl.visibleInList\"\n [width]=\"subControl.width\"\n [pTooltip]=\"subControl.fullLabel || subControl.label\" tooltipPosition=\"top\"\n style=\"text-align: center;\">\n {{subControl.label}}\n <span *ngIf=\"subControl.required\" class=\"star-required\">*</span>\n <span *ngIf=\"subControl.description\"\n class=\"subControl-description\">({{subControl.description}})</span>\n <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"control.enableReorderRow\">\n <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n </th>\n <th *ngIf=\"control.showFunction\" class=\"table-function column-function\">\n <div class=\"cell-header-function\"><span>{{'Ch\u1EE9c n\u0103ng'|translate}}</span></div>\n <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData let-ri=\"rowIndex\">\n <tr [pReorderableRow]=\"ri\" [class]=\"rowData.class\"\n (click)=\"handleRowClick(rowData, control)\">\n <td *ngIf=\"control.showNumber\" class=\"stt th-sticky\"\n style=\"text-align: center; vertical-align: inherit\">\n <span>\n {{ri + 1}}\n </span>\n <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n </td>\n <ng-container *ngFor=\"let subControl of control.rowTemplate; let i = index\">\n <td *ngIf=\"subControl && !subControl.hidden && subControl.visibleInList\"\n [class.control-inside]=\"true\" [class]=\"subControl.class\"\n [ngStyle]=\"{'text-align': getTextAlign(subControl.textAlign), 'vertical-align': 'inherit'}\">\n <span class=\"p-column-title\">{{subControl.label}}</span>\n <ng-template [ngIf]=\"getControlType(subControl) != 'column'\">\n <ng-container *ngTemplateOutlet=\"customControl; context: {\n control: subControl,\n data: rowData,\n index: ri,\n tablePath: path,\n parentPath: path + '[' + ri + ']',\n path: path + '[' + ri + '].' + subControl.field,\n showLabel: false,\n mdWidth: 12,\n rowSpan: 1\n }\">\n </ng-container>\n </ng-template>\n <ng-template [ngIf]=\"getControlType(subControl) == 'column'\">\n <span>{{_modelData[control.field][ri][subControl.field]}}</span>\n </ng-template>\n <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n </td>\n </ng-container>\n <td *ngIf=\"control.enableReorderRow\" class=\"no-padding center v-center\">\n <i class=\"fas fa-arrows-alt\" style=\"cursor:pointer; padding: 8px; color: #555;\"\n pReorderableRowHandle></i>\n <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n </td>\n <td *ngIf=\"control.showFunction\" style=\"text-align: center\"\n class=\"column-function text-center\">\n <div *ngIf=\"!control.rowButtonTemplate\"\n class=\"p-toolbar-group-center button-group\">\n <button *ngIf=\"control.showSave\" [disabled]=\"rowData._disableSave\"\n type=\"button\" pButton class=\"p-button-text p-button-rounded\"\n icon=\"pi pi-save\" [pTooltip]=\"'L\u01B0u' | translate\" tooltipPosition=\"top\"\n (click)=\"saveRow(ri, control, path)\"></button>\n <button *ngIf=\"control.showEdit\" [disabled]=\"rowData._disableEdit\"\n type=\"button\" pButton class=\"p-button-text p-button-rounded\"\n icon=\"pi pi-pencil\" [pTooltip]=\"'S\u1EEDa' | translate\" tooltipPosition=\"top\"\n (click)=\"editRow(ri, control, path)\"></button>\n <button *ngIf=\"control.showDelete\" [disabled]=\"rowData._disableDelete\"\n type=\"button\" pButton\n class=\"p-button-text p-button-danger p-button-rounded\"\n icon=\"pi pi-trash\" [pTooltip]=\"'X\u00F3a' | translate\" tooltipPosition=\"top\"\n (click)=\"deleteRow(ri, control, path)\"></button>\n <button *ngIf=\"control.rowButtons\" type=\"button\" pButton\n icon=\"pi pi-ellipsis-v\"\n class=\"link-or-action p-button-text p-button-rounded\"\n pTooltip=\"Ch\u1EE9c n\u0103ng kh\u00E1c\" tooltipPosition=\"top\"\n (click)=\"showContextMenu($event, rowData, control)\"></button>\n </div>\n <div *ngIf=\"control.rowButtonTemplate\"\n class=\"p-toolbar-group-center button-group\">\n <ng-container\n *ngTemplateOutlet=\"control.rowButtonTemplate; context: {rowData: _modelData[control.field][ri], rowIndex: ri, path: path, control: control}\">\n </ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n </td>\n </tr>\n </ng-template>\n <ng-template *ngIf=\"control.summaryTemplate\" pTemplate=\"summary\" let-rowData>\n <ng-container *ngTemplateOutlet=\"control.summaryTemplate; context: {rowData: rowData}\">\n </ng-container>\n </ng-template>\n </p-table>\n </tn-custom-scrollbar>\n <div *ngIf=\"control.showFooter\" class=\"--table-schema-footer\">\n <button *ngIf=\"control.showAdd\" type=\"button\" pButton style=\"width:auto\" label=\"Th\u00EAm m\u1EDBi\"\n icon=\"pi pi-plus\" class=\"p-button-text\" (click)=\"addNewRow(control, path)\"></button>\n <span *ngIf=\"control.showDialog\" style=\"font-weight: normal;\">\n <p-checkbox label=\"M\u1EDF dialog\" [binary]=\"true\" [(ngModel)]=\"control.showEdit\">\n </p-checkbox>\n </span>\n <button *ngIf=\"control.enableAddMulti\" type=\"button\" pButton\n style=\"width:auto; margin-left:10px;\" label=\"Th\u00EAm nhi\u1EC1u\" icon=\"pi pi-clone\"\n class=\"p-button-text\" (click)=\"addMultiRow(control, 5, path)\"></button>\n <button *ngFor=\"let bt of control.footerButtons\" type=\"button\" pButton [class]=\"bt.class\"\n [icon]=\"bt.icon\" [label]=\"bt.label | translate\" style=\"width:auto; margin-left:10px;\"\n (click)=\"messageRow( -1, control, path)\"></button>\n </div>\n </div>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"control.template\">\n <ng-container [ngTemplateOutlet]=\"control.template\" [ngTemplateOutletContext]=\"{\n crudForm: this, data: data, index: rowIndex, parentPath: parentPath, control: control, changeFunc: handleFieldValueChange\n }\">\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"!control.template\" [ngTemplateOutlet]=\"getComponentByType(control.field)\"\n [ngTemplateOutletContext]=\"{\n crudForm: this, data: data, index: rowIndex, parentPath: parentPath, control: control, changeFunc: handleFieldValueChange\n }\">\n </ng-container>\n </ng-container>\n <ng-container *ngTemplateOutlet=\"validation; context: {control: control, data: data}\">\n </ng-container>\n <div *ngIf=\"control.message\" class=\"control-message\">\n <span [class]=\"control.messageClass\">{{control.message}}</span>\n </div>\n </ng-container>\n </div>\n</ng-template>\n<ng-template #validation let-control=\"control\" let-data=\"data\">\n <ng-container *ngIf=\"data._errors[control.field].length > 0\">\n <div class=\"error-container\">\n <ng-container *ngFor=\"let error of data._errors[control.field]\">\n <div class=\"error-item\" *ngIf=\"error\">\n <ng-container [ngTemplateOutlet]=\"errorMessage\" [ngTemplateOutletContext]=\"{content: error}\">\n </ng-container>\n </div>\n </ng-container>\n </div>\n </ng-container>\n</ng-template>\n<ng-template #errorMessage let-content=\"content\">\n <div class=\"error-content\">\n <i class=\"pi pi-ban\"></i>\n <span> {{content}}</span>\n </div>\n</ng-template>\n<ng-template #labelControl let-control=\"control\">\n <ng-container>\n <label [class]=\"getLabelClass(control)\" *ngIf=\"!control.isHtml\" [attr.label-index]=\"control.indexLabel\"\n [pTooltip]=\"control.title\" tooltipPosition=\"top\" tooltipStyleClass=\"wrap\" [escape]=\"false\"\n [for]=\"control.for\">{{control.text | translate}}</label>\n <label [class]=\"getLabelClass(control)\" *ngIf=\"control.isHtml\" [innerHTML]=\"control.text | safeHtml\"\n [attr.label-index]=\"control.indexLabel\"></label>\n </ng-container>\n</ng-template>\n<ng-template #containerSticky>\n <span class=\"fix-sticky top\"></span>\n <span class=\"fix-sticky right\"></span>\n <span class=\"fix-sticky left\"></span>\n</ng-template>\n<!-- <ng-template #templateCongViecForm let-control=\"control\">\n <base-congviec-form [control]=\"control\" [parentSetting]=\"congViecSetting\" [tenCongViec]=\"control.data.tenCongViec\">\n </base-congviec-form>\n</ng-template> -->\n<tn-dialog *ngIf=\"tableFormDialogModel.showEditForm\" #dialog [styleClass]=\"'address-form'\"\n [header]=\"tableFormDialogModel.header | translate\" [popupSize]=\"tableFormDialogModel.popupSize\"\n (onHide)=\"tableFormDialogModel.showEditForm = false\">\n <table-detail-form #formBase [parentSetting]=\"setting\" [schema]=\"tableFormSchema\" [data]=\"tableFormDialogModel.data\"\n (onSaved)=\"handleSavedTableRow($event)\" (onCancel)=\"tableFormDialogModel.showEditForm = false\">\n </table-detail-form>\n</tn-dialog>",
18027
+ template: "<div [class]=\"_styleClass\">\n <form #formElement autocomplete=\"off\" autocorrect=\"off\" spellcheck=\"false\"\n [class]=\"'p-grid form-group crud-form' + (formClass ? ' ' + formClass : '')\"\n (keydown.shift.tab)=\"preventBlur($event)\">\n <div class=\"p-grid p-col-12\" [class.grid]=\"useGridTemplate\" style=\"margin: 0\">\n <ng-container *ngFor=\"let control of setting.schema\">\n <ng-container *ngTemplateOutlet=\"customControl; context: {\n control: control, data: _modelData, parentPath: '', path: control.field, showLabel: control.showLabel,\n mdWidth: control.mdWidth, rowSpan: control.rowSpan\n }\">\n </ng-container>\n </ng-container>\n </div>\n </form>\n</div>\n<p-contextMenu #contextMenu [appendTo]=\"'body'\" [model]=\"buttonContexts\">\n</p-contextMenu>\n<ng-template #customControl let-data=\"data\" let-control=\"control\" let-showLabel=\"showLabel\" let-mdWidth=\"mdWidth\"\n let-rowSpan=\"rowSpan\" let-rowIndex=\"index\" let-path=\"path\" let-parentPath=\"parentPath\" let-tablePath=\"tablePath\">\n <div *ngIf=\"!checkHidden(control, data, path)\" id=\"{{path}}-holder\"\n class=\"p-col-{{control.gWidth}} p-md-{{mdWidth}} row-span-{{rowSpan}} {{control.class}} crud-form-control type-{{control.dataType}}\"\n [class.error]=\"data._errors[control.field].length > 0\"\n [class.not-show-in-box-holder]=\"control.showInBox === false\"\n [class.show-in-box-holder]=\"control.showInBox === true\" [ngStyle]=\"control.style\">\n <div class=\"label\" *ngIf=\"showLabel\">\n <label *ngIf=\"control.label && !control.isHtmlLabel\" [pTooltip]=\"control.fullLabel\"\n tooltipPosition=\"top\">{{control.label}}\n <span *ngIf=\"control.required || control.showIconRequired\" class=\"star-required\">*</span>\n </label>\n <ng-container *ngIf=\"control.label && control.isHtmlLabel\">\n <label [innerHTML]=\"control.label | safeHtml\" [pTooltip]=\"control.fullLabel\" tooltipPosition=\"top\">\n </label>\n <span *ngIf=\"control.required || control.showIconRequired\" class=\"star-required\">*</span>\n </ng-container>\n <span *ngIf=\"control.description\" class=\"control-description\">({{control.description}})</span>\n </div>\n <ng-container [ngSwitch]=\"control.controlType\">\n <ng-container *ngSwitchCase=\"'label'\">\n <ng-container [ngTemplateOutlet]=\"labelControl\"\n [ngTemplateOutletContext]=\"{control: control, data: data}\">\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'title'\">\n <label *ngIf=\"!control.isHtml\" [for]=\"control.for\">{{control.text | translate}}</label>\n <label *ngIf=\"control.isHtml\" [innerHTML]=\"control.text | safeHtml\"></label>\n </ng-container>\n <ng-container *ngSwitchCase=\"'text'\">\n <div class=\"p-inputgroup\" *ngIf=\"control.suffFix\">\n <input [placeholder]=\"control.placeholder\" [tooltipDisabled]=\"control.dataFormat == 'password'\"\n [required]=\"control.validators && control.validators.required\" [pTooltip]=\"data[control.field]\"\n tooltipPosition=\"top\" tooltipStyleClass=\"wrap\"\n [attr.disabled]=\" checkDisabled(data, control) ? true : null\" pInputText\n [type]=\"control.dataFormat\" [max]=\"control.max\" [min]=\"control.min\"\n [maxlength]=\"control.maxLength\" [(ngModel)]=\"data[control.field]\"\n (change)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (key.enter)=\"handleFieldValueChange(control, $event, eventType.ENTER, data, parentPath)\" />\n <span class=\"p-inputgroup-addon\">({{control.suffFix}})</span>\n </div>\n <input *ngIf=\"!control.suffFix\" [placeholder]=\"control.placeholder\"\n [tooltipDisabled]=\"control.dataFormat == 'password'\" [pTooltip]=\"data[control.field]\"\n tooltipPosition=\"top\" tooltipStyleClass=\"wrap\"\n [attr.disabled]=\"checkDisabled(data, control) ? true : null\" pInputText [type]=\"control.dataFormat\"\n [max]=\"control.max\" [min]=\"control.min\" [maxlength]=\"control.maxLength\"\n [(ngModel)]=\"data[control.field]\"\n (change)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (key.enter)=\"handleFieldValueChange(control, $event, eventType.ENTER, data, parentPath)\" />\n </ng-container>\n <ng-container *ngSwitchCase=\"'htmlPreview'\">\n <html-preview [control]=\"control\" [(ngModel)]=\"data[control.field]\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </html-preview>\n </ng-container>\n <ng-container *ngSwitchCase=\"'reference-text'\">\n <reference-textbox [control]=\"control\" [value]=\"data[control.field]\" [dataSource]=\"control.dataSource\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"></reference-textbox>\n </ng-container>\n <ng-container *ngSwitchCase=\"'template'\">\n <ng-container [ngTemplateOutlet]=\"control.template\"\n [ngTemplateOutletContext]=\"{$implicit: _rootNode, control: control, data: data, tablePath: tablePath, parentPath: parentPath, rowIndex: rowIndex, funcUpdateModel: updateModelFromExternal}\">\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'content'\">\n <div class=\"control-content label\">\n <span [innerHTML]=\"data[control.field] ? (data[control.field] | safeHtml) : ''\">\n </span>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'mask'\">\n <tn-mask [prefix]=\"control.prefix\" [decimalPlaces]=\"control.decimalPlaces\" [suffix]=\"control.suffix\"\n [placeholder]=\"control.placeholder\" [disabled]=\"checkDisabled(data, control)\" tooltipPosition=\"top\"\n [tooltipDisabled]=\"control.dataFormat == 'password'\" [pTooltip]=\"data[control.field]\"\n [maskType]=\"control.maskType\" [autoFormat]=\"control.autoFormat\" [min]=\"control.min\"\n [max]=\"control.max\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </tn-mask>\n </ng-container>\n <ng-container *ngSwitchCase=\"'numberrange'\">\n <tn-number-picker-range [decimalPlaces]=\"control.decimalPlaces\"\n [disabled]=\"checkDisabled(data, control)\" [maskType]=\"control.maskType\" [min]=\"control.min\"\n [max]=\"control.max\" [placeholder]=\"control.placeholder\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (change)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (blur)=\"handleFieldValueChange(control, $event, eventType.BLUR, data, parentPath)\">\n </tn-number-picker-range>\n </ng-container>\n <ng-container *ngSwitchCase=\"'money'\">\n <input currencyMask [attr.disabled]=\"checkDisabled(data, control) ? true : null\" pInputText type=\"tel\"\n tooltipPosition=\"top\" [pTooltip]=\"data[control.field] | number: '1.0-0'\"\n [options]=\"{prefix: '', thousands: '.', decimal: ',',precision:control.dataFormat === 'money'?0:0 }\"\n [(ngModel)]=\"data[control.field]\"\n (ngModelChange)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\" />\n </ng-container>\n <ng-container *ngSwitchCase=\"'phoneOrfax'\">\n <input [placeholder]=\"control.dataFormat==='phone'?'(999) 999-9999':'999-999-9999'\"\n [attr.disabled]=\"checkDisabled(data, control) ? true : null\" type=\"tel\" pInputText\n [(ngModel)]=\"data[control.field]\"\n (change)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\" />\n </ng-container>\n <ng-container *ngSwitchCase=\"'textarea'\">\n <textarea pInputTextarea [rows]=\"control.rows ? control.rows : 5\"\n [attr.disabled]=\"checkDisabled(data, control) ? true : null\" [(ngModel)]=\"data[control.field]\"\n [placeholder]=\"control.placeholder\"\n (keyup)=\"handleKeyUp(control, $event, eventType.CHANGE, data, parentPath)\"\n (change)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"></textarea>\n </ng-container>\n <ng-container *ngSwitchCase=\"'editor'\">\n <tn-tinymce *ngIf=\"!checkDisabled(data, control)\"\n [required]=\"control.validators && control.validators.required\" [mode]=\"control.mode\"\n [height]=\"control.height ? control.height : 250\" [languageCode]=\"control.languageCode\"\n [control]=\"control\"\n [disabled]=\"control.disabled || (control.disableCheck && control.disableCheck(model))\"\n [(ngModel)]=\"data[control.field]\" (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onKeyUp)=\"handleKeyUp(control, $event, eventType.CHANGE, data, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </tn-tinymce>\n <div *ngIf=\"checkDisabled(data, control)\" class=\"html-box\"\n [innerHTML]=\"data[control.field] ? (data[control.field] | safeHtml) : ''\">\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'datetime'\">\n <datetime-picker [disabled]=\"checkDisabled(data, control)\" [control]=\"control\"\n [(ngModel)]=\"data[control.field]\" (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </datetime-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"'autocomplete'\">\n <app-autocomplete-datasource [control]=\"control\"\n [suggestions]=\"data._source[control.field] || control.dataSource\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onValueChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </app-autocomplete-datasource>\n </ng-container>\n <ng-container *ngSwitchCase=\"'datetimerange'\">\n <tn-datetime-picker-range [disabled]=\"control.disabled\" [control]=\"control\"\n [(ngModel)]=\"data[control.field]\" (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </tn-datetime-picker-range>\n </ng-container>\n <ng-container *ngSwitchCase=\"'dropdown'\">\n <dropdown [control]=\"control\" [dataSource]=\"getControlDataSource(control, data)\" [data]=\"data\"\n [(value)]=\"data[control.field]\" (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleChangeDropdown(control, $event, eventType.CHANGE, data, parentPath)\"\n (onHideSmartEvent)=\"handleChangeDropdown(control, $event, eventType.HIDE, data, parentPath)\"\n (adjustValue)=\"handleAdjustValueDropdownEvent(control, parentPath)\"\n (onDataSourceLoaded)=\"handleDataSourceLoaded(control, parentPath, $event)\"\n (onReady)=\"handleControlReadyEvent(control, parentPath)\">\n </dropdown>\n </ng-container>\n <ng-container *ngSwitchCase=\"'imageuploader'\">\n <app-image-uploader [loadByEntityKey]=\"control.loadByEntityKey\" [entityKey]=\"control.entityKey\"\n [defaultNoImageUrl]=\"'/assets/images/no-image.jpg'\" [multiple]=\"control.multiple\"\n [disabled]=\"control.disabled\" [isAvatar]=\"control.isAvatar\" [(ngModel)]=\"data[control.field]\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\">\n <ng-template *ngIf=\"control.templateItems\" #items let-files>\n <ng-container *ngTemplateOutlet=\"control.templateItems; context: {\n $implicit: files\n }\"></ng-container>\n </ng-template>\n <ng-template *ngIf=\"control.templateItem\" #item let-file>\n <ng-container *ngTemplateOutlet=\"control.templateItem; context: {\n $implicit: file\n }\"></ng-container>\n </ng-template>\n </app-image-uploader>\n </ng-container>\n <ng-container *ngSwitchCase=\"'fileManager'\">\n <file-manager *ngIf=\"control.entityKey || data[control.entityKeyField] || control.rootFolderId\"\n [control]=\"control\" [serviceCode]=\"control.serviceCode\" [entity]=\"control.entity\"\n [hiddenCreateFolder]=\"control.hiddenCreateFolder\"\n [entityKey]=\"control.entityKey ? control.entityKey : data[control.entityKeyField]\"\n [readonly]=\"control.disabled\" [layout]=\"control.layout\" [rootFolderId]=\"control.rootFolderId\"\n [maxFileSize]=\"control.maxFileSize\" [inTaiLieu]=\"control.inTaiLieu\"\n [inTaiLieuChung]=\"control.inTaiLieuChung\" [copyToFolderId]=\"control.copyToFolderId\"\n [filePickerSetting]=\"control.filePickerSetting\" [dataForm]=\"data\"\n [invalidFileSizeMessageSummary]=\"control.invalidFileSizeMessageSummary\"\n [invalidFileSizeMessageDetail]=\"control.invalidFileSizeMessageDetail\"\n [invalidFileTypeMessageSummary]=\"control.invalidFileTypeMessageSummary\"\n [invalidFileTypeMessageDetail]=\"control.invalidFileTypeMessageDetail\"\n [invalidFileLimitMessageSummary]=\"control.invalidFileLimitMessageSummary\"\n [invalidFileLimitMessageDetail]=\"control.invalidFileLimitMessageDetail\" [parentSetting]=\"setting\"\n [noFileMessage]=\"control.noFileMessage\" [(value)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onSelected)=\"control.onSelected($event)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onReady)=\"handleControlReadyEvent(control, parentPath)\">\n </file-manager>\n </ng-container>\n <span *ngSwitchCase=\"'fileUpload'\">\n <file-upload [sharedFolderType]=\"control.sharedFolderType\" [maxFileSize]=\"control.maxFileSize\"\n [invalidFileSizeMessageSummary]=\"control.invalidFileSizeMessageSummary\"\n [invalidFileSizeMessageDetail]=\"control.invalidFileSizeMessageDetail\"\n [invalidFileTypeMessageSummary]=\"control.invalidFileTypeMessageSummary\"\n [invalidFileTypeMessageDetail]=\"control.invalidFileTypeMessageDetail\"\n [invalidFileLimitMessageSummary]=\"control.invalidFileLimitMessageSummary\"\n [invalidFileLimitMessageDetail]=\"control.invalidFileLimitMessageDetail\" [control]=\"control\"\n [showDeleteFile]=\"control.showDeleteFile\" [readonly]=\"control.readonly\" [accept]=\"control.accept\"\n [parentSetting]=\"setting\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onRemove)=\"handleFieldValueChange(control, $event, eventType.DELETED, data, parentPath)\">\n </file-upload>\n </span>\n <span *ngSwitchCase=\"'serviceFileUpload'\">\n <service-file-upload *ngIf=\"control.entityKey || data[control.entityKeyField] || control.rootFolderId\"\n [parentContext]=\"context\" [serviceCode]=\"control.serviceCode\" [entity]=\"control.entity\"\n [entityKey]=\"control.entityKey ? control.entityKey : data[control.entityKeyField]\"\n [control]=\"control\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n [parentSetting]=\"setting\"\n (onRemove)=\"handleFieldValueChange(control, $event, eventType.DELETED, data, parentPath)\">\n </service-file-upload>\n </span>\n <ng-container *ngSwitchCase=\"'user-picker'\">\n <user-picker [control]=\"control\" [disabled]=\"checkDisabled(data, control)\"\n [readOnlyValues]=\"data[control.field + '_readOnly']\" [multiple]=\"control.multiple\"\n [(ngModel)]=\"data[control.field]\" (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onReady)=\"handleReadyControlPicker(control, parentPath)\">\n </user-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"'switch'\">\n <p-inputSwitch [disabled]=\"checkDisabled(data, control)\" [(ngModel)]=\"data[control.field]\"\n (onChange)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </p-inputSwitch>\n </ng-container>\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <div [class]=\"control.class\" role=\"checkbox-alone\">\n <p-checkbox [disabled]=\"checkDisabled(data, control)\" [binary]=\"true\"\n [label]=\"control.isCustomLabel ? control.displayLabel : (!control.hiddenLabel ? control.label : null)\"\n [(ngModel)]=\"data[control.field]\"\n (onChange)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </p-checkbox>\n <!-- <tn-checkbox [control]=\"control\" [disabled]=\"checkDisabled(data, control)\"\n [(ngModel)]=\"data[control.field]\"\n (onChange)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"></tn-checkbox> -->\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'button'\">\n <button type=\"button\" pButton [class]=\"control.btClass\" [icon]=\"control.icon\"\n [disabled]=\"control.disabled\" [label]=\"control.buttonText | translate\" [ngStyle]=\"control.btStyle\"\n [pTooltip]=\"control.fullLabel\" tooltipPosition=\"top\"\n (click)=\"handleButtonClick(control, $event, parentPath)\"></button>\n </ng-container>\n <ng-container *ngSwitchCase=\"'container'\">\n <div class=\"p-grid p-col-12\" style=\"margin: 0\" [class.not-show-in-box]=\"!control.showInBox\"\n [class.show-in-box]=\"control.showInBox\" [ngStyle]=\"control.boxStyle\">\n <ng-container *ngFor=\"let subControl of control.controls\">\n <ng-container *ngTemplateOutlet=\"customControl; context: {\n control: subControl,\n data: data[control.field],\n parentPath: path,\n rowIndex: rowIndex,\n path: path + '.' + subControl.field,\n showLabel: subControl.showLabel,\n mdWidth: subControl.mdWidth,\n rowSpan: subControl.rowSpan\n }\">\n </ng-container>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'checkboxlist'\">\n <check-box-list [control]=\"control\" [dataSource]=\"data._source[control.field] || control.dataSource\"\n [disabled]=\"checkDisabled(data, control)\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onSelect)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onReady)=\"handleControlReadyEvent(control, parentPath)\">\n </check-box-list>\n </ng-container>\n <ng-container *ngSwitchCase=\"'radiobuttonlist'\">\n <radio-button-list [control]=\"control\" [dataSource]=\"control.dataSource\"\n [disabled]=\"checkDisabled(data, control)\" [(value)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (adjustValue)=\"handleAdjustValueDropdownEvent(control, parentPath)\"\n (onReady)=\"handleReadyControlPicker(control, parentPath)\"\n (onDataSourceLoaded)=\"handleDataSourceLoaded(control, parentPath, $event)\">\n </radio-button-list>\n </ng-container>\n <ng-container *ngSwitchCase=\"'colorPicker'\">\n <tn-color-picker [disabled]=\"checkDisabled(data, control)\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (change)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </tn-color-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"'spanControl'\">\n <span *ngIf=\"!control.ishtml\">{{data[control.field]}}</span>\n <span *ngIf=\"control.ishtml\" [innerHTML]=\"data[control.field]\"></span>\n </ng-container>\n <ng-container *ngSwitchCase=\"'colorControl'\">\n <span class=\"show-color-control\" [ngStyle]=\"{ backgroundColor: data[control.sourceField]}\"></span>\n </ng-container>\n <ng-container *ngSwitchCase=\"'address-new'\">\n <address-picker-new [control]=\"control\" [showSubLabel]=\"control.showSubLabel\"\n [disabled]=\"checkDisabled(data, control)\" [(data)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onSelect)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onReady)=\"handleControlReadyEvent(control, parentPath)\">\n </address-picker-new>\n </ng-container>\n <ng-container *ngSwitchCase=\"'address'\">\n <address-picker [control]=\"control\" [showSubLabel]=\"control.showSubLabel\"\n [disabled]=\"checkDisabled(data, control)\" [(data)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onSelect)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onReady)=\"handleControlReadyEvent(control, parentPath)\">\n </address-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"'autocomplete-picker'\">\n <autocomplete-picker [control]=\"control\" [disabled]=\"checkDisabled(data, control)\"\n [required]=\"control.required\" [readOnlyValues]=\"data[control.field + '_readOnly']\"\n [(ngModel)]=\"data[control.field]\" (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onReady)=\"handleReadyControlPicker(control, parentPath)\">\n </autocomplete-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"'cocautochuc'\">\n <cocautochuc-picker [control]=\"control\" [parentOrgId]=\"control.parentOrgId\"\n [disabled]=\"checkDisabled(data, control)\" [parentOrgCode]=\"control.parentOrgCode\"\n [filter]=\"control.filter\" [multiple]=\"control.multiple\" [required]=\"control.required\"\n [isUsingId]=\"control.isUsingId\" [disabledParentItem]=\"control.disabledParentItem\"\n [rootParentId]=\"control.rootParentId\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </cocautochuc-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"'cocautochuc-picker'\">\n <cocautochuc-picker-list [control]=\"control\" [disabled]=\"checkDisabled(data, control)\"\n [required]=\"control.required\" [readOnlyValues]=\"data[control.field + '_readOnly']\"\n [(ngModel)]=\"data[control.field]\" (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onReady)=\"handleReadyControlPicker(control, parentPath)\">\n </cocautochuc-picker-list>\n </ng-container>\n <ng-container *ngSwitchCase=\"'cocautochuc-picker-new'\">\n <cocautochuc-picker-list-new [control]=\"control\" [disabled]=\"checkDisabled(data, control)\"\n [required]=\"control.required\" [readOnlyValues]=\"data[control.field + '_readOnly']\"\n [(ngModel)]=\"data[control.field]\" (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onReady)=\"handleReadyControlPicker(control, parentPath)\">\n </cocautochuc-picker-list-new>\n </ng-container>\n <ng-container *ngSwitchCase=\"'vanban'\">\n <vanban-picker [control]=\"control\" [disabled]=\"checkDisabled(data, control)\"\n [required]=\"control.required\" [readOnly]=\"control.readOnly\" [loaiVanBan]=\"control.loaiVanBan\"\n [(ngModel)]=\"data[control.field]\" (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </vanban-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"'congviec'\">\n <div>\n <congviec-picker [control]=\"control\" [disabled]=\"checkDisabled(data, control)\"\n [required]=\"control.required\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </congviec-picker>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'percent'\">\n <div>\n <tn-mask [suffix]=\"'%'\" [placeholder]=\"control.placeholder\" [maskType]=\"'int'\"\n [autoFormat]=\"control.autoFormat\" [min]=\"0\" [max]=\"100\"\n [disabled]=\"checkDisabled(data, control)\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </tn-mask>\n <p-slider [step]=\"1\" [min]=\"0\" [max]=\"100\" [disabled]=\"checkDisabled(data, control)\"\n [(ngModel)]=\"data[control.field]\"\n (onSlideEnd)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </p-slider>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'chips'\">\n <p-chips [disabled]=\"checkDisabled(data, control)\" [(ngModel)]=\"data[control.field]\"\n [placeholder]=\"control.placeholder\"\n (onAdd)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"\n (onRemove)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\"></p-chips>\n </ng-container>\n <ng-container *ngSwitchCase=\"'entity-picker'\">\n <entity-picker [control]=\"control\" [children]=\"children\" [disabled]=\"checkDisabled(data, control)\"\n [required]=\"control.required\" [readOnly]=\"control.readOnly\" [(ngModel)]=\"data[control.field]\"\n (onInit)=\"handleLoadedControl($event, control, parentPath)\"\n (onChanged)=\"handleFieldValueChange(control, $event, eventType.CHANGE, data, parentPath)\">\n </entity-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"'table'\">\n <div [class]=\"control.class\">\n <tn-custom-scrollbar class=\"--has-border\" [showScrollHorizontal]=\"true\">\n <p-table class=\"new-table scr-table table-control\" [value]=\"data[control.field]\"\n [columns]=\"control.headerTemplate\" [responsive]=\"true\" [scrollable]=\"false\"\n [rowTrackBy]=\"trackByFuncId\"\n (onRowReorder)=\"handleRowOrdered(control, $event, eventType.ROW_REORDER, data, parentPath)\">\n <ng-template pTemplate=\"colgroup\">\n <colgroup>\n <col *ngIf=\"control.showNumber\" style=\"width: 40px\" />\n <ng-container *ngFor=\"let subControl of control.rowTemplate\">\n <col *ngIf=\"subControl && !subControl.hidden && subControl.visibleInList\"\n [style.width]=\"subControl.width\" />\n </ng-container>\n <col *ngIf=\"control.enableReorderRow\" style=\"width: 30px\" />\n <col *ngIf=\"control.showFunction\" [style.width]=\"control.widthFunctionColumn\" />\n </colgroup>\n </ng-template>\n <ng-template *ngIf=\"getComponentByType(_prefixCustomHeader + control.field)\"\n pTemplate=\"header\" let-columns>\n <ng-container\n *ngTemplateOutlet=\"getComponentByType(_prefixCustomHeader + control.field), context: {$implicit: control.headerTemplate, crudForm: this, containerSticky: containerSticky}\">\n </ng-container>\n </ng-template>\n <ng-template *ngIf=\"!getComponentByType(_prefixCustomHeader + control.field)\"\n pTemplate=\"header\" let-rowData let-columns>\n <tr>\n <th *ngIf=\"control.showNumber\" class=\"th-sticky stt\">\n {{ 'TT' |translate}}\n <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n </th>\n <ng-container *ngFor=\"let subControl of control.rowTemplate\">\n <th *ngIf=\"subControl && !subControl.hidden && subControl.visibleInList\"\n [width]=\"subControl.width\"\n [pTooltip]=\"subControl.fullLabel || subControl.label\" tooltipPosition=\"top\"\n style=\"text-align: center;\">\n {{subControl.label}}\n <span *ngIf=\"subControl.required\" class=\"star-required\">*</span>\n <span *ngIf=\"subControl.description\"\n class=\"subControl-description\">({{subControl.description}})</span>\n <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"control.enableReorderRow\">\n <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n </th>\n <th *ngIf=\"control.showFunction\" class=\"table-function column-function\">\n <div class=\"cell-header-function\"><span>{{'Ch\u1EE9c n\u0103ng'|translate}}</span></div>\n <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData let-ri=\"rowIndex\">\n <tr [pReorderableRow]=\"ri\" [class]=\"rowData.class\"\n (click)=\"handleRowClick(rowData, control)\">\n <td *ngIf=\"control.showNumber\" class=\"stt th-sticky\"\n style=\"text-align: center; vertical-align: inherit\">\n <span>\n {{ri + 1}}\n </span>\n <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n </td>\n <ng-container *ngFor=\"let subControl of control.rowTemplate; let i = index\">\n <td *ngIf=\"subControl && !subControl.hidden && subControl.visibleInList\"\n [class.control-inside]=\"true\" [class]=\"subControl.class\"\n [ngStyle]=\"{'text-align': getTextAlign(subControl.textAlign), 'vertical-align': 'inherit'}\">\n <span class=\"p-column-title\">{{subControl.label}}</span>\n <ng-template [ngIf]=\"getControlType(subControl) != 'column'\">\n <ng-container *ngTemplateOutlet=\"customControl; context: {\n control: subControl,\n data: rowData,\n index: ri,\n tablePath: path,\n parentPath: path + '[' + ri + ']',\n path: path + '[' + ri + '].' + subControl.field,\n showLabel: false,\n mdWidth: 12,\n rowSpan: 1\n }\">\n </ng-container>\n </ng-template>\n <ng-template [ngIf]=\"getControlType(subControl) == 'column'\">\n <span>{{_modelData[control.field][ri][subControl.field]}}</span>\n </ng-template>\n <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n </td>\n </ng-container>\n <td *ngIf=\"control.enableReorderRow\" class=\"no-padding center v-center\">\n <i class=\"fas fa-arrows-alt\" style=\"cursor:pointer; padding: 8px; color: #555;\"\n pReorderableRowHandle></i>\n <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n </td>\n <td *ngIf=\"control.showFunction\" style=\"text-align: center\"\n class=\"column-function text-center\">\n <div *ngIf=\"!control.rowButtonTemplate\"\n class=\"p-toolbar-group-center button-group\">\n <button *ngIf=\"control.showSave\" [disabled]=\"rowData._disableSave\"\n type=\"button\" pButton class=\"p-button-text p-button-rounded\"\n icon=\"pi pi-save\" [pTooltip]=\"'L\u01B0u' | translate\" tooltipPosition=\"top\"\n (click)=\"saveRow(ri, control, path)\"></button>\n <button *ngIf=\"control.showEdit\" [disabled]=\"rowData._disableEdit\"\n type=\"button\" pButton class=\"p-button-text p-button-rounded\"\n icon=\"pi pi-pencil\" [pTooltip]=\"'S\u1EEDa' | translate\" tooltipPosition=\"top\"\n (click)=\"editRow(ri, control, path)\"></button>\n <button *ngIf=\"control.showDelete\" [disabled]=\"rowData._disableDelete\"\n type=\"button\" pButton\n class=\"p-button-text p-button-danger p-button-rounded\"\n icon=\"pi pi-trash\" [pTooltip]=\"'X\u00F3a' | translate\" tooltipPosition=\"top\"\n (click)=\"deleteRow(ri, control, path)\"></button>\n <button *ngIf=\"control.rowButtons\" type=\"button\" pButton\n icon=\"pi pi-ellipsis-v\"\n class=\"link-or-action p-button-text p-button-rounded\"\n pTooltip=\"Ch\u1EE9c n\u0103ng kh\u00E1c\" tooltipPosition=\"top\"\n (click)=\"showContextMenu($event, rowData, control)\"></button>\n </div>\n <div *ngIf=\"control.rowButtonTemplate\"\n class=\"p-toolbar-group-center button-group\">\n <ng-container\n *ngTemplateOutlet=\"control.rowButtonTemplate; context: {rowData: _modelData[control.field][ri], rowIndex: ri, path: path, control: control}\">\n </ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n </td>\n </tr>\n </ng-template>\n <ng-template *ngIf=\"control.summaryTemplate\" pTemplate=\"summary\" let-rowData>\n <ng-container *ngTemplateOutlet=\"control.summaryTemplate; context: {rowData: rowData}\">\n </ng-container>\n </ng-template>\n </p-table>\n </tn-custom-scrollbar>\n <div *ngIf=\"control.showFooter\" class=\"--table-schema-footer\">\n <button *ngIf=\"control.showAdd\" type=\"button\" pButton style=\"width:auto\" label=\"Th\u00EAm m\u1EDBi\"\n icon=\"pi pi-plus\" class=\"p-button-text\" (click)=\"addNewRow(control, path)\"></button>\n <span *ngIf=\"control.showDialog\" style=\"font-weight: normal;\">\n <p-checkbox label=\"M\u1EDF dialog\" [binary]=\"true\" [(ngModel)]=\"control.showEdit\">\n </p-checkbox>\n </span>\n <button *ngIf=\"control.enableAddMulti\" type=\"button\" pButton\n style=\"width:auto; margin-left:10px;\" label=\"Th\u00EAm nhi\u1EC1u\" icon=\"pi pi-clone\"\n class=\"p-button-text\" (click)=\"addMultiRow(control, 5, path)\"></button>\n <button *ngFor=\"let bt of control.footerButtons\" type=\"button\" pButton [class]=\"bt.class\"\n [icon]=\"bt.icon\" [label]=\"bt.label | translate\" style=\"width:auto; margin-left:10px;\"\n (click)=\"messageRow( -1, control, path)\"></button>\n </div>\n </div>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"control.template\">\n <ng-container [ngTemplateOutlet]=\"control.template\" [ngTemplateOutletContext]=\"{\n crudForm: this, data: data, index: rowIndex, parentPath: parentPath, control: control, changeFunc: handleFieldValueChange\n }\">\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"!control.template\" [ngTemplateOutlet]=\"getComponentByType(control.field)\"\n [ngTemplateOutletContext]=\"{\n crudForm: this, data: data, index: rowIndex, parentPath: parentPath, control: control, changeFunc: handleFieldValueChange\n }\">\n </ng-container>\n </ng-container>\n <ng-container *ngTemplateOutlet=\"validation; context: {control: control, data: data}\">\n </ng-container>\n <div *ngIf=\"control.message\" class=\"control-message\">\n <span [class]=\"control.messageClass\">{{control.message}}</span>\n </div>\n </ng-container>\n </div>\n</ng-template>\n<ng-template #validation let-control=\"control\" let-data=\"data\">\n <ng-container *ngIf=\"data._errors[control.field].length > 0\">\n <div class=\"error-container\">\n <ng-container *ngFor=\"let error of data._errors[control.field]\">\n <div class=\"error-item\" *ngIf=\"error\">\n <ng-container [ngTemplateOutlet]=\"errorMessage\" [ngTemplateOutletContext]=\"{content: error}\">\n </ng-container>\n </div>\n </ng-container>\n </div>\n </ng-container>\n</ng-template>\n<ng-template #errorMessage let-content=\"content\">\n <div class=\"error-content\">\n <i class=\"pi pi-ban\"></i>\n <span> {{content}}</span>\n </div>\n</ng-template>\n<ng-template #labelControl let-control=\"control\">\n <ng-container>\n <label [class]=\"getLabelClass(control)\" *ngIf=\"!control.isHtml\" [attr.label-index]=\"control.indexLabel\"\n [pTooltip]=\"control.title\" tooltipPosition=\"top\" tooltipStyleClass=\"wrap\" [escape]=\"false\"\n [for]=\"control.for\">{{control.text | translate}}</label>\n <label [class]=\"getLabelClass(control)\" *ngIf=\"control.isHtml\" [innerHTML]=\"control.text | safeHtml\"\n [attr.label-index]=\"control.indexLabel\"></label>\n </ng-container>\n</ng-template>\n<ng-template #containerSticky>\n <span class=\"fix-sticky top\"></span>\n <span class=\"fix-sticky right\"></span>\n <span class=\"fix-sticky left\"></span>\n</ng-template>\n<!-- <ng-template #templateCongViecForm let-control=\"control\">\n <base-congviec-form [control]=\"control\" [parentSetting]=\"congViecSetting\" [tenCongViec]=\"control.data.tenCongViec\">\n </base-congviec-form>\n</ng-template> -->\n<tn-dialog *ngIf=\"tableFormDialogModel.showEditForm\" #dialog [styleClass]=\"'address-form'\"\n [header]=\"tableFormDialogModel.header | translate\" [popupSize]=\"tableFormDialogModel.popupSize\"\n (onHide)=\"tableFormDialogModel.showEditForm = false\">\n <table-detail-form #formBase [parentSetting]=\"setting\" [schema]=\"tableFormSchema\" [data]=\"tableFormDialogModel.data\"\n (onSaved)=\"handleSavedTableRow($event)\" (onCancel)=\"tableFormDialogModel.showEditForm = false\">\n </table-detail-form>\n</tn-dialog>",
18027
18028
  providers: [ComponentContextService],
18028
18029
  styles: [".label-only{font-weight:700;margin-bottom:1em}div.label{position:relative}div.label .star-required{color:red;position:absolute;padding-left:.2em;padding-top:.1em}th>span.star-required{color:red;padding-left:.2em;padding-top:.3em}div.type-container.not-show-in-box-holder{padding:0}.--table-schema-footer{display:flex;align-items:center;font-weight:600;padding:.5em;background:#f8f9fa;color:#495057;border:1px solid #e9ecef}.show-in-box{border:1px solid #ced4da;border-radius:5px}.not-show-in-box{padding:0}.view-mode div.label{padding-bottom:3px}.view-mode div.label label{font-weight:700;font-size:.85em}.view-mode>span:not(:empty){display:inline-block;width:100%;padding:5px 0}.view-mode.type-table div.label+div{padding:5px 0}td>.view-mode{display:inline-block;padding:.25rem .5rem}td>.view-mode .view-mode{padding:0}.crud-form-control div[role=checkbox-alone]{margin-top:24px}.crud-form-control div[role=checkbox-alone].mg-top-0{margin-top:0}.crud-form-control .label+div[role=checkbox-alone]{margin-top:11px}.crud-form-control.type-table div[role=checkbox-alone]{margin-top:6px;text-align:center}.crud-form-control.type-table div[role=checkbox-alone].mg-top-0{margin-top:0}.crud-form-control.type-table div[role=checkbox-alone].align-left{text-align:left}.crud-form-control.type-title{font-size:1.2rem;font-weight:700;color:#025ba7;border-bottom:1px solid #cfcfcf;text-transform:uppercase;padding:5px;margin-bottom:5px}.crud-form-control.type-title>.label{margin-bottom:0}.control-description,.crud-form-control .subControl-description{font-size:.8rem;font-weight:700;color:#007eff;margin-bottom:5px}.control-description{padding-left:.75rem}.th-sticky{text-align:center!important;z-index:2!important;position:sticky!important;top:0;background:inherit}.th-sticky.stt{left:0}.cell-header-function{display:flex;align-items:center}.cell-header-function>span{text-align:center;flex:1 1}.cell-header-function button{width:24px;height:24px;padding:0;margin:0}.no-value{font-size:.8em}@keyframes fadeIn{0%{opacity:0;top:-25px}to{opacity:1;top:0}}@keyframes shrink{0%{height:0}to{height:20px}}@media screen and (min-width:40.063em){.label-right{padding-left:2em}}::ng-deep crud-form .crud-form-control .tn-check-box-list{margin-top:5px}::ng-deep crud-form .crud-form-control>div.label{margin-bottom:5px;font-size:.9rem;height:1.15em}::ng-deep crud-form .crud-form-control>div.label+*{width:100%}::ng-deep crud-form .crud-form-control>.error-container .error-item{overflow:visible;animation:shrink .1s;min-height:20px;padding-top:5px}::ng-deep crud-form .crud-form-control>.error-container .error-item .error-content{display:flex;position:relative;color:red;font-size:.9em;animation:fadeIn .1s}::ng-deep crud-form .crud-form-control>.error-container .error-item .error-content i{font-size:.9em;display:flex;padding-top:1px}::ng-deep crud-form .crud-form-control>.error-container .error-item .error-content span{display:flex;padding-left:5px}::ng-deep crud-form .crud-form-control .control-message{margin-top:5px;font-size:.9rem}::ng-deep crud-form .crud-form-control .control-message .green{color:#00af00}::ng-deep crud-form .crud-form-control .control-message .red{color:red}::ng-deep crud-form .crud-form-control .control-message .blue{color:#0095ff}::ng-deep crud-form .crud-form-control.no-label>div.label{display:none}::ng-deep crud-form .crud-form-control.error .p-dropdown,::ng-deep crud-form .crud-form-control.error .p-inputtext,::ng-deep crud-form .crud-form-control.error .p-multiselect,::ng-deep crud-form .crud-form-control.error .tn-dropdown,::ng-deep crud-form .crud-form-control.error input,::ng-deep crud-form .crud-form-control.error select,::ng-deep crud-form .crud-form-control.error textarea{border-color:#ff5722!important}::ng-deep crud-form .crud-form-control.error .p-autocomplete-multiple-container:not(.p-disabled).p-focus,::ng-deep crud-form .crud-form-control.error .p-inputtext:enabled:focus,::ng-deep crud-form .crud-form-control.error .tn-dropdown:not(.p-disabled).p-focus{box-shadow:0 0 0 .2rem #ffc4b3}::ng-deep crud-form .crud-form-control.error div.crud-form-control:not(.error) .p-dropdown,::ng-deep crud-form .crud-form-control.error div.crud-form-control:not(.error) .p-inputtext,::ng-deep crud-form .crud-form-control.error div.crud-form-control:not(.error) .p-multiselect,::ng-deep crud-form .crud-form-control.error div.crud-form-control:not(.error) .tn-dropdown,::ng-deep crud-form .crud-form-control.error div.crud-form-control:not(.error) input,::ng-deep crud-form .crud-form-control.error div.crud-form-control:not(.error) select,::ng-deep crud-form .crud-form-control.error div.crud-form-control:not(.error) textarea{border-color:#ced4da!important}::ng-deep crud-form .crud-form-control.error div.crud-form-control:not(.error) .p-autocomplete-multiple-container:not(.p-disabled).p-focus,::ng-deep crud-form .crud-form-control.error div.crud-form-control:not(.error) .p-dropdown.tn-dropdown.p-focus,::ng-deep crud-form .crud-form-control.error div.crud-form-control:not(.error) .p-inputtext:enabled:focus{box-shadow:0 0 0 .2rem #a6d5fa}::ng-deep crud-form .crud-form-container{padding:.5rem .5rem 0}::ng-deep crud-form .p-datatable .p-datatable-tbody tr td.control-inside,::ng-deep crud-form .p-datatable .p-datatable-tbody tr td.control-inside .show-in-box:not(.crud-form-control),::ng-deep crud-form base-congviec-form crud-form>.crud-form-container{padding:0}@media screen and (min-width:768px){::ng-deep crud-form .grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr))}::ng-deep crud-form .grid .p-md-1{width:unset;grid-column:span 1}::ng-deep crud-form .grid .p-md-2{width:unset;grid-column:span 2}::ng-deep crud-form .grid .p-md-3{width:unset;grid-column:span 3}::ng-deep crud-form .grid .p-md-4{width:unset;grid-column:span 4}::ng-deep crud-form .grid .p-md-5{width:unset;grid-column:span 5}::ng-deep crud-form .grid .p-md-6{width:unset;grid-column:span 6}::ng-deep crud-form .grid .p-md-7{width:unset;grid-column:span 7}::ng-deep crud-form .grid .p-md-8{width:unset;grid-column:span 8}::ng-deep crud-form .grid .p-md-9{width:unset;grid-column:span 9}::ng-deep crud-form .grid .p-md-10{width:unset;grid-column:span 10}::ng-deep crud-form .grid .p-md-11{width:unset;grid-column:span 11}::ng-deep crud-form .grid .p-md-12{width:unset;grid-column:span 12}::ng-deep crud-form .grid .row-span-1{grid-row:span 1}::ng-deep crud-form .grid .row-span-2{grid-row:span 2}::ng-deep crud-form .grid .row-span-3{grid-row:span 3}::ng-deep crud-form .grid .row-span-4{grid-row:span 4}::ng-deep crud-form .grid .row-span-5{grid-row:span 5}::ng-deep crud-form .grid .row-span-6{grid-row:span 6}::ng-deep crud-form .grid .row-span-7{grid-row:span 7}::ng-deep crud-form .grid .row-span-8{grid-row:span 8}::ng-deep crud-form .grid .row-span-9{grid-row:span 9}::ng-deep crud-form .grid .row-span-10{grid-row:span 10}::ng-deep crud-form .grid .row-span-11{grid-row:span 11}::ng-deep crud-form .grid .row-span-12{grid-row:span 12}::ng-deep crud-form .grid .row-span-13{grid-row:span 13}::ng-deep crud-form .grid .row-span-14{grid-row:span 14}::ng-deep crud-form .grid .row-span-15{grid-row:span 15}::ng-deep crud-form .grid .row-span-16{grid-row:span 16}::ng-deep crud-form .grid .row-span-17{grid-row:span 17}::ng-deep crud-form .grid .row-span-18{grid-row:span 18}::ng-deep crud-form .grid .row-span-19{grid-row:span 19}::ng-deep crud-form .grid .row-span-20{grid-row:span 20}::ng-deep crud-form .grid .row-span-21{grid-row:span 21}::ng-deep crud-form .grid .row-span-22{grid-row:span 22}::ng-deep crud-form .grid .row-span-23{grid-row:span 23}::ng-deep crud-form .grid .row-span-24{grid-row:span 24}::ng-deep crud-form .grid .row-span-25{grid-row:span 25}::ng-deep crud-form .grid .row-span-26{grid-row:span 26}::ng-deep crud-form .grid .row-span-27{grid-row:span 27}::ng-deep crud-form .grid .row-span-28{grid-row:span 28}::ng-deep crud-form .grid .row-span-29{grid-row:span 29}::ng-deep crud-form .grid .row-span-30{grid-row:span 30}::ng-deep crud-form .grid .row-span-31{grid-row:span 31}::ng-deep crud-form .grid .row-span-32{grid-row:span 32}::ng-deep crud-form .grid .row-span-33{grid-row:span 33}::ng-deep crud-form .grid .row-span-34{grid-row:span 34}::ng-deep crud-form .grid .row-span-35{grid-row:span 35}::ng-deep crud-form .grid .row-span-36{grid-row:span 36}::ng-deep crud-form .grid .row-span-37{grid-row:span 37}::ng-deep crud-form .grid .row-span-38{grid-row:span 38}::ng-deep crud-form .grid .row-span-39{grid-row:span 39}::ng-deep crud-form .grid .row-span-40{grid-row:span 40}::ng-deep crud-form .grid .row-span-41{grid-row:span 41}::ng-deep crud-form .grid .row-span-42{grid-row:span 42}::ng-deep crud-form .grid .row-span-43{grid-row:span 43}::ng-deep crud-form .grid .row-span-44{grid-row:span 44}::ng-deep crud-form .grid .row-span-45{grid-row:span 45}::ng-deep crud-form .grid .row-span-46{grid-row:span 46}::ng-deep crud-form .grid .row-span-47{grid-row:span 47}::ng-deep crud-form .grid .row-span-48{grid-row:span 48}::ng-deep crud-form .grid .row-span-49{grid-row:span 49}::ng-deep crud-form .grid .row-span-50{grid-row:span 50}}:host ::ng-deep .tox-tinymce{border:none;border-top:1px solid #ccc;overflow:unset}:host ::ng-deep .tox-tinymce .tox-editor-container{overflow:unset}:host ::ng-deep .tox-tinymce .tox-toolbar{border:1px solid #ccc;border-bottom:none}:host ::ng-deep .tox-tinymce .tox-edit-area{border:1px solid #ccc}:host ::ng-deep .tox-tinymce .tox-edit-area iframe{box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}:host ::ng-deep .tox-tinymce .tox-menubar{border:1px solid #ccc}:host ::ng-deep .tox .tox-edit-area.tinymce-focus{border:1px solid #66afe9;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 3px 0 #66afe9;transition:box-shadow .3s,border-color .3s;transition-property:box-shadow,border-color;transition-duration:.3s,.3s;transition-timing-function:ease,ease;transition-delay:0s,0s}:host ::ng-deep .rq .tox .tox-edit-area{border-left-color:#ff4c46}:host ::ng-deep .table-schema-paging{margin-bottom:40px;display:block}"]
18029
18030
  },] }
@@ -26175,7 +26176,8 @@
26175
26176
  if (itemWorkflowHistoryLast
26176
26177
  && itemWorkflowHistoryLast.actionCode != MaActionBatDauQuyTrinh
26177
26178
  && itemWorkflowHistoryLast.userIdCreated.toUpperCase() == userIdStringUpper
26178
- && this.setting.showButtonThuHoi) {
26179
+ && this.setting.showButtonThuHoi
26180
+ && !rowData.hiddenButtonThuHoi) {
26179
26181
  buttonContexts.push({
26180
26182
  icon: 'pi pi-replay',
26181
26183
  label: 'Thu hồi',
@@ -38026,13 +38028,15 @@
38026
38028
 
38027
38029
  var FileUploadComponent = /** @class */ (function (_super) {
38028
38030
  __extends(FileUploadComponent, _super);
38029
- function FileUploadComponent(_fileObjectService, _notifierService, _downloadLinkService, _moduleConfigService, _fileExplorerService, _injector) {
38031
+ function FileUploadComponent(_fileObjectService, _notifierService, _downloadLinkService, _moduleConfigService, _fileExplorerService, _deviceDetectorService, _userService, _injector) {
38030
38032
  var _this = _super.call(this, _injector) || this;
38031
38033
  _this._fileObjectService = _fileObjectService;
38032
38034
  _this._notifierService = _notifierService;
38033
38035
  _this._downloadLinkService = _downloadLinkService;
38034
38036
  _this._moduleConfigService = _moduleConfigService;
38035
38037
  _this._fileExplorerService = _fileExplorerService;
38038
+ _this._deviceDetectorService = _deviceDetectorService;
38039
+ _this._userService = _userService;
38036
38040
  _this.chooseLabel = 'Chọn';
38037
38041
  _this.readonly = true;
38038
38042
  _this.showDeleteFile = true;
@@ -38046,6 +38050,7 @@
38046
38050
  _this.invalidFileLimitMessageDetail = 'tối đa {0} file.';
38047
38051
  _this.sharedFolderType = exports.SharedFolderType.Tempt;
38048
38052
  _this.control = new FileUploadControlSchema();
38053
+ _this.parentSetting = new CrudFormSetting();
38049
38054
  _this.onInit = new i0.EventEmitter();
38050
38055
  _this.onSelect = new i0.EventEmitter();
38051
38056
  _this.onRemove = new i0.EventEmitter();
@@ -38066,7 +38071,27 @@
38066
38071
  show: false,
38067
38072
  }
38068
38073
  };
38074
+ _this.formIds = {
38075
+ createFolder: 'createFolder',
38076
+ renameFile: 'renameFile',
38077
+ shareFile: 'shareFile',
38078
+ shareFolder: 'shareFolder',
38079
+ fileViewer: 'fileViewer',
38080
+ fileVersionList: 'fileVersionList',
38081
+ signatureDetail: 'signatureDetail',
38082
+ kySoSim: 'kySoSim',
38083
+ viewDetail: 'viewDetail'
38084
+ };
38085
+ _this.signatureFormModel = {
38086
+ formData: new CrudFormData(),
38087
+ show: false,
38088
+ popupSize: new PopupSize({
38089
+ width: 600,
38090
+ height: 400
38091
+ })
38092
+ };
38069
38093
  _this.environment = _this._moduleConfigService.getConfig().environment;
38094
+ _this._moduleConfig = _moduleConfigService.getConfig();
38070
38095
  return _this;
38071
38096
  }
38072
38097
  FileUploadComponent.prototype.writeValue = function (obj) {
@@ -38086,22 +38111,34 @@
38086
38111
  if (this.control.isPublic != null && this.control.isPublic != undefined) {
38087
38112
  this.isPublic = this.control.isPublic;
38088
38113
  }
38114
+ this.forms[this.formIds.signatureDetail] = {
38115
+ header: 'Thông tin chữ ký số',
38116
+ show: false,
38117
+ };
38089
38118
  this.onInit.emit(this);
38090
38119
  };
38091
38120
  FileUploadComponent.prototype.getFile = function () {
38092
38121
  return __awaiter(this, void 0, void 0, function () {
38093
38122
  var fileObject;
38094
- return __generator(this, function (_a) {
38095
- switch (_a.label) {
38123
+ var _this = this;
38124
+ return __generator(this, function (_b) {
38125
+ switch (_b.label) {
38096
38126
  case 0:
38097
38127
  if (!this.fileId) return [3 /*break*/, 2];
38098
38128
  this.loading = true;
38099
38129
  this.notification = 'Đang đính kèm...';
38100
38130
  return [4 /*yield*/, this._fileObjectService.getDetail(this.fileId)];
38101
38131
  case 1:
38102
- fileObject = (_a.sent()).data;
38132
+ fileObject = (_b.sent()).data;
38103
38133
  if (fileObject) {
38104
38134
  this.selectedFileName = fileObject.name;
38135
+ this.selectedFile = fileObject;
38136
+ this._fileExplorerService.getSignatureInfoByFileId(this.fileId).then(function (rs) {
38137
+ var _a;
38138
+ if (rs.success && ((_a = rs.data) === null || _a === void 0 ? void 0 : _a.length)) {
38139
+ _this.selectedFile.signatures = rs.data;
38140
+ }
38141
+ });
38105
38142
  this.hasFile = true;
38106
38143
  this.loading = false;
38107
38144
  this.notification = null;
@@ -38110,7 +38147,7 @@
38110
38147
  else {
38111
38148
  this.hasFile = false;
38112
38149
  }
38113
- _a.label = 2;
38150
+ _b.label = 2;
38114
38151
  case 2:
38115
38152
  this.control.hasFile = this.hasFile;
38116
38153
  return [2 /*return*/];
@@ -38120,11 +38157,76 @@
38120
38157
  };
38121
38158
  FileUploadComponent.prototype.setMenu = function () {
38122
38159
  var _this = this;
38123
- this.menu = [{
38160
+ this.menu = [
38161
+ {
38124
38162
  label: 'Tải về', icon: 'fas fa-download', command: function () {
38125
38163
  _this.onDownloadFile();
38126
38164
  }
38127
- }];
38165
+ },
38166
+ {
38167
+ label: 'Ký số cá nhân (SIM)',
38168
+ icon: 'fas fa-sim-card',
38169
+ command: function () {
38170
+ _this.signKySimFile(_this.selectedFile);
38171
+ },
38172
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
38173
+ && !this.parentSetting.hiddenKySoSimCaNhan),
38174
+ },
38175
+ {
38176
+ label: 'Ký số SmartCA',
38177
+ icon: 'fas fa-signature',
38178
+ command: function () {
38179
+ _this.signatureFormModel.show = true;
38180
+ },
38181
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
38182
+ && !this.parentSetting.hiddenKySoSmartCA),
38183
+ },
38184
+ {
38185
+ label: 'Ký số cá nhân (USB)', icon: 'fas fa-signature',
38186
+ command: function () {
38187
+ _this.signFile(_this.selectedFile);
38188
+ },
38189
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
38190
+ && this._deviceDetectorService.isDesktop()
38191
+ && !this.parentSetting.hiddenKySoUsbCaNhan),
38192
+ },
38193
+ {
38194
+ label: 'Ký số VNPTCA', icon: 'fas fa-signature',
38195
+ command: function () {
38196
+ _this.signVNPTCA(_this.selectedFile);
38197
+ },
38198
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
38199
+ && this._deviceDetectorService.isDesktop()
38200
+ && !this.parentSetting.hiddenKySoVNPTCA),
38201
+ },
38202
+ {
38203
+ label: 'Bút phê', icon: 'fas fa-comment-dots',
38204
+ command: function () {
38205
+ _this.addComment(_this.selectedFile);
38206
+ },
38207
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
38208
+ && this._deviceDetectorService.isDesktop()
38209
+ && !this.parentSetting.hiddenButPhe),
38210
+ },
38211
+ {
38212
+ label: 'Bút phê và ký', icon: 'fas fa-comment-medical',
38213
+ command: function () {
38214
+ _this.addCommentAndSign(_this.selectedFile);
38215
+ },
38216
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
38217
+ && this._deviceDetectorService.isDesktop()
38218
+ && !this.parentSetting.hiddenButPhe),
38219
+ },
38220
+ {
38221
+ label: 'Ký số đơn vị (USB)', icon: 'fas fa-signature',
38222
+ command: function () {
38223
+ _this.signFileDonVi(_this.selectedFile);
38224
+ },
38225
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
38226
+ && this._deviceDetectorService.isDesktop()
38227
+ && !this.parentSetting.hiddenKySoDonVi),
38228
+ },
38229
+ ];
38128
38230
  };
38129
38231
  FileUploadComponent.prototype.showContextMenu = function (evt) {
38130
38232
  this.contextMenu.toggle(evt);
@@ -38135,6 +38237,11 @@
38135
38237
  this.file.basicFileInput.nativeElement.click();
38136
38238
  }
38137
38239
  };
38240
+ FileUploadComponent.prototype.viewListSign = function (e, signatures) {
38241
+ e.stopPropagation();
38242
+ this.forms[this.formIds.signatureDetail].show = true;
38243
+ this.model.advanceData = signatures;
38244
+ };
38138
38245
  FileUploadComponent.prototype.onSelectFile = function (evt) {
38139
38246
  var _this = this;
38140
38247
  if (evt.errorFiles && evt.errorFiles.length > 0) {
@@ -38164,6 +38271,12 @@
38164
38271
  _this.writeValue(rs.data);
38165
38272
  _this.onChangeBase(rs.data);
38166
38273
  _this.control.hasFile = _this.hasFile;
38274
+ _this._fileExplorerService.getSignatureInfoByFileId(rs.data).then(function (rs) {
38275
+ var _a;
38276
+ if (rs.success && ((_a = rs.data) === null || _a === void 0 ? void 0 : _a.length)) {
38277
+ _this.selectedFile.signatures = rs.data;
38278
+ }
38279
+ });
38167
38280
  _this.onSelect.emit();
38168
38281
  _this.onChanged.emit(rs.data);
38169
38282
  }
@@ -38213,18 +38326,18 @@
38213
38326
  FileUploadComponent.prototype.openFileViewer = function () {
38214
38327
  return __awaiter(this, void 0, void 0, function () {
38215
38328
  var fileBinary, fileObject, fileName;
38216
- return __generator(this, function (_a) {
38217
- switch (_a.label) {
38329
+ return __generator(this, function (_b) {
38330
+ switch (_b.label) {
38218
38331
  case 0: return [4 /*yield*/, this._fileExplorerService.checkPhysicalFile(this.fileId)];
38219
38332
  case 1:
38220
- fileBinary = _a.sent();
38333
+ fileBinary = _b.sent();
38221
38334
  if (!fileBinary.success) {
38222
38335
  this._notifierService.showWarning('File không tồn tại, vui lòng liên hệ quản trị viên');
38223
38336
  return [2 /*return*/];
38224
38337
  }
38225
38338
  return [4 /*yield*/, this._fileObjectService.getDetail(this.fileId)];
38226
38339
  case 2:
38227
- fileObject = _a.sent();
38340
+ fileObject = _b.sent();
38228
38341
  fileName = '';
38229
38342
  if (!fileObject.success) {
38230
38343
  this._notifierService.showWarning('Có lỗi trong lúc lấy dữ liệu file, vui lòng liên hệ quản trị viên');
@@ -38242,235 +38355,738 @@
38242
38355
  });
38243
38356
  });
38244
38357
  };
38245
- return FileUploadComponent;
38246
- }(ComponentBase));
38247
- FileUploadComponent.decorators = [
38248
- { type: i0.Component, args: [{
38249
- selector: 'file-upload',
38250
- template: "<div class=\"file-upload\">\n <div class=\"fl-icon\">\n <i *ngIf=\"loading\" class=\"pi pi-spin pi-spinner\" style=\"font-size: 2rem\"></i>\n <i *ngIf=\"!loading\" class=\"pi pi-file-o\" style=\"font-size: 2rem\"></i>\n </div>\n\n <div class=\"fl-file-name\" (click)=\"openFileViewer()\">\n <span *ngIf=\"!showNoti\">{{selectedFileName}}</span>\n <span *ngIf=\"showNoti\"> {{notification}} </span>\n </div>\n\n <div class=\"fl-buttons\">\n <button *ngIf=\"!hasFile && !readonly\" pTooltip=\"Ch\u1ECDn file\" class=\"fl-choose\"\n class=\"link-or-action p-button-text p-button-rounded fl-choose\" tooltipPosition=\"top\" pButton type=\"button\"\n icon=\"pi pi-plus\" (click)=\"onOpenSelect()\"></button>\n\n <button *ngIf=\"hasFile && !readonly && showDeleteFile\" (click)=\"onRemoveFile()\"\n class=\"link-or-action p-button-text p-button-rounded p-button-danger fl-remove\" pTooltip=\"X\u00F3a file\"\n tooltipPosition=\"top\" pButton type=\"button\" icon=\"pi pi-trash\"></button>\n\n <button [disabled]=\"!menu || !menu.length\" type=\"button\" pButton icon=\"pi pi-ellipsis-v\"\n class=\"link-or-action p-button-text p-button-rounded\" pTooltip=\"Th\u00EAm\" tooltipPosition=\"top\"\n (click)=\"showContextMenu($event)\"></button>\n </div>\n\n <div style=\"display: none;\">\n <p-fileUpload #file [accept]=\"accept\" [auto]=\"false\" class=\"file-upload\" mode=\"basic\"\n [chooseLabel]=\"chooseLabel\" name=\"file[]\" [accept]=\"accept\" pTooltip=\"Ch\u1ECDn t\u1EEB m\u00E1y t\u00EDnh\"\n toolStipPosition=\"top\" [invalidFileSizeMessageSummary]=\"invalidFileSizeMessageSummary\"\n [invalidFileSizeMessageDetail]=\"invalidFileSizeMessageDetail\"\n [invalidFileTypeMessageSummary]=\"invalidFileTypeMessageSummary\"\n [invalidFileTypeMessageDetail]=\"invalidFileTypeMessageDetail\"\n [invalidFileLimitMessageSummary]=\"invalidFileLimitMessageSummary\"\n [invalidFileLimitMessageDetail]=\"invalidFileLimitMessageDetail\" (onSelect)=\"onSelectFile($event)\"\n (onError)=\"handleError($event)\">\n </p-fileUpload>\n </div>\n\n</div>\n\n<p-contextMenu #contextMenu [appendTo]=\"'body'\" [model]=\"menu\" styleClass=\"fm-contextMenu-panel\">\n</p-contextMenu>\n\n<file-viewer #fileViewerNew *ngIf=\"forms.fileViewer.show\" [parentModel]=\"model\" [parentContext]=\"context\"\n [readonly]=\"readonly\" [model]=\"forms.fileViewer.formData\" (onClose)=\"forms.fileViewer.show = false;\">\n</file-viewer>",
38251
- providers: [
38252
- {
38253
- provide: forms.NG_VALUE_ACCESSOR,
38254
- useExisting: i0.forwardRef(function () { return FileUploadComponent; }),
38255
- multi: true
38256
- },
38257
- ComponentContextService
38258
- ],
38259
- styles: ["::ng-deep .file-upload{display:flex;border:1px solid #ced4da;border-radius:4px}::ng-deep .file-upload .fl-icon{flex:0 0 30px;display:flex;font-size:20px;justify-content:center;align-items:center;border-right:1px solid #ced4da}::ng-deep .file-upload .fl-icon>i{font-size:16px!important}::ng-deep .file-upload .fl-file-name{display:flex;align-items:center;flex-grow:1;cursor:pointer;opacity:.8;padding-left:12px;color:#109bf8;width:calc(100% - 110px)}::ng-deep .file-upload .fl-file-name>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}::ng-deep .file-upload .fl-file-name:hover{opacity:1}::ng-deep .file-upload .fl-buttons{flex:0 0 80px;display:flex;border-right:1px solid #ced4da;align-items:center;justify-content:space-evenly;border-left:1px solid #ced4da}"]
38260
- },] }
38261
- ];
38262
- FileUploadComponent.ctorParameters = function () { return [
38263
- { type: FileObjectService },
38264
- { type: NotifierService },
38265
- { type: DownloadLinkService },
38266
- { type: ModuleConfigService },
38267
- { type: FileExplorerService },
38268
- { type: i0.Injector }
38269
- ]; };
38270
- FileUploadComponent.propDecorators = {
38271
- file: [{ type: i0.ViewChild, args: ['file',] }],
38272
- contextMenu: [{ type: i0.ViewChild, args: ['contextMenu',] }],
38273
- chooseLabel: [{ type: i0.Input }],
38274
- readonly: [{ type: i0.Input }],
38275
- showDeleteFile: [{ type: i0.Input }],
38276
- accept: [{ type: i0.Input }],
38277
- maxFileSize: [{ type: i0.Input }],
38278
- invalidFileSizeMessageSummary: [{ type: i0.Input }],
38279
- invalidFileSizeMessageDetail: [{ type: i0.Input }],
38280
- invalidFileTypeMessageSummary: [{ type: i0.Input }],
38281
- invalidFileTypeMessageDetail: [{ type: i0.Input }],
38282
- invalidFileLimitMessageSummary: [{ type: i0.Input }],
38283
- invalidFileLimitMessageDetail: [{ type: i0.Input }],
38284
- sharedFolderType: [{ type: i0.Input }],
38285
- control: [{ type: i0.Input }],
38286
- isPublic: [{ type: i0.Input }],
38287
- onInit: [{ type: i0.Output }],
38288
- onSelect: [{ type: i0.Output }],
38289
- onRemove: [{ type: i0.Output }],
38290
- onChanged: [{ type: i0.Output }]
38291
- };
38292
-
38293
- var KeyValueComponent = /** @class */ (function () {
38294
- function KeyValueComponent() {
38295
- this.control = new KeyValueControlSchema();
38296
- this.disabled = false;
38297
- this.dataSourceInternal = [];
38298
- this.onRemoveItem = new i0.EventEmitter();
38299
- this.onClear = new i0.EventEmitter();
38300
- }
38301
- KeyValueComponent.prototype.ngOnInit = function () {
38302
- this.clearAllItems(false);
38303
- };
38304
- KeyValueComponent.prototype.writeValue = function (obj) {
38305
- if (obj && obj instanceof Array) {
38306
- if (obj.length > 0) {
38307
- this.dataSourceInternal = obj;
38308
- }
38309
- else {
38310
- this.clearAllItems(false);
38311
- }
38312
- }
38313
- else {
38314
- this.clearAllItems(false);
38315
- }
38316
- };
38317
- KeyValueComponent.prototype.registerOnChange = function (fn) {
38318
- this.onChange = fn;
38319
- };
38320
- KeyValueComponent.prototype.registerOnTouched = function (fn) {
38321
- this.onTouched = fn;
38322
- };
38323
- KeyValueComponent.prototype.setDisabledState = function (isDisabled) {
38324
- this.disabled = isDisabled;
38325
- };
38326
- KeyValueComponent.prototype.removeItem = function (index) {
38327
- this.dataSourceInternal.splice(index, 1);
38328
- this.updateNgModel();
38329
- };
38330
- KeyValueComponent.prototype.addDefaultItems = function (items) {
38331
- var e_1, _a;
38332
- if (items instanceof Array) {
38333
- try {
38334
- for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {
38335
- var item = items_1_1.value;
38336
- this.addOrUpdateItem(item);
38337
- }
38338
- }
38339
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
38340
- finally {
38341
- try {
38342
- if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);
38358
+ FileUploadComponent.prototype.signFileSmartCA = function (dataKySo) {
38359
+ var _a;
38360
+ return __awaiter(this, void 0, void 0, function () {
38361
+ var sourceFileId, rsConvert, e_1;
38362
+ return __generator(this, function (_b) {
38363
+ switch (_b.label) {
38364
+ case 0:
38365
+ this.signatureFormModel.show = false;
38366
+ sourceFileId = this.selectedFile.id;
38367
+ if (!this._fileExplorerService.needConvertBeforeSign(this.selectedFile.name)) return [3 /*break*/, 4];
38368
+ _b.label = 1;
38369
+ case 1:
38370
+ _b.trys.push([1, 3, , 4]);
38371
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
38372
+ instanceId: sourceFileId,
38373
+ name: this._fileExplorerService.changeFileExtension(this.selectedFile.name, 'pdf'),
38374
+ folderInstanceId: (_a = this.selectedFile.parentFolderId) !== null && _a !== void 0 ? _a : this._commonService.guid(),
38375
+ ownerType: this._userService.getCurrentUser().userId.toString(),
38376
+ })];
38377
+ case 2:
38378
+ rsConvert = _b.sent();
38379
+ if (!rsConvert || !rsConvert.success) {
38380
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + this.selectedFile.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
38381
+ return [2 /*return*/];
38382
+ }
38383
+ else {
38384
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + this.selectedFile.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
38385
+ sourceFileId = rsConvert.data;
38386
+ }
38387
+ return [3 /*break*/, 4];
38388
+ case 3:
38389
+ e_1 = _b.sent();
38390
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + this.selectedFile.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
38391
+ return [2 /*return*/];
38392
+ case 4:
38393
+ if (!dataKySo) {
38394
+ this._notifierService.showWarning('Người dùng chưa cấu hình thông tin ký số');
38395
+ }
38396
+ debugger;
38397
+ this.forms.fileViewer.formData.data = {
38398
+ fileId: sourceFileId,
38399
+ isFileVersion: false,
38400
+ fileName: this.selectedFile.name,
38401
+ // service: this.serviceCode,
38402
+ // entity: this.entity,
38403
+ // entityKey: this.entityKey,
38404
+ fileBase64Content: dataKySo.fileBase64Content,
38405
+ userChuKySoId: dataKySo.id,
38406
+ showKySoButton: true,
38407
+ width: dataKySo.width,
38408
+ height: dataKySo.height,
38409
+ };
38410
+ this.forms.fileViewer.show = true;
38411
+ return [2 /*return*/];
38343
38412
  }
38344
- finally { if (e_1) throw e_1.error; }
38345
- }
38346
- }
38347
- else if (items instanceof Object) {
38348
- this.addOrUpdateItem(items);
38349
- }
38350
- this.updateNgModel();
38351
- };
38352
- KeyValueComponent.prototype.addOrUpdateItem = function (itemToAdd) {
38353
- var item = this.dataSourceInternal.find(function (x) { return x.key === itemToAdd.key; });
38354
- if (!item) {
38355
- this.dataSourceInternal.push(itemToAdd);
38356
- }
38357
- else {
38358
- item.value = itemToAdd.value;
38359
- }
38360
- };
38361
- KeyValueComponent.prototype.addEmptyItems = function () {
38362
- this.dataSourceInternal.push({
38363
- key: '',
38364
- value: ''
38413
+ });
38365
38414
  });
38366
38415
  };
38367
- KeyValueComponent.prototype.clearAllItems = function (updateModel) {
38368
- if (updateModel === void 0) { updateModel = false; }
38369
- this.dataSourceInternal.length = 0;
38370
- this.addEmptyItems();
38371
- if (updateModel) {
38372
- this.updateNgModel();
38373
- }
38374
- };
38375
- KeyValueComponent.prototype.updateNgModel = function () {
38376
- if (this.dataSourceInternal.length > 0) {
38377
- this.onChange(this.dataSourceInternal.filter(function (x) { return x.key != null && x.key != '' && x.value != null && x.value != ''; }));
38378
- }
38379
- else {
38380
- this.onChange([]);
38381
- }
38382
- };
38383
- KeyValueComponent.prototype.blurItem = function (item) {
38384
- this.updateNgModel();
38416
+ FileUploadComponent.prototype.signKySimFile = function (file) {
38417
+ this.forms.kySoSim.show = true;
38418
+ this.model.advanceData = file;
38385
38419
  };
38386
- return KeyValueComponent;
38387
- }());
38388
- KeyValueComponent.decorators = [
38389
- { type: i0.Component, args: [{
38390
- selector: 'app-key-value',
38391
- template: "<!-- <div class=\"bottom-buffer\">\n <div class=\"ui-table-wrapper\">\n <table>\n <tr>\n <th class=\"table-col1\">Key</th>\n <th class=\"table-col2\">Value</th>\n <th></th>\n </tr>\n <ng-container *ngIf=\"dataSourceInternal\">\n <tr *ngFor=\"let item of dataSourceInternal;let i = index;\">\n <td>\n <input (blur)=\"blurItem(item)\" placeholder=\"Nh\u1EADp key...\" pInputText type=\"text\" [(ngModel)]=\"item.key\" />\n </td>\n <td>\n <input (blur)=\"blurItem(item)\" placeholder=\"Nh\u1EADp value...\" pInputText type=\"text\"\n [(ngModel)]=\"item.value\" />\n </td>\n <td>\n <a class=\"danger\" (click)=\"removeItem(i)\" pTooltip=\"X\u00F3a\"><i class=\"fas fa-remove\"></i></a>\n </td>\n </tr>\n </ng-container>\n </table>\n </div>\n <div class=\"button-container\">\n <button icon=\"fas fa-plus\" type=\"button\" label=\"Th\u00EAm\" pButton (click)=\"addEmptyItems()\"></button>\n </div>\n</div> -->",
38392
- providers: [
38393
- {
38394
- provide: forms.NG_VALUE_ACCESSOR,
38395
- useExisting: i0.forwardRef(function () { return KeyValueComponent; }),
38396
- multi: true
38397
- }
38398
- ],
38399
- styles: [".bottom-buffer{margin-bottom:50px}.button-container{width:200px}.danger{color:red;cursor:pointer}"]
38400
- },] }
38401
- ];
38402
- KeyValueComponent.ctorParameters = function () { return []; };
38403
- KeyValueComponent.propDecorators = {
38404
- control: [{ type: i0.Input }],
38405
- onRemoveItem: [{ type: i0.Output }],
38406
- onClear: [{ type: i0.Output }]
38407
- };
38408
-
38409
- var PermissionUtilsComponent = /** @class */ (function (_super) {
38410
- __extends(PermissionUtilsComponent, _super);
38411
- function PermissionUtilsComponent(_injector, _notifierService, _moduleConfigService) {
38412
- var _this = _super.call(this, _injector) || this;
38413
- _this._injector = _injector;
38414
- _this._notifierService = _notifierService;
38415
- _this._moduleConfigService = _moduleConfigService;
38416
- _this.dataSource = [];
38417
- _this.excludeBasePermission = [
38418
- '.WELL-KNOWN/OPENID-CONFIGURATION/GET',
38419
- 'VN.JSON/GET',
38420
- '/GET',
38421
- '.WELL-KNOWN/OPENID-CONFIGURATION/JWKS/GET'
38422
- ];
38423
- _this.basePermissionText = '';
38424
- _this.env = _this._moduleConfigService.getConfig().environment;
38425
- _this.title = 'Quyền';
38426
- _this.popupSize = new PopupSize({
38427
- width: 950,
38428
- height: 650
38429
- });
38430
- return _this;
38431
- }
38432
- PermissionUtilsComponent.prototype.ngOnInit = function () {
38420
+ FileUploadComponent.prototype.signFile = function (file) {
38433
38421
  var _this = this;
38434
- if (this.rootModel.httpRequestList) {
38435
- this.rootModel.httpRequestList.forEach(function (item) {
38436
- // remove querystring
38437
- var temp = item.url.split('?')[0];
38438
- temp = temp.split('#')[0];
38439
- var arr = temp.split('/');
38440
- var url = '';
38441
- for (var i = 3; i < arr.length; i++) {
38442
- if (arr[i] && arr[i].trim() != '') {
38443
- url += '/' + arr[i];
38444
- }
38445
- }
38446
- if (url != '') {
38447
- url = url.substring(1).toUpperCase();
38448
- }
38449
- if (_this.env.gatewaySubPath) {
38450
- url = url.replace(_this.env.gatewaySubPath.toUpperCase(), '');
38451
- if (url.startsWith('/'))
38452
- url = url.substring(1);
38453
- }
38454
- item.basePermission = url + '/' + item.method.toUpperCase();
38455
- // Cái này để debug dưới local
38456
- if (i0.isDevMode()) {
38457
- item.basePermission = "AUTHORIZATION/" + item.basePermission;
38422
+ this._notifierService.showConfirm('Bạn có chắc chắn muốn ký số văn bản này?').then(function (rs) { return __awaiter(_this, void 0, void 0, function () {
38423
+ var sourceFileId, sourceFile_1, rsConvert, e_2;
38424
+ var _this = this;
38425
+ return __generator(this, function (_b) {
38426
+ switch (_b.label) {
38427
+ case 0:
38428
+ if (!rs) return [3 /*break*/, 5];
38429
+ sourceFileId = file.id;
38430
+ sourceFile_1 = file;
38431
+ if (!this._fileExplorerService.needConvertBeforeSign(file.name)) return [3 /*break*/, 4];
38432
+ _b.label = 1;
38433
+ case 1:
38434
+ _b.trys.push([1, 3, , 4]);
38435
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
38436
+ instanceId: sourceFileId,
38437
+ name: this._fileExplorerService.changeFileExtension(file.name, 'pdf'),
38438
+ folderInstanceId: file.parentFolderId,
38439
+ ownerType: this._userService.getCurrentUser().userId.toString(),
38440
+ })];
38441
+ case 2:
38442
+ rsConvert = _b.sent();
38443
+ if (!rsConvert || !rsConvert.success) {
38444
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
38445
+ return [2 /*return*/];
38446
+ }
38447
+ else {
38448
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
38449
+ sourceFileId = rsConvert.data;
38450
+ sourceFile_1 = { id: sourceFileId };
38451
+ this.getFile();
38452
+ }
38453
+ return [3 /*break*/, 4];
38454
+ case 3:
38455
+ e_2 = _b.sent();
38456
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
38457
+ return [2 /*return*/];
38458
+ case 4:
38459
+ this._fileExplorerService.generateLinkDownload({
38460
+ fileId: sourceFileId,
38461
+ }).then(function (rs) {
38462
+ var url = _this._downloadLinkService.getDownloadForSignUrl(rs.data);
38463
+ var prms = {};
38464
+ prms['FileUploadHandler'] = _this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + _this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile";
38465
+ prms['SessionId'] = '';
38466
+ prms['FileName'] = url;
38467
+ // tslint:disable-next-line: variable-name
38468
+ var json_prms = JSON.stringify(prms);
38469
+ vgca_sign_approved(json_prms, function (result) {
38470
+ var resultObj = JSON.parse(result);
38471
+ if (resultObj.FileServer != '') {
38472
+ _this._fileExplorerService.saveSignedFile({
38473
+ sourceFile: sourceFile_1,
38474
+ tempFileId: resultObj.FileServer,
38475
+ }).then(function (rss) {
38476
+ _this.getFile();
38477
+ _this._notifierService.showSuccess('Ký số thành công');
38478
+ });
38479
+ }
38480
+ });
38481
+ });
38482
+ _b.label = 5;
38483
+ case 5: return [2 /*return*/];
38458
38484
  }
38459
- if (_this.dataSource.findIndex(function (x) { return x.basePermission == item.basePermission; }) == -1
38460
- && !_this.excludeBasePermission.find(function (x) { return item.basePermission == x; })) {
38461
- _this.dataSource.push(item);
38485
+ });
38486
+ }); });
38487
+ };
38488
+ FileUploadComponent.prototype.signVNPTCA = function (item) {
38489
+ var _a;
38490
+ return __awaiter(this, void 0, void 0, function () {
38491
+ var sourceFileId, rsConvert, e_3, dataInput, sigOptions, dataJS, data, e_4;
38492
+ return __generator(this, function (_b) {
38493
+ switch (_b.label) {
38494
+ case 0:
38495
+ sourceFileId = item.id;
38496
+ if (!this._fileExplorerService.needConvertBeforeSign(item.name)) return [3 /*break*/, 4];
38497
+ _b.label = 1;
38498
+ case 1:
38499
+ _b.trys.push([1, 3, , 4]);
38500
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
38501
+ instanceId: item.id,
38502
+ name: this._fileExplorerService.changeFileExtension(item.name, 'pdf'),
38503
+ folderInstanceId: (_a = item.parentFolderId) !== null && _a !== void 0 ? _a : this._commonService.guid(),
38504
+ ownerType: this._userService.getCurrentUser().userId.toString(),
38505
+ })];
38506
+ case 2:
38507
+ rsConvert = _b.sent();
38508
+ if (!rsConvert || !rsConvert.success) {
38509
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + item.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
38510
+ return [2 /*return*/];
38511
+ }
38512
+ else {
38513
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + item.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
38514
+ sourceFileId = rsConvert.data;
38515
+ this.model.selectedItem.id = rsConvert.data;
38516
+ this.getFile();
38517
+ }
38518
+ return [3 /*break*/, 4];
38519
+ case 3:
38520
+ e_3 = _b.sent();
38521
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + item.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
38522
+ return [2 /*return*/];
38523
+ case 4: return [4 /*yield*/, this._fileExplorerService.getBase64FromFileId(sourceFileId)];
38524
+ case 5:
38525
+ dataInput = (_b.sent()).split(',')[1];
38526
+ sigOptions = new PdfSigner();
38527
+ sigOptions.page = 1;
38528
+ sigOptions.AdvancedCustom = true;
38529
+ sigOptions.SigType = 1;
38530
+ dataJS = {
38531
+ data: dataInput,
38532
+ type: 'pdf',
38533
+ sigOptions: JSON.stringify(sigOptions)
38534
+ };
38535
+ _b.label = 6;
38536
+ case 6:
38537
+ _b.trys.push([6, 8, , 9]);
38538
+ return [4 /*yield*/, vnpt_plugin.signArrDataAdvanced([JSON.stringify(dataJS)], "", false)];
38539
+ case 7:
38540
+ data = _b.sent();
38541
+ this.handeResult(data);
38542
+ return [3 /*break*/, 9];
38543
+ case 8:
38544
+ e_4 = _b.sent();
38545
+ console.log(e_4);
38546
+ return [3 /*break*/, 9];
38547
+ case 9: return [2 /*return*/];
38462
38548
  }
38463
- _this.dataSource = _this._commonService.orderBy(_this.dataSource, 'basePermission');
38464
- _this.basePermissionText = _this.getBasePermissionText();
38465
38549
  });
38550
+ });
38551
+ };
38552
+ FileUploadComponent.prototype.handeResult = function (data) {
38553
+ var _this = this;
38554
+ if (typeof JSON.parse(data).code !== 'undefined') {
38555
+ var jsOb = JSON.parse(data);
38466
38556
  }
38467
38557
  else {
38468
- this.rootModel.httpRequestList = [];
38558
+ var jsOb = JSON.parse(JSON.parse(data)[0]);
38469
38559
  }
38470
- };
38471
- PermissionUtilsComponent.prototype.visibleChanged = function (evt) {
38472
- if (!evt) {
38473
- this.rootModel.showPermissionUtils = false;
38560
+ switch (jsOb.code) {
38561
+ case 0:
38562
+ this._fileExplorerService.kySimSaveSignedFile({
38563
+ sourceFile: this.model.selectedItem,
38564
+ fileContents: jsOb.data,
38565
+ }).then(function (rss) {
38566
+ _this._notifierService.showSuccess("Ký thành công");
38567
+ _this.getFile();
38568
+ });
38569
+ break;
38570
+ case 1:
38571
+ this._notifierService.showWarning("Dữ liệu đầu vào không đúng định dạng");
38572
+ break;
38573
+ case 2:
38574
+ this._notifierService.showWarning("Không lấy được thông tin chứng thư số");
38575
+ break;
38576
+ case 3:
38577
+ this._notifierService.showWarning("Có lỗi trong quá trình ký số");
38578
+ break;
38579
+ case 4:
38580
+ this._notifierService.showSuccess("Chứng thư số không có khóa bí mật");
38581
+ break;
38582
+ case 5:
38583
+ this._notifierService.showSuccess("Lỗi không xác định");
38584
+ break;
38585
+ case 6:
38586
+ this._notifierService.showSuccess("Ký pdf: không tìm thấy tham số số trang cần ký");
38587
+ break;
38588
+ case 7:
38589
+ this._notifierService.showSuccess("Ký pdf: trang đặt chữ ký không tồn tại");
38590
+ break;
38591
+ case 8:
38592
+ this._notifierService.showSuccess("Ký xml: không tìm thấy thẻ ký số");
38593
+ break;
38594
+ case 9:
38595
+ this._notifierService.showSuccess("Ký pdf: không tìm thấy id của thẻ ký số");
38596
+ break;
38597
+ case 10:
38598
+ this._notifierService.showSuccess("Dữ liệu ký đã chứa một hoặc nhiều chữ ký không hợp lệ");
38599
+ break;
38600
+ case 11:
38601
+ this._notifierService.showSuccess("Người dùng hủy bỏ");
38602
+ break;
38603
+ case 13:
38604
+ this._notifierService.showWarning("Dữ liệu ký rỗng");
38605
+ break;
38606
+ default:
38607
+ this._notifierService.showSuccess("Lỗi không xác định");
38608
+ break;
38609
+ }
38610
+ };
38611
+ FileUploadComponent.prototype.addComment = function (file) {
38612
+ var _this = this;
38613
+ this._notifierService.showConfirm('Bạn có chắc chắn muốn bút phê văn bản này?').then(function (rs) { return __awaiter(_this, void 0, void 0, function () {
38614
+ var sourceFileId, sourceFile_2, rsConvert, e_5;
38615
+ var _this = this;
38616
+ return __generator(this, function (_b) {
38617
+ switch (_b.label) {
38618
+ case 0:
38619
+ if (!rs) return [3 /*break*/, 5];
38620
+ sourceFileId = file.id;
38621
+ sourceFile_2 = file;
38622
+ if (!this._fileExplorerService.needConvertBeforeSign(file.name)) return [3 /*break*/, 4];
38623
+ _b.label = 1;
38624
+ case 1:
38625
+ _b.trys.push([1, 3, , 4]);
38626
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
38627
+ instanceId: sourceFileId,
38628
+ name: this._fileExplorerService.changeFileExtension(file.name, 'pdf'),
38629
+ folderInstanceId: file.parentFolderId,
38630
+ ownerType: this._userService.getCurrentUser().userId.toString(),
38631
+ })];
38632
+ case 2:
38633
+ rsConvert = _b.sent();
38634
+ if (!rsConvert || !rsConvert.success) {
38635
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
38636
+ return [2 /*return*/];
38637
+ }
38638
+ else {
38639
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
38640
+ sourceFileId = rsConvert.data;
38641
+ sourceFile_2 = { id: sourceFileId };
38642
+ this.getFile();
38643
+ }
38644
+ return [3 /*break*/, 4];
38645
+ case 3:
38646
+ e_5 = _b.sent();
38647
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
38648
+ return [2 /*return*/];
38649
+ case 4:
38650
+ this._fileExplorerService.generateLinkDownload({
38651
+ fileId: sourceFileId,
38652
+ }).then(function (rs) {
38653
+ var url = _this._downloadLinkService.getDownloadForSignUrl(rs.data);
38654
+ var prms = {};
38655
+ prms['FileUploadHandler'] = _this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + _this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile";
38656
+ prms['SessionId'] = '';
38657
+ prms['FileName'] = url;
38658
+ // tslint:disable-next-line: variable-name
38659
+ var json_prms = JSON.stringify(prms);
38660
+ vgca_comment(json_prms, function (result) {
38661
+ var resultObj = JSON.parse(result);
38662
+ if (resultObj.FileServer != '') {
38663
+ _this._fileExplorerService.saveSignedFile({
38664
+ sourceFile: sourceFile_2,
38665
+ tempFileId: resultObj.FileServer,
38666
+ }).then(function (rss) {
38667
+ _this.getFile();
38668
+ _this._notifierService.showSuccess('Tạo bút phê thành công');
38669
+ });
38670
+ }
38671
+ });
38672
+ });
38673
+ _b.label = 5;
38674
+ case 5: return [2 /*return*/];
38675
+ }
38676
+ });
38677
+ }); });
38678
+ };
38679
+ FileUploadComponent.prototype.addCommentAndSign = function (file) {
38680
+ return __awaiter(this, void 0, void 0, function () {
38681
+ var rs, sourceFileId, sourceFile, rsConvert, e_6, downloadLink, url, prms, json_prms_1, commentResult, resultObj, downloadLink2, url2, prms2, json_prms2_1, signResult, signResultObj;
38682
+ return __generator(this, function (_b) {
38683
+ switch (_b.label) {
38684
+ case 0: return [4 /*yield*/, this._notifierService.showConfirm('Bạn có chắc chắn muốn tạo bút phê và ký văn bản này?')];
38685
+ case 1:
38686
+ rs = _b.sent();
38687
+ if (!rs) return [3 /*break*/, 11];
38688
+ sourceFileId = file.id;
38689
+ sourceFile = file;
38690
+ if (!this._fileExplorerService.needConvertBeforeSign(file.name)) return [3 /*break*/, 5];
38691
+ _b.label = 2;
38692
+ case 2:
38693
+ _b.trys.push([2, 4, , 5]);
38694
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
38695
+ instanceId: sourceFileId,
38696
+ name: this._fileExplorerService.changeFileExtension(file.name, 'pdf'),
38697
+ folderInstanceId: file.parentFolderId,
38698
+ ownerType: this._userService.getCurrentUser().userId.toString(),
38699
+ })];
38700
+ case 3:
38701
+ rsConvert = _b.sent();
38702
+ if (!rsConvert || !rsConvert.success) {
38703
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
38704
+ return [2 /*return*/];
38705
+ }
38706
+ else {
38707
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
38708
+ sourceFileId = rsConvert.data;
38709
+ sourceFile = { id: sourceFileId };
38710
+ this.getFile();
38711
+ }
38712
+ return [3 /*break*/, 5];
38713
+ case 4:
38714
+ e_6 = _b.sent();
38715
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
38716
+ return [2 /*return*/];
38717
+ case 5: return [4 /*yield*/, this._fileExplorerService.generateLinkDownload({
38718
+ fileId: sourceFileId,
38719
+ })];
38720
+ case 6:
38721
+ downloadLink = _b.sent();
38722
+ url = this._downloadLinkService.getDownloadForSignUrl(downloadLink.data);
38723
+ prms = {
38724
+ FileUploadHandler: this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile",
38725
+ SessionId: '',
38726
+ FileName: url
38727
+ };
38728
+ json_prms_1 = JSON.stringify(prms);
38729
+ return [4 /*yield*/, new Promise(function (resolve) {
38730
+ vgca_comment(json_prms_1, function (result) { return resolve(result); });
38731
+ })];
38732
+ case 7:
38733
+ commentResult = _b.sent();
38734
+ resultObj = JSON.parse(commentResult);
38735
+ return [4 /*yield*/, this._fileExplorerService.generateLinkDownload({
38736
+ fileId: resultObj.FileServer,
38737
+ })];
38738
+ case 8:
38739
+ downloadLink2 = _b.sent();
38740
+ url2 = this._downloadLinkService.getDownloadForSignUrl(downloadLink2.data);
38741
+ prms2 = {
38742
+ FileUploadHandler: this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile",
38743
+ SessionId: '',
38744
+ FileName: url2
38745
+ };
38746
+ json_prms2_1 = JSON.stringify(prms2);
38747
+ return [4 /*yield*/, new Promise(function (resolve) {
38748
+ vgca_sign_approved(json_prms2_1, function (result) { return resolve(result); });
38749
+ })];
38750
+ case 9:
38751
+ signResult = _b.sent();
38752
+ signResultObj = JSON.parse(signResult);
38753
+ if (!(signResultObj.FileServer != '')) return [3 /*break*/, 11];
38754
+ return [4 /*yield*/, this._fileExplorerService.saveSignedFile({
38755
+ sourceFile: sourceFile,
38756
+ tempFileId: signResultObj.FileServer,
38757
+ })];
38758
+ case 10:
38759
+ _b.sent();
38760
+ this.getFile();
38761
+ this._notifierService.showSuccess('Tạo bút phê và ký thành công');
38762
+ _b.label = 11;
38763
+ case 11: return [2 /*return*/];
38764
+ }
38765
+ });
38766
+ });
38767
+ };
38768
+ FileUploadComponent.prototype.signFileDonVi = function (file) {
38769
+ var _this = this;
38770
+ this._notifierService
38771
+ .showConfirm('Bạn có chắc chắn muốn ký số đơn vị văn bản này?')
38772
+ .then(function (rs) { return __awaiter(_this, void 0, void 0, function () {
38773
+ var sourceFileId, sourceFile_3, rsConvert, e_7;
38774
+ var _this = this;
38775
+ return __generator(this, function (_b) {
38776
+ switch (_b.label) {
38777
+ case 0:
38778
+ if (!rs) return [3 /*break*/, 5];
38779
+ sourceFileId = file.id;
38780
+ sourceFile_3 = file;
38781
+ if (!this._fileExplorerService.needConvertBeforeSign(file.name)) return [3 /*break*/, 4];
38782
+ _b.label = 1;
38783
+ case 1:
38784
+ _b.trys.push([1, 3, , 4]);
38785
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
38786
+ instanceId: sourceFileId,
38787
+ name: this._fileExplorerService.changeFileExtension(file.name, 'pdf'),
38788
+ folderInstanceId: file.parentFolderId,
38789
+ ownerType: this._userService.getCurrentUser().userId.toString(),
38790
+ })];
38791
+ case 2:
38792
+ rsConvert = _b.sent();
38793
+ if (!rsConvert || !rsConvert.success) {
38794
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
38795
+ return [2 /*return*/];
38796
+ }
38797
+ else {
38798
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
38799
+ this.getFile();
38800
+ sourceFileId = rsConvert.data;
38801
+ sourceFile_3 = { id: sourceFileId };
38802
+ }
38803
+ return [3 /*break*/, 4];
38804
+ case 3:
38805
+ e_7 = _b.sent();
38806
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
38807
+ return [2 /*return*/];
38808
+ case 4:
38809
+ this._fileExplorerService
38810
+ .generateLinkDownload({
38811
+ isFileVersion: false,
38812
+ fileId: sourceFileId,
38813
+ })
38814
+ .then(function (rs) {
38815
+ var url = _this._downloadLinkService.getDownloadForSignUrl(rs.data);
38816
+ var prms = {};
38817
+ prms['FileUploadHandler'] = _this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + _this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile";
38818
+ prms['SessionId'] = '';
38819
+ prms['FileName'] = url;
38820
+ // Truyền số, ngày ký số phòng ban nếu cần
38821
+ var that = _this;
38822
+ if (that.control && that.control.dataKySoDonVi) {
38823
+ var dataKySoDonVi = that.control.dataKySoDonVi();
38824
+ if (dataKySoDonVi) {
38825
+ // lấy số DocNumber
38826
+ if (dataKySoDonVi.docNumber) {
38827
+ prms['DocNumber'] = dataKySoDonVi.docNumber;
38828
+ }
38829
+ // lấy ngày ban hành vb đi
38830
+ if (dataKySoDonVi.issuedDate) {
38831
+ prms['IssuedDate'] = dataKySoDonVi.issuedDate;
38832
+ }
38833
+ }
38834
+ }
38835
+ // tslint:disable-next-line: variable-name
38836
+ var json_prms = JSON.stringify(prms);
38837
+ vgca_sign_issued(json_prms, function (result) {
38838
+ var resultObj = JSON.parse(result);
38839
+ if (resultObj.FileServer != '') {
38840
+ _this._fileExplorerService
38841
+ .saveSignedFile({
38842
+ sourceFile: sourceFile_3,
38843
+ tempFileId: resultObj.FileServer,
38844
+ })
38845
+ .then(function (rss) {
38846
+ _this.getFile();
38847
+ _this._notifierService.showSuccess('Ký số thành công');
38848
+ });
38849
+ }
38850
+ });
38851
+ });
38852
+ _b.label = 5;
38853
+ case 5: return [2 /*return*/];
38854
+ }
38855
+ });
38856
+ }); });
38857
+ };
38858
+ return FileUploadComponent;
38859
+ }(ComponentBase));
38860
+ FileUploadComponent.decorators = [
38861
+ { type: i0.Component, args: [{
38862
+ selector: 'file-upload',
38863
+ template: "<div class=\"file-upload\">\n <div class=\"fl-icon\">\n <i *ngIf=\"loading\" class=\"pi pi-spin pi-spinner\" style=\"font-size: 2rem\"></i>\n <i *ngIf=\"!loading\" class=\"pi pi-file-o\" style=\"font-size: 2rem\"></i>\n </div>\n\n <div class=\"fl-file-name\" (click)=\"openFileViewer()\">\n <span *ngIf=\"!showNoti\">{{selectedFileName}}</span>\n <span *ngIf=\"showNoti\"> {{notification}} </span>\n <span *ngIf=\"selectedFile?.signatures\" class=\"pull-right signature\" pTooltip=\"Xem chi ti\u1EBFt k\u00FD s\u1ED1\"\n tooltipPosition=\"top\" (click)=\"viewListSign($event, selectedFile.signatures)\">\n <i class=\"fas fa-signature\"></i>\n </span>\n </div>\n <div class=\"fl-buttons\">\n <button *ngIf=\"!hasFile && !readonly\" pTooltip=\"Ch\u1ECDn file\" class=\"fl-choose\"\n class=\"link-or-action p-button-text p-button-rounded fl-choose\" tooltipPosition=\"top\" pButton type=\"button\"\n icon=\"pi pi-plus\" (click)=\"onOpenSelect()\"></button>\n\n <button *ngIf=\"hasFile && !readonly && showDeleteFile\" (click)=\"onRemoveFile()\"\n class=\"link-or-action p-button-text p-button-rounded p-button-danger fl-remove\" pTooltip=\"X\u00F3a file\"\n tooltipPosition=\"top\" pButton type=\"button\" icon=\"pi pi-trash\"></button>\n\n <button [disabled]=\"!menu || !menu.length\" type=\"button\" pButton icon=\"pi pi-ellipsis-v\"\n class=\"link-or-action p-button-text p-button-rounded\" pTooltip=\"Th\u00EAm\" tooltipPosition=\"top\"\n (click)=\"showContextMenu($event)\"></button>\n </div>\n\n <div style=\"display: none;\">\n <p-fileUpload #file [accept]=\"accept\" [auto]=\"false\" class=\"file-upload\" mode=\"basic\"\n [chooseLabel]=\"chooseLabel\" name=\"file[]\" [accept]=\"accept\" pTooltip=\"Ch\u1ECDn t\u1EEB m\u00E1y t\u00EDnh\"\n toolStipPosition=\"top\" [invalidFileSizeMessageSummary]=\"invalidFileSizeMessageSummary\"\n [invalidFileSizeMessageDetail]=\"invalidFileSizeMessageDetail\"\n [invalidFileTypeMessageSummary]=\"invalidFileTypeMessageSummary\"\n [invalidFileTypeMessageDetail]=\"invalidFileTypeMessageDetail\"\n [invalidFileLimitMessageSummary]=\"invalidFileLimitMessageSummary\"\n [invalidFileLimitMessageDetail]=\"invalidFileLimitMessageDetail\" (onSelect)=\"onSelectFile($event)\"\n (onError)=\"handleError($event)\">\n </p-fileUpload>\n </div>\n\n</div>\n\n<p-contextMenu #contextMenu [appendTo]=\"'body'\" [model]=\"menu\" styleClass=\"fm-contextMenu-panel\">\n</p-contextMenu>\n\n<file-viewer #fileViewerNew *ngIf=\"forms.fileViewer.show\" [parentModel]=\"model\" [parentContext]=\"context\"\n [readonly]=\"readonly\" [model]=\"forms.fileViewer.formData\" (onClose)=\"forms.fileViewer.show = false;\">\n</file-viewer>\n<!-- Xem ch\u1EEF k\u00FD s\u1ED1 -->\n<tn-dialog *ngIf=\"forms.signatureDetail.show\" #dialog [styleClass]=\"'address-form'\"\n [header]=\"forms.signatureDetail.header | translate\" [popupSize]=\"forms[formIds.signatureDetail].popupSize\"\n (onHide)=\"forms.signatureDetail.show=false;\">\n <signature-detail [parentModel]=\"model\" [parentContext]=\"context\">\n </signature-detail>\n</tn-dialog>\n<tn-dialog *ngIf=\"signatureFormModel.show\" #dialog [styleClass]=\"'address-form'\" [header]=\"'Ch\u1ECDn ch\u1EEF k\u00FD s\u1ED1' | translate\"\n [popupSize]=\"signatureFormModel.popupSize\" (onHide)=\"signatureFormModel.show=false\">\n <signature-select #formBase [parentModel]=\"model\" [parentContext]=\"context\" [model]=\"signatureFormModel.formData\"\n (onCancel)=\"signatureFormModel.show = false\" (onSaved)=\"signFileSmartCA($event)\">\n </signature-select>\n</tn-dialog>",
38864
+ providers: [
38865
+ {
38866
+ provide: forms.NG_VALUE_ACCESSOR,
38867
+ useExisting: i0.forwardRef(function () { return FileUploadComponent; }),
38868
+ multi: true
38869
+ },
38870
+ ComponentContextService
38871
+ ],
38872
+ styles: ["::ng-deep .file-upload{display:flex;border:1px solid #ced4da;border-radius:4px}::ng-deep .file-upload .fl-icon{flex:0 0 30px;display:flex;font-size:20px;justify-content:center;align-items:center;border-right:1px solid #ced4da}::ng-deep .file-upload .fl-icon>i{font-size:16px!important}::ng-deep .file-upload .fl-file-name{display:flex;align-items:center;flex-grow:1;cursor:pointer;opacity:.8;padding-left:12px;color:#109bf8;width:calc(100% - 110px);position:relative}::ng-deep .file-upload .fl-file-name>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}::ng-deep .file-upload .fl-file-name:hover{opacity:1}::ng-deep .file-upload .fl-buttons{flex:0 0 80px;display:flex;border-right:1px solid #ced4da;align-items:center;justify-content:space-evenly;border-left:1px solid #ced4da}::ng-deep .file-upload .nfl-signature{display:flex;align-items:center;justify-content:center;cursor:pointer;opacity:.8;padding:0 10px;color:#109bf8;overflow:hidden}::ng-deep .file-upload .nfl-signature:hover{opacity:1}::ng-deep .file-upload .signature i{position:absolute;top:50%!important;transform:translate(-50%,-50%)!important;right:0}"]
38873
+ },] }
38874
+ ];
38875
+ FileUploadComponent.ctorParameters = function () { return [
38876
+ { type: FileObjectService },
38877
+ { type: NotifierService },
38878
+ { type: DownloadLinkService },
38879
+ { type: ModuleConfigService },
38880
+ { type: FileExplorerService },
38881
+ { type: ngxDeviceDetector.DeviceDetectorService },
38882
+ { type: UserService },
38883
+ { type: i0.Injector }
38884
+ ]; };
38885
+ FileUploadComponent.propDecorators = {
38886
+ file: [{ type: i0.ViewChild, args: ['file',] }],
38887
+ contextMenu: [{ type: i0.ViewChild, args: ['contextMenu',] }],
38888
+ chooseLabel: [{ type: i0.Input }],
38889
+ readonly: [{ type: i0.Input }],
38890
+ showDeleteFile: [{ type: i0.Input }],
38891
+ accept: [{ type: i0.Input }],
38892
+ maxFileSize: [{ type: i0.Input }],
38893
+ invalidFileSizeMessageSummary: [{ type: i0.Input }],
38894
+ invalidFileSizeMessageDetail: [{ type: i0.Input }],
38895
+ invalidFileTypeMessageSummary: [{ type: i0.Input }],
38896
+ invalidFileTypeMessageDetail: [{ type: i0.Input }],
38897
+ invalidFileLimitMessageSummary: [{ type: i0.Input }],
38898
+ invalidFileLimitMessageDetail: [{ type: i0.Input }],
38899
+ sharedFolderType: [{ type: i0.Input }],
38900
+ control: [{ type: i0.Input }],
38901
+ isPublic: [{ type: i0.Input }],
38902
+ parentSetting: [{ type: i0.Input }],
38903
+ onInit: [{ type: i0.Output }],
38904
+ onSelect: [{ type: i0.Output }],
38905
+ onRemove: [{ type: i0.Output }],
38906
+ onChanged: [{ type: i0.Output }]
38907
+ };
38908
+
38909
+ var KeyValueComponent = /** @class */ (function () {
38910
+ function KeyValueComponent() {
38911
+ this.control = new KeyValueControlSchema();
38912
+ this.disabled = false;
38913
+ this.dataSourceInternal = [];
38914
+ this.onRemoveItem = new i0.EventEmitter();
38915
+ this.onClear = new i0.EventEmitter();
38916
+ }
38917
+ KeyValueComponent.prototype.ngOnInit = function () {
38918
+ this.clearAllItems(false);
38919
+ };
38920
+ KeyValueComponent.prototype.writeValue = function (obj) {
38921
+ if (obj && obj instanceof Array) {
38922
+ if (obj.length > 0) {
38923
+ this.dataSourceInternal = obj;
38924
+ }
38925
+ else {
38926
+ this.clearAllItems(false);
38927
+ }
38928
+ }
38929
+ else {
38930
+ this.clearAllItems(false);
38931
+ }
38932
+ };
38933
+ KeyValueComponent.prototype.registerOnChange = function (fn) {
38934
+ this.onChange = fn;
38935
+ };
38936
+ KeyValueComponent.prototype.registerOnTouched = function (fn) {
38937
+ this.onTouched = fn;
38938
+ };
38939
+ KeyValueComponent.prototype.setDisabledState = function (isDisabled) {
38940
+ this.disabled = isDisabled;
38941
+ };
38942
+ KeyValueComponent.prototype.removeItem = function (index) {
38943
+ this.dataSourceInternal.splice(index, 1);
38944
+ this.updateNgModel();
38945
+ };
38946
+ KeyValueComponent.prototype.addDefaultItems = function (items) {
38947
+ var e_1, _a;
38948
+ if (items instanceof Array) {
38949
+ try {
38950
+ for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {
38951
+ var item = items_1_1.value;
38952
+ this.addOrUpdateItem(item);
38953
+ }
38954
+ }
38955
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
38956
+ finally {
38957
+ try {
38958
+ if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);
38959
+ }
38960
+ finally { if (e_1) throw e_1.error; }
38961
+ }
38962
+ }
38963
+ else if (items instanceof Object) {
38964
+ this.addOrUpdateItem(items);
38965
+ }
38966
+ this.updateNgModel();
38967
+ };
38968
+ KeyValueComponent.prototype.addOrUpdateItem = function (itemToAdd) {
38969
+ var item = this.dataSourceInternal.find(function (x) { return x.key === itemToAdd.key; });
38970
+ if (!item) {
38971
+ this.dataSourceInternal.push(itemToAdd);
38972
+ }
38973
+ else {
38974
+ item.value = itemToAdd.value;
38975
+ }
38976
+ };
38977
+ KeyValueComponent.prototype.addEmptyItems = function () {
38978
+ this.dataSourceInternal.push({
38979
+ key: '',
38980
+ value: ''
38981
+ });
38982
+ };
38983
+ KeyValueComponent.prototype.clearAllItems = function (updateModel) {
38984
+ if (updateModel === void 0) { updateModel = false; }
38985
+ this.dataSourceInternal.length = 0;
38986
+ this.addEmptyItems();
38987
+ if (updateModel) {
38988
+ this.updateNgModel();
38989
+ }
38990
+ };
38991
+ KeyValueComponent.prototype.updateNgModel = function () {
38992
+ if (this.dataSourceInternal.length > 0) {
38993
+ this.onChange(this.dataSourceInternal.filter(function (x) { return x.key != null && x.key != '' && x.value != null && x.value != ''; }));
38994
+ }
38995
+ else {
38996
+ this.onChange([]);
38997
+ }
38998
+ };
38999
+ KeyValueComponent.prototype.blurItem = function (item) {
39000
+ this.updateNgModel();
39001
+ };
39002
+ return KeyValueComponent;
39003
+ }());
39004
+ KeyValueComponent.decorators = [
39005
+ { type: i0.Component, args: [{
39006
+ selector: 'app-key-value',
39007
+ template: "<!-- <div class=\"bottom-buffer\">\n <div class=\"ui-table-wrapper\">\n <table>\n <tr>\n <th class=\"table-col1\">Key</th>\n <th class=\"table-col2\">Value</th>\n <th></th>\n </tr>\n <ng-container *ngIf=\"dataSourceInternal\">\n <tr *ngFor=\"let item of dataSourceInternal;let i = index;\">\n <td>\n <input (blur)=\"blurItem(item)\" placeholder=\"Nh\u1EADp key...\" pInputText type=\"text\" [(ngModel)]=\"item.key\" />\n </td>\n <td>\n <input (blur)=\"blurItem(item)\" placeholder=\"Nh\u1EADp value...\" pInputText type=\"text\"\n [(ngModel)]=\"item.value\" />\n </td>\n <td>\n <a class=\"danger\" (click)=\"removeItem(i)\" pTooltip=\"X\u00F3a\"><i class=\"fas fa-remove\"></i></a>\n </td>\n </tr>\n </ng-container>\n </table>\n </div>\n <div class=\"button-container\">\n <button icon=\"fas fa-plus\" type=\"button\" label=\"Th\u00EAm\" pButton (click)=\"addEmptyItems()\"></button>\n </div>\n</div> -->",
39008
+ providers: [
39009
+ {
39010
+ provide: forms.NG_VALUE_ACCESSOR,
39011
+ useExisting: i0.forwardRef(function () { return KeyValueComponent; }),
39012
+ multi: true
39013
+ }
39014
+ ],
39015
+ styles: [".bottom-buffer{margin-bottom:50px}.button-container{width:200px}.danger{color:red;cursor:pointer}"]
39016
+ },] }
39017
+ ];
39018
+ KeyValueComponent.ctorParameters = function () { return []; };
39019
+ KeyValueComponent.propDecorators = {
39020
+ control: [{ type: i0.Input }],
39021
+ onRemoveItem: [{ type: i0.Output }],
39022
+ onClear: [{ type: i0.Output }]
39023
+ };
39024
+
39025
+ var PermissionUtilsComponent = /** @class */ (function (_super) {
39026
+ __extends(PermissionUtilsComponent, _super);
39027
+ function PermissionUtilsComponent(_injector, _notifierService, _moduleConfigService) {
39028
+ var _this = _super.call(this, _injector) || this;
39029
+ _this._injector = _injector;
39030
+ _this._notifierService = _notifierService;
39031
+ _this._moduleConfigService = _moduleConfigService;
39032
+ _this.dataSource = [];
39033
+ _this.excludeBasePermission = [
39034
+ '.WELL-KNOWN/OPENID-CONFIGURATION/GET',
39035
+ 'VN.JSON/GET',
39036
+ '/GET',
39037
+ '.WELL-KNOWN/OPENID-CONFIGURATION/JWKS/GET'
39038
+ ];
39039
+ _this.basePermissionText = '';
39040
+ _this.env = _this._moduleConfigService.getConfig().environment;
39041
+ _this.title = 'Quyền';
39042
+ _this.popupSize = new PopupSize({
39043
+ width: 950,
39044
+ height: 650
39045
+ });
39046
+ return _this;
39047
+ }
39048
+ PermissionUtilsComponent.prototype.ngOnInit = function () {
39049
+ var _this = this;
39050
+ if (this.rootModel.httpRequestList) {
39051
+ this.rootModel.httpRequestList.forEach(function (item) {
39052
+ // remove querystring
39053
+ var temp = item.url.split('?')[0];
39054
+ temp = temp.split('#')[0];
39055
+ var arr = temp.split('/');
39056
+ var url = '';
39057
+ for (var i = 3; i < arr.length; i++) {
39058
+ if (arr[i] && arr[i].trim() != '') {
39059
+ url += '/' + arr[i];
39060
+ }
39061
+ }
39062
+ if (url != '') {
39063
+ url = url.substring(1).toUpperCase();
39064
+ }
39065
+ if (_this.env.gatewaySubPath) {
39066
+ url = url.replace(_this.env.gatewaySubPath.toUpperCase(), '');
39067
+ if (url.startsWith('/'))
39068
+ url = url.substring(1);
39069
+ }
39070
+ item.basePermission = url + '/' + item.method.toUpperCase();
39071
+ // Cái này để debug dưới local
39072
+ if (i0.isDevMode()) {
39073
+ item.basePermission = "AUTHORIZATION/" + item.basePermission;
39074
+ }
39075
+ if (_this.dataSource.findIndex(function (x) { return x.basePermission == item.basePermission; }) == -1
39076
+ && !_this.excludeBasePermission.find(function (x) { return item.basePermission == x; })) {
39077
+ _this.dataSource.push(item);
39078
+ }
39079
+ _this.dataSource = _this._commonService.orderBy(_this.dataSource, 'basePermission');
39080
+ _this.basePermissionText = _this.getBasePermissionText();
39081
+ });
39082
+ }
39083
+ else {
39084
+ this.rootModel.httpRequestList = [];
39085
+ }
39086
+ };
39087
+ PermissionUtilsComponent.prototype.visibleChanged = function (evt) {
39088
+ if (!evt) {
39089
+ this.rootModel.showPermissionUtils = false;
38474
39090
  }
38475
39091
  };
38476
39092
  PermissionUtilsComponent.prototype.cancel = function () {
@@ -39317,7 +39933,7 @@
39317
39933
 
39318
39934
  var ServiceFileUploadComponent = /** @class */ (function (_super) {
39319
39935
  __extends(ServiceFileUploadComponent, _super);
39320
- function ServiceFileUploadComponent(_fileObjectService, _signalRService, _moduleConfigService, _tnClientService, _authenService, _userService, _notifierService, _downloadLinkService, _fileExplorerService, _injector) {
39936
+ function ServiceFileUploadComponent(_fileObjectService, _signalRService, _moduleConfigService, _tnClientService, _authenService, _userService, _notifierService, _downloadLinkService, _fileExplorerService, _deviceDetectorService, _injector) {
39321
39937
  var _this = _super.call(this, _injector) || this;
39322
39938
  _this._fileObjectService = _fileObjectService;
39323
39939
  _this._signalRService = _signalRService;
@@ -39328,10 +39944,12 @@
39328
39944
  _this._notifierService = _notifierService;
39329
39945
  _this._downloadLinkService = _downloadLinkService;
39330
39946
  _this._fileExplorerService = _fileExplorerService;
39947
+ _this._deviceDetectorService = _deviceDetectorService;
39331
39948
  _this.control = new FileUploadControlSchema();
39332
39949
  _this.serviceCode = '';
39333
39950
  _this.entity = '';
39334
39951
  _this.chooseLabel = 'Chọn';
39952
+ _this.parentSetting = new CrudFormSetting();
39335
39953
  _this.onInit = new i0.EventEmitter();
39336
39954
  _this.onSelect = new i0.EventEmitter();
39337
39955
  _this.onRemove = new i0.EventEmitter();
@@ -39356,6 +39974,25 @@
39356
39974
  _this._subscribe = null;
39357
39975
  _this.dataModel = {};
39358
39976
  _this.forms = {};
39977
+ _this.formIds = {
39978
+ createFolder: 'createFolder',
39979
+ renameFile: 'renameFile',
39980
+ shareFile: 'shareFile',
39981
+ shareFolder: 'shareFolder',
39982
+ fileViewer: 'fileViewer',
39983
+ fileVersionList: 'fileVersionList',
39984
+ signatureDetail: 'signatureDetail',
39985
+ kySoSim: 'kySoSim',
39986
+ viewDetail: 'viewDetail'
39987
+ };
39988
+ _this.signatureFormModel = {
39989
+ formData: new CrudFormData(),
39990
+ show: false,
39991
+ popupSize: new PopupSize({
39992
+ width: 600,
39993
+ height: 400
39994
+ })
39995
+ };
39359
39996
  if (_this._userService.isValidAccessToken()) {
39360
39997
  _this.userId = _this._userService.getUserIdCombine();
39361
39998
  }
@@ -39393,6 +40030,10 @@
39393
40030
  show: false,
39394
40031
  formData: {},
39395
40032
  };
40033
+ this.forms[this.formIds.signatureDetail] = {
40034
+ header: 'Thông tin chữ ký số',
40035
+ show: false,
40036
+ };
39396
40037
  if (this.fileDataService) {
39397
40038
  this.fileDataService.register(this);
39398
40039
  }
@@ -39403,8 +40044,9 @@
39403
40044
  ServiceFileUploadComponent.prototype.getServiceFile = function () {
39404
40045
  return __awaiter(this, void 0, void 0, function () {
39405
40046
  var serviceRequestModel, fileObject;
39406
- return __generator(this, function (_a) {
39407
- switch (_a.label) {
40047
+ var _this = this;
40048
+ return __generator(this, function (_b) {
40049
+ switch (_b.label) {
39408
40050
  case 0:
39409
40051
  if (!this.hasKeys()) return [3 /*break*/, 2];
39410
40052
  serviceRequestModel = {
@@ -39416,7 +40058,7 @@
39416
40058
  this.setNoti('Đang lấy đính kèm...');
39417
40059
  return [4 /*yield*/, this._fileObjectService.getSingleServiceFile(serviceRequestModel)];
39418
40060
  case 1:
39419
- fileObject = (_a.sent()).data;
40061
+ fileObject = (_b.sent()).data;
39420
40062
  this.loading = false;
39421
40063
  this.setNoti(null);
39422
40064
  if (fileObject) {
@@ -39425,8 +40067,14 @@
39425
40067
  return [3 /*break*/, 3];
39426
40068
  case 2:
39427
40069
  this.setFileObject(null);
39428
- _a.label = 3;
40070
+ _b.label = 3;
39429
40071
  case 3:
40072
+ this._fileExplorerService.getSignatureInfoByFileId(this.fileId).then(function (rs) {
40073
+ var _a;
40074
+ if (rs.success && ((_a = rs.data) === null || _a === void 0 ? void 0 : _a.length)) {
40075
+ _this.selectedFile.signatures = rs.data;
40076
+ }
40077
+ });
39430
40078
  this.control.hasFile = this.hasFile;
39431
40079
  this.setMenu();
39432
40080
  return [2 /*return*/];
@@ -39445,6 +40093,7 @@
39445
40093
  this.onChanged.emit();
39446
40094
  return;
39447
40095
  }
40096
+ this.selectedFile = fileObject;
39448
40097
  this.fileObj = fileObject;
39449
40098
  this.fileId = fileObject.id;
39450
40099
  this.setFileName(fileObject.name);
@@ -39472,7 +40121,70 @@
39472
40121
  command: function () {
39473
40122
  _this.download();
39474
40123
  }
39475
- }
40124
+ },
40125
+ {
40126
+ label: 'Ký số cá nhân (SIM)',
40127
+ icon: 'fas fa-sim-card',
40128
+ command: function () {
40129
+ _this.signKySimFile(_this.selectedFile);
40130
+ },
40131
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
40132
+ && !this.parentSetting.hiddenKySoSimCaNhan),
40133
+ },
40134
+ {
40135
+ label: 'Ký số SmartCA',
40136
+ icon: 'fas fa-signature',
40137
+ command: function () {
40138
+ _this.signatureFormModel.show = true;
40139
+ },
40140
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
40141
+ && !this.parentSetting.hiddenKySoSmartCA),
40142
+ },
40143
+ {
40144
+ label: 'Ký số cá nhân (USB)', icon: 'fas fa-signature',
40145
+ command: function () {
40146
+ _this.signFile(_this.selectedFile);
40147
+ },
40148
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
40149
+ && this._deviceDetectorService.isDesktop()
40150
+ && !this.parentSetting.hiddenKySoUsbCaNhan),
40151
+ },
40152
+ {
40153
+ label: 'Ký số VNPTCA', icon: 'fas fa-signature',
40154
+ command: function () {
40155
+ _this.signVNPTCA(_this.selectedFile);
40156
+ },
40157
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
40158
+ && this._deviceDetectorService.isDesktop()
40159
+ && !this.parentSetting.hiddenKySoVNPTCA),
40160
+ },
40161
+ {
40162
+ label: 'Bút phê', icon: 'fas fa-comment-dots',
40163
+ command: function () {
40164
+ _this.addComment(_this.selectedFile);
40165
+ },
40166
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
40167
+ && this._deviceDetectorService.isDesktop()
40168
+ && !this.parentSetting.hiddenButPhe),
40169
+ },
40170
+ {
40171
+ label: 'Bút phê và ký', icon: 'fas fa-comment-medical',
40172
+ command: function () {
40173
+ _this.addCommentAndSign(_this.selectedFile);
40174
+ },
40175
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
40176
+ && this._deviceDetectorService.isDesktop()
40177
+ && !this.parentSetting.hiddenButPhe),
40178
+ },
40179
+ {
40180
+ label: 'Ký số đơn vị (USB)', icon: 'fas fa-signature',
40181
+ command: function () {
40182
+ _this.signFileDonVi(_this.selectedFile);
40183
+ },
40184
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
40185
+ && this._deviceDetectorService.isDesktop()
40186
+ && !this.parentSetting.hiddenKySoDonVi),
40187
+ },
39476
40188
  ];
39477
40189
  };
39478
40190
  ServiceFileUploadComponent.prototype.subscribe = function () {
@@ -39501,71 +40213,100 @@
39501
40213
  }
39502
40214
  };
39503
40215
  ServiceFileUploadComponent.prototype.onSelectFile = function (evt) {
39504
- this.hasFile = false;
39505
- this.fileId = null;
39506
- this.file.clear();
39507
- if (evt.errorFiles && evt.errorFiles.length > 0) {
39508
- this.showNoti = true;
39509
- this.notification = "" + evt.errorMessages[0].summary + evt.errorMessages[0].detail;
39510
- }
39511
- else {
39512
- this.selectedFile = evt.successFiles[0];
39513
- this.setFileName(this.selectedFile ? this.selectedFile.name : null);
39514
- if (this.control.autoSaved) {
39515
- this.handleSaveFile();
39516
- }
39517
- else {
39518
- this.hasFile = true;
39519
- this.onChangeBase('has-value');
39520
- this.onSelect.emit(this.selectedFile);
39521
- this.onChanged.emit(this.selectedFile);
39522
- }
39523
- }
39524
- this.control.hasFile = this.hasFile;
40216
+ return __awaiter(this, void 0, void 0, function () {
40217
+ return __generator(this, function (_b) {
40218
+ switch (_b.label) {
40219
+ case 0:
40220
+ this.hasFile = false;
40221
+ this.fileId = null;
40222
+ this.file.clear();
40223
+ if (!(evt.errorFiles && evt.errorFiles.length > 0)) return [3 /*break*/, 1];
40224
+ this.showNoti = true;
40225
+ this.notification = "" + evt.errorMessages[0].summary + evt.errorMessages[0].detail;
40226
+ return [3 /*break*/, 4];
40227
+ case 1:
40228
+ this.selectedFile = evt.successFiles[0];
40229
+ this.setFileName(this.selectedFile ? this.selectedFile.name : null);
40230
+ if (!this.control.autoSaved) return [3 /*break*/, 3];
40231
+ return [4 /*yield*/, this.handleSaveFile()];
40232
+ case 2:
40233
+ _b.sent();
40234
+ return [3 /*break*/, 4];
40235
+ case 3:
40236
+ this.hasFile = true;
40237
+ this.onChangeBase('has-value');
40238
+ this.onSelect.emit(this.selectedFile);
40239
+ this.onChanged.emit(this.selectedFile);
40240
+ _b.label = 4;
40241
+ case 4:
40242
+ this.control.hasFile = this.hasFile;
40243
+ this.setMenu();
40244
+ return [2 /*return*/];
40245
+ }
40246
+ });
40247
+ });
39525
40248
  };
39526
40249
  ServiceFileUploadComponent.prototype.handleSaveFile = function () {
39527
- var _this = this;
39528
- // Đã lưu file.
39529
- if (this.fileId) {
39530
- return;
39531
- }
39532
- // Trường hợp không có đủ keys.
39533
- if (!this.hasKeys()) {
39534
- this._notifierService.showWarning('Chưa cấu hình keys');
39535
- return;
39536
- }
39537
- // Chưa chọn file.
39538
- if (!this.selectedFile) {
39539
- return;
39540
- }
39541
- var formData = new FormData();
39542
- formData.append('serviceCode', this.serviceCode);
39543
- formData.append('entity', this.entity);
39544
- formData.append('entityKey', this.entityKey);
39545
- formData.append('isMultiple', 'false');
39546
- formData.append('isPublic', "" + this.control.isPublic);
39547
- formData.append('file', this.selectedFile);
39548
- this.loading = true;
39549
- this.setNoti('Đang tải file lên...');
39550
- this._fileObjectService.createServiceFile(formData)
39551
- .then(function (rs) {
39552
- _this.loading = false;
39553
- _this.setNoti(null);
39554
- if (rs.success) {
39555
- _this.selectedFile = _this.selectedFile;
39556
- _this.selectedFileName = _this.selectedFile.name;
39557
- _this.fileId = rs.data;
39558
- _this.hasFile = true;
39559
- _this.control.hasFile = _this.hasFile;
39560
- _this.onChanged.emit({ fileId: _this.fileId, selectedFile: _this.selectedFile });
39561
- }
39562
- else {
39563
- _this._crudService.processErrorResponse(rs);
39564
- }
39565
- }, function (err) {
39566
- _this.loading = false;
39567
- _this.setNoti(null);
39568
- _this._notifierService.showWarning('Upload file chưa thành công');
40250
+ return __awaiter(this, void 0, void 0, function () {
40251
+ var formData;
40252
+ var _this = this;
40253
+ return __generator(this, function (_b) {
40254
+ switch (_b.label) {
40255
+ case 0:
40256
+ // Đã lưu file.
40257
+ if (this.fileId) {
40258
+ return [2 /*return*/];
40259
+ }
40260
+ // Trường hợp không có đủ keys.
40261
+ if (!this.hasKeys()) {
40262
+ this._notifierService.showWarning('Chưa cấu hình keys');
40263
+ return [2 /*return*/];
40264
+ }
40265
+ // Chưa chọn file.
40266
+ if (!this.selectedFile) {
40267
+ return [2 /*return*/];
40268
+ }
40269
+ formData = new FormData();
40270
+ formData.append('serviceCode', this.serviceCode);
40271
+ formData.append('entity', this.entity);
40272
+ formData.append('entityKey', this.entityKey);
40273
+ formData.append('isMultiple', 'false');
40274
+ formData.append('isPublic', "" + this.control.isPublic);
40275
+ formData.append('file', this.selectedFile);
40276
+ this.loading = true;
40277
+ this.setNoti('Đang tải file lên...');
40278
+ return [4 /*yield*/, this._fileObjectService.createServiceFile(formData)
40279
+ .then(function (rs) {
40280
+ _this.loading = false;
40281
+ _this.setNoti(null);
40282
+ if (rs.success) {
40283
+ _this.selectedFile = _this.selectedFile;
40284
+ _this.selectedFileName = _this.selectedFile.name;
40285
+ _this.fileId = rs.data;
40286
+ _this.selectedFile.id = rs.data;
40287
+ _this.hasFile = true;
40288
+ _this.control.hasFile = _this.hasFile;
40289
+ _this.onChanged.emit({ fileId: _this.fileId, selectedFile: _this.selectedFile });
40290
+ _this._fileExplorerService.getSignatureInfoByFileId(_this.fileId).then(function (rs) {
40291
+ var _a;
40292
+ if (rs.success && ((_a = rs.data) === null || _a === void 0 ? void 0 : _a.length)) {
40293
+ _this.selectedFile.signatures = rs.data;
40294
+ }
40295
+ });
40296
+ }
40297
+ else {
40298
+ _this._crudService.processErrorResponse(rs);
40299
+ }
40300
+ }, function (err) {
40301
+ _this.loading = false;
40302
+ _this.setNoti(null);
40303
+ _this._notifierService.showWarning('Upload file chưa thành công');
40304
+ })];
40305
+ case 1:
40306
+ _b.sent();
40307
+ return [2 /*return*/];
40308
+ }
40309
+ });
39569
40310
  });
39570
40311
  };
39571
40312
  ServiceFileUploadComponent.prototype.setNoti = function (msg) {
@@ -39590,6 +40331,11 @@
39590
40331
  this.selectedFileNameShort = null;
39591
40332
  }
39592
40333
  };
40334
+ ServiceFileUploadComponent.prototype.viewListSign = function (e, signatures) {
40335
+ e.stopPropagation();
40336
+ this.forms[this.formIds.signatureDetail].show = true;
40337
+ this.model.advanceData = signatures;
40338
+ };
39593
40339
  ServiceFileUploadComponent.prototype.showContextMenu = function (evt) {
39594
40340
  this.contextMenu.toggle(evt);
39595
40341
  evt.stopPropagation();
@@ -39634,115 +40380,615 @@
39634
40380
  _this.fileId = obj.message.content;
39635
40381
  _this.fileObj.name = obj.message.title;
39636
40382
  }
39637
- else {
39638
- obj = JSON.parse(data);
39639
- _this.fileId = obj.message.content;
39640
- _this.fileObj.name = obj.message.title;
40383
+ else {
40384
+ obj = JSON.parse(data);
40385
+ _this.fileId = obj.message.content;
40386
+ _this.fileObj.name = obj.message.title;
40387
+ }
40388
+ }
40389
+ });
40390
+ };
40391
+ ServiceFileUploadComponent.prototype.viewOnline = function () {
40392
+ if (this._fileObjectService.isSupportedViewOnline(this.fileObj.name)) {
40393
+ this.dataModel.fileViewer.data = {};
40394
+ this.dataModel.fileViewer.data.fileId = this.fileId;
40395
+ this.dataModel.fileViewer.data.fileName = this.fileObj.name;
40396
+ this.dataModel.fileViewer.data.service = this.serviceCode;
40397
+ this.dataModel.fileViewer.data.entity = this.entity;
40398
+ this.dataModel.fileViewer.data.entityKey = this.entityKey;
40399
+ this.dataModel.fileViewer.data.isFileVersion = false;
40400
+ this.dataModel.fileViewer.show = true;
40401
+ }
40402
+ else {
40403
+ this.download();
40404
+ }
40405
+ };
40406
+ ServiceFileUploadComponent.prototype.download = function () {
40407
+ if (!this.fileId) {
40408
+ return;
40409
+ }
40410
+ var model = new GenerateLinkDownloadDTO({
40411
+ fileId: this.fileId
40412
+ });
40413
+ this._downloadLinkService.downloadLink(model);
40414
+ };
40415
+ ServiceFileUploadComponent.prototype.uploadFileFromDrive = function () {
40416
+ // this.dataModel.driveFileDialog = {
40417
+ // show: true
40418
+ // };
40419
+ };
40420
+ ServiceFileUploadComponent.prototype.copyFileToDrive = function () {
40421
+ // this._fileExplorerService.getFolderId(this.userId).then(response => {
40422
+ // var copyFileDto = new CopyFileDto();
40423
+ // copyFileDto.id = this.fileId;
40424
+ // if (this.fileName == "") {
40425
+ // if (this.fileObj != null) {
40426
+ // copyFileDto.name = this.fileObj.name;
40427
+ // }
40428
+ // } else {
40429
+ // copyFileDto.name = this.fileName;
40430
+ // }
40431
+ // copyFileDto.ownerType = this.userId;
40432
+ // copyFileDto.folderId = response.data;
40433
+ // this._fileExplorerService.copyFile(copyFileDto).then(response => {
40434
+ // this._notifierService.showSuccess('Sao chép tài liệu về thư mục cá nhân thành công');
40435
+ // }, error => {
40436
+ // this._notifierService.showBusinessError(error.error.message);
40437
+ // });
40438
+ // });
40439
+ };
40440
+ ServiceFileUploadComponent.prototype.writeValue = function (obj) {
40441
+ };
40442
+ ServiceFileUploadComponent.prototype.registerOnChange = function (fn) {
40443
+ this.onChangeBase = fn;
40444
+ };
40445
+ ServiceFileUploadComponent.prototype.registerOnTouched = function (fn) {
40446
+ this.onTouched = fn;
40447
+ };
40448
+ ServiceFileUploadComponent.prototype.setDisabledState = function (isDisabled) {
40449
+ this.isDisabled = isDisabled;
40450
+ };
40451
+ ServiceFileUploadComponent.prototype.openFileViewer = function () {
40452
+ return __awaiter(this, void 0, void 0, function () {
40453
+ var fileBinary, fileObject, fileName;
40454
+ return __generator(this, function (_b) {
40455
+ switch (_b.label) {
40456
+ case 0: return [4 /*yield*/, this._fileExplorerService.checkPhysicalFile(this.fileId)];
40457
+ case 1:
40458
+ fileBinary = _b.sent();
40459
+ if (!fileBinary.success) {
40460
+ this._notifierService.showWarning('File không tồn tại, vui lòng liên hệ quản trị viên');
40461
+ return [2 /*return*/];
40462
+ }
40463
+ return [4 /*yield*/, this._fileObjectService.getDetail(this.fileId)];
40464
+ case 2:
40465
+ fileObject = _b.sent();
40466
+ fileName = '';
40467
+ if (!fileObject.success) {
40468
+ this._notifierService.showWarning('Có lỗi trong lúc lấy dữ liệu file, vui lòng liên hệ quản trị viên');
40469
+ return [2 /*return*/];
40470
+ }
40471
+ fileName = fileObject === null || fileObject === void 0 ? void 0 : fileObject.name;
40472
+ this.forms.fileViewer.formData.data = {
40473
+ fileId: this.fileId,
40474
+ isFileVersion: false,
40475
+ fileName: fileName,
40476
+ service: this.serviceCode,
40477
+ entity: this.entity,
40478
+ entityKey: this.entityKey,
40479
+ };
40480
+ this.forms.fileViewer.show = true;
40481
+ return [2 /*return*/];
40482
+ }
40483
+ });
40484
+ });
40485
+ };
40486
+ ServiceFileUploadComponent.prototype.signFileSmartCA = function (dataKySo) {
40487
+ var _a;
40488
+ return __awaiter(this, void 0, void 0, function () {
40489
+ var sourceFileId, rsConvert, e_1;
40490
+ return __generator(this, function (_b) {
40491
+ switch (_b.label) {
40492
+ case 0:
40493
+ this.signatureFormModel.show = false;
40494
+ sourceFileId = this.selectedFile.id;
40495
+ if (!this._fileExplorerService.needConvertBeforeSign(this.selectedFile.name)) return [3 /*break*/, 4];
40496
+ _b.label = 1;
40497
+ case 1:
40498
+ _b.trys.push([1, 3, , 4]);
40499
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
40500
+ instanceId: sourceFileId,
40501
+ name: this._fileExplorerService.changeFileExtension(this.selectedFile.name, 'pdf'),
40502
+ folderInstanceId: (_a = this.selectedFile.parentFolderId) !== null && _a !== void 0 ? _a : this._commonService.guid(),
40503
+ ownerType: this._userService.getCurrentUser().userId.toString(),
40504
+ })];
40505
+ case 2:
40506
+ rsConvert = _b.sent();
40507
+ if (!rsConvert || !rsConvert.success) {
40508
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + this.selectedFile.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
40509
+ return [2 /*return*/];
40510
+ }
40511
+ else {
40512
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + this.selectedFile.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
40513
+ sourceFileId = rsConvert.data;
40514
+ }
40515
+ return [3 /*break*/, 4];
40516
+ case 3:
40517
+ e_1 = _b.sent();
40518
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + this.selectedFile.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
40519
+ return [2 /*return*/];
40520
+ case 4:
40521
+ if (!dataKySo) {
40522
+ this._notifierService.showWarning('Người dùng chưa cấu hình thông tin ký số');
40523
+ }
40524
+ debugger;
40525
+ this.forms.fileViewer.formData.data = {
40526
+ fileId: sourceFileId,
40527
+ isFileVersion: false,
40528
+ fileName: this.selectedFile.name,
40529
+ service: this.serviceCode,
40530
+ entity: this.entity,
40531
+ entityKey: this.entityKey,
40532
+ fileBase64Content: dataKySo.fileBase64Content,
40533
+ userChuKySoId: dataKySo.id,
40534
+ showKySoButton: true,
40535
+ width: dataKySo.width,
40536
+ height: dataKySo.height,
40537
+ };
40538
+ this.forms.fileViewer.show = true;
40539
+ return [2 /*return*/];
40540
+ }
40541
+ });
40542
+ });
40543
+ };
40544
+ ServiceFileUploadComponent.prototype.signKySimFile = function (file) {
40545
+ this.forms.kySoSim.show = true;
40546
+ this.model.advanceData = file;
40547
+ };
40548
+ ServiceFileUploadComponent.prototype.signFile = function (file) {
40549
+ var _this = this;
40550
+ this._notifierService.showConfirm('Bạn có chắc chắn muốn ký số văn bản này?').then(function (rs) { return __awaiter(_this, void 0, void 0, function () {
40551
+ var sourceFileId, sourceFile_1, rsConvert, e_2;
40552
+ var _this = this;
40553
+ return __generator(this, function (_b) {
40554
+ switch (_b.label) {
40555
+ case 0:
40556
+ if (!rs) return [3 /*break*/, 5];
40557
+ sourceFileId = file.id;
40558
+ sourceFile_1 = file;
40559
+ if (!this._fileExplorerService.needConvertBeforeSign(file.name)) return [3 /*break*/, 4];
40560
+ _b.label = 1;
40561
+ case 1:
40562
+ _b.trys.push([1, 3, , 4]);
40563
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
40564
+ instanceId: sourceFileId,
40565
+ name: this._fileExplorerService.changeFileExtension(file.name, 'pdf'),
40566
+ folderInstanceId: file.parentFolderId,
40567
+ ownerType: this._userService.getCurrentUser().userId.toString(),
40568
+ })];
40569
+ case 2:
40570
+ rsConvert = _b.sent();
40571
+ if (!rsConvert || !rsConvert.success) {
40572
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
40573
+ return [2 /*return*/];
40574
+ }
40575
+ else {
40576
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
40577
+ sourceFileId = rsConvert.data;
40578
+ sourceFile_1 = { id: sourceFileId };
40579
+ this.getServiceFile();
40580
+ }
40581
+ return [3 /*break*/, 4];
40582
+ case 3:
40583
+ e_2 = _b.sent();
40584
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
40585
+ return [2 /*return*/];
40586
+ case 4:
40587
+ this._fileExplorerService.generateLinkDownload({
40588
+ fileId: sourceFileId,
40589
+ }).then(function (rs) {
40590
+ var url = _this._downloadLinkService.getDownloadForSignUrl(rs.data);
40591
+ var prms = {};
40592
+ prms['FileUploadHandler'] = _this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + _this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile";
40593
+ prms['SessionId'] = '';
40594
+ prms['FileName'] = url;
40595
+ // tslint:disable-next-line: variable-name
40596
+ var json_prms = JSON.stringify(prms);
40597
+ vgca_sign_approved(json_prms, function (result) {
40598
+ var resultObj = JSON.parse(result);
40599
+ if (resultObj.FileServer != '') {
40600
+ _this._fileExplorerService.saveSignedFile({
40601
+ sourceFile: sourceFile_1,
40602
+ tempFileId: resultObj.FileServer,
40603
+ }).then(function (rss) {
40604
+ _this.getServiceFile();
40605
+ _this._notifierService.showSuccess('Ký số thành công');
40606
+ });
40607
+ }
40608
+ });
40609
+ });
40610
+ _b.label = 5;
40611
+ case 5: return [2 /*return*/];
40612
+ }
40613
+ });
40614
+ }); });
40615
+ };
40616
+ ServiceFileUploadComponent.prototype.signVNPTCA = function (item) {
40617
+ var _a;
40618
+ return __awaiter(this, void 0, void 0, function () {
40619
+ var sourceFileId, rsConvert, e_3, dataInput, sigOptions, dataJS, data, e_4;
40620
+ return __generator(this, function (_b) {
40621
+ switch (_b.label) {
40622
+ case 0:
40623
+ sourceFileId = item.id;
40624
+ if (!this._fileExplorerService.needConvertBeforeSign(item.name)) return [3 /*break*/, 4];
40625
+ _b.label = 1;
40626
+ case 1:
40627
+ _b.trys.push([1, 3, , 4]);
40628
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
40629
+ instanceId: item.id,
40630
+ name: this._fileExplorerService.changeFileExtension(item.name, 'pdf'),
40631
+ folderInstanceId: (_a = item.parentFolderId) !== null && _a !== void 0 ? _a : this._commonService.guid(),
40632
+ ownerType: this._userService.getCurrentUser().userId.toString(),
40633
+ })];
40634
+ case 2:
40635
+ rsConvert = _b.sent();
40636
+ if (!rsConvert || !rsConvert.success) {
40637
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + item.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
40638
+ return [2 /*return*/];
40639
+ }
40640
+ else {
40641
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + item.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
40642
+ sourceFileId = rsConvert.data;
40643
+ this.model.selectedItem.id = rsConvert.data;
40644
+ this.getServiceFile();
40645
+ }
40646
+ return [3 /*break*/, 4];
40647
+ case 3:
40648
+ e_3 = _b.sent();
40649
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + item.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
40650
+ return [2 /*return*/];
40651
+ case 4: return [4 /*yield*/, this._fileExplorerService.getBase64FromFileId(sourceFileId)];
40652
+ case 5:
40653
+ dataInput = (_b.sent()).split(',')[1];
40654
+ sigOptions = new PdfSigner();
40655
+ sigOptions.page = 1;
40656
+ sigOptions.AdvancedCustom = true;
40657
+ sigOptions.SigType = 1;
40658
+ dataJS = {
40659
+ data: dataInput,
40660
+ type: 'pdf',
40661
+ sigOptions: JSON.stringify(sigOptions)
40662
+ };
40663
+ _b.label = 6;
40664
+ case 6:
40665
+ _b.trys.push([6, 8, , 9]);
40666
+ return [4 /*yield*/, vnpt_plugin.signArrDataAdvanced([JSON.stringify(dataJS)], "", false)];
40667
+ case 7:
40668
+ data = _b.sent();
40669
+ this.handeResult(data);
40670
+ return [3 /*break*/, 9];
40671
+ case 8:
40672
+ e_4 = _b.sent();
40673
+ console.log(e_4);
40674
+ return [3 /*break*/, 9];
40675
+ case 9: return [2 /*return*/];
39641
40676
  }
39642
- }
40677
+ });
39643
40678
  });
39644
40679
  };
39645
- ServiceFileUploadComponent.prototype.viewOnline = function () {
39646
- if (this._fileObjectService.isSupportedViewOnline(this.fileObj.name)) {
39647
- this.dataModel.fileViewer.data = {};
39648
- this.dataModel.fileViewer.data.fileId = this.fileId;
39649
- this.dataModel.fileViewer.data.fileName = this.fileObj.name;
39650
- this.dataModel.fileViewer.data.service = this.serviceCode;
39651
- this.dataModel.fileViewer.data.entity = this.entity;
39652
- this.dataModel.fileViewer.data.entityKey = this.entityKey;
39653
- this.dataModel.fileViewer.data.isFileVersion = false;
39654
- this.dataModel.fileViewer.show = true;
40680
+ ServiceFileUploadComponent.prototype.handeResult = function (data) {
40681
+ var _this = this;
40682
+ if (typeof JSON.parse(data).code !== 'undefined') {
40683
+ var jsOb = JSON.parse(data);
39655
40684
  }
39656
40685
  else {
39657
- this.download();
40686
+ var jsOb = JSON.parse(JSON.parse(data)[0]);
39658
40687
  }
39659
- };
39660
- ServiceFileUploadComponent.prototype.download = function () {
39661
- if (!this.fileId) {
39662
- return;
40688
+ switch (jsOb.code) {
40689
+ case 0:
40690
+ this._fileExplorerService.kySimSaveSignedFile({
40691
+ sourceFile: this.model.selectedItem,
40692
+ fileContents: jsOb.data,
40693
+ }).then(function (rss) {
40694
+ _this._notifierService.showSuccess("Ký thành công");
40695
+ _this.getServiceFile();
40696
+ });
40697
+ break;
40698
+ case 1:
40699
+ this._notifierService.showWarning("Dữ liệu đầu vào không đúng định dạng");
40700
+ break;
40701
+ case 2:
40702
+ this._notifierService.showWarning("Không lấy được thông tin chứng thư số");
40703
+ break;
40704
+ case 3:
40705
+ this._notifierService.showWarning("Có lỗi trong quá trình ký số");
40706
+ break;
40707
+ case 4:
40708
+ this._notifierService.showSuccess("Chứng thư số không có khóa bí mật");
40709
+ break;
40710
+ case 5:
40711
+ this._notifierService.showSuccess("Lỗi không xác định");
40712
+ break;
40713
+ case 6:
40714
+ this._notifierService.showSuccess("Ký pdf: không tìm thấy tham số số trang cần ký");
40715
+ break;
40716
+ case 7:
40717
+ this._notifierService.showSuccess("Ký pdf: trang đặt chữ ký không tồn tại");
40718
+ break;
40719
+ case 8:
40720
+ this._notifierService.showSuccess("Ký xml: không tìm thấy thẻ ký số");
40721
+ break;
40722
+ case 9:
40723
+ this._notifierService.showSuccess("Ký pdf: không tìm thấy id của thẻ ký số");
40724
+ break;
40725
+ case 10:
40726
+ this._notifierService.showSuccess("Dữ liệu ký đã chứa một hoặc nhiều chữ ký không hợp lệ");
40727
+ break;
40728
+ case 11:
40729
+ this._notifierService.showSuccess("Người dùng hủy bỏ");
40730
+ break;
40731
+ case 13:
40732
+ this._notifierService.showWarning("Dữ liệu ký rỗng");
40733
+ break;
40734
+ default:
40735
+ this._notifierService.showSuccess("Lỗi không xác định");
40736
+ break;
39663
40737
  }
39664
- var model = new GenerateLinkDownloadDTO({
39665
- fileId: this.fileId
39666
- });
39667
- this._downloadLinkService.downloadLink(model);
39668
- };
39669
- ServiceFileUploadComponent.prototype.uploadFileFromDrive = function () {
39670
- // this.dataModel.driveFileDialog = {
39671
- // show: true
39672
- // };
39673
- };
39674
- ServiceFileUploadComponent.prototype.copyFileToDrive = function () {
39675
- // this._fileExplorerService.getFolderId(this.userId).then(response => {
39676
- // var copyFileDto = new CopyFileDto();
39677
- // copyFileDto.id = this.fileId;
39678
- // if (this.fileName == "") {
39679
- // if (this.fileObj != null) {
39680
- // copyFileDto.name = this.fileObj.name;
39681
- // }
39682
- // } else {
39683
- // copyFileDto.name = this.fileName;
39684
- // }
39685
- // copyFileDto.ownerType = this.userId;
39686
- // copyFileDto.folderId = response.data;
39687
- // this._fileExplorerService.copyFile(copyFileDto).then(response => {
39688
- // this._notifierService.showSuccess('Sao chép tài liệu về thư mục cá nhân thành công');
39689
- // }, error => {
39690
- // this._notifierService.showBusinessError(error.error.message);
39691
- // });
39692
- // });
39693
- };
39694
- ServiceFileUploadComponent.prototype.writeValue = function (obj) {
39695
40738
  };
39696
- ServiceFileUploadComponent.prototype.registerOnChange = function (fn) {
39697
- this.onChangeBase = fn;
39698
- };
39699
- ServiceFileUploadComponent.prototype.registerOnTouched = function (fn) {
39700
- this.onTouched = fn;
39701
- };
39702
- ServiceFileUploadComponent.prototype.setDisabledState = function (isDisabled) {
39703
- this.isDisabled = isDisabled;
40739
+ ServiceFileUploadComponent.prototype.addComment = function (file) {
40740
+ var _this = this;
40741
+ this._notifierService.showConfirm('Bạn có chắc chắn muốn bút phê văn bản này?').then(function (rs) { return __awaiter(_this, void 0, void 0, function () {
40742
+ var sourceFileId, sourceFile_2, rsConvert, e_5;
40743
+ var _this = this;
40744
+ return __generator(this, function (_b) {
40745
+ switch (_b.label) {
40746
+ case 0:
40747
+ if (!rs) return [3 /*break*/, 5];
40748
+ sourceFileId = file.id;
40749
+ sourceFile_2 = file;
40750
+ if (!this._fileExplorerService.needConvertBeforeSign(file.name)) return [3 /*break*/, 4];
40751
+ _b.label = 1;
40752
+ case 1:
40753
+ _b.trys.push([1, 3, , 4]);
40754
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
40755
+ instanceId: sourceFileId,
40756
+ name: this._fileExplorerService.changeFileExtension(file.name, 'pdf'),
40757
+ folderInstanceId: file.parentFolderId,
40758
+ ownerType: this._userService.getCurrentUser().userId.toString(),
40759
+ })];
40760
+ case 2:
40761
+ rsConvert = _b.sent();
40762
+ if (!rsConvert || !rsConvert.success) {
40763
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
40764
+ return [2 /*return*/];
40765
+ }
40766
+ else {
40767
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
40768
+ sourceFileId = rsConvert.data;
40769
+ sourceFile_2 = { id: sourceFileId };
40770
+ this.getServiceFile();
40771
+ }
40772
+ return [3 /*break*/, 4];
40773
+ case 3:
40774
+ e_5 = _b.sent();
40775
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
40776
+ return [2 /*return*/];
40777
+ case 4:
40778
+ this._fileExplorerService.generateLinkDownload({
40779
+ fileId: sourceFileId,
40780
+ }).then(function (rs) {
40781
+ var url = _this._downloadLinkService.getDownloadForSignUrl(rs.data);
40782
+ var prms = {};
40783
+ prms['FileUploadHandler'] = _this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + _this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile";
40784
+ prms['SessionId'] = '';
40785
+ prms['FileName'] = url;
40786
+ // tslint:disable-next-line: variable-name
40787
+ var json_prms = JSON.stringify(prms);
40788
+ vgca_comment(json_prms, function (result) {
40789
+ var resultObj = JSON.parse(result);
40790
+ if (resultObj.FileServer != '') {
40791
+ _this._fileExplorerService.saveSignedFile({
40792
+ sourceFile: sourceFile_2,
40793
+ tempFileId: resultObj.FileServer,
40794
+ }).then(function (rss) {
40795
+ _this.getServiceFile();
40796
+ _this._notifierService.showSuccess('Tạo bút phê thành công');
40797
+ });
40798
+ }
40799
+ });
40800
+ });
40801
+ _b.label = 5;
40802
+ case 5: return [2 /*return*/];
40803
+ }
40804
+ });
40805
+ }); });
39704
40806
  };
39705
- ServiceFileUploadComponent.prototype.openFileViewer = function () {
40807
+ ServiceFileUploadComponent.prototype.addCommentAndSign = function (file) {
39706
40808
  return __awaiter(this, void 0, void 0, function () {
39707
- var fileBinary, fileObject, fileName;
39708
- return __generator(this, function (_a) {
39709
- switch (_a.label) {
39710
- case 0: return [4 /*yield*/, this._fileExplorerService.checkPhysicalFile(this.fileId)];
40809
+ var rs, sourceFileId, sourceFile, rsConvert, e_6, downloadLink, url, prms, json_prms_1, commentResult, resultObj, downloadLink2, url2, prms2, json_prms2_1, signResult, signResultObj;
40810
+ return __generator(this, function (_b) {
40811
+ switch (_b.label) {
40812
+ case 0: return [4 /*yield*/, this._notifierService.showConfirm('Bạn có chắc chắn muốn tạo bút phê và ký văn bản này?')];
39711
40813
  case 1:
39712
- fileBinary = _a.sent();
39713
- if (!fileBinary.success) {
39714
- this._notifierService.showWarning('File không tồn tại, vui lòng liên hệ quản trị viên');
40814
+ rs = _b.sent();
40815
+ if (!rs) return [3 /*break*/, 11];
40816
+ sourceFileId = file.id;
40817
+ sourceFile = file;
40818
+ if (!this._fileExplorerService.needConvertBeforeSign(file.name)) return [3 /*break*/, 5];
40819
+ _b.label = 2;
40820
+ case 2:
40821
+ _b.trys.push([2, 4, , 5]);
40822
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
40823
+ instanceId: sourceFileId,
40824
+ name: this._fileExplorerService.changeFileExtension(file.name, 'pdf'),
40825
+ folderInstanceId: file.parentFolderId,
40826
+ ownerType: this._userService.getCurrentUser().userId.toString(),
40827
+ })];
40828
+ case 3:
40829
+ rsConvert = _b.sent();
40830
+ if (!rsConvert || !rsConvert.success) {
40831
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
39715
40832
  return [2 /*return*/];
39716
40833
  }
39717
- return [4 /*yield*/, this._fileObjectService.getDetail(this.fileId)];
40834
+ else {
40835
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
40836
+ sourceFileId = rsConvert.data;
40837
+ sourceFile = { id: sourceFileId };
40838
+ this.getServiceFile();
40839
+ }
40840
+ return [3 /*break*/, 5];
40841
+ case 4:
40842
+ e_6 = _b.sent();
40843
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
40844
+ return [2 /*return*/];
40845
+ case 5: return [4 /*yield*/, this._fileExplorerService.generateLinkDownload({
40846
+ fileId: sourceFileId,
40847
+ })];
40848
+ case 6:
40849
+ downloadLink = _b.sent();
40850
+ url = this._downloadLinkService.getDownloadForSignUrl(downloadLink.data);
40851
+ prms = {
40852
+ FileUploadHandler: this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile",
40853
+ SessionId: '',
40854
+ FileName: url
40855
+ };
40856
+ json_prms_1 = JSON.stringify(prms);
40857
+ return [4 /*yield*/, new Promise(function (resolve) {
40858
+ vgca_comment(json_prms_1, function (result) { return resolve(result); });
40859
+ })];
40860
+ case 7:
40861
+ commentResult = _b.sent();
40862
+ resultObj = JSON.parse(commentResult);
40863
+ return [4 /*yield*/, this._fileExplorerService.generateLinkDownload({
40864
+ fileId: resultObj.FileServer,
40865
+ })];
40866
+ case 8:
40867
+ downloadLink2 = _b.sent();
40868
+ url2 = this._downloadLinkService.getDownloadForSignUrl(downloadLink2.data);
40869
+ prms2 = {
40870
+ FileUploadHandler: this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile",
40871
+ SessionId: '',
40872
+ FileName: url2
40873
+ };
40874
+ json_prms2_1 = JSON.stringify(prms2);
40875
+ return [4 /*yield*/, new Promise(function (resolve) {
40876
+ vgca_sign_approved(json_prms2_1, function (result) { return resolve(result); });
40877
+ })];
40878
+ case 9:
40879
+ signResult = _b.sent();
40880
+ signResultObj = JSON.parse(signResult);
40881
+ if (!(signResultObj.FileServer != '')) return [3 /*break*/, 11];
40882
+ return [4 /*yield*/, this._fileExplorerService.saveSignedFile({
40883
+ sourceFile: sourceFile,
40884
+ tempFileId: signResultObj.FileServer,
40885
+ })];
40886
+ case 10:
40887
+ _b.sent();
40888
+ this.getServiceFile();
40889
+ this._notifierService.showSuccess('Tạo bút phê và ký thành công');
40890
+ _b.label = 11;
40891
+ case 11: return [2 /*return*/];
40892
+ }
40893
+ });
40894
+ });
40895
+ };
40896
+ ServiceFileUploadComponent.prototype.signFileDonVi = function (file) {
40897
+ var _this = this;
40898
+ this._notifierService
40899
+ .showConfirm('Bạn có chắc chắn muốn ký số đơn vị văn bản này?')
40900
+ .then(function (rs) { return __awaiter(_this, void 0, void 0, function () {
40901
+ var sourceFileId, sourceFile_3, rsConvert, e_7;
40902
+ var _this = this;
40903
+ return __generator(this, function (_b) {
40904
+ switch (_b.label) {
40905
+ case 0:
40906
+ if (!rs) return [3 /*break*/, 5];
40907
+ sourceFileId = file.id;
40908
+ sourceFile_3 = file;
40909
+ if (!this._fileExplorerService.needConvertBeforeSign(file.name)) return [3 /*break*/, 4];
40910
+ _b.label = 1;
40911
+ case 1:
40912
+ _b.trys.push([1, 3, , 4]);
40913
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
40914
+ instanceId: sourceFileId,
40915
+ name: this._fileExplorerService.changeFileExtension(file.name, 'pdf'),
40916
+ folderInstanceId: file.parentFolderId,
40917
+ ownerType: this._userService.getCurrentUser().userId.toString(),
40918
+ })];
39718
40919
  case 2:
39719
- fileObject = _a.sent();
39720
- fileName = '';
39721
- if (!fileObject.success) {
39722
- this._notifierService.showWarning('Có lỗi trong lúc lấy dữ liệu file, vui lòng liên hệ quản trị viên');
40920
+ rsConvert = _b.sent();
40921
+ if (!rsConvert || !rsConvert.success) {
40922
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
39723
40923
  return [2 /*return*/];
39724
40924
  }
39725
- fileName = fileObject === null || fileObject === void 0 ? void 0 : fileObject.name;
39726
- this.forms.fileViewer.formData.data = {
39727
- fileId: this.fileId,
39728
- isFileVersion: false,
39729
- fileName: fileName,
39730
- service: this.serviceCode,
39731
- entity: this.entity,
39732
- entityKey: this.entityKey,
39733
- };
39734
- this.forms.fileViewer.show = true;
40925
+ else {
40926
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
40927
+ this.getServiceFile();
40928
+ sourceFileId = rsConvert.data;
40929
+ sourceFile_3 = { id: sourceFileId };
40930
+ }
40931
+ return [3 /*break*/, 4];
40932
+ case 3:
40933
+ e_7 = _b.sent();
40934
+ this._notifierService.showWarning("C\u00F3 l\u1ED7i x\u1EA3y ra khi chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf \u0111\u1EC3 k\u00FD. Vui l\u00F2ng th\u1EED l\u1EA1i sau");
39735
40935
  return [2 /*return*/];
40936
+ case 4:
40937
+ this._fileExplorerService
40938
+ .generateLinkDownload({
40939
+ isFileVersion: false,
40940
+ fileId: sourceFileId,
40941
+ })
40942
+ .then(function (rs) {
40943
+ var url = _this._downloadLinkService.getDownloadForSignUrl(rs.data);
40944
+ var prms = {};
40945
+ prms['FileUploadHandler'] = _this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + _this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile";
40946
+ prms['SessionId'] = '';
40947
+ prms['FileName'] = url;
40948
+ // Truyền số, ngày ký số phòng ban nếu cần
40949
+ var that = _this;
40950
+ if (that.control && that.control.dataKySoDonVi) {
40951
+ var dataKySoDonVi = that.control.dataKySoDonVi();
40952
+ if (dataKySoDonVi) {
40953
+ // lấy số DocNumber
40954
+ if (dataKySoDonVi.docNumber) {
40955
+ prms['DocNumber'] = dataKySoDonVi.docNumber;
40956
+ }
40957
+ // lấy ngày ban hành vb đi
40958
+ if (dataKySoDonVi.issuedDate) {
40959
+ prms['IssuedDate'] = dataKySoDonVi.issuedDate;
40960
+ }
40961
+ }
40962
+ }
40963
+ // tslint:disable-next-line: variable-name
40964
+ var json_prms = JSON.stringify(prms);
40965
+ vgca_sign_issued(json_prms, function (result) {
40966
+ var resultObj = JSON.parse(result);
40967
+ if (resultObj.FileServer != '') {
40968
+ _this._fileExplorerService
40969
+ .saveSignedFile({
40970
+ sourceFile: sourceFile_3,
40971
+ tempFileId: resultObj.FileServer,
40972
+ })
40973
+ .then(function (rss) {
40974
+ _this.getServiceFile();
40975
+ _this._notifierService.showSuccess('Ký số thành công');
40976
+ });
40977
+ }
40978
+ });
40979
+ });
40980
+ _b.label = 5;
40981
+ case 5: return [2 /*return*/];
39736
40982
  }
39737
40983
  });
39738
- });
40984
+ }); });
39739
40985
  };
39740
40986
  return ServiceFileUploadComponent;
39741
40987
  }(ComponentBase));
39742
40988
  ServiceFileUploadComponent.decorators = [
39743
40989
  { type: i0.Component, args: [{
39744
40990
  selector: 'service-file-upload',
39745
- template: "<div class=\"file-upload\">\n <div class=\"fl-icon\">\n <i *ngIf=\"loading\" class=\"pi pi-spin pi-spinner\"></i>\n <i *ngIf=\"!loading\" class=\"pi pi-file-o\"></i>\n </div>\n\n <div class=\"fl-file-name\" (click)=\"openFileViewer()\">\n <div>\n <ng-container *ngIf=\"!showNoti\">\n <span pTooltip=\"{{selectedFileName}}\">{{selectedFileNameShort}}</span>\n <span class=\"suffix\" *ngIf=\"extension\">.{{extension}} </span>\n </ng-container>\n <span *ngIf=\"showNoti\"> {{notification}} </span>\n </div>\n </div>\n\n <!-- <div class=\"fl-file-name\">\n <div>\n <ng-container *ngIf=\"!showNoti\">\n <span pTooltip=\"{{selectedFileName}}\">{{selectedFileNameShort}}</span>\n <span *ngIf=\"extension\">.{{extension}} </span>\n </ng-container>\n <span *ngIf=\"showNoti\"> {{notification}} </span>\n </div>\n </div> -->\n\n <div class=\"fl-buttons\">\n <button *ngIf=\"!hasFile && !readonly\" pTooltip=\"Ch\u1ECDn file\" class=\"fl-choose\"\n class=\"link-or-action p-button-text p-button-rounded fl-choose\" tooltipPosition=\"top\" pButton type=\"button\"\n icon=\"pi pi-plus\" [disabled]=\"disabled\" (click)=\"onOpenSelect()\"></button>\n\n <button *ngIf=\"hasFile && !readonly && control.showDeleteFile\"\n class=\"link-or-action p-button-text p-button-rounded p-button-danger fl-remove\" pTooltip=\"X\u00F3a file\"\n tooltipPosition=\"top\" pButton type=\"button\" icon=\"pi pi-trash\" [disabled]=\"disabled\"\n (click)=\"onRemoveFile()\"></button>\n\n <button [disabled]=\"!menu || !menu.length\" type=\"button\" pButton icon=\"pi pi-ellipsis-v\"\n class=\"link-or-action p-button-text p-button-rounded\" pTooltip=\"Th\u00EAm\" tooltipPosition=\"top\"\n (click)=\"showContextMenu($event)\"></button>\n </div>\n\n <div style=\"display: none;\">\n <p-fileUpload #file [accept]=\"accept\" class=\"file-upload\" mode=\"basic\" [chooseLabel]=\"chooseLabel\" name=\"file[]\"\n [maxFileSize]=\"control.maxFileSize\" pTooltip=\"Ch\u1ECDn t\u1EEB m\u00E1y t\u00EDnh\" toolStipPosition=\"top\" [multiple]=\"false\"\n [invalidFileSizeMessageSummary]=\"control.invalidFileSizeMessageSummary\"\n [invalidFileSizeMessageDetail]=\"control.invalidFileSizeMessageDetail\"\n [invalidFileTypeMessageSummary]=\"control.invalidFileTypeMessageSummary\"\n [invalidFileTypeMessageDetail]=\"control.invalidFileTypeMessageDetail\"\n [invalidFileLimitMessageSummary]=\"control.invalidFileLimitMessageSummary\"\n [invalidFileLimitMessageDetail]=\"control.invalidFileLimitMessageDetail\" (onSelect)=\"onSelectFile($event)\">\n </p-fileUpload>\n </div>\n\n</div>\n\n<p-contextMenu #contextMenu [appendTo]=\"'body'\" [model]=\"menu\" styleClass=\"fm-contextMenu-panel\">\n</p-contextMenu>\n\n<!-- Xem file tr\u1EF1c tuy\u1EBFn -->\n<file-viewer #fileViewerNew *ngIf=\"forms.fileViewer.show\" [parentModel]=\"model\" [parentContext]=\"context\"\n [readonly]=\"readonly || control.disabled\" [model]=\"forms.fileViewer.formData\"\n (onClose)=\"this.forms.fileViewer.show = false;\">\n</file-viewer>",
40991
+ template: "<div class=\"file-upload\">\n <div class=\"fl-icon\">\n <i *ngIf=\"loading\" class=\"pi pi-spin pi-spinner\"></i>\n <i *ngIf=\"!loading\" class=\"pi pi-file-o\"></i>\n </div>\n\n <div class=\"fl-file-name\" (click)=\"openFileViewer()\">\n <div style=\"position: relative;\">\n <ng-container *ngIf=\"!showNoti\">\n <span pTooltip=\"{{selectedFileName}}\">{{selectedFileNameShort}}</span>\n <span class=\"suffix\" *ngIf=\"extension\">.{{extension}} </span>\n </ng-container>\n <span *ngIf=\"showNoti\"> {{notification}} </span>\n <span *ngIf=\"selectedFile?.signatures\" class=\"pull-right signature\" pTooltip=\"Xem chi ti\u1EBFt k\u00FD s\u1ED1\"\n tooltipPosition=\"top\" (click)=\"viewListSign($event, selectedFile.signatures)\">\n <i class=\"fas fa-signature\"></i>\n </span>\n </div>\n </div>\n\n <!-- <div class=\"fl-file-name\">\n <div>\n <ng-container *ngIf=\"!showNoti\">\n <span pTooltip=\"{{selectedFileName}}\">{{selectedFileNameShort}}</span>\n <span *ngIf=\"extension\">.{{extension}} </span>\n </ng-container>\n <span *ngIf=\"showNoti\"> {{notification}} </span>\n </div>\n </div> -->\n <div class=\"fl-buttons\">\n <button *ngIf=\"!hasFile && !readonly\" pTooltip=\"Ch\u1ECDn file\" class=\"fl-choose\"\n class=\"link-or-action p-button-text p-button-rounded fl-choose\" tooltipPosition=\"top\" pButton type=\"button\"\n icon=\"pi pi-plus\" [disabled]=\"disabled\" (click)=\"onOpenSelect()\"></button>\n\n <button *ngIf=\"hasFile && !readonly && control.showDeleteFile\"\n class=\"link-or-action p-button-text p-button-rounded p-button-danger fl-remove\" pTooltip=\"X\u00F3a file\"\n tooltipPosition=\"top\" pButton type=\"button\" icon=\"pi pi-trash\" [disabled]=\"disabled\"\n (click)=\"onRemoveFile()\"></button>\n\n <button [disabled]=\"!menu || !menu.length\" type=\"button\" pButton icon=\"pi pi-ellipsis-v\"\n class=\"link-or-action p-button-text p-button-rounded\" pTooltip=\"Th\u00EAm\" tooltipPosition=\"top\"\n (click)=\"showContextMenu($event)\"></button>\n </div>\n\n <div style=\"display: none;\">\n <p-fileUpload #file [accept]=\"accept\" class=\"file-upload\" mode=\"basic\" [chooseLabel]=\"chooseLabel\" name=\"file[]\"\n [maxFileSize]=\"control.maxFileSize\" pTooltip=\"Ch\u1ECDn t\u1EEB m\u00E1y t\u00EDnh\" toolStipPosition=\"top\" [multiple]=\"false\"\n [invalidFileSizeMessageSummary]=\"control.invalidFileSizeMessageSummary\"\n [invalidFileSizeMessageDetail]=\"control.invalidFileSizeMessageDetail\"\n [invalidFileTypeMessageSummary]=\"control.invalidFileTypeMessageSummary\"\n [invalidFileTypeMessageDetail]=\"control.invalidFileTypeMessageDetail\"\n [invalidFileLimitMessageSummary]=\"control.invalidFileLimitMessageSummary\"\n [invalidFileLimitMessageDetail]=\"control.invalidFileLimitMessageDetail\" (onSelect)=\"onSelectFile($event)\">\n </p-fileUpload>\n </div>\n</div>\n\n<p-contextMenu #contextMenu [appendTo]=\"'body'\" [model]=\"menu\" styleClass=\"fm-contextMenu-panel\">\n</p-contextMenu>\n\n<!-- Xem file tr\u1EF1c tuy\u1EBFn -->\n<file-viewer #fileViewerNew *ngIf=\"forms.fileViewer.show\" [parentModel]=\"model\" [parentContext]=\"context\"\n [readonly]=\"readonly || control.disabled\" [model]=\"forms.fileViewer.formData\"\n (onClose)=\"this.forms.fileViewer.show = false;\">\n</file-viewer>\n<tn-dialog *ngIf=\"forms.signatureDetail.show\" #dialog [styleClass]=\"'address-form'\"\n [header]=\"forms.signatureDetail.header | translate\" [popupSize]=\"forms[formIds.signatureDetail].popupSize\"\n (onHide)=\"forms.signatureDetail.show=false;\">\n <signature-detail [parentModel]=\"model\" [parentContext]=\"context\">\n </signature-detail>\n</tn-dialog>\n<tn-dialog *ngIf=\"signatureFormModel.show\" #dialog [styleClass]=\"'address-form'\" [header]=\"'Ch\u1ECDn ch\u1EEF k\u00FD s\u1ED1' | translate\"\n [popupSize]=\"signatureFormModel.popupSize\" (onHide)=\"signatureFormModel.show=false\">\n <signature-select #formBase [parentModel]=\"model\" [parentContext]=\"context\" [model]=\"signatureFormModel.formData\"\n (onCancel)=\"signatureFormModel.show = false\" (onSaved)=\"signFileSmartCA($event)\">\n </signature-select>\n</tn-dialog>",
39746
40992
  providers: [
39747
40993
  {
39748
40994
  provide: forms.NG_VALUE_ACCESSOR,
@@ -39751,7 +40997,7 @@
39751
40997
  },
39752
40998
  ComponentContextService
39753
40999
  ],
39754
- styles: ["::ng-deep .file-upload{display:flex;border:1px solid #ced4da;border-radius:4px}::ng-deep .file-upload .fl-icon{flex:0 0 30px;display:flex;font-size:20px;justify-content:center;align-items:center;border-right:1px solid #ced4da}::ng-deep .file-upload .fl-icon>i{font-size:16px!important}::ng-deep .file-upload .fl-file-name{display:flex;align-items:center;flex-grow:1;cursor:pointer;opacity:.8;padding:0 10px;color:#109bf8;overflow:hidden}::ng-deep .file-upload .fl-file-name>div{width:100%;display:flex}::ng-deep .file-upload .fl-file-name>div>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}::ng-deep .file-upload .fl-file-name:hover{opacity:1}::ng-deep .file-upload .fl-file-name .suffix{min-width:45px}::ng-deep .file-upload .fl-buttons{flex:0 0 80px;display:flex;border-right:1px solid #ced4da;align-items:center;justify-content:space-evenly;border-left:1px solid #ced4da}"]
41000
+ styles: ["::ng-deep .file-upload{display:flex;border:1px solid #ced4da;border-radius:4px}::ng-deep .file-upload .fl-icon{flex:0 0 30px;display:flex;font-size:20px;justify-content:center;align-items:center;border-right:1px solid #ced4da}::ng-deep .file-upload .fl-icon>i{font-size:16px!important}::ng-deep .file-upload .fl-file-name{display:flex;align-items:center;flex-grow:1;cursor:pointer;opacity:.8;padding:0 10px;color:#109bf8;overflow:hidden}::ng-deep .file-upload .fl-file-name>div{width:100%;display:flex}::ng-deep .file-upload .fl-file-name>div>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}::ng-deep .file-upload .fl-file-name:hover{opacity:1}::ng-deep .file-upload .fl-file-name .suffix{min-width:45px}::ng-deep .file-upload .fl-buttons{flex:0 0 80px;display:flex;border-right:1px solid #ced4da;align-items:center;justify-content:space-evenly;border-left:1px solid #ced4da}::ng-deep .file-upload .nfl-signature{display:flex;align-items:center;justify-content:center;cursor:pointer;opacity:.8;padding:0 10px;color:#109bf8;overflow:hidden}::ng-deep .file-upload .nfl-signature:hover{opacity:1}::ng-deep .file-upload .signature i{position:absolute;top:0;right:0}"]
39755
41001
  },] }
39756
41002
  ];
39757
41003
  ServiceFileUploadComponent.ctorParameters = function () { return [
@@ -39764,6 +41010,7 @@
39764
41010
  { type: NotifierService },
39765
41011
  { type: DownloadLinkService },
39766
41012
  { type: FileExplorerService },
41013
+ { type: ngxDeviceDetector.DeviceDetectorService },
39767
41014
  { type: i0.Injector }
39768
41015
  ]; };
39769
41016
  ServiceFileUploadComponent.propDecorators = {
@@ -39777,6 +41024,7 @@
39777
41024
  entity: [{ type: i0.Input }],
39778
41025
  entityKey: [{ type: i0.Input }],
39779
41026
  chooseLabel: [{ type: i0.Input }],
41027
+ parentSetting: [{ type: i0.Input }],
39780
41028
  onInit: [{ type: i0.Output }],
39781
41029
  onSelect: [{ type: i0.Output }],
39782
41030
  onRemove: [{ type: i0.Output }],
@@ -45421,13 +46669,13 @@
45421
46669
  return UserPickerSetting;
45422
46670
  }());
45423
46671
  var DatasourceFieldFilter = [
45424
- { id: 'userName', ten: 'Tài khoản' },
45425
- { id: 'code', ten: 'Mã' },
45426
- { id: 'email', ten: 'Email' },
46672
+ { id: 'userName', ten: 'Tài khoản', placeholder: 'thuan.pd\nvan.nbt' },
46673
+ { id: 'code', ten: 'Mã cán bộ', placeholder: '00000408\n00014270' },
46674
+ { id: 'email', ten: 'Email', placeholder: 'linh123@gmail.com\ntnam123@gmail.com' },
45427
46675
  ];
45428
46676
  var DatasourceFilterCanBo = [
45429
- { id: 'code', ten: 'Mã' },
45430
- { id: 'email', ten: 'Email' }
46677
+ { id: 'code', ten: 'Mã cán bộ', placeholder: '00000408\n00014270' },
46678
+ { id: 'email', ten: 'Email', placeholder: 'linh123@gmail.com\ntnam123@gmail.com' },
45431
46679
  ];
45432
46680
 
45433
46681
  var AutoCompletePickerComponent = /** @class */ (function (_super) {
@@ -47678,7 +48926,7 @@
47678
48926
  });
47679
48927
  EntityPickerDataComponent.prototype.ngOnInit = function () {
47680
48928
  var _this = this;
47681
- var _a;
48929
+ var _a, _b;
47682
48930
  this.loadDetailFromQueryParam = true;
47683
48931
  this.plusUrl = this.control.plusUrl;
47684
48932
  this.setting.hiddenAuthorizeButton = true;
@@ -47702,6 +48950,9 @@
47702
48950
  if (this.control.baseService instanceof CanBoHoSoService) {
47703
48951
  this.datasourceFieldFilter = DatasourceFilterCanBo;
47704
48952
  }
48953
+ if ((_b = this.control.datasourceFieldFilter) === null || _b === void 0 ? void 0 : _b.length) {
48954
+ this.datasourceFieldFilter = this.control.datasourceFieldFilter;
48955
+ }
47705
48956
  this.control.columns.forEach(function (column) {
47706
48957
  if (column.isDisplay) {
47707
48958
  var newCol = new ColumnSchemaBase({
@@ -48394,6 +49645,7 @@
48394
49645
  configurable: true
48395
49646
  });
48396
49647
  EntityPickerSearchFormComponent.prototype.ngOnInit = function () {
49648
+ var _this = this;
48397
49649
  this.doNotCheckBaseService = true;
48398
49650
  this.setting.schema = [
48399
49651
  new RadioButtonListControlSchema({
@@ -48404,8 +49656,8 @@
48404
49656
  mdWidth: 12,
48405
49657
  hidden: !this.datasourceFieldFilter.length,
48406
49658
  onChanged: function (evt) {
48407
- var plusPlaceholder = evt.parentModel.fieldFilter == 'email' ? '@gmail.com' : '';
48408
- evt.formControls['lstDataCheck'].placeholder = "linh123" + plusPlaceholder + "\nnam123" + plusPlaceholder;
49659
+ var _a;
49660
+ evt.formControls['lstDataCheck'].placeholder = (_a = _this.datasourceFieldFilter.find(function (p) { return p.id == evt.parentModel.fieldFilter; })) === null || _a === void 0 ? void 0 : _a.placeholder;
48409
49661
  }
48410
49662
  }),
48411
49663
  new TextAreaControlSchema({
@@ -48428,16 +49680,17 @@
48428
49680
  };
48429
49681
  EntityPickerSearchFormComponent.prototype.onFormInitialized = function (controls) {
48430
49682
  return __awaiter(this, void 0, void 0, function () {
48431
- return __generator(this, function (_a) {
49683
+ return __generator(this, function (_b) {
48432
49684
  return [2 /*return*/];
48433
49685
  });
48434
49686
  });
48435
49687
  };
48436
49688
  EntityPickerSearchFormComponent.prototype.initDataAdd = function (evt) {
48437
49689
  return __awaiter(this, void 0, void 0, function () {
48438
- return __generator(this, function (_a) {
49690
+ return __generator(this, function (_b) {
48439
49691
  if (this.datasourceFieldFilter.length) {
48440
49692
  evt.rootModel.fieldFilter = this.datasourceFieldFilter[0].id;
49693
+ evt.formControls['lstDataCheck'].placeholder = this.datasourceFieldFilter[0].placeholder;
48441
49694
  }
48442
49695
  evt.rootModel.lstDataCheck = undefined;
48443
49696
  evt.rootModel.lstDataNotExist = undefined;
@@ -48447,7 +49700,7 @@
48447
49700
  };
48448
49701
  EntityPickerSearchFormComponent.prototype.modifyDetailData = function (data) {
48449
49702
  return __awaiter(this, void 0, void 0, function () {
48450
- return __generator(this, function (_a) {
49703
+ return __generator(this, function (_b) {
48451
49704
  return [2 /*return*/];
48452
49705
  });
48453
49706
  });
@@ -48455,11 +49708,11 @@
48455
49708
  EntityPickerSearchFormComponent.prototype.customSave = function () {
48456
49709
  return __awaiter(this, void 0, void 0, function () {
48457
49710
  var isValid;
48458
- return __generator(this, function (_a) {
48459
- switch (_a.label) {
49711
+ return __generator(this, function (_b) {
49712
+ switch (_b.label) {
48460
49713
  case 0: return [4 /*yield*/, this.crudForm.validateForm()];
48461
49714
  case 1:
48462
- isValid = _a.sent();
49715
+ isValid = _b.sent();
48463
49716
  if (!isValid)
48464
49717
  return [2 /*return*/];
48465
49718
  this.model.data.lstData = this.model.data.lstDataCheck.split('\n').map(function (p) { return p.trim(); }).filter(function (p) { return p; });
@@ -49327,6 +50580,21 @@
49327
50580
  EntityPickerComponent.prototype.setDisabledState = function (isDisabled) {
49328
50581
  this.disabled = isDisabled;
49329
50582
  };
50583
+ EntityPickerComponent.prototype._view = function (rowData) {
50584
+ return __awaiter(this, void 0, void 0, function () {
50585
+ return __generator(this, function (_a) {
50586
+ switch (_a.label) {
50587
+ case 0:
50588
+ if (!this.control.onViewDetail) return [3 /*break*/, 2];
50589
+ return [4 /*yield*/, this.control.onViewDetail(rowData)];
50590
+ case 1:
50591
+ _a.sent();
50592
+ return [2 /*return*/];
50593
+ case 2: return [2 /*return*/];
50594
+ }
50595
+ });
50596
+ });
50597
+ };
49330
50598
  return EntityPickerComponent;
49331
50599
  }(DataListBase));
49332
50600
  EntityPickerComponent.decorators = [
@@ -56326,11 +57594,14 @@
56326
57594
 
56327
57595
  var UserPickerBoxComponent = /** @class */ (function (_super) {
56328
57596
  __extends(UserPickerBoxComponent, _super);
56329
- function UserPickerBoxComponent(_injector, _userV5Service, _organizationService, _coCauToChucService) {
56330
- var _this = _super.call(this, _injector) || this;
57597
+ function UserPickerBoxComponent(_injector, _userV5Service, _organizationService, _coCauToChucService, _moduleConfigService) {
57598
+ var _this = this;
57599
+ var _a, _b, _c;
57600
+ _this = _super.call(this, _injector) || this;
56331
57601
  _this._userV5Service = _userV5Service;
56332
57602
  _this._organizationService = _organizationService;
56333
57603
  _this._coCauToChucService = _coCauToChucService;
57604
+ _this._moduleConfigService = _moduleConfigService;
56334
57605
  _this.multiple = false;
56335
57606
  _this.disabled = false;
56336
57607
  _this.enableCaching = true;
@@ -56359,6 +57630,10 @@
56359
57630
  _this.rootFilter = {};
56360
57631
  _this.treeLoading = false;
56361
57632
  _this.datasourceFieldFilter = DatasourceFieldFilter;
57633
+ var _environment = _moduleConfigService.getConfig().environment;
57634
+ if (((_b = (_a = _environment.cauHinhNghiepVu) === null || _a === void 0 ? void 0 : _a.datasourceFieldFilterCanBo) === null || _b === void 0 ? void 0 : _b.length) > 0) {
57635
+ _this.datasourceFieldFilter = (_c = _environment.cauHinhNghiepVu) === null || _c === void 0 ? void 0 : _c.datasourceFieldFilterCanBo;
57636
+ }
56362
57637
  return _this;
56363
57638
  }
56364
57639
  UserPickerBoxComponent.prototype.ngOnInit = function () {
@@ -56380,7 +57655,7 @@
56380
57655
  UserPickerBoxComponent.prototype.nodeSelect = function (event) {
56381
57656
  return __awaiter(this, void 0, void 0, function () {
56382
57657
  var target;
56383
- return __generator(this, function (_a) {
57658
+ return __generator(this, function (_d) {
56384
57659
  target = event.originalEvent.target;
56385
57660
  if (target.classList.contains('custom-node')) {
56386
57661
  this.selectedNodeData = target.id;
@@ -56411,19 +57686,19 @@
56411
57686
  UserPickerBoxComponent.prototype.initTree = function () {
56412
57687
  return __awaiter(this, void 0, void 0, function () {
56413
57688
  var rs;
56414
- return __generator(this, function (_a) {
56415
- switch (_a.label) {
57689
+ return __generator(this, function (_d) {
57690
+ switch (_d.label) {
56416
57691
  case 0:
56417
57692
  if (!this.controlSetting.lazyLoadOrganization) return [3 /*break*/, 2];
56418
57693
  return [4 /*yield*/, this._organizationService.getOrganizationByParentId(this._commonService.guidEmpty())];
56419
57694
  case 1:
56420
- rs = _a.sent();
57695
+ rs = _d.sent();
56421
57696
  this.rootTreeNode = rs.data;
56422
57697
  this.loadTree(this.rootTreeNode[0], true);
56423
57698
  return [3 /*break*/, 3];
56424
57699
  case 2:
56425
57700
  this.loadTree(null);
56426
- _a.label = 3;
57701
+ _d.label = 3;
56427
57702
  case 3: return [2 /*return*/];
56428
57703
  }
56429
57704
  });
@@ -56456,7 +57731,7 @@
56456
57731
  }
56457
57732
  else {
56458
57733
  this._organizationService.getOrganizationTree(this.controlSetting.parentOrgCode).then(function (result) { return __awaiter(_this, void 0, void 0, function () {
56459
- return __generator(this, function (_a) {
57734
+ return __generator(this, function (_d) {
56460
57735
  this.rootTreeNode = result.data;
56461
57736
  this.rootTreeNode[0].expanded = true;
56462
57737
  this.treeLoading = true;
@@ -56476,15 +57751,15 @@
56476
57751
  UserPickerBoxComponent.prototype.modifyFilter = function (filters) {
56477
57752
  return __awaiter(this, void 0, void 0, function () {
56478
57753
  var _this = this;
56479
- return __generator(this, function (_a) {
56480
- switch (_a.label) {
57754
+ return __generator(this, function (_d) {
57755
+ switch (_d.label) {
56481
57756
  case 0:
56482
57757
  Object.keys(this.rootFilter).forEach(function (item) {
56483
57758
  filters.push(_this.rootFilter[item]);
56484
57759
  });
56485
57760
  return [4 /*yield*/, appendDefaultFilter(filters, this.controlSetting.defaultFilters)];
56486
57761
  case 1:
56487
- _a.sent();
57762
+ _d.sent();
56488
57763
  return [2 /*return*/];
56489
57764
  }
56490
57765
  });
@@ -56528,7 +57803,8 @@
56528
57803
  { type: i0.Injector },
56529
57804
  { type: UserV5Service },
56530
57805
  { type: OrganizationService },
56531
- { type: CoCauToChucTestService }
57806
+ { type: CoCauToChucTestService },
57807
+ { type: ModuleConfigService }
56532
57808
  ]; };
56533
57809
  UserPickerBoxComponent.propDecorators = {
56534
57810
  multiple: [{ type: i0.Input }],
@@ -58190,6 +59466,7 @@
58190
59466
 
58191
59467
  // 1
58192
59468
  // 2
59469
+ // 3
58193
59470
  function coreDeclaration() {
58194
59471
  return [
58195
59472
  AddressComponent,