tnx-shared 5.3.423 → 5.3.425

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.
@@ -18023,7 +18023,7 @@
18023
18023
  CrudFormComponent.decorators = [
18024
18024
  { type: i0.Component, args: [{
18025
18025
  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>",
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 [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
18027
  providers: [ComponentContextService],
18028
18028
  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
18029
  },] }
@@ -25905,8 +25905,8 @@
25905
25905
  if (dialog) {
25906
25906
  dialog.buttonTemplateInput = compRef.instance.buttonTemplate;
25907
25907
  }
25908
- compRef.workflows = workflowSetting.workflows;
25909
- compRef.defaultWorkflow = workflowSetting.workflowCode;
25908
+ compRef.instance.workflows = workflowSetting.workflows;
25909
+ compRef.instance.defaultWorkflow = workflowSetting.workflowCode;
25910
25910
  compRef.instance.onSaved.subscribe(function (event) { return _this.handleStartWorkflowFromDialog(event); });
25911
25911
  compRef.instance.onCancel.subscribe(function (event) { return _this.startWorkflowModel.showEditForm = false; });
25912
25912
  _h.label = 14;
@@ -38026,13 +38026,15 @@
38026
38026
 
38027
38027
  var FileUploadComponent = /** @class */ (function (_super) {
38028
38028
  __extends(FileUploadComponent, _super);
38029
- function FileUploadComponent(_fileObjectService, _notifierService, _downloadLinkService, _moduleConfigService, _fileExplorerService, _injector) {
38029
+ function FileUploadComponent(_fileObjectService, _notifierService, _downloadLinkService, _moduleConfigService, _fileExplorerService, _deviceDetectorService, _userService, _injector) {
38030
38030
  var _this = _super.call(this, _injector) || this;
38031
38031
  _this._fileObjectService = _fileObjectService;
38032
38032
  _this._notifierService = _notifierService;
38033
38033
  _this._downloadLinkService = _downloadLinkService;
38034
38034
  _this._moduleConfigService = _moduleConfigService;
38035
38035
  _this._fileExplorerService = _fileExplorerService;
38036
+ _this._deviceDetectorService = _deviceDetectorService;
38037
+ _this._userService = _userService;
38036
38038
  _this.chooseLabel = 'Chọn';
38037
38039
  _this.readonly = true;
38038
38040
  _this.showDeleteFile = true;
@@ -38046,6 +38048,7 @@
38046
38048
  _this.invalidFileLimitMessageDetail = 'tối đa {0} file.';
38047
38049
  _this.sharedFolderType = exports.SharedFolderType.Tempt;
38048
38050
  _this.control = new FileUploadControlSchema();
38051
+ _this.parentSetting = new CrudFormSetting();
38049
38052
  _this.onInit = new i0.EventEmitter();
38050
38053
  _this.onSelect = new i0.EventEmitter();
38051
38054
  _this.onRemove = new i0.EventEmitter();
@@ -38066,7 +38069,27 @@
38066
38069
  show: false,
38067
38070
  }
38068
38071
  };
38072
+ _this.formIds = {
38073
+ createFolder: 'createFolder',
38074
+ renameFile: 'renameFile',
38075
+ shareFile: 'shareFile',
38076
+ shareFolder: 'shareFolder',
38077
+ fileViewer: 'fileViewer',
38078
+ fileVersionList: 'fileVersionList',
38079
+ signatureDetail: 'signatureDetail',
38080
+ kySoSim: 'kySoSim',
38081
+ viewDetail: 'viewDetail'
38082
+ };
38083
+ _this.signatureFormModel = {
38084
+ formData: new CrudFormData(),
38085
+ show: false,
38086
+ popupSize: new PopupSize({
38087
+ width: 600,
38088
+ height: 400
38089
+ })
38090
+ };
38069
38091
  _this.environment = _this._moduleConfigService.getConfig().environment;
38092
+ _this._moduleConfig = _moduleConfigService.getConfig();
38070
38093
  return _this;
38071
38094
  }
38072
38095
  FileUploadComponent.prototype.writeValue = function (obj) {
@@ -38086,22 +38109,34 @@
38086
38109
  if (this.control.isPublic != null && this.control.isPublic != undefined) {
38087
38110
  this.isPublic = this.control.isPublic;
38088
38111
  }
38112
+ this.forms[this.formIds.signatureDetail] = {
38113
+ header: 'Thông tin chữ ký số',
38114
+ show: false,
38115
+ };
38089
38116
  this.onInit.emit(this);
38090
38117
  };
38091
38118
  FileUploadComponent.prototype.getFile = function () {
38092
38119
  return __awaiter(this, void 0, void 0, function () {
38093
38120
  var fileObject;
38094
- return __generator(this, function (_a) {
38095
- switch (_a.label) {
38121
+ var _this = this;
38122
+ return __generator(this, function (_b) {
38123
+ switch (_b.label) {
38096
38124
  case 0:
38097
38125
  if (!this.fileId) return [3 /*break*/, 2];
38098
38126
  this.loading = true;
38099
38127
  this.notification = 'Đang đính kèm...';
38100
38128
  return [4 /*yield*/, this._fileObjectService.getDetail(this.fileId)];
38101
38129
  case 1:
38102
- fileObject = (_a.sent()).data;
38130
+ fileObject = (_b.sent()).data;
38103
38131
  if (fileObject) {
38104
38132
  this.selectedFileName = fileObject.name;
38133
+ this.selectedFile = fileObject;
38134
+ this._fileExplorerService.getSignatureInfoByFileId(this.fileId).then(function (rs) {
38135
+ var _a;
38136
+ if (rs.success && ((_a = rs.data) === null || _a === void 0 ? void 0 : _a.length)) {
38137
+ _this.selectedFile.signatures = rs.data;
38138
+ }
38139
+ });
38105
38140
  this.hasFile = true;
38106
38141
  this.loading = false;
38107
38142
  this.notification = null;
@@ -38110,7 +38145,7 @@
38110
38145
  else {
38111
38146
  this.hasFile = false;
38112
38147
  }
38113
- _a.label = 2;
38148
+ _b.label = 2;
38114
38149
  case 2:
38115
38150
  this.control.hasFile = this.hasFile;
38116
38151
  return [2 /*return*/];
@@ -38120,11 +38155,76 @@
38120
38155
  };
38121
38156
  FileUploadComponent.prototype.setMenu = function () {
38122
38157
  var _this = this;
38123
- this.menu = [{
38158
+ this.menu = [
38159
+ {
38124
38160
  label: 'Tải về', icon: 'fas fa-download', command: function () {
38125
38161
  _this.onDownloadFile();
38126
38162
  }
38127
- }];
38163
+ },
38164
+ {
38165
+ label: 'Ký số cá nhân (SIM)',
38166
+ icon: 'fas fa-sim-card',
38167
+ command: function () {
38168
+ _this.signKySimFile(_this.selectedFile);
38169
+ },
38170
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
38171
+ && !this.parentSetting.hiddenKySoSimCaNhan),
38172
+ },
38173
+ {
38174
+ label: 'Ký số SmartCA',
38175
+ icon: 'fas fa-signature',
38176
+ command: function () {
38177
+ _this.signatureFormModel.show = true;
38178
+ },
38179
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
38180
+ && !this.parentSetting.hiddenKySoSmartCA),
38181
+ },
38182
+ {
38183
+ label: 'Ký số cá nhân (USB)', icon: 'fas fa-signature',
38184
+ command: function () {
38185
+ _this.signFile(_this.selectedFile);
38186
+ },
38187
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
38188
+ && this._deviceDetectorService.isDesktop()
38189
+ && !this.parentSetting.hiddenKySoUsbCaNhan),
38190
+ },
38191
+ {
38192
+ label: 'Ký số VNPTCA', icon: 'fas fa-signature',
38193
+ command: function () {
38194
+ _this.signVNPTCA(_this.selectedFile);
38195
+ },
38196
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
38197
+ && this._deviceDetectorService.isDesktop()
38198
+ && !this.parentSetting.hiddenKySoVNPTCA),
38199
+ },
38200
+ {
38201
+ label: 'Bút phê', icon: 'fas fa-comment-dots',
38202
+ command: function () {
38203
+ _this.addComment(_this.selectedFile);
38204
+ },
38205
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
38206
+ && this._deviceDetectorService.isDesktop()
38207
+ && !this.parentSetting.hiddenButPhe),
38208
+ },
38209
+ {
38210
+ label: 'Bút phê và ký', icon: 'fas fa-comment-medical',
38211
+ command: function () {
38212
+ _this.addCommentAndSign(_this.selectedFile);
38213
+ },
38214
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
38215
+ && this._deviceDetectorService.isDesktop()
38216
+ && !this.parentSetting.hiddenButPhe),
38217
+ },
38218
+ {
38219
+ label: 'Ký số đơn vị (USB)', icon: 'fas fa-signature',
38220
+ command: function () {
38221
+ _this.signFileDonVi(_this.selectedFile);
38222
+ },
38223
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
38224
+ && this._deviceDetectorService.isDesktop()
38225
+ && !this.parentSetting.hiddenKySoDonVi),
38226
+ },
38227
+ ];
38128
38228
  };
38129
38229
  FileUploadComponent.prototype.showContextMenu = function (evt) {
38130
38230
  this.contextMenu.toggle(evt);
@@ -38135,6 +38235,11 @@
38135
38235
  this.file.basicFileInput.nativeElement.click();
38136
38236
  }
38137
38237
  };
38238
+ FileUploadComponent.prototype.viewListSign = function (e, signatures) {
38239
+ e.stopPropagation();
38240
+ this.forms[this.formIds.signatureDetail].show = true;
38241
+ this.model.advanceData = signatures;
38242
+ };
38138
38243
  FileUploadComponent.prototype.onSelectFile = function (evt) {
38139
38244
  var _this = this;
38140
38245
  if (evt.errorFiles && evt.errorFiles.length > 0) {
@@ -38164,6 +38269,12 @@
38164
38269
  _this.writeValue(rs.data);
38165
38270
  _this.onChangeBase(rs.data);
38166
38271
  _this.control.hasFile = _this.hasFile;
38272
+ _this._fileExplorerService.getSignatureInfoByFileId(rs.data).then(function (rs) {
38273
+ var _a;
38274
+ if (rs.success && ((_a = rs.data) === null || _a === void 0 ? void 0 : _a.length)) {
38275
+ _this.selectedFile.signatures = rs.data;
38276
+ }
38277
+ });
38167
38278
  _this.onSelect.emit();
38168
38279
  _this.onChanged.emit(rs.data);
38169
38280
  }
@@ -38213,18 +38324,18 @@
38213
38324
  FileUploadComponent.prototype.openFileViewer = function () {
38214
38325
  return __awaiter(this, void 0, void 0, function () {
38215
38326
  var fileBinary, fileObject, fileName;
38216
- return __generator(this, function (_a) {
38217
- switch (_a.label) {
38327
+ return __generator(this, function (_b) {
38328
+ switch (_b.label) {
38218
38329
  case 0: return [4 /*yield*/, this._fileExplorerService.checkPhysicalFile(this.fileId)];
38219
38330
  case 1:
38220
- fileBinary = _a.sent();
38331
+ fileBinary = _b.sent();
38221
38332
  if (!fileBinary.success) {
38222
38333
  this._notifierService.showWarning('File không tồn tại, vui lòng liên hệ quản trị viên');
38223
38334
  return [2 /*return*/];
38224
38335
  }
38225
38336
  return [4 /*yield*/, this._fileObjectService.getDetail(this.fileId)];
38226
38337
  case 2:
38227
- fileObject = _a.sent();
38338
+ fileObject = _b.sent();
38228
38339
  fileName = '';
38229
38340
  if (!fileObject.success) {
38230
38341
  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,143 +38353,646 @@
38242
38353
  });
38243
38354
  });
38244
38355
  };
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);
38356
+ FileUploadComponent.prototype.signFileSmartCA = function (dataKySo) {
38357
+ var _a;
38358
+ return __awaiter(this, void 0, void 0, function () {
38359
+ var sourceFileId, rsConvert, e_1;
38360
+ return __generator(this, function (_b) {
38361
+ switch (_b.label) {
38362
+ case 0:
38363
+ this.signatureFormModel.show = false;
38364
+ sourceFileId = this.selectedFile.id;
38365
+ if (!this._fileExplorerService.needConvertBeforeSign(this.selectedFile.name)) return [3 /*break*/, 4];
38366
+ _b.label = 1;
38367
+ case 1:
38368
+ _b.trys.push([1, 3, , 4]);
38369
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
38370
+ instanceId: sourceFileId,
38371
+ name: this._fileExplorerService.changeFileExtension(this.selectedFile.name, 'pdf'),
38372
+ folderInstanceId: (_a = this.selectedFile.parentFolderId) !== null && _a !== void 0 ? _a : this._commonService.guid(),
38373
+ ownerType: this._userService.getCurrentUser().userId.toString(),
38374
+ })];
38375
+ case 2:
38376
+ rsConvert = _b.sent();
38377
+ if (!rsConvert || !rsConvert.success) {
38378
+ 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");
38379
+ return [2 /*return*/];
38380
+ }
38381
+ else {
38382
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + this.selectedFile.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
38383
+ sourceFileId = rsConvert.data;
38384
+ }
38385
+ return [3 /*break*/, 4];
38386
+ case 3:
38387
+ e_1 = _b.sent();
38388
+ 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");
38389
+ return [2 /*return*/];
38390
+ case 4:
38391
+ if (!dataKySo) {
38392
+ this._notifierService.showWarning('Người dùng chưa cấu hình thông tin ký số');
38393
+ }
38394
+ debugger;
38395
+ this.forms.fileViewer.formData.data = {
38396
+ fileId: sourceFileId,
38397
+ isFileVersion: false,
38398
+ fileName: this.selectedFile.name,
38399
+ // service: this.serviceCode,
38400
+ // entity: this.entity,
38401
+ // entityKey: this.entityKey,
38402
+ fileBase64Content: dataKySo.fileBase64Content,
38403
+ userChuKySoId: dataKySo.id,
38404
+ showKySoButton: true,
38405
+ width: dataKySo.width,
38406
+ height: dataKySo.height,
38407
+ };
38408
+ this.forms.fileViewer.show = true;
38409
+ return [2 /*return*/];
38343
38410
  }
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: ''
38411
+ });
38365
38412
  });
38366
38413
  };
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
- }
38414
+ FileUploadComponent.prototype.signKySimFile = function (file) {
38415
+ this.forms.kySoSim.show = true;
38416
+ this.model.advanceData = file;
38417
+ };
38418
+ FileUploadComponent.prototype.signFile = function (file) {
38419
+ var _this = this;
38420
+ 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 () {
38421
+ var sourceFileId, sourceFile_1, rsConvert, e_2;
38422
+ var _this = this;
38423
+ return __generator(this, function (_b) {
38424
+ switch (_b.label) {
38425
+ case 0:
38426
+ if (!rs) return [3 /*break*/, 5];
38427
+ sourceFileId = file.id;
38428
+ sourceFile_1 = file;
38429
+ if (!this._fileExplorerService.needConvertBeforeSign(file.name)) return [3 /*break*/, 4];
38430
+ _b.label = 1;
38431
+ case 1:
38432
+ _b.trys.push([1, 3, , 4]);
38433
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
38434
+ instanceId: sourceFileId,
38435
+ name: this._fileExplorerService.changeFileExtension(file.name, 'pdf'),
38436
+ folderInstanceId: file.parentFolderId,
38437
+ ownerType: this._userService.getCurrentUser().userId.toString(),
38438
+ })];
38439
+ case 2:
38440
+ rsConvert = _b.sent();
38441
+ if (!rsConvert || !rsConvert.success) {
38442
+ 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");
38443
+ return [2 /*return*/];
38444
+ }
38445
+ else {
38446
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
38447
+ sourceFileId = rsConvert.data;
38448
+ sourceFile_1 = { id: sourceFileId };
38449
+ this.getFile();
38450
+ }
38451
+ return [3 /*break*/, 4];
38452
+ case 3:
38453
+ e_2 = _b.sent();
38454
+ 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");
38455
+ return [2 /*return*/];
38456
+ case 4:
38457
+ this._fileExplorerService.generateLinkDownload({
38458
+ fileId: sourceFileId,
38459
+ }).then(function (rs) {
38460
+ var url = _this._downloadLinkService.getDownloadForSignUrl(rs.data);
38461
+ var prms = {};
38462
+ prms['FileUploadHandler'] = _this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + _this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile";
38463
+ prms['SessionId'] = '';
38464
+ prms['FileName'] = url;
38465
+ // tslint:disable-next-line: variable-name
38466
+ var json_prms = JSON.stringify(prms);
38467
+ vgca_sign_approved(json_prms, function (result) {
38468
+ var resultObj = JSON.parse(result);
38469
+ if (resultObj.FileServer != '') {
38470
+ _this._fileExplorerService.saveSignedFile({
38471
+ sourceFile: sourceFile_1,
38472
+ tempFileId: resultObj.FileServer,
38473
+ }).then(function (rss) {
38474
+ _this.getFile();
38475
+ _this._notifierService.showSuccess('Ký số thành công');
38476
+ });
38477
+ }
38478
+ });
38479
+ });
38480
+ _b.label = 5;
38481
+ case 5: return [2 /*return*/];
38482
+ }
38483
+ });
38484
+ }); });
38485
+ };
38486
+ FileUploadComponent.prototype.signVNPTCA = function (item) {
38487
+ var _a;
38488
+ return __awaiter(this, void 0, void 0, function () {
38489
+ var sourceFileId, rsConvert, e_3, dataInput, sigOptions, dataJS, data, e_4;
38490
+ return __generator(this, function (_b) {
38491
+ switch (_b.label) {
38492
+ case 0:
38493
+ sourceFileId = item.id;
38494
+ if (!this._fileExplorerService.needConvertBeforeSign(item.name)) return [3 /*break*/, 4];
38495
+ _b.label = 1;
38496
+ case 1:
38497
+ _b.trys.push([1, 3, , 4]);
38498
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
38499
+ instanceId: item.id,
38500
+ name: this._fileExplorerService.changeFileExtension(item.name, 'pdf'),
38501
+ folderInstanceId: (_a = item.parentFolderId) !== null && _a !== void 0 ? _a : this._commonService.guid(),
38502
+ ownerType: this._userService.getCurrentUser().userId.toString(),
38503
+ })];
38504
+ case 2:
38505
+ rsConvert = _b.sent();
38506
+ if (!rsConvert || !rsConvert.success) {
38507
+ 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");
38508
+ return [2 /*return*/];
38509
+ }
38510
+ else {
38511
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + item.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
38512
+ sourceFileId = rsConvert.data;
38513
+ this.model.selectedItem.id = rsConvert.data;
38514
+ this.getFile();
38515
+ }
38516
+ return [3 /*break*/, 4];
38517
+ case 3:
38518
+ e_3 = _b.sent();
38519
+ 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");
38520
+ return [2 /*return*/];
38521
+ case 4: return [4 /*yield*/, this._fileExplorerService.getBase64FromFileId(sourceFileId)];
38522
+ case 5:
38523
+ dataInput = (_b.sent()).split(',')[1];
38524
+ sigOptions = new PdfSigner();
38525
+ sigOptions.page = 1;
38526
+ sigOptions.AdvancedCustom = true;
38527
+ sigOptions.SigType = 1;
38528
+ dataJS = {
38529
+ data: dataInput,
38530
+ type: 'pdf',
38531
+ sigOptions: JSON.stringify(sigOptions)
38532
+ };
38533
+ _b.label = 6;
38534
+ case 6:
38535
+ _b.trys.push([6, 8, , 9]);
38536
+ return [4 /*yield*/, vnpt_plugin.signArrDataAdvanced([JSON.stringify(dataJS)], "", false)];
38537
+ case 7:
38538
+ data = _b.sent();
38539
+ this.handeResult(data);
38540
+ return [3 /*break*/, 9];
38541
+ case 8:
38542
+ e_4 = _b.sent();
38543
+ console.log(e_4);
38544
+ return [3 /*break*/, 9];
38545
+ case 9: return [2 /*return*/];
38546
+ }
38547
+ });
38548
+ });
38549
+ };
38550
+ FileUploadComponent.prototype.handeResult = function (data) {
38551
+ var _this = this;
38552
+ if (typeof JSON.parse(data).code !== 'undefined') {
38553
+ var jsOb = JSON.parse(data);
38554
+ }
38555
+ else {
38556
+ var jsOb = JSON.parse(JSON.parse(data)[0]);
38557
+ }
38558
+ switch (jsOb.code) {
38559
+ case 0:
38560
+ this._fileExplorerService.kySimSaveSignedFile({
38561
+ sourceFile: this.model.selectedItem,
38562
+ fileContents: jsOb.data,
38563
+ }).then(function (rss) {
38564
+ _this._notifierService.showSuccess("Ký thành công");
38565
+ _this.getFile();
38566
+ });
38567
+ break;
38568
+ case 1:
38569
+ this._notifierService.showWarning("Dữ liệu đầu vào không đúng định dạng");
38570
+ break;
38571
+ case 2:
38572
+ this._notifierService.showWarning("Không lấy được thông tin chứng thư số");
38573
+ break;
38574
+ case 3:
38575
+ this._notifierService.showWarning("Có lỗi trong quá trình ký số");
38576
+ break;
38577
+ case 4:
38578
+ this._notifierService.showSuccess("Chứng thư số không có khóa bí mật");
38579
+ break;
38580
+ case 5:
38581
+ this._notifierService.showSuccess("Lỗi không xác định");
38582
+ break;
38583
+ case 6:
38584
+ this._notifierService.showSuccess("Ký pdf: không tìm thấy tham số số trang cần ký");
38585
+ break;
38586
+ case 7:
38587
+ this._notifierService.showSuccess("Ký pdf: trang đặt chữ ký không tồn tại");
38588
+ break;
38589
+ case 8:
38590
+ this._notifierService.showSuccess("Ký xml: không tìm thấy thẻ ký số");
38591
+ break;
38592
+ case 9:
38593
+ this._notifierService.showSuccess("Ký pdf: không tìm thấy id của thẻ ký số");
38594
+ break;
38595
+ case 10:
38596
+ this._notifierService.showSuccess("Dữ liệu ký đã chứa một hoặc nhiều chữ ký không hợp lệ");
38597
+ break;
38598
+ case 11:
38599
+ this._notifierService.showSuccess("Người dùng hủy bỏ");
38600
+ break;
38601
+ case 13:
38602
+ this._notifierService.showWarning("Dữ liệu ký rỗng");
38603
+ break;
38604
+ default:
38605
+ this._notifierService.showSuccess("Lỗi không xác định");
38606
+ break;
38607
+ }
38608
+ };
38609
+ FileUploadComponent.prototype.addComment = function (file) {
38610
+ var _this = this;
38611
+ 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 () {
38612
+ var sourceFileId, sourceFile_2, rsConvert, e_5;
38613
+ var _this = this;
38614
+ return __generator(this, function (_b) {
38615
+ switch (_b.label) {
38616
+ case 0:
38617
+ if (!rs) return [3 /*break*/, 5];
38618
+ sourceFileId = file.id;
38619
+ sourceFile_2 = file;
38620
+ if (!this._fileExplorerService.needConvertBeforeSign(file.name)) return [3 /*break*/, 4];
38621
+ _b.label = 1;
38622
+ case 1:
38623
+ _b.trys.push([1, 3, , 4]);
38624
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
38625
+ instanceId: sourceFileId,
38626
+ name: this._fileExplorerService.changeFileExtension(file.name, 'pdf'),
38627
+ folderInstanceId: file.parentFolderId,
38628
+ ownerType: this._userService.getCurrentUser().userId.toString(),
38629
+ })];
38630
+ case 2:
38631
+ rsConvert = _b.sent();
38632
+ if (!rsConvert || !rsConvert.success) {
38633
+ 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");
38634
+ return [2 /*return*/];
38635
+ }
38636
+ else {
38637
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
38638
+ sourceFileId = rsConvert.data;
38639
+ sourceFile_2 = { id: sourceFileId };
38640
+ this.getFile();
38641
+ }
38642
+ return [3 /*break*/, 4];
38643
+ case 3:
38644
+ e_5 = _b.sent();
38645
+ 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");
38646
+ return [2 /*return*/];
38647
+ case 4:
38648
+ this._fileExplorerService.generateLinkDownload({
38649
+ fileId: sourceFileId,
38650
+ }).then(function (rs) {
38651
+ var url = _this._downloadLinkService.getDownloadForSignUrl(rs.data);
38652
+ var prms = {};
38653
+ prms['FileUploadHandler'] = _this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + _this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile";
38654
+ prms['SessionId'] = '';
38655
+ prms['FileName'] = url;
38656
+ // tslint:disable-next-line: variable-name
38657
+ var json_prms = JSON.stringify(prms);
38658
+ vgca_comment(json_prms, function (result) {
38659
+ var resultObj = JSON.parse(result);
38660
+ if (resultObj.FileServer != '') {
38661
+ _this._fileExplorerService.saveSignedFile({
38662
+ sourceFile: sourceFile_2,
38663
+ tempFileId: resultObj.FileServer,
38664
+ }).then(function (rss) {
38665
+ _this.getFile();
38666
+ _this._notifierService.showSuccess('Tạo bút phê thành công');
38667
+ });
38668
+ }
38669
+ });
38670
+ });
38671
+ _b.label = 5;
38672
+ case 5: return [2 /*return*/];
38673
+ }
38674
+ });
38675
+ }); });
38676
+ };
38677
+ FileUploadComponent.prototype.addCommentAndSign = function (file) {
38678
+ return __awaiter(this, void 0, void 0, function () {
38679
+ var rs, sourceFileId, sourceFile, rsConvert, e_6, downloadLink, url, prms, json_prms_1, commentResult, resultObj, downloadLink2, url2, prms2, json_prms2_1, signResult, signResultObj;
38680
+ return __generator(this, function (_b) {
38681
+ switch (_b.label) {
38682
+ 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?')];
38683
+ case 1:
38684
+ rs = _b.sent();
38685
+ if (!rs) return [3 /*break*/, 11];
38686
+ sourceFileId = file.id;
38687
+ sourceFile = file;
38688
+ if (!this._fileExplorerService.needConvertBeforeSign(file.name)) return [3 /*break*/, 5];
38689
+ _b.label = 2;
38690
+ case 2:
38691
+ _b.trys.push([2, 4, , 5]);
38692
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
38693
+ instanceId: sourceFileId,
38694
+ name: this._fileExplorerService.changeFileExtension(file.name, 'pdf'),
38695
+ folderInstanceId: file.parentFolderId,
38696
+ ownerType: this._userService.getCurrentUser().userId.toString(),
38697
+ })];
38698
+ case 3:
38699
+ rsConvert = _b.sent();
38700
+ if (!rsConvert || !rsConvert.success) {
38701
+ 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");
38702
+ return [2 /*return*/];
38703
+ }
38704
+ else {
38705
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
38706
+ sourceFileId = rsConvert.data;
38707
+ sourceFile = { id: sourceFileId };
38708
+ this.getFile();
38709
+ }
38710
+ return [3 /*break*/, 5];
38711
+ case 4:
38712
+ e_6 = _b.sent();
38713
+ 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");
38714
+ return [2 /*return*/];
38715
+ case 5: return [4 /*yield*/, this._fileExplorerService.generateLinkDownload({
38716
+ fileId: sourceFileId,
38717
+ })];
38718
+ case 6:
38719
+ downloadLink = _b.sent();
38720
+ url = this._downloadLinkService.getDownloadForSignUrl(downloadLink.data);
38721
+ prms = {
38722
+ FileUploadHandler: this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile",
38723
+ SessionId: '',
38724
+ FileName: url
38725
+ };
38726
+ json_prms_1 = JSON.stringify(prms);
38727
+ return [4 /*yield*/, new Promise(function (resolve) {
38728
+ vgca_comment(json_prms_1, function (result) { return resolve(result); });
38729
+ })];
38730
+ case 7:
38731
+ commentResult = _b.sent();
38732
+ resultObj = JSON.parse(commentResult);
38733
+ return [4 /*yield*/, this._fileExplorerService.generateLinkDownload({
38734
+ fileId: resultObj.FileServer,
38735
+ })];
38736
+ case 8:
38737
+ downloadLink2 = _b.sent();
38738
+ url2 = this._downloadLinkService.getDownloadForSignUrl(downloadLink2.data);
38739
+ prms2 = {
38740
+ FileUploadHandler: this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile",
38741
+ SessionId: '',
38742
+ FileName: url2
38743
+ };
38744
+ json_prms2_1 = JSON.stringify(prms2);
38745
+ return [4 /*yield*/, new Promise(function (resolve) {
38746
+ vgca_sign_approved(json_prms2_1, function (result) { return resolve(result); });
38747
+ })];
38748
+ case 9:
38749
+ signResult = _b.sent();
38750
+ signResultObj = JSON.parse(signResult);
38751
+ if (!(signResultObj.FileServer != '')) return [3 /*break*/, 11];
38752
+ return [4 /*yield*/, this._fileExplorerService.saveSignedFile({
38753
+ sourceFile: sourceFile,
38754
+ tempFileId: signResultObj.FileServer,
38755
+ })];
38756
+ case 10:
38757
+ _b.sent();
38758
+ this.getFile();
38759
+ this._notifierService.showSuccess('Tạo bút phê và ký thành công');
38760
+ _b.label = 11;
38761
+ case 11: return [2 /*return*/];
38762
+ }
38763
+ });
38764
+ });
38765
+ };
38766
+ FileUploadComponent.prototype.signFileDonVi = function (file) {
38767
+ var _this = this;
38768
+ this._notifierService
38769
+ .showConfirm('Bạn có chắc chắn muốn ký số đơn vị văn bản này?')
38770
+ .then(function (rs) { return __awaiter(_this, void 0, void 0, function () {
38771
+ var sourceFileId, sourceFile_3, rsConvert, e_7;
38772
+ var _this = this;
38773
+ return __generator(this, function (_b) {
38774
+ switch (_b.label) {
38775
+ case 0:
38776
+ if (!rs) return [3 /*break*/, 5];
38777
+ sourceFileId = file.id;
38778
+ sourceFile_3 = file;
38779
+ if (!this._fileExplorerService.needConvertBeforeSign(file.name)) return [3 /*break*/, 4];
38780
+ _b.label = 1;
38781
+ case 1:
38782
+ _b.trys.push([1, 3, , 4]);
38783
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
38784
+ instanceId: sourceFileId,
38785
+ name: this._fileExplorerService.changeFileExtension(file.name, 'pdf'),
38786
+ folderInstanceId: file.parentFolderId,
38787
+ ownerType: this._userService.getCurrentUser().userId.toString(),
38788
+ })];
38789
+ case 2:
38790
+ rsConvert = _b.sent();
38791
+ if (!rsConvert || !rsConvert.success) {
38792
+ 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");
38793
+ return [2 /*return*/];
38794
+ }
38795
+ else {
38796
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
38797
+ this.getFile();
38798
+ sourceFileId = rsConvert.data;
38799
+ sourceFile_3 = { id: sourceFileId };
38800
+ }
38801
+ return [3 /*break*/, 4];
38802
+ case 3:
38803
+ e_7 = _b.sent();
38804
+ 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");
38805
+ return [2 /*return*/];
38806
+ case 4:
38807
+ this._fileExplorerService
38808
+ .generateLinkDownload({
38809
+ isFileVersion: false,
38810
+ fileId: sourceFileId,
38811
+ })
38812
+ .then(function (rs) {
38813
+ var url = _this._downloadLinkService.getDownloadForSignUrl(rs.data);
38814
+ var prms = {};
38815
+ prms['FileUploadHandler'] = _this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + _this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile";
38816
+ prms['SessionId'] = '';
38817
+ prms['FileName'] = url;
38818
+ // Truyền số, ngày ký số phòng ban nếu cần
38819
+ var that = _this;
38820
+ if (that.control && that.control.dataKySoDonVi) {
38821
+ var dataKySoDonVi = that.control.dataKySoDonVi();
38822
+ if (dataKySoDonVi) {
38823
+ // lấy số DocNumber
38824
+ if (dataKySoDonVi.docNumber) {
38825
+ prms['DocNumber'] = dataKySoDonVi.docNumber;
38826
+ }
38827
+ // lấy ngày ban hành vb đi
38828
+ if (dataKySoDonVi.issuedDate) {
38829
+ prms['IssuedDate'] = dataKySoDonVi.issuedDate;
38830
+ }
38831
+ }
38832
+ }
38833
+ // tslint:disable-next-line: variable-name
38834
+ var json_prms = JSON.stringify(prms);
38835
+ vgca_sign_issued(json_prms, function (result) {
38836
+ var resultObj = JSON.parse(result);
38837
+ if (resultObj.FileServer != '') {
38838
+ _this._fileExplorerService
38839
+ .saveSignedFile({
38840
+ sourceFile: sourceFile_3,
38841
+ tempFileId: resultObj.FileServer,
38842
+ })
38843
+ .then(function (rss) {
38844
+ _this.getFile();
38845
+ _this._notifierService.showSuccess('Ký số thành công');
38846
+ });
38847
+ }
38848
+ });
38849
+ });
38850
+ _b.label = 5;
38851
+ case 5: return [2 /*return*/];
38852
+ }
38853
+ });
38854
+ }); });
38855
+ };
38856
+ return FileUploadComponent;
38857
+ }(ComponentBase));
38858
+ FileUploadComponent.decorators = [
38859
+ { type: i0.Component, args: [{
38860
+ selector: 'file-upload',
38861
+ 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>",
38862
+ providers: [
38863
+ {
38864
+ provide: forms.NG_VALUE_ACCESSOR,
38865
+ useExisting: i0.forwardRef(function () { return FileUploadComponent; }),
38866
+ multi: true
38867
+ },
38868
+ ComponentContextService
38869
+ ],
38870
+ 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:0;right:0}"]
38871
+ },] }
38872
+ ];
38873
+ FileUploadComponent.ctorParameters = function () { return [
38874
+ { type: FileObjectService },
38875
+ { type: NotifierService },
38876
+ { type: DownloadLinkService },
38877
+ { type: ModuleConfigService },
38878
+ { type: FileExplorerService },
38879
+ { type: ngxDeviceDetector.DeviceDetectorService },
38880
+ { type: UserService },
38881
+ { type: i0.Injector }
38882
+ ]; };
38883
+ FileUploadComponent.propDecorators = {
38884
+ file: [{ type: i0.ViewChild, args: ['file',] }],
38885
+ contextMenu: [{ type: i0.ViewChild, args: ['contextMenu',] }],
38886
+ chooseLabel: [{ type: i0.Input }],
38887
+ readonly: [{ type: i0.Input }],
38888
+ showDeleteFile: [{ type: i0.Input }],
38889
+ accept: [{ type: i0.Input }],
38890
+ maxFileSize: [{ type: i0.Input }],
38891
+ invalidFileSizeMessageSummary: [{ type: i0.Input }],
38892
+ invalidFileSizeMessageDetail: [{ type: i0.Input }],
38893
+ invalidFileTypeMessageSummary: [{ type: i0.Input }],
38894
+ invalidFileTypeMessageDetail: [{ type: i0.Input }],
38895
+ invalidFileLimitMessageSummary: [{ type: i0.Input }],
38896
+ invalidFileLimitMessageDetail: [{ type: i0.Input }],
38897
+ sharedFolderType: [{ type: i0.Input }],
38898
+ control: [{ type: i0.Input }],
38899
+ isPublic: [{ type: i0.Input }],
38900
+ parentSetting: [{ type: i0.Input }],
38901
+ onInit: [{ type: i0.Output }],
38902
+ onSelect: [{ type: i0.Output }],
38903
+ onRemove: [{ type: i0.Output }],
38904
+ onChanged: [{ type: i0.Output }]
38905
+ };
38906
+
38907
+ var KeyValueComponent = /** @class */ (function () {
38908
+ function KeyValueComponent() {
38909
+ this.control = new KeyValueControlSchema();
38910
+ this.disabled = false;
38911
+ this.dataSourceInternal = [];
38912
+ this.onRemoveItem = new i0.EventEmitter();
38913
+ this.onClear = new i0.EventEmitter();
38914
+ }
38915
+ KeyValueComponent.prototype.ngOnInit = function () {
38916
+ this.clearAllItems(false);
38917
+ };
38918
+ KeyValueComponent.prototype.writeValue = function (obj) {
38919
+ if (obj && obj instanceof Array) {
38920
+ if (obj.length > 0) {
38921
+ this.dataSourceInternal = obj;
38922
+ }
38923
+ else {
38924
+ this.clearAllItems(false);
38925
+ }
38926
+ }
38927
+ else {
38928
+ this.clearAllItems(false);
38929
+ }
38930
+ };
38931
+ KeyValueComponent.prototype.registerOnChange = function (fn) {
38932
+ this.onChange = fn;
38933
+ };
38934
+ KeyValueComponent.prototype.registerOnTouched = function (fn) {
38935
+ this.onTouched = fn;
38936
+ };
38937
+ KeyValueComponent.prototype.setDisabledState = function (isDisabled) {
38938
+ this.disabled = isDisabled;
38939
+ };
38940
+ KeyValueComponent.prototype.removeItem = function (index) {
38941
+ this.dataSourceInternal.splice(index, 1);
38942
+ this.updateNgModel();
38943
+ };
38944
+ KeyValueComponent.prototype.addDefaultItems = function (items) {
38945
+ var e_1, _a;
38946
+ if (items instanceof Array) {
38947
+ try {
38948
+ for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {
38949
+ var item = items_1_1.value;
38950
+ this.addOrUpdateItem(item);
38951
+ }
38952
+ }
38953
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
38954
+ finally {
38955
+ try {
38956
+ if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);
38957
+ }
38958
+ finally { if (e_1) throw e_1.error; }
38959
+ }
38960
+ }
38961
+ else if (items instanceof Object) {
38962
+ this.addOrUpdateItem(items);
38963
+ }
38964
+ this.updateNgModel();
38965
+ };
38966
+ KeyValueComponent.prototype.addOrUpdateItem = function (itemToAdd) {
38967
+ var item = this.dataSourceInternal.find(function (x) { return x.key === itemToAdd.key; });
38968
+ if (!item) {
38969
+ this.dataSourceInternal.push(itemToAdd);
38970
+ }
38971
+ else {
38972
+ item.value = itemToAdd.value;
38973
+ }
38974
+ };
38975
+ KeyValueComponent.prototype.addEmptyItems = function () {
38976
+ this.dataSourceInternal.push({
38977
+ key: '',
38978
+ value: ''
38979
+ });
38980
+ };
38981
+ KeyValueComponent.prototype.clearAllItems = function (updateModel) {
38982
+ if (updateModel === void 0) { updateModel = false; }
38983
+ this.dataSourceInternal.length = 0;
38984
+ this.addEmptyItems();
38985
+ if (updateModel) {
38986
+ this.updateNgModel();
38987
+ }
38988
+ };
38989
+ KeyValueComponent.prototype.updateNgModel = function () {
38990
+ if (this.dataSourceInternal.length > 0) {
38991
+ this.onChange(this.dataSourceInternal.filter(function (x) { return x.key != null && x.key != '' && x.value != null && x.value != ''; }));
38992
+ }
38993
+ else {
38994
+ this.onChange([]);
38995
+ }
38382
38996
  };
38383
38997
  KeyValueComponent.prototype.blurItem = function (item) {
38384
38998
  this.updateNgModel();
@@ -39317,7 +39931,7 @@
39317
39931
 
39318
39932
  var ServiceFileUploadComponent = /** @class */ (function (_super) {
39319
39933
  __extends(ServiceFileUploadComponent, _super);
39320
- function ServiceFileUploadComponent(_fileObjectService, _signalRService, _moduleConfigService, _tnClientService, _authenService, _userService, _notifierService, _downloadLinkService, _fileExplorerService, _injector) {
39934
+ function ServiceFileUploadComponent(_fileObjectService, _signalRService, _moduleConfigService, _tnClientService, _authenService, _userService, _notifierService, _downloadLinkService, _fileExplorerService, _deviceDetectorService, _injector) {
39321
39935
  var _this = _super.call(this, _injector) || this;
39322
39936
  _this._fileObjectService = _fileObjectService;
39323
39937
  _this._signalRService = _signalRService;
@@ -39328,10 +39942,12 @@
39328
39942
  _this._notifierService = _notifierService;
39329
39943
  _this._downloadLinkService = _downloadLinkService;
39330
39944
  _this._fileExplorerService = _fileExplorerService;
39945
+ _this._deviceDetectorService = _deviceDetectorService;
39331
39946
  _this.control = new FileUploadControlSchema();
39332
39947
  _this.serviceCode = '';
39333
39948
  _this.entity = '';
39334
39949
  _this.chooseLabel = 'Chọn';
39950
+ _this.parentSetting = new CrudFormSetting();
39335
39951
  _this.onInit = new i0.EventEmitter();
39336
39952
  _this.onSelect = new i0.EventEmitter();
39337
39953
  _this.onRemove = new i0.EventEmitter();
@@ -39356,6 +39972,25 @@
39356
39972
  _this._subscribe = null;
39357
39973
  _this.dataModel = {};
39358
39974
  _this.forms = {};
39975
+ _this.formIds = {
39976
+ createFolder: 'createFolder',
39977
+ renameFile: 'renameFile',
39978
+ shareFile: 'shareFile',
39979
+ shareFolder: 'shareFolder',
39980
+ fileViewer: 'fileViewer',
39981
+ fileVersionList: 'fileVersionList',
39982
+ signatureDetail: 'signatureDetail',
39983
+ kySoSim: 'kySoSim',
39984
+ viewDetail: 'viewDetail'
39985
+ };
39986
+ _this.signatureFormModel = {
39987
+ formData: new CrudFormData(),
39988
+ show: false,
39989
+ popupSize: new PopupSize({
39990
+ width: 600,
39991
+ height: 400
39992
+ })
39993
+ };
39359
39994
  if (_this._userService.isValidAccessToken()) {
39360
39995
  _this.userId = _this._userService.getUserIdCombine();
39361
39996
  }
@@ -39393,6 +40028,10 @@
39393
40028
  show: false,
39394
40029
  formData: {},
39395
40030
  };
40031
+ this.forms[this.formIds.signatureDetail] = {
40032
+ header: 'Thông tin chữ ký số',
40033
+ show: false,
40034
+ };
39396
40035
  if (this.fileDataService) {
39397
40036
  this.fileDataService.register(this);
39398
40037
  }
@@ -39403,8 +40042,9 @@
39403
40042
  ServiceFileUploadComponent.prototype.getServiceFile = function () {
39404
40043
  return __awaiter(this, void 0, void 0, function () {
39405
40044
  var serviceRequestModel, fileObject;
39406
- return __generator(this, function (_a) {
39407
- switch (_a.label) {
40045
+ var _this = this;
40046
+ return __generator(this, function (_b) {
40047
+ switch (_b.label) {
39408
40048
  case 0:
39409
40049
  if (!this.hasKeys()) return [3 /*break*/, 2];
39410
40050
  serviceRequestModel = {
@@ -39416,7 +40056,7 @@
39416
40056
  this.setNoti('Đang lấy đính kèm...');
39417
40057
  return [4 /*yield*/, this._fileObjectService.getSingleServiceFile(serviceRequestModel)];
39418
40058
  case 1:
39419
- fileObject = (_a.sent()).data;
40059
+ fileObject = (_b.sent()).data;
39420
40060
  this.loading = false;
39421
40061
  this.setNoti(null);
39422
40062
  if (fileObject) {
@@ -39425,8 +40065,14 @@
39425
40065
  return [3 /*break*/, 3];
39426
40066
  case 2:
39427
40067
  this.setFileObject(null);
39428
- _a.label = 3;
40068
+ _b.label = 3;
39429
40069
  case 3:
40070
+ this._fileExplorerService.getSignatureInfoByFileId(this.fileId).then(function (rs) {
40071
+ var _a;
40072
+ if (rs.success && ((_a = rs.data) === null || _a === void 0 ? void 0 : _a.length)) {
40073
+ _this.selectedFile.signatures = rs.data;
40074
+ }
40075
+ });
39430
40076
  this.control.hasFile = this.hasFile;
39431
40077
  this.setMenu();
39432
40078
  return [2 /*return*/];
@@ -39445,6 +40091,7 @@
39445
40091
  this.onChanged.emit();
39446
40092
  return;
39447
40093
  }
40094
+ this.selectedFile = fileObject;
39448
40095
  this.fileObj = fileObject;
39449
40096
  this.fileId = fileObject.id;
39450
40097
  this.setFileName(fileObject.name);
@@ -39467,12 +40114,75 @@
39467
40114
  }
39468
40115
  this.menu = [
39469
40116
  {
39470
- label: 'Tải về',
39471
- icon: 'fas fa-download',
40117
+ label: 'Tải về',
40118
+ icon: 'fas fa-download',
40119
+ command: function () {
40120
+ _this.download();
40121
+ }
40122
+ },
40123
+ {
40124
+ label: 'Ký số cá nhân (SIM)',
40125
+ icon: 'fas fa-sim-card',
40126
+ command: function () {
40127
+ _this.signKySimFile(_this.selectedFile);
40128
+ },
40129
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
40130
+ && !this.parentSetting.hiddenKySoSimCaNhan),
40131
+ },
40132
+ {
40133
+ label: 'Ký số SmartCA',
40134
+ icon: 'fas fa-signature',
40135
+ command: function () {
40136
+ _this.signatureFormModel.show = true;
40137
+ },
40138
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
40139
+ && !this.parentSetting.hiddenKySoSmartCA),
40140
+ },
40141
+ {
40142
+ label: 'Ký số cá nhân (USB)', icon: 'fas fa-signature',
40143
+ command: function () {
40144
+ _this.signFile(_this.selectedFile);
40145
+ },
40146
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
40147
+ && this._deviceDetectorService.isDesktop()
40148
+ && !this.parentSetting.hiddenKySoUsbCaNhan),
40149
+ },
40150
+ {
40151
+ label: 'Ký số VNPTCA', icon: 'fas fa-signature',
40152
+ command: function () {
40153
+ _this.signVNPTCA(_this.selectedFile);
40154
+ },
40155
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
40156
+ && this._deviceDetectorService.isDesktop()
40157
+ && !this.parentSetting.hiddenKySoVNPTCA),
40158
+ },
40159
+ {
40160
+ label: 'Bút phê', icon: 'fas fa-comment-dots',
40161
+ command: function () {
40162
+ _this.addComment(_this.selectedFile);
40163
+ },
40164
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
40165
+ && this._deviceDetectorService.isDesktop()
40166
+ && !this.parentSetting.hiddenButPhe),
40167
+ },
40168
+ {
40169
+ label: 'Bút phê và ký', icon: 'fas fa-comment-medical',
39472
40170
  command: function () {
39473
- _this.download();
39474
- }
39475
- }
40171
+ _this.addCommentAndSign(_this.selectedFile);
40172
+ },
40173
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
40174
+ && this._deviceDetectorService.isDesktop()
40175
+ && !this.parentSetting.hiddenButPhe),
40176
+ },
40177
+ {
40178
+ label: 'Ký số đơn vị (USB)', icon: 'fas fa-signature',
40179
+ command: function () {
40180
+ _this.signFileDonVi(_this.selectedFile);
40181
+ },
40182
+ visible: (this._fileObjectService.isTypeFileKySo(this.selectedFile.name)
40183
+ && this._deviceDetectorService.isDesktop()
40184
+ && !this.parentSetting.hiddenKySoDonVi),
40185
+ },
39476
40186
  ];
39477
40187
  };
39478
40188
  ServiceFileUploadComponent.prototype.subscribe = function () {
@@ -39501,71 +40211,100 @@
39501
40211
  }
39502
40212
  };
39503
40213
  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;
40214
+ return __awaiter(this, void 0, void 0, function () {
40215
+ return __generator(this, function (_b) {
40216
+ switch (_b.label) {
40217
+ case 0:
40218
+ this.hasFile = false;
40219
+ this.fileId = null;
40220
+ this.file.clear();
40221
+ if (!(evt.errorFiles && evt.errorFiles.length > 0)) return [3 /*break*/, 1];
40222
+ this.showNoti = true;
40223
+ this.notification = "" + evt.errorMessages[0].summary + evt.errorMessages[0].detail;
40224
+ return [3 /*break*/, 4];
40225
+ case 1:
40226
+ this.selectedFile = evt.successFiles[0];
40227
+ this.setFileName(this.selectedFile ? this.selectedFile.name : null);
40228
+ if (!this.control.autoSaved) return [3 /*break*/, 3];
40229
+ return [4 /*yield*/, this.handleSaveFile()];
40230
+ case 2:
40231
+ _b.sent();
40232
+ return [3 /*break*/, 4];
40233
+ case 3:
40234
+ this.hasFile = true;
40235
+ this.onChangeBase('has-value');
40236
+ this.onSelect.emit(this.selectedFile);
40237
+ this.onChanged.emit(this.selectedFile);
40238
+ _b.label = 4;
40239
+ case 4:
40240
+ this.control.hasFile = this.hasFile;
40241
+ this.setMenu();
40242
+ return [2 /*return*/];
40243
+ }
40244
+ });
40245
+ });
39525
40246
  };
39526
40247
  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');
40248
+ return __awaiter(this, void 0, void 0, function () {
40249
+ var formData;
40250
+ var _this = this;
40251
+ return __generator(this, function (_b) {
40252
+ switch (_b.label) {
40253
+ case 0:
40254
+ // Đã lưu file.
40255
+ if (this.fileId) {
40256
+ return [2 /*return*/];
40257
+ }
40258
+ // Trường hợp không có đủ keys.
40259
+ if (!this.hasKeys()) {
40260
+ this._notifierService.showWarning('Chưa cấu hình keys');
40261
+ return [2 /*return*/];
40262
+ }
40263
+ // Chưa chọn file.
40264
+ if (!this.selectedFile) {
40265
+ return [2 /*return*/];
40266
+ }
40267
+ formData = new FormData();
40268
+ formData.append('serviceCode', this.serviceCode);
40269
+ formData.append('entity', this.entity);
40270
+ formData.append('entityKey', this.entityKey);
40271
+ formData.append('isMultiple', 'false');
40272
+ formData.append('isPublic', "" + this.control.isPublic);
40273
+ formData.append('file', this.selectedFile);
40274
+ this.loading = true;
40275
+ this.setNoti('Đang tải file lên...');
40276
+ return [4 /*yield*/, this._fileObjectService.createServiceFile(formData)
40277
+ .then(function (rs) {
40278
+ _this.loading = false;
40279
+ _this.setNoti(null);
40280
+ if (rs.success) {
40281
+ _this.selectedFile = _this.selectedFile;
40282
+ _this.selectedFileName = _this.selectedFile.name;
40283
+ _this.fileId = rs.data;
40284
+ _this.selectedFile.id = rs.data;
40285
+ _this.hasFile = true;
40286
+ _this.control.hasFile = _this.hasFile;
40287
+ _this.onChanged.emit({ fileId: _this.fileId, selectedFile: _this.selectedFile });
40288
+ _this._fileExplorerService.getSignatureInfoByFileId(_this.fileId).then(function (rs) {
40289
+ var _a;
40290
+ if (rs.success && ((_a = rs.data) === null || _a === void 0 ? void 0 : _a.length)) {
40291
+ _this.selectedFile.signatures = rs.data;
40292
+ }
40293
+ });
40294
+ }
40295
+ else {
40296
+ _this._crudService.processErrorResponse(rs);
40297
+ }
40298
+ }, function (err) {
40299
+ _this.loading = false;
40300
+ _this.setNoti(null);
40301
+ _this._notifierService.showWarning('Upload file chưa thành công');
40302
+ })];
40303
+ case 1:
40304
+ _b.sent();
40305
+ return [2 /*return*/];
40306
+ }
40307
+ });
39569
40308
  });
39570
40309
  };
39571
40310
  ServiceFileUploadComponent.prototype.setNoti = function (msg) {
@@ -39590,6 +40329,11 @@
39590
40329
  this.selectedFileNameShort = null;
39591
40330
  }
39592
40331
  };
40332
+ ServiceFileUploadComponent.prototype.viewListSign = function (e, signatures) {
40333
+ e.stopPropagation();
40334
+ this.forms[this.formIds.signatureDetail].show = true;
40335
+ this.model.advanceData = signatures;
40336
+ };
39593
40337
  ServiceFileUploadComponent.prototype.showContextMenu = function (evt) {
39594
40338
  this.contextMenu.toggle(evt);
39595
40339
  evt.stopPropagation();
@@ -39606,143 +40350,643 @@
39606
40350
  this.onChangeBase(null);
39607
40351
  this.onRemove.emit(fileData);
39608
40352
  };
39609
- ServiceFileUploadComponent.prototype.onDownloadFile = function () {
39610
- this.download();
40353
+ ServiceFileUploadComponent.prototype.onDownloadFile = function () {
40354
+ this.download();
40355
+ };
40356
+ ServiceFileUploadComponent.prototype.scanFile = function (evt) {
40357
+ var _this = this;
40358
+ // send tn command
40359
+ var correlationId = this._commonService.randomString();
40360
+ var command = new TnClientCommand();
40361
+ command.commandType = exports.CommandType.Scan;
40362
+ // command.key = this._moduleConfig.environment.signalr.clientKey;
40363
+ command.key = this._moduleConfig.environment.signalr.clientKey;
40364
+ var scanFileCommand = {
40365
+ correlationId: correlationId,
40366
+ uploadFileApi: this._fileObjectService.getScanFileUploadEndpoint(correlationId),
40367
+ accessToken: this._authenService.getAccessToken(),
40368
+ defaultFileName: this.defaultScanFileName
40369
+ };
40370
+ command.data = scanFileCommand;
40371
+ this._tnClientService.sendCommand(command);
40372
+ this._signalRService.unSubscribeViewCode(null, "FILE.SCANNED." + correlationId);
40373
+ this._signalRService.start(null, "FILE.SCANNED." + correlationId, function (data) {
40374
+ if (data) {
40375
+ var obj = void 0;
40376
+ if (data instanceof Object) {
40377
+ obj = data;
40378
+ _this.fileId = obj.message.content;
40379
+ _this.fileObj.name = obj.message.title;
40380
+ }
40381
+ else {
40382
+ obj = JSON.parse(data);
40383
+ _this.fileId = obj.message.content;
40384
+ _this.fileObj.name = obj.message.title;
40385
+ }
40386
+ }
40387
+ });
40388
+ };
40389
+ ServiceFileUploadComponent.prototype.viewOnline = function () {
40390
+ if (this._fileObjectService.isSupportedViewOnline(this.fileObj.name)) {
40391
+ this.dataModel.fileViewer.data = {};
40392
+ this.dataModel.fileViewer.data.fileId = this.fileId;
40393
+ this.dataModel.fileViewer.data.fileName = this.fileObj.name;
40394
+ this.dataModel.fileViewer.data.service = this.serviceCode;
40395
+ this.dataModel.fileViewer.data.entity = this.entity;
40396
+ this.dataModel.fileViewer.data.entityKey = this.entityKey;
40397
+ this.dataModel.fileViewer.data.isFileVersion = false;
40398
+ this.dataModel.fileViewer.show = true;
40399
+ }
40400
+ else {
40401
+ this.download();
40402
+ }
40403
+ };
40404
+ ServiceFileUploadComponent.prototype.download = function () {
40405
+ if (!this.fileId) {
40406
+ return;
40407
+ }
40408
+ var model = new GenerateLinkDownloadDTO({
40409
+ fileId: this.fileId
40410
+ });
40411
+ this._downloadLinkService.downloadLink(model);
40412
+ };
40413
+ ServiceFileUploadComponent.prototype.uploadFileFromDrive = function () {
40414
+ // this.dataModel.driveFileDialog = {
40415
+ // show: true
40416
+ // };
40417
+ };
40418
+ ServiceFileUploadComponent.prototype.copyFileToDrive = function () {
40419
+ // this._fileExplorerService.getFolderId(this.userId).then(response => {
40420
+ // var copyFileDto = new CopyFileDto();
40421
+ // copyFileDto.id = this.fileId;
40422
+ // if (this.fileName == "") {
40423
+ // if (this.fileObj != null) {
40424
+ // copyFileDto.name = this.fileObj.name;
40425
+ // }
40426
+ // } else {
40427
+ // copyFileDto.name = this.fileName;
40428
+ // }
40429
+ // copyFileDto.ownerType = this.userId;
40430
+ // copyFileDto.folderId = response.data;
40431
+ // this._fileExplorerService.copyFile(copyFileDto).then(response => {
40432
+ // this._notifierService.showSuccess('Sao chép tài liệu về thư mục cá nhân thành công');
40433
+ // }, error => {
40434
+ // this._notifierService.showBusinessError(error.error.message);
40435
+ // });
40436
+ // });
40437
+ };
40438
+ ServiceFileUploadComponent.prototype.writeValue = function (obj) {
40439
+ };
40440
+ ServiceFileUploadComponent.prototype.registerOnChange = function (fn) {
40441
+ this.onChangeBase = fn;
40442
+ };
40443
+ ServiceFileUploadComponent.prototype.registerOnTouched = function (fn) {
40444
+ this.onTouched = fn;
40445
+ };
40446
+ ServiceFileUploadComponent.prototype.setDisabledState = function (isDisabled) {
40447
+ this.isDisabled = isDisabled;
40448
+ };
40449
+ ServiceFileUploadComponent.prototype.openFileViewer = function () {
40450
+ return __awaiter(this, void 0, void 0, function () {
40451
+ var fileBinary, fileObject, fileName;
40452
+ return __generator(this, function (_b) {
40453
+ switch (_b.label) {
40454
+ case 0: return [4 /*yield*/, this._fileExplorerService.checkPhysicalFile(this.fileId)];
40455
+ case 1:
40456
+ fileBinary = _b.sent();
40457
+ if (!fileBinary.success) {
40458
+ this._notifierService.showWarning('File không tồn tại, vui lòng liên hệ quản trị viên');
40459
+ return [2 /*return*/];
40460
+ }
40461
+ return [4 /*yield*/, this._fileObjectService.getDetail(this.fileId)];
40462
+ case 2:
40463
+ fileObject = _b.sent();
40464
+ fileName = '';
40465
+ if (!fileObject.success) {
40466
+ 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');
40467
+ return [2 /*return*/];
40468
+ }
40469
+ fileName = fileObject === null || fileObject === void 0 ? void 0 : fileObject.name;
40470
+ this.forms.fileViewer.formData.data = {
40471
+ fileId: this.fileId,
40472
+ isFileVersion: false,
40473
+ fileName: fileName,
40474
+ service: this.serviceCode,
40475
+ entity: this.entity,
40476
+ entityKey: this.entityKey,
40477
+ };
40478
+ this.forms.fileViewer.show = true;
40479
+ return [2 /*return*/];
40480
+ }
40481
+ });
40482
+ });
40483
+ };
40484
+ ServiceFileUploadComponent.prototype.signFileSmartCA = function (dataKySo) {
40485
+ var _a;
40486
+ return __awaiter(this, void 0, void 0, function () {
40487
+ var sourceFileId, rsConvert, e_1;
40488
+ return __generator(this, function (_b) {
40489
+ switch (_b.label) {
40490
+ case 0:
40491
+ this.signatureFormModel.show = false;
40492
+ sourceFileId = this.selectedFile.id;
40493
+ if (!this._fileExplorerService.needConvertBeforeSign(this.selectedFile.name)) return [3 /*break*/, 4];
40494
+ _b.label = 1;
40495
+ case 1:
40496
+ _b.trys.push([1, 3, , 4]);
40497
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
40498
+ instanceId: sourceFileId,
40499
+ name: this._fileExplorerService.changeFileExtension(this.selectedFile.name, 'pdf'),
40500
+ folderInstanceId: (_a = this.selectedFile.parentFolderId) !== null && _a !== void 0 ? _a : this._commonService.guid(),
40501
+ ownerType: this._userService.getCurrentUser().userId.toString(),
40502
+ })];
40503
+ case 2:
40504
+ rsConvert = _b.sent();
40505
+ if (!rsConvert || !rsConvert.success) {
40506
+ 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");
40507
+ return [2 /*return*/];
40508
+ }
40509
+ else {
40510
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + this.selectedFile.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
40511
+ sourceFileId = rsConvert.data;
40512
+ }
40513
+ return [3 /*break*/, 4];
40514
+ case 3:
40515
+ e_1 = _b.sent();
40516
+ 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");
40517
+ return [2 /*return*/];
40518
+ case 4:
40519
+ if (!dataKySo) {
40520
+ this._notifierService.showWarning('Người dùng chưa cấu hình thông tin ký số');
40521
+ }
40522
+ debugger;
40523
+ this.forms.fileViewer.formData.data = {
40524
+ fileId: sourceFileId,
40525
+ isFileVersion: false,
40526
+ fileName: this.selectedFile.name,
40527
+ service: this.serviceCode,
40528
+ entity: this.entity,
40529
+ entityKey: this.entityKey,
40530
+ fileBase64Content: dataKySo.fileBase64Content,
40531
+ userChuKySoId: dataKySo.id,
40532
+ showKySoButton: true,
40533
+ width: dataKySo.width,
40534
+ height: dataKySo.height,
40535
+ };
40536
+ this.forms.fileViewer.show = true;
40537
+ return [2 /*return*/];
40538
+ }
40539
+ });
40540
+ });
40541
+ };
40542
+ ServiceFileUploadComponent.prototype.signKySimFile = function (file) {
40543
+ this.forms.kySoSim.show = true;
40544
+ this.model.advanceData = file;
39611
40545
  };
