广州矛调粤政易端
xusd
7 days ago d27794814b69d18aeb8ee96a46cae91d5613570c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import React, { Fragment, useState } from 'react'
import { Image } from '@arco-design/web-react';
import { IconAttachment } from '@arco-design/web-react/icon';
import './index.less';
import * as $$ from '../../utils/utility';
 
const appUrl = $$.appUrl;
 
export default function PreviewImage(props) {
  const [visible, setVisible] = useState(false)
  const { name, src, ...rest } = props
  return (
    <Fragment>
      <div style={{ display: 'none' }}>
        <Image.Preview
          src={`${appUrl.fileUrl}/${appUrl.sys}${src}`}
          visible={visible}
          onVisibleChange={setVisible}
          {...rest}
        />
      </div>
      <div onClick={() => { setVisible(true) }} style={{ color: '#1a6fb8', cursor: 'pointer', display: 'flex', alignItems: 'center', gap: '4px' }}><IconAttachment style={{ color: '#1A6FB8' }} /><span>{name}</span></div>
    </Fragment>
  )
}