ydb-components-material 0.1.139 → 0.1.141

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/build/docs/404.html +3 -3
  2. package/build/docs/_demos/:uuid +3 -3
  3. package/build/docs/colorful-button.html +3 -3
  4. package/build/docs/colorful-input.html +3 -3
  5. package/build/docs/index.html +3 -3
  6. package/build/docs/{umi.e7fd5197.js → umi.cd30b05c.js} +1 -1
  7. package/build/docs/~demos/:uuid.html +3 -3
  8. package/build/docs/~demos/colorful-button-demo.html +3 -3
  9. package/build/docs/~demos/colorful-input-demo.html +3 -3
  10. package/build/lowcode/assets-daily.json +11 -11
  11. package/build/lowcode/assets-dev.json +2 -2
  12. package/build/lowcode/assets-prod.json +11 -11
  13. package/build/lowcode/index.js +1 -1
  14. package/build/lowcode/meta.js +1 -1
  15. package/build/lowcode/render/default/view.js +1 -1
  16. package/build/lowcode/view.js +1 -1
  17. package/dist/BizComps.js +1 -1
  18. package/dist/BizComps.js.map +1 -1
  19. package/es/components/file-list/index.d.ts +2 -0
  20. package/es/components/file-list/index.js +39 -15
  21. package/es/components/file-list/item.d.ts +3 -0
  22. package/es/components/file-list/item.js +200 -117
  23. package/es/components/file-list/sign.js +13 -87
  24. package/es/components/file-list/signUtil.js +20 -4
  25. package/lib/components/file-list/index.d.ts +2 -0
  26. package/lib/components/file-list/index.js +38 -13
  27. package/lib/components/file-list/item.d.ts +3 -0
  28. package/lib/components/file-list/item.js +199 -116
  29. package/lib/components/file-list/sign.js +11 -85
  30. package/lib/components/file-list/signUtil.js +20 -4
  31. package/lowcode/file-list/meta.ts +29 -0
  32. package/lowcode_es/file-list/meta.js +27 -0
  33. package/lowcode_es/meta.js +1 -1
  34. package/lowcode_lib/file-list/meta.js +27 -0
  35. package/lowcode_lib/meta.js +1 -1
  36. package/package.json +3 -3
