|
@ -34,6 +34,12 @@ const Index = () => { |
|
|
const [sourceRoadStartSel, setSourceRoadStartSel] = useState([]) |
|
|
const [sourceRoadStartSel, setSourceRoadStartSel] = useState([]) |
|
|
const [sourceRoadEndSel, setSourceRoadEndSel] = useState([]) |
|
|
const [sourceRoadEndSel, setSourceRoadEndSel] = useState([]) |
|
|
|
|
|
|
|
|
|
|
|
const prjType = [ |
|
|
|
|
|
{ text: '道路', value: 'road'}, |
|
|
|
|
|
{ text: '桥梁', value: 'birdge'}, |
|
|
|
|
|
{ text: '涵洞', value: 'culvert'}, |
|
|
|
|
|
{ text: '其他', value: 'other'}, |
|
|
|
|
|
] |
|
|
const prjTypeSelector = ['道路', '桥梁', '涵洞', '其他'] |
|
|
const prjTypeSelector = ['道路', '桥梁', '涵洞', '其他'] |
|
|
const [roadStartSel, setRoadStartSel] = useState([]) |
|
|
const [roadStartSel, setRoadStartSel] = useState([]) |
|
|
const [roadEndSel, setRoadEndSel] = useState([]) |
|
|
const [roadEndSel, setRoadEndSel] = useState([]) |
|
@ -60,8 +66,15 @@ const Index = () => { |
|
|
Taro.hideLoading() |
|
|
Taro.hideLoading() |
|
|
if (res.statusCode == 200 || res.statusCode == 204) { |
|
|
if (res.statusCode == 200 || res.statusCode == 204) { |
|
|
const { data } = res |
|
|
const { data } = res |
|
|
|
|
|
let showPrjType = '' |
|
|
|
|
|
for (const item of prjType) { |
|
|
|
|
|
if (item.value === data.projectType) { |
|
|
|
|
|
showPrjType = item.text |
|
|
|
|
|
break |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
setReportType(data.reportType) |
|
|
setReportType(data.reportType) |
|
|
setProjectType(data.projectType) |
|
|
setProjectType(showPrjType || data.projectType) |
|
|
setRoad(data.road) |
|
|
setRoad(data.road) |
|
|
setRoadSectionStart(data.roadSectionStart) |
|
|
setRoadSectionStart(data.roadSectionStart) |
|
|
setRoadSectionEnd(data.roadSectionEnd) |
|
|
setRoadSectionEnd(data.roadSectionEnd) |
|
@ -118,6 +131,7 @@ const Index = () => { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}, []) |
|
|
}, []) |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
setRoadStartSel(sourceRoadStartSel) |
|
|
setRoadStartSel(sourceRoadStartSel) |
|
|
setRoadEndSel(sourceRoadEndSel) |
|
|
setRoadEndSel(sourceRoadEndSel) |
|
@ -148,9 +162,11 @@ const Index = () => { |
|
|
Taro.showToast({ title: '工程类型错误', icon: 'none' }) |
|
|
Taro.showToast({ title: '工程类型错误', icon: 'none' }) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
const reportProjectType = prjType[prjTypeSelector.indexOf(projectType)].value |
|
|
|
|
|
|
|
|
let data = { |
|
|
let data = { |
|
|
reportType, |
|
|
reportType, |
|
|
projectType, |
|
|
projectType: reportProjectType, |
|
|
road, |
|
|
road, |
|
|
roadSectionStart, |
|
|
roadSectionStart, |
|
|
roadSectionEnd, |
|
|
roadSectionEnd, |
|
|