ydb-components-material 0.1.18 → 0.1.19

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.
Files changed (47) hide show
  1. package/build/docs/404.html +3 -3
  2. package/build/docs/_demos/:uuid +3 -3
  3. package/build/docs/colorful-button.html +3 -3
  4. package/build/docs/colorful-input.html +3 -3
  5. package/build/docs/index.html +3 -3
  6. package/build/docs/umi.5df7f485.js +1 -0
  7. package/build/docs/~demos/:uuid.html +3 -3
  8. package/build/docs/~demos/colorful-button-demo.html +3 -3
  9. package/build/docs/~demos/colorful-input-demo.html +3 -3
  10. package/build/lowcode/assets-daily.json +11 -11
  11. package/build/lowcode/assets-dev.json +2 -2
  12. package/build/lowcode/assets-prod.json +11 -11
  13. package/build/lowcode/meta.js +1 -1
  14. package/build/lowcode/preview.js +7 -7
  15. package/build/lowcode/render/default/view.js +1 -1
  16. package/build/lowcode/view.js +1 -1
  17. package/dist/BizComps.js +1 -1
  18. package/dist/BizComps.js.map +1 -1
  19. package/es/api.js +110 -0
  20. package/es/components/file-item/file.js +164 -0
  21. package/es/components/file-item/index.d.ts +5 -0
  22. package/es/components/file-item/index.js +55 -6
  23. package/es/components/file-item/seal.d.ts +3 -0
  24. package/es/components/file-item/seal.js +54 -0
  25. package/es/components/file-item/sealUtil.js +173 -0
  26. package/es/components/file-item/sign.d.ts +3 -0
  27. package/es/components/file-item/sign.js +114 -0
  28. package/es/components/file-item/signUtil.js +370 -0
  29. package/es/components/scene-tree/index.js +6 -4
  30. package/lib/api.js +115 -0
  31. package/lib/components/file-item/file.js +172 -0
  32. package/lib/components/file-item/index.d.ts +5 -0
  33. package/lib/components/file-item/index.js +55 -6
  34. package/lib/components/file-item/seal.d.ts +3 -0
  35. package/lib/components/file-item/seal.js +60 -0
  36. package/lib/components/file-item/sealUtil.js +175 -0
  37. package/lib/components/file-item/sign.d.ts +3 -0
  38. package/lib/components/file-item/sign.js +120 -0
  39. package/lib/components/file-item/signUtil.js +372 -0
  40. package/lib/components/scene-tree/index.js +6 -4
  41. package/lowcode/file-item/meta.ts +83 -0
  42. package/lowcode_es/file-item/meta.js +78 -0
  43. package/lowcode_es/meta.js +1 -1
  44. package/lowcode_lib/file-item/meta.js +78 -0
  45. package/lowcode_lib/meta.js +1 -1
  46. package/package.json +3 -3
  47. package/build/docs/umi.98b9987e.js +0 -1
