ydb-components-material 0.1.87 → 0.1.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/docs/404.html +3 -3
- package/build/docs/_demos/:uuid +3 -3
- package/build/docs/colorful-button.html +3 -3
- package/build/docs/colorful-input.html +3 -3
- package/build/docs/index.html +3 -3
- package/build/docs/umi.6ffa9be4.js +1 -0
- package/build/docs/{umi.507b3306.css → umi.fd11a37a.css} +1 -1
- package/build/docs/~demos/:uuid.html +3 -3
- package/build/docs/~demos/colorful-button-demo.html +3 -3
- package/build/docs/~demos/colorful-input-demo.html +3 -3
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +9 -9
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +2 -2
- package/dist/BizComps.css +1 -1
- package/dist/BizComps.js +5 -5
- package/dist/BizComps.js.map +1 -1
- package/es/components/file-list/checkPoint.d.ts +3 -0
- package/es/components/file-list/checkPoint.js +157 -0
- package/es/components/file-list/checkPoint.scss +120 -0
- package/es/components/file-list/file.js +224 -0
- package/es/components/file-list/icon/checked.svg +1 -0
- package/es/components/file-list/icon/close.svg +1 -0
- package/es/components/file-list/icon/del.svg +1 -0
- package/es/components/file-list/icon/download.svg +1 -0
- package/es/components/file-list/icon/download_pc.svg +1 -0
- package/es/components/file-list/icon/file.svg +1 -0
- package/es/components/file-list/icon/icon_errorMsg.svg +1 -0
- package/es/components/file-list/icon/icon_warning.svg +1 -0
- package/es/components/file-list/icon/preview.svg +1 -0
- package/es/components/file-list/icon/preview_pc.svg +1 -0
- package/es/components/file-list/icon/upload.svg +1 -0
- package/es/components/file-list/icon/view.svg +1 -0
- package/es/components/file-list/index.d.ts +21 -0
- package/es/components/file-list/index.js +258 -0
- package/es/components/file-list/index.scss +61 -0
- package/es/components/file-list/item.d.ts +27 -0
- package/es/components/file-list/item.js +854 -0
- package/es/components/file-list/item.scss +412 -0
- package/es/components/file-list/seal.d.ts +3 -0
- package/es/components/file-list/seal.js +222 -0
- package/es/components/file-list/sealUtil.js +252 -0
- package/es/components/file-list/sign.d.ts +3 -0
- package/es/components/file-list/sign.js +138 -0
- package/es/components/file-list/signUtil.js +369 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +1 -0
- package/es/style.js +1 -0
- package/lib/components/file-list/checkPoint.d.ts +3 -0
- package/lib/components/file-list/checkPoint.js +162 -0
- package/lib/components/file-list/checkPoint.scss +120 -0
- package/lib/components/file-list/file.js +233 -0
- package/lib/components/file-list/icon/checked.svg +1 -0
- package/lib/components/file-list/icon/close.svg +1 -0
- package/lib/components/file-list/icon/del.svg +1 -0
- package/lib/components/file-list/icon/download.svg +1 -0
- package/lib/components/file-list/icon/download_pc.svg +1 -0
- package/lib/components/file-list/icon/file.svg +1 -0
- package/lib/components/file-list/icon/icon_errorMsg.svg +1 -0
- package/lib/components/file-list/icon/icon_warning.svg +1 -0
- package/lib/components/file-list/icon/preview.svg +1 -0
- package/lib/components/file-list/icon/preview_pc.svg +1 -0
- package/lib/components/file-list/icon/upload.svg +1 -0
- package/lib/components/file-list/icon/view.svg +1 -0
- package/lib/components/file-list/index.d.ts +21 -0
- package/lib/components/file-list/index.js +263 -0
- package/lib/components/file-list/index.scss +61 -0
- package/lib/components/file-list/item.d.ts +27 -0
- package/lib/components/file-list/item.js +860 -0
- package/lib/components/file-list/item.scss +412 -0
- package/lib/components/file-list/seal.d.ts +3 -0
- package/lib/components/file-list/seal.js +228 -0
- package/lib/components/file-list/sealUtil.js +254 -0
- package/lib/components/file-list/sign.d.ts +3 -0
- package/lib/components/file-list/sign.js +144 -0
- package/lib/components/file-list/signUtil.js +371 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -1
- package/lib/style.js +1 -0
- package/lowcode/file-list/meta.ts +231 -0
- package/lowcode_es/_setter/IconSelectSetter.js +1 -1
- package/lowcode_es/file-list/meta.d.ts +22 -0
- package/lowcode_es/file-list/meta.js +213 -0
- package/lowcode_es/meta.js +3 -2
- package/lowcode_lib/_setter/IconSelectSetter.js +1 -1
- package/lowcode_lib/file-list/meta.d.ts +22 -0
- package/lowcode_lib/file-list/meta.js +218 -0
- package/lowcode_lib/meta.js +14 -13
- package/package.json +5 -4
- package/build/docs/umi.5298404d.js +0 -1
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
|
|
2
|
+
.file_item {
|
|
3
|
+
border-radius: 8px;
|
|
4
|
+
opacity: 1;
|
|
5
|
+
background: #F7F7F7;
|
|
6
|
+
padding: 12px;
|
|
7
|
+
width: 100%;
|
|
8
|
+
|
|
9
|
+
.file_name {
|
|
10
|
+
font-size: 14px;
|
|
11
|
+
color: #333333;
|
|
12
|
+
margin-bottom: 12px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.file {
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
align-items: center;
|
|
19
|
+
|
|
20
|
+
.file_img {
|
|
21
|
+
width: 80px;
|
|
22
|
+
height: 80px;
|
|
23
|
+
border-radius: 4px;
|
|
24
|
+
position: relative;
|
|
25
|
+
border-radius: 8px;
|
|
26
|
+
position: relative;
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
align-items: center;
|
|
30
|
+
background: #fff;
|
|
31
|
+
font-size: 12px;
|
|
32
|
+
color: #666666;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
|
|
35
|
+
.filed {
|
|
36
|
+
display: flex;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
align-items: center;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
width: 100%;
|
|
41
|
+
height: 100%;
|
|
42
|
+
border-radius: 4px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.small_img {
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 100%;
|
|
48
|
+
border-radius: 4px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.add {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
align-items: center;
|
|
56
|
+
border: 1px dashed #BFDAFF;
|
|
57
|
+
border-radius: 4px;
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
.add_icon {
|
|
61
|
+
width: 14px;
|
|
62
|
+
margin-left: -5px;
|
|
63
|
+
}
|
|
64
|
+
color: #1678FF;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.del {
|
|
68
|
+
position: absolute;
|
|
69
|
+
width: 16px;
|
|
70
|
+
height: 16px;
|
|
71
|
+
top: -6px;
|
|
72
|
+
right: -6px;
|
|
73
|
+
z-index: 3;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.error_msg {
|
|
77
|
+
position: absolute;
|
|
78
|
+
top: 30px;
|
|
79
|
+
right: 22px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.mask {
|
|
83
|
+
// display: none !important;
|
|
84
|
+
border-radius: 8px;
|
|
85
|
+
position: absolute;
|
|
86
|
+
top: 0;
|
|
87
|
+
left: 0;
|
|
88
|
+
width: 100%;
|
|
89
|
+
height: 100%;
|
|
90
|
+
// opacity: 0.5;
|
|
91
|
+
background: #2222227d;
|
|
92
|
+
display: flex;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
align-items: center;
|
|
95
|
+
color: #fff;
|
|
96
|
+
z-index: 3;
|
|
97
|
+
|
|
98
|
+
.checked {
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
|
|
102
|
+
img {
|
|
103
|
+
width: 14px;
|
|
104
|
+
height: 14px;
|
|
105
|
+
margin-right: 3px;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.blocks {
|
|
112
|
+
margin-right: auto;
|
|
113
|
+
margin-left: 20px;
|
|
114
|
+
height: 80px;
|
|
115
|
+
display: flex;
|
|
116
|
+
flex-direction: column;
|
|
117
|
+
justify-content: space-between;
|
|
118
|
+
flex: 1;
|
|
119
|
+
|
|
120
|
+
.status {
|
|
121
|
+
display: flex;
|
|
122
|
+
gap: 12px;
|
|
123
|
+
|
|
124
|
+
.status_item {
|
|
125
|
+
width: 44px;
|
|
126
|
+
height: 20px;
|
|
127
|
+
border-radius: 4px;
|
|
128
|
+
background: #EFDEBD;
|
|
129
|
+
color: #C38A38;
|
|
130
|
+
font-size: 12px;
|
|
131
|
+
text-align: center;
|
|
132
|
+
line-height: 20px;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.btns {
|
|
137
|
+
display: flex;
|
|
138
|
+
gap: 24px;
|
|
139
|
+
font-size: 14px;
|
|
140
|
+
color: #1678FF;
|
|
141
|
+
|
|
142
|
+
.btn {
|
|
143
|
+
display: flex;
|
|
144
|
+
gap: 4px;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
.operation {
|
|
151
|
+
display: flex;
|
|
152
|
+
flex-direction: column;
|
|
153
|
+
justify-content: space-between;
|
|
154
|
+
padding: 4px 0;
|
|
155
|
+
height: 80px;
|
|
156
|
+
}
|
|
157
|
+
.operation_pc {
|
|
158
|
+
display: flex;
|
|
159
|
+
flex-direction: row-reverse;
|
|
160
|
+
height: 80px;
|
|
161
|
+
align-items: end;
|
|
162
|
+
}
|
|
163
|
+
.btn {
|
|
164
|
+
display: flex;
|
|
165
|
+
flex-direction: row;
|
|
166
|
+
justify-content: end;
|
|
167
|
+
|
|
168
|
+
.img_btn {
|
|
169
|
+
margin-left: 8px;
|
|
170
|
+
width: 68px;
|
|
171
|
+
height: 26px;
|
|
172
|
+
border-radius: 4px;
|
|
173
|
+
opacity: 1;
|
|
174
|
+
box-sizing: border-box;
|
|
175
|
+
border: 1px solid #1678FF;
|
|
176
|
+
color: #1678FF;
|
|
177
|
+
font-size: 13px;
|
|
178
|
+
line-height: 26px;
|
|
179
|
+
text-align: center;
|
|
180
|
+
cursor: pointer;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
}
|
|
184
|
+
.operation_btn {
|
|
185
|
+
cursor: pointer;
|
|
186
|
+
margin-left: 8px;
|
|
187
|
+
width: 68px;
|
|
188
|
+
height: 26px;
|
|
189
|
+
border-radius: 4px;
|
|
190
|
+
opacity: 1;
|
|
191
|
+
box-sizing: border-box;
|
|
192
|
+
background: linear-gradient(90deg, #73AEFF 0%, #1678FF 100%);
|
|
193
|
+
color: #fff;
|
|
194
|
+
font-size: 13px;
|
|
195
|
+
line-height: 26px;
|
|
196
|
+
text-align: center;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.file_item_bottom {
|
|
201
|
+
margin-top: 12px;
|
|
202
|
+
border-top: 1px solid #EAEAEA;
|
|
203
|
+
display: flex;
|
|
204
|
+
display: flex;
|
|
205
|
+
justify-content: space-evenly;
|
|
206
|
+
align-items: center;
|
|
207
|
+
padding-top: 12px;
|
|
208
|
+
|
|
209
|
+
.line {
|
|
210
|
+
width: 1px;
|
|
211
|
+
height: 20px;
|
|
212
|
+
background-color: #EAEAEA;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.icon_text {
|
|
216
|
+
display: flex;
|
|
217
|
+
align-items: center;
|
|
218
|
+
font-size: 14px;
|
|
219
|
+
color: #1678FF;
|
|
220
|
+
|
|
221
|
+
img {
|
|
222
|
+
width: 16px;
|
|
223
|
+
height: 11px;
|
|
224
|
+
margin-right: 5px;
|
|
225
|
+
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.img_view {
|
|
231
|
+
position: absolute;
|
|
232
|
+
top: 0;
|
|
233
|
+
left: 0;
|
|
234
|
+
width: 100%;
|
|
235
|
+
height: 100%;
|
|
236
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
237
|
+
display: flex;
|
|
238
|
+
justify-content: center;
|
|
239
|
+
align-items: center;
|
|
240
|
+
|
|
241
|
+
.close {
|
|
242
|
+
width: 17px;
|
|
243
|
+
height: 17px;
|
|
244
|
+
color: #fff;
|
|
245
|
+
position: absolute;
|
|
246
|
+
top: 40px;
|
|
247
|
+
right: 20px;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.view {
|
|
251
|
+
width: 100%;
|
|
252
|
+
height: auto;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.material_lib {
|
|
257
|
+
width: 100%;
|
|
258
|
+
height: 100%;
|
|
259
|
+
position: fixed;
|
|
260
|
+
top: 0;
|
|
261
|
+
left: 0;
|
|
262
|
+
z-index: 88;
|
|
263
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
264
|
+
|
|
265
|
+
.material_lib_content {
|
|
266
|
+
width: 100%;
|
|
267
|
+
position: absolute;
|
|
268
|
+
bottom: 0;
|
|
269
|
+
left: 0;
|
|
270
|
+
background-color: #F5F5F5;
|
|
271
|
+
border-radius: 16px 16px 0px 0px;
|
|
272
|
+
|
|
273
|
+
.material_lib_title {
|
|
274
|
+
border-radius: 16px 16px 0px 0px;
|
|
275
|
+
background-color: #fff;
|
|
276
|
+
font-size: 16px;
|
|
277
|
+
color: #333333;
|
|
278
|
+
line-height: 54px;
|
|
279
|
+
text-align: center;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.tips {
|
|
283
|
+
padding: 12px;
|
|
284
|
+
background: #FFF6E8;
|
|
285
|
+
font-size: 14px;
|
|
286
|
+
line-height: 24px;
|
|
287
|
+
color: #F29655;
|
|
288
|
+
display: flex;
|
|
289
|
+
align-items: flex-start;
|
|
290
|
+
|
|
291
|
+
img {
|
|
292
|
+
width: 14px;
|
|
293
|
+
height: 14px;
|
|
294
|
+
margin-right: 8px;
|
|
295
|
+
margin-top: 5px;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.list {
|
|
300
|
+
padding: 12px 12px 0 12px;
|
|
301
|
+
width: 100%;
|
|
302
|
+
background-color: #F5F5F5;
|
|
303
|
+
// margin-bottom: 14px;
|
|
304
|
+
max-height: 300px;
|
|
305
|
+
overflow: auto;
|
|
306
|
+
|
|
307
|
+
.item {
|
|
308
|
+
padding: 16px 12px;
|
|
309
|
+
border-radius: 8px;
|
|
310
|
+
background: #FFF;
|
|
311
|
+
display: flex;
|
|
312
|
+
align-items: center;
|
|
313
|
+
color: #333333;
|
|
314
|
+
font-size: 14px;
|
|
315
|
+
width: 100%;
|
|
316
|
+
margin-bottom: 12px;
|
|
317
|
+
|
|
318
|
+
.preview_icon {
|
|
319
|
+
margin-left: auto;
|
|
320
|
+
display: flex;
|
|
321
|
+
align-items: center;
|
|
322
|
+
color: #1678FF;
|
|
323
|
+
|
|
324
|
+
img {
|
|
325
|
+
width: 16px;
|
|
326
|
+
margin-right: 4px;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.more {
|
|
333
|
+
color: #1678FF;
|
|
334
|
+
text-align: center;
|
|
335
|
+
height: 30px;
|
|
336
|
+
line-height: 30px;
|
|
337
|
+
margin-bottom: 70px;
|
|
338
|
+
background-color: #F5F5F5;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.bottom_btn {
|
|
342
|
+
background-color: #fff;
|
|
343
|
+
height: 64px;
|
|
344
|
+
display: flex;
|
|
345
|
+
align-items: center;
|
|
346
|
+
justify-content: space-around;
|
|
347
|
+
position: fixed;
|
|
348
|
+
bottom: 0;
|
|
349
|
+
left: 0;
|
|
350
|
+
right: 0;
|
|
351
|
+
|
|
352
|
+
.btn {
|
|
353
|
+
width: 169px;
|
|
354
|
+
height: 40px;
|
|
355
|
+
border-radius: 50px;
|
|
356
|
+
font-size: 16px;
|
|
357
|
+
line-height: 40px;
|
|
358
|
+
text-align: center;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.cancel {
|
|
362
|
+
background-color: #fff;
|
|
363
|
+
border: 1px solid #E7E7E7;
|
|
364
|
+
color: #333;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.ok {
|
|
368
|
+
background: linear-gradient(90deg, #73AEFF 0%, #1678FF 100%);
|
|
369
|
+
color: #fff;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.preview {
|
|
376
|
+
width: 100%;
|
|
377
|
+
height: 100%;
|
|
378
|
+
position: fixed;
|
|
379
|
+
top: 0;
|
|
380
|
+
left: 0;
|
|
381
|
+
background: rgba(0, 0, 0, 0.5);
|
|
382
|
+
display: flex;
|
|
383
|
+
justify-content: center;
|
|
384
|
+
align-items: center;
|
|
385
|
+
z-index: 99;
|
|
386
|
+
.close {
|
|
387
|
+
position: absolute;
|
|
388
|
+
top: 20px;
|
|
389
|
+
right: 20px;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.sealPage {
|
|
394
|
+
position: fixed;
|
|
395
|
+
top: 0;
|
|
396
|
+
left: 0;
|
|
397
|
+
width: 100%;
|
|
398
|
+
height: 100%;
|
|
399
|
+
z-index: 99;
|
|
400
|
+
background: rgba(0, 0, 0, 0.5);
|
|
401
|
+
}
|
|
402
|
+
.sign_page {
|
|
403
|
+
position: fixed;
|
|
404
|
+
top: 0;
|
|
405
|
+
left: 0;
|
|
406
|
+
width: 100%;
|
|
407
|
+
height: 100%;
|
|
408
|
+
z-index: 99;
|
|
409
|
+
background: rgba(0, 0, 0, 0.5);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
}
|
|
@@ -0,0 +1,222 @@
|
|
|
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 { initSealPageMethod } from "./sealUtil";
|
|
6
|
+
import { signFileDownApi, getSignFileApi, fileUploadApi } from "../../api";
|
|
7
|
+
// import { uploadFilePromise, dataURLtoBlob } from './file.js'
|
|
8
|
+
|
|
9
|
+
function SealPage(props) {
|
|
10
|
+
var userInfo = props.userInfo,
|
|
11
|
+
file = props.file,
|
|
12
|
+
getSealRes = props.getSealRes,
|
|
13
|
+
handleClose = props.handleClose,
|
|
14
|
+
tokenTY = props.tokenTY,
|
|
15
|
+
baseUrl = props.baseUrl,
|
|
16
|
+
env = props.env,
|
|
17
|
+
isPC = props.isPC,
|
|
18
|
+
accessToken = props.accessToken;
|
|
19
|
+
var _useState = useState(''),
|
|
20
|
+
srcUrl = _useState[0],
|
|
21
|
+
setSrcUrl = _useState[1];
|
|
22
|
+
var _useState2 = useState(''),
|
|
23
|
+
orderId = _useState2[0],
|
|
24
|
+
setOrderId = _useState2[1];
|
|
25
|
+
var timerRef = useRef(null);
|
|
26
|
+
var elementRef = useRef(null);
|
|
27
|
+
var handleRes = /*#__PURE__*/function () {
|
|
28
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
29
|
+
var fileObj, res, pageUrl, orderIdVal;
|
|
30
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
31
|
+
while (1) switch (_context.prev = _context.next) {
|
|
32
|
+
case 0:
|
|
33
|
+
console.log('file', file, userInfo);
|
|
34
|
+
fileObj = file; // 有旧的 URL 说明是重新签章 旧的是原始的空白的 重新签需要签在原始的空白文件
|
|
35
|
+
if (file.isSealed) {
|
|
36
|
+
fileObj.fileUrl = file.originalUrl;
|
|
37
|
+
} else if (!file.originalUrl) {
|
|
38
|
+
fileObj.originalUrl = file.fileUrl;
|
|
39
|
+
}
|
|
40
|
+
// 传递配置参数给工具函数
|
|
41
|
+
_context.next = 1;
|
|
42
|
+
return initSealPageMethod(fileObj, userInfo, {
|
|
43
|
+
tokenTY: tokenTY,
|
|
44
|
+
baseUrl: baseUrl,
|
|
45
|
+
env: env,
|
|
46
|
+
isPC: isPC,
|
|
47
|
+
accessToken: accessToken
|
|
48
|
+
});
|
|
49
|
+
case 1:
|
|
50
|
+
res = _context.sent;
|
|
51
|
+
if (res) {
|
|
52
|
+
_context.next = 2;
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
handleClose();
|
|
56
|
+
return _context.abrupt("return");
|
|
57
|
+
case 2:
|
|
58
|
+
pageUrl = res.pageUrl, orderIdVal = res.orderId;
|
|
59
|
+
console.log('pageUrl', pageUrl);
|
|
60
|
+
setSrcUrl(pageUrl);
|
|
61
|
+
setOrderId(orderIdVal);
|
|
62
|
+
// console.log(res)
|
|
63
|
+
case 3:
|
|
64
|
+
case "end":
|
|
65
|
+
return _context.stop();
|
|
66
|
+
}
|
|
67
|
+
}, _callee);
|
|
68
|
+
}));
|
|
69
|
+
return function handleRes() {
|
|
70
|
+
return _ref.apply(this, arguments);
|
|
71
|
+
};
|
|
72
|
+
}();
|
|
73
|
+
|
|
74
|
+
// 将返回的文件重新上传
|
|
75
|
+
var uploadNewFile = /*#__PURE__*/function () {
|
|
76
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(fileData) {
|
|
77
|
+
var params, uploadRes, finalFile;
|
|
78
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
79
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
80
|
+
case 0:
|
|
81
|
+
console.log('fileData', fileData);
|
|
82
|
+
params = {
|
|
83
|
+
materiaBase: 'data:application/pdf;base64,' + fileData,
|
|
84
|
+
open: true
|
|
85
|
+
};
|
|
86
|
+
console.log('params', params);
|
|
87
|
+
_context2.next = 1;
|
|
88
|
+
return fileUploadApi(params, {
|
|
89
|
+
tokenTY: tokenTY,
|
|
90
|
+
baseUrl: baseUrl,
|
|
91
|
+
env: env,
|
|
92
|
+
isPC: isPC,
|
|
93
|
+
accessToken: accessToken
|
|
94
|
+
});
|
|
95
|
+
case 1:
|
|
96
|
+
uploadRes = _context2.sent;
|
|
97
|
+
console.log('重新上传的文件', uploadRes);
|
|
98
|
+
if (uploadRes.code === 200) {
|
|
99
|
+
handleClose();
|
|
100
|
+
finalFile = _extends({}, file, {
|
|
101
|
+
fileId: uploadRes.data.fileId,
|
|
102
|
+
fileName: file.fileName,
|
|
103
|
+
fileUrl: uploadRes.data.fileUrlList[2],
|
|
104
|
+
isSealed: true
|
|
105
|
+
});
|
|
106
|
+
getSealRes(finalFile);
|
|
107
|
+
}
|
|
108
|
+
case 2:
|
|
109
|
+
case "end":
|
|
110
|
+
return _context2.stop();
|
|
111
|
+
}
|
|
112
|
+
}, _callee2);
|
|
113
|
+
}));
|
|
114
|
+
return function uploadNewFile(_x) {
|
|
115
|
+
return _ref2.apply(this, arguments);
|
|
116
|
+
};
|
|
117
|
+
}();
|
|
118
|
+
|
|
119
|
+
// 下载文件
|
|
120
|
+
var signFileDown = function signFileDown(filePath) {
|
|
121
|
+
signFileDownApi({
|
|
122
|
+
fileUrl: filePath
|
|
123
|
+
}, {
|
|
124
|
+
tokenTY: tokenTY,
|
|
125
|
+
baseUrl: baseUrl,
|
|
126
|
+
env: env,
|
|
127
|
+
isPC: isPC,
|
|
128
|
+
accessToken: accessToken
|
|
129
|
+
}).then(function (res) {
|
|
130
|
+
if (res.code === 200) {
|
|
131
|
+
uploadNewFile(res.data);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
// 电子签章 - 移动端签批 获取移动端签章结果 (文件地址)
|
|
137
|
+
var getSignFileFun = function getSignFileFun() {
|
|
138
|
+
// uni.showLoading({ title: '加载中' })
|
|
139
|
+
|
|
140
|
+
var params = {
|
|
141
|
+
orderId: orderId
|
|
142
|
+
};
|
|
143
|
+
getSignFileApi(params, {
|
|
144
|
+
tokenTY: tokenTY,
|
|
145
|
+
baseUrl: baseUrl,
|
|
146
|
+
env: env,
|
|
147
|
+
isPC: isPC,
|
|
148
|
+
accessToken: accessToken
|
|
149
|
+
}).then(function (res) {
|
|
150
|
+
if (!res) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
console.log(res, '签章之后的数据');
|
|
154
|
+
var _res$data = res.data,
|
|
155
|
+
signStatus = _res$data.signStatus,
|
|
156
|
+
signFiles = _res$data.signFiles;
|
|
157
|
+
if (signStatus === 6) {
|
|
158
|
+
// 签署成功
|
|
159
|
+
handleClearInterval();
|
|
160
|
+
if (signFiles && signFiles.length) {
|
|
161
|
+
// 下载该文件
|
|
162
|
+
signFileDown(signFiles[0].filePath);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
// uni.hideLoading()
|
|
166
|
+
})["catch"](function (err) {
|
|
167
|
+
console.log(err);
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
var handleClearInterval = function handleClearInterval() {
|
|
171
|
+
clearInterval(timerRef.current);
|
|
172
|
+
timerRef.current = null;
|
|
173
|
+
};
|
|
174
|
+
useEffect(function () {
|
|
175
|
+
if (orderId) {
|
|
176
|
+
handleClearInterval();
|
|
177
|
+
timerRef.current = setInterval(function () {
|
|
178
|
+
getSignFileFun();
|
|
179
|
+
}, 3000);
|
|
180
|
+
}
|
|
181
|
+
return function () {
|
|
182
|
+
handleClearInterval();
|
|
183
|
+
};
|
|
184
|
+
}, [orderId]);
|
|
185
|
+
var handleTouchMove = function handleTouchMove(e) {
|
|
186
|
+
e.preventDefault(); // 只有在 passive: false 时才能调用
|
|
187
|
+
console.log('Touch move');
|
|
188
|
+
};
|
|
189
|
+
var handleTouchStart = function handleTouchStart(e) {
|
|
190
|
+
console.log('Touch start - passive', e.touches[0].clientX);
|
|
191
|
+
};
|
|
192
|
+
useEffect(function () {
|
|
193
|
+
var element = elementRef.current;
|
|
194
|
+
if (!element) return;
|
|
195
|
+
|
|
196
|
+
// 添加被动事件监听器
|
|
197
|
+
element.addEventListener('touchstart', handleTouchStart, {
|
|
198
|
+
passive: true
|
|
199
|
+
});
|
|
200
|
+
element.addEventListener('touchmove', handleTouchMove, {
|
|
201
|
+
passive: false // 如果需要 preventDefault
|
|
202
|
+
});
|
|
203
|
+
return function () {
|
|
204
|
+
element.removeEventListener('touchstart', handleTouchStart);
|
|
205
|
+
element.removeEventListener('touchmove', handleTouchMove);
|
|
206
|
+
};
|
|
207
|
+
}, []);
|
|
208
|
+
useEffect(function () {
|
|
209
|
+
handleRes();
|
|
210
|
+
}, [userInfo, file]);
|
|
211
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
212
|
+
className: "sealPage",
|
|
213
|
+
ref: elementRef
|
|
214
|
+
}, /*#__PURE__*/React.createElement("iframe", {
|
|
215
|
+
src: srcUrl,
|
|
216
|
+
id: "iframe",
|
|
217
|
+
frameborder: "0",
|
|
218
|
+
height: "100%",
|
|
219
|
+
width: "100%"
|
|
220
|
+
}));
|
|
221
|
+
}
|
|
222
|
+
export default SealPage;
|