ydb-components-material 0.1.66 → 0.1.68
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.9dfb1cf9.js +1 -0
- 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/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/dist/BizComps.js +5 -5
- package/dist/BizComps.js.map +1 -1
- package/es/api.js +19 -11
- package/es/components/file-item/index.d.ts +1 -0
- package/es/components/file-item/index.js +49 -26
- package/es/components/file-item/seal.js +5 -20
- package/es/components/file-item/sealUtil.js +20 -38
- package/es/components/file-item/sign.js +9 -16
- package/es/components/file-item/signUtil.js +28 -41
- package/lib/api.js +20 -12
- package/lib/components/file-item/index.d.ts +1 -0
- package/lib/components/file-item/index.js +48 -25
- package/lib/components/file-item/seal.js +5 -20
- package/lib/components/file-item/sealUtil.js +20 -38
- package/lib/components/file-item/sign.js +9 -16
- package/lib/components/file-item/signUtil.js +28 -41
- package/lowcode/file-item/meta.ts +15 -0
- package/lowcode_es/file-item/meta.js +14 -0
- package/lowcode_es/meta.js +1 -1
- package/lowcode_lib/file-item/meta.js +14 -0
- package/lowcode_lib/meta.js +1 -1
- package/package.json +3 -3
- package/build/docs/umi.04af327b.js +0 -1
|
@@ -2,27 +2,26 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import { getBlob, getFileExtension, upload, dataURLtoBlob, uploadFilePromise } from "./file";
|
|
4
4
|
import { createbycategory, contractSignUrl, signurl, checkSignState, contractFinish, documentDownload } from "../../api";
|
|
5
|
-
var baseURL = 'http://172.16.132.12:5005';
|
|
6
5
|
var categoryId = '3354397552669692408';
|
|
7
6
|
var documentId = ''; // 手写签批生成的文件id
|
|
8
7
|
var contractId = ''; // 合同id
|
|
9
8
|
|
|
10
9
|
// 对外的方法 初始化手写签批的页面
|
|
11
|
-
export function initSignPageMethod(_x, _x2
|
|
10
|
+
export function initSignPageMethod(_x, _x2) {
|
|
12
11
|
return _initSignPageMethod.apply(this, arguments);
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
// 【第1步】上传要手写签批的文件
|
|
16
15
|
function _initSignPageMethod() {
|
|
17
|
-
_initSignPageMethod = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(fileObj, userInfo
|
|
16
|
+
_initSignPageMethod = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(fileObj, userInfo) {
|
|
18
17
|
var name, docId, contrId, flag, pageUrl, params;
|
|
19
18
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
20
19
|
while (1) switch (_context.prev = _context.next) {
|
|
21
20
|
case 0:
|
|
22
|
-
console.log('fileObj', fileObj, userInfo
|
|
21
|
+
console.log('fileObj', fileObj, userInfo);
|
|
23
22
|
name = fileObj.name; // 【第1步】上传要手写签批的文件
|
|
24
23
|
_context.next = 1;
|
|
25
|
-
return uploadSignFile(fileObj
|
|
24
|
+
return uploadSignFile(fileObj);
|
|
26
25
|
case 1:
|
|
27
26
|
docId = _context.sent;
|
|
28
27
|
console.log('docId---', docId);
|
|
@@ -36,7 +35,7 @@ function _initSignPageMethod() {
|
|
|
36
35
|
|
|
37
36
|
// 【第2步】创建或者发起电子签批
|
|
38
37
|
_context.next = 3;
|
|
39
|
-
return createbycategoryFun(name, docId
|
|
38
|
+
return createbycategoryFun(name, docId);
|
|
40
39
|
case 3:
|
|
41
40
|
contrId = _context.sent;
|
|
42
41
|
console.log('contrId---', contrId);
|
|
@@ -56,7 +55,7 @@ function _initSignPageMethod() {
|
|
|
56
55
|
|
|
57
56
|
// 【第3步】创建手写签批页面
|
|
58
57
|
_context.next = 5;
|
|
59
|
-
return getContractSignUrl(contrId, userInfo
|
|
58
|
+
return getContractSignUrl(contrId, userInfo);
|
|
60
59
|
case 5:
|
|
61
60
|
flag = _context.sent;
|
|
62
61
|
if (flag) {
|
|
@@ -66,7 +65,7 @@ function _initSignPageMethod() {
|
|
|
66
65
|
return _context.abrupt("return", false);
|
|
67
66
|
case 6:
|
|
68
67
|
_context.next = 7;
|
|
69
|
-
return getSignUrl(userInfo
|
|
68
|
+
return getSignUrl(userInfo);
|
|
70
69
|
case 7:
|
|
71
70
|
pageUrl = _context.sent;
|
|
72
71
|
if (pageUrl) {
|
|
@@ -91,11 +90,11 @@ function _initSignPageMethod() {
|
|
|
91
90
|
}));
|
|
92
91
|
return _initSignPageMethod.apply(this, arguments);
|
|
93
92
|
}
|
|
94
|
-
function uploadSignFile(
|
|
93
|
+
function uploadSignFile(_x3) {
|
|
95
94
|
return _uploadSignFile.apply(this, arguments);
|
|
96
95
|
} // 【第2步】创建或者发起电子签批
|
|
97
96
|
function _uploadSignFile() {
|
|
98
|
-
_uploadSignFile = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(event
|
|
97
|
+
_uploadSignFile = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(event) {
|
|
99
98
|
var blob, file, signApprovalFileType;
|
|
100
99
|
return _regeneratorRuntime.wrap(function (_context2) {
|
|
101
100
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -119,9 +118,9 @@ function _uploadSignFile() {
|
|
|
119
118
|
filename: event.name,
|
|
120
119
|
// 文件名称
|
|
121
120
|
headers: {
|
|
122
|
-
Authorization: token
|
|
121
|
+
Authorization: window.token
|
|
123
122
|
},
|
|
124
|
-
action: "\nhttps://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/signapproval/api/createbyfile",
|
|
123
|
+
action: "\nhttps://zwfwpt.sxzwfw.gov.cn" + (window.env === 'release' ? ':10010' : '') + "/DeclarationAPI/declaration/center/signapproval/api/createbyfile",
|
|
125
124
|
// 上传文件的地址
|
|
126
125
|
onError: function onError(e) {
|
|
127
126
|
// uni.$u.toast(e.msg || '手写签批上传文件异常');
|
|
@@ -143,7 +142,7 @@ function _uploadSignFile() {
|
|
|
143
142
|
}));
|
|
144
143
|
return _uploadSignFile.apply(this, arguments);
|
|
145
144
|
}
|
|
146
|
-
function createbycategoryFun(fileName, documentIdVal
|
|
145
|
+
function createbycategoryFun(fileName, documentIdVal) {
|
|
147
146
|
// uni.showLoading({ title: '加载中' })
|
|
148
147
|
var params = {
|
|
149
148
|
subject: fileName,
|
|
@@ -153,9 +152,7 @@ function createbycategoryFun(fileName, documentIdVal, token) {
|
|
|
153
152
|
tenantName: '山西省行政审批服务管理局'
|
|
154
153
|
};
|
|
155
154
|
return new Promise(function (resolve) {
|
|
156
|
-
createbycategory(params
|
|
157
|
-
token: token
|
|
158
|
-
}).then(function (res) {
|
|
155
|
+
createbycategory(params).then(function (res) {
|
|
159
156
|
console.log('创建订单成功', res);
|
|
160
157
|
if (res.code === 200) {
|
|
161
158
|
resolve(res.data.contractId);
|
|
@@ -170,7 +167,7 @@ function createbycategoryFun(fileName, documentIdVal, token) {
|
|
|
170
167
|
}
|
|
171
168
|
|
|
172
169
|
// 【第3步】创建手写签批页面
|
|
173
|
-
function getContractSignUrl(contractIdVal, userInfo
|
|
170
|
+
function getContractSignUrl(contractIdVal, userInfo) {
|
|
174
171
|
console.log('contractIdVal', contractIdVal, userInfo);
|
|
175
172
|
// uni.showLoading({ title: '加载中' })
|
|
176
173
|
var params = {
|
|
@@ -187,9 +184,7 @@ function getContractSignUrl(contractIdVal, userInfo, token) {
|
|
|
187
184
|
}]
|
|
188
185
|
};
|
|
189
186
|
return new Promise(function (resolve) {
|
|
190
|
-
contractSignUrl(params
|
|
191
|
-
token: token
|
|
192
|
-
}).then(function (res) {
|
|
187
|
+
contractSignUrl(params).then(function (res) {
|
|
193
188
|
if (res.data.code == 0) {
|
|
194
189
|
resolve(true);
|
|
195
190
|
} else {
|
|
@@ -210,7 +205,7 @@ function getContractSignUrl(contractIdVal, userInfo, token) {
|
|
|
210
205
|
}
|
|
211
206
|
|
|
212
207
|
// 【第4步】获取签pi页面
|
|
213
|
-
function getSignUrl(userInfo
|
|
208
|
+
function getSignUrl(userInfo) {
|
|
214
209
|
// uni.showLoading({ title: '加载中' })
|
|
215
210
|
var params = {
|
|
216
211
|
contractId: contractId,
|
|
@@ -235,12 +230,10 @@ function getSignUrl(userInfo, token, device) {
|
|
|
235
230
|
autoClosePage: true,
|
|
236
231
|
// 操作完成自动关闭页面
|
|
237
232
|
language: 'ZH_CN',
|
|
238
|
-
deviceType:
|
|
233
|
+
deviceType: window.isPC || 'H5' // 取值范围:PC(返回PC页面),H5(返回H5页面);不传值默认为:根据请求的UserAgent自动判断返回的页面类型。
|
|
239
234
|
};
|
|
240
235
|
return new Promise(function (resolve) {
|
|
241
|
-
signurl(params
|
|
242
|
-
token: token
|
|
243
|
-
}).then(function (res) {
|
|
236
|
+
signurl(params).then(function (res) {
|
|
244
237
|
console.log(res, '页面结果');
|
|
245
238
|
if (res.data.code == 0) {
|
|
246
239
|
resolve(res.data.signUrl);
|
|
@@ -258,19 +251,19 @@ function getSignUrl(userInfo, token, device) {
|
|
|
258
251
|
// 下方是打开手写签批页面后 的后续操作
|
|
259
252
|
|
|
260
253
|
// 对外的方法 获取签批后的文件
|
|
261
|
-
export function getSignRes(
|
|
254
|
+
export function getSignRes(_x4, _x5, _x6, _x7) {
|
|
262
255
|
return _getSignRes.apply(this, arguments);
|
|
263
256
|
}
|
|
264
257
|
|
|
265
258
|
// 轮询 签批状态
|
|
266
259
|
function _getSignRes() {
|
|
267
|
-
_getSignRes = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(documentIdVal, contractIdVal, name, autoUpload
|
|
260
|
+
_getSignRes = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(documentIdVal, contractIdVal, name, autoUpload) {
|
|
268
261
|
var isSignSucc, newFile, uploadedFileObj;
|
|
269
262
|
return _regeneratorRuntime.wrap(function (_context3) {
|
|
270
263
|
while (1) switch (_context3.prev = _context3.next) {
|
|
271
264
|
case 0:
|
|
272
265
|
_context3.next = 1;
|
|
273
|
-
return getCheckSignState(contractIdVal
|
|
266
|
+
return getCheckSignState(contractIdVal);
|
|
274
267
|
case 1:
|
|
275
268
|
isSignSucc = _context3.sent;
|
|
276
269
|
if (!isSignSucc) {
|
|
@@ -278,9 +271,9 @@ function _getSignRes() {
|
|
|
278
271
|
break;
|
|
279
272
|
}
|
|
280
273
|
// 封存
|
|
281
|
-
getContractFinish(contractIdVal
|
|
274
|
+
getContractFinish(contractIdVal);
|
|
282
275
|
_context3.next = 2;
|
|
283
|
-
return handleSignApprovalDown(documentIdVal, name
|
|
276
|
+
return handleSignApprovalDown(documentIdVal, name);
|
|
284
277
|
case 2:
|
|
285
278
|
newFile = _context3.sent;
|
|
286
279
|
console.log('newFile', newFile);
|
|
@@ -290,7 +283,7 @@ function _getSignRes() {
|
|
|
290
283
|
break;
|
|
291
284
|
}
|
|
292
285
|
_context3.next = 3;
|
|
293
|
-
return uploadFilePromise(newFile
|
|
286
|
+
return uploadFilePromise(newFile);
|
|
294
287
|
case 3:
|
|
295
288
|
uploadedFileObj = _context3.sent;
|
|
296
289
|
console.log('签批完成后的文件地址', uploadedFileObj);
|
|
@@ -310,12 +303,10 @@ function _getSignRes() {
|
|
|
310
303
|
}));
|
|
311
304
|
return _getSignRes.apply(this, arguments);
|
|
312
305
|
}
|
|
313
|
-
function getCheckSignState(contractIdVal
|
|
306
|
+
function getCheckSignState(contractIdVal) {
|
|
314
307
|
return new Promise(function (resolve) {
|
|
315
308
|
checkSignState({
|
|
316
309
|
contractId: contractIdVal
|
|
317
|
-
}, {
|
|
318
|
-
token: token
|
|
319
310
|
}).then(function (res) {
|
|
320
311
|
console.log('轮询结果---', res);
|
|
321
312
|
// console.log('轮询结果', JSON.parse(res.data));
|
|
@@ -335,24 +326,20 @@ function getCheckSignState(contractIdVal, token) {
|
|
|
335
326
|
}
|
|
336
327
|
|
|
337
328
|
// 封存电子签批
|
|
338
|
-
function getContractFinish(contractIdVal
|
|
329
|
+
function getContractFinish(contractIdVal) {
|
|
339
330
|
contractFinish({
|
|
340
331
|
contractId: contractIdVal
|
|
341
|
-
}, {
|
|
342
|
-
token: token
|
|
343
332
|
});
|
|
344
333
|
}
|
|
345
334
|
|
|
346
335
|
// 下载签署完的文档
|
|
347
|
-
function handleSignApprovalDown(documentIdVal, name
|
|
336
|
+
function handleSignApprovalDown(documentIdVal, name) {
|
|
348
337
|
var params = {
|
|
349
338
|
documentId: documentIdVal,
|
|
350
339
|
type: 'pdf'
|
|
351
340
|
};
|
|
352
341
|
return new Promise(function (resolve) {
|
|
353
|
-
documentDownload(params
|
|
354
|
-
token: token
|
|
355
|
-
}).then(function (res) {
|
|
342
|
+
documentDownload(params).then(function (res) {
|
|
356
343
|
console.log('下载文件:', res);
|
|
357
344
|
// 返回来是base64格式的
|
|
358
345
|
var blob = dataURLtoBlob(res.data); // 转成blob格式进行上传
|
package/lib/api.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
|
-
exports.signurl = exports.signFileDownApi = exports.qrySealApi = exports.previewApi = exports.post = exports.getSignOrderIdApi = exports.getSignFileApi = exports.getSealUrlApi = exports.getPcSealUrlApi = exports.getMaterialLib = exports.getIcons = exports.get = exports.fileUploadApi = exports.documentDownload = exports.createbycategory = exports.contractSignUrl = exports.contractFinish = exports.checkSignState = void 0;
|
|
5
|
+
exports.signurl = exports.signFileDownApi = exports.qrySealApi = exports.previewApi = exports.post = exports.getSignOrderIdApi = exports.getSignFileApi = exports.getSealUrlApi = exports.getPcSealUrlApi = exports.getMaterialPreview = exports.getMaterialLib = exports.getIcons = exports.getGuideImg = exports.get = exports.fileUploadApi = exports.documentDownload = exports.createbycategory = exports.contractSignUrl = exports.contractFinish = exports.checkSignState = void 0;
|
|
6
6
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
7
7
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
8
|
var post = exports.post = /*#__PURE__*/function () {
|
|
@@ -14,7 +14,8 @@ var post = exports.post = /*#__PURE__*/function () {
|
|
|
14
14
|
if (noJson === void 0) {
|
|
15
15
|
noJson = false;
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
console.log('window.env', window.env);
|
|
18
|
+
if (window.env === 'release' && url.indexOf('zwfwpt.sxzwfw.gov.cn') > -1) {
|
|
18
19
|
url = url.replace('zwfwpt.sxzwfw.gov.cn', 'zwfwpt.sxzwfw.gov.cn:10010');
|
|
19
20
|
}
|
|
20
21
|
_context.next = 1;
|
|
@@ -23,7 +24,7 @@ var post = exports.post = /*#__PURE__*/function () {
|
|
|
23
24
|
headers: {
|
|
24
25
|
'Content-Type': config && config['Content-Type'] ? config['Content-Type'] : 'application/json',
|
|
25
26
|
// 声明发送的数据格式
|
|
26
|
-
'Authorization':
|
|
27
|
+
'Authorization': url.indexOf('zwfwpt.sxzwfw.gov.cn') > -1 ? window.token : window.tokenTY
|
|
27
28
|
},
|
|
28
29
|
body: JSON.stringify(data)
|
|
29
30
|
}).then(function (response) {
|
|
@@ -57,7 +58,8 @@ var get = exports.get = /*#__PURE__*/function () {
|
|
|
57
58
|
return fetch(url + "?" + new URLSearchParams(data), {
|
|
58
59
|
method: 'GET',
|
|
59
60
|
headers: {
|
|
60
|
-
'Content-Type': config && config['Content-Type'] ? config['Content-Type'] : 'application/json'
|
|
61
|
+
'Content-Type': config && config['Content-Type'] ? config['Content-Type'] : 'application/json',
|
|
62
|
+
'Authorization': url.indexOf('zwfwpt.sxzwfw.gov.cn') > -1 ? window.token : window.tokenTY
|
|
61
63
|
}
|
|
62
64
|
}).then(function (response) {
|
|
63
65
|
return response.json();
|
|
@@ -108,30 +110,30 @@ var documentDownload = exports.documentDownload = function documentDownload(para
|
|
|
108
110
|
return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/signapproval/api/documentDownload", params, config);
|
|
109
111
|
};
|
|
110
112
|
var qrySealApi = exports.qrySealApi = function qrySealApi(params, config) {
|
|
111
|
-
return post(
|
|
113
|
+
return post(window.baseUrl + "/declaration/center/sign/api/qrySeal", params, config);
|
|
112
114
|
};
|
|
113
115
|
|
|
114
116
|
// 获取电子签章页面
|
|
115
117
|
var getSignOrderIdApi = exports.getSignOrderIdApi = function getSignOrderIdApi(params, config) {
|
|
116
|
-
return post(
|
|
118
|
+
return post(window.baseUrl + "/declaration/center/sign/api/outSignCreateSiggOrder", params, config);
|
|
117
119
|
};
|
|
118
120
|
// 获取电子签章页面
|
|
119
121
|
var getSealUrlApi = exports.getSealUrlApi = function getSealUrlApi(params, config) {
|
|
120
|
-
return post(
|
|
122
|
+
return post(window.baseUrl + "/declaration/center/sign/api/signWebByDirectMobile", params, config, true);
|
|
121
123
|
};
|
|
122
124
|
// 获取电子签章页面pc
|
|
123
125
|
var getPcSealUrlApi = exports.getPcSealUrlApi = function getPcSealUrlApi(params, config) {
|
|
124
|
-
return post(
|
|
126
|
+
return post(window.baseUrl + "/declaration/center/sign/api/signWebByDirect", params, config);
|
|
125
127
|
};
|
|
126
128
|
|
|
127
129
|
// 电子签章-下载文件
|
|
128
130
|
var signFileDownApi = exports.signFileDownApi = function signFileDownApi(params, config) {
|
|
129
|
-
return post(
|
|
131
|
+
return post(window.baseUrl + "/declaration/center/sign/api/fileDownloadBySign", params, config);
|
|
130
132
|
};
|
|
131
133
|
|
|
132
134
|
// 电子签章 上传文件
|
|
133
135
|
var fileUploadApi = exports.fileUploadApi = function fileUploadApi(params, config) {
|
|
134
|
-
return post(
|
|
136
|
+
return post(window.baseUrl + "/declaration/material/base64UploadMaterial", params, config);
|
|
135
137
|
};
|
|
136
138
|
|
|
137
139
|
// 预览
|
|
@@ -142,9 +144,15 @@ var previewApi = exports.previewApi = function previewApi(params, config) {
|
|
|
142
144
|
var getMaterialLib = exports.getMaterialLib = function getMaterialLib(params, config) {
|
|
143
145
|
return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/material/queryFileByCardNo", params, config);
|
|
144
146
|
};
|
|
147
|
+
var getMaterialPreview = exports.getMaterialPreview = function getMaterialPreview(params, config) {
|
|
148
|
+
return get(window.baseUrl + "/declaration/material/onlinePreview", params, config);
|
|
149
|
+
};
|
|
145
150
|
var getSignFileApi = exports.getSignFileApi = function getSignFileApi(params, config) {
|
|
146
|
-
return post(
|
|
151
|
+
return post(window.baseUrl + "/declaration/center/sign/api/getSignFileList", params, config);
|
|
147
152
|
};
|
|
148
153
|
var getIcons = exports.getIcons = function getIcons(params, config) {
|
|
149
|
-
return post(
|
|
154
|
+
return post(window.baseUrl + "component/icon/page", params, config);
|
|
155
|
+
};
|
|
156
|
+
var getGuideImg = exports.getGuideImg = function getGuideImg(params, config) {
|
|
157
|
+
return get(window.baseUrl + "/declaration/material/file/files/api/presigned-url", params, config);
|
|
150
158
|
};
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports["default"] = void 0;
|
|
6
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
6
7
|
var _icon = _interopRequireDefault(require("@alifd/next/lib/icon"));
|
|
8
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
7
9
|
var _extends3 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
10
|
var _message = _interopRequireDefault(require("@alifd/next/lib/message"));
|
|
9
11
|
var _radio = _interopRequireDefault(require("@alifd/next/lib/radio"));
|
|
@@ -46,6 +48,7 @@ var FileItem = function FileItem(_ref) {
|
|
|
46
48
|
tokenTY = _ref.tokenTY,
|
|
47
49
|
accessToken = _ref.accessToken,
|
|
48
50
|
baseUrl = _ref.baseUrl,
|
|
51
|
+
env = _ref.env,
|
|
49
52
|
isPC = _ref.isPC,
|
|
50
53
|
disabled = _ref.disabled,
|
|
51
54
|
checkPoint = _ref.checkPoint,
|
|
@@ -270,9 +273,7 @@ var FileItem = function FileItem(_ref) {
|
|
|
270
273
|
pageNum: 1,
|
|
271
274
|
pageSize: 10
|
|
272
275
|
};
|
|
273
|
-
(0, _api.getMaterialLib)(params
|
|
274
|
-
token: token
|
|
275
|
-
}).then(function (res) {
|
|
276
|
+
(0, _api.getMaterialLib)(params).then(function (res) {
|
|
276
277
|
if (res.code === 200) {
|
|
277
278
|
var records = res.data.records;
|
|
278
279
|
setMaterialLib(records);
|
|
@@ -286,26 +287,39 @@ var FileItem = function FileItem(_ref) {
|
|
|
286
287
|
// this.loadStatus = 'nomore'
|
|
287
288
|
});
|
|
288
289
|
};
|
|
289
|
-
var showGuide = function
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
290
|
+
var showGuide = /*#__PURE__*/function () {
|
|
291
|
+
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
292
|
+
var guideImgRes;
|
|
293
|
+
return _regenerator["default"].wrap(function (_context) {
|
|
294
|
+
while (1) switch (_context.prev = _context.next) {
|
|
295
|
+
case 0:
|
|
296
|
+
if (guideImg) {
|
|
297
|
+
_context.next = 1;
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
return _context.abrupt("return");
|
|
301
|
+
case 1:
|
|
302
|
+
_context.next = 2;
|
|
303
|
+
return (0, _api.getGuideImg)({
|
|
304
|
+
id: guideImg,
|
|
305
|
+
effectiveTime: 3600000
|
|
306
|
+
});
|
|
307
|
+
case 2:
|
|
308
|
+
guideImgRes = _context.sent;
|
|
309
|
+
if (guideImgRes.presignedUrl) {
|
|
310
|
+
setGuideurl(guideImgRes.presignedUrl);
|
|
311
|
+
setIsShowGuide(true);
|
|
312
|
+
}
|
|
313
|
+
case 3:
|
|
314
|
+
case "end":
|
|
315
|
+
return _context.stop();
|
|
316
|
+
}
|
|
317
|
+
}, _callee);
|
|
318
|
+
}));
|
|
319
|
+
return function showGuide() {
|
|
320
|
+
return _ref2.apply(this, arguments);
|
|
321
|
+
};
|
|
322
|
+
}();
|
|
309
323
|
var selectMaterialOk = function selectMaterialOk() {
|
|
310
324
|
console.log('val', materialId);
|
|
311
325
|
console.log('materialLib==', materialLib);
|
|
@@ -344,11 +358,19 @@ var FileItem = function FileItem(_ref) {
|
|
|
344
358
|
});
|
|
345
359
|
};
|
|
346
360
|
(0, _react.useEffect)(function () {
|
|
347
|
-
if (userInfo && isShowLib) {
|
|
361
|
+
if (userInfo && isShowLib && tokenTY) {
|
|
348
362
|
console.log('userInfo', userInfo);
|
|
349
363
|
queryFileLibs();
|
|
350
364
|
}
|
|
351
|
-
}, [userInfo, isShowLib]);
|
|
365
|
+
}, [userInfo, isShowLib, tokenTY]);
|
|
366
|
+
(0, _react.useEffect)(function () {
|
|
367
|
+
window.env = env;
|
|
368
|
+
window.baseUrl = baseUrl;
|
|
369
|
+
window.token = token;
|
|
370
|
+
window.tokenTY = tokenTY;
|
|
371
|
+
window.isPC = isPC;
|
|
372
|
+
window.accessToken = accessToken;
|
|
373
|
+
}, [env, baseUrl, token, tokenTY, isPC, accessToken]);
|
|
352
374
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
353
375
|
className: "file_item"
|
|
354
376
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -551,6 +573,7 @@ var FileItem = function FileItem(_ref) {
|
|
|
551
573
|
token: token,
|
|
552
574
|
tokenTY: tokenTY,
|
|
553
575
|
baseUrl: baseUrl,
|
|
576
|
+
env: env,
|
|
554
577
|
getSealRes: getSealRes,
|
|
555
578
|
accessToken: accessToken,
|
|
556
579
|
handleClose: function handleClose() {
|
|
@@ -15,14 +15,8 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
15
15
|
function SealPage(props) {
|
|
16
16
|
var userInfo = props.userInfo,
|
|
17
17
|
file = props.file,
|
|
18
|
-
token = props.token,
|
|
19
|
-
tokenTY = props.tokenTY,
|
|
20
|
-
accessToken = props.accessToken,
|
|
21
18
|
getSealRes = props.getSealRes,
|
|
22
|
-
|
|
23
|
-
handleClose = props.handleClose,
|
|
24
|
-
_props$isPC = props.isPC,
|
|
25
|
-
isPC = _props$isPC === void 0 ? false : _props$isPC;
|
|
19
|
+
handleClose = props.handleClose;
|
|
26
20
|
var _useState = (0, _react.useState)(''),
|
|
27
21
|
srcUrl = _useState[0],
|
|
28
22
|
setSrcUrl = _useState[1];
|
|
@@ -43,7 +37,7 @@ function SealPage(props) {
|
|
|
43
37
|
fileObj.url = file.oldUrl;
|
|
44
38
|
}
|
|
45
39
|
_context.next = 1;
|
|
46
|
-
return (0, _sealUtil.initSealPageMethod)(file, userInfo
|
|
40
|
+
return (0, _sealUtil.initSealPageMethod)(file, userInfo);
|
|
47
41
|
case 1:
|
|
48
42
|
res = _context.sent;
|
|
49
43
|
if (res) {
|
|
@@ -83,10 +77,7 @@ function SealPage(props) {
|
|
|
83
77
|
};
|
|
84
78
|
console.log('params', params);
|
|
85
79
|
_context2.next = 1;
|
|
86
|
-
return (0, _api.fileUploadApi)(params
|
|
87
|
-
baseUrl: baseUrl,
|
|
88
|
-
tokenTY: tokenTY
|
|
89
|
-
});
|
|
80
|
+
return (0, _api.fileUploadApi)(params);
|
|
90
81
|
case 1:
|
|
91
82
|
uploadRes = _context2.sent;
|
|
92
83
|
console.log('重新上传的文件', uploadRes);
|
|
@@ -115,9 +106,6 @@ function SealPage(props) {
|
|
|
115
106
|
var signFileDown = function signFileDown(filePath) {
|
|
116
107
|
(0, _api.signFileDownApi)({
|
|
117
108
|
fileUrl: filePath
|
|
118
|
-
}, {
|
|
119
|
-
baseUrl: baseUrl,
|
|
120
|
-
tokenTY: tokenTY
|
|
121
109
|
}).then(function (res) {
|
|
122
110
|
if (res.code === 200) {
|
|
123
111
|
uploadNewFile(res.data);
|
|
@@ -132,10 +120,7 @@ function SealPage(props) {
|
|
|
132
120
|
var params = {
|
|
133
121
|
orderId: orderId
|
|
134
122
|
};
|
|
135
|
-
(0, _api.getSignFileApi)(params
|
|
136
|
-
baseUrl: baseUrl,
|
|
137
|
-
tokenTY: tokenTY
|
|
138
|
-
}).then(function (res) {
|
|
123
|
+
(0, _api.getSignFileApi)(params).then(function (res) {
|
|
139
124
|
if (!res) {
|
|
140
125
|
return;
|
|
141
126
|
}
|
|
@@ -196,7 +181,7 @@ function SealPage(props) {
|
|
|
196
181
|
}, []);
|
|
197
182
|
(0, _react.useEffect)(function () {
|
|
198
183
|
handleRes();
|
|
199
|
-
}, [userInfo, file
|
|
184
|
+
}, [userInfo, file]);
|
|
200
185
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
201
186
|
className: "sealPage",
|
|
202
187
|
ref: elementRef
|