tnx-shared 5.3.412 → 5.3.414
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/assets/Dockerfile.ci +1 -1
- package/bundles/tnx-shared.umd.js +175 -0
- 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/classes/constants.d.ts +2 -1
- package/classes/constants.d.ts.map +1 -1
- package/classes/form-schema.d.ts +1 -0
- package/classes/form-schema.d.ts.map +1 -1
- package/components/file-explorer/file-manager/file-manager.component.d.ts +3 -0
- package/components/file-explorer/file-manager/file-manager.component.d.ts.map +1 -1
- package/esm2015/classes/constants.js +2 -1
- package/esm2015/classes/form-schema.js +2 -1
- package/esm2015/components/file-explorer/file-manager/file-manager.component.js +156 -1
- package/esm2015/public-api.js +2 -2
- package/fesm2015/tnx-shared.js +157 -0
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
- package/tnx-shared.metadata.json +1 -1
package/assets/Dockerfile.ci
CHANGED
|
@@ -1038,6 +1038,7 @@
|
|
|
1038
1038
|
(function (EnumProcessWorkflowType) {
|
|
1039
1039
|
EnumProcessWorkflowType[EnumProcessWorkflowType["EDIT"] = 1] = "EDIT";
|
|
1040
1040
|
EnumProcessWorkflowType[EnumProcessWorkflowType["VIEW"] = 2] = "VIEW";
|
|
1041
|
+
EnumProcessWorkflowType[EnumProcessWorkflowType["COEDIT"] = 3] = "COEDIT";
|
|
1041
1042
|
})(exports.EnumProcessWorkflowType || (exports.EnumProcessWorkflowType = {}));
|
|
1042
1043
|
var WfItem = /** @class */ (function () {
|
|
1043
1044
|
function WfItem() {
|
|
@@ -1356,6 +1357,7 @@
|
|
|
1356
1357
|
this.function = new CrudFormCustomFunction();
|
|
1357
1358
|
this.hiddenKySoSimCaNhan = false;
|
|
1358
1359
|
this.hiddenKySoUsbCaNhan = false;
|
|
1360
|
+
this.hiddenKySoVNPTCA = false;
|
|
1359
1361
|
this.hiddenKySoDonVi = false;
|
|
1360
1362
|
this.hiddenKySoSmartCA = false;
|
|
1361
1363
|
this.hiddenButPhe = false;
|
|
@@ -35660,6 +35662,7 @@
|
|
|
35660
35662
|
visible: this.showFileVersion
|
|
35661
35663
|
}),
|
|
35662
35664
|
];
|
|
35665
|
+
this.checkPlugin();
|
|
35663
35666
|
this.initSetting();
|
|
35664
35667
|
};
|
|
35665
35668
|
FileManagerComponent.prototype.initSetting = function () {
|
|
@@ -35790,6 +35793,16 @@
|
|
|
35790
35793
|
&& this._deviceDetectorService.isDesktop()
|
|
35791
35794
|
&& this.layout !== exports.EnumFileLayout.SIMPLE_FOR_LIST && !this.parentSetting.hiddenKySoUsbCaNhan),
|
|
35792
35795
|
},
|
|
35796
|
+
{
|
|
35797
|
+
label: 'Ký số VNPTCA', icon: 'fas fa-signature',
|
|
35798
|
+
command: function () {
|
|
35799
|
+
_this.model.selectedItem = item;
|
|
35800
|
+
_this.signVNPTCA(item);
|
|
35801
|
+
},
|
|
35802
|
+
visible: (this._fileObjectService.isTypeFileKySo(item.name)
|
|
35803
|
+
&& this._deviceDetectorService.isDesktop()
|
|
35804
|
+
&& this.layout !== exports.EnumFileLayout.SIMPLE_FOR_LIST && !this.parentSetting.hiddenKySoVNPTCA),
|
|
35805
|
+
},
|
|
35793
35806
|
{
|
|
35794
35807
|
label: 'Bút phê', icon: 'fas fa-comment-dots',
|
|
35795
35808
|
command: function () {
|
|
@@ -37123,6 +37136,168 @@
|
|
|
37123
37136
|
FileManagerComponent.prototype.getPathImage = function (fileId) {
|
|
37124
37137
|
return this._fileObjectService.getUrlImage(fileId);
|
|
37125
37138
|
};
|
|
37139
|
+
FileManagerComponent.prototype.signVNPTCA = function (item) {
|
|
37140
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
37141
|
+
var sourceFileId, rsConvert, e_7, dataInput, sigOptions, dataJS, data, e_8;
|
|
37142
|
+
return __generator(this, function (_b) {
|
|
37143
|
+
switch (_b.label) {
|
|
37144
|
+
case 0:
|
|
37145
|
+
sourceFileId = item.id;
|
|
37146
|
+
if (!this._fileExplorerService.needConvertBeforeSign(item.name)) return [3 /*break*/, 4];
|
|
37147
|
+
_b.label = 1;
|
|
37148
|
+
case 1:
|
|
37149
|
+
_b.trys.push([1, 3, , 4]);
|
|
37150
|
+
return [4 /*yield*/, this._fileExplorerService.convertDocumentToPdfAndSave({
|
|
37151
|
+
instanceId: item.id,
|
|
37152
|
+
name: this._fileExplorerService.changeFileExtension(item.name, 'pdf'),
|
|
37153
|
+
folderInstanceId: item.parentFolderId,
|
|
37154
|
+
ownerType: this._userService.getCurrentUser().userId.toString(),
|
|
37155
|
+
})];
|
|
37156
|
+
case 2:
|
|
37157
|
+
rsConvert = _b.sent();
|
|
37158
|
+
if (!rsConvert || !rsConvert.success) {
|
|
37159
|
+
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");
|
|
37160
|
+
return [2 /*return*/];
|
|
37161
|
+
}
|
|
37162
|
+
else {
|
|
37163
|
+
this._notifierService.showSuccess("Chuy\u1EC3n \u0111\u1ED5i t\u00E0i li\u1EC7u " + item.name + " th\u00E0nh pdf th\u00E0nh c\u00F4ng");
|
|
37164
|
+
sourceFileId = rsConvert.data;
|
|
37165
|
+
this.model.selectedItem.id = rsConvert.data;
|
|
37166
|
+
this._triggerProcessData();
|
|
37167
|
+
}
|
|
37168
|
+
return [3 /*break*/, 4];
|
|
37169
|
+
case 3:
|
|
37170
|
+
e_7 = _b.sent();
|
|
37171
|
+
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");
|
|
37172
|
+
return [2 /*return*/];
|
|
37173
|
+
case 4: return [4 /*yield*/, this._fileExplorerService.getBase64FromFileId(sourceFileId)];
|
|
37174
|
+
case 5:
|
|
37175
|
+
dataInput = (_b.sent()).split(',')[1];
|
|
37176
|
+
sigOptions = new PdfSigner();
|
|
37177
|
+
sigOptions.page = 1;
|
|
37178
|
+
sigOptions.AdvancedCustom = true;
|
|
37179
|
+
sigOptions.SigType = 1;
|
|
37180
|
+
dataJS = {
|
|
37181
|
+
data: dataInput,
|
|
37182
|
+
type: 'pdf',
|
|
37183
|
+
sigOptions: JSON.stringify(sigOptions)
|
|
37184
|
+
};
|
|
37185
|
+
_b.label = 6;
|
|
37186
|
+
case 6:
|
|
37187
|
+
_b.trys.push([6, 8, , 9]);
|
|
37188
|
+
return [4 /*yield*/, vnpt_plugin.signArrDataAdvanced([JSON.stringify(dataJS)], "", false)];
|
|
37189
|
+
case 7:
|
|
37190
|
+
data = _b.sent();
|
|
37191
|
+
this.handeResult(data);
|
|
37192
|
+
return [3 /*break*/, 9];
|
|
37193
|
+
case 8:
|
|
37194
|
+
e_8 = _b.sent();
|
|
37195
|
+
console.log(e_8);
|
|
37196
|
+
return [3 /*break*/, 9];
|
|
37197
|
+
case 9: return [2 /*return*/];
|
|
37198
|
+
}
|
|
37199
|
+
});
|
|
37200
|
+
});
|
|
37201
|
+
};
|
|
37202
|
+
FileManagerComponent.prototype.checkPlugin = function () {
|
|
37203
|
+
var _this = this;
|
|
37204
|
+
try {
|
|
37205
|
+
// checkbrowser support
|
|
37206
|
+
// Kiem tra plugin
|
|
37207
|
+
var timer = null;
|
|
37208
|
+
var key = this._moduleConfig.environment.VNPTLicenseKey;
|
|
37209
|
+
vnpt_plugin.checkPlugin().then(function (data) {
|
|
37210
|
+
if (data === "1") {
|
|
37211
|
+
console.log("Plugin đã sẵn sàng");
|
|
37212
|
+
vnpt_plugin.setLicenseKey(key).then(function (data) {
|
|
37213
|
+
vnpt_plugin.SetShowCertListDialog(true);
|
|
37214
|
+
}).catch(function (e) {
|
|
37215
|
+
console.log(e);
|
|
37216
|
+
});
|
|
37217
|
+
}
|
|
37218
|
+
else {
|
|
37219
|
+
// app dung cho ban 1.0.0.9 tro len
|
|
37220
|
+
if (vnpt_plugin.getOsName() !== "MAC") {
|
|
37221
|
+
if (vnpt_plugin.checkBrowserSupportWS()) {
|
|
37222
|
+
var protoUrl = "vnpt-plugin:\/\/resolve?domain=vnpt";
|
|
37223
|
+
window.protocolCheck("vnpt-plugin:\/\/resolve?domain=a", function () {
|
|
37224
|
+
console.log("VNPT-CA Plugin chưa được cài đặt hoặc chưa được bật");
|
|
37225
|
+
clearTimeout(timer); // clear
|
|
37226
|
+
});
|
|
37227
|
+
timer = setTimeout(_this.checkPlugin, 1500);
|
|
37228
|
+
}
|
|
37229
|
+
}
|
|
37230
|
+
else {
|
|
37231
|
+
console.log("VNPT-CA Plugin chưa được cài đặt hoặc chưa được bật");
|
|
37232
|
+
}
|
|
37233
|
+
}
|
|
37234
|
+
}).catch(function (e) {
|
|
37235
|
+
console.log("VNPT-CA Plugin chưa được cài đặt hoặc chưa được bật");
|
|
37236
|
+
});
|
|
37237
|
+
}
|
|
37238
|
+
catch (e) {
|
|
37239
|
+
console.log(e);
|
|
37240
|
+
}
|
|
37241
|
+
};
|
|
37242
|
+
FileManagerComponent.prototype.handeResult = function (data) {
|
|
37243
|
+
var _this = this;
|
|
37244
|
+
if (typeof JSON.parse(data).code !== 'undefined') {
|
|
37245
|
+
var jsOb = JSON.parse(data);
|
|
37246
|
+
}
|
|
37247
|
+
else {
|
|
37248
|
+
var jsOb = JSON.parse(JSON.parse(data)[0]);
|
|
37249
|
+
}
|
|
37250
|
+
switch (jsOb.code) {
|
|
37251
|
+
case 0:
|
|
37252
|
+
this._fileExplorerService.kySimSaveSignedFile({
|
|
37253
|
+
sourceFile: this.model.selectedItem,
|
|
37254
|
+
fileContents: jsOb.data,
|
|
37255
|
+
}).then(function (rss) {
|
|
37256
|
+
_this._notifierService.showSuccess("Ký thành công");
|
|
37257
|
+
_this._triggerProcessData();
|
|
37258
|
+
});
|
|
37259
|
+
break;
|
|
37260
|
+
case 1:
|
|
37261
|
+
this._notifierService.showWarning("Dữ liệu đầu vào không đúng định dạng");
|
|
37262
|
+
break;
|
|
37263
|
+
case 2:
|
|
37264
|
+
this._notifierService.showWarning("Không lấy được thông tin chứng thư số");
|
|
37265
|
+
break;
|
|
37266
|
+
case 3:
|
|
37267
|
+
this._notifierService.showWarning("Có lỗi trong quá trình ký số");
|
|
37268
|
+
break;
|
|
37269
|
+
case 4:
|
|
37270
|
+
this._notifierService.showSuccess("Chứng thư số không có khóa bí mật");
|
|
37271
|
+
break;
|
|
37272
|
+
case 5:
|
|
37273
|
+
this._notifierService.showSuccess("Lỗi không xác định");
|
|
37274
|
+
break;
|
|
37275
|
+
case 6:
|
|
37276
|
+
this._notifierService.showSuccess("Ký pdf: không tìm thấy tham số số trang cần ký");
|
|
37277
|
+
break;
|
|
37278
|
+
case 7:
|
|
37279
|
+
this._notifierService.showSuccess("Ký pdf: trang đặt chữ ký không tồn tại");
|
|
37280
|
+
break;
|
|
37281
|
+
case 8:
|
|
37282
|
+
this._notifierService.showSuccess("Ký xml: không tìm thấy thẻ ký số");
|
|
37283
|
+
break;
|
|
37284
|
+
case 9:
|
|
37285
|
+
this._notifierService.showSuccess("Ký pdf: không tìm thấy id của thẻ ký số");
|
|
37286
|
+
break;
|
|
37287
|
+
case 10:
|
|
37288
|
+
this._notifierService.showSuccess("Dữ liệu ký đã chứa một hoặc nhiều chữ ký không hợp lệ");
|
|
37289
|
+
break;
|
|
37290
|
+
case 11:
|
|
37291
|
+
this._notifierService.showSuccess("Người dùng hủy bỏ");
|
|
37292
|
+
break;
|
|
37293
|
+
case 13:
|
|
37294
|
+
this._notifierService.showWarning("Dữ liệu ký rỗng");
|
|
37295
|
+
break;
|
|
37296
|
+
default:
|
|
37297
|
+
this._notifierService.showSuccess("Lỗi không xác định");
|
|
37298
|
+
break;
|
|
37299
|
+
}
|
|
37300
|
+
};
|
|
37126
37301
|
return FileManagerComponent;
|
|
37127
37302
|
}(DataListBase));
|
|
37128
37303
|
FileManagerComponent.decorators = [
|