ydb-components-material 0.1.108 → 0.1.110
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/build/docs/404.html +3 -3
- package/build/docs/_demos/:uuid +3 -3
- package/build/docs/colorful-button.html +3 -3
- package/build/docs/colorful-input.html +3 -3
- package/build/docs/index.html +3 -3
- package/build/docs/static/add.fb69e154.svg +1 -0
- package/build/docs/static/close_black.d2efc5af.svg +1 -0
- package/build/docs/umi.af2a87c1.js +1 -0
- package/build/docs/{umi.0bdb74c5.css → umi.e486411a.css} +1 -1
- package/build/docs/~demos/:uuid.html +3 -3
- package/build/docs/~demos/colorful-button-demo.html +3 -3
- package/build/docs/~demos/colorful-input-demo.html +3 -3
- package/build/lowcode/3.js +2 -2
- package/build/lowcode/4.js +1 -1
- package/build/lowcode/5.js +1 -1
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +9 -9
- package/build/lowcode/render/default/1.js +2 -2
- package/build/lowcode/render/default/2.js +1 -1
- package/build/lowcode/render/default/3.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +6 -6
- package/dist/1.js +2 -2
- package/dist/2.js +1 -1
- package/dist/3.js +1 -1
- package/dist/BizComps.css +1 -1
- package/dist/BizComps.js +21 -21
- package/dist/BizComps.js.map +1 -1
- package/es/components/file-item/index.js +2 -15
- package/es/components/file-list/icon/add.svg +1 -0
- package/es/components/file-list/icon/close_black.svg +1 -0
- package/es/components/file-list/index.d.ts +2 -0
- package/es/components/file-list/index.js +7 -1
- package/es/components/file-list/item.d.ts +2 -0
- package/es/components/file-list/item.js +32 -7
- package/es/components/file-list/seal.js +4 -2
- package/es/components/file-list/sign.js +4 -2
- package/es/components/file-list/signerInfo.d.ts +4 -0
- package/es/components/file-list/signerInfo.js +274 -0
- package/es/components/file-list/signerInfo.scss +179 -0
- package/es/components/guide/compoents/materials/materialsList.js +2 -8
- package/es/components/sign/index.d.ts +18 -0
- package/es/components/sign/index.js +1 -0
- package/es/components/sign/index.scss +0 -0
- package/es/components/sign-file/file.js +225 -0
- package/es/components/sign-file/icon/checked.svg +1 -0
- package/es/components/sign-file/icon/close.svg +1 -0
- package/es/components/sign-file/icon/del.svg +1 -0
- package/es/components/sign-file/icon/download.svg +1 -0
- package/es/components/sign-file/icon/download_pc.svg +1 -0
- package/es/components/sign-file/icon/file.svg +1 -0
- package/es/components/sign-file/icon/icon_errorMsg.svg +1 -0
- package/es/components/sign-file/icon/icon_warning.svg +1 -0
- package/es/components/sign-file/icon/preview.svg +1 -0
- package/es/components/sign-file/icon/preview_pc.svg +1 -0
- package/es/components/sign-file/icon/upload.svg +1 -0
- package/es/components/sign-file/icon/view.svg +1 -0
- package/es/components/sign-file/index.d.ts +20 -0
- package/es/components/sign-file/index.js +444 -0
- package/es/components/sign-file/index.scss +422 -0
- package/es/components/sign-file/seal.d.ts +3 -0
- package/es/components/sign-file/seal.js +220 -0
- package/es/components/sign-file/sealUtil.js +252 -0
- package/es/components/sign-file/sign.d.ts +3 -0
- package/es/components/sign-file/sign.js +136 -0
- package/es/components/sign-file/signUtil.js +367 -0
- package/es/index.d.ts +2 -2
- package/es/index.js +1 -1
- package/es/style.js +1 -0
- package/lib/components/file-item/index.js +2 -15
- package/lib/components/file-list/icon/add.svg +1 -0
- package/lib/components/file-list/icon/close_black.svg +1 -0
- package/lib/components/file-list/index.d.ts +2 -0
- package/lib/components/file-list/index.js +7 -1
- package/lib/components/file-list/item.d.ts +2 -0
- package/lib/components/file-list/item.js +32 -7
- package/lib/components/file-list/seal.js +4 -2
- package/lib/components/file-list/sign.js +4 -2
- package/lib/components/file-list/signerInfo.d.ts +4 -0
- package/lib/components/file-list/signerInfo.js +280 -0
- package/lib/components/file-list/signerInfo.scss +179 -0
- package/lib/components/guide/compoents/materials/materialsList.js +2 -8
- package/lib/components/sign/index.d.ts +18 -0
- package/lib/components/sign/index.js +3 -0
- package/lib/components/sign/index.scss +0 -0
- package/lib/components/sign-file/file.js +234 -0
- package/lib/components/sign-file/icon/checked.svg +1 -0
- package/lib/components/sign-file/icon/close.svg +1 -0
- package/lib/components/sign-file/icon/del.svg +1 -0
- package/lib/components/sign-file/icon/download.svg +1 -0
- package/lib/components/sign-file/icon/download_pc.svg +1 -0
- package/lib/components/sign-file/icon/file.svg +1 -0
- package/lib/components/sign-file/icon/icon_errorMsg.svg +1 -0
- package/lib/components/sign-file/icon/icon_warning.svg +1 -0
- package/lib/components/sign-file/icon/preview.svg +1 -0
- package/lib/components/sign-file/icon/preview_pc.svg +1 -0
- package/lib/components/sign-file/icon/upload.svg +1 -0
- package/lib/components/sign-file/icon/view.svg +1 -0
- package/lib/components/sign-file/index.d.ts +20 -0
- package/lib/components/sign-file/index.js +451 -0
- package/lib/components/sign-file/index.scss +422 -0
- package/lib/components/sign-file/seal.d.ts +3 -0
- package/lib/components/sign-file/seal.js +226 -0
- package/lib/components/sign-file/sealUtil.js +254 -0
- package/lib/components/sign-file/sign.d.ts +3 -0
- package/lib/components/sign-file/sign.js +142 -0
- package/lib/components/sign-file/signUtil.js +369 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.js +3 -3
- package/lib/style.js +1 -0
- package/lowcode/file-list/meta.ts +30 -4
- package/lowcode/sign-file/meta.ts +209 -0
- package/lowcode_es/file-list/meta.js +29 -4
- package/lowcode_es/meta.js +3 -2
- package/lowcode_es/sign-file/meta.d.ts +22 -0
- package/lowcode_es/sign-file/meta.js +192 -0
- package/lowcode_lib/file-list/meta.js +29 -4
- package/lowcode_lib/meta.js +7 -6
- package/lowcode_lib/sign-file/meta.d.ts +22 -0
- package/lowcode_lib/sign-file/meta.js +197 -0
- package/package.json +3 -3
- package/build/docs/umi.f685e4ec.js +0 -1
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.getSignRes = getSignRes;
|
|
6
|
+
exports.initSignPageMethod = initSignPageMethod;
|
|
7
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
8
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
9
|
+
var _file = require("./file");
|
|
10
|
+
var _api = require("../../api");
|
|
11
|
+
var categoryId = '3354397552669692408';
|
|
12
|
+
// 预发
|
|
13
|
+
var categoryIdRelease = '3291682531601133765'; // 手写签批id
|
|
14
|
+
var documentId = ''; // 手写签批生成的文件id
|
|
15
|
+
var contractId = ''; // 合同id
|
|
16
|
+
|
|
17
|
+
// 对外的方法 初始化手写签批的页面
|
|
18
|
+
function initSignPageMethod(_x, _x2, _x3) {
|
|
19
|
+
return _initSignPageMethod.apply(this, arguments);
|
|
20
|
+
} // 【第 1 步】上传要手写签批的文件
|
|
21
|
+
function _initSignPageMethod() {
|
|
22
|
+
_initSignPageMethod = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(fileObj, userInfo, config) {
|
|
23
|
+
var name, docId, contrId, flag, pageUrl, params;
|
|
24
|
+
return _regenerator["default"].wrap(function (_context) {
|
|
25
|
+
while (1) switch (_context.prev = _context.next) {
|
|
26
|
+
case 0:
|
|
27
|
+
console.log('fileObj', fileObj, userInfo);
|
|
28
|
+
name = fileObj.name; // 【第 1 步】上传要手写签批的文件
|
|
29
|
+
_context.next = 1;
|
|
30
|
+
return uploadSignFile(fileObj, config);
|
|
31
|
+
case 1:
|
|
32
|
+
docId = _context.sent;
|
|
33
|
+
console.log('docId---', docId);
|
|
34
|
+
if (docId) {
|
|
35
|
+
_context.next = 2;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
return _context.abrupt("return", false);
|
|
39
|
+
case 2:
|
|
40
|
+
documentId = docId; // 保存文档 id
|
|
41
|
+
|
|
42
|
+
// 【第 2 步】创建或者发起电子签批
|
|
43
|
+
_context.next = 3;
|
|
44
|
+
return createbycategoryFun(name, docId, config);
|
|
45
|
+
case 3:
|
|
46
|
+
contrId = _context.sent;
|
|
47
|
+
console.log('contrId---', contrId);
|
|
48
|
+
if (contrId) {
|
|
49
|
+
_context.next = 4;
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
return _context.abrupt("return", false);
|
|
53
|
+
case 4:
|
|
54
|
+
contractId = contrId;
|
|
55
|
+
|
|
56
|
+
// 【第 3 步】创建手写签批页面
|
|
57
|
+
_context.next = 5;
|
|
58
|
+
return getContractSignUrl(contrId, userInfo, config);
|
|
59
|
+
case 5:
|
|
60
|
+
flag = _context.sent;
|
|
61
|
+
if (flag) {
|
|
62
|
+
_context.next = 6;
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
return _context.abrupt("return", false);
|
|
66
|
+
case 6:
|
|
67
|
+
_context.next = 7;
|
|
68
|
+
return getSignUrl(userInfo, config);
|
|
69
|
+
case 7:
|
|
70
|
+
pageUrl = _context.sent;
|
|
71
|
+
if (pageUrl) {
|
|
72
|
+
_context.next = 8;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
return _context.abrupt("return", false);
|
|
76
|
+
case 8:
|
|
77
|
+
// 将 文档 id/签批文件 id/签署地址/文件名称 返回
|
|
78
|
+
params = {
|
|
79
|
+
documentId: documentId,
|
|
80
|
+
contractId: contractId,
|
|
81
|
+
pageUrl: pageUrl,
|
|
82
|
+
name: name
|
|
83
|
+
};
|
|
84
|
+
return _context.abrupt("return", params);
|
|
85
|
+
case 9:
|
|
86
|
+
case "end":
|
|
87
|
+
return _context.stop();
|
|
88
|
+
}
|
|
89
|
+
}, _callee);
|
|
90
|
+
}));
|
|
91
|
+
return _initSignPageMethod.apply(this, arguments);
|
|
92
|
+
}
|
|
93
|
+
function uploadSignFile(_x4, _x5) {
|
|
94
|
+
return _uploadSignFile.apply(this, arguments);
|
|
95
|
+
} // 【第 2 步】创建或者发起电子签批
|
|
96
|
+
function _uploadSignFile() {
|
|
97
|
+
_uploadSignFile = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(event, config) {
|
|
98
|
+
var blob, file, signApprovalFileType;
|
|
99
|
+
return _regenerator["default"].wrap(function (_context2) {
|
|
100
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
101
|
+
case 0:
|
|
102
|
+
console.log(event, '文件 1111', config);
|
|
103
|
+
// uni.showLoading({ title: '加载中' })
|
|
104
|
+
_context2.next = 1;
|
|
105
|
+
return (0, _file.getBlob)(event.url);
|
|
106
|
+
case 1:
|
|
107
|
+
blob = _context2.sent;
|
|
108
|
+
file = new File([blob], event.name, {
|
|
109
|
+
type: event.type
|
|
110
|
+
}); // 获取文件类型
|
|
111
|
+
signApprovalFileType = (0, _file.getFileExtension)(event.name);
|
|
112
|
+
return _context2.abrupt("return", new Promise(function (resolve) {
|
|
113
|
+
// 上传文件
|
|
114
|
+
(0, _file.upload)({
|
|
115
|
+
file: file,
|
|
116
|
+
title: event.name,
|
|
117
|
+
fileType: signApprovalFileType,
|
|
118
|
+
filename: event.name,
|
|
119
|
+
// 文件名称
|
|
120
|
+
headers: {
|
|
121
|
+
Authorization: config.tokenTY
|
|
122
|
+
},
|
|
123
|
+
// https://zwfwpt.sxzwfw.gov.cn${window.env === 'release' ? ':10010' : ''}/DeclarationAPI
|
|
124
|
+
action: config.baseUrl + "/declaration/center/signapproval/api/createbyfile",
|
|
125
|
+
// 上传文件的地址
|
|
126
|
+
onError: function onError(e) {
|
|
127
|
+
// uni.$u.toast(e.msg || '手写签批上传文件异常');
|
|
128
|
+
// uni.hideLoading();
|
|
129
|
+
resolve(false);
|
|
130
|
+
},
|
|
131
|
+
onSuccess: function onSuccess(e) {
|
|
132
|
+
// 上传成功
|
|
133
|
+
console.log('上传成功', e);
|
|
134
|
+
resolve(e.data.documentId);
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}));
|
|
138
|
+
case 2:
|
|
139
|
+
case "end":
|
|
140
|
+
return _context2.stop();
|
|
141
|
+
}
|
|
142
|
+
}, _callee2);
|
|
143
|
+
}));
|
|
144
|
+
return _uploadSignFile.apply(this, arguments);
|
|
145
|
+
}
|
|
146
|
+
function createbycategoryFun(fileName, documentIdVal, config) {
|
|
147
|
+
// uni.showLoading({ title: '加载中' })
|
|
148
|
+
console.log('env---', config.env);
|
|
149
|
+
var params = {
|
|
150
|
+
subject: fileName,
|
|
151
|
+
documents: [documentIdVal],
|
|
152
|
+
categoryId: config.env === 'releaseHLW' ? categoryIdRelease : categoryId,
|
|
153
|
+
send: true,
|
|
154
|
+
tenantName: '山西省行政审批服务管理局'
|
|
155
|
+
};
|
|
156
|
+
return new Promise(function (resolve) {
|
|
157
|
+
(0, _api.createbycategory)(params, config).then(function (res) {
|
|
158
|
+
console.log('创建订单成功', res);
|
|
159
|
+
if (res.code === 200) {
|
|
160
|
+
resolve(res.data.contractId);
|
|
161
|
+
} else {
|
|
162
|
+
resolve(false);
|
|
163
|
+
}
|
|
164
|
+
})["catch"](function (error) {
|
|
165
|
+
// uni.hideLoading();
|
|
166
|
+
resolve(false);
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// 【第 3 步】创建手写签批页面
|
|
172
|
+
function getContractSignUrl(contractIdVal, userInfo, config) {
|
|
173
|
+
console.log('contractIdVal', contractIdVal, userInfo);
|
|
174
|
+
// uni.showLoading({ title: '加载中' })
|
|
175
|
+
var params = {
|
|
176
|
+
contractId: contractIdVal,
|
|
177
|
+
signatories: [{
|
|
178
|
+
tenantType: 'PERSONAL',
|
|
179
|
+
tenantName: userInfo.acctType === '20' ? userInfo.legalName : userInfo.userName,
|
|
180
|
+
contact: userInfo.acctType === '20' ? userInfo.legalMobile : userInfo.contactMobile,
|
|
181
|
+
serialNo: 1,
|
|
182
|
+
signAuthConfig: {
|
|
183
|
+
signAuth: 'DEFAULT'
|
|
184
|
+
},
|
|
185
|
+
remind: false
|
|
186
|
+
}]
|
|
187
|
+
};
|
|
188
|
+
return new Promise(function (resolve) {
|
|
189
|
+
(0, _api.contractSignUrl)(params, config).then(function (res) {
|
|
190
|
+
if (res.data.code == 0) {
|
|
191
|
+
resolve(true);
|
|
192
|
+
} else {
|
|
193
|
+
// uni.hideLoading();
|
|
194
|
+
// uni.showModal({
|
|
195
|
+
// title: '温馨提示',
|
|
196
|
+
// content: '获取签批页面失败',
|
|
197
|
+
// confirmText: '知道了',
|
|
198
|
+
// showCancel: false,
|
|
199
|
+
// })
|
|
200
|
+
resolve(false);
|
|
201
|
+
}
|
|
202
|
+
})["catch"](function (error) {
|
|
203
|
+
// uni.hideLoading();
|
|
204
|
+
resolve(false);
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// 【第 4 步】获取签 pi 页面
|
|
210
|
+
function getSignUrl(userInfo, config) {
|
|
211
|
+
// uni.showLoading({ title: '加载中' })
|
|
212
|
+
var params = {
|
|
213
|
+
contractId: contractId,
|
|
214
|
+
tenantType: 'PERSONAL',
|
|
215
|
+
// COMPANY(组织),PERSONAL(个人)
|
|
216
|
+
tenantName: userInfo.acctType === '20' ? userInfo.legalName : userInfo.userName,
|
|
217
|
+
contact: userInfo.acctType === '20' ? userInfo.legalMobile : userInfo.contactMobile,
|
|
218
|
+
canReturn: false,
|
|
219
|
+
// 页面是否显示返回按钮
|
|
220
|
+
canWithdraw: false,
|
|
221
|
+
// 页面是否显示撤回/回退/拒签按钮
|
|
222
|
+
rejectable: false,
|
|
223
|
+
// 页面是否显示拒签按钮
|
|
224
|
+
allowDownload: false,
|
|
225
|
+
// 页面是否显示下载按钮
|
|
226
|
+
allowPrint: false,
|
|
227
|
+
// 页面是否显示打印按钮
|
|
228
|
+
canViewDetail: false,
|
|
229
|
+
// 页面是否显示签署详情按钮
|
|
230
|
+
canMoreOperation: false,
|
|
231
|
+
// 页面是否显示"更多操作"按钮
|
|
232
|
+
autoClosePage: true,
|
|
233
|
+
// 操作完成自动关闭页面
|
|
234
|
+
language: 'ZH_CN',
|
|
235
|
+
deviceType: config.isPC || 'H5' // 取值范围:PC(返回 PC 页面),H5(返回 H5 页面);不传值默认为:根据请求的 UserAgent 自动判断返回的页面类型。
|
|
236
|
+
};
|
|
237
|
+
return new Promise(function (resolve) {
|
|
238
|
+
(0, _api.signurl)(params, config).then(function (res) {
|
|
239
|
+
console.log(res, '页面结果');
|
|
240
|
+
if (res.data.code == 0) {
|
|
241
|
+
resolve(res.data.signUrl);
|
|
242
|
+
} else {
|
|
243
|
+
resolve(false);
|
|
244
|
+
}
|
|
245
|
+
// uni.hideLoading();
|
|
246
|
+
})["catch"](function (error) {
|
|
247
|
+
resolve(false);
|
|
248
|
+
// uni.hideLoading();
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// 下方是打开手写签批页面后 的后续操作
|
|
254
|
+
|
|
255
|
+
// 对外的方法 获取签批后的文件
|
|
256
|
+
function getSignRes(_x6, _x7, _x8, _x9, _x0) {
|
|
257
|
+
return _getSignRes.apply(this, arguments);
|
|
258
|
+
} // 轮询 签批状态
|
|
259
|
+
function _getSignRes() {
|
|
260
|
+
_getSignRes = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(documentIdVal, contractIdVal, name, autoUpload, config) {
|
|
261
|
+
var isSignSucc, newFile, params, uploadRes;
|
|
262
|
+
return _regenerator["default"].wrap(function (_context3) {
|
|
263
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
264
|
+
case 0:
|
|
265
|
+
_context3.next = 1;
|
|
266
|
+
return getCheckSignState(contractIdVal, config);
|
|
267
|
+
case 1:
|
|
268
|
+
isSignSucc = _context3.sent;
|
|
269
|
+
if (!isSignSucc) {
|
|
270
|
+
_context3.next = 8;
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
// 封存
|
|
274
|
+
getContractFinish(contractIdVal, config);
|
|
275
|
+
_context3.next = 2;
|
|
276
|
+
return handleSignApprovalDown(documentIdVal, name, config);
|
|
277
|
+
case 2:
|
|
278
|
+
newFile = _context3.sent;
|
|
279
|
+
console.log('newFile', newFile);
|
|
280
|
+
// 如果需要自动上传
|
|
281
|
+
if (!autoUpload) {
|
|
282
|
+
_context3.next = 6;
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
params = {
|
|
286
|
+
materiaBase: newFile,
|
|
287
|
+
open: true
|
|
288
|
+
};
|
|
289
|
+
console.log('params', params);
|
|
290
|
+
_context3.next = 3;
|
|
291
|
+
return (0, _api.fileUploadApi)(params, config);
|
|
292
|
+
case 3:
|
|
293
|
+
uploadRes = _context3.sent;
|
|
294
|
+
// const uploadedFileObj = await uploadFilePromise(newFile, config)
|
|
295
|
+
console.log('签批完成后的文件地址', uploadRes);
|
|
296
|
+
if (!(uploadRes.code === 200)) {
|
|
297
|
+
_context3.next = 4;
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
return _context3.abrupt("return", uploadRes.data);
|
|
301
|
+
case 4:
|
|
302
|
+
return _context3.abrupt("return", false);
|
|
303
|
+
case 5:
|
|
304
|
+
_context3.next = 7;
|
|
305
|
+
break;
|
|
306
|
+
case 6:
|
|
307
|
+
return _context3.abrupt("return", newFile);
|
|
308
|
+
case 7:
|
|
309
|
+
_context3.next = 9;
|
|
310
|
+
break;
|
|
311
|
+
case 8:
|
|
312
|
+
return _context3.abrupt("return", false);
|
|
313
|
+
case 9:
|
|
314
|
+
case "end":
|
|
315
|
+
return _context3.stop();
|
|
316
|
+
}
|
|
317
|
+
}, _callee3);
|
|
318
|
+
}));
|
|
319
|
+
return _getSignRes.apply(this, arguments);
|
|
320
|
+
}
|
|
321
|
+
function getCheckSignState(contractIdVal, config) {
|
|
322
|
+
return new Promise(function (resolve) {
|
|
323
|
+
(0, _api.checkSignState)({
|
|
324
|
+
contractId: contractIdVal
|
|
325
|
+
}, config).then(function (res) {
|
|
326
|
+
console.log('轮询结果---', res);
|
|
327
|
+
// console.log('轮询结果', JSON.parse(res.data));
|
|
328
|
+
// 签署完成
|
|
329
|
+
if (res.data !== 'null') {
|
|
330
|
+
res = JSON.parse(res.data);
|
|
331
|
+
if (res.status == 'SIGNED') {
|
|
332
|
+
resolve(true);
|
|
333
|
+
} else {
|
|
334
|
+
resolve(false);
|
|
335
|
+
}
|
|
336
|
+
} else {
|
|
337
|
+
resolve(false);
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// 封存电子签批
|
|
344
|
+
function getContractFinish(contractIdVal, config) {
|
|
345
|
+
(0, _api.contractFinish)({
|
|
346
|
+
contractId: contractIdVal
|
|
347
|
+
}, config);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// 下载签署完的文档
|
|
351
|
+
function handleSignApprovalDown(documentIdVal, name, config) {
|
|
352
|
+
var params = {
|
|
353
|
+
documentId: documentIdVal,
|
|
354
|
+
type: 'pdf'
|
|
355
|
+
};
|
|
356
|
+
return new Promise(function (resolve) {
|
|
357
|
+
(0, _api.documentDownload)(params, config).then(function (res) {
|
|
358
|
+
console.log('下载文件:', res);
|
|
359
|
+
// 返回来是base64格式的
|
|
360
|
+
// const blob = dataURLtoBlob(res.data); // 转成blob格式进行上传
|
|
361
|
+
// console.log(blob, '新文件的blob格式');
|
|
362
|
+
if (res.code === 200) {
|
|
363
|
+
resolve(res.data);
|
|
364
|
+
} else {
|
|
365
|
+
resolve(false);
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
});
|
|
369
|
+
}
|
package/lib/index.d.ts
CHANGED
|
@@ -17,8 +17,6 @@ export type { SuccessPromptProps } from './components/success-prompt';
|
|
|
17
17
|
export { default as SuccessPrompt } from './components/success-prompt';
|
|
18
18
|
export type { CheckDetailProps } from './components/check-detail';
|
|
19
19
|
export { default as CheckDetail } from './components/check-detail';
|
|
20
|
-
export type { FilePCProps } from './components/file-pc';
|
|
21
|
-
export { default as FilePC } from './components/file-pc';
|
|
22
20
|
export type { PreCheckResPCProps } from './components/pre-check-res-pc';
|
|
23
21
|
export { default as PreCheckResPC } from './components/pre-check-res-pc';
|
|
24
22
|
export type { CheckDetailPcProps } from './components/check-detail-pc';
|
|
@@ -51,5 +49,7 @@ export type { GuideProps } from './components/guide';
|
|
|
51
49
|
export { default as Guide } from './components/guide';
|
|
52
50
|
export type { CommentProps } from './components/guide/comment';
|
|
53
51
|
export { default as Comment } from './components/guide/comment';
|
|
52
|
+
export type { SignFileProps } from './components/sign-file';
|
|
53
|
+
export { default as SignFile } from './components/sign-file';
|
|
54
54
|
declare const bizCssPrefix = "bizpack";
|
|
55
55
|
export { bizCssPrefix };
|
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
|
-
exports.bizCssPrefix = exports.Tips = exports.SuccessPrompt = exports.SubmitType = exports.Statstic = exports.SceneTree = exports.QRCodeImg = exports.PrintButton = exports.PreviewMaterial = exports.PreCheckResPC = exports.Message = exports.MaterialCheckRes = exports.IconCustom = exports.Guide = exports.
|
|
5
|
+
exports.bizCssPrefix = exports.Tips = exports.SuccessPrompt = exports.SubmitType = exports.Statstic = exports.SignFile = exports.SceneTree = exports.QRCodeImg = exports.PrintButton = exports.PreviewMaterial = exports.PreCheckResPC = exports.Message = exports.MaterialCheckRes = exports.IconCustom = exports.Guide = exports.FileListPreview = exports.FileList = exports.FileItem = exports.DragDropList = exports.CustomFrom = exports.Comment = exports.CheckRes = exports.CheckLoading = exports.CheckDetailPc = exports.CheckDetail = exports.CardTitle = exports.AddressSelect = exports.AddressCascader = void 0;
|
|
6
6
|
var _checkLoading = _interopRequireDefault(require("./components/check-loading"));
|
|
7
7
|
exports.CheckLoading = _checkLoading["default"];
|
|
8
8
|
var _cardTitle = _interopRequireDefault(require("./components/card-title"));
|
|
@@ -23,8 +23,6 @@ var _successPrompt = _interopRequireDefault(require("./components/success-prompt
|
|
|
23
23
|
exports.SuccessPrompt = _successPrompt["default"];
|
|
24
24
|
var _checkDetail = _interopRequireDefault(require("./components/check-detail"));
|
|
25
25
|
exports.CheckDetail = _checkDetail["default"];
|
|
26
|
-
var _filePc = _interopRequireDefault(require("./components/file-pc"));
|
|
27
|
-
exports.FilePC = _filePc["default"];
|
|
28
26
|
var _preCheckResPc = _interopRequireDefault(require("./components/pre-check-res-pc"));
|
|
29
27
|
exports.PreCheckResPC = _preCheckResPc["default"];
|
|
30
28
|
var _checkDetailPc = _interopRequireDefault(require("./components/check-detail-pc"));
|
|
@@ -57,6 +55,8 @@ var _guide = _interopRequireDefault(require("./components/guide"));
|
|
|
57
55
|
exports.Guide = _guide["default"];
|
|
58
56
|
var _comment = _interopRequireDefault(require("./components/guide/comment"));
|
|
59
57
|
exports.Comment = _comment["default"];
|
|
58
|
+
var _signFile = _interopRequireDefault(require("./components/sign-file"));
|
|
59
|
+
exports.SignFile = _signFile["default"];
|
|
60
60
|
// export type { ColorfulButtonProps } from './components/colorful-button';
|
|
61
61
|
// export { default as ColorfulButton } from './components/colorful-button';
|
|
62
62
|
|
package/lib/style.js
CHANGED
|
@@ -4,6 +4,7 @@ require('@alifd/next/lib/radio/style');
|
|
|
4
4
|
require('@alifd/next/lib/checkbox/style');
|
|
5
5
|
require('@alifd/next/lib/balloon/style');
|
|
6
6
|
require('antd/lib/cascader/style');
|
|
7
|
+
require('@alifd/next/lib/input/style');
|
|
7
8
|
require('@alifd/next/lib/dialog/style');
|
|
8
9
|
require('@alifd/next/lib/loading/style');
|
|
9
10
|
require('@alifd/next/lib/button/style');
|
|
@@ -50,6 +50,32 @@ const FileListMeta: IPublicTypeComponentMetadata = {
|
|
|
50
50
|
"initialValue": []
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
+
{
|
|
54
|
+
"title": {
|
|
55
|
+
"label": {
|
|
56
|
+
"type": "i18n",
|
|
57
|
+
"en-US": "signerInfo",
|
|
58
|
+
"zh-CN": "签署人信息"
|
|
59
|
+
},
|
|
60
|
+
"tip": "signerInfo | 签署人信息"
|
|
61
|
+
},
|
|
62
|
+
"name": "signerInfo",
|
|
63
|
+
"description": "签署人信息",
|
|
64
|
+
"setter": {
|
|
65
|
+
"componentName": "ObjectSetter",
|
|
66
|
+
"props": {
|
|
67
|
+
"config": {
|
|
68
|
+
"extraSetter": {
|
|
69
|
+
"componentName": "MixedSetter",
|
|
70
|
+
"isRequired": false,
|
|
71
|
+
"props": {}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"isRequired": false,
|
|
76
|
+
"initialValue": undefined
|
|
77
|
+
}
|
|
78
|
+
},
|
|
53
79
|
{
|
|
54
80
|
"title": {
|
|
55
81
|
"label": {
|
|
@@ -239,14 +265,14 @@ const FileListMeta: IPublicTypeComponentMetadata = {
|
|
|
239
265
|
"title": {
|
|
240
266
|
"label": {
|
|
241
267
|
"type": "i18n",
|
|
242
|
-
"en-US": "
|
|
243
|
-
"zh-CN": "
|
|
268
|
+
"en-US": "saveSignerInfo",
|
|
269
|
+
"zh-CN": "保存签署人信息"
|
|
244
270
|
}
|
|
245
271
|
},
|
|
246
|
-
"name": "
|
|
272
|
+
"name": "saveSignerInfo",
|
|
247
273
|
"setter": {
|
|
248
274
|
"componentName": "FunctionSetter",
|
|
249
|
-
"isRequired":
|
|
275
|
+
"isRequired": false
|
|
250
276
|
}
|
|
251
277
|
}
|
|
252
278
|
],
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
|
|
2
|
+
import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';
|
|
3
|
+
|
|
4
|
+
const SignFileMeta: IPublicTypeComponentMetadata = {
|
|
5
|
+
"componentName": "SignFile",
|
|
6
|
+
"title": "SignFile",
|
|
7
|
+
"docUrl": "",
|
|
8
|
+
"screenshot": "",
|
|
9
|
+
"devMode": "proCode",
|
|
10
|
+
"npm": {
|
|
11
|
+
"package": "ydb-components-material",
|
|
12
|
+
"version": "0.1.108",
|
|
13
|
+
"exportName": "SignFile",
|
|
14
|
+
"main": "src/index.tsx",
|
|
15
|
+
"destructuring": true,
|
|
16
|
+
"subName": ""
|
|
17
|
+
},
|
|
18
|
+
"configure": {
|
|
19
|
+
"props": [
|
|
20
|
+
{
|
|
21
|
+
"title": {
|
|
22
|
+
"label": {
|
|
23
|
+
"type": "i18n",
|
|
24
|
+
"en-US": "file",
|
|
25
|
+
"zh-CN": "file"
|
|
26
|
+
},
|
|
27
|
+
"tip": "file | file"
|
|
28
|
+
},
|
|
29
|
+
"name": "file",
|
|
30
|
+
"description": "file",
|
|
31
|
+
"setter": {
|
|
32
|
+
"componentName": "ObjectSetter",
|
|
33
|
+
"props": {
|
|
34
|
+
"config": {
|
|
35
|
+
"extraSetter": {
|
|
36
|
+
"componentName": "MixedSetter",
|
|
37
|
+
"isRequired": false,
|
|
38
|
+
"props": {}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"isRequired": true,
|
|
43
|
+
"initialValue": {}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"title": {
|
|
48
|
+
"label": {
|
|
49
|
+
"type": "i18n",
|
|
50
|
+
"en-US": "token",
|
|
51
|
+
"zh-CN": "token"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"name": "token",
|
|
55
|
+
"setter": {
|
|
56
|
+
"componentName": "StringSetter",
|
|
57
|
+
"isRequired": true,
|
|
58
|
+
"initialValue": ""
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"title": {
|
|
63
|
+
"label": {
|
|
64
|
+
"type": "i18n",
|
|
65
|
+
"en-US": "tokenTY",
|
|
66
|
+
"zh-CN": "tokenTY"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"name": "tokenTY",
|
|
70
|
+
"setter": {
|
|
71
|
+
"componentName": "StringSetter",
|
|
72
|
+
"isRequired": true,
|
|
73
|
+
"initialValue": ""
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"title": {
|
|
78
|
+
"label": {
|
|
79
|
+
"type": "i18n",
|
|
80
|
+
"en-US": "accessToken",
|
|
81
|
+
"zh-CN": "accessToken"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"name": "accessToken",
|
|
85
|
+
"setter": {
|
|
86
|
+
"componentName": "StringSetter",
|
|
87
|
+
"isRequired": true,
|
|
88
|
+
"initialValue": ""
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"title": {
|
|
93
|
+
"label": {
|
|
94
|
+
"type": "i18n",
|
|
95
|
+
"en-US": "userInfo",
|
|
96
|
+
"zh-CN": "userInfo"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"name": "userInfo",
|
|
100
|
+
"setter": {
|
|
101
|
+
"componentName": "ObjectSetter",
|
|
102
|
+
"props": {
|
|
103
|
+
"config": {
|
|
104
|
+
"extraSetter": {
|
|
105
|
+
"componentName": "MixedSetter",
|
|
106
|
+
"isRequired": false,
|
|
107
|
+
"props": {}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"isRequired": true,
|
|
112
|
+
"initialValue": {}
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"title": {
|
|
117
|
+
"label": {
|
|
118
|
+
"type": "i18n",
|
|
119
|
+
"en-US": "baseUrl",
|
|
120
|
+
"zh-CN": "baseUrl"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"name": "baseUrl",
|
|
124
|
+
"setter": {
|
|
125
|
+
"componentName": "StringSetter",
|
|
126
|
+
"isRequired": true,
|
|
127
|
+
"initialValue": ""
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"title": {
|
|
132
|
+
"label": {
|
|
133
|
+
"type": "i18n",
|
|
134
|
+
"en-US": "env",
|
|
135
|
+
"zh-CN": "env"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"name": "env",
|
|
139
|
+
"setter": {
|
|
140
|
+
"componentName": "StringSetter",
|
|
141
|
+
"isRequired": true,
|
|
142
|
+
"initialValue": ""
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"title": {
|
|
147
|
+
"label": {
|
|
148
|
+
"type": "i18n",
|
|
149
|
+
"en-US": "isPC",
|
|
150
|
+
"zh-CN": "isPC"
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"name": "isPC",
|
|
154
|
+
"setter": {
|
|
155
|
+
"componentName": "BoolSetter",
|
|
156
|
+
"isRequired": false,
|
|
157
|
+
"initialValue": false
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"title": {
|
|
162
|
+
"label": {
|
|
163
|
+
"type": "i18n",
|
|
164
|
+
"en-US": "download",
|
|
165
|
+
"zh-CN": "download"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"name": "download",
|
|
169
|
+
"setter": {
|
|
170
|
+
"componentName": "FunctionSetter",
|
|
171
|
+
"isRequired": true
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"title": {
|
|
176
|
+
"label": {
|
|
177
|
+
"type": "i18n",
|
|
178
|
+
"en-US": "valChange",
|
|
179
|
+
"zh-CN": "valChange"
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"name": "valChange",
|
|
183
|
+
"setter": {
|
|
184
|
+
"componentName": "FunctionSetter",
|
|
185
|
+
"isRequired": true
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"supports": {
|
|
190
|
+
"style": true
|
|
191
|
+
},
|
|
192
|
+
"component": {}
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
const snippets: IPublicTypeSnippet[] = [
|
|
196
|
+
{
|
|
197
|
+
"title": "SignFile",
|
|
198
|
+
"screenshot": "",
|
|
199
|
+
"schema": {
|
|
200
|
+
"componentName": "SignFile",
|
|
201
|
+
"props": {}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
];
|
|
205
|
+
|
|
206
|
+
export default {
|
|
207
|
+
...SignFileMeta,
|
|
208
|
+
snippets
|
|
209
|
+
};
|