Browse Source

切换线路编码类型相关逻辑

dev
liujiangyong 1 year ago
parent
commit
088419a7f3
  1. 82
      weapp/src/packages/patrol/index.jsx

82
weapp/src/packages/patrol/index.jsx

@ -544,40 +544,7 @@ const Index = () => {
}
})
}
function handleInput({ detail: { value } }, type, key) {
switch (type) {
case 'roadSectionStart':
setRoadSectionStart(value)
if (value) {
setRoadStartSel(sourceRoadStartSel.filter(item => item && item.includes(value)))
} else {
setRoadStartSel(sourceRoadStartSel)
}
break;
case 'roadSectionEnd':
setRoadSectionEnd(value)
if (value) {
setRoadEndSel(sourceRoadEndSel.filter(item => item && item.includes(value)))
} else {
setRoadEndSel(sourceRoadEndSel)
}
break;
case 'address':
setAddress(value)
break;
case 'content':
setContent(value)
break;
case "projectName":
setProjectName(value)
break;
case "wait":
setHandleCenter(value)
break;
case "roadCodeEnd":
setRoadCodeEnd(value)
if (value.length >= 9) {
function queryConserveInfo(roadCodeHead, value) {
let routeCode = ''
let roadStart = []
let roadEnd = []
@ -627,6 +594,41 @@ const Index = () => {
}
})
}
}
function handleInput({ detail: { value } }, type, key) {
switch (type) {
case 'roadSectionStart':
setRoadSectionStart(value)
if (value) {
setRoadStartSel(sourceRoadStartSel.filter(item => item && item.includes(value)))
} else {
setRoadStartSel(sourceRoadStartSel)
}
break;
case 'roadSectionEnd':
setRoadSectionEnd(value)
if (value) {
setRoadEndSel(sourceRoadEndSel.filter(item => item && item.includes(value)))
} else {
setRoadEndSel(sourceRoadEndSel)
}
break;
case 'address':
setAddress(value)
break;
case 'content':
setContent(value)
break;
case "projectName":
setProjectName(value)
break;
case "wait":
setHandleCenter(value)
break;
case "roadCodeEnd":
setRoadCodeEnd(value)
if (value.length >= 9) {
queryConserveInfo(roadCodeHead, value)
} else {
if (!patrolContentEdit) {
setPatrolContentEdit(true)
@ -936,6 +938,18 @@ const Index = () => {
<Text style={{ color: 'red' }}>*&nbsp;</Text>线路编码
<RadioGroup onChange={(e) => {
setRoadCodeHead(e.detail.value[0]);
if (roadCodeEnd.length >= 9) {
queryConserveInfo(e.detail.value[0], roadCodeEnd)
} else {
if (!patrolContentEdit) {
setPatrolContentEdit(true)
let nextInfo = { ...conserveInfo }
Object.keys(conserveInfo).forEach(key => {
nextInfo[key].value = ''
})
setConserveInfo(nextInfo)
}
}
}}>
<Radio value='X' checked={roadCodeHead === 'X'} color='#0080EE' className='radio' disabled={isView}>X</Radio>
<Radio value='Y' checked={roadCodeHead === 'Y'} color='#0080EE' className='radio' disabled={isView}>Y</Radio>

Loading…
Cancel
Save