|
@@ -60,6 +60,7 @@ function FlieBox(props: Props) {
|
|
|
const [moveId, setMoveId] = useState<any>('')//移动的素材ID
|
|
|
const [treeEl, item, folderId, setActionId, setHoverId] = TreeBox({ data: get_folder_tree.data, belongUser })
|
|
|
const [listData, setListData] = useState<any>({})
|
|
|
+ const [showImg, setShowImg] = useState(-1)
|
|
|
|
|
|
// 获取数据
|
|
|
useEffect(() => {
|
|
@@ -73,7 +74,7 @@ function FlieBox(props: Props) {
|
|
|
/**全局右键菜单 */
|
|
|
const Menu = useCallback((props: { isItem?: boolean }) => {
|
|
|
console.log('props--->', props, rightClickPup);
|
|
|
-
|
|
|
+
|
|
|
if (props.isItem && isAll) {
|
|
|
return <ul style={{ top: xy?.y, left: xy?.x }} className={style.menu} >
|
|
|
{
|
|
@@ -189,7 +190,7 @@ function FlieBox(props: Props) {
|
|
|
},
|
|
|
}
|
|
|
}, [folderId, moveId, mediaType])
|
|
|
-
|
|
|
+
|
|
|
return <div style={{ display: 'flex', flexFlow: 'row' }}>
|
|
|
{get_folder_tree?.data?.length > 0 && <div style={{ flexShrink: 0 }}>
|
|
|
{treeEl}
|
|
@@ -223,7 +224,7 @@ function FlieBox(props: Props) {
|
|
|
<Spin spinning={list.loading} style={{ width: '100%' }}>
|
|
|
<div className={style.file_content}>
|
|
|
{
|
|
|
- listData?.records?.map((item: Item) => {
|
|
|
+ listData?.records?.map((item: Item, index: number) => {
|
|
|
if (item.folder) {
|
|
|
{/* 文件夹模板 */ }
|
|
|
return <Popconfirm
|
|
@@ -273,7 +274,27 @@ function FlieBox(props: Props) {
|
|
|
}
|
|
|
let El = null
|
|
|
if (mediaType === 'IMG') {
|
|
|
- El = <Image src={item.url} onClick={(e) => { e.stopPropagation() }} />
|
|
|
+ El = <Image
|
|
|
+ src={item.url}
|
|
|
+ onClick={(e) => {
|
|
|
+ e.stopPropagation()
|
|
|
+ let className = (e.target as any).className
|
|
|
+ if (className === 'ant-image-mask-info') {
|
|
|
+ setShowImg(index)
|
|
|
+ } else {
|
|
|
+ changeClickFile(e, item, isAll, noFile)
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ preview={{
|
|
|
+ visible: showImg === index,
|
|
|
+ maskClassName: style.maskClass,
|
|
|
+ onVisibleChange: (value) => {
|
|
|
+ if (!value) {
|
|
|
+ setShowImg(-1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ />
|
|
|
} else if (mediaType === 'VIDEO') {
|
|
|
El = <video src={item.url} style={{ width: 130, height: 100 }} controls />
|
|
|
} else if (mediaType === 'PAGE') {
|