|
@ -13,13 +13,14 @@ import moment from 'moment'; |
|
|
|
|
|
|
|
|
const DetailForm = (props) => { |
|
|
const DetailForm = (props) => { |
|
|
const { visible, data, handleClose, loading } = props; |
|
|
const { visible, data, handleClose, loading } = props; |
|
|
|
|
|
const [qndmn] = useState(localStorage.getItem('qndmn')); |
|
|
const keyList = [ |
|
|
const keyList = [ |
|
|
{ key: '编号', name: 'id' }, |
|
|
{ key: '编号', name: 'id' }, |
|
|
{ key: '工程类型', name: 'projectType' }, |
|
|
{ key: '工程类型', name: 'projectType' }, |
|
|
{ key: '所在路段', name: 'road' }, |
|
|
{ key: '所在路段', name: 'road' }, |
|
|
{ key: '具体位置', name: 'address' }, |
|
|
{ key: '具体位置', name: 'address' }, |
|
|
{ key: '巡查内容', name: 'content' }, |
|
|
{ key: '巡查内容', name: 'content' }, |
|
|
{ key: '病害照片', name: 'scenePic' }, |
|
|
{ key: '现场照片', name: 'scenePic' }, |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
const renderContent = (data) => { |
|
|
const renderContent = (data) => { |
|
@ -38,7 +39,7 @@ const DetailForm = (props) => { |
|
|
{ |
|
|
{ |
|
|
data.scenePic && data.scenePic instanceof Array ? data.scenePic.map(imgSrc => { |
|
|
data.scenePic && data.scenePic instanceof Array ? data.scenePic.map(imgSrc => { |
|
|
return <div style={{ width: '44%', margin: 6 }}> |
|
|
return <div style={{ width: '44%', margin: 6 }}> |
|
|
<Image src={imgSrc} width={'100%'} style={{ marginBottom: 4 }} /> |
|
|
<Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} /> |
|
|
</div> |
|
|
</div> |
|
|
}) : '暂无图片' |
|
|
}) : '暂无图片' |
|
|
} |
|
|
} |
|
@ -57,7 +58,7 @@ const DetailForm = (props) => { |
|
|
visible={visible} |
|
|
visible={visible} |
|
|
footer={null} |
|
|
footer={null} |
|
|
onCancel={handleClose} |
|
|
onCancel={handleClose} |
|
|
title={'巡更管理详情'} |
|
|
title={'巡查管理详情'} |
|
|
> |
|
|
> |
|
|
<Spin spinning={loading}> |
|
|
<Spin spinning={loading}> |
|
|
{renderContent(data)} |
|
|
{renderContent(data)} |
|
@ -90,7 +91,7 @@ const DetailList = (props) => { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
let daySet = {}; |
|
|
const columns = [ |
|
|
const columns = [ |
|
|
{ |
|
|
{ |
|
|
title: '编号', |
|
|
title: '编号', |
|
@ -98,6 +99,14 @@ const DetailList = (props) => { |
|
|
dataIndex: 'id', |
|
|
dataIndex: 'id', |
|
|
align: 'center', |
|
|
align: 'center', |
|
|
render: (text, record) => { |
|
|
render: (text, record) => { |
|
|
|
|
|
let day = moment(record.time).format("YYYYMMDD") |
|
|
|
|
|
if (daySet[day]) { |
|
|
|
|
|
daySet[day].add(Symbol()) |
|
|
|
|
|
} else { |
|
|
|
|
|
daySet[day] = new Set() |
|
|
|
|
|
daySet[day].add(Symbol()) |
|
|
|
|
|
} |
|
|
|
|
|
return day * 10000 + daySet[day].size |
|
|
return moment(record.time).format("YYYYMMDD") * 10000 + record.id; |
|
|
return moment(record.time).format("YYYYMMDD") * 10000 + record.id; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@ -106,6 +115,15 @@ const DetailList = (props) => { |
|
|
key: 'projectType', |
|
|
key: 'projectType', |
|
|
dataIndex: 'projectType', |
|
|
dataIndex: 'projectType', |
|
|
align: 'center', |
|
|
align: 'center', |
|
|
|
|
|
render: (text, record) => { |
|
|
|
|
|
switch (text) { |
|
|
|
|
|
case 'road': return '道路'; |
|
|
|
|
|
case 'bridge': return '桥梁'; |
|
|
|
|
|
case 'culvert ': return '涵洞'; |
|
|
|
|
|
case 'other': return '其他'; |
|
|
|
|
|
default: return text; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '所属道路', |
|
|
title: '所属道路', |
|
@ -205,7 +223,7 @@ const PatrolNameList = (props) => { |
|
|
|
|
|
|
|
|
const columns = [ |
|
|
const columns = [ |
|
|
{ |
|
|
{ |
|
|
title: '巡更人员', |
|
|
title: '巡查人员', |
|
|
key: 'name', |
|
|
key: 'name', |
|
|
dataIndex: 'name', |
|
|
dataIndex: 'name', |
|
|
align: 'center' |
|
|
align: 'center' |
|
@ -243,7 +261,7 @@ const PatrolNameList = (props) => { |
|
|
return record.id == selectRoad ? 'list-row-actived' : ''; |
|
|
return record.id == selectRoad ? 'list-row-actived' : ''; |
|
|
}} |
|
|
}} |
|
|
toolBarRender={() => [ |
|
|
toolBarRender={() => [ |
|
|
<Input placeholder='输入巡更人员名称' onChange={doUserNameSearch} ></Input> |
|
|
<Input placeholder='输入巡查人员名称' onChange={doUserNameSearch} ></Input> |
|
|
]} |
|
|
]} |
|
|
options={false} |
|
|
options={false} |
|
|
pagination={false} |
|
|
pagination={false} |
|
@ -319,10 +337,10 @@ const PatrolTable = (props) => { |
|
|
const tabList = [ |
|
|
const tabList = [ |
|
|
{ |
|
|
{ |
|
|
key: 'tab1', |
|
|
key: 'tab1', |
|
|
tab: '巡更', |
|
|
tab: '巡查', |
|
|
}, { |
|
|
}, { |
|
|
key: 'tab2', |
|
|
key: 'tab2', |
|
|
tab: '巡更轨迹查询', |
|
|
tab: '巡查轨迹查询', |
|
|
}, |
|
|
}, |
|
|
]; |
|
|
]; |
|
|
const contentList = { |
|
|
const contentList = { |
|
@ -388,7 +406,7 @@ const PatrolTable = (props) => { |
|
|
); |
|
|
); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
function mapStateToProps(state) { |
|
|
function mapStateToProps (state) { |
|
|
const { auth, depMessage, userList, reportList, reportDetail } = state; |
|
|
const { auth, depMessage, userList, reportList, reportDetail } = state; |
|
|
const pakData = (dep) => { |
|
|
const pakData = (dep) => { |
|
|
return dep.map((d) => { |
|
|
return dep.map((d) => { |
|
|