|
@ -19,9 +19,8 @@ const Index = () => { |
|
|
const isSuperAdmin = userInfo && userInfo.username === 'SuperAdmin' ? true : false |
|
|
const isSuperAdmin = userInfo && userInfo.username === 'SuperAdmin' ? true : false |
|
|
|
|
|
|
|
|
const router = useRouter() |
|
|
const router = useRouter() |
|
|
const { params: { type, kind, wait } } = router |
|
|
const { params: { type, kind, wait, handle } } = router |
|
|
const isView = type === 'view' ? true : false |
|
|
const isView = type === 'view' ? true : false |
|
|
|
|
|
|
|
|
const isPatrol = kind === 'patrol' || kind == 'conserve' ? true : false |
|
|
const isPatrol = kind === 'patrol' || kind == 'conserve' ? true : false |
|
|
const isRoad = kind === 'road' ? true : false |
|
|
const isRoad = kind === 'road' ? true : false |
|
|
const isAnomaly = kind === 'anomaly' ? true : false |
|
|
const isAnomaly = kind === 'anomaly' ? true : false |
|
@ -57,6 +56,7 @@ const Index = () => { |
|
|
const [handleCenter, setHandleCenter] = useState('') |
|
|
const [handleCenter, setHandleCenter] = useState('') |
|
|
const [handlePic, setHandlePic] = useState([]) |
|
|
const [handlePic, setHandlePic] = useState([]) |
|
|
const [handlePicPn, setHandlePicPn] = useState([]) |
|
|
const [handlePicPn, setHandlePicPn] = useState([]) |
|
|
|
|
|
const [handleId, setHandleId] = useState([]) |
|
|
|
|
|
|
|
|
const prjType = |
|
|
const prjType = |
|
|
isAnomaly ? |
|
|
isAnomaly ? |
|
@ -101,11 +101,10 @@ const Index = () => { |
|
|
checked: false |
|
|
checked: false |
|
|
} |
|
|
} |
|
|
]) |
|
|
]) |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
if (isRoad) { |
|
|
if (isRoad) { |
|
|
Taro.setNavigationBarTitle({ title: '在建项目' }) |
|
|
Taro.setNavigationBarTitle({ title: '在建项目' }) |
|
|
} else if (wait == 'wait') { |
|
|
} else if (wait == 'wait' || handle == 'handle') { |
|
|
Taro.setNavigationBarTitle({ title: '待办事项' }) |
|
|
Taro.setNavigationBarTitle({ title: '待办事项' }) |
|
|
} else if (isAnomaly) { |
|
|
} else if (isAnomaly) { |
|
|
Taro.setNavigationBarTitle({ title: '异常反馈' }) |
|
|
Taro.setNavigationBarTitle({ title: '异常反馈' }) |
|
@ -141,6 +140,13 @@ const Index = () => { |
|
|
setConserveBeforePic(data.conserveBeforePic ? data.conserveBeforePic.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 })) : []) |
|
|
setConserveUnderwayPic(data.conserveUnderwayPic ? data.conserveUnderwayPic.map(item => ({ url: imgUrl + item })) : []) |
|
|
setConserveAfterPic(data.conserveAfterPic ? data.conserveAfterPic.map(item => ({ url: imgUrl + item })) : []) |
|
|
setConserveAfterPic(data.conserveAfterPic ? data.conserveAfterPic.map(item => ({ url: imgUrl + item })) : []) |
|
|
|
|
|
setHandleId(data.id) |
|
|
|
|
|
if (data.handleContent) { |
|
|
|
|
|
setHandleCenter(data.handleContent) |
|
|
|
|
|
} |
|
|
|
|
|
if (data.handlePic.length) { |
|
|
|
|
|
setHandlePic(data.handlePic) |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' }) |
|
|
Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' }) |
|
|
} |
|
|
} |
|
@ -483,6 +489,11 @@ const Index = () => { |
|
|
urls: [file.url] // 需要预览的图片http链接列表 |
|
|
urls: [file.url] // 需要预览的图片http链接列表 |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
function handleImgClicks(index, file) { |
|
|
|
|
|
Taro.previewImage({ |
|
|
|
|
|
urls: [file] // 需要预览的图片http链接列表 |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
if (!isView) { |
|
|
if (!isView) { |
|
|
let newRoadList = roadList.filter(e => e.routeName.match(road)) |
|
|
let newRoadList = roadList.filter(e => e.routeName.match(road)) |
|
@ -512,15 +523,15 @@ const Index = () => { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
let handlePicList = [] |
|
|
let handlePicList = [] |
|
|
if(handlePic.length){ |
|
|
if (handlePic.length) { |
|
|
handlePic.forEach(e=>{ |
|
|
handlePic.forEach(e => { |
|
|
handlePicList.push(e.url) |
|
|
handlePicList.push(e.url) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
let data = { |
|
|
let data = { |
|
|
handleContent: str, |
|
|
handleContent: str, |
|
|
handlePic: handlePicList, |
|
|
handlePic: handlePicList, |
|
|
handleState:'已处理' |
|
|
handleState: '已处理' |
|
|
} |
|
|
} |
|
|
Taro.showModal({ |
|
|
Taro.showModal({ |
|
|
title: '提示', |
|
|
title: '提示', |
|
@ -534,7 +545,7 @@ const Index = () => { |
|
|
Taro.showLoading({ |
|
|
Taro.showLoading({ |
|
|
title: '提交中' |
|
|
title: '提交中' |
|
|
}) |
|
|
}) |
|
|
request.post(postHandle(userInfo.id), data).then(res => { |
|
|
request.post(postHandle(handleId), data).then(res => { |
|
|
Taro.hideLoading() |
|
|
Taro.hideLoading() |
|
|
if (res.statusCode == 200 || res.statusCode == 204) { |
|
|
if (res.statusCode == 200 || res.statusCode == 204) { |
|
|
Taro.showToast({ title: '提交成功', icon: 'none', duration: 1500 }) |
|
|
Taro.showToast({ title: '提交成功', icon: 'none', duration: 1500 }) |
|
@ -545,8 +556,7 @@ const Index = () => { |
|
|
Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' }) |
|
|
Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' }) |
|
|
} |
|
|
} |
|
|
}, err => { |
|
|
}, err => { |
|
|
console.log(err); |
|
|
Taro.showToast({ title: err.message || '请求出错', icon: 'none' }) |
|
|
Taro.showToast({ title: err.message || '请求出错123', icon: 'none' }) |
|
|
|
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -856,26 +866,25 @@ const Index = () => { |
|
|
<AtButton type='primary' className='sub-btn' onClick={report}>上报</AtButton> |
|
|
<AtButton type='primary' className='sub-btn' onClick={report}>上报</AtButton> |
|
|
} |
|
|
} |
|
|
{ |
|
|
{ |
|
|
wait == 'wait' ? <view> |
|
|
wait == 'wait' || handle == 'handle' ? <view> |
|
|
<view className='patrol-img'><text style={{ color: 'red' }}>*</text>处理内容:</view> |
|
|
<view className='patrol-img'><text style={{ color: 'red' }}>*</text>处理内容:</view> |
|
|
<AtTextarea |
|
|
<AtTextarea |
|
|
title='处理内容:' |
|
|
title='处理内容:' |
|
|
// placeholder={isView ? '' : '请输入具体内容'} |
|
|
|
|
|
placeholder='请输入处理内容' |
|
|
placeholder='请输入处理内容' |
|
|
value={handleCenter} |
|
|
value={handleCenter} |
|
|
onChange={(v, e) => handleInput(e, 'wait')} |
|
|
onChange={(v, e) => handleInput(e, 'wait')} |
|
|
// disabled={isView} |
|
|
disabled={handle == 'handle' ? true : false} |
|
|
maxLength={50} |
|
|
maxLength={50} |
|
|
/> |
|
|
/> |
|
|
<View className='patrol-img'> |
|
|
<View className='patrol-img'> |
|
|
处理图片: |
|
|
处理图片: |
|
|
{ |
|
|
{ |
|
|
// isView ? |
|
|
handle == 'handle' ? |
|
|
// <View className='img-box'> |
|
|
<View className='img-box'> |
|
|
// {scenePic.map(item => ( |
|
|
{handlePic.map(item => ( |
|
|
// <Image className='img' src={item.url} onClick={() => handleImgClick(undefined, item)} /> |
|
|
<Image className='img' src={item} onClick={() => handleImgClicks(undefined, item)} /> |
|
|
// ))} |
|
|
))} |
|
|
// </View> : |
|
|
</View> : |
|
|
<AtImagePicker |
|
|
<AtImagePicker |
|
|
className='img-picker' |
|
|
className='img-picker' |
|
|
count={3 - handlePic.length} |
|
|
count={3 - handlePic.length} |
|
@ -885,7 +894,7 @@ const Index = () => { |
|
|
onImageClick={handleImgClick} |
|
|
onImageClick={handleImgClick} |
|
|
/> |
|
|
/> |
|
|
} |
|
|
} |
|
|
<AtButton type='primary' className='sub-btn' onClick={handleOk}>提交</AtButton> |
|
|
{handle != 'handle' ? <AtButton type='primary' className='sub-btn' onClick={handleOk}>提交</AtButton> : ''} |
|
|
</View> |
|
|
</View> |
|
|
</view> : '' |
|
|
</view> : '' |
|
|
} |
|
|
} |
|
|