ydb-components-material 0.1.95 → 0.1.97
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/120.7b74d4ab.async.js +1 -0
- package/build/docs/404.html +3 -3
- package/build/docs/608.bbe7d3e1.async.js +1 -0
- package/build/docs/856.8be8ecec.async.js +1 -0
- 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.aa947d35.css → umi.8e9c906f.css} +1 -1
- package/build/docs/umi.f458a7ca.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/3.js +16 -0
- package/build/lowcode/4.js +3 -0
- package/build/lowcode/5.js +20 -0
- 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 +16 -16
- package/build/lowcode/render/default/1.js +16 -0
- package/build/lowcode/render/default/2.js +3 -0
- package/build/lowcode/render/default/3.js +20 -0
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +294 -2
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +294 -2
- package/dist/1.js +17 -0
- package/dist/1.js.map +1 -0
- package/dist/2.js +4 -0
- package/dist/2.js.map +1 -0
- package/dist/3.js +21 -0
- package/dist/3.js.map +1 -0
- package/dist/BizComps.css +1 -1
- package/dist/BizComps.js +297 -5
- package/dist/BizComps.js.map +1 -1
- package/es/components/drag-drop/icons/preview.svg +1 -0
- package/es/components/drag-drop/index.d.ts +17 -0
- package/es/components/drag-drop/index.js +306 -0
- package/es/components/drag-drop/index.scss +130 -0
- package/es/components/file-list/checkPoint.js +6 -9
- package/es/components/file-list/index.js +79 -5
- package/es/components/file-list/index.scss +14 -1
- package/es/components/file-list/item.js +14 -7
- package/es/components/file-list/merge.d.ts +18 -0
- package/es/components/file-list/merge.js +313 -0
- package/es/components/file-list/merge.scss +137 -0
- package/es/components/file-list/seal.js +3 -1
- package/es/components/file-list/sign.js +3 -1
- package/es/components/scene-tree/index.js +2 -0
- package/es/components/scene-tree/index.scss +1 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +1 -0
- package/lib/components/drag-drop/icons/preview.svg +1 -0
- package/lib/components/drag-drop/index.d.ts +17 -0
- package/lib/components/drag-drop/index.js +314 -0
- package/lib/components/drag-drop/index.scss +130 -0
- package/lib/components/file-list/checkPoint.js +6 -9
- package/lib/components/file-list/index.js +80 -6
- package/lib/components/file-list/index.scss +14 -1
- package/lib/components/file-list/item.js +14 -7
- package/lib/components/file-list/merge.d.ts +18 -0
- package/lib/components/file-list/merge.js +321 -0
- package/lib/components/file-list/merge.scss +137 -0
- package/lib/components/file-list/seal.js +3 -1
- package/lib/components/file-list/sign.js +3 -1
- package/lib/components/scene-tree/index.js +2 -0
- package/lib/components/scene-tree/index.scss +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -1
- package/lowcode/drag-drop-list/meta.ts +159 -0
- package/lowcode/file-list/meta.ts +14 -0
- package/lowcode_es/drag-drop-list/meta.d.ts +22 -0
- package/lowcode_es/drag-drop-list/meta.js +145 -0
- package/lowcode_es/file-list/meta.js +13 -0
- package/lowcode_es/meta.js +3 -2
- package/lowcode_lib/drag-drop-list/meta.d.ts +22 -0
- package/lowcode_lib/drag-drop-list/meta.js +150 -0
- package/lowcode_lib/file-list/meta.js +13 -0
- package/lowcode_lib/meta.js +18 -17
- package/package.json +5 -3
- package/build/docs/umi.a9f70b86.js +0 -1
|
@@ -284,7 +284,7 @@ var FileItem = function FileItem(_ref) {
|
|
|
284
284
|
|
|
285
285
|
// 手写签批
|
|
286
286
|
var sign = function sign() {
|
|
287
|
-
|
|
287
|
+
openLoading();
|
|
288
288
|
setIsShowSignPage(true);
|
|
289
289
|
};
|
|
290
290
|
|
|
@@ -307,7 +307,6 @@ var FileItem = function FileItem(_ref) {
|
|
|
307
307
|
var getRes = function getRes(val) {
|
|
308
308
|
console.log('val---', val);
|
|
309
309
|
valChange(val, fileIndex, index, subIndex);
|
|
310
|
-
closeLoading();
|
|
311
310
|
};
|
|
312
311
|
|
|
313
312
|
// 获取签章结果
|
|
@@ -317,8 +316,6 @@ var FileItem = function FileItem(_ref) {
|
|
|
317
316
|
// 如果还允许签批 就连住一起做了
|
|
318
317
|
if (signatureEnable) {
|
|
319
318
|
sign();
|
|
320
|
-
} else {
|
|
321
|
-
closeLoading();
|
|
322
319
|
}
|
|
323
320
|
};
|
|
324
321
|
var queryFileLibs = function queryFileLibs() {
|
|
@@ -483,13 +480,19 @@ var FileItem = function FileItem(_ref) {
|
|
|
483
480
|
valChange(undefined, fileIndex, index, subIndex);
|
|
484
481
|
};
|
|
485
482
|
useEffect(function () {
|
|
483
|
+
var timer;
|
|
486
484
|
if (userInfo && tokenTY) {
|
|
487
485
|
console.log('userInfo', tokenTY, userInfo);
|
|
488
|
-
setTimeout(function () {
|
|
486
|
+
timer = setTimeout(function () {
|
|
489
487
|
queryFileLibs();
|
|
490
488
|
}, 0);
|
|
491
489
|
}
|
|
490
|
+
return function () {
|
|
491
|
+
timer && clearTimeout(timer);
|
|
492
|
+
};
|
|
492
493
|
}, [userInfo, tokenTY]);
|
|
494
|
+
|
|
495
|
+
// 获取缩略图
|
|
493
496
|
var extractImageUrls = /*#__PURE__*/function () {
|
|
494
497
|
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(previewUrl) {
|
|
495
498
|
var response, htmlText, parser, doc, imgElements, srcList;
|
|
@@ -521,6 +524,8 @@ var FileItem = function FileItem(_ref) {
|
|
|
521
524
|
return _ref6.apply(this, arguments);
|
|
522
525
|
};
|
|
523
526
|
}();
|
|
527
|
+
|
|
528
|
+
// 获取预览图片
|
|
524
529
|
var getViewUrl = /*#__PURE__*/function () {
|
|
525
530
|
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id) {
|
|
526
531
|
var type, urlRes, res, list;
|
|
@@ -789,7 +794,8 @@ var FileItem = function FileItem(_ref) {
|
|
|
789
794
|
getRes: getRes,
|
|
790
795
|
handleClose: function handleClose() {
|
|
791
796
|
return setIsShowSignPage(false);
|
|
792
|
-
}
|
|
797
|
+
},
|
|
798
|
+
closeLoading: closeLoading
|
|
793
799
|
}), isShowSealPage && /*#__PURE__*/React.createElement(SealPage, {
|
|
794
800
|
isShowSealPage: isShowSealPage,
|
|
795
801
|
userInfo: userInfo,
|
|
@@ -803,7 +809,8 @@ var FileItem = function FileItem(_ref) {
|
|
|
803
809
|
accessToken: accessToken,
|
|
804
810
|
handleClose: function handleClose() {
|
|
805
811
|
return setIsShowSealPage(false);
|
|
806
|
-
}
|
|
812
|
+
},
|
|
813
|
+
closeLoading: closeLoading
|
|
807
814
|
}), isShowPreview && /*#__PURE__*/React.createElement("div", {
|
|
808
815
|
className: "preview"
|
|
809
816
|
}, /*#__PURE__*/React.createElement("img", {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './merge.scss';
|
|
3
|
+
export interface MergeProps {
|
|
4
|
+
/**
|
|
5
|
+
* 类型
|
|
6
|
+
*/
|
|
7
|
+
fileList: Array<object>;
|
|
8
|
+
valChange?: (value: any) => void;
|
|
9
|
+
close?: () => void;
|
|
10
|
+
style?: object;
|
|
11
|
+
baseUrl: string;
|
|
12
|
+
tokenTY: string;
|
|
13
|
+
materialName: string;
|
|
14
|
+
openLoading: () => void;
|
|
15
|
+
closeLoading: () => void;
|
|
16
|
+
}
|
|
17
|
+
declare const Merge: React.FC<MergeProps>;
|
|
18
|
+
export default Merge;
|
|
@@ -0,0 +1,313 @@
|
|
|
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 * as React from 'react';
|
|
5
|
+
import { useState } from 'react'; // 1. 引入 useState
|
|
6
|
+
import previewIcon from "./icon/preview.svg";
|
|
7
|
+
import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
|
|
8
|
+
import { ExclamationCircleFilled, HolderOutlined, CloseOutlined, VerticalAlignTopOutlined } from '@ant-design/icons';
|
|
9
|
+
import jsPDF from 'jspdf';
|
|
10
|
+
import "./merge.scss";
|
|
11
|
+
var Merge = function Merge(_ref) {
|
|
12
|
+
var fileList = _ref.fileList,
|
|
13
|
+
valChange = _ref.valChange,
|
|
14
|
+
_ref$style = _ref.style,
|
|
15
|
+
style = _ref$style === void 0 ? {} : _ref$style,
|
|
16
|
+
baseUrl = _ref.baseUrl,
|
|
17
|
+
materialName = _ref.materialName,
|
|
18
|
+
tokenTY = _ref.tokenTY,
|
|
19
|
+
openLoading = _ref.openLoading,
|
|
20
|
+
closeLoading = _ref.closeLoading,
|
|
21
|
+
close = _ref.close;
|
|
22
|
+
var _useState = useState(''),
|
|
23
|
+
viewUrl = _useState[0],
|
|
24
|
+
setViewUrl = _useState[1];
|
|
25
|
+
var _useState2 = useState(''),
|
|
26
|
+
viewPdfUrl = _useState2[0],
|
|
27
|
+
setViewPdfUrl = _useState2[1];
|
|
28
|
+
var _useState3 = useState(null),
|
|
29
|
+
blob = _useState3[0],
|
|
30
|
+
setBlob = _useState3[1];
|
|
31
|
+
var _useState4 = useState(fileList),
|
|
32
|
+
materialList = _useState4[0],
|
|
33
|
+
setMaterialList = _useState4[1];
|
|
34
|
+
|
|
35
|
+
// 置顶
|
|
36
|
+
var top = function top(index) {
|
|
37
|
+
console.log('置顶');
|
|
38
|
+
var newItems = Array.from(materialList);
|
|
39
|
+
|
|
40
|
+
// 4. 移除被拖拽的元素
|
|
41
|
+
var _newItems$splice = newItems.splice(index, 1),
|
|
42
|
+
removed = _newItems$splice[0];
|
|
43
|
+
|
|
44
|
+
// 5. 将元素插入到新的位置
|
|
45
|
+
newItems.splice(0, 0, removed);
|
|
46
|
+
|
|
47
|
+
// 6. 更新状态,触发重新渲染
|
|
48
|
+
// setItems(newItems);
|
|
49
|
+
setMaterialList(newItems);
|
|
50
|
+
};
|
|
51
|
+
var onDragEnd = function onDragEnd(result) {
|
|
52
|
+
// 如果没有目标位置(比如拖拽到容器外),则不处理
|
|
53
|
+
if (!result.destination) return;
|
|
54
|
+
|
|
55
|
+
// 如果源位置和目标位置相同,也不处理
|
|
56
|
+
if (result.source.index === result.destination.index) return;
|
|
57
|
+
|
|
58
|
+
// 3. 创建一个新的数组副本
|
|
59
|
+
var newItems = Array.from(materialList);
|
|
60
|
+
|
|
61
|
+
// 4. 移除被拖拽的元素
|
|
62
|
+
var _newItems$splice2 = newItems.splice(result.source.index, 1),
|
|
63
|
+
removed = _newItems$splice2[0];
|
|
64
|
+
|
|
65
|
+
// 5. 将元素插入到新的位置
|
|
66
|
+
newItems.splice(result.destination.index, 0, removed);
|
|
67
|
+
|
|
68
|
+
// 6. 更新状态,触发重新渲染
|
|
69
|
+
// setItems(newItems);
|
|
70
|
+
setMaterialList(newItems);
|
|
71
|
+
console.log('拖拽完成,新顺序:', newItems);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// File 文件转 Image 对象
|
|
75
|
+
var getImageByFile = function getImageByFile(file) {
|
|
76
|
+
return new Promise(function (resolve) {
|
|
77
|
+
var reader = new FileReader();
|
|
78
|
+
reader.onload = function (e) {
|
|
79
|
+
var img = new Image();
|
|
80
|
+
img.src = e.target.result;
|
|
81
|
+
img.onload = function () {
|
|
82
|
+
return resolve(img);
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
reader.readAsDataURL(file);
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// 下载文件
|
|
90
|
+
var getBlob = function getBlob(url) {
|
|
91
|
+
return new Promise(function (resolve, reject) {
|
|
92
|
+
var xhr = new XMLHttpRequest();
|
|
93
|
+
xhr.open('GET', url, true);
|
|
94
|
+
xhr.responseType = 'blob';
|
|
95
|
+
xhr.onload = function () {
|
|
96
|
+
if (xhr.status === 200) {
|
|
97
|
+
resolve(xhr.response);
|
|
98
|
+
} else {
|
|
99
|
+
reject("Request failed with status " + xhr.status);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
xhr.onerror = function () {
|
|
103
|
+
reject('Request failed');
|
|
104
|
+
};
|
|
105
|
+
xhr.send();
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
// 核心:多张图片合并PDF
|
|
110
|
+
var imgsToPdf = /*#__PURE__*/function () {
|
|
111
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
112
|
+
var pdf, i, fileUrl, _blob, file, img, targetWidth, scale, targetHeight, pdfBlob, blobUrl;
|
|
113
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
114
|
+
while (1) switch (_context.prev = _context.next) {
|
|
115
|
+
case 0:
|
|
116
|
+
// 初始化PDF,纵向、A4
|
|
117
|
+
pdf = new jsPDF({
|
|
118
|
+
orientation: 'portrait',
|
|
119
|
+
unit: 'px',
|
|
120
|
+
format: 'a4'
|
|
121
|
+
}); // 遍历所有图片
|
|
122
|
+
i = 0;
|
|
123
|
+
case 1:
|
|
124
|
+
if (!(i < materialList.length)) {
|
|
125
|
+
_context.next = 5;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
fileUrl = materialList[i].fileUrl;
|
|
129
|
+
_context.next = 2;
|
|
130
|
+
return getBlob(fileUrl);
|
|
131
|
+
case 2:
|
|
132
|
+
_blob = _context.sent;
|
|
133
|
+
console.log(_blob);
|
|
134
|
+
file = new File([_blob], "img" + i, {
|
|
135
|
+
type: 'image/png'
|
|
136
|
+
});
|
|
137
|
+
console.log(file);
|
|
138
|
+
_context.next = 3;
|
|
139
|
+
return getImageByFile(file);
|
|
140
|
+
case 3:
|
|
141
|
+
img = _context.sent;
|
|
142
|
+
// 3. 计算可用宽度(保留边距)
|
|
143
|
+
targetWidth = 400; // 4. 按比例计算高度
|
|
144
|
+
scale = targetWidth / img.width;
|
|
145
|
+
targetHeight = img.height * scale; // 第一张不加新页,后续图片新增一页
|
|
146
|
+
if (i > 0) pdf.addPage();
|
|
147
|
+
|
|
148
|
+
// 图片写入PDF
|
|
149
|
+
pdf.addImage(img, 'PNG',
|
|
150
|
+
// 格式 JPEG/PNG
|
|
151
|
+
0, 0,
|
|
152
|
+
// x y 坐标
|
|
153
|
+
// A4_W, A4_H
|
|
154
|
+
targetWidth, targetHeight);
|
|
155
|
+
case 4:
|
|
156
|
+
i++;
|
|
157
|
+
_context.next = 1;
|
|
158
|
+
break;
|
|
159
|
+
case 5:
|
|
160
|
+
// 1. 获取 Blob
|
|
161
|
+
pdfBlob = pdf.output('blob');
|
|
162
|
+
setBlob(pdfBlob);
|
|
163
|
+
|
|
164
|
+
// 2. 创建 Blob URL
|
|
165
|
+
blobUrl = URL.createObjectURL(pdfBlob);
|
|
166
|
+
setViewPdfUrl(blobUrl);
|
|
167
|
+
case 6:
|
|
168
|
+
case "end":
|
|
169
|
+
return _context.stop();
|
|
170
|
+
}
|
|
171
|
+
}, _callee);
|
|
172
|
+
}));
|
|
173
|
+
return function imgsToPdf() {
|
|
174
|
+
return _ref2.apply(this, arguments);
|
|
175
|
+
};
|
|
176
|
+
}();
|
|
177
|
+
var uploadPdf = /*#__PURE__*/function () {
|
|
178
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
179
|
+
var formData;
|
|
180
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
181
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
182
|
+
case 0:
|
|
183
|
+
openLoading();
|
|
184
|
+
formData = new FormData();
|
|
185
|
+
formData.append('file', blob, materialName + '.pdf');
|
|
186
|
+
formData.append('open', true);
|
|
187
|
+
fetch(baseUrl + "/declaration/material/file/files/api", {
|
|
188
|
+
method: 'POST',
|
|
189
|
+
body: formData,
|
|
190
|
+
headers: {
|
|
191
|
+
'Authorization': tokenTY || ''
|
|
192
|
+
}
|
|
193
|
+
}).then(function (response) {
|
|
194
|
+
return response.json();
|
|
195
|
+
}).then(function (res) {
|
|
196
|
+
console.log(res);
|
|
197
|
+
valChange(_extends({}, res, {
|
|
198
|
+
fileName: materialName + '.pdf'
|
|
199
|
+
}));
|
|
200
|
+
closeLoading();
|
|
201
|
+
});
|
|
202
|
+
case 1:
|
|
203
|
+
case "end":
|
|
204
|
+
return _context2.stop();
|
|
205
|
+
}
|
|
206
|
+
}, _callee2);
|
|
207
|
+
}));
|
|
208
|
+
return function uploadPdf() {
|
|
209
|
+
return _ref3.apply(this, arguments);
|
|
210
|
+
};
|
|
211
|
+
}();
|
|
212
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
213
|
+
className: "drag_drop",
|
|
214
|
+
style: style
|
|
215
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
216
|
+
className: "tip"
|
|
217
|
+
}, /*#__PURE__*/React.createElement(ExclamationCircleFilled, {
|
|
218
|
+
size: 14,
|
|
219
|
+
style: {
|
|
220
|
+
marginTop: '4px'
|
|
221
|
+
}
|
|
222
|
+
}), "\u8BF7\u5BF9\u7167\u6750\u6599\u9875\u7801\u987A\u5E8F\u4F9D\u6B21\u6392\u5217\u56FE\u7247\uFF0C\u672A\u6309\u89C4\u8303\u63D0\u4EA4\u7684\u6750\u6599\uFF0C\u5C06\u5F71\u54CD\u5BA1\u6838\u7ED3\u679C"), /*#__PURE__*/React.createElement("p", {
|
|
223
|
+
className: "text"
|
|
224
|
+
}, "\u957F\u6309\u5217\u8868\u62D6\u52A8\u6392\u5E8F"), /*#__PURE__*/React.createElement(DragDropContext, {
|
|
225
|
+
onDragEnd: onDragEnd
|
|
226
|
+
}, /*#__PURE__*/React.createElement(Droppable, {
|
|
227
|
+
droppableId: "droppable"
|
|
228
|
+
}, function (provided) {
|
|
229
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, provided.droppableProps, {
|
|
230
|
+
ref: provided.innerRef
|
|
231
|
+
}), materialList.map(function (item, index) {
|
|
232
|
+
return /*#__PURE__*/React.createElement(Draggable, {
|
|
233
|
+
key: item.fileId,
|
|
234
|
+
draggableId: item.fileId,
|
|
235
|
+
index: index
|
|
236
|
+
}, function (provided) {
|
|
237
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
238
|
+
ref: provided.innerRef
|
|
239
|
+
}, provided.draggableProps, provided.dragHandleProps, {
|
|
240
|
+
className: "dragable",
|
|
241
|
+
style: _extends({}, provided.draggableProps.style)
|
|
242
|
+
}), /*#__PURE__*/React.createElement(HolderOutlined, {
|
|
243
|
+
style: {
|
|
244
|
+
fontSize: '20px'
|
|
245
|
+
}
|
|
246
|
+
}), /*#__PURE__*/React.createElement("img", {
|
|
247
|
+
className: "img",
|
|
248
|
+
src: item.fileUrl,
|
|
249
|
+
alt: ""
|
|
250
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
251
|
+
className: "info"
|
|
252
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
253
|
+
className: "name"
|
|
254
|
+
}, item.fileName), /*#__PURE__*/React.createElement("div", {
|
|
255
|
+
className: "view",
|
|
256
|
+
onClick: function onClick() {
|
|
257
|
+
return setViewUrl(item.fileUrl);
|
|
258
|
+
}
|
|
259
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
260
|
+
src: previewIcon,
|
|
261
|
+
alt: ""
|
|
262
|
+
}), "\u9884\u89C8")), /*#__PURE__*/React.createElement("div", {
|
|
263
|
+
className: "top",
|
|
264
|
+
onClick: function onClick() {
|
|
265
|
+
return top(index);
|
|
266
|
+
}
|
|
267
|
+
}, /*#__PURE__*/React.createElement(VerticalAlignTopOutlined, null)));
|
|
268
|
+
});
|
|
269
|
+
}), provided.placeholder);
|
|
270
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
271
|
+
className: "bottom_btn"
|
|
272
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
273
|
+
className: "previous btn",
|
|
274
|
+
onClick: close
|
|
275
|
+
}, "\u4E0A\u4E00\u6B65"), /*#__PURE__*/React.createElement("div", {
|
|
276
|
+
className: "preview btn",
|
|
277
|
+
onClick: imgsToPdf
|
|
278
|
+
}, "\u9884\u89C8\u6750\u6599")), viewUrl && /*#__PURE__*/React.createElement("div", {
|
|
279
|
+
className: "viewImg"
|
|
280
|
+
}, /*#__PURE__*/React.createElement(CloseOutlined, {
|
|
281
|
+
className: "close",
|
|
282
|
+
onClick: function onClick() {
|
|
283
|
+
return setViewUrl('');
|
|
284
|
+
}
|
|
285
|
+
}), /*#__PURE__*/React.createElement("img", {
|
|
286
|
+
className: "view",
|
|
287
|
+
src: viewUrl,
|
|
288
|
+
alt: ""
|
|
289
|
+
})), viewPdfUrl && /*#__PURE__*/React.createElement("div", {
|
|
290
|
+
className: "view_pdf"
|
|
291
|
+
}, /*#__PURE__*/React.createElement("iframe", {
|
|
292
|
+
src: viewPdfUrl + '#toolbar=0&navpanes=0&scrollbar=0&messages=0&statusbar=0',
|
|
293
|
+
id: "iframe",
|
|
294
|
+
frameBorder: "0",
|
|
295
|
+
height: "95%",
|
|
296
|
+
width: "100%"
|
|
297
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
298
|
+
className: "bottom_btn",
|
|
299
|
+
style: {
|
|
300
|
+
background: '#fff',
|
|
301
|
+
paddingTop: '20px'
|
|
302
|
+
}
|
|
303
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
304
|
+
className: "previous btn",
|
|
305
|
+
onClick: function onClick() {
|
|
306
|
+
return setViewPdfUrl('');
|
|
307
|
+
}
|
|
308
|
+
}, "\u8FD4\u56DE\u4FEE\u6539"), /*#__PURE__*/React.createElement("div", {
|
|
309
|
+
className: "preview btn",
|
|
310
|
+
onClick: uploadPdf
|
|
311
|
+
}, "\u786E\u8BA4\u65E0\u8BEF"))));
|
|
312
|
+
};
|
|
313
|
+
export default Merge;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
.drag_drop {
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 100%;
|
|
7
|
+
background: #F7F7F7;
|
|
8
|
+
z-index: 9999;
|
|
9
|
+
.tip {
|
|
10
|
+
background: #FFF6E8;
|
|
11
|
+
padding: 12px;
|
|
12
|
+
color: #F29655;
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
display: flex;
|
|
15
|
+
gap: 8px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.text {
|
|
19
|
+
color: #999999;
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
margin: 8px 12px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.dragable {
|
|
25
|
+
padding: 12px;
|
|
26
|
+
border-radius: 8px;
|
|
27
|
+
background: #fff;
|
|
28
|
+
display: flex;
|
|
29
|
+
gap: 15px;
|
|
30
|
+
align-items: center;
|
|
31
|
+
margin: 0 12px;
|
|
32
|
+
margin-bottom: 12px;
|
|
33
|
+
|
|
34
|
+
.img {
|
|
35
|
+
width: 50px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.info {
|
|
39
|
+
.name {
|
|
40
|
+
font-size: 14px;
|
|
41
|
+
color: #333333;
|
|
42
|
+
margin-bottom: 25px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.view {
|
|
46
|
+
color: #1678FF;
|
|
47
|
+
font-size: 14px;
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
gap: 4px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
.top {
|
|
56
|
+
margin-left: auto;
|
|
57
|
+
width: 30px;
|
|
58
|
+
height: 30px;
|
|
59
|
+
border-radius: 8px;
|
|
60
|
+
opacity: 1;
|
|
61
|
+
background: #F7F7F7;
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
font-size: 20px;
|
|
66
|
+
color: #666666;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.bottom_btn {
|
|
71
|
+
display: flex;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
gap: 15px;
|
|
74
|
+
position: fixed;
|
|
75
|
+
bottom: 0;
|
|
76
|
+
width: 100%;
|
|
77
|
+
padding-bottom: 20px;
|
|
78
|
+
|
|
79
|
+
.btn {
|
|
80
|
+
text-align: center;
|
|
81
|
+
line-height: 40px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.previous {
|
|
85
|
+
width: 45%;
|
|
86
|
+
height: 40px;
|
|
87
|
+
border-radius: 50px;
|
|
88
|
+
opacity: 1;
|
|
89
|
+
background: rgb(255, 255, 255);
|
|
90
|
+
color: rgb(51, 51, 51);
|
|
91
|
+
border: 1px solid rgb(231, 231, 231);
|
|
92
|
+
font-size: 16px;
|
|
93
|
+
font-weight: 500;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.preview {
|
|
97
|
+
width: 45%;
|
|
98
|
+
height: 40px;
|
|
99
|
+
border-radius: 50px;
|
|
100
|
+
opacity: 1;
|
|
101
|
+
color: rgb(255, 255, 255);
|
|
102
|
+
font-size: 16px;
|
|
103
|
+
font-weight: 500;
|
|
104
|
+
background: linear-gradient(90deg, rgb(115, 174, 255) 0%, rgb(22, 120, 255) 100%);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
.view_pdf {
|
|
108
|
+
position: fixed;
|
|
109
|
+
top: 0;
|
|
110
|
+
left: 0;
|
|
111
|
+
width: 100%;
|
|
112
|
+
height: 100%;
|
|
113
|
+
z-index: 9;
|
|
114
|
+
}
|
|
115
|
+
.viewImg {
|
|
116
|
+
background-color: #3333336a;
|
|
117
|
+
position: fixed;
|
|
118
|
+
top: 0;
|
|
119
|
+
left: 0;
|
|
120
|
+
width: 100%;
|
|
121
|
+
height: 100%;
|
|
122
|
+
// z-index: 9999;
|
|
123
|
+
|
|
124
|
+
.close {
|
|
125
|
+
position: absolute;
|
|
126
|
+
right: 20px;
|
|
127
|
+
top: 20px;
|
|
128
|
+
font-size: 30px;
|
|
129
|
+
color: #fff;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.view {
|
|
133
|
+
width: 100%;
|
|
134
|
+
margin-top: 40%;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -16,7 +16,8 @@ function SealPage(props) {
|
|
|
16
16
|
baseUrl = props.baseUrl,
|
|
17
17
|
env = props.env,
|
|
18
18
|
isPC = props.isPC,
|
|
19
|
-
accessToken = props.accessToken
|
|
19
|
+
accessToken = props.accessToken,
|
|
20
|
+
closeLoading = props.closeLoading;
|
|
20
21
|
var _useState = useState(''),
|
|
21
22
|
srcUrl = _useState[0],
|
|
22
23
|
setSrcUrl = _useState[1];
|
|
@@ -57,6 +58,7 @@ function SealPage(props) {
|
|
|
57
58
|
return _context.abrupt("return");
|
|
58
59
|
case 2:
|
|
59
60
|
pageUrl = res.pageUrl, orderIdVal = res.orderId;
|
|
61
|
+
closeLoading();
|
|
60
62
|
console.log('pageUrl', pageUrl);
|
|
61
63
|
setSrcUrl(pageUrl);
|
|
62
64
|
setOrderId(orderIdVal);
|
|
@@ -13,7 +13,8 @@ function SignPage(props) {
|
|
|
13
13
|
tokenTY = props.tokenTY,
|
|
14
14
|
baseUrl = props.baseUrl,
|
|
15
15
|
env = props.env,
|
|
16
|
-
isPC = props.isPC
|
|
16
|
+
isPC = props.isPC,
|
|
17
|
+
closeLoading = props.closeLoading;
|
|
17
18
|
var _useState = useState(''),
|
|
18
19
|
srcUrl = _useState[0],
|
|
19
20
|
setSrcUrl = _useState[1];
|
|
@@ -51,6 +52,7 @@ function SignPage(props) {
|
|
|
51
52
|
case 1:
|
|
52
53
|
res = _context.sent;
|
|
53
54
|
documentIdVal = res.documentId, contractIdVal = res.contractId, pageUrl = res.pageUrl, nameVal = res.fileName;
|
|
55
|
+
closeLoading();
|
|
54
56
|
setSrcUrl(pageUrl);
|
|
55
57
|
setDocumentId(documentIdVal);
|
|
56
58
|
setContractId(contractIdVal);
|
|
@@ -173,6 +173,7 @@ var SceneTree = function SceneTree(_ref) {
|
|
|
173
173
|
id: option.pid + "+" + node.pid,
|
|
174
174
|
key: option.id + node.pid + option.value + index,
|
|
175
175
|
value: option.id,
|
|
176
|
+
disabled: node.disabled,
|
|
176
177
|
style: isOverFlow && index > 0 ? {
|
|
177
178
|
width: '100%',
|
|
178
179
|
marginTop: '10px'
|
|
@@ -188,6 +189,7 @@ var SceneTree = function SceneTree(_ref) {
|
|
|
188
189
|
id: option.pid + "+" + node.pid,
|
|
189
190
|
key: option.id + node.pid + option.value + index,
|
|
190
191
|
value: option.id,
|
|
192
|
+
disabled: node.disabled,
|
|
191
193
|
style: isOverFlow && index > 0 ? {
|
|
192
194
|
width: '100%',
|
|
193
195
|
marginTop: '10px'
|
package/es/index.d.ts
CHANGED
|
@@ -45,5 +45,7 @@ export type { SubmitTypeProps } from './components/submit-type';
|
|
|
45
45
|
export { default as SubmitType } from './components/submit-type';
|
|
46
46
|
export type { FileListPreviewProps } from './components/file-list-preview';
|
|
47
47
|
export { default as FileListPreview } from './components/file-list-preview';
|
|
48
|
+
export type { DragDropListProps } from './components/drag-drop';
|
|
49
|
+
export { default as DragDropList } from './components/drag-drop';
|
|
48
50
|
declare const bizCssPrefix = "bizpack";
|
|
49
51
|
export { bizCssPrefix };
|
package/es/index.js
CHANGED
|
@@ -28,5 +28,6 @@ export { default as PrintButton } from "./components/print";
|
|
|
28
28
|
export { default as FileList } from "./components/file-list";
|
|
29
29
|
export { default as SubmitType } from "./components/submit-type";
|
|
30
30
|
export { default as FileListPreview } from "./components/file-list-preview";
|
|
31
|
+
export { default as DragDropList } from "./components/drag-drop";
|
|
31
32
|
var bizCssPrefix = 'bizpack';
|
|
32
33
|
export { bizCssPrefix };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="11" viewBox="0 0 16 11"><g><path d="M15.949896,5.2555661C16.016703,5.4388962,16.016703,5.5611272,15.949896,5.7444577C15.949896,5.7444577,15.883092,5.9277883,15.816283,5.9888978C15.749479,6.1722283,15.615868,6.3555694,15.482255,6.5999985C15.148229,7.0888891,14.680583,7.7000132,14.012527,8.3722239C12.743215,9.6555681,10.739035,11,8,11C5.2609663,11,3.2567897,9.6555681,1.987474,8.3722239C1.319415,7.7000132,0.85177505,7.0888891,0.51774478,6.5999985C0.51774478,6.5999985,0.18371604,5.9888978,0.18371604,5.9888978C0.11691014,5.9277883,0.050104432,5.7444577,0.050104432,5.7444577C-0.016701477,5.6222262,-0.016701477,5.4388962,0.050104432,5.2555661C0.050104432,5.2555661,0.1169103,5.0722361,0.18371604,5.0111141C0.25052202,4.8277841,0.38413364,4.6444426,0.51774478,4.4000139C0.85177356,3.9111221,1.319415,3.3000102,1.987474,2.6277888C3.2567489,1.3444551,5.2609239,0,7.9999585,0C10.738992,0,12.743169,1.3444551,14.012487,2.6277888C14.680545,3.3000102,15.148186,3.9111221,15.482213,4.400003C15.482213,4.400003,15.816243,5.0111032,15.816243,5.0111032C15.883049,5.0722246,15.949852,5.2555661,15.949852,5.2555661C15.949852,5.2555661,15.949896,5.2555661,15.949896,5.2555661ZM8.0000048,3.3000102C9.2025099,3.3000102,10.271409,4.2777824,10.271409,5.5000286C10.271409,6.72223,9.2025127,7.7000132,8.0000048,7.7000132C6.7974997,7.7000132,5.728601,6.72223,5.728601,5.5000286C5.728601,4.2777824,6.7974944,3.3000102,8.0000048,3.3000102C8.0000048,3.3000102,8.0000048,3.3000102,8.0000048,3.3000102ZM4.3924899,5.5000286C4.3924899,7.3333526,5.9958301,8.9222136,8.0000048,8.9222136C10.004179,8.9222136,11.607521,7.3333526,11.607521,5.5000286C11.607521,3.6666818,10.004179,2.0777981,8.0000048,2.0777981C5.9958305,2.0777981,4.3924899,3.6666818,4.3924899,5.5000286C4.3924899,5.5000286,4.3924899,5.5000286,4.3924899,5.5000286Z" fill="#1678FF" fill-opacity="1" style="mix-blend-mode:passthrough"/></g></svg>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
export interface DragDropListProps {
|
|
4
|
+
/**
|
|
5
|
+
* 类型
|
|
6
|
+
*/
|
|
7
|
+
fileList: Array<object>;
|
|
8
|
+
valChange?: (value: any) => void;
|
|
9
|
+
close?: () => void;
|
|
10
|
+
style?: object;
|
|
11
|
+
baseUrl: string;
|
|
12
|
+
tokenTY: string;
|
|
13
|
+
materialName: string;
|
|
14
|
+
getRes: (value: any) => void;
|
|
15
|
+
}
|
|
16
|
+
declare const DragDropList: React.FC<DragDropListProps>;
|
|
17
|
+
export default DragDropList;
|