@@ -0,0 +1,114 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
+ import React, { useEffect, useState, useRef } from 'react';
5
+ import { initSignPageMethod, getSignRes } from "./signUtil";
6
+ function SignPage(props) {
7
+ var isShowSignPage = props.isShowSignPage,
8
+ userInfo = props.userInfo,
9
+ file = props.file,
10
+ token = props.token,
11
+ getRes = props.getRes;
12
+ var _useState = useState(''),
13
+ srcUrl = _useState[0],
14
+ setSrcUrl = _useState[1];
15
+ var _useState2 = useState(''),
16
+ documentId = _useState2[0],
17
+ setDocumentId = _useState2[1];
18
+ var _useState3 = useState(''),
19
+ contractId = _useState3[0],
20
+ setContractId = _useState3[1];
21
+ var _useState4 = useState(''),
22
+ name = _useState4[0],
23
+ setName = _useState4[1];
24
+ var timerRef = useRef(null);
25
+ var handleRes = /*#__PURE__*/function () {
26
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
27
+ var res, documentIdVal, contractIdVal, pageUrl, nameVal;
28
+ return _regeneratorRuntime.wrap(function (_context) {
29
+ while (1) switch (_context.prev = _context.next) {
30
+ case 0:
31
+ _context.next = 1;
32
+ return initSignPageMethod(file, userInfo, token);
33
+ case 1:
34
+ res = _context.sent;
35
+ documentIdVal = res.documentId, contractIdVal = res.contractId, pageUrl = res.pageUrl, nameVal = res.name;
36
+ setSrcUrl(pageUrl);
37
+ setDocumentId(documentIdVal);
38
+ setContractId(contractIdVal);
39
+ setName(nameVal);
40
+ console.log(res);
41
+ case 2:
42
+ case "end":
43
+ return _context.stop();
44
+ }
45
+ }, _callee);
46
+ }));
47
+ return function handleRes() {
48
+ return _ref.apply(this, arguments);
49
+ };
50
+ }();
51
+ var getSignedFile = /*#__PURE__*/function () {
52
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(documentIdVal, contractIdVal, nameVal, tokenVal) {
53
+ var newFile, finalFile;
54
+ return _regeneratorRuntime.wrap(function (_context2) {
55
+ while (1) switch (_context2.prev = _context2.next) {
56
+ case 0:
57
+ console.log('tokenVal----', tokenVal);
58
+ // const { autoUpload } = this
59
+ _context2.next = 1;
60
+ return getSignRes(documentIdVal, contractIdVal, nameVal, true, tokenVal);
61
+ case 1:
62
+ newFile = _context2.sent;
63
+ console.log(newFile, '签署完毕后的');
64
+ if (newFile) {
65
+ // 关闭轮询定时
66
+ handleClearInterval();
67
+ // 关闭弹框
68
+ // this.handleClose()
69
+ // 将手写签批后的新文件 传给
70
+ finalFile = _extends({
71
+ name: nameVal,
72
+ url: newFile.fileUrlList[0]
73
+ }, newFile);
74
+ console.log('finalFile---', finalFile);
75
+ getRes(finalFile);
76
+ }
77
+ case 2:
78
+ case "end":
79
+ return _context2.stop();
80
+ }
81
+ }, _callee2);
82
+ }));
83
+ return function getSignedFile(_x, _x2, _x3, _x4) {
84
+ return _ref2.apply(this, arguments);
85
+ };
86
+ }();
87
+ var handleClearInterval = function handleClearInterval() {
88
+ clearInterval(timerRef.current);
89
+ timerRef.current = null;
90
+ };
91
+ useEffect(function () {
92
+ if (isShowSignPage) {
93
+ handleRes();
94
+ }
95
+ }, [isShowSignPage]);
96
+ useEffect(function () {
97
+ if (srcUrl && documentId && contractId && name && token && !timerRef.current) {
98
+ handleClearInterval();
99
+ timerRef.current = setInterval(function () {
100
+ getSignedFile(documentId, contractId, name, token);
101
+ }, 3000);
102
+ }
103
+ }, [srcUrl, documentId, contractId, name, token]);
104
+ return /*#__PURE__*/React.createElement("div", {
105
+ className: "sign_page"
106
+ }, /*#__PURE__*/React.createElement("iframe", {
107
+ src: srcUrl,
108
+ id: "iframe",
109
+ frameborder: "0",
110
+ height: "500px",
111
+ width: "100%"
112
+ }));
113
+ }
114
+ export default SignPage;
@@ -0,0 +1,370 @@
1
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
+ import { getBlob, getFileExtension, upload, dataURLtoBlob, uploadFilePromise } from "./file";
4
+ import { createbycategory, contractSignUrl, signurl, checkSignState, contractFinish, documentDownload } from "../../api";
5
+ var baseURL = 'http://172.16.132.12:5005';
6
+ var categoryId = '3354397552669692408';
7
+ var documentId = ''; // 手写签批生成的文件id
8
+ var contractId = ''; // 合同id
9
+
10
+ // 对外的方法 初始化手写签批的页面
11
+ export function initSignPageMethod(_x, _x2, _x3) {
12
+ return _initSignPageMethod.apply(this, arguments);
13
+ }
14
+
15
+ // 【第1步】上传要手写签批的文件
16
+ function _initSignPageMethod() {
17
+ _initSignPageMethod = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(fileObj, userInfo, token) {
18
+ var name, docId, contrId, flag, pageUrl, params;
19
+ return _regeneratorRuntime.wrap(function (_context) {
20
+ while (1) switch (_context.prev = _context.next) {
21
+ case 0:
22
+ console.log('fileObj', fileObj, userInfo, token);
23
+ name = fileObj.name; // 【第1步】上传要手写签批的文件
24
+ _context.next = 1;
25
+ return uploadSignFile(fileObj, token);
26
+ case 1:
27
+ docId = _context.sent;
28
+ if (docId) {
29
+ _context.next = 2;
30
+ break;
31
+ }
32
+ return _context.abrupt("return", false);
33
+ case 2:
34
+ documentId = docId; // 保存文档id
35
+
36
+ // 【第2步】创建或者发起电子签批
37
+ _context.next = 3;
38
+ return createbycategoryFun(name, docId, token);
39
+ case 3:
40
+ contrId = _context.sent;
41
+ console.log('contrId---', contrId);
42
+ if (contrId) {
43
+ _context.next = 4;
44
+ break;
45
+ }
46
+ return _context.abrupt("return", false);
47
+ case 4:
48
+ contractId = contrId;
49
+ // const contractIdList = [contrId];
50
+ // uni.setStorageSync('contractIdList',
51
+ // [
52
+ // ...uni.getStorageSync('contractIdList'), ...contractIdList
53
+ // ]
54
+ // );
55
+
56
+ // 【第3步】创建手写签批页面
57
+ _context.next = 5;
58
+ return getContractSignUrl(contrId, userInfo, token);
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, token);
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 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(event, token) {
98
+ var blob, file, signApprovalFileType;
99
+ return _regeneratorRuntime.wrap(function (_context2) {
100
+ while (1) switch (_context2.prev = _context2.next) {
101
+ case 0:
102
+ console.log(event, '文件');
103
+ // uni.showLoading({ title: '加载中' })
104
+ _context2.next = 1;
105
+ return getBlob(event.url);
106
+ case 1:
107
+ blob = _context2.sent;
108
+ file = new File([blob], event.name, {
109
+ type: event.type
110
+ }); // 获取文件类型
111
+ signApprovalFileType = getFileExtension(event.name);
112
+ return _context2.abrupt("return", new Promise(function (resolve) {
113
+ // 上传文件
114
+ upload({
115
+ file: file,
116
+ title: event.name,
117
+ fileType: signApprovalFileType,
118
+ filename: event.name,
119
+ // 文件名称
120
+ headers: {
121
+ Authorization: token
122
+ },
123
+ action: "\nhttps://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/signapproval/api/createbyfile",
124
+ // 上传文件的地址
125
+ onError: function onError(e) {
126
+ // uni.$u.toast(e.msg || '手写签批上传文件异常');
127
+ // uni.hideLoading();
128
+ resolve(false);
129
+ },
130
+ onSuccess: function onSuccess(e) {
131
+ // 上传成功
132
+ console.log('上传成功', e);
133
+ resolve(e.data.documentId);
134
+ }
135
+ });
136
+ }));
137
+ case 2:
138
+ case "end":
139
+ return _context2.stop();
140
+ }
141
+ }, _callee2);
142
+ }));
143
+ return _uploadSignFile.apply(this, arguments);
144
+ }
145
+ function createbycategoryFun(fileName, documentIdVal, token) {
146
+ // uni.showLoading({ title: '加载中' })
147
+ var params = {
148
+ subject: fileName,
149
+ documents: [documentIdVal],
150
+ categoryId: categoryId,
151
+ send: true,
152
+ tenantName: '山西省行政审批服务管理局'
153
+ };
154
+ return new Promise(function (resolve) {
155
+ createbycategory(params, {
156
+ token: token
157
+ }).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, token) {
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
+ contractSignUrl(params, {
190
+ token: token
191
+ }).then(function (res) {
192
+ if (res.data.code == 0) {
193
+ resolve(true);
194
+ } else {
195
+ // uni.hideLoading();
196
+ // uni.showModal({
197
+ // title: '温馨提示',
198
+ // content: '获取签批页面失败',
199
+ // confirmText: '知道了',
200
+ // showCancel: false,
201
+ // })
202
+ resolve(false);
203
+ }
204
+ })["catch"](function (error) {
205
+ // uni.hideLoading();
206
+ resolve(false);
207
+ });
208
+ });
209
+ }
210
+
211
+ // 【第4步】获取签章页面
212
+ function getSignUrl(userInfo, token) {
213
+ // uni.showLoading({ title: '加载中' })
214
+ var params = {
215
+ contractId: contractId,
216
+ tenantType: 'PERSONAL',
217
+ // COMPANY(组织),PERSONAL(个人)
218
+ tenantName: userInfo.acctType === '20' ? userInfo.legalName : userInfo.userName,
219
+ contact: userInfo.acctType === '20' ? userInfo.legalMobile : userInfo.contactMobile,
220
+ canReturn: false,
221
+ // 页面是否显示返回按钮
222
+ canWithdraw: false,
223
+ // 页面是否显示撤回/回退/拒签按钮
224
+ rejectable: false,
225
+ // 页面是否显示拒签按钮
226
+ allowDownload: false,
227
+ // 页面是否显示下载按钮
228
+ allowPrint: false,
229
+ // 页面是否显示打印按钮
230
+ canViewDetail: false,
231
+ // 页面是否显示签署详情按钮
232
+ canMoreOperation: false,
233
+ // 页面是否显示“更多操作”按钮
234
+ autoClosePage: true,
235
+ // 操作完成自动关闭页面
236
+ language: 'ZH_CN',
237
+ deviceType: 'H5' // 取值范围:PC(返回PC页面),H5(返回H5页面);不传值默认为:根据请求的UserAgent自动判断返回的页面类型。
238
+ };
239
+ return new Promise(function (resolve) {
240
+ signurl(params, {
241
+ token: token
242
+ }).then(function (res) {
243
+ console.log(res, '页面结果');
244
+ if (res.data.code == 0) {
245
+ resolve(res.data.signUrl);
246
+ } else {
247
+ resolve(false);
248
+ }
249
+ // uni.hideLoading();
250
+ })["catch"](function (error) {
251
+ resolve(false);
252
+ // uni.hideLoading();
253
+ });
254
+ });
255
+ }
256
+
257
+ // 下方是打开手写签批页面后 的后续操作
258
+
259
+ // 对外的方法 获取签批后的文件
260
+ export function getSignRes(_x6, _x7, _x8, _x9, _x0) {
261
+ return _getSignRes.apply(this, arguments);
262
+ }
263
+
264
+ // 轮询 签批状态
265
+ function _getSignRes() {
266
+ _getSignRes = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(documentIdVal, contractIdVal, name, autoUpload, token) {
267
+ var isSignSucc, newFile, uploadedFileObj;
268
+ return _regeneratorRuntime.wrap(function (_context3) {
269
+ while (1) switch (_context3.prev = _context3.next) {
270
+ case 0:
271
+ _context3.next = 1;
272
+ return getCheckSignState(contractIdVal, token);
273
+ case 1:
274
+ isSignSucc = _context3.sent;
275
+ if (!isSignSucc) {
276
+ _context3.next = 6;
277
+ break;
278
+ }
279
+ // 封存
280
+ getContractFinish(contractIdVal, token);
281
+ _context3.next = 2;
282
+ return handleSignApprovalDown(documentIdVal, name, token);
283
+ case 2:
284
+ newFile = _context3.sent;
285
+ console.log('newFile', newFile);
286
+ // 如果需要自动上传
287
+ if (!autoUpload) {
288
+ _context3.next = 4;
289
+ break;
290
+ }
291
+ _context3.next = 3;
292
+ return uploadFilePromise(newFile, token);
293
+ case 3:
294
+ uploadedFileObj = _context3.sent;
295
+ console.log('签批完成后的文件地址', uploadedFileObj);
296
+ return _context3.abrupt("return", uploadedFileObj);
297
+ case 4:
298
+ return _context3.abrupt("return", newFile);
299
+ case 5:
300
+ _context3.next = 7;
301
+ break;
302
+ case 6:
303
+ return _context3.abrupt("return", false);
304
+ case 7:
305
+ case "end":
306
+ return _context3.stop();
307
+ }
308
+ }, _callee3);
309
+ }));
310
+ return _getSignRes.apply(this, arguments);
311
+ }
312
+ function getCheckSignState(contractIdVal, token) {
313
+ return new Promise(function (resolve) {
314
+ checkSignState({
315
+ contractId: contractIdVal
316
+ }, {
317
+ token: token
318
+ }).then(function (res) {
319
+ console.log('轮询结果---', res);
320
+ // console.log('轮询结果', JSON.parse(res.data));
321
+ // 签署完成
322
+ if (res.data !== 'null') {
323
+ res = JSON.parse(res.data);
324
+ if (res.status == 'SIGNED') {
325
+ resolve(true);
326
+ } else {
327
+ resolve(false);
328
+ }
329
+ } else {
330
+ resolve(false);
331
+ }
332
+ });
333
+ });
334
+ }
335
+
336
+ // 封存电子签批
337
+ function getContractFinish(contractIdVal, token) {
338
+ contractFinish({
339
+ contractId: contractIdVal
340
+ }, {
341
+ token: token
342
+ });
343
+ }
344
+
345
+ // 下载签署完的文档
346
+ function handleSignApprovalDown(documentIdVal, name, token) {
347
+ var params = {
348
+ documentId: documentIdVal,
349
+ type: 'pdf'
350
+ };
351
+ return new Promise(function (resolve) {
352
+ documentDownload(params, {
353
+ token: token
354
+ }).then(function (res) {
355
+ console.log('下载文件:', res);
356
+ // 返回来是base64格式的
357
+ var blob = dataURLtoBlob(res.data); // 转成blob格式进行上传
358
+ console.log(blob, '新文件的blob格式');
359
+ var fileObj = {
360
+ file: [{
361
+ url: res.data,
362
+ size: blob.size,
363
+ isSignApproval: true,
364
+ name: name
365
+ }]
366
+ };
367
+ resolve(blob);
368
+ });
369
+ });
370
+ }
@@ -150,7 +150,7 @@ var SceneTree = function SceneTree(_ref) {
150
150
  console.log('targetNodeOfOriginTree', targetNodeOfOriginTree);
151
151
  // 找到题目下选中的那个选项
152
152
  var targetOption = targetNodeOfOriginTree.options.find(function (item) {
153
- return item.value === val;
153
+ return item.id === val;
154
154
  });
155
155
  // 拿到选中选项的子题目
156
156
  var targetNodeChildList = (targetOption.children || []).map(function (item) {
@@ -169,6 +169,7 @@ var SceneTree = function SceneTree(_ref) {
169
169
  };
170
170
  var _TreeNode = function TreeNode(_ref2) {
171
171
  var node = _ref2.node;
172
+ console.log('val', node.value);
172
173
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FormItem, {
173
174
  name: "baseUser",
174
175
  label: node.title,
@@ -181,11 +182,12 @@ var SceneTree = function SceneTree(_ref) {
181
182
  value: node.value,
182
183
  onChange: onValChange,
183
184
  "aria-labelledby": "groupId"
184
- }, node.options.map(function (option) {
185
+ }, node.options.map(function (option, index) {
186
+ console.log('optionsVal', option.value);
185
187
  return /*#__PURE__*/React.createElement(_Radio, {
186
188
  id: option.pid + "+" + node.pid,
187
- key: option.id + node.pid + option.value,
188
- value: option.value
189
+ key: option.id + node.pid + option.value + index,
190
+ value: option.id
189
191
  }, option.name);
190
192
  }))), node.children && (node.children || []).map(function (item) {
191
193
  return /*#__PURE__*/React.createElement(_TreeNode, {
package/lib/api.js ADDED
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ exports.__esModule = true;
5
+ exports.signurl = exports.signFileDownApi = exports.qrySealApi = exports.post = exports.getSealUrlApi = exports.get = exports.documentDownload = exports.createbycategory = exports.contractSignUrl = exports.contractFinish = exports.checkSignState = void 0;
6
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
7
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
8
+ var post = exports.post = /*#__PURE__*/function () {
9
+ var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(url, data, config) {
10
+ var res;
11
+ return _regenerator["default"].wrap(function (_context) {
12
+ while (1) switch (_context.prev = _context.next) {
13
+ case 0:
14
+ _context.next = 1;
15
+ return fetch(url, {
16
+ method: 'POST',
17
+ headers: {
18
+ 'Content-Type': config && config['Content-Type'] ? config['Content-Type'] : 'application/json',
19
+ // 声明发送的数据格式
20
+ 'Authorization': config.token || undefined
21
+ },
22
+ body: JSON.stringify(data)
23
+ }).then(function (response) {
24
+ return response.json();
25
+ }).then(function (res) {
26
+ return res;
27
+ })["catch"](function (err) {
28
+ return err;
29
+ });
30
+ case 1:
31
+ res = _context.sent;
32
+ return _context.abrupt("return", res);
33
+ case 2:
34
+ case "end":
35
+ return _context.stop();
36
+ }
37
+ }, _callee);
38
+ }));
39
+ return function post(_x, _x2, _x3) {
40
+ return _ref.apply(this, arguments);
41
+ };
42
+ }();
43
+ var get = exports.get = /*#__PURE__*/function () {
44
+ var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(url, data, config) {
45
+ var res;
46
+ return _regenerator["default"].wrap(function (_context2) {
47
+ while (1) switch (_context2.prev = _context2.next) {
48
+ case 0:
49
+ _context2.next = 1;
50
+ return fetch(url + "?" + new URLSearchParams(data), {
51
+ method: 'GET',
52
+ headers: {
53
+ 'Content-Type': config && config['Content-Type'] ? config['Content-Type'] : 'application/json'
54
+ }
55
+ }).then(function (response) {
56
+ return response.json();
57
+ }).then(function (res) {
58
+ return res;
59
+ })["catch"](function (err) {
60
+ return err;
61
+ });
62
+ case 1:
63
+ res = _context2.sent;
64
+ return _context2.abrupt("return", res);
65
+ case 2:
66
+ case "end":
67
+ return _context2.stop();
68
+ }
69
+ }, _callee2);
70
+ }));
71
+ return function get(_x4, _x5, _x6) {
72
+ return _ref2.apply(this, arguments);
73
+ };
74
+ }();
75
+ var createbycategory = exports.createbycategory = function createbycategory(params, config) {
76
+ return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/signapproval/api/createbycategory", params, config);
77
+ };
78
+
79
+ // 获取电子签批签署页面
80
+ var contractSignUrl = exports.contractSignUrl = function contractSignUrl(params, config) {
81
+ return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/signapproval/api/contractSignUrl", params, config);
82
+ };
83
+
84
+ // 获取电子签批签署页面
85
+ var signurl = exports.signurl = function signurl(params, config) {
86
+ return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/signapproval/contract/signurl/v3", params, config);
87
+ };
88
+
89
+ // 校验签批状态-轮训
90
+ var checkSignState = exports.checkSignState = function checkSignState(params, config) {
91
+ return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/signapproval/api/checkSignState", params, config);
92
+ };
93
+
94
+ // 封存电子签批并完成签署
95
+ var contractFinish = exports.contractFinish = function contractFinish(params, config) {
96
+ return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/signapproval/api/contract/finish", params, config);
97
+ };
98
+
99
+ // 下载签署文档
100
+ var documentDownload = exports.documentDownload = function documentDownload(params, config) {
101
+ return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/signapproval/api/documentDownload", params, config);
102
+ };
103
+ var qrySealApi = exports.qrySealApi = function qrySealApi(params, config) {
104
+ return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/sign/api/qrySeal", params, config);
105
+ };
106
+
107
+ // 获取电子签章页面
108
+ var getSealUrlApi = exports.getSealUrlApi = function getSealUrlApi(params, config) {
109
+ return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/sign/api/signWebByDirect", params, config);
110
+ };
111
+
112
+ // 电子签章-下载文件
113
+ var signFileDownApi = exports.signFileDownApi = function signFileDownApi(params, config) {
114
+ return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/sign/api/fileDownloadBySign", params, config);
115
+ };