39612
- ServiceFileUploadComponent.prototype.scanFile = function (evt) {
40546
+ ServiceFileUploadComponent.prototype.signFile = function (file) {
39613
40547
  var _this = this;
39614
- // send tn command
39615
- var correlationId = this._commonService.randomString();
39616
- var command = new TnClientCommand();
39617
- command.commandType = exports.CommandType.Scan;
39618
- // command.key = this._moduleConfig.environment.signalr.clientKey;
39619
- command.key = this._moduleConfig.environment.signalr.clientKey;
39620
- var scanFileCommand = {
39621
- correlationId: correlationId,
39622
- uploadFileApi: this._fileObjectService.getScanFileUploadEndpoint(correlationId),
39623
- accessToken: this._authenService.getAccessToken(),
39624
- defaultFileName: this.defaultScanFileName
39625
- };
39626
- command.data = scanFileCommand;
39627
- this._tnClientService.sendCommand(command);
39628
- this._signalRService.unSubscribeViewCode(null, "FILE.SCANNED." + correlationId);
39629
- this._signalRService.start(null, "FILE.SCANNED." + correlationId, function (data) {
39630
- if (data) {
39631
- var obj = void 0;
39632
- if (data instanceof Object) {
39633
- obj = data;
39634
- _this.fileId = obj.message.content;
39635
- _this.fileObj.name = obj.message.title;
40548
+ this._notifierService.showConfirm('Bạn 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 () {
40549
+ var sourceFileId, sourceFile_1, rsConvert, e_2;
40550
+ var _this = this;
40551
+ return __generator(this, function (_b) {
40552
+ switch (_b.label) {
40553
+ case 0:
40554
+ if (!rs) return [3 /*break*/, 5];
40555
+ sourceFileId = file.id;
40556
+ sourceFile_1 = file;
40557
+ if (!this._fileExplorerService.needConvertBeforeSign(file.name)) return [3 /*break*/, 4];
40558
+ _b.label = 1;
40559
+ case 1:
40560
+ _b.trys.push([1, 3, , 4]);
40561
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
40562
+ instanceId: sourceFileId,
40563
+ name: this._fileExplorerService.changeFileExtension(file.name, 'pdf'),
40564
+ folderInstanceId: file.parentFolderId,
40565
+ ownerType: this._userService.getCurrentUser().userId.toString(),
40566
+ })];
40567
+ case 2:
40568
+ rsConvert = _b.sent();
40569
+ if (!rsConvert || !rsConvert.success) {
40570
+ 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");
40571
+ return [2 /*return*/];
40572
+ }
40573
+ else {
40574
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
40575
+ sourceFileId = rsConvert.data;
40576
+ sourceFile_1 = { id: sourceFileId };
40577
+ this.getServiceFile();
40578
+ }
40579
+ return [3 /*break*/, 4];
40580
+ case 3:
40581
+ e_2 = _b.sent();
40582
+ 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");
40583
+ return [2 /*return*/];
40584
+ case 4:
40585
+ this._fileExplorerService.generateLinkDownload({
40586
+ fileId: sourceFileId,
40587
+ }).then(function (rs) {
40588
+ var url = _this._downloadLinkService.getDownloadForSignUrl(rs.data);
40589
+ var prms = {};
40590
+ prms['FileUploadHandler'] = _this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + _this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile";
40591
+ prms['SessionId'] = '';
40592
+ prms['FileName'] = url;
40593
+ // tslint:disable-next-line: variable-name
40594
+ var json_prms = JSON.stringify(prms);
40595
+ vgca_sign_approved(json_prms, function (result) {
40596
+ var resultObj = JSON.parse(result);
40597
+ if (resultObj.FileServer != '') {
40598
+ _this._fileExplorerService.saveSignedFile({
40599
+ sourceFile: sourceFile_1,
40600
+ tempFileId: resultObj.FileServer,
40601
+ }).then(function (rss) {
40602
+ _this.getServiceFile();
40603
+ _this._notifierService.showSuccess('Ký số thành công');
40604
+ });
40605
+ }
40606
+ });
40607
+ });
40608
+ _b.label = 5;
40609
+ case 5: return [2 /*return*/];
39636
40610
  }
39637
- else {
39638
- obj = JSON.parse(data);
39639
- _this.fileId = obj.message.content;
39640
- _this.fileObj.name = obj.message.title;
40611
+ });
40612
+ }); });
40613
+ };
40614
+ ServiceFileUploadComponent.prototype.signVNPTCA = function (item) {
40615
+ var _a;
40616
+ return __awaiter(this, void 0, void 0, function () {
40617
+ var sourceFileId, rsConvert, e_3, dataInput, sigOptions, dataJS, data, e_4;
40618
+ return __generator(this, function (_b) {
40619
+ switch (_b.label) {
40620
+ case 0:
40621
+ sourceFileId = item.id;
40622
+ if (!this._fileExplorerService.needConvertBeforeSign(item.name)) return [3 /*break*/, 4];
40623
+ _b.label = 1;
40624
+ case 1:
40625
+ _b.trys.push([1, 3, , 4]);
40626
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
40627
+ instanceId: item.id,
40628
+ name: this._fileExplorerService.changeFileExtension(item.name, 'pdf'),
40629
+ folderInstanceId: (_a = item.parentFolderId) !== null && _a !== void 0 ? _a : this._commonService.guid(),
40630
+ ownerType: this._userService.getCurrentUser().userId.toString(),
40631
+ })];
40632
+ case 2:
40633
+ rsConvert = _b.sent();
40634
+ if (!rsConvert || !rsConvert.success) {
40635
+ 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");
40636
+ return [2 /*return*/];
40637
+ }
40638
+ else {
40639
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + item.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
40640
+ sourceFileId = rsConvert.data;
40641
+ this.model.selectedItem.id = rsConvert.data;
40642
+ this.getServiceFile();
40643
+ }
40644
+ return [3 /*break*/, 4];
40645
+ case 3:
40646
+ e_3 = _b.sent();
40647
+ 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");
40648
+ return [2 /*return*/];
40649
+ case 4: return [4 /*yield*/, this._fileExplorerService.getBase64FromFileId(sourceFileId)];
40650
+ case 5:
40651
+ dataInput = (_b.sent()).split(',')[1];
40652
+ sigOptions = new PdfSigner();
40653
+ sigOptions.page = 1;
40654
+ sigOptions.AdvancedCustom = true;
40655
+ sigOptions.SigType = 1;
40656
+ dataJS = {
40657
+ data: dataInput,
40658
+ type: 'pdf',
40659
+ sigOptions: JSON.stringify(sigOptions)
40660
+ };
40661
+ _b.label = 6;
40662
+ case 6:
40663
+ _b.trys.push([6, 8, , 9]);
40664
+ return [4 /*yield*/, vnpt_plugin.signArrDataAdvanced([JSON.stringify(dataJS)], "", false)];
40665
+ case 7:
40666
+ data = _b.sent();
40667
+ this.handeResult(data);
40668
+ return [3 /*break*/, 9];
40669
+ case 8:
40670
+ e_4 = _b.sent();
40671
+ console.log(e_4);
40672
+ return [3 /*break*/, 9];
40673
+ case 9: return [2 /*return*/];
39641
40674
  }
39642
- }
40675
+ });
39643
40676
  });
