ydb-components-material 0.1.87 → 0.1.89

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 (96) 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.6ffa9be4.js +1 -0
  7. package/build/docs/{umi.507b3306.css → umi.fd11a37a.css} +1 -1
  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 +2 -2
  19. package/build/lowcode/view.css +1 -1
  20. package/build/lowcode/view.js +2 -2
  21. package/dist/BizComps.css +1 -1
  22. package/dist/BizComps.js +5 -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 +224 -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 +258 -0
  42. package/es/components/file-list/index.scss +61 -0
  43. package/es/components/file-list/item.d.ts +27 -0
  44. package/es/components/file-list/item.js +854 -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/es/style.js +1 -0
  55. package/lib/components/file-list/checkPoint.d.ts +3 -0
  56. package/lib/components/file-list/checkPoint.js +162 -0
  57. package/lib/components/file-list/checkPoint.scss +120 -0
  58. package/lib/components/file-list/file.js +233 -0
  59. package/lib/components/file-list/icon/checked.svg +1 -0
  60. package/lib/components/file-list/icon/close.svg +1 -0
  61. package/lib/components/file-list/icon/del.svg +1 -0
  62. package/lib/components/file-list/icon/download.svg +1 -0
  63. package/lib/components/file-list/icon/download_pc.svg +1 -0
  64. package/lib/components/file-list/icon/file.svg +1 -0
  65. package/lib/components/file-list/icon/icon_errorMsg.svg +1 -0
  66. package/lib/components/file-list/icon/icon_warning.svg +1 -0
  67. package/lib/components/file-list/icon/preview.svg +1 -0
  68. package/lib/components/file-list/icon/preview_pc.svg +1 -0
  69. package/lib/components/file-list/icon/upload.svg +1 -0
  70. package/lib/components/file-list/icon/view.svg +1 -0
  71. package/lib/components/file-list/index.d.ts +21 -0
  72. package/lib/components/file-list/index.js +263 -0
  73. package/lib/components/file-list/index.scss +61 -0
  74. package/lib/components/file-list/item.d.ts +27 -0
  75. package/lib/components/file-list/item.js +860 -0
  76. package/lib/components/file-list/item.scss +412 -0
  77. package/lib/components/file-list/seal.d.ts +3 -0
  78. package/lib/components/file-list/seal.js +228 -0
  79. package/lib/components/file-list/sealUtil.js +254 -0
  80. package/lib/components/file-list/sign.d.ts +3 -0
  81. package/lib/components/file-list/sign.js +144 -0
  82. package/lib/components/file-list/signUtil.js +371 -0
  83. package/lib/index.d.ts +2 -0
  84. package/lib/index.js +3 -1
  85. package/lib/style.js +1 -0
  86. package/lowcode/file-list/meta.ts +231 -0
  87. package/lowcode_es/_setter/IconSelectSetter.js +1 -1
  88. package/lowcode_es/file-list/meta.d.ts +22 -0
  89. package/lowcode_es/file-list/meta.js +213 -0
  90. package/lowcode_es/meta.js +3 -2
  91. package/lowcode_lib/_setter/IconSelectSetter.js +1 -1
  92. package/lowcode_lib/file-list/meta.d.ts +22 -0
  93. package/lowcode_lib/file-list/meta.js +218 -0
  94. package/lowcode_lib/meta.js +14 -13
  95. package/package.json +5 -4
  96. package/build/docs/umi.5298404d.js +0 -1
