|
|
@ -2,382 +2,405 @@ import React, { useEffect, useState } from 'react'; |
|
|
|
import { connect } from 'react-redux'; |
|
|
|
import { Form, Spin, Table } from 'antd'; |
|
|
|
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 _ from 'lodash' |
|
|
|
import _ from 'lodash' |
|
|
|
const UserModal = (props) => { |
|
|
|
const { visible, onVisibleChange, typecard, rewkeys, data, recortd, sitename,setDelet, dispatch, setRecortd, engineering,whichofits } = props |
|
|
|
const [newlys, setNewlys] = useState() //必填数据
|
|
|
|
const [newlysay, setNewlysay] = useState() //处理hou
|
|
|
|
const [records, setRecords] = useState()//处理
|
|
|
|
const [recordsay, setRecordsay] = useState()//必填数据
|
|
|
|
// const [success, setSuccess] = useState() //状态
|
|
|
|
// const [establishment, setEstablishment] = useState() //业户类型
|
|
|
|
// console.log(recortd)
|
|
|
|
useEffect(() => { |
|
|
|
const array = [] |
|
|
|
if (rewkeys === 'transportation') { |
|
|
|
const xindata = [...data] |
|
|
|
setNewlys(xindata?.splice(0, 2)) |
|
|
|
setNewlysay(xindata) |
|
|
|
} if (rewkeys === 'bridge') { |
|
|
|
_.forIn(data, function (value, key) { |
|
|
|
array.push({ name: value, type: key }) |
|
|
|
}); |
|
|
|
setNewlys(array?.splice(0, 2)) |
|
|
|
setNewlysay(array) |
|
|
|
// console.log(array)
|
|
|
|
} |
|
|
|
if (rewkeys === 'weihuo') { |
|
|
|
_.forIn(data, function (value, key) { |
|
|
|
array.push({ name: value, type: key }) |
|
|
|
}); |
|
|
|
setNewlys(array?.splice(0, 2)) |
|
|
|
setNewlysay(array) |
|
|
|
// console.log(array)
|
|
|
|
} |
|
|
|
if (rewkeys === 'chuzu') { |
|
|
|
_.forIn(data, function (value, key) { |
|
|
|
array.push({ name: value, type: key }) |
|
|
|
}); |
|
|
|
array?.splice(1, 1) |
|
|
|
setNewlys(array?.splice(0, 2)) |
|
|
|
setNewlysay(array) |
|
|
|
} |
|
|
|
if (rewkeys === 'yehu') { |
|
|
|
_.forIn(data, function (value, key) { |
|
|
|
array.push({ name: value, type: key }) |
|
|
|
}); |
|
|
|
setNewlys(array?.splice(0, 2)) |
|
|
|
const { visible, onVisibleChange, typecard, rewkeys, data, recortd, sitename, setDelet, dispatch, setRecortd, engineering, whichofits, villageList } = props |
|
|
|
const [newlys, setNewlys] = useState() //必填数据
|
|
|
|
const [newlysay, setNewlysay] = useState() //处理hou
|
|
|
|
const [records, setRecords] = useState()//处理
|
|
|
|
const [recordsay, setRecordsay] = useState()//必填数据
|
|
|
|
// const [success, setSuccess] = useState() //状态
|
|
|
|
// const [establishment, setEstablishment] = useState() //业户类型
|
|
|
|
|
|
|
|
setNewlysay(array) |
|
|
|
// console.log(array)
|
|
|
|
} if (rewkeys === 'xianlu') { |
|
|
|
_.forIn(data, function (value, key) { |
|
|
|
array.push({ name: value, type: key }) |
|
|
|
}); |
|
|
|
setNewlys(array?.splice(0, 2)) |
|
|
|
setNewlysay(array) |
|
|
|
} if (rewkeys === 'cheliang') { |
|
|
|
_.forIn(data, function (value, key) { |
|
|
|
array.push({ name: value, type: key }) |
|
|
|
}); |
|
|
|
setNewlys(array?.splice(0, 2)) |
|
|
|
setNewlysay(array) |
|
|
|
}if (rewkeys === 'zhichao') { |
|
|
|
_.forIn(data, function (value, key) { |
|
|
|
array.push({ name: value, type: key }) |
|
|
|
}); |
|
|
|
setNewlys(array?.splice(0, 2)) |
|
|
|
setNewlysay(array) |
|
|
|
} |
|
|
|
}, []) |
|
|
|
useEffect(() => { |
|
|
|
const arr = [] |
|
|
|
if (rewkeys === 'transportation') { |
|
|
|
_.forIn(recortd, function (value, key) { |
|
|
|
arr.push({ value: value, type: key }) |
|
|
|
}); |
|
|
|
setRecordsay(arr.splice(1, 2)) |
|
|
|
setRecords(arr) |
|
|
|
} |
|
|
|
if (rewkeys === 'bridge') { |
|
|
|
_.forIn(recortd, function (value, key) { |
|
|
|
arr.push({ value: value, type: key }) |
|
|
|
}); |
|
|
|
setRecordsay(arr.splice(1, 2)) |
|
|
|
setRecords(arr) |
|
|
|
} |
|
|
|
if (rewkeys === 'weihuo') { |
|
|
|
_.forIn(recortd, function (value, key) { |
|
|
|
arr.push({ value: value, type: key }) |
|
|
|
}); |
|
|
|
setRecordsay(arr.splice(1, 2)) |
|
|
|
setRecords(arr) |
|
|
|
} |
|
|
|
if (rewkeys === 'chuzu') { |
|
|
|
_.forIn(recortd, function (value, key) { |
|
|
|
arr.push({ value: value, type: key }) |
|
|
|
}); |
|
|
|
setRecordsay(arr.splice(1, 2)) |
|
|
|
setRecords(arr) |
|
|
|
} if (rewkeys === 'yehu') { |
|
|
|
_.forIn(recortd, function (value, key) { |
|
|
|
arr.push({ value: value, type: key }) |
|
|
|
}); |
|
|
|
setRecordsay(arr.splice(1, 2)) |
|
|
|
// setEstablishment(arr.splice(-1, 1))
|
|
|
|
setRecords(arr) |
|
|
|
} |
|
|
|
if (rewkeys === 'xianlu') { |
|
|
|
_.forIn(recortd, function (value, key) { |
|
|
|
arr.push({ value: value, type: key }) |
|
|
|
}); |
|
|
|
setRecordsay(arr.splice(1, 2)) |
|
|
|
// setEstablishment(arr.splice(-1, 1))
|
|
|
|
setRecords(arr) |
|
|
|
} if (rewkeys === 'cheliang') { |
|
|
|
_.forIn(recortd, function (value, key) { |
|
|
|
arr.push({ value: value, type: key }) |
|
|
|
}); |
|
|
|
setRecordsay(arr.splice(1, 2)) |
|
|
|
// setEstablishment(arr.splice(-1, 1))
|
|
|
|
setRecords(arr) |
|
|
|
} |
|
|
|
}, [recortd]) |
|
|
|
useEffect(() => { |
|
|
|
return () => { |
|
|
|
setRecortd() |
|
|
|
} |
|
|
|
}, [setRecortd]) |
|
|
|
// console.log(recortd)
|
|
|
|
return ( |
|
|
|
<Spin spinning={false}> |
|
|
|
{/* { |
|
|
|
newlysay ? */} |
|
|
|
<DrawerForm |
|
|
|
width={'90rem'} |
|
|
|
visible={visible} |
|
|
|
onVisibleChange={onVisibleChange} |
|
|
|
onFinish={(values) => { |
|
|
|
if (Object.values(values).length > 0) { |
|
|
|
if (rewkeys === 'transportation') { |
|
|
|
if (typecard == 'compile') { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, level: whichofits, roadId: records?.[0]?.value || '' } |
|
|
|
dispatch(putRoadway(query)).then((res) => { |
|
|
|
useEffect(() => { |
|
|
|
const array = [] |
|
|
|
if (rewkeys === 'transportation') { |
|
|
|
const xindata = [...data] |
|
|
|
setNewlys(xindata?.splice(0, 2)) |
|
|
|
setNewlysay(xindata) |
|
|
|
} if (rewkeys === 'bridge') { |
|
|
|
_.forIn(data, function (value, key) { |
|
|
|
array.push({ name: value, type: key }) |
|
|
|
}); |
|
|
|
setNewlys(array?.splice(0, 2)) |
|
|
|
setNewlysay(array) |
|
|
|
// console.log(array)
|
|
|
|
} |
|
|
|
if (rewkeys === 'weihuo') { |
|
|
|
_.forIn(data, function (value, key) { |
|
|
|
array.push({ name: value, type: key }) |
|
|
|
}); |
|
|
|
setNewlys(array?.splice(0, 2)) |
|
|
|
setNewlysay(array) |
|
|
|
// console.log(array)
|
|
|
|
} |
|
|
|
if (rewkeys === 'chuzu') { |
|
|
|
_.forIn(data, function (value, key) { |
|
|
|
array.push({ name: value, type: key }) |
|
|
|
}); |
|
|
|
array?.splice(1, 1) |
|
|
|
setNewlys(array?.splice(0, 2)) |
|
|
|
setNewlysay(array) |
|
|
|
} |
|
|
|
if (rewkeys === 'yehu') { |
|
|
|
_.forIn(data, function (value, key) { |
|
|
|
array.push({ name: value, type: key }) |
|
|
|
}); |
|
|
|
setNewlys(array?.splice(0, 2)) |
|
|
|
|
|
|
|
}) |
|
|
|
return true |
|
|
|
} else { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, level: whichofits } |
|
|
|
dispatch(putRoadway(query)).then((res) => { |
|
|
|
setNewlysay(array) |
|
|
|
// console.log(array)
|
|
|
|
} if (rewkeys === 'xianlu') { |
|
|
|
_.forIn(data, function (value, key) { |
|
|
|
array.push({ name: value, type: key }) |
|
|
|
}); |
|
|
|
setNewlys(array?.splice(0, 2)) |
|
|
|
setNewlysay(array) |
|
|
|
} if (rewkeys === 'cheliang') { |
|
|
|
_.forIn(data, function (value, key) { |
|
|
|
array.push({ name: value, type: key }) |
|
|
|
}); |
|
|
|
setNewlys(array?.splice(0, 2)) |
|
|
|
setNewlysay(array) |
|
|
|
} if (rewkeys === 'zhichao') { |
|
|
|
_.forIn(data, function (value, key) { |
|
|
|
array.push({ name: value, type: key }) |
|
|
|
}); |
|
|
|
setNewlys(array?.splice(0, 2)) |
|
|
|
setNewlysay(array) |
|
|
|
} |
|
|
|
}, []) |
|
|
|
useEffect(() => { |
|
|
|
const arr = [] |
|
|
|
if (rewkeys === 'transportation') { |
|
|
|
_.forIn(recortd, function (value, key) { |
|
|
|
arr.push({ value: value, type: key }) |
|
|
|
}); |
|
|
|
setRecordsay(arr.splice(1, 2)) |
|
|
|
setRecords(arr) |
|
|
|
} |
|
|
|
if (rewkeys === 'bridge') { |
|
|
|
_.forIn(recortd, function (value, key) { |
|
|
|
arr.push({ value: value, type: key }) |
|
|
|
}); |
|
|
|
setRecordsay(arr.splice(1, 2)) |
|
|
|
setRecords(arr) |
|
|
|
} |
|
|
|
if (rewkeys === 'weihuo') { |
|
|
|
_.forIn(recortd, function (value, key) { |
|
|
|
arr.push({ value: value, type: key }) |
|
|
|
}); |
|
|
|
setRecordsay(arr.splice(1, 2)) |
|
|
|
setRecords(arr) |
|
|
|
} |
|
|
|
if (rewkeys === 'chuzu') { |
|
|
|
_.forIn(recortd, function (value, key) { |
|
|
|
arr.push({ value: value, type: key }) |
|
|
|
}); |
|
|
|
setRecordsay(arr.splice(1, 2)) |
|
|
|
setRecords(arr) |
|
|
|
} if (rewkeys === 'yehu') { |
|
|
|
_.forIn(recortd, function (value, key) { |
|
|
|
arr.push({ value: value, type: key }) |
|
|
|
}); |
|
|
|
setRecordsay(arr.splice(1, 2)) |
|
|
|
// setEstablishment(arr.splice(-1, 1))
|
|
|
|
setRecords(arr) |
|
|
|
} |
|
|
|
if (rewkeys === 'xianlu') { |
|
|
|
_.forIn(recortd, function (value, key) { |
|
|
|
arr.push({ value: value, type: key }) |
|
|
|
}); |
|
|
|
setRecordsay(arr.splice(1, 2)) |
|
|
|
// setEstablishment(arr.splice(-1, 1))
|
|
|
|
setRecords(arr) |
|
|
|
} if (rewkeys === 'cheliang') { |
|
|
|
_.forIn(recortd, function (value, key) { |
|
|
|
arr.push({ value: value, type: key }) |
|
|
|
}); |
|
|
|
setRecordsay(arr.splice(1, 2)) |
|
|
|
// setEstablishment(arr.splice(-1, 1))
|
|
|
|
setRecords(arr) |
|
|
|
} |
|
|
|
}, [recortd]) |
|
|
|
useEffect(() => { |
|
|
|
return () => { |
|
|
|
setRecortd() |
|
|
|
} |
|
|
|
}, [setRecortd]) |
|
|
|
// console.log(recortd)
|
|
|
|
return ( |
|
|
|
<Spin spinning={false}> |
|
|
|
{/* { |
|
|
|
newlysay ? */} |
|
|
|
<DrawerForm |
|
|
|
width={'90rem'} |
|
|
|
visible={visible} |
|
|
|
onVisibleChange={onVisibleChange} |
|
|
|
onFinish={(values) => { |
|
|
|
if (Object.values(values).length > 0) { |
|
|
|
if (rewkeys === 'transportation') { |
|
|
|
if (typecard == 'compile') { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, level: whichofits, roadId: records?.[0]?.value || '' } |
|
|
|
dispatch(putRoadway(query)).then((res) => { |
|
|
|
|
|
|
|
}) |
|
|
|
return true |
|
|
|
} else { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, level: whichofits } |
|
|
|
dispatch(putRoadway(query)).then((res) => { |
|
|
|
|
|
|
|
}) |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
if (rewkeys === 'bridge') { |
|
|
|
if (typecard == 'compile') { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, roadId: records?.[0]?.value || '' } |
|
|
|
dispatch(putBridge(query)).then((res) => { |
|
|
|
|
|
|
|
}) |
|
|
|
return true |
|
|
|
} else { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values } |
|
|
|
dispatch(putBridge(query)).then((res) => { |
|
|
|
}) |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
if (rewkeys === 'bridge') { |
|
|
|
if (typecard == 'compile') { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, roadId: records?.[0]?.value || '' } |
|
|
|
dispatch(putBridge(query)).then((res) => { |
|
|
|
|
|
|
|
}) |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
if (rewkeys === 'weihuo' || rewkeys === 'chuzu') { |
|
|
|
if (typecard == 'compile') { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, vehicleId: records?.[0]?.value || '', type: rewkeys == 'chuzu' ? '出租车' : '危货' } |
|
|
|
dispatch(putSpecificVehicle(query)).then((res) => { |
|
|
|
}) |
|
|
|
return true |
|
|
|
} else { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values } |
|
|
|
dispatch(putBridge(query)).then((res) => { |
|
|
|
|
|
|
|
}) |
|
|
|
return true |
|
|
|
} else { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, type: rewkeys == 'chuzu' ? '出租车' : '危货' } |
|
|
|
dispatch(putSpecificVehicle(query)).then((res) => { |
|
|
|
}) |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
if (rewkeys === 'weihuo' || rewkeys === 'chuzu') { |
|
|
|
if (typecard == 'compile') { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, vehicleId: records?.[0]?.value || '', type: rewkeys == 'chuzu' ? '出租车' : '危货' } |
|
|
|
dispatch(putSpecificVehicle(query)).then((res) => { |
|
|
|
|
|
|
|
}) |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
if (rewkeys === 'yehu') { |
|
|
|
if (typecard == 'compile') { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, businessId: records?.[0]?.value, type: rewkeys == 'chuzu' ? '出租车' : '危货' } |
|
|
|
dispatch(putHouseholds(query)).then((res) => { |
|
|
|
}) |
|
|
|
return true |
|
|
|
} else { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, type: rewkeys == 'chuzu' ? '出租车' : '危货' } |
|
|
|
dispatch(putSpecificVehicle(query)).then((res) => { |
|
|
|
|
|
|
|
}) |
|
|
|
return true |
|
|
|
} else { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, type: rewkeys === 'chuzu' ? '出租车' : '危货' } |
|
|
|
dispatch(putHouseholds(query)).then((res) => { |
|
|
|
}) |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
if (rewkeys === 'yehu') { |
|
|
|
if (typecard == 'compile') { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, businessId: records?.[0]?.value, type: rewkeys == 'chuzu' ? '出租车' : '危货' } |
|
|
|
dispatch(putHouseholds(query)).then((res) => { |
|
|
|
|
|
|
|
}) |
|
|
|
return true |
|
|
|
} |
|
|
|
} if (rewkeys === 'xianlu') { |
|
|
|
if (typecard == 'compile') { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, lineId: records?.[0]?.value || '' } |
|
|
|
dispatch(putCircuit(query)).then((res) => { |
|
|
|
}) |
|
|
|
return true |
|
|
|
} else { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, type: rewkeys === 'chuzu' ? '出租车' : '危货' } |
|
|
|
dispatch(putHouseholds(query)).then((res) => { |
|
|
|
|
|
|
|
}) |
|
|
|
return true |
|
|
|
} else { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values } |
|
|
|
dispatch(putCircuit(query)).then((res) => { |
|
|
|
}) |
|
|
|
return true |
|
|
|
} |
|
|
|
} if (rewkeys === 'xianlu') { |
|
|
|
if (typecard == 'compile') { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, lineId: records?.[0]?.value || '' } |
|
|
|
dispatch(putCircuit(query)).then((res) => { |
|
|
|
|
|
|
|
}) |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
if (rewkeys === 'cheliang') { |
|
|
|
if (typecard == 'compile') { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, carId: records?.[0]?.value || '' } |
|
|
|
dispatch(putVehicle(query)).then((res) => { |
|
|
|
}) |
|
|
|
return true |
|
|
|
} else { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values } |
|
|
|
dispatch(putCircuit(query)).then((res) => { |
|
|
|
|
|
|
|
}) |
|
|
|
return true |
|
|
|
} else { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values } |
|
|
|
dispatch(putVehicle(query)).then((res) => { |
|
|
|
}) |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
if (rewkeys === 'cheliang') { |
|
|
|
if (typecard == 'compile') { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, carId: records?.[0]?.value || '' } |
|
|
|
dispatch(putVehicle(query)).then((res) => { |
|
|
|
|
|
|
|
}) |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
if (rewkeys == 'zhichao') { |
|
|
|
}) |
|
|
|
return true |
|
|
|
} else { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values } |
|
|
|
dispatch(putVehicle(query)).then((res) => { |
|
|
|
|
|
|
|
if (typecard == 'compile') { |
|
|
|
console.log(typecard) |
|
|
|
}) |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
if (rewkeys == 'zhichao') { |
|
|
|
|
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, overspeedId: records?.[0]?.value || '' } |
|
|
|
dispatch(putPurchase(query)).then((res) => { |
|
|
|
console.log(res) |
|
|
|
}) |
|
|
|
return true |
|
|
|
} else { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values } |
|
|
|
dispatch(putPurchase(query)).then((res) => { |
|
|
|
console.log(res) |
|
|
|
if (typecard == 'compile') { |
|
|
|
console.log(typecard) |
|
|
|
|
|
|
|
}) |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
} else { return false } |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, overspeedId: records?.[0]?.value || '' } |
|
|
|
dispatch(putPurchase(query)).then((res) => { |
|
|
|
console.log(res) |
|
|
|
}) |
|
|
|
return true |
|
|
|
} else { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values } |
|
|
|
dispatch(putPurchase(query)).then((res) => { |
|
|
|
console.log(res) |
|
|
|
|
|
|
|
}} |
|
|
|
initialValues={recortd} |
|
|
|
> |
|
|
|
{typecard == 'compile' ? |
|
|
|
<ProForm.Group |
|
|
|
> |
|
|
|
<ProFormText |
|
|
|
name={newlys?.[0]?.type} |
|
|
|
width="md" |
|
|
|
label={newlys?.[0]?.name} |
|
|
|
}) |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
} else { return false } |
|
|
|
|
|
|
|
placeholder="请输入名称" |
|
|
|
value={recordsay?.[0]?.value} |
|
|
|
}} |
|
|
|
initialValues={recortd} |
|
|
|
> |
|
|
|
{typecard == 'compile' ? |
|
|
|
<ProForm.Group |
|
|
|
> |
|
|
|
{rewkeys == 'transportation' && whichofits == '村' ? |
|
|
|
<ProFormSelect |
|
|
|
width="md" |
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
|
/><ProFormText |
|
|
|
name={newlys?.[1]?.type} |
|
|
|
width="md" |
|
|
|
label={newlys?.[1]?.name} |
|
|
|
options={villageList || []} |
|
|
|
placeholder="请选择所属行政村" |
|
|
|
showSearch={true} |
|
|
|
name='villageId' |
|
|
|
label='所属行政村' |
|
|
|
/> : null |
|
|
|
} |
|
|
|
<ProFormText |
|
|
|
name={newlys?.[0]?.type} |
|
|
|
width="md" |
|
|
|
label={newlys?.[0]?.name} |
|
|
|
|
|
|
|
placeholder="请输入名称" |
|
|
|
value={recordsay?.[1]?.value} |
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
|
/> |
|
|
|
{rewkeys === 'yehu' ? |
|
|
|
<ProFormSelect |
|
|
|
rules={[{ required: true, message: "必填" }]} |
|
|
|
options={[ |
|
|
|
{ |
|
|
|
value: '出租车', |
|
|
|
label: '出租车', |
|
|
|
}, { |
|
|
|
value: '危货', |
|
|
|
label: '危险货运', |
|
|
|
}, |
|
|
|
]} |
|
|
|
name='type' |
|
|
|
label='类型' |
|
|
|
/> : null |
|
|
|
} |
|
|
|
{newlysay?.map((item, index) => { |
|
|
|
return <ProFormText width="md" |
|
|
|
name={item?.type} label={newlysay[index]?.name} placeholder="请输入名称" |
|
|
|
key={index} |
|
|
|
/> |
|
|
|
})} |
|
|
|
placeholder="请输入名称" |
|
|
|
value={recordsay?.[0]?.value} |
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
|
/><ProFormText |
|
|
|
name={newlys?.[1]?.type} |
|
|
|
width="md" |
|
|
|
label={newlys?.[1]?.name} |
|
|
|
|
|
|
|
</ProForm.Group> |
|
|
|
: <ProForm.Group> |
|
|
|
<ProFormText |
|
|
|
name={newlys?.[0]?.type} |
|
|
|
width="md" |
|
|
|
label={newlys?.[0]?.name} |
|
|
|
placeholder="请输入名称" |
|
|
|
value={recordsay?.[1]?.value} |
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
|
/> |
|
|
|
{rewkeys === 'yehu' ? |
|
|
|
<ProFormSelect |
|
|
|
rules={[{ required: true, message: "必填" }]} |
|
|
|
options={[ |
|
|
|
{ |
|
|
|
value: '出租车', |
|
|
|
label: '出租车', |
|
|
|
}, { |
|
|
|
value: '危货', |
|
|
|
label: '危险货运', |
|
|
|
}, |
|
|
|
]} |
|
|
|
name='type' |
|
|
|
label='类型' |
|
|
|
/> : null |
|
|
|
} |
|
|
|
{newlysay?.map((item, index) => { |
|
|
|
return <ProFormText width="md" |
|
|
|
name={item?.type} label={newlysay[index]?.name} placeholder="请输入名称" |
|
|
|
key={index} |
|
|
|
/> |
|
|
|
})} |
|
|
|
|
|
|
|
placeholder="请输入名称" |
|
|
|
// value={recordssy?.[0]?.value}
|
|
|
|
</ProForm.Group> |
|
|
|
: <ProForm.Group> |
|
|
|
{rewkeys == 'transportation' && whichofits == '村' ? |
|
|
|
<ProFormSelect |
|
|
|
width="md" |
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
|
/><ProFormText |
|
|
|
name={newlys?.[1]?.type} |
|
|
|
width="md" |
|
|
|
label={newlys?.[1]?.name} |
|
|
|
options={villageList || []} |
|
|
|
placeholder="请选择所属行政村" |
|
|
|
showSearch={true} |
|
|
|
name='villageId' |
|
|
|
label='所属行政村' |
|
|
|
/> : null |
|
|
|
} |
|
|
|
<ProFormText |
|
|
|
name={newlys?.[0]?.type} |
|
|
|
width="md" |
|
|
|
label={newlys?.[0]?.name} |
|
|
|
|
|
|
|
placeholder="请输入名称" |
|
|
|
// value={recordssy?.[1]?.value}
|
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
|
/> |
|
|
|
{rewkeys === 'yehu' ? |
|
|
|
<ProFormSelect |
|
|
|
rules={[{ required: true, message: "必填" }]} |
|
|
|
options={[ |
|
|
|
{ |
|
|
|
value: '出租车', |
|
|
|
label: '出租车', |
|
|
|
}, { |
|
|
|
value: '危货', |
|
|
|
label: '危险货运', |
|
|
|
}, |
|
|
|
]} |
|
|
|
name='type' |
|
|
|
label='类型' |
|
|
|
/> : null |
|
|
|
} |
|
|
|
{newlysay?.map((item, index) => { |
|
|
|
return <ProFormText width="md" |
|
|
|
name={item?.type} label={newlysay[index]?.name} placeholder="请输入名称" key={index} |
|
|
|
placeholder="请输入名称" |
|
|
|
// value={recordssy?.[0]?.value}
|
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
|
/><ProFormText |
|
|
|
name={newlys?.[1]?.type} |
|
|
|
width="md" |
|
|
|
label={newlys?.[1]?.name} |
|
|
|
|
|
|
|
placeholder="请输入名称" |
|
|
|
// value={recordssy?.[1]?.value}
|
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
|
/> |
|
|
|
{rewkeys === 'yehu' ? |
|
|
|
<ProFormSelect |
|
|
|
rules={[{ required: true, message: "必填" }]} |
|
|
|
options={[ |
|
|
|
{ |
|
|
|
value: '出租车', |
|
|
|
label: '出租车', |
|
|
|
}, { |
|
|
|
value: '危货', |
|
|
|
label: '危险货运', |
|
|
|
}, |
|
|
|
]} |
|
|
|
name='type' |
|
|
|
label='类型' |
|
|
|
/> : null |
|
|
|
} |
|
|
|
|
|
|
|
{newlysay?.map((item, index) => { |
|
|
|
return <ProFormText width="md" |
|
|
|
name={item?.type} label={newlysay[index]?.name} placeholder="请输入名称" key={index} |
|
|
|
|
|
|
|
|
|
|
|
/> |
|
|
|
})} |
|
|
|
</ProForm.Group>} |
|
|
|
/> |
|
|
|
})} |
|
|
|
</ProForm.Group>} |
|
|
|
|
|
|
|
</DrawerForm> |
|
|
|
{/* : '' |
|
|
|
</DrawerForm> |
|
|
|
{/* : '' |
|
|
|
} */} |
|
|
|
|
|
|
|
</Spin> |
|
|
|
) |
|
|
|
</Spin> |
|
|
|
) |
|
|
|
} |
|
|
|
function mapStateToProps(state) { |
|
|
|
const { depMessage } = state; |
|
|
|
const pakData = (dep) => { |
|
|
|
return dep.map((d) => { |
|
|
|
return { |
|
|
|
title: d.name, |
|
|
|
value: d.id, |
|
|
|
children: pakData(d.subordinate) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
let depData = pakData(depMessage.data || []) |
|
|
|
return { |
|
|
|
loading: depMessage.isRequesting, |
|
|
|
depData, |
|
|
|
}; |
|
|
|
function mapStateToProps (state) { |
|
|
|
const { depMessage } = state; |
|
|
|
const pakData = (dep) => { |
|
|
|
return dep.map((d) => { |
|
|
|
return { |
|
|
|
title: d.name, |
|
|
|
value: d.id, |
|
|
|
children: pakData(d.subordinate) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
let depData = pakData(depMessage.data || []) |
|
|
|
return { |
|
|
|
loading: depMessage.isRequesting, |
|
|
|
depData, |
|
|
|
}; |
|
|
|
} |
|
|
|
export default connect(mapStateToProps)(UserModal); |