From 186bccedbc337c574c5e09327d34c4f660f6db31 Mon Sep 17 00:00:00 2001
From: 董国庆 <364620639@qq.com>
Date: 星期一, 17 三月 2025 14:17:40 +0800
Subject: [PATCH] 党员管理调试字段,接口

---
 management/src/pages/party/audit/components/index.jsx |   55 ++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 32 insertions(+), 23 deletions(-)

diff --git a/management/src/pages/party/audit/components/index.jsx b/management/src/pages/party/audit/components/index.jsx
index 9d071f4..99cac66 100644
--- a/management/src/pages/party/audit/components/index.jsx
+++ b/management/src/pages/party/audit/components/index.jsx
@@ -1,9 +1,9 @@
-import { Form, Input, Modal, Select, Upload, Space, Button, message, Row, Col, Divider } from 'antd';
+import { Form, Input, Modal, Image, Upload, Space, Cascader, message, Row, Col, Divider } from 'antd';
 import { sendRequest } from '@/utils/antdUtils';
 import { LoadingOutlined, PlusOutlined } from '@ant-design/icons';
 import { forwardRef, useEffect, useImperativeHandle, useState } from 'react';
 import { customRequest } from '@/utils/utils';
-import { add, Edit, getDetail } from '../service'
+import { audit, getDetail,regionTree } from '../service'
 
 const formItemLayout = {
   labelCol: { span: 8 },
@@ -15,6 +15,8 @@
   const [fileList, setFileList] = useState([])//banner图片
   const [loading, setLoading] = useState(false);
   const [editData, setEditData] = useState({})
+  const [userInfo, setUserInfo] = useState({})//党员信息
+  const [items, setItems] = useState([]);
 
   const formItemLayout = {
     labelCol: { span: 6 },
@@ -25,25 +27,21 @@
   useImperativeHandle(ref, () => {
     return {
       refreshData: (data) => {
-
         setEditData(data);
+        regionTree({}).then(res => {
+          setItems(() => res.data)
+        })
         if (data.id) {
-          // getDetail(data.id).then(res => {
-          //   if (res.data.url) {
-          //     let obj = [{
-          //       uid: 1,
-          //       name: 'banner',
-          //       url: res.data.url
-          //     }]
-          //     setFileList(obj)
-          //     form.setFieldsValue({ image: obj })
-          //   }
-          //   form.setFieldsValue({name: res.data.name})
-          // })
+          getDetail(data.id).then(res => {
+            res.data.community = [res.data.districtsCode, res.data.streetId, res.data.communityId.toString()]
+            setUserInfo(() => res.data)
+            form.setFieldsValue(res.data)
+          })
         }
       },
       clean: () => {
         form.resetFields();
+        setUserInfo({})
         setFileList([])
       },
     };
@@ -89,30 +87,41 @@
               <Input disabled placeholder='请输入'></Input>
             </Form.Item>
             <Form.Item
-              name="name"
+              name="community"
               label='所在社区'
               required
             >
-              <Input disabled placeholder='请输入'></Input>
+              <Cascader
+                disabled
+                options={items}
+                fieldNames={{ value: 'id', label: 'name' }}
+                placeholder="请选择"
+                // onChange={(value, label) => {
+                //   console.log('value', value, '1', label)
+                //   setCommunity(() => label)
+                // }}
+              // displayRender={(label) => label[label.length - 1]}
+              // changeOnSelect={true}
+              />
             </Form.Item>
             <Form.Item
-              name="name"
+              name="avatar"
               label='头像上传'
               required
             >
-              <Input disabled placeholder='请输入'></Input>
+              <Image src={userInfo.avatar} width={100} height={100} />
             </Form.Item>
           </Col>
           <Col span={8}>
             <Form.Item
-              name="name"
+              name="phone"
               label='联系电话'
               required
             >
               <Input disabled placeholder='请输入'></Input>
             </Form.Item>
             <Form.Item
-              name="name"
+              name="serviceTarget"
               label='服务对象'
               required
             >
@@ -120,14 +129,14 @@
             </Form.Item></Col>
           <Col span={8}>
             <Form.Item
-              name="name"
+              name="idMumber"
               label='身份证号'
               required
             >
               <Input disabled placeholder='请输入'></Input>
             </Form.Item>
             <Form.Item
-              name="name"
+              name="partyOrganization"
               label='所在党组织'
               required
             >

--
Gitblit v1.7.1