ydb-components-material 0.1.88 → 0.1.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/docs/404.html +3 -3
- package/build/docs/_demos/:uuid +3 -3
- package/build/docs/colorful-button.html +3 -3
- package/build/docs/colorful-input.html +3 -3
- package/build/docs/index.html +3 -3
- package/build/docs/static/bj1.c8eb2503.png +0 -0
- package/build/docs/static/bj2.fb5ead8b.png +0 -0
- package/build/docs/static/bj3.aa81c8c1.png +0 -0
- package/build/docs/static/type1-3.6426929d.png +0 -0
- package/build/docs/static/type2.fa812bd1.png +0 -0
- package/build/docs/static/typeImg3.c88bc129.png +0 -0
- package/build/docs/umi.0d8865d0.js +1 -0
- package/build/docs/{umi.666eb3a7.css → umi.ec50463c.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/17f243cfda7d6e50dd94b66c293f2239.png +0 -0
- package/build/lowcode/assets/7bb589fd0f7d37fa8ed13cb06736a079.png +0 -0
- package/build/lowcode/assets/952850f47326ce9313abf0d289d5ee0c.png +0 -0
- package/build/lowcode/assets/b2215bb470264d2ac1445c1136838fcf.png +0 -0
- package/build/lowcode/assets/d5dfb3a4d87c01db66274b13c8bb68ef.png +0 -0
- package/build/lowcode/assets/dae0b5495fd1e0b6386ad8a14e293bd9.png +0 -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 +9 -9
- package/build/lowcode/render/default/assets/17f243cfda7d6e50dd94b66c293f2239.png +0 -0
- package/build/lowcode/render/default/assets/7bb589fd0f7d37fa8ed13cb06736a079.png +0 -0
- package/build/lowcode/render/default/assets/952850f47326ce9313abf0d289d5ee0c.png +0 -0
- package/build/lowcode/render/default/assets/b2215bb470264d2ac1445c1136838fcf.png +0 -0
- package/build/lowcode/render/default/assets/d5dfb3a4d87c01db66274b13c8bb68ef.png +0 -0
- package/build/lowcode/render/default/assets/dae0b5495fd1e0b6386ad8a14e293bd9.png +0 -0
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +2 -55
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +2 -55
- package/dist/BizComps.css +1 -1
- package/dist/BizComps.js +5 -58
- package/dist/BizComps.js.map +1 -1
- package/dist/assets/17f243cfda7d6e50dd94b66c293f2239.png +0 -0
- package/dist/assets/7bb589fd0f7d37fa8ed13cb06736a079.png +0 -0
- package/dist/assets/952850f47326ce9313abf0d289d5ee0c.png +0 -0
- package/dist/assets/b2215bb470264d2ac1445c1136838fcf.png +0 -0
- package/dist/assets/d5dfb3a4d87c01db66274b13c8bb68ef.png +0 -0
- package/dist/assets/dae0b5495fd1e0b6386ad8a14e293bd9.png +0 -0
- package/es/components/file-list/file.js +0 -71
- package/es/components/file-list/index.js +40 -2
- package/es/components/file-list/index.scss +25 -0
- package/es/components/file-list/item.js +75 -23
- package/es/components/file-list-preview/checkPoint.d.ts +3 -0
- package/es/components/file-list-preview/checkPoint.js +157 -0
- package/es/components/file-list-preview/checkPoint.scss +120 -0
- package/es/components/file-list-preview/file.js +224 -0
- package/es/components/file-list-preview/icon/checked.svg +1 -0
- package/es/components/file-list-preview/icon/close.svg +1 -0
- package/es/components/file-list-preview/icon/del.svg +1 -0
- package/es/components/file-list-preview/icon/download.svg +1 -0
- package/es/components/file-list-preview/icon/download_pc.svg +1 -0
- package/es/components/file-list-preview/icon/file.svg +1 -0
- package/es/components/file-list-preview/icon/icon_errorMsg.svg +1 -0
- package/es/components/file-list-preview/icon/icon_warning.svg +1 -0
- package/es/components/file-list-preview/icon/preview.svg +1 -0
- package/es/components/file-list-preview/icon/preview_pc.svg +1 -0
- package/es/components/file-list-preview/icon/upload.svg +1 -0
- package/es/components/file-list-preview/icon/view.svg +1 -0
- package/es/components/file-list-preview/index.d.ts +21 -0
- package/es/components/file-list-preview/index.js +249 -0
- package/es/components/file-list-preview/index.scss +61 -0
- package/es/components/file-list-preview/item.d.ts +18 -0
- package/es/components/file-list-preview/item.js +370 -0
- package/es/components/file-list-preview/item.scss +412 -0
- package/es/components/submit-type/assets/bj1.png +0 -0
- package/es/components/submit-type/assets/bj2.png +0 -0
- package/es/components/submit-type/assets/bj3.png +0 -0
- package/es/components/submit-type/assets/type1-3.png +0 -0
- package/es/components/submit-type/assets/type2.png +0 -0
- package/es/components/submit-type/assets/typeImg3.png +0 -0
- package/es/components/submit-type/index.d.ts +10 -0
- package/es/components/submit-type/index.js +69 -0
- package/es/components/submit-type/index.scss +41 -0
- package/es/index.d.ts +4 -0
- package/es/index.js +2 -0
- package/es/style.js +1 -0
- package/lib/components/file-list/file.js +1 -74
- package/lib/components/file-list/index.js +40 -2
- package/lib/components/file-list/index.scss +25 -0
- package/lib/components/file-list/item.js +80 -28
- package/lib/components/file-list-preview/checkPoint.d.ts +3 -0
- package/lib/components/file-list-preview/checkPoint.js +162 -0
- package/lib/components/file-list-preview/checkPoint.scss +120 -0
- package/lib/components/file-list-preview/file.js +233 -0
- package/lib/components/file-list-preview/icon/checked.svg +1 -0
- package/lib/components/file-list-preview/icon/close.svg +1 -0
- package/lib/components/file-list-preview/icon/del.svg +1 -0
- package/lib/components/file-list-preview/icon/download.svg +1 -0
- package/lib/components/file-list-preview/icon/download_pc.svg +1 -0
- package/lib/components/file-list-preview/icon/file.svg +1 -0
- package/lib/components/file-list-preview/icon/icon_errorMsg.svg +1 -0
- package/lib/components/file-list-preview/icon/icon_warning.svg +1 -0
- package/lib/components/file-list-preview/icon/preview.svg +1 -0
- package/lib/components/file-list-preview/icon/preview_pc.svg +1 -0
- package/lib/components/file-list-preview/icon/upload.svg +1 -0
- package/lib/components/file-list-preview/icon/view.svg +1 -0
- package/lib/components/file-list-preview/index.d.ts +21 -0
- package/lib/components/file-list-preview/index.js +254 -0
- package/lib/components/file-list-preview/index.scss +61 -0
- package/lib/components/file-list-preview/item.d.ts +18 -0
- package/lib/components/file-list-preview/item.js +376 -0
- package/lib/components/file-list-preview/item.scss +412 -0
- package/lib/components/submit-type/assets/bj1.png +0 -0
- package/lib/components/submit-type/assets/bj2.png +0 -0
- package/lib/components/submit-type/assets/bj3.png +0 -0
- package/lib/components/submit-type/assets/type1-3.png +0 -0
- package/lib/components/submit-type/assets/type2.png +0 -0
- package/lib/components/submit-type/assets/typeImg3.png +0 -0
- package/lib/components/submit-type/index.d.ts +10 -0
- package/lib/components/submit-type/index.js +75 -0
- package/lib/components/submit-type/index.scss +41 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +5 -1
- package/lib/style.js +1 -0
- package/lowcode/file-list-preview/meta.ts +231 -0
- package/lowcode/submit-type/meta.ts +40 -0
- package/lowcode_es/file-list-preview/meta.d.ts +22 -0
- package/lowcode_es/file-list-preview/meta.js +213 -0
- package/lowcode_es/meta.js +4 -2
- package/lowcode_es/submit-type/meta.d.ts +22 -0
- package/lowcode_es/submit-type/meta.js +34 -0
- package/lowcode_lib/file-list-preview/meta.d.ts +22 -0
- package/lowcode_lib/file-list-preview/meta.js +218 -0
- package/lowcode_lib/meta.js +16 -14
- package/lowcode_lib/submit-type/meta.d.ts +22 -0
- package/lowcode_lib/submit-type/meta.js +39 -0
- package/package.json +3 -4
- package/build/docs/umi.f5d91602.js +0 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,76 +1,5 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
1
|
// import apiConfig from '@/config/api.cofig'
|
|
4
2
|
|
|
5
|
-
// utils/pdfToImage.js
|
|
6
|
-
import * as pdfjsLib from 'pdfjs-dist/build/pdf';
|
|
7
|
-
import 'pdfjs-dist/build/pdf.worker.entry';
|
|
8
|
-
|
|
9
|
-
// 配置 worker(必须!)
|
|
10
|
-
if (typeof window !== 'undefined') {
|
|
11
|
-
pdfjsLib.GlobalWorkerOptions.workerSrc = require('pdfjs-dist/build/pdf.worker.entry');
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* 将 PDF URL 转换为图片 URL
|
|
16
|
-
* @param {string} pdfUrl - PDF 文件的 URL
|
|
17
|
-
* @param {number} [page=1] - 页码,默认第1页
|
|
18
|
-
* @param {number} [scale=0.5] - 缩放比例,默认0.5
|
|
19
|
-
* @param {string} [imageFormat='image/jpeg'] - 图片格式
|
|
20
|
-
* @param {number} [imageQuality=0.8] - 图片质量(0-1)
|
|
21
|
-
* @returns {Promise<string>} 返回图片的 Data URL
|
|
22
|
-
*/
|
|
23
|
-
export var pdfToImageUrl = /*#__PURE__*/function () {
|
|
24
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(pdfUrl, scale) {
|
|
25
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
26
|
-
while (1) switch (_context.prev = _context.next) {
|
|
27
|
-
case 0:
|
|
28
|
-
if (scale === void 0) {
|
|
29
|
-
scale = 0.5;
|
|
30
|
-
}
|
|
31
|
-
console.log('pdfToImageUrl----', pdfUrl);
|
|
32
|
-
pdfjsLib.getDocument(pdfUrl).promise.then(function (pdf) {
|
|
33
|
-
console.log('获取PDF文件成功', pdf);
|
|
34
|
-
// 获取第一页
|
|
35
|
-
return pdf.getPage(1);
|
|
36
|
-
}).then(function (page) {
|
|
37
|
-
console.log('获取PDF页面成功', page);
|
|
38
|
-
// 设置缩略图的缩放比例 (0.5 表示缩小到一半尺寸)
|
|
39
|
-
var viewport = page.getViewport({
|
|
40
|
-
scale: scale
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
// 创建Canvas元素
|
|
44
|
-
var canvas = document.createElement('canvas');
|
|
45
|
-
var context = canvas.getContext('2d');
|
|
46
|
-
canvas.height = viewport.height;
|
|
47
|
-
canvas.width = viewport.width;
|
|
48
|
-
|
|
49
|
-
// 将PDF页面渲染到Canvas上
|
|
50
|
-
var renderContext = {
|
|
51
|
-
canvasContext: context,
|
|
52
|
-
viewport: viewport
|
|
53
|
-
};
|
|
54
|
-
page.render(renderContext).promise.then(function () {
|
|
55
|
-
// 将Canvas转换为图片URL
|
|
56
|
-
var thumbnail = canvas.toDataURL();
|
|
57
|
-
console.log('获取图片成功', thumbnail);
|
|
58
|
-
return thumbnail;
|
|
59
|
-
});
|
|
60
|
-
})["catch"](function (error) {
|
|
61
|
-
console.error('Error generating thumbnail:', error);
|
|
62
|
-
});
|
|
63
|
-
case 1:
|
|
64
|
-
case "end":
|
|
65
|
-
return _context.stop();
|
|
66
|
-
}
|
|
67
|
-
}, _callee);
|
|
68
|
-
}));
|
|
69
|
-
return function pdfToImageUrl(_x, _x2) {
|
|
70
|
-
return _ref.apply(this, arguments);
|
|
71
|
-
};
|
|
72
|
-
}();
|
|
73
|
-
|
|
74
3
|
// 下载文件
|
|
75
4
|
export function getBlob(url) {
|
|
76
5
|
return new Promise(function (resolve, reject) {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import _Balloon from "@alifd/next/es/balloon";
|
|
1
2
|
import React from 'react';
|
|
3
|
+
var Tooltip = _Balloon.Tooltip;
|
|
2
4
|
import FileItem from "./item";
|
|
3
5
|
import "./index.scss";
|
|
4
6
|
var MATERIAL_TYPE = {
|
|
@@ -110,6 +112,8 @@ var FileList = function FileList(_ref) {
|
|
|
110
112
|
if (subIndex !== undefined) {
|
|
111
113
|
// value为空,说明删除了
|
|
112
114
|
if (!value) {
|
|
115
|
+
oneLevelItem.subMaterials[subIndex].isSmart = false;
|
|
116
|
+
oneLevelItem.subMaterials[subIndex].isShareFile = false;
|
|
113
117
|
// 如果当前文件list中只有一个文件,还得补个空的
|
|
114
118
|
if (oneLevelItem.subMaterials[subIndex].fileList.length === 1) {
|
|
115
119
|
oneLevelItem.subMaterials[subIndex].fileList = [{
|
|
@@ -130,6 +134,8 @@ var FileList = function FileList(_ref) {
|
|
|
130
134
|
}
|
|
131
135
|
} else {
|
|
132
136
|
if (!value) {
|
|
137
|
+
oneLevelItem.isSmart = false;
|
|
138
|
+
oneLevelItem.isShareFile = false;
|
|
133
139
|
oneLevelItem.fileList.splice(fileIndex, 1);
|
|
134
140
|
if (oneLevelItem.fileList.length === 0) {
|
|
135
141
|
oneLevelItem.fileList.push({
|
|
@@ -150,22 +156,54 @@ var FileList = function FileList(_ref) {
|
|
|
150
156
|
console.log('fileList--------res', fileList);
|
|
151
157
|
valChange(fileList);
|
|
152
158
|
};
|
|
159
|
+
var trigger = function trigger(child) {
|
|
160
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
161
|
+
className: "tag",
|
|
162
|
+
style: {
|
|
163
|
+
backgroundColor: child.isSmart ? '#1678FF' : child.isShareFile ? '#15BC83' : '#9570F7'
|
|
164
|
+
}
|
|
165
|
+
}, child.isSmart ? '智' : child.isShareFile ? '享' : '自');
|
|
166
|
+
};
|
|
153
167
|
return /*#__PURE__*/React.createElement("div", {
|
|
154
168
|
className: "file_list",
|
|
155
169
|
style: style
|
|
156
170
|
}, fileList.map(function (item, index) {
|
|
157
171
|
return /*#__PURE__*/React.createElement("div", {
|
|
158
172
|
className: "file_level_one"
|
|
173
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
174
|
+
className: "file_level_one_title"
|
|
159
175
|
}, /*#__PURE__*/React.createElement("p", {
|
|
160
176
|
className: "name_level_one"
|
|
161
|
-
}, convertNumbersToChinese(index + 1), item.materialName), item.subMaterials && item.subMaterials.length > 0
|
|
177
|
+
}, convertNumbersToChinese(index + 1), item.materialName), !(item.subMaterials && item.subMaterials.length > 0) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
178
|
+
className: "required"
|
|
179
|
+
}, "*"), /*#__PURE__*/React.createElement(_Balloon, {
|
|
180
|
+
v2: true,
|
|
181
|
+
trigger: trigger(item),
|
|
182
|
+
triggerType: "click",
|
|
183
|
+
align: "t",
|
|
184
|
+
arrowPointToCenter: true,
|
|
185
|
+
title: "",
|
|
186
|
+
delay: 20
|
|
187
|
+
}, item.isSmart ? '本材料为智能生成材料,系统将根据您填写的信息自动生成申报材料。' : item.isShareFile ? '本材料为共享材料,数据由大数据共享获取,无需用户自行准备。' : '需要用户自行准备申报材料'))), item.subMaterials && item.subMaterials.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
162
188
|
className: "file_level_two"
|
|
163
189
|
}, item.subMaterials.map(function (child, subIndex) {
|
|
164
190
|
return /*#__PURE__*/React.createElement("div", {
|
|
165
191
|
className: "file_level_two_item"
|
|
192
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
193
|
+
className: "file_level_two_title"
|
|
166
194
|
}, /*#__PURE__*/React.createElement("p", {
|
|
167
195
|
className: "name_level_two"
|
|
168
|
-
}, subIndex + 1, "\u3001", child.materialName), /*#__PURE__*/React.createElement("
|
|
196
|
+
}, subIndex + 1, "\u3001", child.materialName), /*#__PURE__*/React.createElement("span", {
|
|
197
|
+
className: "required"
|
|
198
|
+
}, "*"), /*#__PURE__*/React.createElement(_Balloon, {
|
|
199
|
+
v2: true,
|
|
200
|
+
trigger: trigger(child),
|
|
201
|
+
triggerType: "click",
|
|
202
|
+
arrowPointToCenter: true,
|
|
203
|
+
align: "t",
|
|
204
|
+
title: "",
|
|
205
|
+
delay: 20
|
|
206
|
+
}, child.isSmart ? '本材料为智能生成材料,系统将根据您填写的信息自动生成申报材料。' : child.isShareFile ? '本材料为共享材料,数据由大数据共享获取,无需用户自行准备。' : '需要用户自行准备申报材料')), /*#__PURE__*/React.createElement("p", {
|
|
169
207
|
className: "tip"
|
|
170
208
|
}, getTipTextForSubMaterial(item, index, subIndex)), child.fileList.map(function (file, i) {
|
|
171
209
|
return /*#__PURE__*/React.createElement(FileItem, {
|
|
@@ -11,12 +11,31 @@
|
|
|
11
11
|
margin-top: 8px;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
.required {
|
|
15
|
+
color: red;
|
|
16
|
+
margin-right: 8px;
|
|
17
|
+
margin-left: 2px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.tag {
|
|
21
|
+
border-radius: 4px;
|
|
22
|
+
padding: 0 4px;
|
|
23
|
+
font-size: 12px;
|
|
24
|
+
color: #FFFFFF;
|
|
25
|
+
}
|
|
26
|
+
|
|
14
27
|
.name_level_one {
|
|
15
28
|
font-size: 15px;
|
|
16
29
|
font-weight: 500;
|
|
17
30
|
color: #333333;
|
|
31
|
+
margin-bottom: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.file_level_one_title {
|
|
18
35
|
padding-bottom: 16px;
|
|
19
36
|
border-bottom: 1px solid #EEEEEE;
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
20
39
|
}
|
|
21
40
|
|
|
22
41
|
.file_level_two {
|
|
@@ -24,12 +43,18 @@
|
|
|
24
43
|
|
|
25
44
|
.file_level_two_item {
|
|
26
45
|
margin-bottom: 16px;
|
|
46
|
+
|
|
47
|
+
.file_level_two_title {
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
}
|
|
27
51
|
}
|
|
28
52
|
|
|
29
53
|
.name_level_two {
|
|
30
54
|
font-size: 14px;
|
|
31
55
|
font-weight: 500;
|
|
32
56
|
color: #323232;
|
|
57
|
+
margin-bottom: 0;
|
|
33
58
|
}
|
|
34
59
|
}
|
|
35
60
|
}
|
|
@@ -10,6 +10,7 @@ import previewIcon from "./icon/preview.svg";
|
|
|
10
10
|
import previewIconPC from "./icon/preview_pc.svg";
|
|
11
11
|
import downloadIcon from "./icon/download.svg";
|
|
12
12
|
import downloadIconPC from "./icon/download_pc.svg";
|
|
13
|
+
import fileIcon from "./icon/file.svg";
|
|
13
14
|
import warningIcon from "./icon/icon_warning.svg";
|
|
14
15
|
import errorMsgIcon from "./icon/icon_errorMsg.svg";
|
|
15
16
|
import uploadIcon from "./icon/upload.svg";
|
|
@@ -17,7 +18,7 @@ import closeIcon from "./icon/close.svg";
|
|
|
17
18
|
import SignPage from "./sign";
|
|
18
19
|
import SealPage from "./seal";
|
|
19
20
|
import { getMaterialLib, getGuideImg, getUrlById, onlinePreview } from "../../api";
|
|
20
|
-
import { initFormat, getFileExtension
|
|
21
|
+
import { initFormat, getFileExtension } from "./file.js";
|
|
21
22
|
import CheckPoint from "./checkPoint";
|
|
22
23
|
import "./item.scss";
|
|
23
24
|
var RadioGroup = _Radio.Group;
|
|
@@ -46,7 +47,8 @@ var FileItem = function FileItem(_ref) {
|
|
|
46
47
|
fileUrl = file.fileUrl,
|
|
47
48
|
fileId = file.fileId,
|
|
48
49
|
isSigned = file.isSigned,
|
|
49
|
-
isSealed = file.isSealed
|
|
50
|
+
isSealed = file.isSealed,
|
|
51
|
+
fileType = file.fileType;
|
|
50
52
|
var signatureEnable = fileConfig.signatureEnable,
|
|
51
53
|
signEnable = fileConfig.signEnable,
|
|
52
54
|
isInValid = fileConfig.isInValid,
|
|
@@ -485,13 +487,57 @@ var FileItem = function FileItem(_ref) {
|
|
|
485
487
|
}, 0);
|
|
486
488
|
}
|
|
487
489
|
}, [userInfo, isShowLib, tokenTY]);
|
|
488
|
-
var
|
|
489
|
-
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(
|
|
490
|
-
var
|
|
490
|
+
var extractImageUrls = /*#__PURE__*/function () {
|
|
491
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(previewUrl) {
|
|
492
|
+
var response, htmlText, parser, doc, imgElements, srcList;
|
|
491
493
|
return _regeneratorRuntime.wrap(function (_context5) {
|
|
492
494
|
while (1) switch (_context5.prev = _context5.next) {
|
|
493
495
|
case 0:
|
|
494
496
|
_context5.next = 1;
|
|
497
|
+
return fetch(previewUrl);
|
|
498
|
+
case 1:
|
|
499
|
+
response = _context5.sent;
|
|
500
|
+
_context5.next = 2;
|
|
501
|
+
return response.text();
|
|
502
|
+
case 2:
|
|
503
|
+
htmlText = _context5.sent;
|
|
504
|
+
parser = new DOMParser();
|
|
505
|
+
doc = parser.parseFromString(htmlText, 'text/html');
|
|
506
|
+
imgElements = doc.querySelectorAll('img');
|
|
507
|
+
srcList = Array.from(imgElements).map(function (img) {
|
|
508
|
+
return img.getAttribute('data-src');
|
|
509
|
+
});
|
|
510
|
+
return _context5.abrupt("return", srcList);
|
|
511
|
+
case 3:
|
|
512
|
+
case "end":
|
|
513
|
+
return _context5.stop();
|
|
514
|
+
}
|
|
515
|
+
}, _callee5);
|
|
516
|
+
}));
|
|
517
|
+
return function extractImageUrls(_x3) {
|
|
518
|
+
return _ref6.apply(this, arguments);
|
|
519
|
+
};
|
|
520
|
+
}();
|
|
521
|
+
var getViewUrl = /*#__PURE__*/function () {
|
|
522
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id) {
|
|
523
|
+
var type, urlRes, res, list;
|
|
524
|
+
return _regeneratorRuntime.wrap(function (_context6) {
|
|
525
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
526
|
+
case 0:
|
|
527
|
+
type = getFileExtension(fileName);
|
|
528
|
+
if (!['png', 'jpg', 'jpeg'].includes(type)) {
|
|
529
|
+
_context6.next = 1;
|
|
530
|
+
break;
|
|
531
|
+
}
|
|
532
|
+
return _context6.abrupt("return", fileUrl);
|
|
533
|
+
case 1:
|
|
534
|
+
if (!(type !== 'pdf')) {
|
|
535
|
+
_context6.next = 2;
|
|
536
|
+
break;
|
|
537
|
+
}
|
|
538
|
+
return _context6.abrupt("return", '');
|
|
539
|
+
case 2:
|
|
540
|
+
_context6.next = 3;
|
|
495
541
|
return getUrlById({
|
|
496
542
|
id: id,
|
|
497
543
|
effectiveTime: 3600000
|
|
@@ -503,14 +549,14 @@ var FileItem = function FileItem(_ref) {
|
|
|
503
549
|
isPC: isPC,
|
|
504
550
|
accessToken: accessToken
|
|
505
551
|
});
|
|
506
|
-
case
|
|
507
|
-
urlRes =
|
|
552
|
+
case 3:
|
|
553
|
+
urlRes = _context6.sent;
|
|
508
554
|
if (!(urlRes.presignedUrlList && urlRes.presignedUrlList.length > 0)) {
|
|
509
|
-
|
|
555
|
+
_context6.next = 6;
|
|
510
556
|
break;
|
|
511
557
|
}
|
|
512
558
|
console.log('urlRes', urlRes);
|
|
513
|
-
|
|
559
|
+
_context6.next = 4;
|
|
514
560
|
return onlinePreview({
|
|
515
561
|
url: urlRes.presignedUrlList[2]
|
|
516
562
|
}, {
|
|
@@ -521,26 +567,28 @@ var FileItem = function FileItem(_ref) {
|
|
|
521
567
|
isPC: isPC,
|
|
522
568
|
accessToken: accessToken
|
|
523
569
|
});
|
|
524
|
-
case
|
|
525
|
-
res =
|
|
526
|
-
|
|
527
|
-
|
|
570
|
+
case 4:
|
|
571
|
+
res = _context6.sent;
|
|
572
|
+
_context6.next = 5;
|
|
573
|
+
return extractImageUrls(res.url);
|
|
574
|
+
case 5:
|
|
575
|
+
list = _context6.sent;
|
|
576
|
+
console.log('list---', list);
|
|
577
|
+
return _context6.abrupt("return", list[0]);
|
|
578
|
+
case 6:
|
|
528
579
|
case "end":
|
|
529
|
-
return
|
|
580
|
+
return _context6.stop();
|
|
530
581
|
}
|
|
531
|
-
},
|
|
582
|
+
}, _callee6);
|
|
532
583
|
}));
|
|
533
|
-
return function
|
|
534
|
-
return
|
|
584
|
+
return function getViewUrl(_x4) {
|
|
585
|
+
return _ref7.apply(this, arguments);
|
|
535
586
|
};
|
|
536
587
|
}();
|
|
537
588
|
useEffect(function () {
|
|
538
589
|
if (fileId) {
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
console.log('imgUrl', res);
|
|
542
|
-
setThumbnail(res);
|
|
543
|
-
});
|
|
590
|
+
getViewUrl(fileId).then(function (url) {
|
|
591
|
+
setThumbnail(url);
|
|
544
592
|
});
|
|
545
593
|
}
|
|
546
594
|
}, [fileId]);
|
|
@@ -557,7 +605,11 @@ var FileItem = function FileItem(_ref) {
|
|
|
557
605
|
className: "filed"
|
|
558
606
|
}, /*#__PURE__*/React.createElement("img", {
|
|
559
607
|
className: "small_img",
|
|
560
|
-
|
|
608
|
+
style: !thumbnail ? {
|
|
609
|
+
width: '30px',
|
|
610
|
+
height: '30px'
|
|
611
|
+
} : {},
|
|
612
|
+
src: thumbnail || fileIcon,
|
|
561
613
|
alt: ""
|
|
562
614
|
}), !disabled && /*#__PURE__*/React.createElement("img", {
|
|
563
615
|
className: "del",
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import _Message from "@alifd/next/es/message";
|
|
2
|
+
import { React, useState, useEffect, useRef } from 'react';
|
|
3
|
+
import { CheckCircleFilled } from '@ant-design/icons';
|
|
4
|
+
import "./checkPoint.scss";
|
|
5
|
+
export default function CheckPoint(props) {
|
|
6
|
+
var _resultData$at, _resultData$at2;
|
|
7
|
+
var checkPointData = props.checkPointData,
|
|
8
|
+
handleClose = props.handleClose;
|
|
9
|
+
var _useState = useState(0),
|
|
10
|
+
resIndex = _useState[0],
|
|
11
|
+
setResIndex = _useState[1];
|
|
12
|
+
var _useState2 = useState(null),
|
|
13
|
+
resIndexData = _useState2[0],
|
|
14
|
+
setResIndexData = _useState2[1];
|
|
15
|
+
var _useState3 = useState([]),
|
|
16
|
+
resultData = _useState3[0],
|
|
17
|
+
setResultData = _useState3[1];
|
|
18
|
+
var _useState4 = useState(0),
|
|
19
|
+
pageHeight = _useState4[0],
|
|
20
|
+
setPageHeight = _useState4[1];
|
|
21
|
+
var imgRef = useRef();
|
|
22
|
+
var initData = function initData() {
|
|
23
|
+
var fileUrl = checkPointData.fileUrl,
|
|
24
|
+
_checkPointData$annot = checkPointData.annotations,
|
|
25
|
+
annotations = _checkPointData$annot === void 0 ? [] : _checkPointData$annot;
|
|
26
|
+
setTimeout(function () {
|
|
27
|
+
var iframe = document.getElementById('file_check_point');
|
|
28
|
+
iframe.src = fileUrl + "#toolbar=0";
|
|
29
|
+
}, 500);
|
|
30
|
+
setResIndexData(annotations[0]);
|
|
31
|
+
// 其中的page可能是乱序的,所以先排序一下
|
|
32
|
+
setResultData(annotations.sort(function (a, b) {
|
|
33
|
+
return a.page - b.page;
|
|
34
|
+
}));
|
|
35
|
+
var clientWidth = document.documentElement.clientWidth;
|
|
36
|
+
var _annotations$ = annotations[0],
|
|
37
|
+
scrollWidth = _annotations$.scrollWidth,
|
|
38
|
+
scrollHeight = _annotations$.scrollHeight;
|
|
39
|
+
var scale = clientWidth / scrollWidth;
|
|
40
|
+
setPageHeight(scrollHeight * scale);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// 获取标识的位置和大小 [方法]
|
|
44
|
+
var getTipDotStyle = function getTipDotStyle(item) {
|
|
45
|
+
var width = item.width,
|
|
46
|
+
height = item.height,
|
|
47
|
+
x = item.x,
|
|
48
|
+
y = item.y,
|
|
49
|
+
scrollWidth = item.scrollWidth,
|
|
50
|
+
scrollHeight = item.scrollHeight,
|
|
51
|
+
page = item.page;
|
|
52
|
+
console.log(width, height, x, y);
|
|
53
|
+
var img = imgRef.current;
|
|
54
|
+
console.log(img, 'refs');
|
|
55
|
+
var clientWidth = document.documentElement.clientWidth;
|
|
56
|
+
console.log('clientWidth-----', clientWidth);
|
|
57
|
+
|
|
58
|
+
// 算出一个系数,来动态生成下面的边框样式
|
|
59
|
+
var scale = clientWidth / scrollWidth;
|
|
60
|
+
|
|
61
|
+
// console.log('原始宽高', sourceImgWidth, sourceImgHeight);
|
|
62
|
+
console.log('原始宽高', scrollWidth, scrollHeight);
|
|
63
|
+
console.log('缩放系数', scale, scale);
|
|
64
|
+
return {
|
|
65
|
+
width: width * scale + 'px',
|
|
66
|
+
height: height * scale + 'px',
|
|
67
|
+
left: x * scale + 'px',
|
|
68
|
+
top: (page - 1) * pageHeight + y * scale + 'px'
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// 上一项(prev),下一项(next) [按钮]
|
|
73
|
+
var handleSwitch = function handleSwitch(state) {
|
|
74
|
+
if (state === 'next' && resIndex === resultData.length - 1) return _Message.notice('没有下一项了');
|
|
75
|
+
if (state === 'prev' && resIndex === 0) return _Message.notice('没有上一项了');
|
|
76
|
+
if (state === 'next') {
|
|
77
|
+
setResIndex(resIndex + 1);
|
|
78
|
+
setResIndexData(resultData[resIndex + 1]);
|
|
79
|
+
}
|
|
80
|
+
if (state === 'prev') {
|
|
81
|
+
setResIndex(resIndex - 1);
|
|
82
|
+
setResIndexData(resultData[resIndex - 1]);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
var checkOneDot = function checkOneDot(item, index) {
|
|
86
|
+
setResIndex(index);
|
|
87
|
+
setResIndexData(item);
|
|
88
|
+
};
|
|
89
|
+
useEffect(function () {
|
|
90
|
+
if (checkPointData) {
|
|
91
|
+
initData();
|
|
92
|
+
}
|
|
93
|
+
}, [checkPointData]);
|
|
94
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
className: "keyPoint-container"
|
|
96
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
97
|
+
className: "tipDot-content",
|
|
98
|
+
style: {
|
|
99
|
+
height: ((_resultData$at = resultData.at(-1)) === null || _resultData$at === void 0 ? void 0 : _resultData$at.page) * pageHeight + 'px'
|
|
100
|
+
}
|
|
101
|
+
}, resultData.map(function (item, index) {
|
|
102
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
103
|
+
className: "tip-item " + (index === resIndex ? 'active' : ''),
|
|
104
|
+
key: index,
|
|
105
|
+
onClick: function onClick() {
|
|
106
|
+
return checkOneDot(item, index);
|
|
107
|
+
},
|
|
108
|
+
style: getTipDotStyle(item)
|
|
109
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
className: "num " + (index === resIndex ? 'active' : '')
|
|
111
|
+
}, index + 1));
|
|
112
|
+
})), resIndexData && /*#__PURE__*/React.createElement("div", {
|
|
113
|
+
className: "result-outter"
|
|
114
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
115
|
+
className: "result-card"
|
|
116
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
117
|
+
className: "result-title"
|
|
118
|
+
}, resIndex + 1, "\u3001", resIndexData.text), /*#__PURE__*/React.createElement("div", {
|
|
119
|
+
className: "result-info"
|
|
120
|
+
}, /*#__PURE__*/React.createElement(CheckCircleFilled, {
|
|
121
|
+
color: "#15bc83",
|
|
122
|
+
size: "20",
|
|
123
|
+
style: {
|
|
124
|
+
color: '#15bc83',
|
|
125
|
+
fontSize: '20px'
|
|
126
|
+
}
|
|
127
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
128
|
+
className: "result-text"
|
|
129
|
+
}, resIndexData.reviewNotes)))), /*#__PURE__*/React.createElement("div", {
|
|
130
|
+
className: "bottom-btn"
|
|
131
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
132
|
+
className: "btn"
|
|
133
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
134
|
+
onClick: handleClose
|
|
135
|
+
}, "\u8FD4\u56DE")), /*#__PURE__*/React.createElement("div", {
|
|
136
|
+
className: "btn"
|
|
137
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
138
|
+
onClick: function onClick() {
|
|
139
|
+
return handleSwitch('prev');
|
|
140
|
+
}
|
|
141
|
+
}, "\u4E0A\u4E00\u9879")), /*#__PURE__*/React.createElement("div", {
|
|
142
|
+
className: "btn btn-blue"
|
|
143
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
144
|
+
onClick: function onClick() {
|
|
145
|
+
return handleSwitch('next');
|
|
146
|
+
}
|
|
147
|
+
}, "\u4E0B\u4E00\u9879"))), /*#__PURE__*/React.createElement("iframe", {
|
|
148
|
+
ref: imgRef,
|
|
149
|
+
id: "file_check_point",
|
|
150
|
+
frameBorder: "0",
|
|
151
|
+
height: "100%",
|
|
152
|
+
width: "100%",
|
|
153
|
+
style: {
|
|
154
|
+
height: ((_resultData$at2 = resultData.at(-1)) === null || _resultData$at2 === void 0 ? void 0 : _resultData$at2.page) * pageHeight + 'px'
|
|
155
|
+
}
|
|
156
|
+
})));
|
|
157
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
.keyPoint-container {
|
|
2
|
+
// position: sticky;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
// margin-top: -56px;
|
|
5
|
+
width: 100vw;
|
|
6
|
+
position: fixed;
|
|
7
|
+
z-index: 999;
|
|
8
|
+
left: 0;
|
|
9
|
+
top: 0;
|
|
10
|
+
background: #919191;
|
|
11
|
+
overflow-y: scroll;
|
|
12
|
+
#file_check_point {
|
|
13
|
+
overflow: visible !important;
|
|
14
|
+
overflow-clip-margin: unset !important;
|
|
15
|
+
}
|
|
16
|
+
.tipDot-content{
|
|
17
|
+
// height: 100vh;
|
|
18
|
+
width: 100%;
|
|
19
|
+
position: absolute;
|
|
20
|
+
top: 0;
|
|
21
|
+
left: 0;
|
|
22
|
+
// overflow: scroll;
|
|
23
|
+
.tip-item{
|
|
24
|
+
position: absolute;
|
|
25
|
+
border-radius: 2px;
|
|
26
|
+
border: 1px solid #15BC83;
|
|
27
|
+
background: rgba(21, 188, 131, 0.1);
|
|
28
|
+
&.active {
|
|
29
|
+
background: rgba(247, 98, 93, 0.1);
|
|
30
|
+
border: 1px solid #F7625D;
|
|
31
|
+
}
|
|
32
|
+
.num{
|
|
33
|
+
width: 20px;
|
|
34
|
+
height: 20px;
|
|
35
|
+
border-radius: 50%;
|
|
36
|
+
font-size: 10px;
|
|
37
|
+
display: flex;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
align-items: center;
|
|
40
|
+
color: #ffffff;
|
|
41
|
+
margin-left: -20px;
|
|
42
|
+
background: #15BC83;
|
|
43
|
+
&.active {
|
|
44
|
+
background: #F7625D;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
.result-outter {
|
|
51
|
+
box-sizing: border-box;
|
|
52
|
+
padding: 0 24px;
|
|
53
|
+
// border: 1px solid red;
|
|
54
|
+
position: fixed;
|
|
55
|
+
width: 100%;
|
|
56
|
+
bottom: 65px;
|
|
57
|
+
left: 0;
|
|
58
|
+
.result-card {
|
|
59
|
+
border-radius: 10px;
|
|
60
|
+
padding: 16px;
|
|
61
|
+
background: #ffffff;
|
|
62
|
+
border: 1px solid #ddd;
|
|
63
|
+
box-shadow: 0px 4px 10px 0px rgba(177, 188, 200, 0.25);
|
|
64
|
+
.result-title {
|
|
65
|
+
color: #333;
|
|
66
|
+
font-size: 14px;
|
|
67
|
+
margin-bottom: 8px;
|
|
68
|
+
}
|
|
69
|
+
.result-info{
|
|
70
|
+
font-size: 14px;
|
|
71
|
+
margin-bottom: 10px;
|
|
72
|
+
display: flex;
|
|
73
|
+
justify-content: flex-start;
|
|
74
|
+
align-items: center;
|
|
75
|
+
gap: 5px;
|
|
76
|
+
// 提示类型: error/judge/pass
|
|
77
|
+
.result-text{
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
}
|
|
83
|
+
.bottom-btn {
|
|
84
|
+
box-sizing: border-box;
|
|
85
|
+
position: fixed;
|
|
86
|
+
bottom: 0;
|
|
87
|
+
left: 0;
|
|
88
|
+
width: 100%;
|
|
89
|
+
background-color: #fff;
|
|
90
|
+
padding: 11px 0;
|
|
91
|
+
display: flex;
|
|
92
|
+
box-shadow: 0px 2px 16px 0px rgba(0, 0, 0, 0.1);
|
|
93
|
+
z-index: 200;
|
|
94
|
+
.btn {
|
|
95
|
+
margin: 0 10px;
|
|
96
|
+
flex: 1;
|
|
97
|
+
color: #323233;
|
|
98
|
+
background-color: #fff;
|
|
99
|
+
border-color: #ebedf0;
|
|
100
|
+
border-width: 1px;
|
|
101
|
+
border-style: solid;
|
|
102
|
+
border-radius: 100px;
|
|
103
|
+
padding: 0 12px;
|
|
104
|
+
font-size: 14px;
|
|
105
|
+
height: 40px;
|
|
106
|
+
position: relative;
|
|
107
|
+
align-items: center;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-direction: row;
|
|
111
|
+
box-sizing: border-box;
|
|
112
|
+
flex-direction: row;
|
|
113
|
+
}
|
|
114
|
+
.btn-blue {
|
|
115
|
+
color: white;
|
|
116
|
+
border-width: 0px;
|
|
117
|
+
background-image: linear-gradient(rgb(22, 120, 255), rgb(118, 173, 250));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|