Commit bd233ac9 by haojie

1

parent d2cd6295
...@@ -81,6 +81,7 @@ export default class StartTrade extends Component<any, any> { ...@@ -81,6 +81,7 @@ export default class StartTrade extends Component<any, any> {
onReset = () => { onReset = () => {
const items = Object.keys(this.state); const items = Object.keys(this.state);
items.forEach((item: any) => { items.forEach((item: any) => {
if (!noSubmitFields.includes(item)) {
if (typeof this.state[item] === 'string') { if (typeof this.state[item] === 'string') {
this.setState({ this.setState({
[item]: '' [item]: ''
...@@ -94,7 +95,7 @@ export default class StartTrade extends Component<any, any> { ...@@ -94,7 +95,7 @@ export default class StartTrade extends Component<any, any> {
[item]: [] [item]: []
}) })
} }
}
}) })
console.log(this.state) console.log(this.state)
} }
......
...@@ -70,6 +70,8 @@ export default class TradeDialog extends Component<any, any> { ...@@ -70,6 +70,8 @@ export default class TradeDialog extends Component<any, any> {
onReset = () => { onReset = () => {
const items = Object.keys(this.state); const items = Object.keys(this.state);
items.forEach((item: any) => { items.forEach((item: any) => {
// 跳过不提交的字段
if (!noSubmitFields.includes(item)) {
if (typeof this.state[item] === 'string') { if (typeof this.state[item] === 'string') {
this.setState({ this.setState({
[item]: '' [item]: ''
...@@ -83,7 +85,7 @@ export default class TradeDialog extends Component<any, any> { ...@@ -83,7 +85,7 @@ export default class TradeDialog extends Component<any, any> {
[item]: [] [item]: []
}) })
} }
}
}) })
} }
......
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