@@ -0,0 +1,258 @@
1
+ import _Balloon from "@alifd/next/es/balloon";
2
+ import React from 'react';
3
+ var Tooltip = _Balloon.Tooltip;
4
+ import FileItem from "./item";
5
+ import "./index.scss";
6
+ var MATERIAL_TYPE = {
7
+ 1: '原件',
8
+ 2: '复印件',
9
+ 3: '原件或复印件',
10
+ 4: '有电子签章的电子证照',
11
+ 5: '证照扫描件'
12
+ };
13
+ var MATERIAL_FORMAT = {
14
+ 1: 'doc',
15
+ 2: 'docx',
16
+ 3: 'ofd',
17
+ 4: 'pdf',
18
+ 5: 'xlsx',
19
+ 6: 'xls',
20
+ 7: 'png',
21
+ 8: 'jpg',
22
+ 9: 'jpeg',
23
+ 10: 'gif',
24
+ 11: 'bmp',
25
+ 12: 'zip',
26
+ 13: 'rar',
27
+ 14: 'mp3',
28
+ 15: 'mp4',
29
+ 16: 'xml'
30
+ };
31
+ var FileList = function FileList(_ref) {
32
+ var fileList = _ref.fileList,
33
+ token = _ref.token,
34
+ tokenTY = _ref.tokenTY,
35
+ accessToken = _ref.accessToken,
36
+ userInfo = _ref.userInfo,
37
+ baseUrl = _ref.baseUrl,
38
+ env = _ref.env,
39
+ isPC = _ref.isPC,
40
+ disabled = _ref.disabled,
41
+ isShowLib = _ref.isShowLib,
42
+ style = _ref.style,
43
+ download = _ref.download,
44
+ valChange = _ref.valChange;
45
+ var convertNumbersToChinese = function convertNumbersToChinese(str) {
46
+ // 定义基础映射关系
47
+ var digitMap = {
48
+ '0': '〇',
49
+ '1': '一',
50
+ '2': '二',
51
+ '3': '三',
52
+ '4': '四',
53
+ '5': '五',
54
+ '6': '六',
55
+ '7': '七',
56
+ '8': '八',
57
+ '9': '九'
58
+ };
59
+
60
+ // 使用正则表达式全局匹配所有数字字符并进行替换
61
+ return String(str).replace(/\d/g, function (matchedDigit) {
62
+ return digitMap[matchedDigit];
63
+ }) + '、';
64
+ };
65
+
66
+ // 拼接材料的提示文案 - 一级材料
67
+ var getTipText = function getTipText(item) {
68
+ console.log('getTipText', item);
69
+ var materialSize = item.materialSize,
70
+ materialSpec = item.materialSpec,
71
+ materialType = item.materialType;
72
+ if (!materialSpec) return '';
73
+ var formatText = materialSpec.split(',').map(function (i) {
74
+ return MATERIAL_FORMAT[i];
75
+ }).join('、');
76
+ var sizeText = materialSize ? "\u5355\u4E2A\u4E0D\u8D85\u8FC7\u3010" + materialSize + "MB\u3011" : '';
77
+ return "\u9700\u4E0A\u4F20\u3010" + MATERIAL_TYPE[materialType] + "\u3011\uFF0C\u652F\u6301\u3010" + formatText + "\u3011\u683C\u5F0F\u3002" + sizeText;
78
+ };
79
+
80
+ // 拼接材料的提示文案 - 二级材料
81
+ var getTipTextForSubMaterial = function getTipTextForSubMaterial(item, index, subIndex) {
82
+ var subMaterials = fileList[index].subMaterials;
83
+ console.log('getTipTextForSubMaterial', item, index, subIndex);
84
+ console.log('subMaterials', subMaterials);
85
+ var materialSize = item.materialSize,
86
+ materialSpec = item.materialSpec,
87
+ materialType = item.materialType;
88
+ var groupId = fileList[index].subMaterials[subIndex].groupId;
89
+ if (!materialSpec) return '';
90
+ var formatText = materialSpec.split(',').map(function (i) {
91
+ return MATERIAL_FORMAT[i];
92
+ }).join('、');
93
+ var sameGroupIdMaterials = subMaterials.filter(function (m) {
94
+ return m.groupId === groupId;
95
+ });
96
+ var materialNames = sameGroupIdMaterials.map(function (m) {
97
+ return m.materialName;
98
+ });
99
+ var text = '';
100
+ if (materialNames.length > 1) {
101
+ text = "\u3010" + materialNames.join('和') + "\u3011\u81F3\u5C11\u4E0A\u4F20\u4E00\u4EFD\uFF0C";
102
+ }
103
+ var sizeText = materialSize ? "\u5355\u4E2A\u4E0D\u8D85\u8FC7\u3010" + materialSize + "MB\u3011" : '';
104
+ console.log('text', sizeText);
105
+ return text + "\u9700\u4E0A\u4F20\u3010" + MATERIAL_TYPE[materialType] + "\u3011\uFF0C\u652F\u6301\u3010" + formatText + "\u3011\u683C\u5F0F\u3002" + sizeText;
106
+ };
107
+ var handleChange = function handleChange(value, fileIndex, index, subIndex) {
108
+ console.log('handleChange', value, fileIndex, index, subIndex);
109
+ // 先找到一级目录
110
+ var oneLevelItem = fileList[index];
111
+ // 如果subIndex有值。再去找一下二级目录
112
+ if (subIndex !== undefined) {
113
+ // value为空,说明删除了
114
+ if (!value) {
115
+ oneLevelItem.subMaterials[subIndex].isSmart = false;
116
+ oneLevelItem.subMaterials[subIndex].isShareFile = false;
117
+ // 如果当前文件list中只有一个文件,还得补个空的
118
+ if (oneLevelItem.subMaterials[subIndex].fileList.length === 1) {
119
+ oneLevelItem.subMaterials[subIndex].fileList = [{
120
+ fileId: ''
121
+ }];
122
+ } else {
123
+ oneLevelItem.subMaterials[subIndex].fileList.splice(fileIndex, 1);
124
+ }
125
+ } else {
126
+ // 如果当前这个位置的fileId是空的。说明这次修改是新增
127
+ var isAdd = !oneLevelItem.subMaterials[subIndex].fileList[fileIndex].fileId;
128
+ oneLevelItem.subMaterials[subIndex].fileList[fileIndex] = value;
129
+ if (isAdd && oneLevelItem.subMaterials[subIndex].fileList.length < 10) {
130
+ oneLevelItem.subMaterials[subIndex].fileList.push({
131
+ fileId: ''
132
+ });
133
+ }
134
+ }
135
+ } else {
136
+ if (!value) {
137
+ oneLevelItem.isSmart = false;
138
+ oneLevelItem.isShareFile = false;
139
+ oneLevelItem.fileList.splice(fileIndex, 1);
140
+ if (oneLevelItem.fileList.length === 0) {
141
+ oneLevelItem.fileList.push({
142
+ fileId: ''
143
+ });
144
+ }
145
+ } else {
146
+ // 如果当前这个位置的fileId是空的。说明这次修改是新增
147
+ var _isAdd = !oneLevelItem.fileList[fileIndex].fileId;
148
+ oneLevelItem.fileList[fileIndex] = value;
149
+ if (_isAdd && oneLevelItem.fileList.length < 10) {
150
+ oneLevelItem.fileList.push({
151
+ fileId: ''
152
+ });
153
+ }
154
+ }
155
+ }
156
+ console.log('fileList--------res', fileList);
157
+ valChange(fileList);
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
+ };
167
+ return /*#__PURE__*/React.createElement("div", {
168
+ className: "file_list",
169
+ style: style
170
+ }, fileList.map(function (item, index) {
171
+ return /*#__PURE__*/React.createElement("div", {
172
+ className: "file_level_one"
173
+ }, /*#__PURE__*/React.createElement("div", {
174
+ className: "file_level_one_title"
175
+ }, /*#__PURE__*/React.createElement("p", {
176
+ className: "name_level_one"
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: "tl",
184
+ title: "",
185
+ delay: 20
186
+ }, item.isSmart ? '本材料为智能生成材料,系统将根据您填写的信息自动生成申报材料。' : item.isShareFile ? '本材料为共享材料,数据由大数据共享获取,无需用户自行准备。' : '需要用户自行准备申报材料'))), item.subMaterials && item.subMaterials.length > 0 ? /*#__PURE__*/React.createElement("div", {
187
+ className: "file_level_two"
188
+ }, item.subMaterials.map(function (child, subIndex) {
189
+ return /*#__PURE__*/React.createElement("div", {
190
+ className: "file_level_two_item"
191
+ }, /*#__PURE__*/React.createElement("div", {
192
+ className: "file_level_two_title"
193
+ }, /*#__PURE__*/React.createElement("p", {
194
+ className: "name_level_two"
195
+ }, subIndex + 1, "\u3001", child.materialName), /*#__PURE__*/React.createElement("span", {
196
+ className: "required"
197
+ }, "*"), /*#__PURE__*/React.createElement(_Balloon, {
198
+ v2: true,
199
+ trigger: trigger(child),
200
+ triggerType: "click",
201
+ align: "tl",
202
+ title: "",
203
+ delay: 20
204
+ }, child.isSmart ? '本材料为智能生成材料,系统将根据您填写的信息自动生成申报材料。' : child.isShareFile ? '本材料为共享材料,数据由大数据共享获取,无需用户自行准备。' : '需要用户自行准备申报材料')), /*#__PURE__*/React.createElement("p", {
205
+ className: "tip"
206
+ }, getTipTextForSubMaterial(item, index, subIndex)), child.fileList.map(function (file, i) {
207
+ return /*#__PURE__*/React.createElement(FileItem, {
208
+ index: index,
209
+ subIndex: subIndex,
210
+ fileIndex: i,
211
+ file: file,
212
+ fileConfig: child,
213
+ maxFileSize: item.materialSize,
214
+ spec: item.materialSpec,
215
+ userInfo: userInfo,
216
+ token: token,
217
+ tokenTY: tokenTY,
218
+ accessToken: accessToken,
219
+ baseUrl: baseUrl,
220
+ env: env,
221
+ isPC: isPC,
222
+ disabled: disabled,
223
+ download: download,
224
+ valChange: handleChange,
225
+ style: {
226
+ marginBottom: '12px'
227
+ }
228
+ });
229
+ }));
230
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", {
231
+ className: "tip"
232
+ }, getTipText(item)), item.fileList.map(function (file, i) {
233
+ return /*#__PURE__*/React.createElement(FileItem, {
234
+ index: index,
235
+ fileIndex: i,
236
+ file: file,
237
+ fileConfig: item,
238
+ maxFileSize: item.materialSize,
239
+ spec: item.materialSpec,
240
+ isShowLib: isShowLib,
241
+ userInfo: userInfo,
242
+ token: token,
243
+ tokenTY: tokenTY,
244
+ accessToken: accessToken,
245
+ baseUrl: baseUrl,
246
+ env: env,
247
+ isPC: isPC,
248
+ disabled: disabled,
249
+ download: download,
250
+ valChange: handleChange,
251
+ style: {
252
+ marginBottom: '12px'
253
+ }
254
+ });
255
+ })));
256
+ }));
257
+ };
258
+ export default FileList;
@@ -0,0 +1,61 @@
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
+ .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
+
27
+ .name_level_one {
28
+ font-size: 15px;
29
+ font-weight: 500;
30
+ color: #333333;
31
+ margin-bottom: 0;
32
+ }
33
+
34
+ .file_level_one_title {
35
+ padding-bottom: 16px;
36
+ border-bottom: 1px solid #EEEEEE;
37
+ display: flex;
38
+ align-items: center;
39
+ }
40
+
41
+ .file_level_two {
42
+ margin-top: 16px;
43
+
44
+ .file_level_two_item {
45
+ margin-bottom: 16px;
46
+
47
+ .file_level_two_title {
48
+ display: flex;
49
+ align-items: center;
50
+ }
51
+ }
52
+
53
+ .name_level_two {
54
+ font-size: 14px;
55
+ font-weight: 500;
56
+ color: #323232;
57
+ margin-bottom: 0;
58
+ }
59
+ }
60
+ }
61
+ }
@@ -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;