|
|
@ -59,6 +59,7 @@ const Index = () => { |
|
|
|
const [handleId, setHandleId] = useState([]) |
|
|
|
const [video, setVideo] = useState('') |
|
|
|
const [videoqn, setVideoqn] = useState([]) |
|
|
|
const [handleType, setHandleType] = useState('') |
|
|
|
|
|
|
|
const prjType = |
|
|
|
isAnomaly ? |
|
|
@ -140,13 +141,14 @@ const Index = () => { |
|
|
|
setRoadSectionEnd(data.roadSectionEnd) |
|
|
|
setAddress(data.address) |
|
|
|
setContent(data.content) |
|
|
|
setHandleType(data.handleState) |
|
|
|
setScenePic(data.scenePic ? data.scenePic.map(item => ({ url: imgUrl + item })) : []) |
|
|
|
setHandlePic(data.handlePic ? data.handlePic.map(item => ({ url: imgUrl + item })) : []) |
|
|
|
setConserveBeforePic(data.conserveBeforePic ? data.conserveBeforePic.map(item => ({ url: imgUrl + item })) : []) |
|
|
|
setConserveUnderwayPic(data.conserveUnderwayPic ? data.conserveUnderwayPic.map(item => ({ url: imgUrl + item })) : []) |
|
|
|
setConserveAfterPic(data.conserveAfterPic ? data.conserveAfterPic.map(item => ({ url: imgUrl + item })) : []) |
|
|
|
setHandleId(data.id) |
|
|
|
setVideo(imgUrl + data.videoUrl[0]) |
|
|
|
setVideo(data.videoUrl[0] ? imgUrl + data.videoUrl[0] : '') |
|
|
|
if (data.handleContent) { |
|
|
|
setHandleCenter(data.handleContent) |
|
|
|
} |
|
|
@ -249,7 +251,7 @@ const Index = () => { |
|
|
|
]) |
|
|
|
}, [reportType]) |
|
|
|
|
|
|
|
function report () { |
|
|
|
function report() { |
|
|
|
if (!canReport) { return } |
|
|
|
if ( |
|
|
|
(isPatrol && (!projectType || !road)) |
|
|
@ -326,7 +328,7 @@ const Index = () => { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
function deleteReport () { |
|
|
|
function deleteReport() { |
|
|
|
Taro.showModal({ |
|
|
|
title: '提示', |
|
|
|
content: '确定删除吗?', |
|
|
@ -353,7 +355,7 @@ const Index = () => { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
function handleInput ({ detail: { value } }, type) { |
|
|
|
function handleInput({ detail: { value } }, type) { |
|
|
|
switch (type) { |
|
|
|
case 'roadSectionStart': |
|
|
|
setRoadSectionStart(value) |
|
|
@ -388,15 +390,15 @@ const Index = () => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function handleTypeChange (e) { |
|
|
|
function handleTypeChange(e) { |
|
|
|
setReportType(e.detail.value) |
|
|
|
} |
|
|
|
|
|
|
|
function handleImgChange (files, operationType, index, type) { |
|
|
|
function handleImgChange(files, operationType, index, type) { |
|
|
|
if (operationType === 'remove') { |
|
|
|
setImg(false) |
|
|
|
} |
|
|
|
function setImg (isAdd, url) { |
|
|
|
function setImg(isAdd, url) { |
|
|
|
switch (type) { |
|
|
|
case 'scenePic': |
|
|
|
let nextImg = sceneImg |
|
|
@ -496,12 +498,12 @@ const Index = () => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function handleImgClick (index, file) { |
|
|
|
function handleImgClick(index, file) { |
|
|
|
Taro.previewImage({ |
|
|
|
urls: [file.url] // 需要预览的图片http链接列表 |
|
|
|
}) |
|
|
|
} |
|
|
|
function handleImgClicks (index, file) { |
|
|
|
function handleImgClicks(index, file) { |
|
|
|
Taro.previewImage({ |
|
|
|
urls: [file] // 需要预览的图片http链接列表 |
|
|
|
}) |
|
|
@ -523,7 +525,7 @@ const Index = () => { |
|
|
|
} |
|
|
|
} |
|
|
|
}, [road]) |
|
|
|
function handleOk () { |
|
|
|
function handleOk() { |
|
|
|
if (!canReport) { return } |
|
|
|
let str = handleCenter.trim() |
|
|
|
if (!str) { |
|
|
@ -568,7 +570,7 @@ const Index = () => { |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
function addVideo () { |
|
|
|
function addVideo() { |
|
|
|
wx.chooseMedia({ |
|
|
|
count: 1, |
|
|
|
mediaType: ['video'], |
|
|
@ -611,6 +613,7 @@ const Index = () => { |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
console.log(handleType,'handleType'); |
|
|
|
return ( |
|
|
|
<View className='patrol'> |
|
|
|
{/* { |
|
|
@ -941,11 +944,10 @@ const Index = () => { |
|
|
|
<AtButton type='primary' className='sub-btn' onClick={report}>上报</AtButton> |
|
|
|
} |
|
|
|
{ |
|
|
|
wait == 'wait' || handle == 'handle' ? <view> |
|
|
|
handleType == '已处理' || wait == 'wait' || handle == 'handle' ? <view> |
|
|
|
<view className='patrol-img'><text style={{ color: 'red' }}>*</text>处理内容:</view> |
|
|
|
<AtTextarea |
|
|
|
title='处理内容:' |
|
|
|
placeholder='请输入处理内容' |
|
|
|
value={handleCenter} |
|
|
|
onChange={(v, e) => handleInput(e, 'wait')} |
|
|
|
disabled={handle == 'handle' ? true : false} |
|
|
@ -959,15 +961,15 @@ const Index = () => { |
|
|
|
{handlePic.map(item => ( |
|
|
|
<Image className='img' src={item.url} onClick={() => handleImgClicks(undefined, item)} /> |
|
|
|
))} |
|
|
|
</View> : |
|
|
|
<AtImagePicker |
|
|
|
className='img-picker' |
|
|
|
count={3 - handlePic.length} |
|
|
|
showAddBtn={handlePic.length >= 3 ? false : true} |
|
|
|
files={handlePic} |
|
|
|
onChange={(files, operationType, index) => handleImgChange(files, operationType, index, 'wait')} |
|
|
|
onImageClick={handleImgClick} |
|
|
|
/> |
|
|
|
</View> : handleType != '已处理' ? |
|
|
|
<AtImagePicker |
|
|
|
className='img-picker' |
|
|
|
count={3 - handlePic.length} |
|
|
|
showAddBtn={handlePic.length >= 3 ? false : true} |
|
|
|
files={handlePic} |
|
|
|
onChange={(files, operationType, index) => handleImgChange(files, operationType, index, 'wait')} |
|
|
|
onImageClick={handleImgClick} |
|
|
|
/> : '' |
|
|
|
} |
|
|
|
{handle != 'handle' ? <AtButton type='primary' className='sub-btn' onClick={handleOk}>提交</AtButton> : ''} |
|
|
|
</View> |
|
|
|