From 35ee8234fb67dd31a6b8d7b988a2d1b04728ab5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=87=AA=E5=B8=A6=E5=A4=A7=E4=BD=AC=E6=B0=94=E5=9C=BA?= <188633308@qq.com> Date: Fri, 2 Jul 2021 14:48:19 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E9=BB=98=E8=AE=A4=E5=80=BC=E8=A2=AB?= =?UTF-8?q?=E7=A9=BA=E8=8A=82=E7=82=B9=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web-react/src/pages/business/house/info/form/index.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web-react/src/pages/business/house/info/form/index.jsx b/web-react/src/pages/business/house/info/form/index.jsx index 5a2363d..1bf327c 100644 --- a/web-react/src/pages/business/house/info/form/index.jsx +++ b/web-react/src/pages/business/house/info/form/index.jsx @@ -1,6 +1,6 @@ import React, { Component } from 'react' 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 { api } from 'common/api' @@ -90,6 +90,10 @@ export default class index extends Component { const { taskId } = this.props.param if (taskId) { api.houseInfoGetByTaskId({ taskId }).then(({ data }) => { + // 删除空节点 + for (const key in data) { + data[key] = pickBy(data[key], p => p !== null && p !== undefined) + } this.setState({ taskStatus: data.patrolInfo.status, record: data, @@ -168,7 +172,6 @@ export default class index extends Component { this.formData.patrolInfo.id = this.props.param.taskId } - console.log(this.formData) this.setState({ saving: true }) if (action) {