fix 默认值被空节点覆盖
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import React, { Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
import { Form, Button, Input, Descriptions, message as Message, Modal, Spin, Tabs } from 'antd'
|
import { Form, Button, Input, Descriptions, message as Message, Modal, Spin, Tabs } from 'antd'
|
||||||
import { merge, isEqual } from 'lodash'
|
import { merge, isEqual, pickBy } from 'lodash'
|
||||||
import { AntIcon, ComponentDynamic, Container } from 'components'
|
import { AntIcon, ComponentDynamic, Container } from 'components'
|
||||||
import { api } from 'common/api'
|
import { api } from 'common/api'
|
||||||
|
|
||||||
@@ -90,6 +90,10 @@ export default class index extends Component {
|
|||||||
const { taskId } = this.props.param
|
const { taskId } = this.props.param
|
||||||
if (taskId) {
|
if (taskId) {
|
||||||
api.houseInfoGetByTaskId({ taskId }).then(({ data }) => {
|
api.houseInfoGetByTaskId({ taskId }).then(({ data }) => {
|
||||||
|
// 删除空节点
|
||||||
|
for (const key in data) {
|
||||||
|
data[key] = pickBy(data[key], p => p !== null && p !== undefined)
|
||||||
|
}
|
||||||
this.setState({
|
this.setState({
|
||||||
taskStatus: data.patrolInfo.status,
|
taskStatus: data.patrolInfo.status,
|
||||||
record: data,
|
record: data,
|
||||||
@@ -168,7 +172,6 @@ export default class index extends Component {
|
|||||||
this.formData.patrolInfo.id = this.props.param.taskId
|
this.formData.patrolInfo.id = this.props.param.taskId
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(this.formData)
|
|
||||||
this.setState({ saving: true })
|
this.setState({ saving: true })
|
||||||
|
|
||||||
if (action) {
|
if (action) {
|
||||||
|
|||||||
Reference in New Issue
Block a user