From 5aa4a814ab8d4aa194a9683ebefaefdfc6d92c3a Mon Sep 17 00:00:00 2001 From: liuwh <964324856@qq.com> Date: Tue, 17 Sep 2024 17:18:05 +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 | 88 ++++++++++++++++++++++++++++---------------- 1 files changed, 56 insertions(+), 32 deletions(-) diff --git a/gz-customerSystem/src/components/personCard/DetailDialog.jsx b/gz-customerSystem/src/components/personCard/DetailDialog.jsx index 2e177df..2a94e1c 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 = [ @@ -69,10 +71,9 @@ [ { label: '身份证明材料', - value: <a href="your-link-here.html" target="_blank"> - <img src={link} alt="" className="title-file" />李晓明身份证明材料.pdf - </a>, - isFile: true + value: '', + isFile: true, + field: 'file', }, ], ] @@ -125,17 +126,15 @@ [ { label: '登记企业材料', - value: <a href="your-link-here.html" target="_blank"> - <img src={link} alt="" className="title-file" />广东好又多餐饮有限公司营业执照.pdf - </a>, - isFile: true + value: '', + isFile: true, + field: 'file', }, { label: '法定代表人身份证明材料', - value: <a href="your-link-here.html" target="_blank"> - <img src={link} alt="" className="title-file" />江照月个人身份.pdf - </a>, - isFile: true + value: '', + isFile: true, + field: 'file1', }, ], ] @@ -188,17 +187,15 @@ [ { label: '机构登记材料', - value: <a href="your-link-here.html" target="_blank"> - <img src={link} alt="" className="title-file" />广东好又多餐饮有限公司营业执照.pdf - </a>, - isFile: true + value: '', + isFile: true, + field: 'file', }, { label: '机构代表人身份证明材料', - value: <a href="your-link-here.html" target="_blank"> - <img src={link} alt="" className="title-file" />江照月个人身份.pdf - </a>, - isFile: true + value: '', + isFile: true, + field: 'file1', }, ], ] @@ -287,17 +284,15 @@ [ { label: '身份证明材料', - value: <a href="your-link-here.html" target="_blank"> - <img src={link} alt="" className="title-file" />广东好又多餐饮有限公司营业执照.pdf - </a>, + value: '', isFile: true, + field: 'file', }, { label: '代理人授权委托书', - value: <a href="your-link-here.html" target="_blank"> - <img src={link} alt="" className="title-file" />江照月个人身份.pdf - </a>, + value: '', isFile: true, + field: 'file1', }, ], ] @@ -328,7 +323,26 @@ newList = mapList.map(item => { return item.map(res => { if (res.isFile) { - return res + return { + ...res, + value: <> + {data[res.field]?.map((item, index) => { + if (item.response) { + //新上传的,前端数据 + const newData = item.response.data[0] + return <div style={{ display: 'inline-block' }}> + <PreviewImage name={newData.name} src={newData.showUrl} /> + {index !== data[res.field].length - 1 && <>,</>} + </div> + } else { + return <div style={{ display: 'inline-block' }}> + <PreviewImage name={item.name} src={item.showUrl} /> + {index !== data[res.field].length - 1 && <>,</>} + </div> + } + })} + </> + } } if (res.isName) { return { @@ -342,6 +356,11 @@ return { ...res, value: filterValue + } + } else if (res.field === 'extreme') { + return { + ...res, + value: data[res.field] === 0 ? '否' : '是' } } else { return { @@ -357,7 +376,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) => { @@ -380,9 +404,9 @@ } </table> {/* 重复来访重点人员 */} - <div style={{ width: 'calc(100% - 9px)', background: '#f2f3f5', marginBottom: '20px', padding: '12px' }}> + {/* <div style={{ width: 'calc(100% - 9px)', background: '#f2f3f5', marginBottom: '20px', padding: '12px' }}> <KeyVisits /> - </div> - </div> + </div> */} + </Scrollbars> ) } -- Gitblit v1.8.0