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
package/fesm2015/tnx-shared.js
CHANGED
|
@@ -31152,6 +31152,15 @@ class FileManagerComponent extends DataListBase {
|
|
|
31152
31152
|
&& this._deviceDetectorService.isDesktop()
|
|
31153
31153
|
&& this.layout !== EnumFileLayout.SIMPLE_FOR_LIST && !this.parentSetting.hiddenKySoUsbCaNhan),
|
|
31154
31154
|
},
|
|
31155
|
+
{
|
|
31156
|
+
label: 'Bút phê và ký', icon: 'fas fa-comment-medical',
|
|
31157
|
+
command: () => {
|
|
31158
|
+
this.addCommentAndSign(item);
|
|
31159
|
+
},
|
|
31160
|
+
visible: (this._fileObjectService.isTypeFileKySo(item.name)
|
|
31161
|
+
&& this._deviceDetectorService.isDesktop()
|
|
31162
|
+
&& this.layout !== EnumFileLayout.SIMPLE_FOR_LIST && !this.parentSetting.hiddenKySoUsbCaNhan),
|
|
31163
|
+
},
|
|
31155
31164
|
{
|
|
31156
31165
|
label: 'Ký số đơn vị (USB)', icon: 'fas fa-signature',
|
|
31157
31166
|
command: () => {
|
|
@@ -31901,6 +31910,78 @@ class FileManagerComponent extends DataListBase {
|
|
|
31901
31910
|
}
|
|
31902
31911
|
}));
|
|
31903
31912
|
}
|
|
31913
|
+
addCommentAndSign(file) {
|
|
31914
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31915
|
+
const rs = 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?');
|
|
31916
|
+
if (rs) {
|
|
31917
|
+
let sourceFileId = file.id;
|
|
31918
|
+
let sourceFile = file;
|
|
31919
|
+
// Ký số file word - cần convert sang pdf trước
|
|
31920
|
+
if (this._fileExplorerService.needConvertBeforeSign(file.name)) {
|
|
31921
|
+
// convert file before sign
|
|
31922
|
+
try {
|
|
31923
|
+
const rsConvert = yield this._fileExplorerService.convertDocumentToPdfAndSave({
|
|
31924
|
+
instanceId: sourceFileId,
|
|
31925
|
+
name: this._fileExplorerService.changeFileExtension(file.name, 'pdf'),
|
|
31926
|
+
folderInstanceId: file.parentFolderId,
|
|
31927
|
+
ownerType: this._userService.getCurrentUser().userId.toString(),
|
|
31928
|
+
});
|
|
31929
|
+
if (!rsConvert || !rsConvert.success) {
|
|
31930
|
+
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`);
|
|
31931
|
+
return;
|
|
31932
|
+
}
|
|
31933
|
+
else {
|
|
31934
|
+
this._notifierService.showSuccess(`Chuyển đổi tài liệu ${file.name} thành pdf thành công`);
|
|
31935
|
+
sourceFileId = rsConvert.data;
|
|
31936
|
+
sourceFile = { id: sourceFileId };
|
|
31937
|
+
this._triggerProcessData();
|
|
31938
|
+
}
|
|
31939
|
+
}
|
|
31940
|
+
catch (e) {
|
|
31941
|
+
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`);
|
|
31942
|
+
return;
|
|
31943
|
+
}
|
|
31944
|
+
}
|
|
31945
|
+
const downloadLink = yield this._fileExplorerService.generateLinkDownload({
|
|
31946
|
+
fileId: sourceFileId,
|
|
31947
|
+
});
|
|
31948
|
+
const url = this._downloadLinkService.getDownloadForSignUrl(downloadLink.data);
|
|
31949
|
+
const prms = {
|
|
31950
|
+
FileUploadHandler: `${this._moduleConfig.environment.apiDomain.fileEndpoint}/${this._moduleConfig.environment.apiVersion}/KySoFile/SavePhysicalSignedFile`,
|
|
31951
|
+
SessionId: '',
|
|
31952
|
+
FileName: url
|
|
31953
|
+
};
|
|
31954
|
+
const json_prms = JSON.stringify(prms);
|
|
31955
|
+
// Wrap callback-based functions in Promises
|
|
31956
|
+
const commentResult = yield new Promise((resolve) => {
|
|
31957
|
+
vgca_comment(json_prms, (result) => resolve(result));
|
|
31958
|
+
});
|
|
31959
|
+
const resultObj = JSON.parse(commentResult);
|
|
31960
|
+
const downloadLink2 = yield this._fileExplorerService.generateLinkDownload({
|
|
31961
|
+
fileId: resultObj.FileServer,
|
|
31962
|
+
});
|
|
31963
|
+
const url2 = this._downloadLinkService.getDownloadForSignUrl(downloadLink2.data);
|
|
31964
|
+
const prms2 = {
|
|
31965
|
+
FileUploadHandler: `${this._moduleConfig.environment.apiDomain.fileEndpoint}/${this._moduleConfig.environment.apiVersion}/KySoFile/SavePhysicalSignedFile`,
|
|
31966
|
+
SessionId: '',
|
|
31967
|
+
FileName: url2
|
|
31968
|
+
};
|
|
31969
|
+
const json_prms2 = JSON.stringify(prms2);
|
|
31970
|
+
const signResult = yield new Promise((resolve) => {
|
|
31971
|
+
vgca_sign_approved(json_prms2, (result) => resolve(result));
|
|
31972
|
+
});
|
|
31973
|
+
const signResultObj = JSON.parse(signResult);
|
|
31974
|
+
if (signResultObj.FileServer != '') {
|
|
31975
|
+
yield this._fileExplorerService.saveSignedFile({
|
|
31976
|
+
sourceFile: sourceFile,
|
|
31977
|
+
tempFileId: signResultObj.FileServer,
|
|
31978
|
+
});
|
|
31979
|
+
this._triggerProcessData();
|
|
31980
|
+
this._notifierService.showSuccess('Tạo bút phê và ký thành công');
|
|
31981
|
+
}
|
|
31982
|
+
}
|
|
31983
|
+
});
|
|
31984
|
+
}
|
|
31904
31985
|
signFileDonVi(file) {
|
|
31905
31986
|
this._notifierService
|
|
31906
31987
|
.showConfirm('Bạn có chắc chắn muốn ký số đơn vị văn bản này?')
|