@cloudbase/weda-ui 2.0.12 → 2.0.28
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/package.json +36 -33
- package/src/configs/components/form/textarea.json +8 -0
- package/src/configs/components/graphicCard.json +1 -1
- package/src/configs/components/navLayout.json +2 -1
- package/src/configs/components/wedaVideo.json +12 -9
- package/src/mp/components/calendar/index.js +4 -1
- package/src/mp/components/calendar/index.json +2 -1
- package/src/mp/components/calendar/index.wxml +1 -1
- package/src/mp/components/calendar/index.wxss +17 -16
- package/src/mp/components/chart/statisticsCard/index.wxss +7 -10
- package/src/mp/components/form/checkbox/index.js +5 -1
- package/src/mp/components/form/input/index.js +1 -1
- package/src/mp/components/form/radio/index.js +5 -1
- package/src/mp/components/form/select/index.js +7 -7
- package/src/mp/components/form/textarea/index.js +6 -0
- package/src/mp/components/form/textarea/index.wxml +1 -1
- package/src/mp/components/graphicCard/index.wxss +6 -6
- package/src/mp/components/listView/index.wxss +2 -2
- package/src/mp/components/navLayout/index.wxss +10 -10
- package/src/mp/components/navigationBar/index.js +15 -4
- package/src/mp/components/navigationBar/index.wxss +10 -10
- package/src/mp/components/richText/index.wxml +1 -1
- package/src/mp/components/richText/index.wxss +7 -5
- package/src/mp/components/tabs/index.wxss +1 -2
- package/src/mp/style/weda-ui.wxss +4 -2
- package/src/mp/utils/tcb.js +14 -0
- package/src/web/components/calendar/index.css +27 -40
- package/src/web/components/chart/statisticsCard/index.css +9 -8
- package/src/web/components/form/formcell/index.css +1 -14
- package/src/web/components/form/input/index.css +4 -0
- package/src/web/components/form/location/common/mapChoose.css +13 -11
- package/src/web/components/form/location/components/LocationH5/index.css +19 -19
- package/src/web/components/form/select/h5.tsx +1 -1
- package/src/web/components/form/select/index.tsx +1 -1
- package/src/web/components/form/textarea/index.tsx +12 -0
- package/src/web/components/form/uploader/index.css +10 -0
- package/src/web/components/form/uploader/uploader.h5.tsx +3 -6
- package/src/web/components/form/uploader/uploader.pc.tsx +3 -6
- package/src/web/components/form/uploaderFile/index.css +24 -23
- package/src/web/components/form/uploaderFile/uploadFile.h5.tsx +9 -4
- package/src/web/components/form/uploaderFile/uploadFile.pc.tsx +7 -4
- package/src/web/components/graphicCard/index.css +6 -6
- package/src/web/components/listView/index.css +8 -8
- package/src/web/components/lottery/index.tsx +1 -1
- package/src/web/components/navLayout/index.css +25 -25
- package/src/web/components/navigationBar/common.tsx +11 -6
- package/src/web/components/navigationBar/h5Menu.tsx +1 -1
- package/src/web/components/navigationBar/horizontalMenu.tsx +3 -2
- package/src/web/components/navigationBar/index.css +26 -26
- package/src/web/components/navigationBar/index.tsx +1 -0
- package/src/web/components/navigationBar/type.d.ts +8 -1
- package/src/web/components/navigationBar/verticalMenu.tsx +1 -1
- package/src/web/components/richTextView/index.css +7 -3
- package/src/web/components/tabs/index.css +1 -2
- package/src/web/components/wedaVideo/index.tsx +14 -4
- package/src/web/utils/platform.js +27 -0
- package/src/web/weda-ui.css +11 -9
- package/src/docs/common/format.tsx +0 -115
- package/src/docs/common/tableView.css +0 -164
- package/src/docs/common/tableView.tsx +0 -283
- package/src/docs/compsdocs/chart/Bar.mdx +0 -159
- package/src/docs/compsdocs/chart/Line.mdx +0 -100
- package/src/docs/compsdocs/chart/Pie.mdx +0 -83
- package/src/docs/compsdocs/chart/_category_.json +0 -1
- package/src/docs/compsdocs/chart/statisticsCard.mdx +0 -51
- package/src/docs/compsdocs/database/DataView.mdx +0 -33
- package/src/docs/compsdocs/database/ListView.mdx +0 -33
- package/src/docs/compsdocs/database/_category_.json +0 -1
- package/src/docs/compsdocs/form/Form.mdx +0 -35
- package/src/docs/compsdocs/form/FormCheckbox.mdx +0 -35
- package/src/docs/compsdocs/form/FormDate.mdx +0 -30
- package/src/docs/compsdocs/form/FormEmail.mdx +0 -30
- package/src/docs/compsdocs/form/FormImageUploader.mdx +0 -31
- package/src/docs/compsdocs/form/FormInput.mdx +0 -30
- package/src/docs/compsdocs/form/FormLocation.mdx +0 -64
- package/src/docs/compsdocs/form/FormPhone.mdx +0 -30
- package/src/docs/compsdocs/form/FormRadio.mdx +0 -35
- package/src/docs/compsdocs/form/FormRegion.mdx +0 -30
- package/src/docs/compsdocs/form/FormSelect.mdx +0 -35
- package/src/docs/compsdocs/form/FormSwitch.mdx +0 -30
- package/src/docs/compsdocs/form/FormTextarea.mdx +0 -30
- package/src/docs/compsdocs/form/FormTime.mdx +0 -30
- package/src/docs/compsdocs/form/FormUploadFile.mdx +0 -30
- package/src/docs/compsdocs/form/FormUrl.mdx +0 -30
- package/src/docs/compsdocs/form/_category_.json +0 -1
- package/src/docs/compsdocs/grid/Card.mdx +0 -31
- package/src/docs/compsdocs/grid/Container.mdx +0 -41
- package/src/docs/compsdocs/grid/Footer.mdx +0 -31
- package/src/docs/compsdocs/grid/GridLayout.mdx +0 -31
- package/src/docs/compsdocs/grid/Header.mdx +0 -31
- package/src/docs/compsdocs/grid/Layout.mdx +0 -25
- package/src/docs/compsdocs/grid/List.mdx +0 -31
- package/src/docs/compsdocs/grid/ScrollView.mdx +0 -37
- package/src/docs/compsdocs/grid/Swiper.mdx +0 -57
- package/src/docs/compsdocs/grid/_category_.json +0 -1
- package/src/docs/compsdocs/media/Icon.mdx +0 -31
- package/src/docs/compsdocs/media/Image.mdx +0 -55
- package/src/docs/compsdocs/media/_category_.json +0 -1
- package/src/docs/compsdocs/model/ModelCreate.mdx +0 -44
- package/src/docs/compsdocs/model/ModelDetail.mdx +0 -44
- package/src/docs/compsdocs/model/ModelTable.mdx +0 -156
- package/src/docs/compsdocs/model/ModelUpdate.mdx +0 -44
- package/src/docs/compsdocs/model/PageLayout.mdx +0 -21
- package/src/docs/compsdocs/model/_category_.json +0 -1
- package/src/docs/compsdocs/navmenu/Classification.mdx +0 -37
- package/src/docs/compsdocs/navmenu/NavBar.mdx +0 -52
- package/src/docs/compsdocs/navmenu/NavLayout.mdx +0 -29
- package/src/docs/compsdocs/navmenu/TabBar.mdx +0 -43
- package/src/docs/compsdocs/navmenu/TabBarItem.mdx +0 -29
- package/src/docs/compsdocs/navmenu/_category_.json +0 -1
- package/src/docs/compsdocs/senior/Lottery.mdx +0 -45
- package/src/docs/compsdocs/senior/Modal.mdx +0 -57
- package/src/docs/compsdocs/senior/SlotMachine.mdx +0 -49
- package/src/docs/compsdocs/senior/_category_.json +0 -1
- package/src/docs/compsdocs/show/Calendar.mdx +0 -29
- package/src/docs/compsdocs/show/Divider.mdx +0 -31
- package/src/docs/compsdocs/show/GraphicCard.mdx +0 -29
- package/src/docs/compsdocs/show/Item.mdx +0 -31
- package/src/docs/compsdocs/show/ItemList.mdx +0 -48
- package/src/docs/compsdocs/show/Media.mdx +0 -25
- package/src/docs/compsdocs/show/StatusTip.mdx +0 -25
- package/src/docs/compsdocs/show/Swiper.mdx +0 -33
- package/src/docs/compsdocs/show/Tabs.mdx +0 -37
- package/src/docs/compsdocs/show/_category_.json +0 -1
- package/src/docs/compsdocs/show/button.mdx +0 -25
- package/src/docs/compsdocs/text/Link.mdx +0 -43
- package/src/docs/compsdocs/text/RichTextView.mdx +0 -35
- package/src/docs/compsdocs/text/Text.mdx +0 -31
- package/src/docs/compsdocs/text/Title.mdx +0 -31
- package/src/docs/compsdocs/text/_category_.json +0 -1
- package/src/docs/compsdocs/wxOpen/Phone.mdx +0 -59
- package/src/docs/compsdocs/wxOpen/Share.mdx +0 -45
- package/src/docs/compsdocs/wxOpen/UserInfo.mdx +0 -59
- package/src/docs/compsdocs/wxOpen/_category_.json +0 -4
|
@@ -4,10 +4,9 @@ import classNames from '../../../utils/classnames';
|
|
|
4
4
|
import { getCloudInstance, getTempFileURL } from '../../../utils/tcb';
|
|
5
5
|
import isObjectEqual from '../../../utils/isObjectEqual';
|
|
6
6
|
import { useSyncValue } from '../../../utils/useSyncValue';
|
|
7
|
-
import { isCloudFileID } from '../../../utils/platform';
|
|
7
|
+
import { isCloudFileID, randomUuid } from '../../../utils/platform';
|
|
8
8
|
import { IMAGE_TYPES } from './uploader.pc';
|
|
9
9
|
import type { CommonFormPropsType } from '../types';
|
|
10
|
-
import { v4 } from 'uuid';
|
|
11
10
|
|
|
12
11
|
const uploadPath = 'weda-uploader';
|
|
13
12
|
/**
|
|
@@ -40,7 +39,7 @@ export function ImageUploaderH5({
|
|
|
40
39
|
//上传进度
|
|
41
40
|
const [progress, setProgress] = React.useState(0);
|
|
42
41
|
const [inputValue, setInputValue] = useSyncValue(defaultValue, isObjectEqual);
|
|
43
|
-
|
|
42
|
+
const inputValueRef = React.useRef(inputValue);
|
|
44
43
|
const fileIdList = React.useMemo(() => {
|
|
45
44
|
//兼容h5默认值为空时情况
|
|
46
45
|
if (inputValue === null) {
|
|
@@ -94,9 +93,7 @@ export function ImageUploaderH5({
|
|
|
94
93
|
getCloudInstance().then(async (tcb) => {
|
|
95
94
|
try {
|
|
96
95
|
const fileType = file.type.split('/')?.[1];
|
|
97
|
-
const cloudPath = `${uploadPath}/${
|
|
98
|
-
file?.name
|
|
99
|
-
}`;
|
|
96
|
+
const cloudPath = `${uploadPath}/${randomUuid()}-${file?.name}`;
|
|
100
97
|
const { fileID } = await tcb.uploadFile({
|
|
101
98
|
cloudPath,
|
|
102
99
|
filePath: file,
|
|
@@ -8,10 +8,9 @@ import {
|
|
|
8
8
|
ImagePreview,
|
|
9
9
|
ConfigProvider,
|
|
10
10
|
} from 'tea-component';
|
|
11
|
-
import { v4 } from 'uuid';
|
|
12
11
|
import classNames from '../../../utils/classnames';
|
|
13
12
|
import { getCloudInstance, getTempFileURL } from '../../../utils/tcb';
|
|
14
|
-
import { isCloudFileID } from '../../../utils/platform';
|
|
13
|
+
import { isCloudFileID, randomUuid } from '../../../utils/platform';
|
|
15
14
|
import isObjectEqual from '../../../utils/isObjectEqual';
|
|
16
15
|
import { H5UploaderProps } from './uploader.h5';
|
|
17
16
|
// 默认组件类前缀
|
|
@@ -79,7 +78,7 @@ export function UploaderPCInner(props) {
|
|
|
79
78
|
const [progress, setProgress] = React.useState(0);
|
|
80
79
|
// 文件列表
|
|
81
80
|
const [fileIDList, setfileIDList] = React.useState([]);
|
|
82
|
-
const fileRef = React.useRef(
|
|
81
|
+
const fileRef = React.useRef<string[] | string>([]);
|
|
83
82
|
React.useEffect(() => {
|
|
84
83
|
let initialValue = []
|
|
85
84
|
.concat(defaultValue)
|
|
@@ -130,9 +129,7 @@ export function UploaderPCInner(props) {
|
|
|
130
129
|
getCloudInstance().then(async (tcb) => {
|
|
131
130
|
try {
|
|
132
131
|
const fileType = file.type.split('/')?.[1];
|
|
133
|
-
const cloudPath = `${uploadPath}/${
|
|
134
|
-
file?.name
|
|
135
|
-
}`;
|
|
132
|
+
const cloudPath = `${uploadPath}/${randomUuid()}-${file?.name}`;
|
|
136
133
|
const { fileID } = await tcb.uploadFile({
|
|
137
134
|
cloudPath,
|
|
138
135
|
filePath: file,
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
|
|
88
88
|
.weda-upload-file-pc .weda-upload-file-pc__btn-descripe {
|
|
89
89
|
margin-left: 16px;
|
|
90
|
-
font-size:
|
|
90
|
+
font-size: 0.75em;
|
|
91
91
|
line-height: 20px;
|
|
92
92
|
color: rgba(0, 0, 0, 0.4);
|
|
93
93
|
}
|
|
@@ -103,13 +103,13 @@
|
|
|
103
103
|
|
|
104
104
|
.weda-upload-file-pc .weda-upload-file-pc--item {
|
|
105
105
|
display: flex;
|
|
106
|
-
font-size:
|
|
106
|
+
font-size: 0.875em;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
.weda-upload-file-pc .weda-upload-file-pc--item-header {
|
|
110
110
|
border: 1px solid #e7e7e7;
|
|
111
|
-
font-size:
|
|
112
|
-
line-height:
|
|
111
|
+
font-size: 0.875em;
|
|
112
|
+
line-height: 1.375em;
|
|
113
113
|
color: rgba(0, 0, 0, 0.4);
|
|
114
114
|
margin-top: 16px;
|
|
115
115
|
}
|
|
@@ -117,8 +117,8 @@
|
|
|
117
117
|
.weda-upload-file-pc .weda-upload-file-pc--item-body {
|
|
118
118
|
border-left: 1px dashed #e7e7e7;
|
|
119
119
|
border-right: 1px dashed #e7e7e7;
|
|
120
|
-
font-size:
|
|
121
|
-
line-height:
|
|
120
|
+
font-size: 0.875em;
|
|
121
|
+
line-height: 1.375em;
|
|
122
122
|
color: rgba(0, 0, 0, 0.9);
|
|
123
123
|
}
|
|
124
124
|
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
border-color: #dcdcdc;
|
|
167
167
|
color: rgba(0, 0, 0, 0.9);
|
|
168
168
|
width: 88px;
|
|
169
|
-
font-size:
|
|
169
|
+
font-size: 0.875em;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
.weda-upload-file-pc
|
|
@@ -187,8 +187,8 @@
|
|
|
187
187
|
.weda-upload-file-pc--item
|
|
188
188
|
.weda-upload-file-pc--item-action
|
|
189
189
|
.wedatea2td-btn {
|
|
190
|
-
font-size:
|
|
191
|
-
line-height:
|
|
190
|
+
font-size: 0.875em;
|
|
191
|
+
line-height: 1.375em;
|
|
192
192
|
color: #0052d9;
|
|
193
193
|
margin-right: 12px;
|
|
194
194
|
}
|
|
@@ -214,9 +214,9 @@
|
|
|
214
214
|
.weda-upload-file-pc
|
|
215
215
|
.weda-upload-file-pc--item-empty
|
|
216
216
|
.weda-upload-file-pc--item {
|
|
217
|
-
font-size:
|
|
217
|
+
font-size: 0.875em;
|
|
218
218
|
color: rgba(0, 0, 0, 0.4);
|
|
219
|
-
line-height:
|
|
219
|
+
line-height: 1.375em;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
/* ----上传文件---- h5 */
|
|
@@ -236,8 +236,8 @@
|
|
|
236
236
|
padding: 0 20px 8px 20px;
|
|
237
237
|
}
|
|
238
238
|
.weda-upload-file-mobile .weda-upload-file-mobile__title {
|
|
239
|
-
font-size:
|
|
240
|
-
line-height:
|
|
239
|
+
font-size: 0.875em;
|
|
240
|
+
line-height: 1.25em;
|
|
241
241
|
color: #000;
|
|
242
242
|
margin-right: 20px;
|
|
243
243
|
padding-top: 6px;
|
|
@@ -246,18 +246,18 @@
|
|
|
246
246
|
.weda-upload-file-mobile .weda-upload-file-mobile__btn--weak {
|
|
247
247
|
width: 88px;
|
|
248
248
|
padding: 0 16px;
|
|
249
|
-
font-size:
|
|
249
|
+
font-size: 0.875em;
|
|
250
250
|
color: rgba(0, 0, 0, 0.9);
|
|
251
251
|
border: 1px solid #dcdcdc;
|
|
252
252
|
border-radius: 3px;
|
|
253
|
-
line-height:
|
|
253
|
+
line-height: 1.375em;
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
.weda-upload-file-mobile .weda-upload-file-mobile__tips {
|
|
257
257
|
display: block;
|
|
258
258
|
margin-top: 8px;
|
|
259
|
-
font-size:
|
|
260
|
-
line-height:
|
|
259
|
+
font-size: 0.75em;
|
|
260
|
+
line-height: 1.25em;
|
|
261
261
|
color: rgba(0, 0, 0, 0.4);
|
|
262
262
|
}
|
|
263
263
|
|
|
@@ -331,8 +331,8 @@
|
|
|
331
331
|
.weda-upload-file-mobile
|
|
332
332
|
.weda-upload-file-mobile__item
|
|
333
333
|
.weda-upload-file-mobile__file-name {
|
|
334
|
-
font-size:
|
|
335
|
-
line-height:
|
|
334
|
+
font-size: 0.875em;
|
|
335
|
+
line-height: 1.375em;
|
|
336
336
|
color: rgba(0, 0, 0, 0.9);
|
|
337
337
|
max-width: 6.5rem;
|
|
338
338
|
overflow: hidden;
|
|
@@ -373,16 +373,16 @@
|
|
|
373
373
|
.weda-upload-file-mobile__file-status--msg {
|
|
374
374
|
width: 4.2rem;
|
|
375
375
|
margin-left: 4px;
|
|
376
|
-
font-size:
|
|
377
|
-
line-height:
|
|
376
|
+
font-size: 0.75em;
|
|
377
|
+
line-height: 1.25em;
|
|
378
378
|
color: rgba(0, 0, 0, 0.9);
|
|
379
379
|
}
|
|
380
380
|
|
|
381
381
|
.weda-upload-file-mobile
|
|
382
382
|
.weda-upload-file-mobile__item
|
|
383
383
|
.weda-upload-file-mobile__file-foot {
|
|
384
|
-
font-size:
|
|
385
|
-
line-height:
|
|
384
|
+
font-size: 0.75em;
|
|
385
|
+
line-height: 1.25em;
|
|
386
386
|
color: rgba(0, 0, 0, 0.4);
|
|
387
387
|
margin-top: 8px;
|
|
388
388
|
display: flex;
|
|
@@ -415,6 +415,7 @@
|
|
|
415
415
|
}
|
|
416
416
|
.weda-upload-file-mobile .weui-uploader-mobile__input {
|
|
417
417
|
position: absolute;
|
|
418
|
+
font-size: 1em;
|
|
418
419
|
opacity: 0;
|
|
419
420
|
width: 92px;
|
|
420
421
|
height: 32px;
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
Progress,
|
|
12
12
|
Tooltip,
|
|
13
13
|
} from 'tea-component';
|
|
14
|
-
import { v4 } from 'uuid';
|
|
15
14
|
import {
|
|
16
15
|
filterStrList,
|
|
17
16
|
isCloudFileID,
|
|
@@ -19,6 +18,7 @@ import {
|
|
|
19
18
|
transSize,
|
|
20
19
|
downloadFile,
|
|
21
20
|
transFileCloudidToName,
|
|
21
|
+
randomUuid,
|
|
22
22
|
} from '../../../utils/platform';
|
|
23
23
|
import { getCloudInstance, getTempFileURL } from '../../../utils/tcb';
|
|
24
24
|
import classNames from '../../../utils/classnames';
|
|
@@ -78,6 +78,7 @@ export function UploadFileH5({
|
|
|
78
78
|
const [fileSizeObj, setFileSizeObj] = React.useState({}); // 管理上传文件大小 {uuid:size}
|
|
79
79
|
// 两次默认值不同, 需要刷新
|
|
80
80
|
const prevDefaultRef = React.useRef<any>([]);
|
|
81
|
+
const fileRef = React.useRef(fileIDList);
|
|
81
82
|
React.useMemo(() => {
|
|
82
83
|
//有有效默认值时不刷新,解决初次渲染默认值不显示问题
|
|
83
84
|
if (
|
|
@@ -103,7 +104,10 @@ export function UploadFileH5({
|
|
|
103
104
|
onChange && onChange(pureFileIDList);
|
|
104
105
|
events?.change?.({ value: pureFileIDList });
|
|
105
106
|
}
|
|
106
|
-
|
|
107
|
+
if (!isObjectEqual(fileRef.current, fileIDList)) {
|
|
108
|
+
events?.success?.({ value: pureFileIDList });
|
|
109
|
+
fileRef.current = fileIDList;
|
|
110
|
+
}
|
|
107
111
|
}, [fileIDList]);
|
|
108
112
|
|
|
109
113
|
// 外层组件类
|
|
@@ -206,13 +210,14 @@ export function UploadFileH5({
|
|
|
206
210
|
weui.alert(`请上传不超过1024M的文件`);
|
|
207
211
|
return false;
|
|
208
212
|
}
|
|
209
|
-
fileList.forEach((f) => (f['_uuid'] =
|
|
213
|
+
fileList.forEach((f) => (f['_uuid'] = randomUuid()));
|
|
210
214
|
setFileList((list) => [...list, ...fileList]);
|
|
211
215
|
}}
|
|
212
216
|
/>
|
|
213
217
|
<a
|
|
214
218
|
type="weak"
|
|
215
219
|
className="wedatea2td-btn wedatea2td-btn--weak"
|
|
220
|
+
style={{ fontSize: '1em' }}
|
|
216
221
|
>
|
|
217
222
|
点击上传
|
|
218
223
|
</a>
|
|
@@ -381,7 +386,7 @@ const TcbFileUpload = ({
|
|
|
381
386
|
try {
|
|
382
387
|
setStatus('UPLOAD_STATUS_PENDING');
|
|
383
388
|
const { fileID } = await tcb.uploadFile({
|
|
384
|
-
cloudPath: `${uploadPath}/${
|
|
389
|
+
cloudPath: `${uploadPath}/${randomUuid()}-${file?.name}`,
|
|
385
390
|
filePath: file,
|
|
386
391
|
onUploadProgress: (progressEvent) => {
|
|
387
392
|
let percent = 0;
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
Text,
|
|
9
9
|
List,
|
|
10
10
|
} from 'tea-component';
|
|
11
|
-
import { v4 } from 'uuid';
|
|
12
11
|
import {
|
|
13
12
|
filterStrList,
|
|
14
13
|
isCloudFileID,
|
|
@@ -17,6 +16,7 @@ import {
|
|
|
17
16
|
downloadFile,
|
|
18
17
|
cutFileTitle,
|
|
19
18
|
transFileCloudidToName,
|
|
19
|
+
randomUuid,
|
|
20
20
|
} from '../../../utils/platform';
|
|
21
21
|
import { getCloudInstance, getTempFileURL } from '../../../utils/tcb';
|
|
22
22
|
import classNames from '../../../utils/classnames';
|
|
@@ -75,6 +75,7 @@ export function UploadFilePc({
|
|
|
75
75
|
const [fileSizeObj, setFileSizeObj] = React.useState({}); // 管理上传文件大小 {uuid:size}
|
|
76
76
|
// 两次默认值不同, 需要刷新
|
|
77
77
|
const prevDefaultRef = React.useRef<any>([]);
|
|
78
|
+
const fileRef = React.useRef(fileIDList);
|
|
78
79
|
React.useMemo(() => {
|
|
79
80
|
//有有效默认值时不刷新,解决初次渲染默认值不显示问题
|
|
80
81
|
if (
|
|
@@ -96,11 +97,13 @@ export function UploadFilePc({
|
|
|
96
97
|
const file = pureFileIDList[0] || '';
|
|
97
98
|
onChange?.(file);
|
|
98
99
|
events?.change?.({ value: file });
|
|
99
|
-
events?.success?.({ value: file });
|
|
100
100
|
} else {
|
|
101
101
|
onChange?.(pureFileIDList);
|
|
102
102
|
events?.change?.({ value: pureFileIDList });
|
|
103
|
+
}
|
|
104
|
+
if (!isObjectEqual(fileRef.current, fileIDList)) {
|
|
103
105
|
events?.success?.({ value: pureFileIDList });
|
|
106
|
+
fileRef.current = fileIDList;
|
|
104
107
|
}
|
|
105
108
|
}, [fileIDList]);
|
|
106
109
|
// 外层组件类
|
|
@@ -128,7 +131,7 @@ export function UploadFilePc({
|
|
|
128
131
|
} catch (e) {}
|
|
129
132
|
return false;
|
|
130
133
|
}
|
|
131
|
-
file['_uuid'] =
|
|
134
|
+
file['_uuid'] = randomUuid();
|
|
132
135
|
setFileList((list) => [...list, file]);
|
|
133
136
|
return false;
|
|
134
137
|
};
|
|
@@ -352,7 +355,7 @@ const TcbFileUpload = ({ file }: ITcbFileUpload) => {
|
|
|
352
355
|
try {
|
|
353
356
|
setStatus('0');
|
|
354
357
|
const { fileID } = await tcb.uploadFile({
|
|
355
|
-
cloudPath: `${uploadPath}/${
|
|
358
|
+
cloudPath: `${uploadPath}/${randomUuid()}-${file?.name}`,
|
|
356
359
|
filePath: file,
|
|
357
360
|
onUploadProgress: (progressEvent) => {
|
|
358
361
|
let percent = 0;
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
.weda-graphic-card .weda-graphic-card__col .weda-graphic-card__title {
|
|
84
|
-
font-size:
|
|
85
|
-
line-height:
|
|
84
|
+
font-size: 1.1428em;
|
|
85
|
+
line-height: 1.71428em;
|
|
86
86
|
text-align: center;
|
|
87
87
|
color: rgba(0, 0, 0, 0.9);
|
|
88
88
|
display: -webkit-box;
|
|
@@ -93,8 +93,8 @@
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
.weda-graphic-card .weda-graphic-card__col .weda-graphic-card__desc {
|
|
96
|
-
font-size:
|
|
97
|
-
line-height:
|
|
96
|
+
font-size: 1em;
|
|
97
|
+
line-height: 1.5714em;
|
|
98
98
|
color: rgba(0, 0, 0, 0.4);
|
|
99
99
|
text-align: center;
|
|
100
100
|
display: -webkit-box;
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
.weda-graphic-card .weda-graphic-card__col .weda-graphic-card__btn--text {
|
|
108
|
-
font-size:
|
|
109
|
-
line-height:
|
|
108
|
+
font-size: 1em;
|
|
109
|
+
line-height: 1.5714em;
|
|
110
110
|
color: #0052d9;
|
|
111
111
|
margin-right: 8px;
|
|
112
112
|
}
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
.weda-list-view__containor .weda-list-view__more .weda-list-view__more-text {
|
|
23
23
|
padding-top: 10px;
|
|
24
24
|
padding-bottom: 14px;
|
|
25
|
-
font-size:
|
|
26
|
-
line-height:
|
|
25
|
+
font-size: 0.85714em;
|
|
26
|
+
line-height: 0.85714em;
|
|
27
27
|
color: rgba(0, 0, 0, 0.4);
|
|
28
28
|
text-align: center;
|
|
29
29
|
box-sizing: border-box;
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
.weda-list-view__containor
|
|
82
82
|
.weda-list-view__more
|
|
83
83
|
.weda-list-view__pagination-next {
|
|
84
|
-
font-size:
|
|
85
|
-
line-height:
|
|
84
|
+
font-size: 0.85714em;
|
|
85
|
+
line-height: 1.71428em;
|
|
86
86
|
color: rgba(0, 0, 0, 0.4);
|
|
87
87
|
padding: 0 24px;
|
|
88
88
|
cursor: pointer;
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
.weda-list-view__pagination-next::after {
|
|
106
106
|
position: absolute;
|
|
107
107
|
content: '';
|
|
108
|
-
width:
|
|
109
|
-
height:
|
|
108
|
+
width: 1.71428em;
|
|
109
|
+
height: 1.71428em;
|
|
110
110
|
top: 10px;
|
|
111
111
|
opacity: 0.2;
|
|
112
112
|
background-image: url(arrow-right-line.svg);
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
.weda-list-view__containor
|
|
138
138
|
.weda-list-view__more
|
|
139
139
|
.weda-list-view__pagination-text {
|
|
140
|
-
font-size:
|
|
141
|
-
line-height:
|
|
140
|
+
font-size: 0.85714em;
|
|
141
|
+
line-height: 1.71428em;
|
|
142
142
|
color: rgba(0, 0, 0, 0.4);
|
|
143
143
|
}
|
|
@@ -3,7 +3,7 @@ import React, { useState, useEffect } from 'react';
|
|
|
3
3
|
import { usePlatform } from '../../utils/platform';
|
|
4
4
|
import classNames from '../../utils/classnames';
|
|
5
5
|
import './index.css';
|
|
6
|
-
import { CommonPropsType } from '../../types';
|
|
6
|
+
import type { CommonPropsType } from '../../types';
|
|
7
7
|
import { ConfigProvider } from 'tea-component';
|
|
8
8
|
import LotteryAction from './lotteryUtil';
|
|
9
9
|
|
|
@@ -156,36 +156,36 @@
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
.weda-grid-navigation .weda-grid-navigation__col .weda-grid-navigation__icon {
|
|
159
|
-
width:
|
|
160
|
-
height:
|
|
159
|
+
width: 4em;
|
|
160
|
+
height: 4em;
|
|
161
161
|
}
|
|
162
162
|
.weda-grid-navigation
|
|
163
163
|
.weda-grid-navigation__col
|
|
164
164
|
.weda-grid-navigation__fonticon {
|
|
165
|
-
font-size:
|
|
165
|
+
font-size: 4em;
|
|
166
166
|
}
|
|
167
167
|
.weda-grid-navigation
|
|
168
168
|
.weda-grid-navigation__col--small
|
|
169
169
|
.weda-grid-navigation__icon {
|
|
170
|
-
width:
|
|
171
|
-
height:
|
|
170
|
+
width: 3.428571em;
|
|
171
|
+
height: 3.428571em;
|
|
172
172
|
}
|
|
173
173
|
.weda-grid-navigation
|
|
174
174
|
.weda-grid-navigation__col--small
|
|
175
175
|
.weda-grid-navigation__fonticon {
|
|
176
|
-
font-size:
|
|
176
|
+
font-size: 3.428571em;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
.weda-grid-navigation
|
|
180
180
|
.weda-grid-navigation__col--big
|
|
181
181
|
.weda-grid-navigation__icon {
|
|
182
|
-
width:
|
|
183
|
-
height:
|
|
182
|
+
width: 5.14285em;
|
|
183
|
+
height: 5.14285em;
|
|
184
184
|
}
|
|
185
185
|
.weda-grid-navigation
|
|
186
186
|
.weda-grid-navigation__col--big
|
|
187
187
|
.weda-grid-navigation__fonticon {
|
|
188
|
-
font-size:
|
|
188
|
+
font-size: 5.14285em;
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
.weda-grid-navigation .weda-grid-navigation__img {
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
.weda-grid-navigation .weda-grid-navigation__col .weda-grid-navigation__text {
|
|
197
|
-
font-size:
|
|
197
|
+
font-size: 1.142857em;
|
|
198
198
|
/* line-height: 24px; */
|
|
199
199
|
text-align: center;
|
|
200
200
|
color: rgba(0, 0, 0, 0.6);
|
|
@@ -215,15 +215,15 @@
|
|
|
215
215
|
.weda-grid-navigation
|
|
216
216
|
.weda-grid-navigation__col--small
|
|
217
217
|
.weda-grid-navigation__text {
|
|
218
|
-
font-size:
|
|
219
|
-
line-height:
|
|
218
|
+
font-size: 1em;
|
|
219
|
+
line-height: 1.5714em;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
.weda-grid-navigation
|
|
223
223
|
.weda-grid-navigation__col--big
|
|
224
224
|
.weda-grid-navigation__text {
|
|
225
|
-
font-size:
|
|
226
|
-
line-height:
|
|
225
|
+
font-size: 1.42857em;
|
|
226
|
+
line-height: 2em;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
/* h5 style */
|
|
@@ -280,36 +280,36 @@
|
|
|
280
280
|
.weda-grid-navigation-mobile
|
|
281
281
|
.weda-grid-navigation__col
|
|
282
282
|
.weda-grid-navigation__icon {
|
|
283
|
-
width:
|
|
284
|
-
height:
|
|
283
|
+
width: 2.57142em;
|
|
284
|
+
height: 2.57142em;
|
|
285
285
|
}
|
|
286
286
|
.weda-grid-navigation-mobile
|
|
287
287
|
.weda-grid-navigation__col
|
|
288
288
|
.weda-grid-navigation__fonticon {
|
|
289
|
-
font-size:
|
|
289
|
+
font-size: 2.57142em;
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
.weda-grid-navigation-mobile
|
|
293
293
|
.weda-grid-navigation__col--small
|
|
294
294
|
.weda-grid-navigation__icon {
|
|
295
|
-
width:
|
|
296
|
-
height:
|
|
295
|
+
width: 2.285714em;
|
|
296
|
+
height: 2.285714em;
|
|
297
297
|
}
|
|
298
298
|
.weda-grid-navigation-mobile
|
|
299
299
|
.weda-grid-navigation__col--small
|
|
300
300
|
.weda-grid-navigation__fonticon {
|
|
301
|
-
font-size:
|
|
301
|
+
font-size: 2.285714em;
|
|
302
302
|
}
|
|
303
303
|
.weda-grid-navigation-mobile
|
|
304
304
|
.weda-grid-navigation__col--big
|
|
305
305
|
.weda-grid-navigation__fonticon {
|
|
306
|
-
font-size:
|
|
306
|
+
font-size: 2.857142em;
|
|
307
307
|
}
|
|
308
308
|
.weda-grid-navigation-mobile
|
|
309
309
|
.weda-grid-navigation__col--big
|
|
310
310
|
.weda-grid-navigation__icon {
|
|
311
|
-
width:
|
|
312
|
-
height:
|
|
311
|
+
width: 2.85714em;
|
|
312
|
+
height: 2.85714em;
|
|
313
313
|
}
|
|
314
314
|
.weda-grid-navigation-mobile
|
|
315
315
|
.weda-grid-navigation__col
|
|
@@ -320,8 +320,8 @@
|
|
|
320
320
|
.weda-grid-navigation-mobile
|
|
321
321
|
.weda-grid-navigation__col--small
|
|
322
322
|
.weda-grid-navigation__text {
|
|
323
|
-
font-size:
|
|
324
|
-
line-height:
|
|
323
|
+
font-size: 0.85714em;
|
|
324
|
+
line-height: 1.42857em;
|
|
325
325
|
margin-top: 4px;
|
|
326
326
|
}
|
|
327
327
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IMenuItem, INavigationStyle } from './type';
|
|
3
|
-
import { isUrl } from '../../utils/platform';
|
|
2
|
+
import type { IMenuItem, INavigationStyle } from './type';
|
|
3
|
+
import { isUrl, resolveStaticResourceUrl } from '../../utils/platform';
|
|
4
4
|
import { IconFont } from 'tdesign-icons-react';
|
|
5
5
|
const CLASS_PREFIX = 'weda-menu';
|
|
6
6
|
|
|
@@ -30,7 +30,7 @@ export const renderMenuTitle = (
|
|
|
30
30
|
hasIcon: boolean
|
|
31
31
|
) => {
|
|
32
32
|
const { menuColor, menuFontSize, showMenuIcon } = navigationStyle;
|
|
33
|
-
const { title, level, iconUrl } = item;
|
|
33
|
+
const { title, level, iconUrl, iconPath } = item;
|
|
34
34
|
return (
|
|
35
35
|
<span
|
|
36
36
|
className="menu-text"
|
|
@@ -43,7 +43,7 @@ export const renderMenuTitle = (
|
|
|
43
43
|
{showMenuIcon &&
|
|
44
44
|
level === 0 &&
|
|
45
45
|
hasIcon &&
|
|
46
|
-
renderMenuIcon(iconUrl, navigationStyle)}
|
|
46
|
+
renderMenuIcon(iconUrl, iconPath, navigationStyle)}
|
|
47
47
|
{title}
|
|
48
48
|
</span>
|
|
49
49
|
);
|
|
@@ -57,14 +57,16 @@ export const renderLogo = (
|
|
|
57
57
|
navigationStyle: INavigationStyle,
|
|
58
58
|
className: string
|
|
59
59
|
) => {
|
|
60
|
-
const { showLogo, logoHeight, logoWidth, logoUrl } =
|
|
60
|
+
const { showLogo, logoHeight, logoWidth, logoUrl, logoPath } =
|
|
61
|
+
navigationStyle;
|
|
62
|
+
const src = resolveStaticResourceUrl(logoPath) || logoUrl;
|
|
61
63
|
return (
|
|
62
64
|
showLogo && (
|
|
63
65
|
<img
|
|
64
66
|
data-testid="navigationBar-logo"
|
|
65
67
|
className={className}
|
|
66
68
|
style={{ width: `${logoWidth}px`, height: `${logoHeight}px` }}
|
|
67
|
-
src={
|
|
69
|
+
src={src || defaultLogoUrl}
|
|
68
70
|
alt="logo"
|
|
69
71
|
/>
|
|
70
72
|
)
|
|
@@ -93,11 +95,14 @@ export const IconShow = ({ onIcon, menuColor, menuFontSize }) => {
|
|
|
93
95
|
// 菜单图标
|
|
94
96
|
export const renderMenuIcon = (
|
|
95
97
|
iconUrl: string,
|
|
98
|
+
iconPath: string,
|
|
96
99
|
navigationStyle: INavigationStyle
|
|
97
100
|
) => {
|
|
98
101
|
const { menuColor, menuFontSize } = navigationStyle;
|
|
99
102
|
let icon = iconUrl || 'td:view-module';
|
|
103
|
+
|
|
100
104
|
if (iconUrl && isUrl(iconUrl)) {
|
|
105
|
+
icon = resolveStaticResourceUrl(iconPath) || iconUrl;
|
|
101
106
|
return (
|
|
102
107
|
<img
|
|
103
108
|
className={`${CLASS_PREFIX}__item-icon`}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-key */
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import { Menu, Drawer } from 'tea-component';
|
|
4
|
-
import { IMenuItem, INavigationStyle } from './type';
|
|
4
|
+
import type { IMenuItem, INavigationStyle } from './type';
|
|
5
5
|
import classNames from '../../utils/classnames';
|
|
6
6
|
import {
|
|
7
7
|
renderMenuTitle,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-key */
|
|
2
2
|
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
3
3
|
import { NavMenu, List, Dropdown } from 'tea-component';
|
|
4
|
-
import { IMenuItem, INavigationStyle } from './type';
|
|
4
|
+
import type { IMenuItem, INavigationStyle } from './type';
|
|
5
5
|
import { usePlatform } from '../../utils/platform';
|
|
6
6
|
import classNames from '../../utils/classnames';
|
|
7
7
|
import {
|
|
@@ -157,7 +157,8 @@ const HorizontalMenu: React.FC<{
|
|
|
157
157
|
}
|
|
158
158
|
}}
|
|
159
159
|
>
|
|
160
|
-
{showMenuIcon &&
|
|
160
|
+
{showMenuIcon &&
|
|
161
|
+
renderMenuIcon(i?.iconUrl, i?.iconPath, navigationStyle)}
|
|
161
162
|
{i?.children?.length ? (
|
|
162
163
|
<Dropdown
|
|
163
164
|
trigger={'hover'}
|