ydb-components-material 0.1.194 → 0.1.196

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 (72) 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/static/file_pc.19f7f013.svg +1 -0
  7. package/build/docs/static/guide_pc.7cfeb270.svg +1 -0
  8. package/build/docs/static/sign_pc.1662db4e.svg +1 -0
  9. package/build/docs/{umi.e78c834a.css → umi.0356f6c1.css} +1 -1
  10. package/build/docs/umi.45cac330.js +1 -0
  11. package/build/docs/~demos/:uuid.html +3 -3
  12. package/build/docs/~demos/colorful-button-demo.html +3 -3
  13. package/build/docs/~demos/colorful-input-demo.html +3 -3
  14. package/build/lowcode/3.js +2 -2
  15. package/build/lowcode/4.js +1 -1
  16. package/build/lowcode/5.js +1 -1
  17. package/build/lowcode/assets-daily.json +11 -11
  18. package/build/lowcode/assets-dev.json +2 -2
  19. package/build/lowcode/assets-prod.json +11 -11
  20. package/build/lowcode/index.js +1 -1
  21. package/build/lowcode/meta.js +3 -3
  22. package/build/lowcode/preview.js +8 -8
  23. package/build/lowcode/render/default/1.js +2 -2
  24. package/build/lowcode/render/default/2.js +1 -1
  25. package/build/lowcode/render/default/3.js +1 -1
  26. package/build/lowcode/render/default/view.css +1 -1
  27. package/build/lowcode/render/default/view.js +20 -20
  28. package/build/lowcode/view.css +1 -1
  29. package/build/lowcode/view.js +20 -20
  30. package/dist/1.js +2 -2
  31. package/dist/2.js +1 -1
  32. package/dist/3.js +1 -1
  33. package/dist/BizComps.css +1 -1
  34. package/dist/BizComps.js +22 -22
  35. package/dist/BizComps.js.map +1 -1
  36. package/es/components/sign-file/icon/file_pc.svg +1 -0
  37. package/es/components/sign-file/icon/guide_pc.svg +1 -0
  38. package/es/components/sign-file/icon/sign_pc.svg +1 -0
  39. package/es/components/sign-file/index.d.ts +3 -22
  40. package/es/components/sign-file/index.js +5 -661
  41. package/es/components/sign-file/mobile.d.ts +5 -0
  42. package/es/components/sign-file/mobile.js +158 -0
  43. package/es/components/sign-file/pc.d.ts +11 -0
  44. package/es/components/sign-file/pc.js +156 -0
  45. package/es/components/sign-file/pc.scss +144 -0
  46. package/es/components/sign-file/useSignFile.d.ts +57 -0
  47. package/es/components/sign-file/useSignFile.js +563 -0
  48. package/es/index.d.ts +2 -0
  49. package/es/index.js +1 -0
  50. package/lib/components/sign-file/icon/file_pc.svg +1 -0
  51. package/lib/components/sign-file/icon/guide_pc.svg +1 -0
  52. package/lib/components/sign-file/icon/sign_pc.svg +1 -0
  53. package/lib/components/sign-file/index.d.ts +3 -22
  54. package/lib/components/sign-file/index.js +5 -662
  55. package/lib/components/sign-file/mobile.d.ts +5 -0
  56. package/lib/components/sign-file/mobile.js +163 -0
  57. package/lib/components/sign-file/pc.d.ts +11 -0
  58. package/lib/components/sign-file/pc.js +161 -0
  59. package/lib/components/sign-file/pc.scss +144 -0
  60. package/lib/components/sign-file/useSignFile.d.ts +57 -0
  61. package/lib/components/sign-file/useSignFile.js +568 -0
  62. package/lib/index.d.ts +2 -0
  63. package/lib/index.js +3 -1
  64. package/lowcode/sign-file-pc/meta.ts +296 -0
  65. package/lowcode_es/meta.js +3 -2
  66. package/lowcode_es/sign-file-pc/meta.d.ts +22 -0
  67. package/lowcode_es/sign-file-pc/meta.js +273 -0
  68. package/lowcode_lib/meta.js +8 -7
  69. package/lowcode_lib/sign-file-pc/meta.d.ts +22 -0
  70. package/lowcode_lib/sign-file-pc/meta.js +278 -0
  71. package/package.json +3 -3
  72. package/build/docs/umi.c78ee399.js +0 -1
