From 74c811f4f3beb02bf5766b58d453b4d58b8317e8 Mon Sep 17 00:00:00 2001 From: liujiangyong Date: Wed, 2 Aug 2023 19:54:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=85=E9=9A=9C=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/src/packages/patrol/index.jsx | 34 ++++++++++++++++++++++++---- weapp/src/packages/patrol/index.scss | 4 ++++ 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/weapp/src/packages/patrol/index.jsx b/weapp/src/packages/patrol/index.jsx index d9a094ee..cfce0c02 100644 --- a/weapp/src/packages/patrol/index.jsx +++ b/weapp/src/packages/patrol/index.jsx @@ -65,7 +65,7 @@ const Index = () => { const [roadCodeHead, setRoadCodeHead] = useState('X') const [roadCodeEnd, setRoadCodeEnd] = useState('') const [otherType, setOtherType] = useState('') // 道路类型-其他 - const [patrolContentEdit, setPatrolContentEdit] = useState(false) // 养护基本信息是否可编辑 + const [patrolContentEdit, setPatrolContentEdit] = useState(true) // 养护基本信息是否可编辑 const [patrolContent, setPatrolContent] = useState({ inspectionNoException: { @@ -158,7 +158,7 @@ const Index = () => { unit: '平米', }, ditchCleaning: { - label: '开挖、清理边坡', + label: '开挖、清理边沟', value: '', unit: '米', }, @@ -356,7 +356,7 @@ const Index = () => { addresscity = res.data.result.address let street = res.data.result.address_component.street - setRoad(street) + // setRoad(street) setAddress(addresscity) } }) @@ -607,14 +607,37 @@ const Index = () => { setConserveInfo(nextInfo) setPatrolContentEdit(false) } else { - setPatrolContentEdit(true) + if (!patrolContentEdit) { + setPatrolContentEdit(true) + let nextInfo = { ...conserveInfo } + Object.keys(conserveInfo).forEach(key => { + nextInfo[key].value = '' + }) + setConserveInfo(nextInfo) + } } }) } else { - setPatrolContentEdit(true) + if (!patrolContentEdit) { + setPatrolContentEdit(true) + let nextInfo = { ...conserveInfo } + Object.keys(conserveInfo).forEach(key => { + nextInfo[key].value = '' + }) + setConserveInfo(nextInfo) + } } }) } + } else { + if (!patrolContentEdit) { + setPatrolContentEdit(true) + let nextInfo = { ...conserveInfo } + Object.keys(conserveInfo).forEach(key => { + nextInfo[key].value = '' + }) + setConserveInfo(nextInfo) + } } break; case "conserveInfo": @@ -922,6 +945,7 @@ const Index = () => { C