|
|
@ -1,9 +1,9 @@ |
|
|
|
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 { DrawerForm, ProForm, ProFormText, ProFormSelect } from '@ant-design/pro-form'; |
|
|
|
import { putProject } from "../../actions/infor" |
|
|
|
import _ from 'lodash' |
|
|
|
import _ from 'lodash' |
|
|
|
|
|
|
|
const data = { |
|
|
|
"entryName": "项目名称", |
|
|
@ -32,7 +32,7 @@ const ProjectModal = (props) => { |
|
|
|
setNewlys(array?.splice(0, 2)) |
|
|
|
setNewlysay(array) |
|
|
|
// console.log()
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
if (rewkeys === 'bridge') { |
|
|
|
_.forIn(data, function (value, key) { |
|
|
@ -41,7 +41,7 @@ const ProjectModal = (props) => { |
|
|
|
setNewlys(array?.splice(0, 2)) |
|
|
|
setNewlysay(array) |
|
|
|
// console.log()
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}, []) |
|
|
|
useEffect(() => { |
|
|
@ -51,7 +51,7 @@ const ProjectModal = (props) => { |
|
|
|
arr.push({ value: value, type: key }) |
|
|
|
}); |
|
|
|
setRecordsay(arr.splice(1, 2)) |
|
|
|
|
|
|
|
|
|
|
|
setRecords(arr) |
|
|
|
} |
|
|
|
if (rewkeys === 'bridge') { |
|
|
@ -79,68 +79,68 @@ const ProjectModal = (props) => { |
|
|
|
onFinish={(values) => { |
|
|
|
console.log(values) |
|
|
|
if (rewkeys === 'road') { |
|
|
|
if (typecard == '111') { |
|
|
|
if (typecard == 'compile') { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, type:rewkeys,projectId:records?.[0]?.value || '' } |
|
|
|
const query = { ...values, type: rewkeys, projectId: records?.[0]?.value || '', done: values.done === 'true' ? true : false } |
|
|
|
dispatch(putProject(query)).then((res) => { |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
return true |
|
|
|
} else { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, type:rewkeys } |
|
|
|
const query = { ...values, type: rewkeys,done: values.done === 'true' ? true : false } |
|
|
|
dispatch(putProject(query)).then((res) => { |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
if (rewkeys === 'bridge') { |
|
|
|
if (typecard == '111') { |
|
|
|
if (typecard == 'compile') { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, type:rewkeys,projectId:records?.[0]?.value || '' } |
|
|
|
const query = { ...values, type: rewkeys, projectId: records?.[0]?.value || '',done: values.done === 'true' ? true : false } |
|
|
|
dispatch(putProject(query)).then((res) => { |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
return true |
|
|
|
} else { |
|
|
|
setDelet(values) |
|
|
|
const query = { ...values, type:rewkeys } |
|
|
|
const query = { ...values, type: rewkeys,done: values.done === 'true' ? true : false } |
|
|
|
dispatch(putProject(query)).then((res) => { |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
}} |
|
|
|
initialValues={recortd} |
|
|
|
initialValues={{ ...recortd, done: recortd.done ? 'true' : 'false' }} |
|
|
|
> |
|
|
|
{typecard == '111' ? |
|
|
|
{typecard == 'compile' ? |
|
|
|
<ProForm.Group |
|
|
|
> |
|
|
|
<ProFormText |
|
|
|
name={newlys?.[0]?.type} |
|
|
|
width="md" |
|
|
|
label={newlys?.[0]?.name} |
|
|
|
|
|
|
|
|
|
|
|
placeholder="请输入名称" |
|
|
|
// value={recordsay?.[0]?.value}
|
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
|
// value={recordsay?.[0]?.value}
|
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
|
/><ProFormText |
|
|
|
name={newlys?.[1]?.type} |
|
|
|
width="md" |
|
|
|
label={newlys?.[1]?.name} |
|
|
|
|
|
|
|
|
|
|
|
placeholder="请输入名称" |
|
|
|
// value={recordsay?.[1]?.value}
|
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
|
// value={recordsay?.[1]?.value}
|
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
|
/> |
|
|
|
<ProFormSelect |
|
|
|
options={[ |
|
|
|
{ |
|
|
|
value: 'true', |
|
|
|
label: '是', |
|
|
|
},{ |
|
|
|
}, { |
|
|
|
value: 'false', |
|
|
|
label: '否', |
|
|
|
}, |
|
|
@ -162,38 +162,38 @@ const ProjectModal = (props) => { |
|
|
|
name={newlys?.[0]?.type} |
|
|
|
width="md" |
|
|
|
label={newlys?.[0]?.name} |
|
|
|
|
|
|
|
|
|
|
|
placeholder="请输入名称" |
|
|
|
// value={recordssy?.[0]?.value}
|
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
|
// 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: "必填" }]}
|
|
|
|
// value={recordssy?.[1]?.value}
|
|
|
|
// rules={[{ required: true, message: "必填" }]}
|
|
|
|
/> |
|
|
|
<ProFormSelect |
|
|
|
options={[ |
|
|
|
{ |
|
|
|
value: 'true', |
|
|
|
label: '是', |
|
|
|
},{ |
|
|
|
value: 'false', |
|
|
|
label: '否', |
|
|
|
}, |
|
|
|
]} |
|
|
|
width="xs" |
|
|
|
name='done' |
|
|
|
label='是否已完成' |
|
|
|
rules={[{ required: true, message: "必填" }]} |
|
|
|
<ProFormSelect |
|
|
|
request={async () => [ |
|
|
|
{ |
|
|
|
value: 'true', |
|
|
|
label: '是', |
|
|
|
}, { |
|
|
|
value: 'false', |
|
|
|
label: '否', |
|
|
|
}, |
|
|
|
]} |
|
|
|
|
|
|
|
name='done' |
|
|
|
label='是否已完成' |
|
|
|
rules={[{ required: true, message: "必填" }]} |
|
|
|
/> |
|
|
|
{newlysay?.map((item, index) => { |
|
|
|
return <ProFormText width="md" |
|
|
|
name={item?.type} label={newlysay[index]?.name} placeholder="请输入名称" key={index} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/> |
|
|
|
})} |
|
|
|