|
@ -2,18 +2,18 @@ import React, { useEffect, useState } from 'react'; |
|
|
import { connect } from 'react-redux'; |
|
|
import { connect } from 'react-redux'; |
|
|
import { Form, Spin, Table } from 'antd'; |
|
|
import { Form, Spin, Table } from 'antd'; |
|
|
import { DrawerForm, ProForm, ProFormText, ProFormSelect } from '@ant-design/pro-form'; |
|
|
import { DrawerForm, ProForm, ProFormText, ProFormSelect } from '@ant-design/pro-form'; |
|
|
import { putRoadway, putSpecificVehicle, putHouseholds,putCircuit,putVehicle,putPurchase } from "../../actions/infor" |
|
|
import { putRoadway, putSpecificVehicle, putHouseholds, putCircuit, putVehicle, putPurchase } from "../../actions/infor" |
|
|
import { putBridge } from "../../actions/infor" |
|
|
import { putBridge } from "../../actions/infor" |
|
|
import _ from 'lodash' |
|
|
import _ from 'lodash' |
|
|
const UserModal = (props) => { |
|
|
const UserModal = (props) => { |
|
|
const { visible, onVisibleChange, typecard, rewkeys, data, recortd, sitename,setDelet, dispatch, setRecortd, engineering,whichofits } = props |
|
|
const { visible, onVisibleChange, typecard, rewkeys, data, recortd, sitename, setDelet, dispatch, setRecortd, engineering, whichofits, villageList } = props |
|
|
const [newlys, setNewlys] = useState() //必填数据
|
|
|
const [newlys, setNewlys] = useState() //必填数据
|
|
|
const [newlysay, setNewlysay] = useState() //处理hou
|
|
|
const [newlysay, setNewlysay] = useState() //处理hou
|
|
|
const [records, setRecords] = useState()//处理
|
|
|
const [records, setRecords] = useState()//处理
|
|
|
const [recordsay, setRecordsay] = useState()//必填数据
|
|
|
const [recordsay, setRecordsay] = useState()//必填数据
|
|
|
// const [success, setSuccess] = useState() //状态
|
|
|
// const [success, setSuccess] = useState() //状态
|
|
|
// const [establishment, setEstablishment] = useState() //业户类型
|
|
|
// const [establishment, setEstablishment] = useState() //业户类型
|
|
|
// console.log(recortd)
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
const array = [] |
|
|
const array = [] |
|
|
if (rewkeys === 'transportation') { |
|
|
if (rewkeys === 'transportation') { |
|
@ -64,7 +64,7 @@ const UserModal = (props) => { |
|
|
}); |
|
|
}); |
|
|
setNewlys(array?.splice(0, 2)) |
|
|
setNewlys(array?.splice(0, 2)) |
|
|
setNewlysay(array) |
|
|
setNewlysay(array) |
|
|
}if (rewkeys === 'zhichao') { |
|
|
} if (rewkeys === 'zhichao') { |
|
|
_.forIn(data, function (value, key) { |
|
|
_.forIn(data, function (value, key) { |
|
|
array.push({ name: value, type: key }) |
|
|
array.push({ name: value, type: key }) |
|
|
}); |
|
|
}); |
|
@ -272,6 +272,17 @@ const UserModal = (props) => { |
|
|
{typecard == 'compile' ? |
|
|
{typecard == 'compile' ? |
|
|
<ProForm.Group |
|
|
<ProForm.Group |
|
|
> |
|
|
> |
|
|
|
|
|
{rewkeys == 'transportation' && whichofits == '村' ? |
|
|
|
|
|
<ProFormSelect |
|
|
|
|
|
width="md" |
|
|
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
|
|
|
options={villageList || []} |
|
|
|
|
|
placeholder="请选择所属行政村" |
|
|
|
|
|
showSearch={true} |
|
|
|
|
|
name='villageId' |
|
|
|
|
|
label='所属行政村' |
|
|
|
|
|
/> : null |
|
|
|
|
|
} |
|
|
<ProFormText |
|
|
<ProFormText |
|
|
name={newlys?.[0]?.type} |
|
|
name={newlys?.[0]?.type} |
|
|
width="md" |
|
|
width="md" |
|
@ -314,6 +325,17 @@ const UserModal = (props) => { |
|
|
|
|
|
|
|
|
</ProForm.Group> |
|
|
</ProForm.Group> |
|
|
: <ProForm.Group> |
|
|
: <ProForm.Group> |
|
|
|
|
|
{rewkeys == 'transportation' && whichofits == '村' ? |
|
|
|
|
|
<ProFormSelect |
|
|
|
|
|
width="md" |
|
|
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
|
|
|
options={villageList || []} |
|
|
|
|
|
placeholder="请选择所属行政村" |
|
|
|
|
|
showSearch={true} |
|
|
|
|
|
name='villageId' |
|
|
|
|
|
label='所属行政村' |
|
|
|
|
|
/> : null |
|
|
|
|
|
} |
|
|
<ProFormText |
|
|
<ProFormText |
|
|
name={newlys?.[0]?.type} |
|
|
name={newlys?.[0]?.type} |
|
|
width="md" |
|
|
width="md" |
|
@ -347,6 +369,7 @@ const UserModal = (props) => { |
|
|
label='类型' |
|
|
label='类型' |
|
|
/> : null |
|
|
/> : null |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
{newlysay?.map((item, index) => { |
|
|
{newlysay?.map((item, index) => { |
|
|
return <ProFormText width="md" |
|
|
return <ProFormText width="md" |
|
|
name={item?.type} label={newlysay[index]?.name} placeholder="请输入名称" key={index} |
|
|
name={item?.type} label={newlysay[index]?.name} placeholder="请输入名称" key={index} |
|
@ -363,7 +386,7 @@ const UserModal = (props) => { |
|
|
</Spin> |
|
|
</Spin> |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
function mapStateToProps(state) { |
|
|
function mapStateToProps (state) { |
|
|
const { depMessage } = state; |
|
|
const { depMessage } = state; |
|
|
const pakData = (dep) => { |
|
|
const pakData = (dep) => { |
|
|
return dep.map((d) => { |
|
|
return dep.map((d) => { |
|
|