forked from gzzfw/frontEnd/gzDyh

zhangyongtian
2024-08-30 558043a024fccd7ebb86b6927ae12757922c24c8
gz-customerSystem/src/components/personCard/index.jsx
@@ -6,20 +6,30 @@
 * @FilePath: \gzDyh\gz-customerSystem\src\components\personCard\index.jsx
 * @Description: 来访登记当事人卡片
 */
import React from 'react';
import React, { Fragment, useState } from 'react';
import PropTypes from 'prop-types';
import { Typography, Row, Col, Space, Tooltip } from 'antd';
import { Modal } from '@arco-design/web-react';
import { del, add } from '../../assets/images';
import * as $$ from '@/utils/utility';
import DetailDialog from "./DetailDialog";
const { Link, Text } = Typography;
/**
 * isCheck, // 是否无操作
 * data, // 当事人数据
 * handleCheckParty, // 点击查看详情
 * handleDeleteParty, // 删除当事人
 */
const PersonCard = ({ isCheck, data, handleCheckParty, handleDeleteParty, handleAdd, handleEdit }) => {
const PersonCard = ({ isCheck, data, handleDeleteParty, handleAdd, handleEdit }) => {
  const [editData, setEditData] = useState(null);
  const [detailVisabled, setDetailVisabled] = useState(false);//查看信息弹窗控制
  const [dialogType, setDialogType] = useState(0);//添加当事人的类型
  const peopleMap = {
    '15_020008-1': '申请方',
    '15_020008-2': '被申请方',
    '24_00006-1': '申请方代理人',
    '24_00006-2': '被申请方代理人'
  }
  let isAgent = false
  let isAgentFor = false
  const typeList = data.map(item => {
@@ -31,7 +41,15 @@
  if (typeList.indexOf('15_020008-2') != -1) {
    isAgentFor = true
  }
  const handleCheckParty = (value) => {
    setDialogType(value.perType)
    setEditData(value)
    setDetailVisabled(true)
  }
  return (
    <Fragment>
    <Row gutter={[24, 16]}>
      {data.map((x, t) => (
        <Col span={7} key={t}>
@@ -42,12 +60,12 @@
            >
              {x.trueName.substr(0, 1)}
              <div className="public-personCard-card-check">查看</div>
              <img
                {isCheck && <img
                src={del}
                alt=''
                style={{ width: '16px', height: '16px', position: 'absolute', top: '-8px', left: '56px' }}
                onClick={(event) => { handleDeleteParty(event, x) }}
              />
                />}
            </div>
            <div className="public-personCard-content">
              <div className="public-personCard-title">
@@ -88,6 +106,7 @@
          </div>
        </Col>
      ))}
        {isCheck &&
      <Col span={3}>
        <div className="dataSync-addBtn">
          <Tooltip
@@ -107,7 +126,25 @@
          </Tooltip>
        </div>
      </Col>
        }
    </Row>
      <Modal
        title={'查看' + peopleMap[dialogType]}
        visible={detailVisabled}
        onOk={() => setDetailVisabled(false)}
        onCancel={() => {
          setDetailVisabled(false)
          setEditData(null)
        }}
        autoFocus={false}
        focusLock={true}
        footer={null}
        unmountOnExit={true}
        maskClosable={false}
      >
        <DetailDialog editData={editData} />
      </Modal>
    </Fragment>
  );
};