ydb-components-material 0.1.139 → 0.1.140
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.e7fd5197.js → umi.eb9ae16b.js} +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/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/dist/BizComps.js +1 -1
- package/dist/BizComps.js.map +1 -1
- package/es/components/file-list/index.js +32 -14
- package/es/components/file-list/item.d.ts +1 -0
- package/es/components/file-list/item.js +195 -116
- package/es/components/file-list/sign.js +8 -87
- package/es/components/file-list/signUtil.js +20 -4
- package/lib/components/file-list/index.js +31 -12
- package/lib/components/file-list/item.d.ts +1 -0
- package/lib/components/file-list/item.js +194 -115
- package/lib/components/file-list/sign.js +6 -85
- package/lib/components/file-list/signUtil.js +20 -4
- package/lowcode_es/meta.js +1 -1
- package/lowcode_lib/meta.js +1 -1
- package/package.json +3 -3
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _Balloon from "@alifd/next/es/balloon";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { useState } from 'react';
|
|
3
|
+
import React, { useEffect, useState } from 'react';
|
|
5
4
|
import { getFileExtension } from "./file.js";
|
|
6
5
|
import Merge from "./merge";
|
|
7
6
|
import FileItem from "./item";
|
|
@@ -50,17 +49,31 @@ var FileList = function FileList(_ref) {
|
|
|
50
49
|
saveSignerInfo = _ref.saveSignerInfo,
|
|
51
50
|
applySeal = _ref.applySeal,
|
|
52
51
|
signInfoMap = _ref.signInfoMap;
|
|
53
|
-
var _useState = useState(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
var _useState = useState(fileList),
|
|
53
|
+
fileArray = _useState[0],
|
|
54
|
+
setFileArray = _useState[1];
|
|
55
|
+
useEffect(function () {
|
|
56
|
+
var stored = localStorage.getItem(tokenTY);
|
|
57
|
+
console.log('fileList-stored', stored);
|
|
58
|
+
if (stored) {
|
|
59
|
+
try {
|
|
60
|
+
setFileArray(JSON.parse(stored));
|
|
61
|
+
} catch (e) {}
|
|
62
|
+
} else {
|
|
63
|
+
setFileArray(fileList);
|
|
64
|
+
}
|
|
65
|
+
}, [fileList]);
|
|
66
|
+
var _useState2 = useState(false),
|
|
67
|
+
showMerge = _useState2[0],
|
|
68
|
+
setShowMerge = _useState2[1];
|
|
69
|
+
var _useState3 = useState({
|
|
57
70
|
materialName: '',
|
|
58
71
|
fileList: [],
|
|
59
72
|
index: 0,
|
|
60
73
|
subIndex: 0
|
|
61
74
|
}),
|
|
62
|
-
curMerge =
|
|
63
|
-
setCurMerge =
|
|
75
|
+
curMerge = _useState3[0],
|
|
76
|
+
setCurMerge = _useState3[1];
|
|
64
77
|
var convertNumbersToChinese = function convertNumbersToChinese(str) {
|
|
65
78
|
// 定义基础映射关系
|
|
66
79
|
var digitMap = {
|
|
@@ -98,13 +111,13 @@ var FileList = function FileList(_ref) {
|
|
|
98
111
|
|
|
99
112
|
// 拼接材料的提示文案 - 二级材料
|
|
100
113
|
var getTipTextForSubMaterial = function getTipTextForSubMaterial(item, index, subIndex) {
|
|
101
|
-
var subMaterials =
|
|
114
|
+
var subMaterials = fileArray[index].subMaterials;
|
|
102
115
|
console.log('getTipTextForSubMaterial', item, index, subIndex);
|
|
103
116
|
console.log('subMaterials', subMaterials);
|
|
104
117
|
var materialSize = item.materialSize,
|
|
105
118
|
materialSpec = item.materialSpec,
|
|
106
119
|
materialType = item.materialType;
|
|
107
|
-
var groupId =
|
|
120
|
+
var groupId = fileArray[index].subMaterials[subIndex].groupId;
|
|
108
121
|
if (!materialSpec) return '';
|
|
109
122
|
var formatText = materialSpec.split(',').map(function (i) {
|
|
110
123
|
return MATERIAL_FORMAT[i];
|
|
@@ -146,7 +159,7 @@ var FileList = function FileList(_ref) {
|
|
|
146
159
|
var handleChange = function handleChange(value, fileIndex, index, subIndex) {
|
|
147
160
|
console.log('handleChange', value, fileIndex, index, subIndex);
|
|
148
161
|
// 先找到一级目录
|
|
149
|
-
var oneLevelItem =
|
|
162
|
+
var oneLevelItem = fileArray[index];
|
|
150
163
|
// 如果subIndex有值。再去找一下二级目录
|
|
151
164
|
if (subIndex !== undefined) {
|
|
152
165
|
// value为空,说明删除了
|
|
@@ -192,8 +205,9 @@ var FileList = function FileList(_ref) {
|
|
|
192
205
|
}
|
|
193
206
|
}
|
|
194
207
|
}
|
|
195
|
-
console.log('fileList--------res',
|
|
196
|
-
valChange(
|
|
208
|
+
console.log('fileList--------res', fileArray);
|
|
209
|
+
valChange(fileArray);
|
|
210
|
+
setFileArray([].concat(fileArray));
|
|
197
211
|
};
|
|
198
212
|
|
|
199
213
|
// 如果 文件列表中都是图片,且数量大于1 判断需要合并
|
|
@@ -224,7 +238,7 @@ var FileList = function FileList(_ref) {
|
|
|
224
238
|
style: _extends({}, style, {
|
|
225
239
|
width: '100%'
|
|
226
240
|
})
|
|
227
|
-
},
|
|
241
|
+
}, fileArray.map(function (item, index) {
|
|
228
242
|
return /*#__PURE__*/React.createElement("div", {
|
|
229
243
|
className: "file_level_one"
|
|
230
244
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -278,11 +292,13 @@ var FileList = function FileList(_ref) {
|
|
|
278
292
|
className: "tip"
|
|
279
293
|
}, getTipTextForSubMaterial(item, index, subIndex)), child.fileList.map(function (file, i) {
|
|
280
294
|
return /*#__PURE__*/React.createElement(FileItem, {
|
|
295
|
+
key: file.fileId || i,
|
|
281
296
|
index: index,
|
|
282
297
|
subIndex: subIndex,
|
|
283
298
|
fileIndex: i,
|
|
284
299
|
file: file,
|
|
285
300
|
fileConfig: child,
|
|
301
|
+
fileList: fileArray,
|
|
286
302
|
maxFileSize: item.materialSize,
|
|
287
303
|
spec: item.materialSpec,
|
|
288
304
|
userInfo: userInfo,
|
|
@@ -310,12 +326,14 @@ var FileList = function FileList(_ref) {
|
|
|
310
326
|
className: "tip"
|
|
311
327
|
}, getTipText(item)), item.fileList.map(function (file, i) {
|
|
312
328
|
return /*#__PURE__*/React.createElement(FileItem, {
|
|
329
|
+
key: file.fileId || i,
|
|
313
330
|
index: index,
|
|
314
331
|
fileIndex: i,
|
|
315
332
|
signerInfo: signerInfo || {},
|
|
316
333
|
signInfoMap: signInfoMap,
|
|
317
334
|
file: file,
|
|
318
335
|
fileConfig: item,
|
|
336
|
+
fileList: fileArray,
|
|
319
337
|
maxFileSize: item.materialSize,
|
|
320
338
|
spec: item.materialSpec,
|
|
321
339
|
userInfo: userInfo,
|