@@ -0,0 +1,563 @@
1
+ import _Dialog from "@alifd/next/es/dialog";
2
+ import _Message from "@alifd/next/es/message";
3
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
+ import _extends from "@babel/runtime/helpers/extends";
5
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
6
+ import { useState, useEffect, useRef } from 'react';
7
+ import { getSignRes } from "../file-list/signUtil";
8
+ import { querySeal } from "../file-list/sealUtil";
9
+ import { getGuideImg, getUrlById, onlinePreview } from "../../api";
10
+ import { getFileExtension } from "./file.js";
11
+ var SIGN = 1; // 签名
12
+ var SEAL = 2; // 签章
13
+
14
+ /**
15
+ * 签署文件的状态与业务逻辑,移动端(mobile.tsx)和 PC 端(pc.tsx)共用。
16
+ */
17
+ export var useSignFile = function useSignFile(props, options) {
18
+ var file = props.file,
19
+ userInfo = props.userInfo,
20
+ token = props.token,
21
+ tokenTY = props.tokenTY,
22
+ accessToken = props.accessToken,
23
+ baseUrl = props.baseUrl,
24
+ env = props.env,
25
+ isPC = props.isPC,
26
+ download = props.download,
27
+ valChange = props.valChange,
28
+ applySeal = props.applySeal,
29
+ openLoading = props.openLoading,
30
+ closeLoading = props.closeLoading;
31
+ var _ref = options || {},
32
+ _ref$withThumbnail = _ref.withThumbnail,
33
+ withThumbnail = _ref$withThumbnail === void 0 ? false : _ref$withThumbnail;
34
+ var fileName = file.fileName,
35
+ fileId = file.fileId,
36
+ guideImg = file.signGuidFileId,
37
+ _file$signContent = file.signContent,
38
+ signContent = _file$signContent === void 0 ? [] : _file$signContent;
39
+ var _useState = useState(false),
40
+ isShowSignPage = _useState[0],
41
+ setIsShowSignPage = _useState[1];
42
+ var _useState2 = useState(false),
43
+ isShowSealPage = _useState2[0],
44
+ setIsShowSealPage = _useState2[1];
45
+ var _useState3 = useState(false),
46
+ isShowPreview = _useState3[0],
47
+ setIsShowPreview = _useState3[1];
48
+ var _useState4 = useState(''),
49
+ previewIframeUrl = _useState4[0],
50
+ setPreviewIframeUrl = _useState4[1];
51
+ var _useState5 = useState(''),
52
+ guideurl = _useState5[0],
53
+ setGuideurl = _useState5[1];
54
+ var _useState6 = useState(false),
55
+ isShowGuide = _useState6[0],
56
+ setIsShowGuide = _useState6[1];
57
+ var _useState7 = useState(''),
58
+ thumbnail = _useState7[0],
59
+ setThumbnail = _useState7[1]; // 缩略图
60
+ var _useState8 = useState(false),
61
+ loading = _useState8[0],
62
+ setLoading = _useState8[1];
63
+ var _useState9 = useState(),
64
+ sealedFile = _useState9[0],
65
+ setSealedFile = _useState9[1];
66
+ var _useState0 = useState(false),
67
+ hasSigned = _useState0[0],
68
+ setHasSigned = _useState0[1];
69
+ var _useState1 = useState(fileId),
70
+ currentFileId = _useState1[0],
71
+ setCurrentFileId = _useState1[1];
72
+ var fileCopy = useRef(_extends({}, file));
73
+ var timerRef = useRef(null);
74
+ var originalUrlRef = useRef('');
75
+
76
+ // 预览材料
77
+ var preview = /*#__PURE__*/function () {
78
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
79
+ var urlRes, res;
80
+ return _regeneratorRuntime.wrap(function (_context) {
81
+ while (1) switch (_context.prev = _context.next) {
82
+ case 0:
83
+ if (currentFileId) {
84
+ _context.next = 1;
85
+ break;
86
+ }
87
+ return _context.abrupt("return");
88
+ case 1:
89
+ _context.next = 2;
90
+ return getUrlById({
91
+ id: currentFileId,
92
+ effectiveTime: 3600000
93
+ }, {
94
+ token: token,
95
+ tokenTY: tokenTY,
96
+ baseUrl: baseUrl,
97
+ env: env,
98
+ isPC: isPC,
99
+ accessToken: accessToken
100
+ });
101
+ case 2:
102
+ urlRes = _context.sent;
103
+ if (!(urlRes.presignedUrlList && urlRes.presignedUrlList.length > 0)) {
104
+ _context.next = 4;
105
+ break;
106
+ }
107
+ _context.next = 3;
108
+ return onlinePreview({
109
+ url: urlRes.presignedUrlList[2]
110
+ }, {
111
+ token: token,
112
+ tokenTY: tokenTY,
113
+ baseUrl: baseUrl,
114
+ env: env,
115
+ isPC: isPC,
116
+ accessToken: accessToken
117
+ });
118
+ case 3:
119
+ res = _context.sent;
120
+ setPreviewIframeUrl(res.url);
121
+ setIsShowPreview(true);
122
+ case 4:
123
+ case "end":
124
+ return _context.stop();
125
+ }
126
+ }, _callee);
127
+ }));
128
+ return function preview() {
129
+ return _ref2.apply(this, arguments);
130
+ };
131
+ }();
132
+
133
+ // 签章引导
134
+ var showGuide = /*#__PURE__*/function () {
135
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
136
+ var guideImgRes;
137
+ return _regeneratorRuntime.wrap(function (_context2) {
138
+ while (1) switch (_context2.prev = _context2.next) {
139
+ case 0:
140
+ if (guideImg) {
141
+ _context2.next = 1;
142
+ break;
143
+ }
144
+ return _context2.abrupt("return");
145
+ case 1:
146
+ _context2.next = 2;
147
+ return getGuideImg({
148
+ id: guideImg,
149
+ effectiveTime: 3600000
150
+ }, {
151
+ token: token,
152
+ tokenTY: tokenTY,
153
+ baseUrl: baseUrl,
154
+ env: env,
155
+ isPC: isPC,
156
+ accessToken: accessToken
157
+ });
158
+ case 2:
159
+ guideImgRes = _context2.sent;
160
+ if (guideImgRes.presignedUrl) {
161
+ setGuideurl(guideImgRes.presignedUrl);
162
+ setIsShowGuide(true);
163
+ }
164
+ case 3:
165
+ case "end":
166
+ return _context2.stop();
167
+ }
168
+ }, _callee2);
169
+ }));
170
+ return function showGuide() {
171
+ return _ref3.apply(this, arguments);
172
+ };
173
+ }();
174
+ var onDownload = function onDownload() {
175
+ var format = getFileExtension(fileName);
176
+ download({
177
+ fileId: fileId,
178
+ format: format
179
+ });
180
+ };
181
+
182
+ // 获取预览图片
183
+ var getViewUrl = /*#__PURE__*/function () {
184
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id) {
185
+ var type, _urlRes, urlRes, res, list;
186
+ return _regeneratorRuntime.wrap(function (_context3) {
187
+ while (1) switch (_context3.prev = _context3.next) {
188
+ case 0:
189
+ type = getFileExtension(fileName);
190
+ if (!['png', 'jpg', 'jpeg'].includes(type)) {
191
+ _context3.next = 2;
192
+ break;
193
+ }
194
+ _context3.next = 1;
195
+ return getUrlById({
196
+ id: fileId,
197
+ effectiveTime: 3600000
198
+ }, {
199
+ token: token,
200
+ tokenTY: tokenTY,
201
+ baseUrl: baseUrl,
202
+ env: env,
203
+ isPC: isPC,
204
+ accessToken: accessToken
205
+ });
206
+ case 1:
207
+ _urlRes = _context3.sent;
208
+ return _context3.abrupt("return", _urlRes.presignedUrlList[2]);
209
+ case 2:
210
+ if (!(type !== 'pdf')) {
211
+ _context3.next = 3;
212
+ break;
213
+ }
214
+ return _context3.abrupt("return", '');
215
+ case 3:
216
+ _context3.next = 4;
217
+ return getUrlById({
218
+ id: id,
219
+ effectiveTime: 3600000
220
+ }, {
221
+ token: token,
222
+ tokenTY: tokenTY,
223
+ baseUrl: baseUrl,
224
+ env: env,
225
+ isPC: isPC,
226
+ accessToken: accessToken
227
+ });
228
+ case 4:
229
+ urlRes = _context3.sent;
230
+ if (!(urlRes.presignedUrlList && urlRes.presignedUrlList.length > 0)) {
231
+ _context3.next = 7;
232
+ break;
233
+ }
234
+ _context3.next = 5;
235
+ return onlinePreview({
236
+ url: urlRes.presignedUrlList[2]
237
+ }, {
238
+ token: token,
239
+ tokenTY: tokenTY,
240
+ baseUrl: baseUrl,
241
+ env: env,
242
+ isPC: isPC,
243
+ accessToken: accessToken
244
+ });
245
+ case 5:
246
+ res = _context3.sent;
247
+ _context3.next = 6;
248
+ return extractImageUrls(res.url);
249
+ case 6:
250
+ list = _context3.sent;
251
+ return _context3.abrupt("return", list[0]);
252
+ case 7:
253
+ case "end":
254
+ return _context3.stop();
255
+ }
256
+ }, _callee3);
257
+ }));
258
+ return function getViewUrl(_x) {
259
+ return _ref4.apply(this, arguments);
260
+ };
261
+ }();
262
+ var extractImageUrls = /*#__PURE__*/function () {
263
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(previewUrl) {
264
+ var response, htmlText, parser, doc, imgElements, srcList;
265
+ return _regeneratorRuntime.wrap(function (_context4) {
266
+ while (1) switch (_context4.prev = _context4.next) {
267
+ case 0:
268
+ _context4.next = 1;
269
+ return fetch(previewUrl);
270
+ case 1:
271
+ response = _context4.sent;
272
+ _context4.next = 2;
273
+ return response.text();
274
+ case 2:
275
+ htmlText = _context4.sent;
276
+ parser = new DOMParser();
277
+ doc = parser.parseFromString(htmlText, 'text/html');
278
+ imgElements = doc.querySelectorAll('img');
279
+ srcList = Array.from(imgElements).map(function (img) {
280
+ return img.getAttribute('data-src');
281
+ });
282
+ return _context4.abrupt("return", srcList);
283
+ case 3:
284
+ case "end":
285
+ return _context4.stop();
286
+ }
287
+ }, _callee4);
288
+ }));
289
+ return function extractImageUrls(_x2) {
290
+ return _ref5.apply(this, arguments);
291
+ };
292
+ }();
293
+
294
+ // 手写签批
295
+ var sign = function sign(fromSeal) {
296
+ if (fromSeal === void 0) {
297
+ fromSeal = false;
298
+ }
299
+ if (!fromSeal) setSealedFile(undefined);
300
+ setLoading(true);
301
+ setIsShowSignPage(true);
302
+ };
303
+
304
+ // 签章
305
+ var seal = /*#__PURE__*/function () {
306
+ var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
307
+ var type, sealList;
308
+ return _regeneratorRuntime.wrap(function (_context5) {
309
+ while (1) switch (_context5.prev = _context5.next) {
310
+ case 0:
311
+ setSealedFile(undefined);
312
+ // 如果不需要签章 就直接去签字
313
+ if (signContent.map(function (i) {
314
+ return +i;
315
+ }).includes(SEAL)) {
316
+ _context5.next = 1;
317
+ break;
318
+ }
319
+ sign();
320
+ return _context5.abrupt("return");
321
+ case 1:
322
+ type = getFileExtension(fileName);
323
+ if (!(type !== 'pdf')) {
324
+ _context5.next = 2;
325
+ break;
326
+ }
327
+ _Message.notice('只有pdf文件才能使用电子签章');
328
+ return _context5.abrupt("return");
329
+ case 2:
330
+ _context5.next = 3;
331
+ return querySeal(userInfo, {
332
+ token: token,
333
+ tokenTY: tokenTY,
334
+ baseUrl: baseUrl,
335
+ env: env,
336
+ isPC: isPC,
337
+ accessToken: accessToken
338
+ });
339
+ case 3:
340
+ sealList = _context5.sent;
341
+ if (!(userInfo.certificateSno && userInfo.certificateSno.substring(0, 2) === '92')) {
342
+ _context5.next = 4;
343
+ break;
344
+ }
345
+ if (sealList.length) {
346
+ // 有印章 → 对话框提示,可跳过走签批
347
+ _Dialog.confirm({
348
+ title: '提示',
349
+ footerAlign: 'center',
350
+ content: '本份材料可豁免签章流程,完成电子签名即可,是否确认跳过签章?',
351
+ okProps: {
352
+ children: '继续签章'
353
+ },
354
+ cancelProps: {
355
+ children: '跳过签章'
356
+ },
357
+ onOk: function onOk() {
358
+ setIsShowSealPage(true);
359
+ },
360
+ onCancel: function onCancel() {
361
+ sign();
362
+ },
363
+ onClose: function onClose() {
364
+ setLoading(false);
365
+ }
366
+ });
367
+ } else {
368
+ // 无印章 → 对话框提示,可申请印章或跳过走签批
369
+ _Dialog.confirm({
370
+ title: '提示',
371
+ content: '经检测,本账户暂未申请企业印章,办理时可选择跳过签章流程完成签名;也可办好印章后再来办理此项业务',
372
+ footerAlign: 'center',
373
+ okProps: {
374
+ children: '申请印章'
375
+ },
376
+ cancelProps: {
377
+ children: '跳过签章'
378
+ },
379
+ onOk: function onOk() {
380
+ applySeal();
381
+ },
382
+ onCancel: function onCancel() {
383
+ sign();
384
+ },
385
+ onClose: function onClose() {
386
+ setLoading(false);
387
+ }
388
+ });
389
+ }
390
+ return _context5.abrupt("return");
391
+ case 4:
392
+ if (sealList.length) {
393
+ _context5.next = 5;
394
+ break;
395
+ }
396
+ _Message.error('该单位下暂无印章,请前往"山西政务服务网"或"三晋通"小程序申领印章');
397
+ return _context5.abrupt("return");
398
+ case 5:
399
+ setLoading(true);
400
+ setIsShowSealPage(true);
401
+ case 6:
402
+ case "end":
403
+ return _context5.stop();
404
+ }
405
+ }, _callee5);
406
+ }));
407
+ return function seal() {
408
+ return _ref6.apply(this, arguments);
409
+ };
410
+ }();
411
+
412
+ // 获取签批结果
413
+ var getRes = function getRes(val) {
414
+ setCurrentFileId(val.fileId);
415
+ // 同步最新的签署结果到 fileCopy,确保第三方"重新签署"时 SignPage 拿到的是本人/上次签完的文件
416
+ fileCopy.current = _extends({}, val);
417
+ valChange(val);
418
+ setHasSigned(true);
419
+ };
420
+
421
+ // 获取签章结果
422
+ var getSealRes = function getSealRes(val) {
423
+ // 如果还允许签批 就连住一起做了
424
+ if (signContent.map(function (i) {
425
+ return +i;
426
+ }).includes(SIGN)) {
427
+ setSealedFile(val);
428
+ sign(true);
429
+ } else {
430
+ setCurrentFileId(val.fileId);
431
+ // 签章后无连签时,同样同步 fileCopy,保证后续"重新签署"基于签章后的文件
432
+ fileCopy.current = _extends({}, val);
433
+ valChange(val);
434
+ setHasSigned(true);
435
+ }
436
+ };
437
+ var getSignedFile = /*#__PURE__*/function () {
438
+ var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(documentIdVal, contractIdVal, nameVal) {
439
+ var newFile;
440
+ return _regeneratorRuntime.wrap(function (_context6) {
441
+ while (1) switch (_context6.prev = _context6.next) {
442
+ case 0:
443
+ _context6.next = 1;
444
+ return getSignRes(documentIdVal, contractIdVal, nameVal, true, {
445
+ token: token,
446
+ tokenTY: tokenTY,
447
+ baseUrl: baseUrl,
448
+ env: env,
449
+ isPC: isPC
450
+ });
451
+ case 1:
452
+ newFile = _context6.sent;
453
+ if (!newFile) {
454
+ _context6.next = 2;
455
+ break;
456
+ }
457
+ clearInterval(timerRef.current);
458
+ timerRef.current = null;
459
+ localStorage.removeItem(fileId);
460
+ closeLoading();
461
+ getRes(_extends({}, file, {
462
+ fileId: newFile.fileId,
463
+ fileName: nameVal,
464
+ fileUrl: newFile.fileUrlList[2],
465
+ originalUrl: originalUrlRef.current,
466
+ isSigned: true
467
+ }));
468
+ return _context6.abrupt("return", true);
469
+ case 2:
470
+ return _context6.abrupt("return", false);
471
+ case 3:
472
+ case "end":
473
+ return _context6.stop();
474
+ }
475
+ }, _callee6);
476
+ }));
477
+ return function getSignedFile(_x3, _x4, _x5) {
478
+ return _ref7.apply(this, arguments);
479
+ };
480
+ }();
481
+ useEffect(function () {
482
+ if (!withThumbnail || !currentFileId) return;
483
+ getViewUrl(currentFileId).then(function (url) {
484
+ setThumbnail(url);
485
+ });
486
+ }, [withThumbnail, currentFileId]);
487
+ useEffect(function () {
488
+ try {
489
+ var stored = localStorage.getItem(fileId);
490
+ if (stored) {
491
+ var _JSON$parse = JSON.parse(stored),
492
+ contrId = _JSON$parse.contractId,
493
+ docId = _JSON$parse.documentId,
494
+ nameVal = _JSON$parse.fileName,
495
+ originalUrl = _JSON$parse.fileUrl;
496
+ localStorage.removeItem(fileId);
497
+ originalUrlRef.current = originalUrl || '';
498
+ if (docId && contrId && nameVal) {
499
+ openLoading();
500
+ // 兜底:连续 10 次轮询仍未成功则结束轮询,避免无限请求
501
+ var pollCount = 0;
502
+ timerRef.current = setInterval(function () {
503
+ getSignedFile(docId, contrId, nameVal).then(function (success) {
504
+ // 成功时 getSignedFile 内部会清除轮询并关闭 loading
505
+ if (!success) {
506
+ pollCount += 1;
507
+ if (pollCount >= 10) {
508
+ clearInterval(timerRef.current);
509
+ timerRef.current = null;
510
+ closeLoading();
511
+ }
512
+ }
513
+ });
514
+ }, 3000);
515
+ }
516
+ }
517
+ } catch (e) {}
518
+ return function () {
519
+ if (timerRef.current) {
520
+ clearInterval(timerRef.current);
521
+ timerRef.current = null;
522
+ }
523
+ };
524
+ }, [fileId]);
525
+ return {
526
+ // 数据
527
+ fileName: fileName,
528
+ originalFileId: fileId,
529
+ guideImg: guideImg,
530
+ thumbnail: thumbnail,
531
+ loading: loading,
532
+ isShowSignPage: isShowSignPage,
533
+ isShowSealPage: isShowSealPage,
534
+ isShowPreview: isShowPreview,
535
+ isShowGuide: isShowGuide,
536
+ previewIframeUrl: previewIframeUrl,
537
+ guideurl: guideurl,
538
+ sealedFile: sealedFile,
539
+ hasSigned: hasSigned,
540
+ fileCopy: fileCopy,
541
+ // 操作
542
+ preview: preview,
543
+ onDownload: onDownload,
544
+ showGuide: showGuide,
545
+ seal: seal,
546
+ getSealRes: getSealRes,
547
+ closeSignPage: function closeSignPage() {
548
+ return setIsShowSignPage(false);
549
+ },
550
+ closeSealPage: function closeSealPage() {
551
+ return setIsShowSealPage(false);
552
+ },
553
+ closePreview: function closePreview() {
554
+ return setIsShowPreview(false);
555
+ },
556
+ closeGuide: function closeGuide() {
557
+ return setIsShowGuide(false);
558
+ },
559
+ stopLoading: function stopLoading() {
560
+ return setLoading(false);
561
+ }
562
+ };
563
+ };
package/es/index.d.ts CHANGED
@@ -51,6 +51,8 @@ export type { CommentProps } from './components/guide/comment';
51
51
  export { default as Comment } from './components/guide/comment';