39644
40677
  };
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;
40678
+ ServiceFileUploadComponent.prototype.handeResult = function (data) {
40679
+ var _this = this;
40680
+ if (typeof JSON.parse(data).code !== 'undefined') {
40681
+ var jsOb = JSON.parse(data);
39655
40682
  }
39656
40683
  else {
39657
- this.download();
39658
- }
39659
- };
39660
- ServiceFileUploadComponent.prototype.download = function () {
39661
- if (!this.fileId) {
39662
- return;
40684
+ var jsOb = JSON.parse(JSON.parse(data)[0]);
40685
+ }
40686
+ switch (jsOb.code) {
40687
+ case 0:
40688
+ this._fileExplorerService.kySimSaveSignedFile({
40689
+ sourceFile: this.model.selectedItem,
40690
+ fileContents: jsOb.data,
40691
+ }).then(function (rss) {
40692
+ _this._notifierService.showSuccess("Ký thành công");
40693
+ _this.getServiceFile();
40694
+ });
40695
+ break;
40696
+ case 1:
40697
+ this._notifierService.showWarning("Dữ liệu đầu vào không đúng định dạng");
40698
+ break;
40699
+ case 2:
40700
+ this._notifierService.showWarning("Không lấy được thông tin chứng thư số");
40701
+ break;
40702
+ case 3:
40703
+ this._notifierService.showWarning("Có lỗi trong quá trình ký số");
40704
+ break;
40705
+ case 4:
40706
+ this._notifierService.showSuccess("Chứng thư số không có khóa bí mật");
40707
+ break;
40708
+ case 5:
40709
+ this._notifierService.showSuccess("Lỗi không xác định");
40710
+ break;
40711
+ case 6:
40712
+ this._notifierService.showSuccess("Ký pdf: không tìm thấy tham số số trang cần ký");
40713
+ break;
40714
+ case 7:
40715
+ this._notifierService.showSuccess("Ký pdf: trang đặt chữ ký không tồn tại");
40716
+ break;
40717
+ case 8:
40718
+ this._notifierService.showSuccess("Ký xml: không tìm thấy thẻ ký số");
40719
+ break;
40720
+ case 9:
40721
+ this._notifierService.showSuccess("Ký pdf: không tìm thấy id của thẻ ký số");
40722
+ break;
40723
+ case 10:
40724
+ this._notifierService.showSuccess("Dữ liệu ký đã chứa một hoặc nhiều chữ ký không hợp lệ");
40725
+ break;
40726
+ case 11:
40727
+ this._notifierService.showSuccess("Người dùng hủy bỏ");
40728
+ break;
40729
+ case 13:
40730
+ this._notifierService.showWarning("Dữ liệu ký rỗng");
40731
+ break;
40732
+ default:
40733
+ this._notifierService.showSuccess("Lỗi không xác định");
40734
+ break;
39663
40735
  }
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
- };
39696
- ServiceFileUploadComponent.prototype.registerOnChange = function (fn) {
39697
- this.onChangeBase = fn;
39698
- };
39699
- ServiceFileUploadComponent.prototype.registerOnTouched = function (fn) {
39700
- this.onTouched = fn;
39701
40736
  };
