tnx-shared 5.3.399 → 5.3.400

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.
@@ -31143,6 +31143,15 @@ class FileManagerComponent extends DataListBase {
31143
31143
  && this._deviceDetectorService.isDesktop()
31144
31144
  && this.layout !== EnumFileLayout.SIMPLE_FOR_LIST && !this.parentSetting.hiddenKySoUsbCaNhan),
31145
31145
  },
31146
+ {
31147
+ label: 'Bút phê', icon: 'fas fa-comment-dots',
31148
+ command: () => {
31149
+ this.addComment(item);
31150
+ },
31151
+ visible: (this._fileObjectService.isTypeFileKySo(item.name)
31152
+ && this._deviceDetectorService.isDesktop()
31153
+ && this.layout !== EnumFileLayout.SIMPLE_FOR_LIST && !this.parentSetting.hiddenKySoUsbCaNhan),
31154
+ },
31146
31155
  {
31147
31156
  label: 'Ký số đơn vị (USB)', icon: 'fas fa-signature',
31148
31157
  command: () => {
@@ -31835,6 +31844,63 @@ class FileManagerComponent extends DataListBase {
31835
31844
  }
31836
31845
  }));
31837
31846
  }
31847
+ addComment(file) {
31848
+ this._notifierService.showConfirm('Bạn có chắc chắn muốn bút phê văn bản này?').then((rs) => __awaiter(this, void 0, void 0, function* () {
31849
+ if (rs) {
31850
+ let sourceFileId = file.id;
31851
+ let sourceFile = file;
31852
+ // Ký số file word - cần convert sang pdf trước
31853
+ if (this._fileExplorerService.needConvertBeforeSign(file.name)) {
31854
+ // convert file before sign
31855
+ try {
31856
+ const rsConvert = yield this._fileExplorerService.convertDocumentToPdfAndSave({
31857
+ instanceId: sourceFileId,
31858
+ name: this._fileExplorerService.changeFileExtension(file.name, 'pdf'),
31859
+ folderInstanceId: file.parentFolderId,
31860
+ ownerType: this._userService.getCurrentUser().userId.toString(),
31861
+ });
31862
+ if (!rsConvert || !rsConvert.success) {
31863
+ this._notifierService.showWarning(`Có lỗi xảy ra khi chuyển đổi tài liệu ${file.name} thành pdf để ký. Vui lòng thử lại sau`);
31864
+ return;
31865
+ }
31866
+ else {
31867
+ this._notifierService.showSuccess(`Chuyển đổi tài liệu ${file.name} thành pdf thành công`);
31868
+ sourceFileId = rsConvert.data;
31869
+ sourceFile = { id: sourceFileId };
31870
+ this._triggerProcessData();
31871
+ }
31872
+ }
31873
+ catch (e) {
31874
+ this._notifierService.showWarning(`Có lỗi xảy ra khi chuyển đổi tài liệu ${file.name} thành pdf để ký. Vui lòng thử lại sau`);
31875
+ return;
31876
+ }
31877
+ }
31878
+ this._fileExplorerService.generateLinkDownload({
31879
+ fileId: sourceFileId,
31880
+ }).then(rs => {
31881
+ const url = this._downloadLinkService.getDownloadForSignUrl(rs.data);
31882
+ const prms = {};
31883
+ prms['FileUploadHandler'] = `${this._moduleConfig.environment.apiDomain.fileEndpoint}/${this._moduleConfig.environment.apiVersion}/KySoFile/SavePhysicalSignedFile`;
31884
+ prms['SessionId'] = '';
31885
+ prms['FileName'] = url;
31886
+ // tslint:disable-next-line: variable-name
31887
+ const json_prms = JSON.stringify(prms);
31888
+ vgca_comment(json_prms, (result) => {
31889
+ const resultObj = JSON.parse(result);
31890
+ if (resultObj.FileServer != '') {
31891
+ this._fileExplorerService.saveSignedFile({
31892
+ sourceFile: sourceFile,
31893
+ tempFileId: resultObj.FileServer,
31894
+ }).then(rss => {
31895
+ this._triggerProcessData();
31896
+ this._notifierService.showSuccess('Tạo bút phê thành công');
31897
+ });
31898
+ }
31899
+ });
31900
+ });
31901
+ }
31902
+ }));
31903
+ }
31838
31904
  signFileDonVi(file) {
31839
31905
  this._notifierService
31840
31906
  .showConfirm('Bạn có chắc chắn muốn ký số đơn vị văn bản này?')