|
@ -23,7 +23,6 @@ const ProjectModal = (props) => { |
|
|
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 [flage, setFlage] = useState() //xiangmujinzhan
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
const array = [] |
|
|
const array = [] |
|
|
if (rewkeys === 'road') { |
|
|
if (rewkeys === 'road') { |
|
@ -78,40 +77,39 @@ const ProjectModal = (props) => { |
|
|
visible={visible} |
|
|
visible={visible} |
|
|
onVisibleChange={onVisibleChange} |
|
|
onVisibleChange={onVisibleChange} |
|
|
onFinish={(values) => { |
|
|
onFinish={(values) => { |
|
|
|
|
|
console.log(values) |
|
|
if (rewkeys === 'road') { |
|
|
if (rewkeys === 'road') { |
|
|
if (typecard == '111') { |
|
|
if (typecard == '111') { |
|
|
setDelet(values) |
|
|
setDelet(values) |
|
|
setDelet(values) |
|
|
const query = { ...values, type:rewkeys,projectId:records?.[0]?.value || '' } |
|
|
|
|
|
|
|
|
const query = { ...values, type:rewkeys } |
|
|
|
|
|
dispatch(putProject(query)).then((res) => { |
|
|
dispatch(putProject(query)).then((res) => { |
|
|
setSuccess(res.success) |
|
|
|
|
|
}) |
|
|
}) |
|
|
return success |
|
|
return true |
|
|
} else { |
|
|
} else { |
|
|
setDelet(values) |
|
|
setDelet(values) |
|
|
const query = { ...values, type:rewkeys } |
|
|
const query = { ...values, type:rewkeys } |
|
|
dispatch(putProject(query)).then((res) => { |
|
|
dispatch(putProject(query)).then((res) => { |
|
|
setSuccess(res.success) |
|
|
|
|
|
}) |
|
|
}) |
|
|
return success |
|
|
return true |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (rewkeys === 'bridge') { |
|
|
if (rewkeys === 'bridge') { |
|
|
if (typecard == '111') { |
|
|
if (typecard == '111') { |
|
|
setDelet(values) |
|
|
setDelet(values) |
|
|
const query = { ...values, type:rewkeys } |
|
|
const query = { ...values, type:rewkeys,projectId:records?.[0]?.value || '' } |
|
|
dispatch(putProject(query)).then((res) => { |
|
|
dispatch(putProject(query)).then((res) => { |
|
|
setSuccess(res.success) |
|
|
|
|
|
}) |
|
|
}) |
|
|
return success |
|
|
return true |
|
|
} else { |
|
|
} else { |
|
|
setDelet(values) |
|
|
setDelet(values) |
|
|
const query = { ...values, type:rewkeys } |
|
|
const query = { ...values, type:rewkeys } |
|
|
dispatch(putProject(query)).then((res) => { |
|
|
dispatch(putProject(query)).then((res) => { |
|
|
setSuccess(res.success) |
|
|
|
|
|
}) |
|
|
}) |
|
|
return success |
|
|
return true |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}} |
|
|
}} |
|
@ -127,7 +125,7 @@ const ProjectModal = (props) => { |
|
|
|
|
|
|
|
|
placeholder="请输入名称" |
|
|
placeholder="请输入名称" |
|
|
// value={recordsay?.[0]?.value}
|
|
|
// value={recordsay?.[0]?.value}
|
|
|
rules={[{ required: true, message: "必填" }]} |
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
/><ProFormText |
|
|
/><ProFormText |
|
|
name={newlys?.[1]?.type} |
|
|
name={newlys?.[1]?.type} |
|
|
width="md" |
|
|
width="md" |
|
@ -135,7 +133,7 @@ const ProjectModal = (props) => { |
|
|
|
|
|
|
|
|
placeholder="请输入名称" |
|
|
placeholder="请输入名称" |
|
|
// value={recordsay?.[1]?.value}
|
|
|
// value={recordsay?.[1]?.value}
|
|
|
rules={[{ required: true, message: "必填" }]} |
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
/> |
|
|
/> |
|
|
<ProFormSelect |
|
|
<ProFormSelect |
|
|
options={[ |
|
|
options={[ |
|
@ -150,6 +148,7 @@ const ProjectModal = (props) => { |
|
|
width="xs" |
|
|
width="xs" |
|
|
name='done' |
|
|
name='done' |
|
|
label='是否已完成' |
|
|
label='是否已完成' |
|
|
|
|
|
rules={[{ required: true, message: "必填" }]} |
|
|
/> |
|
|
/> |
|
|
{newlysay?.map((item, index) => { |
|
|
{newlysay?.map((item, index) => { |
|
|
return <ProFormText width="md" |
|
|
return <ProFormText width="md" |
|
@ -167,7 +166,7 @@ const ProjectModal = (props) => { |
|
|
|
|
|
|
|
|
placeholder="请输入名称" |
|
|
placeholder="请输入名称" |
|
|
// value={recordssy?.[0]?.value}
|
|
|
// value={recordssy?.[0]?.value}
|
|
|
rules={[{ required: true, message: "必填" }]} |
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
/><ProFormText |
|
|
/><ProFormText |
|
|
name={newlys?.[1]?.type} |
|
|
name={newlys?.[1]?.type} |
|
|
width="md" |
|
|
width="md" |
|
@ -175,7 +174,7 @@ const ProjectModal = (props) => { |
|
|
|
|
|
|
|
|
placeholder="请输入名称" |
|
|
placeholder="请输入名称" |
|
|
// value={recordssy?.[1]?.value}
|
|
|
// value={recordssy?.[1]?.value}
|
|
|
rules={[{ required: true, message: "必填" }]} |
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
/> |
|
|
/> |
|
|
<ProFormSelect |
|
|
<ProFormSelect |
|
|
options={[ |
|
|
options={[ |
|
@ -190,6 +189,7 @@ const ProjectModal = (props) => { |
|
|
width="xs" |
|
|
width="xs" |
|
|
name='done' |
|
|
name='done' |
|
|
label='是否已完成' |
|
|
label='是否已完成' |
|
|
|
|
|
rules={[{ required: true, message: "必填" }]} |
|
|
/> |
|
|
/> |
|
|
{newlysay?.map((item, index) => { |
|
|
{newlysay?.map((item, index) => { |
|
|
return <ProFormText width="md" |
|
|
return <ProFormText width="md" |
|
|