39702
- ServiceFileUploadComponent.prototype.setDisabledState = function (isDisabled) {
39703
- this.isDisabled = isDisabled;
40737
+ ServiceFileUploadComponent.prototype.addComment = function (file) {
40738
+ var _this = this;
40739
+ 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 () {
40740
+ var sourceFileId, sourceFile_2, rsConvert, e_5;
40741
+ var _this = this;
40742
+ return __generator(this, function (_b) {
40743
+ switch (_b.label) {
40744
+ case 0:
40745
+ if (!rs) return [3 /*break*/, 5];
40746
+ sourceFileId = file.id;
40747
+ sourceFile_2 = file;
40748
+ if (!this._fileExplorerService.needConvertBeforeSign(file.name)) return [3 /*break*/, 4];
40749
+ _b.label = 1;
40750
+ case 1:
40751
+ _b.trys.push([1, 3, , 4]);
40752
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
40753
+ instanceId: sourceFileId,
40754
+ name: this._fileExplorerService.changeFileExtension(file.name, 'pdf'),
40755
+ folderInstanceId: file.parentFolderId,
40756
+ ownerType: this._userService.getCurrentUser().userId.toString(),
40757
+ })];
40758
+ case 2:
40759
+ rsConvert = _b.sent();
40760
+ if (!rsConvert || !rsConvert.success) {
40761
+ 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");
40762
+ return [2 /*return*/];
40763
+ }
40764
+ else {
40765
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
40766
+ sourceFileId = rsConvert.data;
40767
+ sourceFile_2 = { id: sourceFileId };
40768
+ this.getServiceFile();
40769
+ }
40770
+ return [3 /*break*/, 4];
40771
+ case 3:
40772
+ e_5 = _b.sent();
40773
+ 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");
40774
+ return [2 /*return*/];
40775
+ case 4:
40776
+ this._fileExplorerService.generateLinkDownload({
40777
+ fileId: sourceFileId,
40778
+ }).then(function (rs) {
40779
+ var url = _this._downloadLinkService.getDownloadForSignUrl(rs.data);
40780
+ var prms = {};
40781
+ prms['FileUploadHandler'] = _this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + _this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile";
40782
+ prms['SessionId'] = '';
40783
+ prms['FileName'] = url;
40784
+ // tslint:disable-next-line: variable-name
40785
+ var json_prms = JSON.stringify(prms);
40786
+ vgca_comment(json_prms, function (result) {
40787
+ var resultObj = JSON.parse(result);
40788
+ if (resultObj.FileServer != '') {
40789
+ _this._fileExplorerService.saveSignedFile({
40790
+ sourceFile: sourceFile_2,
40791
+ tempFileId: resultObj.FileServer,
40792
+ }).then(function (rss) {
40793
+ _this.getServiceFile();
40794
+ _this._notifierService.showSuccess('Tạo bút phê thành công');
40795
+ });
40796
+ }
40797
+ });
40798
+ });
40799
+ _b.label = 5;
40800
+ case 5: return [2 /*return*/];
40801
+ }
40802
+ });
40803
+ }); });
39704
40804
  };