@@ -15,6 +15,8 @@ export interface FileListProps {
15
15
  isPC?: boolean;
16
16
  disabled?: boolean;
17
17
  style?: object;
18
+ parentPageUrl?: string;
19
+ toSign?: (url: string) => void;
18
20
  download: (value: any) => void;
19
21
  openLoading: () => void;
20
22
  closeLoading: () => void;
@@ -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";
@@ -49,18 +48,34 @@ var FileList = function FileList(_ref) {
49
48
  valChange = _ref.valChange,
50
49
  saveSignerInfo = _ref.saveSignerInfo,
51
50
  applySeal = _ref.applySeal,
52
- signInfoMap = _ref.signInfoMap;
53
- var _useState = useState(false),
54
- showMerge = _useState[0],
55
- setShowMerge = _useState[1];
56
- var _useState2 = useState({
51
+ signInfoMap = _ref.signInfoMap,
52
+ parentPageUrl = _ref.parentPageUrl,
53
+ toSign = _ref.toSign;
54
+ var _useState = useState(fileList),
55
+ fileArray = _useState[0],
56
+ setFileArray = _useState[1];
57
+ useEffect(function () {
58
+ var stored = localStorage.getItem(tokenTY);
59
+ console.log('fileList-stored', stored);
60
+ if (stored) {
61
+ try {
62
+ setFileArray(JSON.parse(stored));
63
+ } catch (e) {}
64
+ } else {
65
+ setFileArray(fileList);
66
+ }
67
+ }, [fileList]);
68
+ var _useState2 = useState(false),
69
+ showMerge = _useState2[0],
70
+ setShowMerge = _useState2[1];
71
+ var _useState3 = useState({
57
72
  materialName: '',
58
73
  fileList: [],
59
74
  index: 0,
60
75
  subIndex: 0
61
76
  }),
62
- curMerge = _useState2[0],
63
- setCurMerge = _useState2[1];
77
+ curMerge = _useState3[0],
78
+ setCurMerge = _useState3[1];
64
79
  var convertNumbersToChinese = function convertNumbersToChinese(str) {
65
80
  // 定义基础映射关系
66
81
  var digitMap = {
@@ -98,13 +113,13 @@ var FileList = function FileList(_ref) {
98
113
 
99
114
  // 拼接材料的提示文案 - 二级材料
100
115
  var getTipTextForSubMaterial = function getTipTextForSubMaterial(item, index, subIndex) {
101
- var subMaterials = fileList[index].subMaterials;
116
+ var subMaterials = fileArray[index].subMaterials;
102
117
  console.log('getTipTextForSubMaterial', item, index, subIndex);
103
118
  console.log('subMaterials', subMaterials);
104
119
  var materialSize = item.materialSize,
105
120
  materialSpec = item.materialSpec,
106
121
  materialType = item.materialType;
107
- var groupId = fileList[index].subMaterials[subIndex].groupId;
122
+ var groupId = fileArray[index].subMaterials[subIndex].groupId;
108
123
  if (!materialSpec) return '';
109
124
  var formatText = materialSpec.split(',').map(function (i) {
110
125
  return MATERIAL_FORMAT[i];
@@ -146,7 +161,7 @@ var FileList = function FileList(_ref) {
146
161
  var handleChange = function handleChange(value, fileIndex, index, subIndex) {
147
162
  console.log('handleChange', value, fileIndex, index, subIndex);
148
163
  // 先找到一级目录
149
- var oneLevelItem = fileList[index];
164
+ var oneLevelItem = fileArray[index];
150
165
  // 如果subIndex有值。再去找一下二级目录
151
166
  if (subIndex !== undefined) {
152
167
  // value为空,说明删除了
@@ -192,8 +207,9 @@ var FileList = function FileList(_ref) {
192
207
  }
193
208
  }
194
209
  }
195
- console.log('fileList--------res', fileList);
196
- valChange(fileList);
210
+ console.log('fileList--------res', fileArray);
211
+ valChange(fileArray);
212
+ setFileArray([].concat(fileArray));
197
213
  };
198
214
 
199
215
  // 如果 文件列表中都是图片,且数量大于1 判断需要合并
@@ -224,7 +240,7 @@ var FileList = function FileList(_ref) {
224
240
  style: _extends({}, style, {
225
241
  width: '100%'
226
242
  })
227
- }, fileList.map(function (item, index) {
243
+ }, fileArray.map(function (item, index) {
228
244
  return /*#__PURE__*/React.createElement("div", {
229
245
  className: "file_level_one"
230
246
  }, /*#__PURE__*/React.createElement("div", {
@@ -278,11 +294,13 @@ var FileList = function FileList(_ref) {
278
294
  className: "tip"
279
295
  }, getTipTextForSubMaterial(item, index, subIndex)), child.fileList.map(function (file, i) {
280
296
  return /*#__PURE__*/React.createElement(FileItem, {
297
+ key: file.fileId || i,
281
298
  index: index,
282
299
  subIndex: subIndex,
283
300
  fileIndex: i,
284
301
  file: file,
285
302
  fileConfig: child,
303
+ fileList: fileArray,
286
304
  maxFileSize: item.materialSize,
287
305
  spec: item.materialSpec,
288
306
  userInfo: userInfo,
@@ -300,6 +318,8 @@ var FileList = function FileList(_ref) {
300
318
  valChange: handleChange,
301
319
  openLoading: openLoading,
302
320
  closeLoading: closeLoading,
321
+ parentPageUrl: parentPageUrl,
322
+ toSign: toSign,
303
323
  saveSignerInfo: saveSignerInfo,
304
324
  style: {
305
325
  marginBottom: '12px'
@@ -310,12 +330,14 @@ var FileList = function FileList(_ref) {
310
330
  className: "tip"
311
331
  }, getTipText(item)), item.fileList.map(function (file, i) {
312
332
  return /*#__PURE__*/React.createElement(FileItem, {
333
+ key: file.fileId || i,
313
334
  index: index,
314
335
  fileIndex: i,
315
336
  signerInfo: signerInfo || {},
316
337
  signInfoMap: signInfoMap,
317
338
  file: file,
318
339
  fileConfig: item,
340
+ fileList: fileArray,
319
341
  maxFileSize: item.materialSize,
320
342
  spec: item.materialSpec,
321
343
  userInfo: userInfo,
@@ -325,12 +347,14 @@ var FileList = function FileList(_ref) {
325
347
  baseUrl: baseUrl,
326
348
  env: env,
327
349
  isPC: isPC,
350
+ toSign: toSign,
328
351
  disabled: disabled,
329
352
  download: download,
330
353
  applySeal: applySeal,
331
354
  valChange: handleChange,
332
355
  openLoading: openLoading,
333
356
  closeLoading: closeLoading,
357
+ parentPageUrl: parentPageUrl,
334
358
  saveSignerInfo: saveSignerInfo,
335
359
  style: {
336
360
  marginBottom: '12px'
@@ -19,6 +19,9 @@ export interface FileItemProps {
19
19
  userInfo: object;
20
20
  style?: object;
21
21
  signerInfo?: object;
22
+ fileList: Array<object>;
23
+ parentPageUrl?: string;
24
+ toSign?: (url: string) => void;
22
25
  openLoading: () => void;
23
26
  applySeal: () => void;
24
27
  closeLoading: () => void;