ydb-components-material 0.1.87 → 0.1.88

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 (94) 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.507b3306.css → umi.666eb3a7.css} +1 -1
  7. package/build/docs/umi.f5d91602.js +1 -0
  8. package/build/docs/~demos/:uuid.html +3 -3
  9. package/build/docs/~demos/colorful-button-demo.html +3 -3
  10. package/build/docs/~demos/colorful-input-demo.html +3 -3
  11. package/build/lowcode/assets-daily.json +11 -11
  12. package/build/lowcode/assets-dev.json +2 -2
  13. package/build/lowcode/assets-prod.json +11 -11
  14. package/build/lowcode/index.js +1 -1
  15. package/build/lowcode/meta.js +1 -1
  16. package/build/lowcode/preview.js +9 -9
  17. package/build/lowcode/render/default/view.css +1 -1
  18. package/build/lowcode/render/default/view.js +55 -2
  19. package/build/lowcode/view.css +1 -1
  20. package/build/lowcode/view.js +55 -2
  21. package/dist/BizComps.css +1 -1
  22. package/dist/BizComps.js +58 -5
  23. package/dist/BizComps.js.map +1 -1
  24. package/es/components/file-list/checkPoint.d.ts +3 -0
  25. package/es/components/file-list/checkPoint.js +157 -0
  26. package/es/components/file-list/checkPoint.scss +120 -0
  27. package/es/components/file-list/file.js +295 -0
  28. package/es/components/file-list/icon/checked.svg +1 -0
  29. package/es/components/file-list/icon/close.svg +1 -0
  30. package/es/components/file-list/icon/del.svg +1 -0
  31. package/es/components/file-list/icon/download.svg +1 -0
  32. package/es/components/file-list/icon/download_pc.svg +1 -0
  33. package/es/components/file-list/icon/file.svg +1 -0
  34. package/es/components/file-list/icon/icon_errorMsg.svg +1 -0
  35. package/es/components/file-list/icon/icon_warning.svg +1 -0
  36. package/es/components/file-list/icon/preview.svg +1 -0
  37. package/es/components/file-list/icon/preview_pc.svg +1 -0
  38. package/es/components/file-list/icon/upload.svg +1 -0
  39. package/es/components/file-list/icon/view.svg +1 -0
  40. package/es/components/file-list/index.d.ts +21 -0
  41. package/es/components/file-list/index.js +222 -0
  42. package/es/components/file-list/index.scss +36 -0
  43. package/es/components/file-list/item.d.ts +27 -0
  44. package/es/components/file-list/item.js +802 -0
  45. package/es/components/file-list/item.scss +412 -0
  46. package/es/components/file-list/seal.d.ts +3 -0
  47. package/es/components/file-list/seal.js +222 -0
  48. package/es/components/file-list/sealUtil.js +252 -0
  49. package/es/components/file-list/sign.d.ts +3 -0
  50. package/es/components/file-list/sign.js +138 -0
  51. package/es/components/file-list/signUtil.js +369 -0
  52. package/es/index.d.ts +2 -0
  53. package/es/index.js +1 -0
  54. package/lib/components/file-list/checkPoint.d.ts +3 -0
  55. package/lib/components/file-list/checkPoint.js +162 -0
  56. package/lib/components/file-list/checkPoint.scss +120 -0
  57. package/lib/components/file-list/file.js +306 -0
  58. package/lib/components/file-list/icon/checked.svg +1 -0
  59. package/lib/components/file-list/icon/close.svg +1 -0
  60. package/lib/components/file-list/icon/del.svg +1 -0
  61. package/lib/components/file-list/icon/download.svg +1 -0
  62. package/lib/components/file-list/icon/download_pc.svg +1 -0
  63. package/lib/components/file-list/icon/file.svg +1 -0
  64. package/lib/components/file-list/icon/icon_errorMsg.svg +1 -0
  65. package/lib/components/file-list/icon/icon_warning.svg +1 -0
  66. package/lib/components/file-list/icon/preview.svg +1 -0
  67. package/lib/components/file-list/icon/preview_pc.svg +1 -0
  68. package/lib/components/file-list/icon/upload.svg +1 -0
  69. package/lib/components/file-list/icon/view.svg +1 -0
  70. package/lib/components/file-list/index.d.ts +21 -0
  71. package/lib/components/file-list/index.js +227 -0
  72. package/lib/components/file-list/index.scss +36 -0
  73. package/lib/components/file-list/item.d.ts +27 -0
  74. package/lib/components/file-list/item.js +808 -0
  75. package/lib/components/file-list/item.scss +412 -0
  76. package/lib/components/file-list/seal.d.ts +3 -0
  77. package/lib/components/file-list/seal.js +228 -0
  78. package/lib/components/file-list/sealUtil.js +254 -0
  79. package/lib/components/file-list/sign.d.ts +3 -0
  80. package/lib/components/file-list/sign.js +144 -0
  81. package/lib/components/file-list/signUtil.js +371 -0
  82. package/lib/index.d.ts +2 -0
  83. package/lib/index.js +3 -1
  84. package/lowcode/file-list/meta.ts +231 -0
  85. package/lowcode_es/_setter/IconSelectSetter.js +1 -1
  86. package/lowcode_es/file-list/meta.d.ts +22 -0
  87. package/lowcode_es/file-list/meta.js +213 -0
  88. package/lowcode_es/meta.js +3 -2
  89. package/lowcode_lib/_setter/IconSelectSetter.js +1 -1
  90. package/lowcode_lib/file-list/meta.d.ts +22 -0
  91. package/lowcode_lib/file-list/meta.js +218 -0
  92. package/lowcode_lib/meta.js +14 -13
  93. package/package.json +6 -4
  94. package/build/docs/umi.5298404d.js +0 -1
