From 9f705a54328c4b59ad9566c521bc6e0e7577acb3 Mon Sep 17 00:00:00 2001 From: liuwh <964324856@qq.com> Date: Fri, 13 Sep 2024 19:10:30 +0800 Subject: [PATCH] Merge branch 'master' of http://120.79.193.119:9090/r/gzzfw/frontEnd/gzDyh into master --- gz-customerSystem/src/components/personCard/DetailDialog.jsx | 24 ++++++++++++++++++------ 1 files changed, 18 insertions(+), 6 deletions(-) diff --git a/gz-customerSystem/src/components/personCard/DetailDialog.jsx b/gz-customerSystem/src/components/personCard/DetailDialog.jsx index 183501d..814f556 100644 --- a/gz-customerSystem/src/components/personCard/DetailDialog.jsx +++ b/gz-customerSystem/src/components/personCard/DetailDialog.jsx @@ -1,6 +1,8 @@ import React, { useEffect, useState } from 'react' import KeyVisits from "./KeyVisits"; -import { link } from '@/assets/images' +import { link } from '@/assets/images'; +import { Scrollbars } from "react-custom-scrollbars"; +import PreviewImage from '../PreviewImage'; export default function DetailDialog(props) { const nuturalList = [ @@ -325,9 +327,14 @@ ...res, value: <> {data[res.field]?.map(item => { - return <a target="_blank"> - <img src={link} alt="" className="title-file" />{item.name} - </a> + console.log(item); + if(item.response) { + //新上传的,前端数据 + const data = item.response.data[0] + return <PreviewImage name={data.name} src={data.showUrl} /> + } else { + return <PreviewImage name={item.name} src={item.showUrl} /> + } })} </> } @@ -359,7 +366,12 @@ }, []) return ( - <div style={{ maxHeight: '590px', overflowY: 'scroll' }}> + <Scrollbars + autoHide + autoHeight + autoHeightMin={200} // 最小高度为300px + autoHeightMax={590} + > <table border="1" align="center" cellpadding="8" className="table" style={{ marginBottom: '20px' }}> { tableList?.map((item, index) => { @@ -385,6 +397,6 @@ {/* <div style={{ width: 'calc(100% - 9px)', background: '#f2f3f5', marginBottom: '20px', padding: '12px' }}> <KeyVisits /> </div> */} - </div> + </Scrollbars> ) } -- Gitblit v1.8.0