39705
- ServiceFileUploadComponent.prototype.openFileViewer = function () {
40805
+ ServiceFileUploadComponent.prototype.addCommentAndSign = function (file) {
39706
40806
  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)];
40807
+ var rs, sourceFileId, sourceFile, rsConvert, e_6, downloadLink, url, prms, json_prms_1, commentResult, resultObj, downloadLink2, url2, prms2, json_prms2_1, signResult, signResultObj;
40808
+ return __generator(this, function (_b) {
40809
+ switch (_b.label) {
40810
+ 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
40811
  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');
40812
+ rs = _b.sent();
40813
+ if (!rs) return [3 /*break*/, 11];
40814
+ sourceFileId = file.id;
40815
+ sourceFile = file;
40816
+ if (!this._fileExplorerService.needConvertBeforeSign(file.name)) return [3 /*break*/, 5];
40817
+ _b.label = 2;
40818
+ case 2:
40819
+ _b.trys.push([2, 4, , 5]);
40820
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
40821
+ instanceId: sourceFileId,
40822
+ name: this._fileExplorerService.changeFileExtension(file.name, 'pdf'),
40823
+ folderInstanceId: file.parentFolderId,
40824
+ ownerType: this._userService.getCurrentUser().userId.toString(),
40825
+ })];
40826
+ case 3:
40827
+ rsConvert = _b.sent();
40828
+ if (!rsConvert || !rsConvert.success) {
40829
+ 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
40830
  return [2 /*return*/];
39716
40831
  }
