说明
转账到支付宝账户
diff --git a/src/routes/Forms/StepForm/style.less b/src/routes/Forms/StepForm/style.less
index 36330941c18b496dd55842f42be2fec2659d8a24..9d98d456c9252a3274a9bd9934e4d81bc4b4f3cc 100644
--- a/src/routes/Forms/StepForm/style.less
+++ b/src/routes/Forms/StepForm/style.less
@@ -6,6 +6,7 @@
}
.stepFormText {
+ margin-bottom: 24px;
:global {
.ant-form-item-label,
.ant-form-item-control {
@@ -16,26 +17,36 @@
.result {
margin: 0 auto;
- max-width: 520px;
- padding: 32px 0;
+ max-width: 560px;
+ padding: 24px 0;
}
.desc {
h3 {
- font-size: 14px;
- margin: 8px 0;
+ font-size: 16px;
+ margin: 0 0 12px 0;
color: @text-color-secondary;
+ line-height: 32px;
}
h4 {
- margin: 2px 0;
+ margin: 0 0 4px 0;
color: @text-color-secondary;
+ font-size: 14px;
+ line-height: 22px;
}
p {
- margin-bottom: 16px;
+ margin-top: 0;
+ margin-bottom: 12px;
+ line-height: 22px;
}
- padding: 0 34px;
+ padding: 0 80px;
color: @text-color-secondary;
- font-size: 12px;
+}
+
+@media screen and (max-width: @screen-md) {
+ .desc {
+ padding: 0;
+ }
}
.information {
diff --git a/src/routes/Forms/TableForm.js b/src/routes/Forms/TableForm.js
index 390bd9b0509e5247378b52aa11b8ef10096c084a..b5b78dc97a1b1e56d909b3449b77481052b72dcd 100644
--- a/src/routes/Forms/TableForm.js
+++ b/src/routes/Forms/TableForm.js
@@ -1,5 +1,5 @@
import React, { PureComponent } from 'react';
-import { Table, Button, Input, message } from 'antd';
+import { Table, Button, Input, message, Popconfirm, Divider } from 'antd';
import styles from './style.less';
export default class TableForm extends PureComponent {
@@ -45,8 +45,7 @@ export default class TableForm extends PureComponent {
this.setState({ data: [...this.state.data] });
}
}
- remove(e, key) {
- e.preventDefault();
+ remove(key) {
const newData = this.state.data.filter(item => item.key !== key);
this.setState({ data: newData });
this.props.onChange(newData);
@@ -64,6 +63,11 @@ export default class TableForm extends PureComponent {
this.index += 1;
this.setState({ data: newData });
}
+ handleKeyPress(e, key) {
+ if (e.key === 'Enter') {
+ this.saveRow(e, key);
+ }
+ }
handleFieldChange(e, fieldName, key) {
const newData = [...this.state.data];
const target = this.getRowByKey(key);
@@ -73,16 +77,29 @@ 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;
- }
- this.toggleEditable(e, key);
- this.props.onChange(this.state.data);
+ e.persist();
+ // save field when blur input
+ setTimeout(() => {
+ if (document.activeElement.tagName === 'INPUT' &&
+ document.activeElement !== e.target) {
+ return;
+ }
+ if (this.clickedCancel) {
+ this.clickedCancel = false;
+ return;
+ }
+ const target = this.getRowByKey(key);
+ delete target.isNew;
+ if (!target.workId || !target.name || !target.department) {
+ message.error('请填写完整成员信息。');
+ return;
+ }
+ this.toggleEditable(e, key);
+ this.props.onChange(this.state.data);
+ }, 10);
}
cancel(e, key) {
+ this.clickedCancel = true;
e.preventDefault();
const target = this.getRowByKey(key);
if (this.cacheOriginData[key]) {
@@ -105,6 +122,8 @@ export default class TableForm extends PureComponent {
value={text}
autoFocus
onChange={e => this.handleFieldChange(e, 'name', record.key)}
+ onBlur={e => this.saveRow(e, record.key)}
+ onKeyPress={e => this.handleKeyPress(e, record.key)}
placeholder="成员姓名"
/>
);
@@ -122,6 +141,8 @@ export default class TableForm extends PureComponent {
this.handleFieldChange(e, 'workId', record.key)}
+ onBlur={e => this.saveRow(e, record.key)}
+ onKeyPress={e => this.handleKeyPress(e, record.key)}
placeholder="工号"
/>
);
@@ -139,6 +160,8 @@ export default class TableForm extends PureComponent {
this.handleFieldChange(e, 'department', record.key)}
+ onBlur={e => this.saveRow(e, record.key)}
+ onKeyPress={e => this.handleKeyPress(e, record.key)}
placeholder="所属部门"
/>
);
@@ -154,7 +177,7 @@ export default class TableForm extends PureComponent {
return (
this.saveRow(e, record.key)}>保存
-
+
this.remove(e, record.key)}>删除
);
@@ -162,7 +185,7 @@ export default class TableForm extends PureComponent {
return (
this.saveRow(e, record.key)}>保存
-
+
this.cancel(e, record.key)}>取消
);
@@ -170,8 +193,10 @@ export default class TableForm extends PureComponent {
return (
this.toggleEditable(e, record.key)}>编辑
-
- this.remove(e, record.key)}>删除
+
+ this.remove(record.key)}>
+ 删除
+
);
},
diff --git a/src/routes/Forms/style.less b/src/routes/Forms/style.less
index ca4b150a27f763b43e07fbcbdf8732924cb0154a..722aca805fcddd009a3c66687106a31bc7227ba8 100644
--- a/src/routes/Forms/style.less
+++ b/src/routes/Forms/style.less
@@ -15,13 +15,6 @@
margin: 16px auto;
}
-.divider {
- border: 0;
- border-top: 1px solid @border-color-split;
- height: 1px;
- margin: 0 0 24px 0;
-}
-
.errorIcon {
cursor: pointer;
color: @error-color;
@@ -37,7 +30,7 @@
padding: 0;
max-height: 290px;
overflow: auto;
- min-width: 240px;
+ min-width: 256px;
}
}
}
@@ -45,7 +38,7 @@
.errorListItem {
list-style: none;
border-bottom: 1px solid @border-color-split;
- padding: 8px 24px;
+ padding: 8px 16px;
cursor: pointer;
transition: all .3s;
&:hover {
@@ -58,21 +51,16 @@
color: @error-color;
float: left;
margin-top: 4px;
- margin-right: 8px;
+ margin-right: 12px;
padding-bottom: 22px;
}
.errorField {
font-size: 12px;
color: @text-color-secondary;
- margin-top: 4px;
+ margin-top: 2px;
}
}
-// 避免表格编辑模式切换时抖动
-:global(.ant-table) td {
- transition: none !important;
-}
-
.editable {
td {
padding-top: 13px !important;
@@ -81,10 +69,21 @@
}
// custom footer for fixed footer toolbar
-.withFooterToolbar + div {
+.advancedForm + div {
padding-bottom: 64px;
}
+.advancedForm {
+ :global {
+ .ant-form .ant-row:last-child .ant-form-item {
+ margin-bottom: 24px;
+ }
+ .ant-table td {
+ transition: none !important;
+ }
+ }
+}
+
.optional {
color: @text-color-secondary;
font-style: normal;
diff --git a/src/routes/List/CardList.js b/src/routes/List/CardList.js
index 2866d1b5b09c1d800abca7fca55fd9d196cbbbf6..0eb540852116bf531254a6f6d72e2fffa7724d96 100644
--- a/src/routes/List/CardList.js
+++ b/src/routes/List/CardList.js
@@ -62,8 +62,8 @@ export default class CardList extends PureComponent {
dataSource={['', ...list]}
renderItem={item => (item ? (
-
- 操作一, 操作二]}>
+ 操作一, 操作二]}>
+
}
title={item.title}
@@ -73,8 +73,8 @@ export default class CardList extends PureComponent {
)}
/>
-
-
+
+
) : (
diff --git a/src/routes/List/CardList.less b/src/routes/List/CardList.less
index 8a5c958c66aa19b9de99fdb3094b8fc5ce8ea958..d6c3cfd8810174c1e474768267b759c1630e4f22 100644
--- a/src/routes/List/CardList.less
+++ b/src/routes/List/CardList.less
@@ -24,7 +24,7 @@
border-color: @border-color-base;
color: @text-color-secondary;
width: 100%;
- height: 178px;
+ height: 185px;
}
.cardDescription {
diff --git a/src/routes/List/CoverCardList.js b/src/routes/List/CoverCardList.js
index 0ad34b5db1d0944a819433a7305a77c876bfb781..6d0aa290a4c8d3fbf6c244ac5086ec0ab3fb3c55 100644
--- a/src/routes/List/CoverCardList.js
+++ b/src/routes/List/CoverCardList.js
@@ -153,7 +153,7 @@ export default class CoverCardList extends PureComponent {
onTabChange={this.handleTabChange}
>