Commit c5d6923d authored by ddcat1115's avatar ddcat1115

Merge branch 'master' of https://github.com/ant-design/test2

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