@@ -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="14" height="14" viewBox="0 0 14 14"><g><g><rect x="0" y="5.958888053894043" width="14" height="2.0841517448425293" rx="1.0420758724212646" fill="#1678FF" fill-opacity="1"/><g transform="matrix(0,1,-1,0,8.041714668273926,-8.041714668273926)"><rect x="8.041714668273926" y="0" width="14" height="2.0841517448425293" rx="1.0420758724212646" fill="#1678FF" fill-opacity="1"/></g></g></g></svg>
@@ -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="16" viewBox="0 0 16 16"><defs><clipPath id="master_svg0_141_32160"><rect x="0" y="0" width="16" height="16" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_141_32160)"><g><path d="M15.949896,7.7555661C16.016703,7.9388962,16.016703,8.0611272,15.949896,8.2444577C15.949896,8.2444577,15.883092,8.4277883,15.816283,8.4888978C15.749479,8.6722283,15.615868,8.8555694,15.482255,9.0999985C15.148229,9.5888891,14.680583,10.2000132,14.012527,10.8722239C12.743215,12.1555681,10.739035,13.5,8,13.5C5.2609663,13.5,3.2567897,12.1555681,1.987474,10.8722239C1.319415,10.2000132,0.85177505,9.5888891,0.51774478,9.0999985C0.51774478,9.0999985,0.18371604,8.4888978,0.18371604,8.4888978C0.11691014,8.4277883,0.050104432,8.2444577,0.050104432,8.2444577C-0.016701477,8.1222262,-0.016701477,7.9388962,0.050104432,7.7555661C0.050104432,7.7555661,0.1169103,7.5722361,0.18371604,7.5111141C0.25052202,7.3277841,0.38413364,7.1444426,0.51774478,6.9000139C0.85177356,6.4111221,1.319415,5.8000102,1.987474,5.127788799999999C3.2567489,3.8444551000000002,5.2609239,2.5,7.9999585,2.5C10.738992,2.5,12.743169,3.8444551000000002,14.012487,5.127788799999999C14.680545,5.8000102,15.148186,6.4111221,15.482213,6.900003C15.482213,6.900003,15.816243,7.5111032,15.816243,7.5111032C15.883049,7.5722246,15.949852,7.7555661,15.949852,7.7555661C15.949852,7.7555661,15.949896,7.7555661,15.949896,7.7555661ZM8.0000048,5.8000102C9.2025099,5.8000102,10.271409,6.7777824,10.271409,8.0000286C10.271409,9.22223,9.2025127,10.2000132,8.0000048,10.2000132C6.7974997,10.2000132,5.728601,9.22223,5.728601,8.0000286C5.728601,6.7777824,6.7974944,5.8000102,8.0000048,5.8000102C8.0000048,5.8000102,8.0000048,5.8000102,8.0000048,5.8000102ZM4.3924899,8.0000286C4.3924899,9.833352600000001,5.9958301,11.4222136,8.0000048,11.4222136C10.004179,11.4222136,11.607521,9.833352600000001,11.607521,8.0000286C11.607521,6.1666818,10.004179,4.5777981,8.0000048,4.5777981C5.9958305,4.5777981,4.3924899,6.1666818,4.3924899,8.0000286C4.3924899,8.0000286,4.3924899,8.0000286,4.3924899,8.0000286Z" fill="#1678FF" fill-opacity="1" style="mix-blend-mode:passthrough"/></g></g></svg>
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ export interface FileListProps {
4
+ /**
5
+ * 列表数据
6
+ */
7
+ fileList: Array<object>;
8
+ token: string;
9
+ tokenTY: string;
10
+ accessToken: string;
11
+ userInfo: object;
12
+ baseUrl: string;
13
+ env: string;
14
+ isPC?: boolean;
15
+ disabled?: boolean;
16
+ style?: object;
17
+ download: (value: any) => void;
18
+ valChange: (value: any) => void;
19
+ }
20
+ declare const FileList: React.FC<FileListProps>;
21
+ export default FileList;
@@ -0,0 +1,222 @@
1
+ import React from 'react';
2
+ import FileItem from "./item";
3
+ import "./index.scss";
4
+ var MATERIAL_TYPE = {
5
+ 1: '原件',
6
+ 2: '复印件',
7
+ 3: '原件或复印件',
8
+ 4: '有电子签章的电子证照',
9
+ 5: '证照扫描件'
10
+ };
11
+ var MATERIAL_FORMAT = {
12
+ 1: 'doc',
13
+ 2: 'docx',
14
+ 3: 'ofd',
15
+ 4: 'pdf',
16
+ 5: 'xlsx',
17
+ 6: 'xls',
18
+ 7: 'png',
19
+ 8: 'jpg',
20
+ 9: 'jpeg',
21
+ 10: 'gif',
22
+ 11: 'bmp',
23
+ 12: 'zip',
24
+ 13: 'rar',
25
+ 14: 'mp3',
26
+ 15: 'mp4',
27
+ 16: 'xml'
28
+ };
29
+ var FileList = function FileList(_ref) {
30
+ var fileList = _ref.fileList,
31
+ token = _ref.token,
32
+ tokenTY = _ref.tokenTY,
33
+ accessToken = _ref.accessToken,
34
+ userInfo = _ref.userInfo,
35
+ baseUrl = _ref.baseUrl,
36
+ env = _ref.env,
37
+ isPC = _ref.isPC,
38
+ disabled = _ref.disabled,
39
+ isShowLib = _ref.isShowLib,
40
+ style = _ref.style,
41
+ download = _ref.download,
42
+ valChange = _ref.valChange;
43
+ var convertNumbersToChinese = function convertNumbersToChinese(str) {
44
+ // 定义基础映射关系
45
+ var digitMap = {
46
+ '0': '〇',
47
+ '1': '一',
48
+ '2': '二',
49
+ '3': '三',
50
+ '4': '四',
51
+ '5': '五',
52
+ '6': '六',
53
+ '7': '七',
54
+ '8': '八',
55
+ '9': '九'
56
+ };
57
+
58
+ // 使用正则表达式全局匹配所有数字字符并进行替换
59
+ return String(str).replace(/\d/g, function (matchedDigit) {
60
+ return digitMap[matchedDigit];
61
+ }) + '、';
62
+ };
63
+
64
+ // 拼接材料的提示文案 - 一级材料
65
+ var getTipText = function getTipText(item) {
66
+ console.log('getTipText', item);
67
+ var materialSize = item.materialSize,
68
+ materialSpec = item.materialSpec,
69
+ materialType = item.materialType;
70
+ if (!materialSpec) return '';
71
+ var formatText = materialSpec.split(',').map(function (i) {
72
+ return MATERIAL_FORMAT[i];
73
+ }).join('、');
74
+ var sizeText = materialSize ? "\u5355\u4E2A\u4E0D\u8D85\u8FC7\u3010" + materialSize + "MB\u3011" : '';
75
+ return "\u9700\u4E0A\u4F20\u3010" + MATERIAL_TYPE[materialType] + "\u3011\uFF0C\u652F\u6301\u3010" + formatText + "\u3011\u683C\u5F0F\u3002" + sizeText;
76
+ };
77
+
78
+ // 拼接材料的提示文案 - 二级材料
79
+ var getTipTextForSubMaterial = function getTipTextForSubMaterial(item, index, subIndex) {
80
+ var subMaterials = fileList[index].subMaterials;
81
+ console.log('getTipTextForSubMaterial', item, index, subIndex);
82
+ console.log('subMaterials', subMaterials);
83
+ var materialSize = item.materialSize,
84
+ materialSpec = item.materialSpec,
85
+ materialType = item.materialType;
86
+ var groupId = fileList[index].subMaterials[subIndex].groupId;
87
+ if (!materialSpec) return '';
88
+ var formatText = materialSpec.split(',').map(function (i) {
89
+ return MATERIAL_FORMAT[i];
90
+ }).join('、');
91
+ var sameGroupIdMaterials = subMaterials.filter(function (m) {
92
+ return m.groupId === groupId;
93
+ });
94
+ var materialNames = sameGroupIdMaterials.map(function (m) {
95
+ return m.materialName;
96
+ });
97
+ var text = '';
98
+ if (materialNames.length > 1) {
99
+ text = "\u3010" + materialNames.join('和') + "\u3011\u81F3\u5C11\u4E0A\u4F20\u4E00\u4EFD\uFF0C";
100
+ }
101
+ var sizeText = materialSize ? "\u5355\u4E2A\u4E0D\u8D85\u8FC7\u3010" + materialSize + "MB\u3011" : '';
102
+ console.log('text', sizeText);
103
+ return text + "\u9700\u4E0A\u4F20\u3010" + MATERIAL_TYPE[materialType] + "\u3011\uFF0C\u652F\u6301\u3010" + formatText + "\u3011\u683C\u5F0F\u3002" + sizeText;
104
+ };
105
+ var handleChange = function handleChange(value, fileIndex, index, subIndex) {
106
+ console.log('handleChange', value, fileIndex, index, subIndex);
107
+ // 先找到一级目录
108
+ var oneLevelItem = fileList[index];
109
+ // 如果subIndex有值。再去找一下二级目录
110
+ if (subIndex !== undefined) {
111
+ // value为空,说明删除了
112
+ if (!value) {
113
+ // 如果当前文件list中只有一个文件,还得补个空的
114
+ if (oneLevelItem.subMaterials[subIndex].fileList.length === 1) {
115
+ oneLevelItem.subMaterials[subIndex].fileList = [{
116
+ fileId: ''
117
+ }];
118
+ } else {
119
+ oneLevelItem.subMaterials[subIndex].fileList.splice(fileIndex, 1);
120
+ }
121
+ } else {
122
+ // 如果当前这个位置的fileId是空的。说明这次修改是新增
123
+ var isAdd = !oneLevelItem.subMaterials[subIndex].fileList[fileIndex].fileId;
124
+ oneLevelItem.subMaterials[subIndex].fileList[fileIndex] = value;
125
+ if (isAdd && oneLevelItem.subMaterials[subIndex].fileList.length < 10) {
126
+ oneLevelItem.subMaterials[subIndex].fileList.push({
127
+ fileId: ''
128
+ });
129
+ }
130
+ }
131
+ } else {
132
+ if (!value) {
133
+ oneLevelItem.fileList.splice(fileIndex, 1);
134
+ if (oneLevelItem.fileList.length === 0) {
135
+ oneLevelItem.fileList.push({
136
+ fileId: ''
137
+ });
138
+ }
139
+ } else {
140
+ // 如果当前这个位置的fileId是空的。说明这次修改是新增
141
+ var _isAdd = !oneLevelItem.fileList[fileIndex].fileId;
142
+ oneLevelItem.fileList[fileIndex] = value;
143
+ if (_isAdd && oneLevelItem.fileList.length < 10) {
144
+ oneLevelItem.fileList.push({
145
+ fileId: ''
146
+ });
147
+ }
148
+ }
149
+ }
150
+ console.log('fileList--------res', fileList);
151
+ valChange(fileList);
152
+ };
153
+ return /*#__PURE__*/React.createElement("div", {
154
+ className: "file_list",
155
+ style: style
156
+ }, fileList.map(function (item, index) {
157
+ return /*#__PURE__*/React.createElement("div", {
158
+ className: "file_level_one"
159
+ }, /*#__PURE__*/React.createElement("p", {
160
+ className: "name_level_one"
161
+ }, convertNumbersToChinese(index + 1), item.materialName), item.subMaterials && item.subMaterials.length > 0 ? /*#__PURE__*/React.createElement("div", {
162
+ className: "file_level_two"
163
+ }, item.subMaterials.map(function (child, subIndex) {
164
+ return /*#__PURE__*/React.createElement("div", {
165
+ className: "file_level_two_item"
166
+ }, /*#__PURE__*/React.createElement("p", {
167
+ className: "name_level_two"
168
+ }, subIndex + 1, "\u3001", child.materialName), /*#__PURE__*/React.createElement("p", {
169
+ className: "tip"
170
+ }, getTipTextForSubMaterial(item, index, subIndex)), child.fileList.map(function (file, i) {
171
+ return /*#__PURE__*/React.createElement(FileItem, {
172
+ index: index,
173
+ subIndex: subIndex,
174
+ fileIndex: i,
175
+ file: file,
176
+ fileConfig: child,
177
+ maxFileSize: item.materialSize,
178
+ spec: item.materialSpec,
179
+ userInfo: userInfo,
180
+ token: token,
181
+ tokenTY: tokenTY,
182
+ accessToken: accessToken,
183
+ baseUrl: baseUrl,
184
+ env: env,
185
+ isPC: isPC,
186
+ disabled: disabled,
187
+ download: download,
188
+ valChange: handleChange,
189
+ style: {
190
+ marginBottom: '12px'
191
+ }
192
+ });
193
+ }));
194
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", {
195
+ className: "tip"
196
+ }, getTipText(item)), item.fileList.map(function (file, i) {
197
+ return /*#__PURE__*/React.createElement(FileItem, {
198
+ index: index,
199
+ fileIndex: i,
200
+ file: file,
201
+ fileConfig: item,
202
+ maxFileSize: item.materialSize,
203
+ spec: item.materialSpec,
204
+ isShowLib: isShowLib,
205
+ userInfo: userInfo,
206
+ token: token,
207
+ tokenTY: tokenTY,
208
+ accessToken: accessToken,
209
+ baseUrl: baseUrl,
210
+ env: env,
211
+ isPC: isPC,
212
+ disabled: disabled,
213
+ download: download,
214
+ valChange: handleChange,
215
+ style: {
216
+ marginBottom: '12px'
217
+ }
218
+ });
219
+ })));
220
+ }));
221
+ };
222
+ export default FileList;
@@ -0,0 +1,36 @@
1
+ .file_list {
2
+ .file_level_one {
3
+ background: #ffffff;
4
+ border-radius: 8px;
5
+ padding: 16px 12px;
6
+ margin-bottom: 12px;
7
+
8
+ .tip {
9
+ font-size: 12px;
10
+ color: #999999;
11
+ margin-top: 8px;
12
+ }
13
+
14
+ .name_level_one {
15
+ font-size: 15px;
16
+ font-weight: 500;
17
+ color: #333333;
18
+ padding-bottom: 16px;
19
+ border-bottom: 1px solid #EEEEEE;
20
+ }
21
+
22
+ .file_level_two {
23
+ margin-top: 16px;
24
+
25
+ .file_level_two_item {
26
+ margin-bottom: 16px;
27
+ }
28
+
29
+ .name_level_two {
30
+ font-size: 14px;
31
+ font-weight: 500;
32
+ color: #323232;
33
+ }
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import './item.scss';
3
+ export interface FileItemProps {
4
+ index: number;
5
+ subIndex: number;
6
+ fileIndex: number;
7
+ file: object;
8
+ fileConfig: object;
9
+ token: string;
10
+ tokenTY: string;
11
+ accessToken: string;
12
+ baseUrl: string;
13
+ env: string;
14
+ isPC?: boolean;
15
+ disabled?: boolean;
16
+ maxFileSize: number;
17
+ spec: string;
18
+ isInValid: boolean;
19
+ isShowLib: boolean;
20
+ userInfo: object;
21
+ style?: object;
22
+ del: () => void;
23
+ valChange: (value: any, fileIndex: any, index: any, subIndex: any) => void;
24
+ download: (value: any) => void;
25
+ }
26
+ declare const FileItem: React.FC<FileItemProps>;
27
+ export default FileItem;