diff --git a/packages/xgen/components/edit/Upload/components/Audio.less b/packages/xgen/components/edit/Upload/components/Audio.less index f979d9f..9e638fe 100644 --- a/packages/xgen/components/edit/Upload/components/Audio.less +++ b/packages/xgen/components/edit/Upload/components/Audio.less @@ -14,6 +14,10 @@ } .vds-title-text { + color: var(--color_title); + font-family: inherit; + font-weight: 400; + font-size: 14px; animation: none; } diff --git a/packages/xgen/components/edit/Upload/components/Audio.tsx b/packages/xgen/components/edit/Upload/components/Audio.tsx index c718e4e..45b8321 100644 --- a/packages/xgen/components/edit/Upload/components/Audio.tsx +++ b/packages/xgen/components/edit/Upload/components/Audio.tsx @@ -42,6 +42,7 @@ const Index = (props: IPropsCustomRender) => { ...defaultLayoutIcons } + console.log('file', preivewSize?.height) return (
{ }} > { + const { file, preivewSize, remove } = props + const [loading, setLoading] = useState(true) + const [url, setUrl] = useState(file.response || '') + const [title, setTitle] = useState(file.name) + const [ext, setExt] = useState(file.name.split('.').pop() || '') + const [showOpration, setShowOpration] = useState(false) + + const src = getFileSrc(url, props.appRoot) + useEffect(() => { + if (file.response) { + const url = getFileSrc(file.response, props.appRoot) + const title = url.split('name=/')[1]?.split('&')[0] || file.name + setUrl(url) + setTitle(title.split('/').pop() || file.name) + setExt(title.split('.').pop() || '') + setLoading(false) + } + }, [file.response]) + + const preview = () => { + window.open(src) + } + + return ( +
setShowOpration(true)} + onMouseLeave={() => setShowOpration(false)} + > +
+
+ +
+
+ +
+
+ + +
+ + + {ext}: {title} + +
+
+
+ ) +} + +export default window.$app.memo(Index) diff --git a/packages/xgen/components/edit/Upload/filemap.tsx b/packages/xgen/components/edit/Upload/filemap.tsx index bd5d772..e4c86f7 100644 --- a/packages/xgen/components/edit/Upload/filemap.tsx +++ b/packages/xgen/components/edit/Upload/filemap.tsx @@ -1,3 +1,4 @@ +import File from './components/File' import Video from './components/Video' import Audio from './components/Audio' import Image from './components/Image' @@ -41,7 +42,7 @@ export default { }, placeholderIcon: 'icon-upload', preview: (props: PreviewProps, file: UploadFile, remove: () => void) => { - return
File
+ return } }, diff --git a/packages/xgen/components/edit/Upload/index.less b/packages/xgen/components/edit/Upload/index.less index 6d39125..56f0cd2 100644 --- a/packages/xgen/components/edit/Upload/index.less +++ b/packages/xgen/components/edit/Upload/index.less @@ -77,9 +77,9 @@ &.audio { :global { @min_width: 288px; - @min_height: 52px; + @min_height: 60px; @width: 288px; - @height: 52px; + @height: 60px; .form_item_upload_wrap { padding-top: 11px; padding-left: 10px; diff --git a/packages/xgen/components/edit/Upload/index.tsx b/packages/xgen/components/edit/Upload/index.tsx index 6f60dca..92b9bd5 100644 --- a/packages/xgen/components/edit/Upload/index.tsx +++ b/packages/xgen/components/edit/Upload/index.tsx @@ -89,8 +89,8 @@ const fmtSize = (size: PreviewProps['size'], filetype: AllowedFileType): Preview const defaultSizes: Record = { image: { width: '90px', height: '90px', ratio: 1 }, video: { width: '288px', height: '162px', ratio: 1 }, - file: { width: '288px', height: '52px', ratio: 1 }, - audio: { width: '288px', height: '52px', ratio: 1 } + file: { width: '288px', height: '60px', ratio: 1 }, + audio: { width: '288px', height: '60px', ratio: 1 } } const defaultSize: PreviewProps['size'] = {