tnx-shared 5.3.400 → 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.
- package/bundles/tnx-shared.umd.js +103 -5
- package/bundles/tnx-shared.umd.js.map +1 -1
- package/bundles/tnx-shared.umd.min.js +1 -1
- package/bundles/tnx-shared.umd.min.js.map +1 -1
- package/components/file-explorer/file-manager/file-manager.component.d.ts +1 -0
- package/components/file-explorer/file-manager/file-manager.component.d.ts.map +1 -1
- package/esm2015/components/file-explorer/file-manager/file-manager.component.js +82 -1
- package/fesm2015/tnx-shared.js +81 -0
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
- package/tnx-shared.metadata.json +1 -1
|
@@ -35747,6 +35747,15 @@
|
|
|
35747
35747
|
&& this._deviceDetectorService.isDesktop()
|
|
35748
35748
|
&& this.layout !== exports.EnumFileLayout.SIMPLE_FOR_LIST && !this.parentSetting.hiddenKySoUsbCaNhan),
|
|
35749
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
|
+
},
|
|
35750
35759
|
{
|
|
35751
35760
|
label: 'Ký số đơn vị (USB)', icon: 'fas fa-signature',
|
|
35752
35761
|
command: function () {
|
|
@@ -36584,12 +36593,101 @@
|
|
|
36584
36593
|
});
|
|
36585
36594
|
}); });
|
|
36586
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
|
+
};
|
|
36587
36685
|
FileManagerComponent.prototype.signFileDonVi = function (file) {
|
|
36588
36686
|
var _this = this;
|
|
36589
36687
|
this._notifierService
|
|
36590
36688
|
.showConfirm('Bạn có chắc chắn muốn ký số đơn vị văn bản này?')
|
|
36591
36689
|
.then(function (rs) { return __awaiter(_this, void 0, void 0, function () {
|
|
36592
|
-
var sourceFileId, sourceFile_3, rsConvert,
|
|
36690
|
+
var sourceFileId, sourceFile_3, rsConvert, e_4;
|
|
36593
36691
|
var _this = this;
|
|
36594
36692
|
return __generator(this, function (_b) {
|
|
36595
36693
|
switch (_b.label) {
|
|
@@ -36621,7 +36719,7 @@
|
|
|
36621
36719
|
}
|
|
36622
36720
|
return [3 /*break*/, 4];
|
|
36623
36721
|
case 3:
|
|
36624
|
-
|
|
36722
|
+
e_4 = _b.sent();
|
|
36625
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");
|
|
36626
36724
|
return [2 /*return*/];
|
|
36627
36725
|
case 4:
|
|
@@ -36850,7 +36948,7 @@
|
|
|
36850
36948
|
});
|
|
36851
36949
|
};
|
|
36852
36950
|
FileManagerComponent.prototype.buildTreeData = function (data, rootFolderId) {
|
|
36853
|
-
var
|
|
36951
|
+
var e_5, _b;
|
|
36854
36952
|
var result = [];
|
|
36855
36953
|
var rootData = data.filter(function (x) { return x.parentFolderId == rootFolderId; });
|
|
36856
36954
|
if (rootData.length > 0) {
|
|
@@ -36866,12 +36964,12 @@
|
|
|
36866
36964
|
});
|
|
36867
36965
|
}
|
|
36868
36966
|
}
|
|
36869
|
-
catch (
|
|
36967
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
36870
36968
|
finally {
|
|
36871
36969
|
try {
|
|
36872
36970
|
if (rootData_1_1 && !rootData_1_1.done && (_b = rootData_1.return)) _b.call(rootData_1);
|
|
36873
36971
|
}
|
|
36874
|
-
finally { if (
|
|
36972
|
+
finally { if (e_5) throw e_5.error; }
|
|
36875
36973
|
}
|
|
36876
36974
|
}
|
|
36877
36975
|
return result;
|