Commit 9a495d52 authored by 田翔's avatar 田翔

fix: 图片样式优化

parent e2c8da1b
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import styles from './index.less' import styles from './index.less'
import { Button, Upload, message } from 'antd' import { Button, Upload, message } from 'antd'
import { accepts,getFileType } from '../../../../../../constant' import { accepts, getFileType } from '../../../../../../constant'
import { uploadFileUrl, downloadFileUrl, downloadFile } from '../../../../../../apis/process' import { uploadFileUrl, downloadFileUrl, downloadFile } from '../../../../../../apis/process'
import { import {
SnippetsOutlined, SnippetsOutlined,
...@@ -42,9 +42,16 @@ const FileView = (props) => { ...@@ -42,9 +42,16 @@ const FileView = (props) => {
<div className={styles.fileView}> <div className={styles.fileView}>
<Viewer> <Viewer>
{ {
fileList.map(v => { fileList.map((v, i) => {
return ( return (
<img className={styles.img} src={`${window.origin}/PandaWorkFlow/WorkFlow/AccountManage/DownloadFiles?filePath=${v}`}></img> <span className={styles.imgSpan} style={{ display: i == 0 ? 'inline-block' : 'none' }}>
{fileList.length !== 1 ? <span className={styles.imgSub}>{fileList.length}</span> : null}
<img
className={styles.img}
src={`${window.origin}/PandaWorkFlow/WorkFlow/AccountManage/DownloadFiles?filePath=${v}`}
>
</img>
</span>
) )
}) })
} }
...@@ -108,7 +115,7 @@ const FileView = (props) => { ...@@ -108,7 +115,7 @@ const FileView = (props) => {
} }
}) })
setShowList(JSON.stringify(list)) setShowList(JSON.stringify(list))
},[value]) }, [value])
return ( return (
<div className={styles.fileView}> <div className={styles.fileView}>
......
...@@ -3,14 +3,30 @@ ...@@ -3,14 +3,30 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.img { .imgSpan {
width: 65px; position: relative;
margin-right: 5px;
transition: all 0.2s ease-in; transition: all 0.2s ease-in;
&:hover { &:hover {
cursor: pointer; cursor: pointer;
transform: scale(1.2); transform: scale(1.2);
} }
.img {
width: 65px;
}
.imgSub {
position: absolute;
z-index: 99;
top: 0;
right: 0;
background: red;
color: white;
width: 14px;
height: 14px;
text-align: center;
line-height: 14px;
font-size: 12px;
border-radius: 50%;
}
} }
.iconImg { .iconImg {
width: 45px; width: 45px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment