From 394e04ba31f0822255862033b8dffef17530495c Mon Sep 17 00:00:00 2001
From: zhangyongtian <1181606322@qq.com>
Date: Fri, 13 Sep 2024 22:49:01 +0800
Subject: [PATCH] fix: 受理跳转办理页面为空白的bug
---
gz-customerSystem/src/components/personCard/DetailDialog.jsx | 31 ++++++++++++++++++++++++-------
1 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/gz-customerSystem/src/components/personCard/DetailDialog.jsx b/gz-customerSystem/src/components/personCard/DetailDialog.jsx
index 183501d..9038fef 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 = [
@@ -324,10 +326,20 @@
return {
...res,
value: <>
- {data[res.field]?.map(item => {
- return <a target="_blank">
- <img src={link} alt="" className="title-file" />{item.name}
- </a>
+ {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>
+ }
})}
</>
}
@@ -359,7 +371,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 +402,6 @@
{/* <div style={{ width: 'calc(100% - 9px)', background: '#f2f3f5', marginBottom: '20px', padding: '12px' }}>
<KeyVisits />
</div> */}
- </div>
+ </Scrollbars>
)
}
--
Gitblit v1.8.0