You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96 lines
2.6 KiB
96 lines
2.6 KiB
import React,{useState,useEffect} from 'react'
|
|
import { Modal, Form, Input, Button,DatePicker,Select } from 'antd'
|
|
import dayjs from 'dayjs';
|
|
function modeal(props) {
|
|
const [form] = Form.useForm();
|
|
const { visible, handleOk, handleCancel, editData } = props
|
|
console.log(editData)
|
|
useEffect(() => {
|
|
if (editData && visible) {
|
|
form.setFieldsValue({
|
|
name_project: editData.name_project,
|
|
part_people: editData.part_people,
|
|
build_time: dayjs(editData?.build_time),
|
|
publish_time: dayjs(editData.publish_time),
|
|
progress:editData.progress
|
|
})
|
|
}
|
|
}, [editData, visible])
|
|
return (
|
|
<Modal
|
|
visible={visible}
|
|
onCancel={handleCancel}
|
|
footer={null}
|
|
title="研发看板项目编辑"
|
|
>
|
|
<Form
|
|
name="basic"
|
|
labelAlign="left"
|
|
form={form}
|
|
onFinish={handleOk}
|
|
autoComplete="off"
|
|
>
|
|
<Form.Item
|
|
label="项目计划"
|
|
name="name_project"
|
|
rules={[{ required: true, message: '请输入项目计划' }]}
|
|
>
|
|
<Input/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label="投入人力"
|
|
name="part_people"
|
|
rules={[{ required: true, message: '请输入人员姓名' }]}
|
|
>
|
|
<Input/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label="构建时间"
|
|
name="build_time"
|
|
rules={[{ required: true, message: '请选择时间' }]}
|
|
>
|
|
<DatePicker />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label="发布时间"
|
|
name="publish_time"
|
|
rules={[{ required: true, message: '请选择时间' }]}
|
|
>
|
|
<DatePicker />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label="目前进度"
|
|
name="progress"
|
|
rules={[{ required: true, message: '请选择进度' }]}
|
|
>
|
|
<Select><Select.Option value="需求评审中">需求评审中</Select.Option>
|
|
<Select.Option value="研发中">研发中</Select.Option>
|
|
<Select.Option value="测试中">测试中</Select.Option>
|
|
<Select.Option value="已发布">已发布</Select.Option>
|
|
</Select>
|
|
</Form.Item>
|
|
<Form.Item noStyle={true}>
|
|
<div style={{
|
|
padding: '12px 0',
|
|
width: '100%',
|
|
textAlign: 'right',
|
|
}}>
|
|
<Button
|
|
style={{ marginRight: 16, width: 88 }}
|
|
onClick={handleCancel}
|
|
>取消</Button>
|
|
<Button
|
|
htmlType="submit"
|
|
type="primary"
|
|
style={{ marginRight: 16, width: 88 }}
|
|
// onClick={() => handleOk(form)}
|
|
>确定</Button>
|
|
</div>
|
|
</Form.Item>
|
|
|
|
</Form>
|
|
</Modal>
|
|
)
|
|
}
|
|
|
|
export default modeal
|