tnx-shared 5.3.399 → 5.3.401

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.
@@ -35738,6 +35738,24 @@
35738
35738
  && this._deviceDetectorService.isDesktop()
35739
35739
  && this.layout !== exports.EnumFileLayout.SIMPLE_FOR_LIST && !this.parentSetting.hiddenKySoUsbCaNhan),
35740
35740
  },
35741
+ {
35742
+ label: 'Bút phê', icon: 'fas fa-comment-dots',
35743
+ command: function () {
35744
+ _this.addComment(item);
35745
+ },
35746
+ visible: (this._fileObjectService.isTypeFileKySo(item.name)
35747
+ && this._deviceDetectorService.isDesktop()
35748
+ && this.layout !== exports.EnumFileLayout.SIMPLE_FOR_LIST && !this.parentSetting.hiddenKySoUsbCaNhan),
35749
+ },
35750
+ {
35751
+ label: 'Bút phê và ký', icon: 'fas fa-comment-medical',
35752
+ command: function () {
35753
+ _this.addCommentAndSign(item);
35754
+ },
35755
+ visible: (this._fileObjectService.isTypeFileKySo(item.name)
35756
+ && this._deviceDetectorService.isDesktop()
35757
+ && this.layout !== exports.EnumFileLayout.SIMPLE_FOR_LIST && !this.parentSetting.hiddenKySoUsbCaNhan),
35758
+ },
35741
35759
  {
35742
35760
  label: 'Ký số đơn vị (USB)', icon: 'fas fa-signature',
35743
35761
  command: function () {
@@ -36507,19 +36525,176 @@
36507
36525
  });
36508
36526
  }); });
36509
36527
  };
