Commit d9283419 authored by afc163's avatar afc163

Fix details

parent 14fa2965
...@@ -101,7 +101,7 @@ function AdvancedForm({ form, dispatch, submitting }) { ...@@ -101,7 +101,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
<Card title="仓库管理" className={styles.card} bordered={false}> <Card title="仓库管理" className={styles.card} bordered={false}>
<Form layout="vertical" hideRequiredMark> <Form layout="vertical" hideRequiredMark>
<Row gutter={16}> <Row gutter={16}>
<Col md={6} sm={24}> <Col lg={6} md={12} sm={24}>
<Form.Item label={fieldLabels.name}> <Form.Item label={fieldLabels.name}>
{getFieldDecorator('name', { {getFieldDecorator('name', {
rules: [{ required: true, message: '请输入仓库名称' }], rules: [{ required: true, message: '请输入仓库名称' }],
...@@ -110,7 +110,7 @@ function AdvancedForm({ form, dispatch, submitting }) { ...@@ -110,7 +110,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
)} )}
</Form.Item> </Form.Item>
</Col> </Col>
<Col xl={{ span: 6, offset: 2 }} md={{ span: 8 }} sm={24}> <Col xl={{ span: 6, offset: 2 }} lg={{ span: 8 }} md={{ span: 12 }} sm={24}>
<Form.Item label={fieldLabels.url}> <Form.Item label={fieldLabels.url}>
{getFieldDecorator('url', { {getFieldDecorator('url', {
rules: [{ required: true, message: '请选择' }], rules: [{ required: true, message: '请选择' }],
...@@ -124,7 +124,7 @@ function AdvancedForm({ form, dispatch, submitting }) { ...@@ -124,7 +124,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
)} )}
</Form.Item> </Form.Item>
</Col> </Col>
<Col xl={{ span: 8, offset: 2 }} md={{ span: 10 }} sm={24}> <Col xl={{ span: 8, offset: 2 }} lg={{ span: 10 }} md={{ span: 24 }} sm={24}>
<Form.Item label={fieldLabels.owner}> <Form.Item label={fieldLabels.owner}>
{getFieldDecorator('owner', { {getFieldDecorator('owner', {
rules: [{ required: true, message: '请选择管理员' }], rules: [{ required: true, message: '请选择管理员' }],
...@@ -138,7 +138,7 @@ function AdvancedForm({ form, dispatch, submitting }) { ...@@ -138,7 +138,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
</Col> </Col>
</Row> </Row>
<Row gutter={16}> <Row gutter={16}>
<Col md={6} sm={24}> <Col lg={6} md={12} sm={24}>
<Form.Item label={fieldLabels.approver}> <Form.Item label={fieldLabels.approver}>
{getFieldDecorator('approver', { {getFieldDecorator('approver', {
rules: [{ required: true, message: '请选择审批员' }], rules: [{ required: true, message: '请选择审批员' }],
...@@ -150,7 +150,7 @@ function AdvancedForm({ form, dispatch, submitting }) { ...@@ -150,7 +150,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
)} )}
</Form.Item> </Form.Item>
</Col> </Col>
<Col xl={{ span: 6, offset: 2 }} md={{ span: 8 }} sm={24}> <Col xl={{ span: 6, offset: 2 }} lg={{ span: 8 }} md={{ span: 12 }} sm={24}>
<Form.Item label={fieldLabels.dateRange}> <Form.Item label={fieldLabels.dateRange}>
{getFieldDecorator('dateRange', { {getFieldDecorator('dateRange', {
rules: [{ required: true, message: '请选择生效日期' }], rules: [{ required: true, message: '请选择生效日期' }],
...@@ -159,7 +159,7 @@ function AdvancedForm({ form, dispatch, submitting }) { ...@@ -159,7 +159,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
)} )}
</Form.Item> </Form.Item>
</Col> </Col>
<Col xl={{ span: 8, offset: 2 }} md={{ span: 10 }} sm={24}> <Col xl={{ span: 8, offset: 2 }} lg={{ span: 10 }} md={{ span: 24 }} sm={24}>
<Form.Item label={fieldLabels.type}> <Form.Item label={fieldLabels.type}>
{getFieldDecorator('type', { {getFieldDecorator('type', {
rules: [{ required: true, message: '请选择仓库类型' }], rules: [{ required: true, message: '请选择仓库类型' }],
...@@ -177,7 +177,7 @@ function AdvancedForm({ form, dispatch, submitting }) { ...@@ -177,7 +177,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
<Card title="任务管理" className={styles.card} bordered={false}> <Card title="任务管理" className={styles.card} bordered={false}>
<Form layout="vertical" hideRequiredMark> <Form layout="vertical" hideRequiredMark>
<Row gutter={16}> <Row gutter={16}>
<Col md={6} sm={24}> <Col lg={6} md={12} sm={24}>
<Form.Item label={fieldLabels.name2}> <Form.Item label={fieldLabels.name2}>
{getFieldDecorator('name2', { {getFieldDecorator('name2', {
rules: [{ required: true, message: '请输入' }], rules: [{ required: true, message: '请输入' }],
...@@ -186,7 +186,7 @@ function AdvancedForm({ form, dispatch, submitting }) { ...@@ -186,7 +186,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
)} )}
</Form.Item> </Form.Item>
</Col> </Col>
<Col xl={{ span: 6, offset: 2 }} md={{ span: 8 }} sm={24}> <Col xl={{ span: 6, offset: 2 }} lg={{ span: 8 }} md={{ span: 12 }} sm={24}>
<Form.Item label={fieldLabels.url2}> <Form.Item label={fieldLabels.url2}>
{getFieldDecorator('url2', { {getFieldDecorator('url2', {
rules: [{ required: true, message: '请选择' }], rules: [{ required: true, message: '请选择' }],
...@@ -195,7 +195,7 @@ function AdvancedForm({ form, dispatch, submitting }) { ...@@ -195,7 +195,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
)} )}
</Form.Item> </Form.Item>
</Col> </Col>
<Col xl={{ span: 8, offset: 2 }} md={{ span: 10 }} sm={24}> <Col xl={{ span: 8, offset: 2 }} lg={{ span: 10 }} md={{ span: 24 }} sm={24}>
<Form.Item label={fieldLabels.owner2}> <Form.Item label={fieldLabels.owner2}>
{getFieldDecorator('owner2', { {getFieldDecorator('owner2', {
rules: [{ required: true, message: '请选择管理员' }], rules: [{ required: true, message: '请选择管理员' }],
...@@ -209,7 +209,7 @@ function AdvancedForm({ form, dispatch, submitting }) { ...@@ -209,7 +209,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
</Col> </Col>
</Row> </Row>
<Row gutter={16}> <Row gutter={16}>
<Col md={6} sm={24}> <Col lg={6} md={12} sm={24}>
<Form.Item label={fieldLabels.approver2}> <Form.Item label={fieldLabels.approver2}>
{getFieldDecorator('approver2', { {getFieldDecorator('approver2', {
rules: [{ required: true, message: '请选择审批员' }], rules: [{ required: true, message: '请选择审批员' }],
...@@ -221,7 +221,7 @@ function AdvancedForm({ form, dispatch, submitting }) { ...@@ -221,7 +221,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
)} )}
</Form.Item> </Form.Item>
</Col> </Col>
<Col xl={{ span: 6, offset: 2 }} md={{ span: 8 }} sm={24}> <Col xl={{ span: 6, offset: 2 }} lg={{ span: 8 }} md={{ span: 12 }} sm={24}>
<Form.Item label={fieldLabels.dateRange2}> <Form.Item label={fieldLabels.dateRange2}>
{getFieldDecorator('dateRange2', { {getFieldDecorator('dateRange2', {
rules: [{ required: true, message: '请输入' }], rules: [{ required: true, message: '请输入' }],
...@@ -230,7 +230,7 @@ function AdvancedForm({ form, dispatch, submitting }) { ...@@ -230,7 +230,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
)} )}
</Form.Item> </Form.Item>
</Col> </Col>
<Col xl={{ span: 8, offset: 2 }} md={{ span: 10 }} sm={24}> <Col xl={{ span: 8, offset: 2 }} lg={{ span: 10 }} md={{ span: 24 }} sm={24}>
<Form.Item label={fieldLabels.type2}> <Form.Item label={fieldLabels.type2}>
{getFieldDecorator('type2', { {getFieldDecorator('type2', {
rules: [{ required: true, message: '请选择仓库类型' }], rules: [{ required: true, message: '请选择仓库类型' }],
...@@ -252,7 +252,6 @@ function AdvancedForm({ form, dispatch, submitting }) { ...@@ -252,7 +252,6 @@ function AdvancedForm({ form, dispatch, submitting }) {
</Card> </Card>
<FooterToolbar> <FooterToolbar>
{getErrorInfo()} {getErrorInfo()}
<Button size="large">取消</Button>
<Button type="primary" size="large" onClick={validate} loading={submitting}> <Button type="primary" size="large" onClick={validate} loading={submitting}>
提交 提交
</Button> </Button>
......
...@@ -59,6 +59,7 @@ export default class TableForm extends PureComponent { ...@@ -59,6 +59,7 @@ export default class TableForm extends PureComponent {
name: '', name: '',
department: '', department: '',
editable: true, editable: true,
isNew: true,
}); });
this.index += 1; this.index += 1;
this.setState({ data: newData }); this.setState({ data: newData });
...@@ -73,6 +74,7 @@ export default class TableForm extends PureComponent { ...@@ -73,6 +74,7 @@ export default class TableForm extends PureComponent {
} }
saveRow(e, key) { saveRow(e, key) {
const target = this.getRowByKey(key); const target = this.getRowByKey(key);
delete target.isNew;
if (!target.workId || !target.name || !target.department) { if (!target.workId || !target.name || !target.department) {
message.error('请填写完整成员信息。'); message.error('请填写完整成员信息。');
return; return;
...@@ -148,7 +150,7 @@ export default class TableForm extends PureComponent { ...@@ -148,7 +150,7 @@ export default class TableForm extends PureComponent {
key: 'action', key: 'action',
render: (text, record) => { render: (text, record) => {
if (record.editable) { if (record.editable) {
if (record.key.indexOf('NEW_TEMP_ID_') >= 0) { if (record.isNew) {
return ( return (
<span> <span>
<a onClick={e => this.saveRow(e, record.key)}>保存</a> <a onClick={e => this.saveRow(e, record.key)}>保存</a>
......
...@@ -69,10 +69,13 @@ ...@@ -69,10 +69,13 @@
} }
// 避免表格编辑模式切换时抖动 // 避免表格编辑模式切换时抖动
:global(.ant-table) td {
transition: none !important;
}
.editable { .editable {
td { td {
transition: none !important; padding-top: 13px !important;
padding-top: 12.5px !important;
padding-bottom: 12.5px !important; padding-bottom: 12.5px !important;
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment