ydb-components-material 0.1.21 → 0.1.23
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/close.e2e8764a.svg +1 -0
- package/build/docs/umi.d170f160.js +1 -0
- package/build/docs/{umi.4278bf7b.css → umi.e536bfab.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 +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +1 -1
- package/dist/BizComps.css +1 -1
- package/dist/BizComps.js +1 -1
- package/dist/BizComps.js.map +1 -1
- package/es/api.js +27 -7
- package/es/components/file-item/file.js +65 -5
- package/es/components/file-item/icon/close.svg +1 -0
- package/es/components/file-item/index.d.ts +9 -5
- package/es/components/file-item/index.js +320 -63
- package/es/components/file-item/index.scss +42 -3
- package/es/components/file-item/seal.js +111 -12
- package/es/components/file-item/sealUtil.js +129 -32
- package/es/components/file-item/sign.js +20 -16
- package/es/components/file-item/signUtil.js +3 -3
- package/es/components/scene-tree/index.js +1 -0
- package/es/utils.js +0 -0
- package/lib/api.js +28 -8
- package/lib/components/file-item/file.js +66 -5
- package/lib/components/file-item/icon/close.svg +1 -0
- package/lib/components/file-item/index.d.ts +9 -5
- package/lib/components/file-item/index.js +321 -64
- package/lib/components/file-item/index.scss +42 -3
- package/lib/components/file-item/seal.js +110 -11
- package/lib/components/file-item/sealUtil.js +128 -31
- package/lib/components/file-item/sign.js +20 -16
- package/lib/components/file-item/signUtil.js +3 -3
- package/lib/components/scene-tree/index.js +1 -0
- package/lib/utils.js +1 -0
- package/lowcode/file-item/meta.ts +63 -15
- package/lowcode_es/file-item/meta.js +60 -15
- package/lowcode_es/meta.js +1 -1
- package/lowcode_lib/file-item/meta.js +60 -15
- package/lowcode_lib/meta.js +1 -1
- package/package.json +3 -3
- package/build/docs/umi.b1d4b795.js +0 -1
|
@@ -4,33 +4,43 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports["default"] = void 0;
|
|
6
6
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
7
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
8
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
10
|
var _sealUtil = require("./sealUtil");
|
|
11
|
+
var _api = require("../../api");
|
|
12
|
+
var _file = require("./file.js");
|
|
10
13
|
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); }
|
|
11
14
|
function SealPage(props) {
|
|
12
|
-
var
|
|
13
|
-
userInfo = props.userInfo,
|
|
15
|
+
var userInfo = props.userInfo,
|
|
14
16
|
file = props.file,
|
|
15
17
|
token = props.token,
|
|
16
18
|
accessToken = props.accessToken,
|
|
17
|
-
|
|
19
|
+
getSealRes = props.getSealRes,
|
|
20
|
+
baseUrl = props.baseUrl,
|
|
21
|
+
handleClose = props.handleClose;
|
|
18
22
|
var _useState = (0, _react.useState)(''),
|
|
19
23
|
srcUrl = _useState[0],
|
|
20
24
|
setSrcUrl = _useState[1];
|
|
25
|
+
var _useState2 = (0, _react.useState)(''),
|
|
26
|
+
orderId = _useState2[0],
|
|
27
|
+
setOrderId = _useState2[1];
|
|
28
|
+
var timerRef = (0, _react.useRef)(null);
|
|
21
29
|
var handleRes = /*#__PURE__*/function () {
|
|
22
30
|
var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
23
|
-
var res, pageUrl;
|
|
31
|
+
var res, pageUrl, orderIdVal;
|
|
24
32
|
return _regenerator["default"].wrap(function (_context) {
|
|
25
33
|
while (1) switch (_context.prev = _context.next) {
|
|
26
34
|
case 0:
|
|
27
35
|
console.log('file', file, userInfo);
|
|
28
36
|
_context.next = 1;
|
|
29
|
-
return (0, _sealUtil.initSealPageMethod)(file, userInfo, token, accessToken);
|
|
37
|
+
return (0, _sealUtil.initSealPageMethod)(file, userInfo, token, accessToken, baseUrl);
|
|
30
38
|
case 1:
|
|
31
39
|
res = _context.sent;
|
|
32
|
-
pageUrl = res.pageUrl;
|
|
40
|
+
pageUrl = res.pageUrl, orderIdVal = res.orderId;
|
|
41
|
+
console.log('pageUrl', pageUrl);
|
|
33
42
|
setSrcUrl(pageUrl);
|
|
43
|
+
setOrderId(orderIdVal);
|
|
34
44
|
// console.log(res)
|
|
35
45
|
case 2:
|
|
36
46
|
case "end":
|
|
@@ -42,18 +52,107 @@ function SealPage(props) {
|
|
|
42
52
|
return _ref.apply(this, arguments);
|
|
43
53
|
};
|
|
44
54
|
}();
|
|
55
|
+
|
|
56
|
+
// 将返回的文件重新上传
|
|
57
|
+
var uploadNewFile = /*#__PURE__*/function () {
|
|
58
|
+
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(fileData) {
|
|
59
|
+
var blob, uploadedFileObj, finalFile;
|
|
60
|
+
return _regenerator["default"].wrap(function (_context2) {
|
|
61
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
62
|
+
case 0:
|
|
63
|
+
blob = (0, _file.dataURLtoBlob)('data:application/pdf;base64,' + fileData);
|
|
64
|
+
_context2.next = 1;
|
|
65
|
+
return (0, _file.uploadFilePromise)(blob, baseUrl, token);
|
|
66
|
+
case 1:
|
|
67
|
+
uploadedFileObj = _context2.sent;
|
|
68
|
+
console.log('重新上传的文件', uploadedFileObj);
|
|
69
|
+
handleClose();
|
|
70
|
+
finalFile = (0, _extends2["default"])({
|
|
71
|
+
name: file.name,
|
|
72
|
+
url: uploadedFileObj.fileUrl
|
|
73
|
+
}, uploadedFileObj);
|
|
74
|
+
getSealRes(finalFile);
|
|
75
|
+
case 2:
|
|
76
|
+
case "end":
|
|
77
|
+
return _context2.stop();
|
|
78
|
+
}
|
|
79
|
+
}, _callee2);
|
|
80
|
+
}));
|
|
81
|
+
return function uploadNewFile(_x) {
|
|
82
|
+
return _ref2.apply(this, arguments);
|
|
83
|
+
};
|
|
84
|
+
}();
|
|
85
|
+
|
|
86
|
+
// 下载文件
|
|
87
|
+
var signFileDown = function signFileDown(filePath) {
|
|
88
|
+
(0, _api.signFileDownApi)({
|
|
89
|
+
fileUrl: filePath
|
|
90
|
+
}, {
|
|
91
|
+
baseUrl: baseUrl,
|
|
92
|
+
token: token
|
|
93
|
+
}).then(function (res) {
|
|
94
|
+
if (res.code === 200) {
|
|
95
|
+
uploadNewFile(res.data);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// 电子签章-移动端签批 获取移动端签章结果(文件地址)
|
|
101
|
+
var getSignFileFun = function getSignFileFun() {
|
|
102
|
+
// uni.showLoading({ title: '加载中' })
|
|
103
|
+
|
|
104
|
+
var params = {
|
|
105
|
+
orderId: orderId
|
|
106
|
+
};
|
|
107
|
+
(0, _api.getSignFileApi)(params, {
|
|
108
|
+
baseUrl: baseUrl,
|
|
109
|
+
token: token
|
|
110
|
+
}).then(function (res) {
|
|
111
|
+
if (!res) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
console.log(res, '签章之后的数据');
|
|
115
|
+
var _res$data = res.data,
|
|
116
|
+
signStatus = _res$data.signStatus,
|
|
117
|
+
signFiles = _res$data.signFiles;
|
|
118
|
+
if (signStatus === 6) {
|
|
119
|
+
// 签署成功
|
|
120
|
+
handleClearInterval();
|
|
121
|
+
if (signFiles && signFiles.length) {
|
|
122
|
+
// 下载该文件
|
|
123
|
+
signFileDown(signFiles[0].filePath);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
// uni.hideLoading()
|
|
127
|
+
})["catch"](function (err) {
|
|
128
|
+
console.log(err);
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
var handleClearInterval = function handleClearInterval() {
|
|
132
|
+
clearInterval(timerRef.current);
|
|
133
|
+
timerRef.current = null;
|
|
134
|
+
};
|
|
45
135
|
(0, _react.useEffect)(function () {
|
|
46
|
-
if (
|
|
47
|
-
|
|
136
|
+
if (orderId) {
|
|
137
|
+
handleClearInterval();
|
|
138
|
+
timerRef.current = setInterval(function () {
|
|
139
|
+
getSignFileFun();
|
|
140
|
+
}, 3000);
|
|
48
141
|
}
|
|
49
|
-
|
|
142
|
+
return function () {
|
|
143
|
+
handleClearInterval();
|
|
144
|
+
};
|
|
145
|
+
}, [orderId]);
|
|
146
|
+
(0, _react.useEffect)(function () {
|
|
147
|
+
handleRes();
|
|
148
|
+
}, [userInfo, file, token, accessToken, baseUrl]);
|
|
50
149
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
51
|
-
className: "
|
|
150
|
+
className: "sealPage"
|
|
52
151
|
}, /*#__PURE__*/_react["default"].createElement("iframe", {
|
|
53
152
|
src: srcUrl,
|
|
54
153
|
id: "iframe",
|
|
55
154
|
frameborder: "0",
|
|
56
|
-
height: "
|
|
155
|
+
height: "100%",
|
|
57
156
|
width: "100%"
|
|
58
157
|
}));
|
|
59
158
|
}
|
|
@@ -11,12 +11,12 @@ var _api = require("../../api.js");
|
|
|
11
11
|
// import apiConfig from '@/config/api.cofig'
|
|
12
12
|
// const userInfo = uni.getStorageSync('userInfo')
|
|
13
13
|
// 对外的方法 获取电子签章的页面地址
|
|
14
|
-
function initSealPageMethod(_x, _x2, _x3, _x4) {
|
|
14
|
+
function initSealPageMethod(_x, _x2, _x3, _x4, _x5) {
|
|
15
15
|
return _initSealPageMethod.apply(this, arguments);
|
|
16
16
|
} // [第1步] 查询当前用户是否有电子签章
|
|
17
17
|
function _initSealPageMethod() {
|
|
18
|
-
_initSealPageMethod = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(fileObj, userInfo, token, accessToken) {
|
|
19
|
-
var name,
|
|
18
|
+
_initSealPageMethod = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(fileObj, userInfo, token, accessToken, baseUrl) {
|
|
19
|
+
var name, sealList, fileUrl, orderId, pageUrl, params;
|
|
20
20
|
return _regenerator["default"].wrap(function (_context) {
|
|
21
21
|
while (1) switch (_context.prev = _context.next) {
|
|
22
22
|
case 0:
|
|
@@ -24,26 +24,21 @@ function _initSealPageMethod() {
|
|
|
24
24
|
console.log('fileObj', fileObj, userInfo);
|
|
25
25
|
// 【第1步】判断当前用户是否有印章
|
|
26
26
|
_context.next = 1;
|
|
27
|
-
return querySeal(userInfo, token);
|
|
27
|
+
return querySeal(userInfo, token, baseUrl);
|
|
28
28
|
case 1:
|
|
29
|
-
|
|
30
|
-
if (
|
|
29
|
+
sealList = _context.sent;
|
|
30
|
+
if (sealList.length) {
|
|
31
31
|
_context.next = 2;
|
|
32
32
|
break;
|
|
33
33
|
}
|
|
34
34
|
_message["default"].error('该单位下暂无印章,请前往“山西政务服务网”或“三晋通”小程序申领印章');
|
|
35
|
-
// return uni.showModal({
|
|
36
|
-
// title: '提示',
|
|
37
|
-
// content: '该单位下暂无印章,请前往“山西政务服务网”或“三晋通”小程序申领印章',
|
|
38
|
-
// confirmText: '知道了',
|
|
39
|
-
// showCancel: false,
|
|
40
|
-
// })
|
|
41
35
|
return _context.abrupt("return", false);
|
|
42
36
|
case 2:
|
|
43
37
|
_context.next = 3;
|
|
44
|
-
return uploadSealFile(fileObj, token);
|
|
38
|
+
return uploadSealFile(fileObj, token, baseUrl);
|
|
45
39
|
case 3:
|
|
46
40
|
fileUrl = _context.sent;
|
|
41
|
+
console.log('fileUrl---', fileUrl);
|
|
47
42
|
if (fileUrl) {
|
|
48
43
|
_context.next = 4;
|
|
49
44
|
break;
|
|
@@ -51,22 +46,28 @@ function _initSealPageMethod() {
|
|
|
51
46
|
return _context.abrupt("return", false);
|
|
52
47
|
case 4:
|
|
53
48
|
_context.next = 5;
|
|
54
|
-
return
|
|
49
|
+
return getSignOrderId(sealList, fileObj, fileUrl, token, baseUrl, userInfo);
|
|
55
50
|
case 5:
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
orderId = _context.sent;
|
|
52
|
+
console.log('orderId---', orderId);
|
|
53
|
+
if (orderId) {
|
|
58
54
|
_context.next = 6;
|
|
59
55
|
break;
|
|
60
56
|
}
|
|
61
57
|
return _context.abrupt("return", false);
|
|
62
58
|
case 6:
|
|
59
|
+
_context.next = 7;
|
|
60
|
+
return getMobilePageFun(orderId, accessToken, token, baseUrl);
|
|
61
|
+
case 7:
|
|
62
|
+
pageUrl = _context.sent;
|
|
63
63
|
// 将 电子签章地址/文件名称 返回
|
|
64
64
|
params = {
|
|
65
65
|
pageUrl: pageUrl,
|
|
66
|
-
name: name
|
|
66
|
+
name: name,
|
|
67
|
+
orderId: orderId
|
|
67
68
|
};
|
|
68
69
|
return _context.abrupt("return", params);
|
|
69
|
-
case
|
|
70
|
+
case 8:
|
|
70
71
|
case "end":
|
|
71
72
|
return _context.stop();
|
|
72
73
|
}
|
|
@@ -74,7 +75,7 @@ function _initSealPageMethod() {
|
|
|
74
75
|
}));
|
|
75
76
|
return _initSealPageMethod.apply(this, arguments);
|
|
76
77
|
}
|
|
77
|
-
function querySeal(userInfo, token) {
|
|
78
|
+
function querySeal(userInfo, token, baseUrl) {
|
|
78
79
|
console.log('querySeal', userInfo);
|
|
79
80
|
// uni.showLoading({ title: '查询印章中' })
|
|
80
81
|
var params = {
|
|
@@ -84,27 +85,28 @@ function querySeal(userInfo, token) {
|
|
|
84
85
|
};
|
|
85
86
|
return new Promise(function (resolve) {
|
|
86
87
|
(0, _api.qrySealApi)(params, {
|
|
87
|
-
token: token
|
|
88
|
+
token: token,
|
|
89
|
+
baseUrl: baseUrl
|
|
88
90
|
}).then(function (res) {
|
|
89
91
|
if (res.data && res.data.length > 0) {
|
|
90
|
-
resolve(
|
|
92
|
+
resolve(res.data);
|
|
91
93
|
} else {
|
|
92
|
-
resolve(
|
|
94
|
+
resolve([]);
|
|
93
95
|
}
|
|
94
96
|
// uni.hideLoading()
|
|
95
97
|
})["catch"](function (error) {
|
|
96
|
-
resolve(
|
|
98
|
+
resolve([]);
|
|
97
99
|
// uni.hideLoading()
|
|
98
100
|
});
|
|
99
101
|
});
|
|
100
102
|
}
|
|
101
103
|
|
|
102
104
|
// [第2步] 上传文件
|
|
103
|
-
function uploadSealFile(
|
|
105
|
+
function uploadSealFile(_x6, _x7, _x8) {
|
|
104
106
|
return _uploadSealFile.apply(this, arguments);
|
|
105
107
|
} // [第3步] 获取电子印章页面
|
|
106
108
|
function _uploadSealFile() {
|
|
107
|
-
_uploadSealFile = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(fileObj, token) {
|
|
109
|
+
_uploadSealFile = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(fileObj, token, baseUrl) {
|
|
108
110
|
var blob, file;
|
|
109
111
|
return _regenerator["default"].wrap(function (_context2) {
|
|
110
112
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -116,7 +118,6 @@ function _uploadSealFile() {
|
|
|
116
118
|
file = new File([blob], fileObj.name, {
|
|
117
119
|
type: fileObj.type
|
|
118
120
|
}); // 上传接口
|
|
119
|
-
// const { baseURL } = apiConfig;
|
|
120
121
|
return _context2.abrupt("return", new Promise(function (resolve) {
|
|
121
122
|
(0, _file.upload)({
|
|
122
123
|
file: file,
|
|
@@ -125,7 +126,7 @@ function _uploadSealFile() {
|
|
|
125
126
|
headers: {
|
|
126
127
|
Authorization: token
|
|
127
128
|
},
|
|
128
|
-
action: "
|
|
129
|
+
action: baseUrl + "/declaration/center/sign/api/fileUploadApi",
|
|
129
130
|
// 上传文件的地址
|
|
130
131
|
onError: function onError(e) {
|
|
131
132
|
// uni.$u.toast(e.msg || '上传文件异常');
|
|
@@ -147,20 +148,116 @@ function _uploadSealFile() {
|
|
|
147
148
|
}));
|
|
148
149
|
return _uploadSealFile.apply(this, arguments);
|
|
149
150
|
}
|
|
150
|
-
function
|
|
151
|
+
function getSignOrderId(sealList, fileObj, esusFileUrl, token, baseUrl, userInfo) {
|
|
151
152
|
// uni.showLoading({ title: '获取签章页面中' })
|
|
152
|
-
|
|
153
|
+
console.log('sealList', sealList, fileObj, esusFileUrl, token, baseUrl, userInfo);
|
|
154
|
+
var fileId = fileObj.fileId,
|
|
155
|
+
name = fileObj.name;
|
|
156
|
+
// 循环签章列表 - 开始
|
|
157
|
+
var apiSignDtosArr = [];
|
|
158
|
+
sealList.forEach(function (sealItem, sealIndex) {
|
|
159
|
+
apiSignDtosArr.push({
|
|
160
|
+
deviceType: 3,
|
|
161
|
+
// 签章类型(默认3)
|
|
162
|
+
signType: 0,
|
|
163
|
+
// 签章方式(0 - 自由签章 or 定位签章2 - 关键字签章3 - 骑缝签章,一次只能有个一个类型,多个请写多组)
|
|
164
|
+
sealCode: sealItem.sealCode,
|
|
165
|
+
// 印章编码
|
|
166
|
+
signatories: [
|
|
167
|
+
// 定位签章参数
|
|
168
|
+
{
|
|
169
|
+
pageIndex: sealIndex,
|
|
170
|
+
// 签章所在页码
|
|
171
|
+
x: 0.00,
|
|
172
|
+
// 位置横坐标 支持百分比坐标<1,百分比。>1,pdf磅,ofd 毫米
|
|
173
|
+
y: 0.00 // 位置纵坐标
|
|
174
|
+
}]
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
var params = {
|
|
178
|
+
deptCode: userInfo.certificateSno,
|
|
179
|
+
// 单位统一社会信用代码
|
|
180
|
+
outUserId: userInfo.legalCertno,
|
|
181
|
+
// 用户身份证号
|
|
182
|
+
userIdType: '2',
|
|
183
|
+
// 2:身份证
|
|
184
|
+
signFileReqs: [{
|
|
185
|
+
file: esusFileUrl,
|
|
186
|
+
// 签章文件(签章文件base64编码文件数据或者文件地址)
|
|
187
|
+
fileType: '0',
|
|
188
|
+
// 文件格式类型(0文件路径;1文件数据)
|
|
189
|
+
docType: '0',
|
|
190
|
+
// 文件内容类型 (0 PDF;1 OFD)
|
|
191
|
+
fileId: fileId,
|
|
192
|
+
// 业务系统文件id (用于回传文件,不可重复)
|
|
193
|
+
fileName: name,
|
|
194
|
+
// 签章文件名称(文件名称包含文件格式,如a.pdf,b.ofd)
|
|
195
|
+
apiSignDtos: apiSignDtosArr
|
|
196
|
+
// apiSignDtos: [ // 签章信息列表(一次可以多个签章参数。每个参数选一个签章参数)
|
|
197
|
+
// {
|
|
198
|
+
// deviceType: 3, // 签章类型(默认3)
|
|
199
|
+
// sealCode: '14110000000423', // 印章编码
|
|
200
|
+
// signType: 0, // 签章方式(0 - 自由签章 or 定位签章2 - 关键字签章3 - 骑缝签章,一次只能有个一个类型,多个请写多组)
|
|
201
|
+
// signatories: [ // 定位签章参数
|
|
202
|
+
// {
|
|
203
|
+
// pageIndex: 0, // 签章所在页码
|
|
204
|
+
// x: 0.00, // 位置横坐标 支持百分比坐标<1,百分比。>1,pdf磅,ofd 毫米
|
|
205
|
+
// y: 0.00, // 位置纵坐标
|
|
206
|
+
// }
|
|
207
|
+
// ]
|
|
208
|
+
// },
|
|
209
|
+
// {
|
|
210
|
+
// deviceType: 3, // 签章类型(默认3)
|
|
211
|
+
// sealCode: '14110000000392', // 印章编码
|
|
212
|
+
// signType: 0, // 签章方式(0 - 自由签章 or 定位签章2 - 关键字签章3 - 骑缝签章,一次只能有个一个类型,多个请写多组)
|
|
213
|
+
// signatories: [ // 定位签章参数
|
|
214
|
+
// {
|
|
215
|
+
// pageIndex: 0, // 签章所在页码
|
|
216
|
+
// x: 0.00, // 位置横坐标 支持百分比坐标<1,百分比。>1,pdf磅,ofd 毫米
|
|
217
|
+
// y: 0.00, // 位置纵坐标
|
|
218
|
+
// }
|
|
219
|
+
// ]
|
|
220
|
+
// }
|
|
221
|
+
// ]
|
|
222
|
+
}]
|
|
223
|
+
};
|
|
224
|
+
console.log('params---', params);
|
|
225
|
+
return new Promise(function (resolve) {
|
|
226
|
+
console.log('获取签章订单id');
|
|
227
|
+
(0, _api.getSignOrderIdApi)(params, {
|
|
228
|
+
token: token,
|
|
229
|
+
baseUrl: baseUrl
|
|
230
|
+
}).then(function (res) {
|
|
231
|
+
if (res) {
|
|
232
|
+
var bigNumber = BigInt(res);
|
|
233
|
+
resolve(bigNumber + '');
|
|
234
|
+
// uni.hideLoading()
|
|
235
|
+
} else {
|
|
236
|
+
resolve(false);
|
|
237
|
+
// uni.hideLoading()
|
|
238
|
+
}
|
|
239
|
+
})["catch"](function () {
|
|
240
|
+
resolve(false);
|
|
241
|
+
// uni.hideLoading()
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// [第4步-移动端] 获取电子印章页面
|
|
247
|
+
function getMobilePageFun(orderId, accessToken, token, baseUrl) {
|
|
248
|
+
// uni.showLoading({ title: '获取移动端签章页面中' })
|
|
153
249
|
var params = {
|
|
154
250
|
accessToken: accessToken,
|
|
155
251
|
acctType: '20',
|
|
156
|
-
|
|
157
|
-
name: fileName
|
|
252
|
+
orderId: orderId
|
|
158
253
|
};
|
|
159
254
|
return new Promise(function (resolve) {
|
|
160
255
|
(0, _api.getSealUrlApi)(params, {
|
|
256
|
+
baseUrl: baseUrl,
|
|
161
257
|
token: token
|
|
162
258
|
}).then(function (res) {
|
|
163
259
|
if (res) {
|
|
260
|
+
console.log(res, '移动端签章页面');
|
|
164
261
|
resolve(res);
|
|
165
262
|
// uni.hideLoading()
|
|
166
263
|
} else {
|
|
@@ -14,7 +14,9 @@ function SignPage(props) {
|
|
|
14
14
|
userInfo = props.userInfo,
|
|
15
15
|
file = props.file,
|
|
16
16
|
token = props.token,
|
|
17
|
-
getRes = props.getRes
|
|
17
|
+
getRes = props.getRes,
|
|
18
|
+
handleClose = props.handleClose,
|
|
19
|
+
baseUrl = props.baseUrl;
|
|
18
20
|
var _useState = (0, _react.useState)(''),
|
|
19
21
|
srcUrl = _useState[0],
|
|
20
22
|
setSrcUrl = _useState[1];
|
|
@@ -28,7 +30,7 @@ function SignPage(props) {
|
|
|
28
30
|
name = _useState4[0],
|
|
29
31
|
setName = _useState4[1];
|
|
30
32
|
var timerRef = (0, _react.useRef)(null);
|
|
31
|
-
var
|
|
33
|
+
var init = /*#__PURE__*/function () {
|
|
32
34
|
var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
33
35
|
var res, documentIdVal, contractIdVal, pageUrl, nameVal;
|
|
34
36
|
return _regenerator["default"].wrap(function (_context) {
|
|
@@ -50,12 +52,12 @@ function SignPage(props) {
|
|
|
50
52
|
}
|
|
51
53
|
}, _callee);
|
|
52
54
|
}));
|
|
53
|
-
return function
|
|
55
|
+
return function init() {
|
|
54
56
|
return _ref.apply(this, arguments);
|
|
55
57
|
};
|
|
56
58
|
}();
|
|
57
59
|
var getSignedFile = /*#__PURE__*/function () {
|
|
58
|
-
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(documentIdVal, contractIdVal, nameVal, tokenVal) {
|
|
60
|
+
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(documentIdVal, contractIdVal, nameVal, tokenVal, baseUrl) {
|
|
59
61
|
var newFile, finalFile;
|
|
60
62
|
return _regenerator["default"].wrap(function (_context2) {
|
|
61
63
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -63,7 +65,7 @@ function SignPage(props) {
|
|
|
63
65
|
console.log('tokenVal----', tokenVal);
|
|
64
66
|
// const { autoUpload } = this
|
|
65
67
|
_context2.next = 1;
|
|
66
|
-
return (0, _signUtil.getSignRes)(documentIdVal, contractIdVal, nameVal, true, tokenVal);
|
|
68
|
+
return (0, _signUtil.getSignRes)(documentIdVal, contractIdVal, nameVal, true, tokenVal, baseUrl);
|
|
67
69
|
case 1:
|
|
68
70
|
newFile = _context2.sent;
|
|
69
71
|
console.log(newFile, '签署完毕后的');
|
|
@@ -71,11 +73,12 @@ function SignPage(props) {
|
|
|
71
73
|
// 关闭轮询定时
|
|
72
74
|
handleClearInterval();
|
|
73
75
|
// 关闭弹框
|
|
74
|
-
|
|
76
|
+
handleClose();
|
|
75
77
|
// 将手写签批后的新文件 传给
|
|
76
78
|
finalFile = (0, _extends2["default"])({
|
|
77
79
|
name: nameVal,
|
|
78
|
-
url: newFile.fileUrlList[0]
|
|
80
|
+
url: newFile.fileUrlList[0],
|
|
81
|
+
isSigned: true
|
|
79
82
|
}, newFile);
|
|
80
83
|
console.log('finalFile---', finalFile);
|
|
81
84
|
getRes(finalFile);
|
|
@@ -86,7 +89,7 @@ function SignPage(props) {
|
|
|
86
89
|
}
|
|
87
90
|
}, _callee2);
|
|
88
91
|
}));
|
|
89
|
-
return function getSignedFile(_x, _x2, _x3, _x4) {
|
|
92
|
+
return function getSignedFile(_x, _x2, _x3, _x4, _x5) {
|
|
90
93
|
return _ref2.apply(this, arguments);
|
|
91
94
|
};
|
|
92
95
|
}();
|
|
@@ -95,25 +98,26 @@ function SignPage(props) {
|
|
|
95
98
|
timerRef.current = null;
|
|
96
99
|
};
|
|
97
100
|
(0, _react.useEffect)(function () {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
}, [isShowSignPage]);
|
|
101
|
+
init();
|
|
102
|
+
}, []);
|
|
102
103
|
(0, _react.useEffect)(function () {
|
|
103
|
-
if (srcUrl && documentId && contractId && name && token && !timerRef.current) {
|
|
104
|
+
if (srcUrl && documentId && contractId && name && token && baseUrl && !timerRef.current) {
|
|
104
105
|
handleClearInterval();
|
|
105
106
|
timerRef.current = setInterval(function () {
|
|
106
|
-
getSignedFile(documentId, contractId, name, token);
|
|
107
|
+
getSignedFile(documentId, contractId, name, token, baseUrl);
|
|
107
108
|
}, 3000);
|
|
108
109
|
}
|
|
109
|
-
|
|
110
|
+
return function () {
|
|
111
|
+
handleClearInterval();
|
|
112
|
+
};
|
|
113
|
+
}, [srcUrl, documentId, contractId, name, token, baseUrl]);
|
|
110
114
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
111
115
|
className: "sign_page"
|
|
112
116
|
}, /*#__PURE__*/_react["default"].createElement("iframe", {
|
|
113
117
|
src: srcUrl,
|
|
114
118
|
id: "iframe",
|
|
115
119
|
frameborder: "0",
|
|
116
|
-
height: "
|
|
120
|
+
height: "100%",
|
|
117
121
|
width: "100%"
|
|
118
122
|
}));
|
|
119
123
|
}
|
|
@@ -261,11 +261,11 @@ function getSignUrl(userInfo, token) {
|
|
|
261
261
|
// 下方是打开手写签批页面后 的后续操作
|
|
262
262
|
|
|
263
263
|
// 对外的方法 获取签批后的文件
|
|
264
|
-
function getSignRes(_x6, _x7, _x8, _x9, _x0) {
|
|
264
|
+
function getSignRes(_x6, _x7, _x8, _x9, _x0, _x1) {
|
|
265
265
|
return _getSignRes.apply(this, arguments);
|
|
266
266
|
} // 轮询 签批状态
|
|
267
267
|
function _getSignRes() {
|
|
268
|
-
_getSignRes = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(documentIdVal, contractIdVal, name, autoUpload, token) {
|
|
268
|
+
_getSignRes = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(documentIdVal, contractIdVal, name, autoUpload, token, baseUrl) {
|
|
269
269
|
var isSignSucc, newFile, uploadedFileObj;
|
|
270
270
|
return _regenerator["default"].wrap(function (_context3) {
|
|
271
271
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -291,7 +291,7 @@ function _getSignRes() {
|
|
|
291
291
|
break;
|
|
292
292
|
}
|
|
293
293
|
_context3.next = 3;
|
|
294
|
-
return (0, _file.uploadFilePromise)(newFile, token);
|
|
294
|
+
return (0, _file.uploadFilePromise)(newFile, baseUrl, token);
|
|
295
295
|
case 3:
|
|
296
296
|
uploadedFileObj = _context3.sent;
|
|
297
297
|
console.log('签批完成后的文件地址', uploadedFileObj);
|
|
@@ -179,6 +179,7 @@ var SceneTree = function SceneTree(_ref) {
|
|
|
179
179
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FormItem, {
|
|
180
180
|
name: "baseUser",
|
|
181
181
|
label: node.title,
|
|
182
|
+
labelTextAlign: "left",
|
|
182
183
|
required: true,
|
|
183
184
|
style: {
|
|
184
185
|
borderBottom: node.children && node.children.length ? '1px solid #EEEEEE' : '',
|
package/lib/utils.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|