ydb-components-material 0.1.87 → 0.1.89
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/umi.6ffa9be4.js +1 -0
- package/build/docs/{umi.507b3306.css → umi.fd11a37a.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/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/view.css +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +2 -2
- package/dist/BizComps.css +1 -1
- package/dist/BizComps.js +5 -5
- package/dist/BizComps.js.map +1 -1
- package/es/components/file-list/checkPoint.d.ts +3 -0
- package/es/components/file-list/checkPoint.js +157 -0
- package/es/components/file-list/checkPoint.scss +120 -0
- package/es/components/file-list/file.js +224 -0
- package/es/components/file-list/icon/checked.svg +1 -0
- package/es/components/file-list/icon/close.svg +1 -0
- package/es/components/file-list/icon/del.svg +1 -0
- package/es/components/file-list/icon/download.svg +1 -0
- package/es/components/file-list/icon/download_pc.svg +1 -0
- package/es/components/file-list/icon/file.svg +1 -0
- package/es/components/file-list/icon/icon_errorMsg.svg +1 -0
- package/es/components/file-list/icon/icon_warning.svg +1 -0
- package/es/components/file-list/icon/preview.svg +1 -0
- package/es/components/file-list/icon/preview_pc.svg +1 -0
- package/es/components/file-list/icon/upload.svg +1 -0
- package/es/components/file-list/icon/view.svg +1 -0
- package/es/components/file-list/index.d.ts +21 -0
- package/es/components/file-list/index.js +258 -0
- package/es/components/file-list/index.scss +61 -0
- package/es/components/file-list/item.d.ts +27 -0
- package/es/components/file-list/item.js +854 -0
- package/es/components/file-list/item.scss +412 -0
- package/es/components/file-list/seal.d.ts +3 -0
- package/es/components/file-list/seal.js +222 -0
- package/es/components/file-list/sealUtil.js +252 -0
- package/es/components/file-list/sign.d.ts +3 -0
- package/es/components/file-list/sign.js +138 -0
- package/es/components/file-list/signUtil.js +369 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +1 -0
- package/es/style.js +1 -0
- package/lib/components/file-list/checkPoint.d.ts +3 -0
- package/lib/components/file-list/checkPoint.js +162 -0
- package/lib/components/file-list/checkPoint.scss +120 -0
- package/lib/components/file-list/file.js +233 -0
- package/lib/components/file-list/icon/checked.svg +1 -0
- package/lib/components/file-list/icon/close.svg +1 -0
- package/lib/components/file-list/icon/del.svg +1 -0
- package/lib/components/file-list/icon/download.svg +1 -0
- package/lib/components/file-list/icon/download_pc.svg +1 -0
- package/lib/components/file-list/icon/file.svg +1 -0
- package/lib/components/file-list/icon/icon_errorMsg.svg +1 -0
- package/lib/components/file-list/icon/icon_warning.svg +1 -0
- package/lib/components/file-list/icon/preview.svg +1 -0
- package/lib/components/file-list/icon/preview_pc.svg +1 -0
- package/lib/components/file-list/icon/upload.svg +1 -0
- package/lib/components/file-list/icon/view.svg +1 -0
- package/lib/components/file-list/index.d.ts +21 -0
- package/lib/components/file-list/index.js +263 -0
- package/lib/components/file-list/index.scss +61 -0
- package/lib/components/file-list/item.d.ts +27 -0
- package/lib/components/file-list/item.js +860 -0
- package/lib/components/file-list/item.scss +412 -0
- package/lib/components/file-list/seal.d.ts +3 -0
- package/lib/components/file-list/seal.js +228 -0
- package/lib/components/file-list/sealUtil.js +254 -0
- package/lib/components/file-list/sign.d.ts +3 -0
- package/lib/components/file-list/sign.js +144 -0
- package/lib/components/file-list/signUtil.js +371 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -1
- package/lib/style.js +1 -0
- package/lowcode/file-list/meta.ts +231 -0
- package/lowcode_es/_setter/IconSelectSetter.js +1 -1
- package/lowcode_es/file-list/meta.d.ts +22 -0
- package/lowcode_es/file-list/meta.js +213 -0
- package/lowcode_es/meta.js +3 -2
- package/lowcode_lib/_setter/IconSelectSetter.js +1 -1
- package/lowcode_lib/file-list/meta.d.ts +22 -0
- package/lowcode_lib/file-list/meta.js +218 -0
- package/lowcode_lib/meta.js +14 -13
- package/package.json +5 -4
- package/build/docs/umi.5298404d.js +0 -1
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.initSealPageMethod = initSealPageMethod;
|
|
6
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
7
|
+
var _message = _interopRequireDefault(require("@alifd/next/lib/message"));
|
|
8
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
9
|
+
var _file = require("./file.js");
|
|
10
|
+
var _api = require("../../api.js");
|
|
11
|
+
// import apiConfig from '@/config/api.cofig'
|
|
12
|
+
// const userInfo = uni.getStorageSync('userInfo')
|
|
13
|
+
// 对外的方法 获取电子签章的页面地址
|
|
14
|
+
function initSealPageMethod(_x, _x2, _x3) {
|
|
15
|
+
return _initSealPageMethod.apply(this, arguments);
|
|
16
|
+
} // [第 1 步] 查询当前用户是否有电子签章
|
|
17
|
+
function _initSealPageMethod() {
|
|
18
|
+
_initSealPageMethod = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(fileObj, userInfo, config) {
|
|
19
|
+
var fileName, sealList, fileUrl, orderId, pageUrl, params;
|
|
20
|
+
return _regenerator["default"].wrap(function (_context) {
|
|
21
|
+
while (1) switch (_context.prev = _context.next) {
|
|
22
|
+
case 0:
|
|
23
|
+
fileName = fileObj.fileName;
|
|
24
|
+
console.log('fileObj', fileObj, userInfo);
|
|
25
|
+
// 【第 1 步】判断当前用户是否有印章
|
|
26
|
+
_context.next = 1;
|
|
27
|
+
return querySeal(userInfo, config);
|
|
28
|
+
case 1:
|
|
29
|
+
sealList = _context.sent;
|
|
30
|
+
console.log('sealList---', sealList);
|
|
31
|
+
if (sealList.length) {
|
|
32
|
+
_context.next = 2;
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
_message["default"].error('该单位下暂无印章,请前往“山西政务服务网”或“三晋通”小程序申领印章');
|
|
36
|
+
return _context.abrupt("return", false);
|
|
37
|
+
case 2:
|
|
38
|
+
_context.next = 3;
|
|
39
|
+
return uploadSealFile(fileObj, config);
|
|
40
|
+
case 3:
|
|
41
|
+
fileUrl = _context.sent;
|
|
42
|
+
console.log('fileUrl---', fileUrl);
|
|
43
|
+
if (fileUrl) {
|
|
44
|
+
_context.next = 4;
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
return _context.abrupt("return", false);
|
|
48
|
+
case 4:
|
|
49
|
+
_context.next = 5;
|
|
50
|
+
return getSignOrderId(sealList, fileObj, fileUrl, userInfo, config);
|
|
51
|
+
case 5:
|
|
52
|
+
orderId = _context.sent;
|
|
53
|
+
console.log('orderId---', orderId);
|
|
54
|
+
if (orderId) {
|
|
55
|
+
_context.next = 6;
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
return _context.abrupt("return", false);
|
|
59
|
+
case 6:
|
|
60
|
+
_context.next = 7;
|
|
61
|
+
return getMobilePageFun(orderId, config);
|
|
62
|
+
case 7:
|
|
63
|
+
pageUrl = _context.sent;
|
|
64
|
+
// 将 电子签章地址/文件名称 返回
|
|
65
|
+
params = {
|
|
66
|
+
pageUrl: pageUrl,
|
|
67
|
+
fileName: fileName,
|
|
68
|
+
orderId: orderId
|
|
69
|
+
};
|
|
70
|
+
return _context.abrupt("return", params);
|
|
71
|
+
case 8:
|
|
72
|
+
case "end":
|
|
73
|
+
return _context.stop();
|
|
74
|
+
}
|
|
75
|
+
}, _callee);
|
|
76
|
+
}));
|
|
77
|
+
return _initSealPageMethod.apply(this, arguments);
|
|
78
|
+
}
|
|
79
|
+
function querySeal(userInfo, config) {
|
|
80
|
+
console.log('querySeal', userInfo);
|
|
81
|
+
// uni.showLoading({ title: '查询印章中' })
|
|
82
|
+
var params = {
|
|
83
|
+
deptCode: userInfo.certificateSno,
|
|
84
|
+
outUserId: userInfo.legalCertno,
|
|
85
|
+
userIdType: '2'
|
|
86
|
+
};
|
|
87
|
+
return new Promise(function (resolve) {
|
|
88
|
+
(0, _api.qrySealApi)(params, config).then(function (res) {
|
|
89
|
+
if (res.data && res.data.length > 0) {
|
|
90
|
+
resolve(res.data);
|
|
91
|
+
} else {
|
|
92
|
+
resolve([]);
|
|
93
|
+
}
|
|
94
|
+
// uni.hideLoading()
|
|
95
|
+
})["catch"](function (error) {
|
|
96
|
+
resolve([]);
|
|
97
|
+
// uni.hideLoading()
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// [第 2 步] 上传文件
|
|
103
|
+
function uploadSealFile(_x4, _x5) {
|
|
104
|
+
return _uploadSealFile.apply(this, arguments);
|
|
105
|
+
} // [第 3 步] 获取电子印章页面
|
|
106
|
+
function _uploadSealFile() {
|
|
107
|
+
_uploadSealFile = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(fileObj, config) {
|
|
108
|
+
var blob, file;
|
|
109
|
+
return _regenerator["default"].wrap(function (_context2) {
|
|
110
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
111
|
+
case 0:
|
|
112
|
+
_context2.next = 1;
|
|
113
|
+
return (0, _file.getBlob)(fileObj.fileUrl);
|
|
114
|
+
case 1:
|
|
115
|
+
blob = _context2.sent;
|
|
116
|
+
file = new File([blob], fileObj.fileName, {
|
|
117
|
+
type: fileObj.fileType
|
|
118
|
+
}); // 上传接口
|
|
119
|
+
return _context2.abrupt("return", new Promise(function (resolve) {
|
|
120
|
+
(0, _file.upload)({
|
|
121
|
+
file: file,
|
|
122
|
+
filename: fileObj.fileName,
|
|
123
|
+
// 文件名称
|
|
124
|
+
headers: {
|
|
125
|
+
Authorization: config.tokenTY
|
|
126
|
+
},
|
|
127
|
+
action: config.baseUrl + "/declaration/center/sign/api/fileUploadApi",
|
|
128
|
+
// 上传文件的地址
|
|
129
|
+
onError: function onError(e) {
|
|
130
|
+
// uni.$u.toast(e.msg || '上传文件异常');
|
|
131
|
+
// uni.hideLoading();
|
|
132
|
+
_message["default"].error('上传文件异常');
|
|
133
|
+
},
|
|
134
|
+
onSuccess: function onSuccess(e) {
|
|
135
|
+
// uni.hideLoading();
|
|
136
|
+
console.log('success', e);
|
|
137
|
+
resolve(e.data);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}));
|
|
141
|
+
case 2:
|
|
142
|
+
case "end":
|
|
143
|
+
return _context2.stop();
|
|
144
|
+
}
|
|
145
|
+
}, _callee2);
|
|
146
|
+
}));
|
|
147
|
+
return _uploadSealFile.apply(this, arguments);
|
|
148
|
+
}
|
|
149
|
+
function getSignOrderId(sealList, fileObj, esusFileUrl, userInfo, config) {
|
|
150
|
+
// uni.showLoading({ title: '获取签章页面中' })
|
|
151
|
+
console.log('sealList', sealList, fileObj, esusFileUrl, userInfo);
|
|
152
|
+
var fileId = fileObj.fileId,
|
|
153
|
+
fileName = fileObj.fileName;
|
|
154
|
+
// 循环签章列表 - 开始
|
|
155
|
+
var apiSignDtosArr = [];
|
|
156
|
+
sealList.forEach(function (sealItem, sealIndex) {
|
|
157
|
+
apiSignDtosArr.push({
|
|
158
|
+
deviceType: 3,
|
|
159
|
+
// 签章类型 (默认 3)
|
|
160
|
+
signType: 0,
|
|
161
|
+
// 签章方式 (0 - 自由签章 or 定位签章 2 - 关键字签章 3 - 骑缝签章,一次只能有个一个类型,多个请写多组)
|
|
162
|
+
sealCode: sealItem.sealCode,
|
|
163
|
+
// 印章编码
|
|
164
|
+
signatories: [
|
|
165
|
+
// 定位签章参数
|
|
166
|
+
{
|
|
167
|
+
pageIndex: sealIndex,
|
|
168
|
+
// 签章所在页码
|
|
169
|
+
x: 0.00,
|
|
170
|
+
// 位置横坐标 支持百分比坐标<1,百分比。>1,pdf 磅,ofd 毫米
|
|
171
|
+
y: 0.00 // 位置纵坐标
|
|
172
|
+
}]
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
var params = {
|
|
176
|
+
deptCode: userInfo.certificateSno,
|
|
177
|
+
// 单位统一社会信用代码
|
|
178
|
+
outUserId: userInfo.legalCertno,
|
|
179
|
+
// 用户身份证号
|
|
180
|
+
userIdType: '2',
|
|
181
|
+
// 2:身份证
|
|
182
|
+
signFileReqs: [{
|
|
183
|
+
file: esusFileUrl,
|
|
184
|
+
// 签章文件 (签章文件 base64 编码文件数据或者文件地址)
|
|
185
|
+
fileType: '0',
|
|
186
|
+
// 文件格式类型 (0 文件路径;1 文件数据)
|
|
187
|
+
docType: '0',
|
|
188
|
+
// 文件内容类型 (0 PDF;1 OFD)
|
|
189
|
+
fileId: fileId,
|
|
190
|
+
// 业务系统文件 id (用于回传文件,不可重复)
|
|
191
|
+
fileName: fileName,
|
|
192
|
+
// 签章文件名称 (文件名称包含文件格式,如 a.pdf,b.ofd)
|
|
193
|
+
apiSignDtos: apiSignDtosArr
|
|
194
|
+
}]
|
|
195
|
+
};
|
|
196
|
+
console.log('params---', params);
|
|
197
|
+
return new Promise(function (resolve) {
|
|
198
|
+
console.log('获取签章订单 id');
|
|
199
|
+
(0, _api.getSignOrderIdApi)(params, config).then(function (res) {
|
|
200
|
+
if (res) {
|
|
201
|
+
var bigNumber = BigInt(res);
|
|
202
|
+
resolve(bigNumber + '');
|
|
203
|
+
// uni.hideLoading()
|
|
204
|
+
} else {
|
|
205
|
+
resolve(false);
|
|
206
|
+
// uni.hideLoading()
|
|
207
|
+
}
|
|
208
|
+
})["catch"](function () {
|
|
209
|
+
resolve(false);
|
|
210
|
+
// uni.hideLoading()
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// [第 4 步 - 移动端] 获取电子印章页面
|
|
216
|
+
function getMobilePageFun(orderId, config) {
|
|
217
|
+
// uni.showLoading({ title: '获取移动端签章页面中' })
|
|
218
|
+
var params = {
|
|
219
|
+
accessToken: config.accessToken,
|
|
220
|
+
acctType: '20',
|
|
221
|
+
orderId: orderId
|
|
222
|
+
};
|
|
223
|
+
return new Promise(function (resolve) {
|
|
224
|
+
if (config.isPC) {
|
|
225
|
+
(0, _api.getPcSealUrlApi)(params, config).then(function (res) {
|
|
226
|
+
console.log('签章页面 pc----', res);
|
|
227
|
+
if (res.code === 200) {
|
|
228
|
+
resolve(res.data);
|
|
229
|
+
// uni.hideLoading()
|
|
230
|
+
} else {
|
|
231
|
+
resolve(false);
|
|
232
|
+
// uni.hideLoading()
|
|
233
|
+
}
|
|
234
|
+
})["catch"](function () {
|
|
235
|
+
resolve(false);
|
|
236
|
+
// uni.hideLoading()
|
|
237
|
+
});
|
|
238
|
+
} else {
|
|
239
|
+
(0, _api.getSealUrlApi)(params, config).then(function (res) {
|
|
240
|
+
if (res) {
|
|
241
|
+
console.log(res, '移动端签章页面');
|
|
242
|
+
resolve(res);
|
|
243
|
+
// uni.hideLoading()
|
|
244
|
+
} else {
|
|
245
|
+
resolve(false);
|
|
246
|
+
// uni.hideLoading()
|
|
247
|
+
}
|
|
248
|
+
})["catch"](function () {
|
|
249
|
+
resolve(false);
|
|
250
|
+
// uni.hideLoading()
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports["default"] = void 0;
|
|
6
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
7
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _signUtil = require("./signUtil");
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
12
|
+
function SignPage(props) {
|
|
13
|
+
var userInfo = props.userInfo,
|
|
14
|
+
file = props.file,
|
|
15
|
+
getRes = props.getRes,
|
|
16
|
+
handleClose = props.handleClose,
|
|
17
|
+
token = props.token,
|
|
18
|
+
tokenTY = props.tokenTY,
|
|
19
|
+
baseUrl = props.baseUrl,
|
|
20
|
+
env = props.env,
|
|
21
|
+
isPC = props.isPC;
|
|
22
|
+
var _useState = (0, _react.useState)(''),
|
|
23
|
+
srcUrl = _useState[0],
|
|
24
|
+
setSrcUrl = _useState[1];
|
|
25
|
+
var _useState2 = (0, _react.useState)(''),
|
|
26
|
+
documentId = _useState2[0],
|
|
27
|
+
setDocumentId = _useState2[1];
|
|
28
|
+
var _useState3 = (0, _react.useState)(''),
|
|
29
|
+
contractId = _useState3[0],
|
|
30
|
+
setContractId = _useState3[1];
|
|
31
|
+
var _useState4 = (0, _react.useState)(''),
|
|
32
|
+
name = _useState4[0],
|
|
33
|
+
setName = _useState4[1];
|
|
34
|
+
var timerRef = (0, _react.useRef)(null);
|
|
35
|
+
var init = /*#__PURE__*/function () {
|
|
36
|
+
var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
37
|
+
var fileObj, res, documentIdVal, contractIdVal, pageUrl, nameVal;
|
|
38
|
+
return _regenerator["default"].wrap(function (_context) {
|
|
39
|
+
while (1) switch (_context.prev = _context.next) {
|
|
40
|
+
case 0:
|
|
41
|
+
fileObj = file; // 有旧的 URL 说明是重新签章 旧的是原始的空白的 重新签需要签在原始的空白文件
|
|
42
|
+
if (file.isSigned && !file.isSealed) {
|
|
43
|
+
fileObj.fileUrl = file.originalUrl;
|
|
44
|
+
} else if (!file.originalUrl) {
|
|
45
|
+
fileObj.originalUrl = file.fileUrl;
|
|
46
|
+
}
|
|
47
|
+
// 传递配置参数给工具函数
|
|
48
|
+
_context.next = 1;
|
|
49
|
+
return (0, _signUtil.initSignPageMethod)(fileObj, userInfo, {
|
|
50
|
+
token: token,
|
|
51
|
+
tokenTY: tokenTY,
|
|
52
|
+
baseUrl: baseUrl,
|
|
53
|
+
env: env,
|
|
54
|
+
isPC: isPC
|
|
55
|
+
});
|
|
56
|
+
case 1:
|
|
57
|
+
res = _context.sent;
|
|
58
|
+
documentIdVal = res.documentId, contractIdVal = res.contractId, pageUrl = res.pageUrl, nameVal = res.fileName;
|
|
59
|
+
setSrcUrl(pageUrl);
|
|
60
|
+
setDocumentId(documentIdVal);
|
|
61
|
+
setContractId(contractIdVal);
|
|
62
|
+
setName(nameVal);
|
|
63
|
+
console.log(res);
|
|
64
|
+
case 2:
|
|
65
|
+
case "end":
|
|
66
|
+
return _context.stop();
|
|
67
|
+
}
|
|
68
|
+
}, _callee);
|
|
69
|
+
}));
|
|
70
|
+
return function init() {
|
|
71
|
+
return _ref.apply(this, arguments);
|
|
72
|
+
};
|
|
73
|
+
}();
|
|
74
|
+
var getSignedFile = /*#__PURE__*/function () {
|
|
75
|
+
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(documentIdVal, contractIdVal, nameVal) {
|
|
76
|
+
var newFile, finalFile;
|
|
77
|
+
return _regenerator["default"].wrap(function (_context2) {
|
|
78
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
79
|
+
case 0:
|
|
80
|
+
_context2.next = 1;
|
|
81
|
+
return (0, _signUtil.getSignRes)(documentIdVal, contractIdVal, nameVal, true, {
|
|
82
|
+
token: token,
|
|
83
|
+
tokenTY: tokenTY,
|
|
84
|
+
baseUrl: baseUrl,
|
|
85
|
+
env: env,
|
|
86
|
+
isPC: isPC
|
|
87
|
+
});
|
|
88
|
+
case 1:
|
|
89
|
+
newFile = _context2.sent;
|
|
90
|
+
console.log(newFile, '签署完毕后的');
|
|
91
|
+
if (newFile) {
|
|
92
|
+
// 关闭轮询定时
|
|
93
|
+
handleClearInterval();
|
|
94
|
+
// 关闭弹框
|
|
95
|
+
handleClose();
|
|
96
|
+
// 将手写签批后的新文件 传给
|
|
97
|
+
finalFile = (0, _extends2["default"])({}, file, {
|
|
98
|
+
fileId: newFile.fileId,
|
|
99
|
+
fileName: nameVal,
|
|
100
|
+
fileUrl: newFile.fileUrlList[2],
|
|
101
|
+
isSigned: true
|
|
102
|
+
});
|
|
103
|
+
console.log('finalFile---', finalFile);
|
|
104
|
+
getRes(finalFile);
|
|
105
|
+
}
|
|
106
|
+
case 2:
|
|
107
|
+
case "end":
|
|
108
|
+
return _context2.stop();
|
|
109
|
+
}
|
|
110
|
+
}, _callee2);
|
|
111
|
+
}));
|
|
112
|
+
return function getSignedFile(_x, _x2, _x3) {
|
|
113
|
+
return _ref2.apply(this, arguments);
|
|
114
|
+
};
|
|
115
|
+
}();
|
|
116
|
+
var handleClearInterval = function handleClearInterval() {
|
|
117
|
+
clearInterval(timerRef.current);
|
|
118
|
+
timerRef.current = null;
|
|
119
|
+
};
|
|
120
|
+
(0, _react.useEffect)(function () {
|
|
121
|
+
init();
|
|
122
|
+
}, []);
|
|
123
|
+
(0, _react.useEffect)(function () {
|
|
124
|
+
if (srcUrl && documentId && contractId && name && !timerRef.current) {
|
|
125
|
+
handleClearInterval();
|
|
126
|
+
timerRef.current = setInterval(function () {
|
|
127
|
+
getSignedFile(documentId, contractId, name);
|
|
128
|
+
}, 3000);
|
|
129
|
+
}
|
|
130
|
+
return function () {
|
|
131
|
+
handleClearInterval();
|
|
132
|
+
};
|
|
133
|
+
}, [srcUrl, documentId, contractId, name]);
|
|
134
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
135
|
+
className: "sign_page"
|
|
136
|
+
}, /*#__PURE__*/_react["default"].createElement("iframe", {
|
|
137
|
+
src: srcUrl,
|
|
138
|
+
id: "iframe",
|
|
139
|
+
frameborder: "0",
|
|
140
|
+
height: "100%",
|
|
141
|
+
width: "100%"
|
|
142
|
+
}));
|
|
143
|
+
}
|
|
144
|
+
var _default = exports["default"] = SignPage;
|