36528
+ FileManagerComponent.prototype.addComment = function (file) {
36529
+ var _this = this;
36530
+ 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 () {
36531
+ var sourceFileId, sourceFile_2, rsConvert, e_2;
36532
+ var _this = this;
36533
+ return __generator(this, function (_b) {
36534
+ switch (_b.label) {
36535
+ case 0:
36536
+ if (!rs) return [3 /*break*/, 5];
36537
+ sourceFileId = file.id;
36538
+ sourceFile_2 = file;
36539
+ if (!this._fileExplorerService.needConvertBeforeSign(file.name)) return [3 /*break*/, 4];
36540
+ _b.label = 1;
36541
+ case 1:
36542
+ _b.trys.push([1, 3, , 4]);
36543
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
36544
+ instanceId: sourceFileId,
36545
+ name: this._fileExplorerService.changeFileExtension(file.name, 'pdf'),
36546
+ folderInstanceId: file.parentFolderId,
36547
+ ownerType: this._userService.getCurrentUser().userId.toString(),
36548
+ })];
36549
+ case 2:
36550
+ rsConvert = _b.sent();
36551
+ if (!rsConvert || !rsConvert.success) {
36552
+ 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");
36553
+ return [2 /*return*/];
36554
+ }
36555
+ else {
36556
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
36557
+ sourceFileId = rsConvert.data;
36558
+ sourceFile_2 = { id: sourceFileId };
36559
+ this._triggerProcessData();
36560
+ }
36561
+ return [3 /*break*/, 4];
36562
+ case 3:
36563
+ e_2 = _b.sent();
36564
+ 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");
36565
+ return [2 /*return*/];
36566
+ case 4:
36567
+ this._fileExplorerService.generateLinkDownload({
36568
+ fileId: sourceFileId,
36569
+ }).then(function (rs) {
36570
+ var url = _this._downloadLinkService.getDownloadForSignUrl(rs.data);
36571
+ var prms = {};
36572
+ prms['FileUploadHandler'] = _this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + _this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile";
36573
+ prms['SessionId'] = '';
36574
+ prms['FileName'] = url;
36575
+ // tslint:disable-next-line: variable-name
36576
+ var json_prms = JSON.stringify(prms);
36577
+ vgca_comment(json_prms, function (result) {
36578
+ var resultObj = JSON.parse(result);
36579
+ if (resultObj.FileServer != '') {
36580
+ _this._fileExplorerService.saveSignedFile({
36581
+ sourceFile: sourceFile_2,
36582
+ tempFileId: resultObj.FileServer,
36583
+ }).then(function (rss) {
36584
+ _this._triggerProcessData();
36585
+ _this._notifierService.showSuccess('Tạo bút phê thành công');
36586
+ });
36587
+ }
36588
+ });
36589
+ });
36590
+ _b.label = 5;
36591
+ case 5: return [2 /*return*/];
36592
+ }
36593
+ });
36594
+ }); });
36595
+ };
36596
+ FileManagerComponent.prototype.addCommentAndSign = function (file) {
36597
+ return __awaiter(this, void 0, void 0, function () {
36598
+ var rs, sourceFileId, sourceFile, rsConvert, e_3, downloadLink, url, prms, json_prms_1, commentResult, resultObj, downloadLink2, url2, prms2, json_prms2_1, signResult, signResultObj;
36599
+ return __generator(this, function (_b) {
36600
+ switch (_b.label) {
36601
+ 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?')];
36602
+ case 1:
36603
+ rs = _b.sent();
36604
+ if (!rs) return [3 /*break*/, 11];
36605
+ sourceFileId = file.id;
36606
+ sourceFile = file;
36607
+ if (!this._fileExplorerService.needConvertBeforeSign(file.name)) return [3 /*break*/, 5];
36608
+ _b.label = 2;
36609
+ case 2:
36610
+ _b.trys.push([2, 4, , 5]);
36611
+ return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
36612
+ instanceId: sourceFileId,
36613
+ name: this._fileExplorerService.changeFileExtension(file.name, 'pdf'),
36614
+ folderInstanceId: file.parentFolderId,
36615
+ ownerType: this._userService.getCurrentUser().userId.toString(),
36616
+ })];
36617
+ case 3:
36618
+ rsConvert = _b.sent();
36619
+ if (!rsConvert || !rsConvert.success) {
36620
+ 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");
36621
+ return [2 /*return*/];
36622
+ }
36623
+ else {
36624
+ this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
36625
+ sourceFileId = rsConvert.data;
36626
+ sourceFile = { id: sourceFileId };
36627
+ this._triggerProcessData();
36628
+ }
36629
+ return [3 /*break*/, 5];
36630
+ case 4:
36631
+ e_3 = _b.sent();
36632
+ 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");
36633
+ return [2 /*return*/];
36634
+ case 5: return [4 /*yield*/, this._fileExplorerService.generateLinkDownload({
36635
+ fileId: sourceFileId,
36636
+ })];
36637
+ case 6:
36638
+ downloadLink = _b.sent();
36639
+ url = this._downloadLinkService.getDownloadForSignUrl(downloadLink.data);
36640
+ prms = {
36641
+ FileUploadHandler: this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile",
36642
+ SessionId: '',
36643
+ FileName: url
36644
+ };
36645
+ json_prms_1 = JSON.stringify(prms);
36646
+ return [4 /*yield*/, new Promise(function (resolve) {
36647
+ vgca_comment(json_prms_1, function (result) { return resolve(result); });
36648
+ })];
36649
+ case 7:
36650
+ commentResult = _b.sent();
36651
+ resultObj = JSON.parse(commentResult);
36652
+ return [4 /*yield*/, this._fileExplorerService.generateLinkDownload({
36653
+ fileId: resultObj.FileServer,
36654
+ })];
36655
+ case 8:
36656
+ downloadLink2 = _b.sent();
36657
+ url2 = this._downloadLinkService.getDownloadForSignUrl(downloadLink2.data);
36658
+ prms2 = {
36659
+ FileUploadHandler: this._moduleConfig.environment.apiDomain.fileEndpoint + "/" + this._moduleConfig.environment.apiVersion + "/KySoFile/SavePhysicalSignedFile",
36660
+ SessionId: '',
36661
+ FileName: url2
36662
+ };
36663
+ json_prms2_1 = JSON.stringify(prms2);
36664
+ return [4 /*yield*/, new Promise(function (resolve) {
36665
+ vgca_sign_approved(json_prms2_1, function (result) { return resolve(result); });
36666
+ })];
36667
+ case 9:
36668
+ signResult = _b.sent();
36669
+ signResultObj = JSON.parse(signResult);
36670
+ if (!(signResultObj.FileServer != '')) return [3 /*break*/, 11];
36671
+ return [4 /*yield*/, this._fileExplorerService.saveSignedFile({
36672
+ sourceFile: sourceFile,
36673
+ tempFileId: signResultObj.FileServer,
36674
+ })];
36675
+ case 10:
36676
+ _b.sent();
36677
+ this._triggerProcessData();
36678
+ this._notifierService.showSuccess('Tạo bút phê và ký thành công');
36679
+ _b.label = 11;
36680
+ case 11: return [2 /*return*/];
36681
+ }
36682
+ });
36683
+ });
36684
+ };
36510
36685
  FileManagerComponent.prototype.signFileDonVi = function (file) {
36511
36686
  var _this = this;
36512
36687
  this._notifierService
36513
36688
  .showConfirm('Bạn có chắc chắn muốn ký số đơn vị văn bản này?')
36514
36689
  .then(function (rs) { return __awaiter(_this, void 0, void 0, function () {
36515
- var sourceFileId, sourceFile_2, rsConvert, e_2;
36690
+ var sourceFileId, sourceFile_3, rsConvert, e_4;
36516
36691
  var _this = this;
36517
36692
  return __generator(this, function (_b) {
36518
36693
  switch (_b.label) {
36519
36694
  case 0:
36520
36695
  if (!rs) return [3 /*break*/, 5];
36521
36696
  sourceFileId = file.id;
36522
- sourceFile_2 = file;
36697
+ sourceFile_3 = file;
36523
36698
  if (!this._fileExplorerService.needConvertBeforeSign(file.name)) return [3 /*break*/, 4];
36524
36699
  _b.label = 1;
36525
36700
  case 1:
@@ -36540,11 +36715,11 @@
36540
36715
  this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + file.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
36541
36716
  this._triggerProcessData();
36542
36717
  sourceFileId = rsConvert.data;
36543
- sourceFile_2 = { id: sourceFileId };
36718
+ sourceFile_3 = { id: sourceFileId };
36544
36719
  }
36545
36720
  return [3 /*break*/, 4];
36546
36721
  case 3:
36547
- e_2 = _b.sent();
36722
+ e_4 = _b.sent();
36548
36723
  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");
36549
36724
  return [2 /*return*/];
36550
36725
  case 4:
@@ -36581,7 +36756,7 @@
36581
36756
  if (resultObj.FileServer != '') {
36582
36757
  _this._fileExplorerService
36583
36758
  .saveSignedFile({
36584
- sourceFile: sourceFile_2,
36759
+ sourceFile: sourceFile_3,
36585
36760
  tempFileId: resultObj.FileServer,
36586
36761
  })
36587
36762
  .then(function (rss) {
@@ -36773,7 +36948,7 @@
36773
36948
  });
36774
36949
  };
36775
36950
  FileManagerComponent.prototype.buildTreeData = function (data, rootFolderId) {
36776
- var e_3, _b;
36951
+ var e_5, _b;
36777
36952
  var result = [];
36778
36953
  var rootData = data.filter(function (x) { return x.parentFolderId == rootFolderId; });
36779
36954
  if (rootData.length > 0) {
@@ -36789,12 +36964,12 @@
36789
36964
  });
36790
36965
  }
36791
36966
  }
36792
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
36967
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
36793
36968
  finally {
36794
36969
  try {
36795
36970
  if (rootData_1_1 && !rootData_1_1.done && (_b = rootData_1.return)) _b.call(rootData_1);
36796
36971
  }
36797
- finally { if (e_3) throw e_3.error; }
36972
+ finally { if (e_5) throw e_5.error; }
36798
36973
  }
36799
36974
  }
36800
36975
  return result;