{{item.name}}
diff --git a/weapp/utils/getApiUrl.js b/weapp/utils/getApiUrl.js
index ce01ed6..6527efb 100644
--- a/weapp/utils/getApiUrl.js
+++ b/weapp/utils/getApiUrl.js
@@ -24,6 +24,6 @@ exports.addPatrolRecord = () => {
}
// 获取巡检记录
-exports.getPatrolRecord = (patrolPlanId, startTime, endTime, alarm) => {
- return `/patrolRecord/${patrolPlanId}/${startTime}/${endTime}/${alarm}`
+exports.getPatrolRecord = (patrolPlanId, startTime, endTime, alarm, pointId) => {
+ return `/patrolRecord/${patrolPlanId}/${startTime}/${endTime}/${alarm}/${pointId}`
}
\ No newline at end of file
diff --git a/web/client/src/sections/patrolManage/containers/patrolRecord.js b/web/client/src/sections/patrolManage/containers/patrolRecord.js
index e10829e..ce15464 100644
--- a/web/client/src/sections/patrolManage/containers/patrolRecord.js
+++ b/web/client/src/sections/patrolManage/containers/patrolRecord.js
@@ -3,14 +3,14 @@
import React, { useEffect, useState } from 'react';
import { connect } from 'react-redux';
-import { Form, Input, Select, Button, Table, Modal, DatePicker } from 'antd';
+import { Form, Input, Select, Button, Table, Modal, DatePicker, Checkbox, Row, Col } from 'antd';
import moment from "moment";
const PatrolRecord = (props) => {
const { dispatch, actions, } = props
const { patrolManage } = actions
const [tableList, settableList] = useState([])
- const [addModel, setAddModel] = useState(false)
+ const [showDetailModal, setShowDetail] = useState(false)
const [modelData, setModelData] = useState({})
const [query, setQuery] = useState({ limit: 10, page: 0 })
const [limits, setLimits] = useState()
@@ -22,80 +22,82 @@ const PatrolRecord = (props) => {
}, [])
const record = (params) => {
- dispatch(patrolManage.records(`patrolRecord/all/${params.time[0]}/${params.time[1]}/${params.state}/1`)).then(res => {
+ dispatch(patrolManage.records(`patrolRecord/all/${params.time[0]}/${params.time[1]}/${params.state}/null`)).then(res => {
if (res.success) {
- settableList(res.payload.data?.map(v => ({ ...v, key: v.id })))
+ settableList(params.name != null ? res.payload.data?.filter(v =>
+ (v.points.user.name.indexOf(params.name) != -1 || v.points.project.name.indexOf(params.name) != -1))
+ .map(v => ({ ...v, key: v.id })) : res.payload.data?.map(v => ({ ...v, key: v.id })))
setLimits(res.payload.data?.length)
}
})
}
const columns = [{
- title: '结构物名称',
- dataIndex: 'name',
- key: 'name',
- render: (text, record, index) => {
- return !record.points?.project? '':{record.points.project.name}
- }
- }, {
- title: '巡检人',
- dataIndex: 'type',
- key: 'type',
- render: (text, record, index) => {
- return !record.points?.user? '':{record.points.user.name}
- }
- }, {
- title: '巡检点位',
- dataIndex: 'type',
- key: 'type',
- render: (text, record, index) => {
- return !record.points?.user? '':{record.points.itemData.name}
- }
- }, {
- title: '巡检单位',
- dataIndex: 'type',
- key: 'type',
- render: (text, record, index) => {
- return !record.points?.user? '':{record.points.user.department.name}
- }
- }, {
- title: '巡检频次',
- dataIndex: 'describe',
- key: 'describe',
- render: (text, record, index) => {
- return !record.points? '':{record.points.frequency}
- }
- }, {
- title: '上次巡检日期',
- dataIndex: 'describe',
- key: 'describe',
- render: (text, record, index) => moment(record.lastInspectionTime).format('YYYY-MM-DD HH:mm') || '--'
- }, {
- title: '本次巡检日期',
- dataIndex: 'describe',
- key: 'describe',
- render: (text, record, index) => moment(record.inspectionTime).format('YYYY-MM-DD HH:mm') || '--'
- }, {
- title: '巡检结果',
- dataIndex: 'describe',
- key: 'describe',
- render: (text, record, index) => !record.alarm? '正常':'异常'
- }, {
- title: '操作',
- dataIndex: 'operation',
- key: 'operation',
- render: (text, record, index) => {
- return (
-
-
-
- )
- }
+ title: '结构物名称',
+ dataIndex: 'name',
+ key: 'name',
+ render: (text, record, index) => {
+ return !record.points?.project ? '' : {record.points.project.name}
+ }
+ }, {
+ title: '巡检人',
+ dataIndex: 'type',
+ key: 'type',
+ render: (text, record, index) => {
+ return !record.points?.user ? '' : {record.points.user.name}
}
+ }, {
+ title: '巡检点位',
+ dataIndex: 'type',
+ key: 'type',
+ render: (text, record, index) => {
+ return !record.points?.user ? '' : {record.points.itemData.name}
+ }
+ }, {
+ title: '巡检单位',
+ dataIndex: 'type',
+ key: 'type',
+ render: (text, record, index) => {
+ return !record.points?.user ? '' : {record.points.user.department.name}
+ }
+ }, {
+ title: '巡检频次',
+ dataIndex: 'describe',
+ key: 'describe',
+ render: (text, record, index) => {
+ return !record.points ? '' : {record.points.frequency}
+ }
+ }, {
+ title: '上次巡检日期',
+ dataIndex: 'describe',
+ key: 'describe',
+ render: (text, record, index) => moment(record.lastInspectionTime).format('YYYY-MM-DD HH:mm') || '--'
+ }, {
+ title: '本次巡检日期',
+ dataIndex: 'describe',
+ key: 'describe',
+ render: (text, record, index) => moment(record.inspectionTime).format('YYYY-MM-DD HH:mm') || '--'
+ }, {
+ title: '巡检结果',
+ dataIndex: 'describe',
+ key: 'describe',
+ render: (text, record, index) => !record.alarm ? '正常' : '异常'
+ }, {
+ title: '操作',
+ dataIndex: 'operation',
+ key: 'operation',
+ render: (text, record, index) => {
+ return (
+
+
+
+ )
+ }
+ }
]
return (
@@ -122,10 +124,10 @@ const PatrolRecord = (props) => {
style={{ marginRight: 16, }}
initialValue={[moment(search.time[0], format), moment(search.time[1], format)]}
>
-
+
-
@@ -160,6 +162,33 @@ const PatrolRecord = (props) => {
}
}}
/>
+ setShowDetail(false)}
+ footer={[]}
+ >
+
+ 当前点位:{modelData?.points?.itemData?.name}
+
+
+ 当前位置:{modelData?.points?.address}
+
+
+ 巡检结果:{modelData.alarm? '异常':'正常'}
+
+ { !modelData.alarm? '':
+
+ 巡检详情:{modelData?.points?.msgInp}
+
}
+ { !modelData.alarm? '':
+
+ 异常等级:{modelData?.points?.changeThree}
+
}
+ { !modelData.alarm? '':
+ { modelData?.points?.imgs?.map(rs => )}
+
}
+
>
)
}