Browse Source

fix 异常反馈-详情页面上报图片不展示

dev
巴林闲侠 2 years ago
parent
commit
6b7572db43
  1. 12
      weapp/src/packages/patrol/index.jsx
  2. 36
      web/client/src/sections/fillion/components/patrolTable.js

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

@ -154,7 +154,6 @@ const Index = () => {
+ res.data.result.address_component.district
+ res.data.result.address_component.street_number
// addresscity = res.data.result.formatted_addresses.standard_address
console.log(res, 'res')
let street = res.data.result.address_component.street
setRoad(street)
setAddress(addresscity)
@ -190,7 +189,6 @@ const Index = () => {
setRoadStartSel(sourceRoadStartSel)
setRoadEndSel(sourceRoadEndSel)
}, [sourceRoadStartSel, sourceRoadEndSel])
useEffect(() => {
setTypeList([
{
@ -217,7 +215,7 @@ const Index = () => {
}
if (isPatrol && prjTypeSelector.indexOf(projectType) === -1) {
Taro.showToast({ title: '工程类型错误', icon: 'none' })
Taro.showToast({ title: isAnomaly ? '反馈类型错误' : '工程类型错误', icon: 'none' })
return
}
if (content.length > 50) {
@ -228,7 +226,8 @@ const Index = () => {
Taro.showToast({ title: '请完善项目名称', icon: 'none' })
return
}
const reportProjectType = prjType[prjTypeSelector.indexOf(projectType)]?.value || ''
const reportProjectType = prjType.find(p => p.text == projectType)?.value || ''
let data = {
reportType: isPatrol ? reportType : kind,
@ -243,14 +242,13 @@ const Index = () => {
projectName,
handleState: isAnomaly ? '待处理' : undefined,
}
if (reportType === 'patrol') {
if (reportType === 'patrol' || isAnomaly || isRoad) {
data['scenePic'] = sceneImg
} else {
data['conserveBeforePic'] = conserveBeforeImg
data['conserveUnderwayPic'] = conserveUnderwayImg
data['conserveAfterPic'] = conserveAfterImg
}
Taro.showModal({
title: '提示',
content: '您要进行信息上报么?',
@ -625,7 +623,6 @@ const Index = () => {
sourceType: ['album', 'camera'], mediaType: ['image', 'video'],
camera: 'back',
success: function (res) {
console.log(res.tempFilePath)
Taro.showLoading({ title: '上传中' })
const tempFilePaths = res.tempFilePath
let token = getState('token') || Taro.getStorageSync('token')
@ -634,7 +631,6 @@ const Index = () => {
filePath: tempFilePaths,
name: 'file',
success: (res) => {
console.log(res);
Taro.hideLoading();
if (res.statusCode == 200) {
// setImg(true, JSON.parse(res.data).key)

36
web/client/src/sections/fillion/components/patrolTable.js

@ -11,6 +11,25 @@ import PatrolGis from './gis/patrolGis';
import styles from './protable.less';
import moment from 'moment';
const reportTypeText = (text) => {
switch (text) {
case 'road': return '道路';
//
case 'countyRoad': return '县道';
case 'villageRoad': return '乡道';
case 'rusticRoad': return '村道';
//
case 'bridge': return '桥梁';
case 'culvert': return '涵洞';
case 'other': return '其他';
//
case 'conserve': return '养护';
case 'patrol': return '巡查';
case 'construction': return '在建';
default: return text;
}
}
const DetailForm = (props) => {
const { visible, data, handleClose, loading, isAnomaly, isRoad, isPatrol } = props;
@ -38,8 +57,21 @@ const DetailForm = (props) => {
<div style={{ display: 'flex', width: '100%', justifyContent: 'space-between', margin: '12px 0' }}>
<span style={{ fontSize: 16, color: 'gray', minWidth: '26%' }}>{obj.key}</span>
{
obj.name != 'scenePic' ?
<Input style={{ width: '70%' }} value={obj.name == 'id' ? moment(data.time).format("YYYYMMDD") * 10000 + data.id : data[obj.name]} disabled />
<Input
style={{ width: '70%' }}
value={
obj.name == 'id' ?
moment(data.time).format("YYYYMMDD") * 10000 + data.id
:
obj.name == 'projectType' ?
reportTypeText(data[obj.name]) :
data[obj.name]
}
disabled
/>
:
<div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
{
@ -510,7 +542,7 @@ const PatrolTable = (props) => {
);
};
function mapStateToProps(state) {
function mapStateToProps (state) {
const { auth, depMessage, userList, reportList, reportDetail } = state;
const pakData = (dep) => {
return dep.map((d) => {

Loading…
Cancel
Save