巴林闲侠
2 years ago
41 changed files with 6454 additions and 1510 deletions
After Width: | Height: | Size: 577 B |
After Width: | Height: | Size: 742 B |
After Width: | Height: | Size: 750 B |
@ -0,0 +1,106 @@ |
|||
import React, { useEffect, useState } from 'react'; |
|||
import { connect } from 'react-redux'; |
|||
import { Form, Spin, Table } from 'antd'; |
|||
import { ModalForm, ProForm, ProFormText,ProFormSelect } from '@ant-design/pro-form'; |
|||
import { putOperaTional,putHighways } from "../../actions/infor" |
|||
|
|||
const HightModal = (props) => { |
|||
const { visible, onVisibleChange, typecard, rewkeys, recortd, dispatch, setRecortd } = props |
|||
const [success,setSuccess]=useState() |
|||
|
|||
useEffect(() => { |
|||
return () => { |
|||
setRecortd() |
|||
} |
|||
}, [setRecortd]) |
|||
// console.log(recortd)
|
|||
return ( |
|||
<Spin spinning={false}> |
|||
{/* { |
|||
newlysay ? */} |
|||
<ModalForm |
|||
width={'90rem'} |
|||
visible={visible} |
|||
onVisibleChange={onVisibleChange} |
|||
onFinish={(values) => { |
|||
if (rewkeys === 'passenger') { |
|||
|
|||
console.log(values) |
|||
const query = { ...values, id:recortd?.id } |
|||
dispatch(putOperaTional(query)).then((res) => { |
|||
setSuccess(res.success) |
|||
}) |
|||
return true |
|||
|
|||
} |
|||
if (rewkeys === 'highways') { |
|||
|
|||
console.log(values) |
|||
const query = { ...values, id:recortd?.id } |
|||
dispatch(putHighways(query)).then((res) => { |
|||
setSuccess(res.success) |
|||
}) |
|||
return true |
|||
|
|||
} |
|||
|
|||
}} |
|||
initialValues={recortd} |
|||
> |
|||
{typecard == '111' ? |
|||
<ProForm.Group |
|||
> |
|||
<ProFormText |
|||
name='name' |
|||
width="md" |
|||
label='类型' |
|||
tooltip="最长为 24 位" |
|||
placeholder="请输入名称" |
|||
// value={recortd?.[0]?.value}
|
|||
disabled |
|||
rules={[{ required: true, message: "必填" }]} |
|||
/> |
|||
<ProFormText |
|||
name='count' |
|||
width="md" |
|||
label='数量' |
|||
tooltip="最长为 24 位" |
|||
placeholder="请输入名称" |
|||
/> |
|||
|
|||
</ProForm.Group> |
|||
: <ProForm.Group> |
|||
<ProFormText |
|||
name={newlys?.[0]?.type} |
|||
width="md" |
|||
label={newlys?.[0]?.name} |
|||
tooltip="最长为 24 位" |
|||
placeholder="请输入名称" |
|||
/> |
|||
</ProForm.Group>} |
|||
|
|||
</ModalForm> |
|||
{/* : '' |
|||
} */} |
|||
|
|||
</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, |
|||
}; |
|||
} |
|||
export default connect(mapStateToProps)(HightModal); |
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
Loading…
Reference in new issue