39717
- return [4 /*yield*/, this._fileObjectService.getDetail(this.fileId)];
40832
+ else {
40833
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
40834
+ sourceFileId = rsConvert.data;
40835
+ sourceFile = { id: sourceFileId };
40836
+ this.getServiceFile();
40837
+ }
40838
+ return [3 /*break*/, 5];
40839
+ case 4:
40840
+ e_6 = _b.sent();
40841
+ 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");
40842
+ return [2 /*return*/];
40843
+ case 5: return [4 /*yield*/, this._fileExplorerService.generateLinkDownload({
40844
+ fileId: sourceFileId,
40845
+ })];
40846
+ case 6:
40847
+ downloadLink = _b.sent();
40848
+ url = this._downloadLinkService.getDownloadForSignUrl(downloadLink.data);
40849
+ prms = {
40850
+ FileUploadHandler: this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile",
40851
+ SessionId: '',
40852
+ FileName: url
40853
+ };
40854
+ json_prms_1 = JSON.stringify(prms);
40855
+ return [4 /*yield*/, new Promise(function (resolve) {
40856
+ vgca_comment(json_prms_1, function (result) { return resolve(result); });
40857
+ })];
40858
+ case 7:
40859
+ commentResult = _b.sent();
40860
+ resultObj = JSON.parse(commentResult);
40861
+ return [4 /*yield*/, this._fileExplorerService.generateLinkDownload({
40862
+ fileId: resultObj.FileServer,
40863
+ })];
40864
+ case 8:
40865
+ downloadLink2 = _b.sent();
40866
+ url2 = this._downloadLinkService.getDownloadForSignUrl(downloadLink2.data);
40867
+ prms2 = {
40868
+ FileUploadHandler: this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile",
40869
+ SessionId: '',
40870
+ FileName: url2
40871
+ };
40872
+ json_prms2_1 = JSON.stringify(prms2);
40873
+ return [4 /*yield*/, new Promise(function (resolve) {
40874
+ vgca_sign_approved(json_prms2_1, function (result) { return resolve(result); });
40875
+ })];
40876
+ case 9:
40877
+ signResult = _b.sent();
40878
+ signResultObj = JSON.parse(signResult);
40879
+ if (!(signResultObj.FileServer != '')) return [3 /*break*/, 11];
40880
+ return [4 /*yield*/, this._fileExplorerService.saveSignedFile({
40881
+ sourceFile: sourceFile,
40882
+ tempFileId: signResultObj.FileServer,
40883
+ })];
40884
+ case 10:
40885
+ _b.sent();
40886
+ this.getServiceFile();
40887
+ this._notifierService.showSuccess('Tạo bút phê và ký thành công');
40888
+ _b.label = 11;
40889
+ case 11: return [2 /*return*/];
40890
+ }
40891
+ });
40892
+ });
40893
+ };
40894
+ ServiceFileUploadComponent.prototype.signFileDonVi = function (file) {
40895
+ var _this = this;
40896
+ this._notifierService
40897
+ .showConfirm('Bạn có chắc chắn muốn ký số đơn vị văn bản này?')
40898
+ .then(function (rs) { return __awaiter(_this, void 0, void 0, function () {
40899
+ var sourceFileId, sourceFile_3, rsConvert, e_7;
40900
+ var _this = this;
40901
+ return __generator(this, function (_b) {
40902
+ switch (_b.label) {
40903
+ case 0:
40904
+ if (!rs) return [3 /*break*/, 5];
40905
+ sourceFileId = file.id;
40906
+ sourceFile_3 = file;
40907
+ if (!this._fileExplorerService.needConvertBeforeSign(file.name)) return [3 /*break*/, 4];
40908
+ _b.label = 1;
40909
+ case 1:
40910
+ _b.trys.push([1, 3, , 4]);
40911
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
40912
+ instanceId: sourceFileId,
40913
+ name: this._fileExplorerService.changeFileExtension(file.name, 'pdf'),
40914
+ folderInstanceId: file.parentFolderId,
40915
+ ownerType: this._userService.getCurrentUser().userId.toString(),
40916
+ })];
39718
40917
  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');
40918
+ rsConvert = _b.sent();
40919
+ if (!rsConvert || !rsConvert.success) {
40920
+ 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
40921
  return [2 /*return*/];
39724
40922
  }
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;
40923
+ else {
40924
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
40925
+ this.getServiceFile();
40926
+ sourceFileId = rsConvert.data;
40927
+ sourceFile_3 = { id: sourceFileId };
40928
+ }
40929
+ return [3 /*break*/, 4];
40930
+ case 3:
40931
+ e_7 = _b.sent();
40932
+ 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
40933
  return [2 /*return*/];
40934
+ case 4:
40935
+ this._fileExplorerService
40936
+ .generateLinkDownload({
40937
+ isFileVersion: false,
40938
+ fileId: sourceFileId,
40939
+ })
40940
+ .then(function (rs) {
40941
+ var url = _this._downloadLinkService.getDownloadForSignUrl(rs.data);
40942
+ var prms = {};
40943
+ prms['FileUploadHandler'] = _this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + _this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile";
40944
+ prms['SessionId'] = '';
40945
+ prms['FileName'] = url;
40946
+ // Truyền số, ngày ký số phòng ban nếu cần
40947
+ var that = _this;
40948
+ if (that.control && that.control.dataKySoDonVi) {
40949
+ var dataKySoDonVi = that.control.dataKySoDonVi();
40950
+ if (dataKySoDonVi) {
40951
+ // lấy số DocNumber
40952
+ if (dataKySoDonVi.docNumber) {
40953
+ prms['DocNumber'] = dataKySoDonVi.docNumber;
40954
+ }
40955
+ // lấy ngày ban hành vb đi
40956
+ if (dataKySoDonVi.issuedDate) {
40957
+ prms['IssuedDate'] = dataKySoDonVi.issuedDate;
40958
+ }
40959
+ }
40960
+ }
40961
+ // tslint:disable-next-line: variable-name
40962
+ var json_prms = JSON.stringify(prms);
40963
+ vgca_sign_issued(json_prms, function (result) {
40964
+ var resultObj = JSON.parse(result);
40965
+ if (resultObj.FileServer != '') {
40966
+ _this._fileExplorerService
40967
+ .saveSignedFile({
40968
+ sourceFile: sourceFile_3,
40969
+ tempFileId: resultObj.FileServer,
40970
+ })
40971
+ .then(function (rss) {
40972
+ _this.getServiceFile();
40973
+ _this._notifierService.showSuccess('Ký số thành công');
40974
+ });
40975
+ }
40976
+ });
40977
+ });
40978
+ _b.label = 5;
40979
+ case 5: return [2 /*return*/];
39736
40980
  }
39737
40981
  });
39738
- });
40982
+ }); });
39739
40983
  };
