diff --git a/web/client/src/sections/patrolManage/actions/index.js b/web/client/src/sections/patrolManage/actions/index.js
index aaaafe9..c465b0f 100644
--- a/web/client/src/sections/patrolManage/actions/index.js
+++ b/web/client/src/sections/patrolManage/actions/index.js
@@ -1,7 +1,9 @@
'use strict';
import * as plan from './plan'
+import * as record from './record'
export default {
...plan,
+ ...record,
}
\ No newline at end of file
diff --git a/web/client/src/sections/patrolManage/actions/record.js b/web/client/src/sections/patrolManage/actions/record.js
new file mode 100644
index 0000000..a6ae77e
--- /dev/null
+++ b/web/client/src/sections/patrolManage/actions/record.js
@@ -0,0 +1,17 @@
+'use strict';
+
+import { basicAction } from '@peace/utils'
+
+export const GET_PATROL_RECORD_LIST = 'GET_PATROL_RECORD_LIST';
+export const GET_PATROL_RECORD_LIST_SUCCESS = 'GET_PATROL_RECORD_LIST_SUCCESS';
+export const GET_PATROL_RECORD_LIST_ERROR = 'GET_PATROL_RECORD_LIST_ERROR';
+export function records(url) {
+ return (dispatch) => basicAction({
+ type: 'get',
+ dispatch,
+ actionType: GET_PATROL_RECORD_LIST,
+ url: url,
+ msg: { error: '获取巡检记录失败', },
+ reducer: { name: 'record' }
+ });
+}
\ No newline at end of file
diff --git a/web/client/src/sections/patrolManage/containers/index.js b/web/client/src/sections/patrolManage/containers/index.js
index 4121322..d83768a 100644
--- a/web/client/src/sections/patrolManage/containers/index.js
+++ b/web/client/src/sections/patrolManage/containers/index.js
@@ -1,5 +1,6 @@
'use strict';
import PatrolPlan from './patrolPlan';
+import PatrolReocrd from './patrolRecord';
-export { PatrolPlan };
\ No newline at end of file
+export { PatrolPlan, PatrolReocrd };
\ 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
new file mode 100644
index 0000000..e10829e
--- /dev/null
+++ b/web/client/src/sections/patrolManage/containers/patrolRecord.js
@@ -0,0 +1,175 @@
+
+'use strict'
+
+import React, { useEffect, useState } from 'react';
+import { connect } from 'react-redux';
+import { Form, Input, Select, Button, Table, Modal, DatePicker } 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 [modelData, setModelData] = useState({})
+ const [query, setQuery] = useState({ limit: 10, page: 0 })
+ const [limits, setLimits] = useState()
+ const format = 'YYYY-MM-DD'
+ const [search, setSearch] = useState({ name: null, time: [moment().add(-7, 'd').format(format), moment().format(format)], state: 'null' })
+
+ useEffect(() => {
+ record(search)
+ }, [])
+
+ const record = (params) => {
+ dispatch(patrolManage.records(`patrolRecord/all/${params.time[0]}/${params.time[1]}/${params.state}/1`)).then(res => {
+ if (res.success) {
+ settableList(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 (
+
+
+
+ )
+ }
+ }
+ ]
+
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {
+ return {`共${Math.ceil(total / query?.limit)}页,${total}项`}
+ },
+ onChange: (page, pageSize) => {
+ setQuery({ limit: pageSize, page: page - 1 });
+ record({ limit: pageSize, page: page - 1, ...search, companyId: companyID || search?.companyId })
+ }
+ }}
+ />
+ >
+ )
+}
+
+function mapStateToProps(state) {
+ const { auth, global } = state;
+ return {
+ user: auth.user,
+ actions: global.actions,
+ };
+}
+
+export default connect(mapStateToProps)(PatrolRecord);
diff --git a/web/client/src/sections/patrolManage/nav-item.js b/web/client/src/sections/patrolManage/nav-item.js
index 51174e4..c3bdb3d 100644
--- a/web/client/src/sections/patrolManage/nav-item.js
+++ b/web/client/src/sections/patrolManage/nav-item.js
@@ -14,6 +14,9 @@ export function getNavItem(user, dispatch) {
巡检计划制定
+
+ 巡检记录
+
);
}
\ No newline at end of file
diff --git a/web/client/src/sections/patrolManage/reducers/record.js b/web/client/src/sections/patrolManage/reducers/record.js
new file mode 100644
index 0000000..91fa14a
--- /dev/null
+++ b/web/client/src/sections/patrolManage/reducers/record.js
@@ -0,0 +1,32 @@
+'use strict';
+import * as actionTypes from '../actions/record';
+import Immutable from 'immutable';
+
+const initState = {
+ data: {},
+ isRequesting: false,
+ error: null
+};
+
+function record(state = initState, action) {
+ const payload = action.payload;
+ switch (action.type){
+ case actionTypes.GET_PATROL_RECORD_LIST:
+ return Immutable.fromJS(state).set('data',
+ payload.data).toJS();
+ case actionTypes.GET_PATROL_RECORD_LIST_SUCCESS:
+ return Immutable.fromJS(state).merge({
+ isRequesting: false,
+ data: payload.data
+ }).toJS();
+ case actionTypes.GET_PATROL_RECORD_LIST_ERROR:
+ return Immutable.fromJS(state).merge({
+ isRequesting: false,
+ error: payload.error
+ }).toJS();
+ default:
+ return state;
+ }
+}
+
+export default record;
\ No newline at end of file
diff --git a/web/client/src/sections/patrolManage/routes.js b/web/client/src/sections/patrolManage/routes.js
index e8e874c..ddd494a 100644
--- a/web/client/src/sections/patrolManage/routes.js
+++ b/web/client/src/sections/patrolManage/routes.js
@@ -1,5 +1,5 @@
'use strict';
-import { PatrolPlan } from './containers';
+import { PatrolPlan, PatrolReocrd } from './containers';
export default [{
type: 'inner',
@@ -12,6 +12,11 @@ export default [{
key: 'patrolPlan',
component: PatrolPlan,
breadcrumb: '巡检计划制定',
+ },{
+ path: '/patrolRecord',
+ key: 'patrolRecord',
+ component: PatrolReocrd,
+ breadcrumb: '巡检记录',
}]
}
}];
\ No newline at end of file
diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js
index c1b75a6..ce46c8a 100644
--- a/web/client/src/utils/webapi.js
+++ b/web/client/src/utils/webapi.js
@@ -23,6 +23,9 @@ export const ApiTable = {
patrolPlan: 'patrolPlan', // 增改查
delPatrolPlan: 'patrolPlan/{id}',
+ // 巡检记录
+ patrolRecord: 'patrolRecord/:patrolPlanId/:startTime/:endTime/:alarm/:pointId',
+
// 用户权限
getResource: 'resource',
getUserResource: 'user/resource',