52
52
  export type { SignFileProps } from './components/sign-file';
53
53
  export { default as SignFile } from './components/sign-file';
54
+ export type { SignFilePcProps } from './components/sign-file/pc';
55
+ export { default as SignFilePc } from './components/sign-file/pc';
54
56
  export type { GuidePcProps } from './components/guide-pc';
55
57
  export { default as GuidePc } from './components/guide-pc';
56
58
  declare const bizCssPrefix = "bizpack";
package/es/index.js CHANGED
@@ -31,6 +31,7 @@ export { default as DragDropList } from "./components/drag-drop";
31
31
  export { default as Guide } from "./components/guide";
32
32
  export { default as Comment } from "./components/guide/comment";
33
33
  export { default as SignFile } from "./components/sign-file";
34
+ export { default as SignFilePc } from "./components/sign-file/pc";
34
35
  export { default as GuidePc } from "./components/guide-pc";
35
36
  var bizCssPrefix = 'bizpack';
36
37
  export { bizCssPrefix };
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="112" height="112" viewBox="0 0 112 112" fill="none"><defs><linearGradient id="signFilePcDoc" x1="0.5" y1="0" x2="0.5" y2="1"><stop offset="0%" stop-color="#DCEAFF" stop-opacity="1"/><stop offset="100%" stop-color="#FFFFFF" stop-opacity="1"/></linearGradient><linearGradient id="signFilePcFolder" x1="0.5" y1="0" x2="0.5" y2="1"><stop offset="0%" stop-color="#5FA9FF" stop-opacity="1"/><stop offset="100%" stop-color="#2E7FF2" stop-opacity="1"/></linearGradient><linearGradient id="signFilePcFront" x1="0.5" y1="0" x2="0.5" y2="1"><stop offset="0%" stop-color="#6FB4FF" stop-opacity="1"/><stop offset="100%" stop-color="#3B8BFB" stop-opacity="1"/></linearGradient></defs><rect x="16" y="26" width="80" height="72" rx="10" fill="url(#signFilePcFolder)"/><rect x="27" y="4" width="58" height="78" rx="6" fill="url(#signFilePcDoc)"/><rect x="36" y="20" width="40" height="6" rx="3" fill="#C3DBFF"/><rect x="36" y="33" width="40" height="6" rx="3" fill="#C3DBFF"/><rect x="36" y="46" width="28" height="6" rx="3" fill="#C3DBFF"/><rect x="36" y="59" width="34" height="6" rx="3" fill="#C3DBFF"/><path d="M16 74h80v14a10 10 0 0 1-10 10H26a10 10 0 0 1-10-10V74Z" fill="url(#signFilePcFront)"/><rect x="34" y="82" width="44" height="10" rx="5" fill="#FFFFFF"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none"><circle cx="7" cy="7" r="6.3" stroke="#1678FF" stroke-width="1.1"/><path d="M5.2 5.4a1.8 1.8 0 1 1 2.6 1.6c-.55.3-.8.6-.8 1.2v.35" stroke="#1678FF" stroke-width="1.15" stroke-linecap="round"/><circle cx="7" cy="9.85" r="0.72" fill="#1678FF"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M9.36 1.53a1.35 1.35 0 0 1 1.91 0l1.2 1.2a1.35 1.35 0 0 1 0 1.91l-1.02 1.02-3.11-3.11 1.02-1.02Z" stroke="#FFFFFF" stroke-width="1.1" stroke-linejoin="round"/><path d="M7.63 3.26 2.6 8.29a1 1 0 0 0-.26.45l-.55 2.1a.4.4 0 0 0 .49.49l2.1-.55a1 1 0 0 0 .45-.26l5.03-5.03-2.23-2.23Z" stroke="#FFFFFF" stroke-width="1.1" stroke-linejoin="round"/><path d="M1.4 12.9h11.2" stroke="#FFFFFF" stroke-width="1.1" stroke-linecap="round"/></svg>
@@ -1,25 +1,6 @@
1
1
  import React from 'react';
2
- import './index.scss';
3
- export interface SignFileProps {
4
- /**
5
- * 标题
6
- */
7
- file: object;
8
- token: string;
9
- tokenTY: string;
10
- accessToken: string;
11
- userInfo: object;
12
- baseUrl: string;
13
- env: string;
14
- isPC?: boolean;
15
- style?: object;
16
- parentPageUrl: string;
17
- applySeal: () => void;
18
- openLoading: () => void;
19
- closeLoading: () => void;
20
- download: (value: any) => void;
21
- valChange: (value: any) => void;
22
- toSign?: (url: string) => void;
23
- }
2
+ import type { SignFileProps } from './useSignFile';
3
+ export type { SignFileProps, UseSignFileOptions } from './useSignFile';
4
+ export type { SignFilePcProps } from './pc';
24
5
  declare const SignFile: React.FC<SignFileProps>;
25
6
  export default SignFile;