39740
40984
  return ServiceFileUploadComponent;
39741
40985
  }(ComponentBase));
39742
40986
  ServiceFileUploadComponent.decorators = [
39743
40987
  { type: i0.Component, args: [{
39744
40988
  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>",
40989
+ 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
40990
  providers: [
39747
40991
  {
39748
40992
  provide: forms.NG_VALUE_ACCESSOR,
@@ -39751,7 +40995,7 @@
39751
40995
  },
39752
40996
  ComponentContextService
39753
40997
  ],
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}"]
40998
+ 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
40999
  },] }
39756
41000
  ];
39757
41001
  ServiceFileUploadComponent.ctorParameters = function () { return [
@@ -39764,6 +41008,7 @@
39764
41008
  { type: NotifierService },
39765
41009
  { type: DownloadLinkService },
39766
41010
  { type: FileExplorerService },
41011
+ { type: ngxDeviceDetector.DeviceDetectorService },
39767
41012
  { type: i0.Injector }
39768
41013
  ]; };
39769
41014
  ServiceFileUploadComponent.propDecorators = {
@@ -39777,6 +41022,7 @@
39777
41022
  entity: [{ type: i0.Input }],
39778
41023
  entityKey: [{ type: i0.Input }],
39779
41024
  chooseLabel: [{ type: i0.Input }],
41025
+ parentSetting: [{ type: i0.Input }],
39780
41026
  onInit: [{ type: i0.Output }],
39781
41027
  onSelect: [{ type: i0.Output }],
39782
41028
  onRemove: [{ type: i0.Output }],