From 47e16d0a56559916c5fb9c4de08838e7a1d457d8 Mon Sep 17 00:00:00 2001
From: zhangyongtian <1181606322@qq.com>
Date: Mon, 09 Sep 2024 18:10:50 +0800
Subject: [PATCH] feat: 完善功能

---
 gz-customerSystem/src/components/personCard/DetailDialog.jsx |   88 ++++++++++++++++++++++++++------------------
 1 files changed, 52 insertions(+), 36 deletions(-)

diff --git a/gz-customerSystem/src/components/personCard/DetailDialog.jsx b/gz-customerSystem/src/components/personCard/DetailDialog.jsx
index a62c172..f5f7dce 100644
--- a/gz-customerSystem/src/components/personCard/DetailDialog.jsx
+++ b/gz-customerSystem/src/components/personCard/DetailDialog.jsx
@@ -1,6 +1,7 @@
 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";
 
 export default function DetailDialog(props) {
   const nuturalList = [
@@ -69,10 +70,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 +125,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 +186,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',
       },
     ],
   ]
@@ -281,23 +277,21 @@
       {
         label: '代理对象',
         value: '',
-        field: 'personList',
+        field: 'personId',
       },
     ],
     [
       {
         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 +322,16 @@
     newList = mapList.map(item => {
       return item.map(res => {
         if (res.isFile) {
-          return res
+          return {
+            ...res,
+            value: <>
+              {data[res.field]?.map(item => {
+                return <a target="_blank">
+                  <img src={link} alt="" className="title-file" />{item.name}
+                </a>
+              })}
+            </>
+          }
         }
         if (res.isName) {
           return {
@@ -337,9 +340,17 @@
             perClass: data.perClassName || data.perTypeName
           }
         } else {
-          return {
-            ...res,
-            value: res.field === 'personList' ? data[res.field].join(',') : data[res.field]
+          if (res.field === 'personId') {
+            const filterValue = props.personData.filter(result => data[res.field].indexOf(result.id) != -1).map(result => result.trueName).join(',')
+            return {
+              ...res,
+              value: filterValue
+            }
+          } else {
+            return {
+              ...res,
+              value: data[res.field]
+            }
           }
         }
       })
@@ -349,7 +360,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) => {
@@ -372,9 +388,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