CODE 1 year ago
parent
commit
6199ec38d7
  1. 5
      api/app/lib/controllers/data/road.js
  2. 21
      api/app/lib/controllers/report/index.js
  3. 4
      web/client/src/sections/fillion/actions/index.js
  4. 2
      web/client/src/sections/fillion/actions/infor.js
  5. 111
      web/client/src/sections/fillion/actions/spotCheck.js
  6. 181
      web/client/src/sections/fillion/components/adjustment.js
  7. 190
      web/client/src/sections/fillion/containers/adjustLog.js
  8. 4
      web/client/src/sections/fillion/containers/index.js
  9. 290
      web/client/src/sections/fillion/containers/maintenanceSpotCheck-new.js
  10. 14
      web/client/src/sections/fillion/nav-item.js
  11. 13
      web/client/src/sections/fillion/routes.js
  12. 2
      web/client/src/sections/organization/containers/authority.js

5
api/app/lib/controllers/data/road.js

@ -35,12 +35,15 @@ async function importIn (ctx) {
async function get (ctx) { async function get (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { codePrefix, level, road, sectionStart, sectionEnd } = ctx.query; const { codePrefix, level, road, sectionStart, sectionEnd, alterId } = ctx.query;
let findOption = { let findOption = {
where: {}, where: {},
order: [['id', 'DESC']] order: [['id', 'DESC']]
} }
if (alterId) {
findOption.where.id = { $notIn: alterId }
}
if (codePrefix) { if (codePrefix) {
findOption.where.routeCode = { $like: `${codePrefix}%` } findOption.where.routeCode = { $like: `${codePrefix}%` }

21
api/app/lib/controllers/report/index.js

@ -805,30 +805,26 @@ async function roadSpotList (ctx) {
let findOpt = { let findOpt = {
order: [['id', 'DESC']], order: [['id', 'DESC']],
where: { where: {
checked: false checked: true
} }
} }
if (startTime && endTime) { if (startTime && endTime) {
findOpt.where = { findOpt.where.date = {
date: {
$between: [moment(startTime).startOf('day').format(), moment(endTime).endOf('day').format()] $between: [moment(startTime).startOf('day').format(), moment(endTime).endOf('day').format()]
} }
}
}
const listRes = await models.RoadSpotCheckPreview.findAll({
order: [['id', 'DESC']],
where: {
checked: true,
} }
})
if (page && limit) { if (page && limit) {
findOpt.offset = (page - 1) * limit findOpt.offset = (page - 1) * limit
findOpt.limit = limit findOpt.limit = limit
} }
const listRes = await models.RoadSpotCheckPreview.findAll(findOpt)
ctx.status = 200; ctx.status = 200;
ctx.body = listRes.map(item => { ctx.body = listRes.map(item => {
return { return {
@ -838,6 +834,9 @@ async function roadSpotList (ctx) {
spotCountyRoadCount: item.countyRoadId ? item.countyRoadId.length : 0, spotCountyRoadCount: item.countyRoadId ? item.countyRoadId.length : 0,
spotTownRoadCount: item.townshipRoadId ? item.townshipRoadId.length : 0, spotTownRoadCount: item.townshipRoadId ? item.townshipRoadId.length : 0,
spotVillageRoadCount: item.villageId ? item.villageId.length : 0, spotVillageRoadCount: item.villageId ? item.villageId.length : 0,
countyRoadId: item.countyRoadId,
townshipRoadId: item.townshipRoadId,
villageId: item.villageId,
} }
}) })
} catch (error) { } catch (error) {
@ -991,7 +990,7 @@ async function roadSpotChangList (ctx) {
where: { where: {
checked: true, checked: true,
}, },
attributes: ['id'] attributes: ['id', 'date']
} }
if (startTime && endTime) { if (startTime && endTime) {

4
web/client/src/sections/fillion/actions/index.js

@ -7,6 +7,7 @@ import * as assess from './assess'
import * as allDepUsers from './allDepUsers' import * as allDepUsers from './allDepUsers'
import * as getReportSpotPrepare from './extract' import * as getReportSpotPrepare from './extract'
import * as luzheng from './luzheng' import * as luzheng from './luzheng'
import * as spotCheck from './spotCheck'
export default { export default {
...infor, ...infor,
...patrol, ...patrol,
@ -14,5 +15,6 @@ export default {
...assess, ...assess,
...allDepUsers, ...allDepUsers,
...getReportSpotPrepare, ...getReportSpotPrepare,
...luzheng ...luzheng,
...spotCheck
} }

2
web/client/src/sections/fillion/actions/infor.js

@ -98,7 +98,7 @@ export function getRoadway(query) {
actionType: 'GET_ROADWAY', actionType: 'GET_ROADWAY',
url: ApiTable.getRoadway, url: ApiTable.getRoadway,
msg: { error: '获取道路信息失败' }, msg: { error: '获取道路信息失败' },
reducer: { name: 'road' }
}); });
} }
export function putRoadway (query) { export function putRoadway (query) {

111
web/client/src/sections/fillion/actions/spotCheck.js

@ -0,0 +1,111 @@
import { basicAction } from '@peace/utils'
import { ApiTable } from '$utils'
export function roadSpotList (query = {}) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_ROAD_STOP_LIST',
url: 'road/spot/list',
msg: { error: '获取抽查列表失败' },
reducer: { name: 'roadSpotList' }
});
}
export function roadSpotDetail (query = {}) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_ROAD_STOP_DETAIL',
url: 'road/spot/detail',
msg: { error: '获取抽查详情失败' },
reducer: { name: 'roadSpotDetail' }
});
}
export function roadSpotPrepare (data = {}) {
return dispatch => basicAction({
type: 'post',
dispatch: dispatch,
data: data,
actionType: 'POST_ROAD_STOP_PREPARE',
url: 'road/spot/prepare',
msg: { option: '抽取' },
reducer: { name: 'roadSpotPrepare' }
});
}
export function confirmRoadSpot (data = {}) {
return dispatch => basicAction({
type: 'post',
dispatch: dispatch,
data: data,
actionType: 'POST_ROAD_STOP_CONFIRM',
url: 'road/spot/confirm',
msg: { option: '确认抽取' },
reducer: { name: 'confirmRoadSpot' }
});
}
export function exportSpotRode (query = {}) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_ROAD_STOP_EXPORT',
url: 'road/spot/export',
msg: { option: '导出路线抽查' },
reducer: { name: '' }
});
}
export function roadSpotChangList (query = {}) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_ROAD_STOP_CHANG_LIST',
url: 'road/spot/change',
msg: { error: '获取抽查路线更改列表' },
reducer: { name: 'roadSpotChangList' }
});
}
export function roadSpotChange (data = {}) {
return dispatch => basicAction({
type: 'post',
dispatch: dispatch,
data: data,
actionType: 'POST_ROAD_STOP_CHANGE',
url: 'road/spot/change',
msg: { option: '更改抽查路线' },
reducer: { name: '' }
});
}
// export function delAssess (query) {
// return dispatch => basicAction({
// type: 'del',
// dispatch: dispatch,
// actionType: 'DEL_ASSESS',
// url: ApiTable.delAssess.replace("{assessId}", query?.id),
// msg: { option: '删除考核评分信息' },
// });
// }
// export function editAssess (query) {
// return dispatch => basicAction({
// type: 'put',
// dispatch: dispatch,
// data: query,
// actionType: 'PUT_ASSESS',
// url: ApiTable.editAssess,
// msg: { option: '编辑/新增考核评分信息' },
// });
// }

181
web/client/src/sections/fillion/components/adjustment.js

@ -0,0 +1,181 @@
import { connect } from 'react-redux';
import React, { useEffect, useState } from 'react';
import { Button, Modal, Form, Input, Divider, Spin, Select, DatePicker, Descriptions, Table } from 'antd'
import { roadSpotChange } from '../actions/spotCheck';
import { getRoadway } from "../actions/infor"
import moment from 'moment'
import '../components/maintenanceTable.less'
const Adjustment = (props) => {
const { dispatch, user, loading, reportDetail, editData, onCancel, road, onOk } = props
const [data, setData] = useState()//外层表格的数据
const [vis, setVis] = useState(false)//模态框的显示与隐藏变量
const [count, setCount] = useState(0)
const [page, setPage] = useState(1)
const [depName, setDepName] = useState('')
const [total, setTotal] = useState(0)
const [previewId, setPreviewId] = useState(0)
const [reportData, setReportData] = useState([])
const [detailList, setDetailList] = useState([])
const [detailVisible, setDetailVisible] = useState(false)
const [dateRange, setDateRange] = useState([]);
const { RangePicker } = DatePicker
const [nameList, setNameList] = useState([]);
const [codeList, setCodeList] = useState([]);
const [indexList, setIndexList] = useState([]);
const [roadFind, setRoadFind] = useState({});
useEffect(() => {
if (editData?.id) {
dispatch(getRoadway({ level: editData?.road?.level, alterId: editData?.alterId })).then(res => {
if (res.success) {
let name = []
let code = []
let index = []
res?.payload.data?.forEach(v => {
if (v.routeName && !name.includes(v.routeName)) {
name.push(v.routeName)
}
if (v.routeCode && !code.includes(v.routeCode)) {
code.push(v.routeCode)
}
if (v.sectionNo && !index.includes(v.sectionNo)) {
index.push(v.sectionNo)
}
});
setNameList(name)
setCodeList(code)
setIndexList(index)
}
})
}
}, [])
const [form] = Form.useForm()
return (
<Modal visible={true}
onCancel={() => {
onCancel()
}}
title='调整' onOk={() => {
form.validateFields().then((values) => {
let data = road?.find(d => values?.routeName == d?.routeName
&& values?.routeCode == d?.routeCode && values?.sectionNo == d?.sectionNo)
dispatch(roadSpotChange({
previewId: editData?.previewId,
originRoadId: editData?.id,
changeRoadId: data?.id
})).then(res => {
if (res.success) {
onCancel()
onOk()
}
});
})
}}>
<Form form={form} labelCol={{ span: 4 }} onValuesChange={(changedValues, allValues) => {
let name = []
let code = []
let index = []
let data = road?.filter(d => (allValues?.routeName ? allValues?.routeName == d?.routeName : true)
&& (allValues?.routeCode ? allValues?.routeCode == d?.routeCode : true) &&
(allValues?.sectionNo ? allValues?.sectionNo == d?.sectionNo : true))
data?.forEach(v => {
if (v.routeName && !name.includes(v.routeName)) {
name.push(v.routeName)
}
if (v.routeCode && !code.includes(v.routeCode)) {
code.push(v.routeCode)
}
if (v.sectionNo && !index.includes(v.sectionNo)) {
index.push(v.sectionNo)
}
});
setNameList(name)
setCodeList(code)
setIndexList(index)
if (allValues?.routeName && allValues?.routeCode && allValues?.sectionNo) {
form.setFieldsValue({
'startingPlaceName': data[0]?.startingPlaceName,
'stopPlaceName': data[0]?.stopPlaceName
})
} else {
form.setFieldsValue({
'startingPlaceName': null,
'stopPlaceName': null
})
}
}}>
<Form.Item label='道路类型' name='type' initialValue={editData?.road?.level ? (editData?.road?.level + "道") : ""} >
<Input disabled style={{ marginBottom: 10 }} />
</Form.Item>
<Form.Item
label="路线名称"
name="routeName"
rules={[{ required: true, message: '请选择路线名称' }]}
>
<Select style={{ marginBottom: 10 }} allowClear showSearch={true} placeholder="请选择路线名称" options={nameList?.map(v => ({ value: v, label: v })) || []} />
</Form.Item>
<Form.Item
label="路线代码"
name="routeCode"
rules={[{ required: true, message: '请选择路线代码' }]}
>
<Select style={{ marginBottom: 10 }} allowClear showSearch={true} placeholder="请选择路线代码" options={codeList?.map(v => ({ value: v, label: v })) || []} />
</Form.Item>
<Form.Item
label="路段序号"
name="sectionNo"
rules={[{ required: true, message: '请选择抽取比例' }]}
>
<Select style={{}} allowClear showSearch={true} placeholder="请选择抽取比例" options={indexList?.map(v => ({ value: v, label: v })) || []} />
</Form.Item>
<Form.Item label='起点地名' name='startingPlaceName'>
<Input disabled />
</Form.Item>
<Form.Item label='止点地名' name='stopPlaceName'>
<Input disabled />
</Form.Item>
</Form>
</Modal>
)
}
function mapStateToProps (state) {
const { auth, road } = state
//('state1', state)
return {
user: auth.user,
road: road?.data || [],
}
}
export default connect(mapStateToProps)(Adjustment);

190
web/client/src/sections/fillion/containers/adjustLog.js

@ -0,0 +1,190 @@
import { connect } from 'react-redux';
import React, { useEffect, useState } from 'react';
import { Button, Modal, Form, Input, Divider, Spin, Select, DatePicker, Descriptions, Table } from 'antd'
const { TextArea } = Input;
import { roadSpotChangList } from '../actions/spotCheck';
import moment from 'moment'
import '../components/maintenanceTable.less'
const AdjustLog = (props) => {
const { dispatch, user, loading, reportDetail, reportDetailLoading, detailLoading } = props
const [data, setData] = useState()//外层表格的数据
const [vis, setVis] = useState(false)//模态框的显示与隐藏变量
const [count, setCount] = useState(0)
const [page, setPage] = useState(1)
const [depName, setDepName] = useState('')
const [total, setTotal] = useState(0)
const [previewId, setPreviewId] = useState(0)
const [reportData, setReportData] = useState([])
const [detailList, setDetailList] = useState([])
const [detailVisible, setDetailVisible] = useState(false)
const [dateRange, setDateRange] = useState([]);
const { RangePicker } = DatePicker
const [expandedRowKeys, setExpandedRowKeys] = useState([]);
//console.log('reportData', reportData)
const [form] = Form.useForm()
//里层列名
const columns = [
{
title: '抽查日期',
key: 'date',
dataIndex: 'date',
render: (_, record) => record?.roadSpotCheckPreview?.date && moment(record?.roadSpotCheckPreview?.date).format('YYYY-MM-DD') || '--'
},
{
title: '调整内容',
key: 'content',
dataIndex: 'content',
},
{
title: '调整人员',
key: 'user',
dataIndex: 'user',
render: (_, record) => record?.user?.name || '--'
},
{
title: '调整时间',
key: 'time',
dataIndex: 'time',
render: (_, record) => record?.time && moment(record?.time).format('YYYY-MM-DD HH:mm:ss') || '--'
},
{
title: '操作',
key: 'operation',
dataIndex: 'operation',
render: (_, record) => <Button type="link" onClick={() => {
setVis(true)
form.setFieldsValue({
'date': record?.roadSpotCheckPreview?.date && moment(record?.roadSpotCheckPreview?.date).format('YYYY-MM-DD') || '--',
'content': record?.content,
'user': record?.user?.name || '--',
'time': record?.time && moment(record?.time).format('YYYY-MM-DD HH:mm:ss') || '--',
})
}}> 查看详情 </Button >
},
]
const queryData = (data = {}) => {
dispatch(roadSpotChangList(data)).then(res => {
if (res.success) {
setReportData(res?.payload.data)
}
})
}
useEffect(() => {
queryData()
}, [])
const cancelHandler = () => {
setVis(false)
form.resetFields()
}
return (
<div>
<div style={{ marginBottom: 16 }}>
抽查日期
<RangePicker value={dateRange[0] ? [moment(dateRange[0]), moment(dateRange[1])] : []} onChange={(date, dateString) => {
setDateRange(dateString)
}} style={{ marginRight: 20 }} />
<Button style={{ marginRight: 20 }} onClick={() => {
setPage(1)
setExpandedRowKeys([])
queryData({ startTime: dateRange[0], endTime: dateRange[1] })
}} > 查询 </Button>
<Button style={{ marginRight: 20 }} onClick={() => {
setDateRange([])
}} > 重置 </Button>
</div>
<Table
columns={columns}
dataSource={reportData}
loading={loading}
pagination={{
total: reportData?.length || 0,
pageSize: 10,
current: page || 1,
defaultPageSize: 10,
showSizeChanger: false,
onChange: (page, pageSize) => {
setPage(page)
}
}}
rowKey={(record) => { return record.id }}
/>
{vis && <Modal visible={vis} onCancel={cancelHandler} title='查看详情'
footer={<Button onClick={() => {
setVis(false)
form.resetFields()
}} > 重置 </Button>}
onOk={() => {
form.resetFields()
setVis(false)
}}>
<Form form={form}>
<Form.Item label='抽查日期' name='date'>
<Input disabled />
</Form.Item>
<Form.Item label='调整内容' name='content'>
<TextArea
disabled
placeholder=""
autoSize={{
minRows: 2,
maxRows: 6,
}}
/>
</Form.Item>
<Form.Item label='调整人员' name='user'>
<Input disabled />
</Form.Item>
<Form.Item label='调整时间' name='time'>
<Input disabled />
</Form.Item>
</Form>
</Modal>}
</div>
)
}
function mapStateToProps (state) {
const { auth, roadSpotList, reportDetail, roadSpotDetail } = state
//('state1', state)
return {
user: auth.user,
loading: roadSpotList?.isRequesting,
detailLoading: roadSpotDetail?.isRequesting,
reportDetailLoading: reportDetail.isRequesting,
reportDetail: reportDetail.data,
}
}
export default connect(mapStateToProps)(AdjustLog);

4
web/client/src/sections/fillion/containers/index.js

@ -18,9 +18,11 @@ import Assess from './assess'
import VideoCenter from './videoCenter'; import VideoCenter from './videoCenter';
import Building from './building' import Building from './building'
import MaintenanceSpotCheck from './maintenanceSpotCheck' import MaintenanceSpotCheck from './maintenanceSpotCheck'
import MaintenanceSpotCheckNew from './maintenanceSpotCheck-new'
import AdjustLog from './adjustLog'
export { export {
Infor, transportation, BridgeTable, HigHways, Infor, transportation, BridgeTable, HigHways,
OperaTional, Enforce, Public, Videois, PromoTional, OperaTional, Enforce, Public, Videois, PromoTional,
Maintenance, Patrol, File, Jiekouguanli, Maintenance, Patrol, File, Jiekouguanli,
Task, Building, Assess, VideoCenter, MaintenanceSpotCheck Task, Building, Assess, VideoCenter, MaintenanceSpotCheck, MaintenanceSpotCheckNew, AdjustLog
}; };

290
web/client/src/sections/fillion/containers/maintenanceSpotCheck-new.js

@ -0,0 +1,290 @@
import { connect } from 'react-redux';
import React, { useEffect, useState } from 'react';
import { Button, Modal, Form, Input, Divider, Spin, Select, DatePicker, Descriptions, Table } from 'antd'
import { roadSpotList, roadSpotDetail, roadSpotPrepare, confirmRoadSpot, exportSpotRode } from '../actions/spotCheck';
import moment from 'moment'
import Adjustment from '../components/adjustment'
import '../components/maintenanceTable.less'
const MaintenanceSpotCheck = (props) => {
const { dispatch, user, loading, reportDetail, reportDetailLoading, detailLoading } = props
const [data, setData] = useState()//外层表格的数据
const [vis, setVis] = useState(false)//模态框的显示与隐藏变量
const [count, setCount] = useState(0)
const [page, setPage] = useState(1)
const [depName, setDepName] = useState('')
const [total, setTotal] = useState(0)
const [previewId, setPreviewId] = useState(0)
const [reportData, setReportData] = useState([])
const [detailList, setDetailList] = useState([])
const [detailVisible, setDetailVisible] = useState(false)
const [dateRange, setDateRange] = useState([]);
const { RangePicker } = DatePicker
const [expandedRowKeys, setExpandedRowKeys] = useState([]);
const [isAdjustment, setIsAdjustment] = useState(false);
const [editData, setEditData] = useState({});
//里层列名
const columns = [
{
title: '抽查日期',
key: 'date',
dataIndex: 'date',
render: (_, record) => record?.date && moment(record?.date).format('YYYY-MM-DD') || '--'
},
{
title: '抽查县道比率(%)',
key: 'countyPercentage',
dataIndex: 'countyPercentage',
},
{
title: '抽查县道',
key: 'spotCountyRoadCount',
dataIndex: 'spotCountyRoadCount',
},
{
title: '抽查乡道',
key: 'spotTownRoadCount',
dataIndex: 'spotTownRoadCount',
},
{
title: '抽查村道',
key: 'spotVillageRoadCount',
dataIndex: 'spotVillageRoadCount',
},
{
title: '操作',
key: 'operation',
dataIndex: 'operation',
render: (_, record) =>
<a href={`/_api/road/spot/export?token=${user?.token}&previewId=${record.id}`}>导出</a>
},
]
const queryData = (data = {}) => {
dispatch(roadSpotList(data)).then(res => {
if (res.success) {
setReportData(res?.payload.data)
}
})
}
const detailData = (data = {}) => {
dispatch(roadSpotDetail(data)).then(res => {
if (res.success) {
setDetailList(res?.payload.data)
}
})
}
useEffect(() => {
queryData()
}, [])
const [form] = Form.useForm()
const extractHandler = () => {
form.validateFields(['percentValue']).then(async (values) => {
if (Number(values.percentValue) > 0) {
const res = await dispatch(roadSpotPrepare({ countyPercentage: values.percentValue }))
setPreviewId(res?.payload.data?.previewId)
form.setFieldsValue({
'spotCountyRoadCount': res?.payload.data?.spotCountyRoadCount,
'spotTownRoadCount': res?.payload.data?.spotTownRoadCount,
'spotVillageRoadCount': res?.payload.data?.spotVillageRoadCount,
})
}
})
}
const cancelHandler = () => {
setVis(false)
form.resetFields()
}
return (
<div>
<div style={{ display: "flex", alignItems: 'center', justifyContent: 'space-between', marginBottom: 16 }}>
<Button onClick={() => {
setVis(true)
}} type='primary' style={{ marginLeft: 10 }}> 新增 </Button>
<div>
<RangePicker value={dateRange[0] ? [moment(dateRange[0]), moment(dateRange[1])] : []} onChange={(date, dateString) => {
setDateRange(dateString)
}} style={{ marginRight: 20 }} />
<Button style={{ marginRight: 20 }} onClick={() => {
setPage(1)
setExpandedRowKeys([])
queryData({ startTime: dateRange[0], endTime: dateRange[1] })
}} > 查询 </Button>
<Button style={{ marginRight: 20 }} onClick={() => {
setDateRange([])
}} > 重置 </Button>
</div>
</div>
<Table
columns={columns}
dataSource={reportData}
loading={loading}
expandable={{
expandedRowKeys: expandedRowKeys, // 控制哪些行展开,这里需要通过 state 管理
// defaultExpandedRowKeys: ['0'],
onExpand: (expanded, record) => {
if (expanded) {
setExpandedRowKeys([record?.id])
detailData({ previewId: record?.id })
} else {
setExpandedRowKeys([])
}
},
expandedRowRender: (record) => (
< Table
pagination={{
pageSize: 10,
defaultPageSize: 10,
showSizeChanger: false,
}}
loading={detailLoading}
style={{ margin: 0 }}
dataSource={detailList}
columns={
[
{
title: '道路类型', key: 'level', dataIndex: 'level', render: (_, r) => r?.road?.level ? (r?.road?.level + '道') : '--'
},
{ title: '道路名称', key: 'routeName', dataIndex: 'routeName', render: (_, r) => r.road?.routeName || '--' },
{ title: '道路代码', key: 'routeCode', dataIndex: 'routeCode', render: (_, r) => r.road?.routeCode || '--' },
{ title: '路段序号', key: 'sectionNo', dataIndex: 'sectionNo', render: (_, r) => r.road?.sectionNo || '--' },
{ title: '起点地名', key: 'startingPlaceName', dataIndex: 'startingPlaceName', render: (_, r) => r.road?.startingPlaceName || '--' },
{ title: '止点地名', key: 'stopPlaceName', dataIndex: 'stopPlaceName', render: (_, r) => r.road?.stopPlaceName || '--' },
{ title: '里程', key: 'chainageMileage', dataIndex: 'chainageMileage', render: (_, r) => r.road?.chainageMileage || '--' },
{ title: '养护次数(次)', key: 'maintenanceCount', dataIndex: 'maintenanceCount' },
{
title: '操作',
key: 'action',
dataIndex: 'action',
render: (_, r) => <Button type="link" onClick={() => {
setEditData({
...r, alterId: r?.road?.level == '县' ? record?.countyRoadId
: r?.road?.level == '乡' ? record?.townshipRoadId
: r?.road?.level == '村' ? record?.villageId : [],
previewId: record?.id
})
setIsAdjustment(true)
}}> 调整 </Button >
},
]}
/>
),
}}
pagination={{
total: reportData?.length || 0,
pageSize: 10,
current: page || 1,
defaultPageSize: 10,
showSizeChanger: false,
onChange: (page, pageSize) => {
setPage(page)
}
}}
rowKey={(record) => { return record.id }}
// toolBarRender={false}
// search={false}
/>
{
vis && <Modal visible={vis} onCancel={cancelHandler} title='养护抽查' onOk={() => {
dispatch(confirmRoadSpot({ previewId })).then(res => {
if (res.success) {
setPage(1)
setExpandedRowKeys([])
queryData({ startTime: dateRange[0], endTime: dateRange[1] })
form.resetFields()
setVis(false)
}
});
}}>
<Form form={form}>
<Form.Item
label="抽取比例(%)"
name="percentValue"
rules={[
{ required: true, message: '请选择抽取比例' },
// {
// pattern: /^(100|\d{1,2})(\.\d{1,2})?$/,
// message: '请输入有效的比例',
// },
]}
>
<Select style={{}} placeholder="请选择抽取比例" options={[{ value: 25, label: '25%', }, { value: 50, label: '50%', }]} />
</Form.Item>
<Form.Item className="ant-row" style={{
textAlign: 'center',
}}>
<Button style={{}} type='primary' onClick={extractHandler}>开始抽取</Button>
</Form.Item>
<Form.Item label='抽查县道(条)' name='spotCountyRoadCount'>
<Input disabled />
</Form.Item>
<Form.Item label='抽查乡道(条)' name='spotTownRoadCount'>
<Input disabled />
</Form.Item>
<Form.Item label='抽查村道(条)' name='spotVillageRoadCount'>
<Input disabled />
</Form.Item>
</Form>
</Modal>
}
{
isAdjustment &&
<Adjustment
editData={editData}
onCancel={() => {
setEditData({})
setIsAdjustment(false)
}}
onOk={() => {
queryData({ startTime: dateRange[0], endTime: dateRange[1] })
}}
/>
}
</div >
)
}
function mapStateToProps (state) {
const { auth, roadSpotList, reportDetail, roadSpotDetail } = state
//('state1', state)
return {
user: auth.user,
loading: roadSpotList?.isRequesting,
detailLoading: roadSpotDetail?.isRequesting,
reportDetailLoading: reportDetail.isRequesting,
reportDetail: reportDetail.data,
}
}
export default connect(mapStateToProps)(MaintenanceSpotCheck);

14
web/client/src/sections/fillion/nav-item.js

@ -21,19 +21,17 @@ export function getNavItem (user, dispatch) {
i.resourceId === 'VIDEOCENTER' || i.resourceId === 'VIDEOCENTER' ||
i.resourceId === 'BUILDINGPROJECT' || i.resourceId === 'BUILDINGPROJECT' ||
i.resourceId === 'MAINTENANCESPOTCHECK' || i.resourceId === 'MAINTENANCESPOTCHECK' ||
i.resourceId === 'LUZHENG' i.resourceId === 'LUZHENG' ||
i.resourceId === 'ADJUSTLOG'
) )
return ( return (
user?.username == 'SuperAdmin' || isshow ? user?.username == 'SuperAdmin' || isshow ?
<SubMenu key="fillion" icon={<ReadOutlined />} title={'数据管理'}> <SubMenu key="fillion" icon={<ReadOutlined />} title={'数据管理'}>
{ {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'OVERLOADMANAGE') ?
user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'OVERLOADMANAGE') ?
<Menu.Item key="fillioninfor"> <Menu.Item key="fillioninfor">
<Link to="/fillion/infor">治超管理</Link> <Link to="/fillion/infor">治超管理</Link>
</Menu.Item> : '' </Menu.Item> : ''}
}
{/* <Menu.Item key="filliontask"> {/* <Menu.Item key="filliontask">
<Link to="/fillion/task">任务管理</Link> <Link to="/fillion/task">任务管理</Link>
</Menu.Item> */} </Menu.Item> */}
@ -113,6 +111,10 @@ export function getNavItem (user, dispatch) {
<Menu.Item key="maintenanceSpotCheck"> <Menu.Item key="maintenanceSpotCheck">
<Link to="/fillion/maintenanceSpotCheck">养护抽查</Link> <Link to="/fillion/maintenanceSpotCheck">养护抽查</Link>
</Menu.Item> : ''} </Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'ADJUSTLOG') ?
<Menu.Item key="adjustLog">
<Link to="/fillion/adjustLog">调整日志</Link>
</Menu.Item> : ''}
</SubMenu> : null </SubMenu> : null
); );
} }

13
web/client/src/sections/fillion/routes.js

@ -14,7 +14,7 @@ import { File } from './containers';
import { Jiekouguanli } from './containers' import { Jiekouguanli } from './containers'
import { Task, Assess, VideoCenter, } from './containers' import { Task, Assess, VideoCenter, } from './containers'
import { Building } from './containers' import { Building } from './containers'
import { MaintenanceSpotCheck } from './containers' import { MaintenanceSpotCheckNew, AdjustLog } from './containers'
import Luzheng from './containers/luzheng'; import Luzheng from './containers/luzheng';
export default [{ export default [{
type: 'inner', type: 'inner',
@ -187,10 +187,19 @@ export default [{
path: '/maintenanceSpotCheck', path: '/maintenanceSpotCheck',
key: 'maintenanceSpotCheck', key: 'maintenanceSpotCheck',
menuSelectKeys: ['maintenanceSpotCheck'], menuSelectKeys: ['maintenanceSpotCheck'],
component: MaintenanceSpotCheck, component: MaintenanceSpotCheckNew,
breadcrumb: '养护抽查', breadcrumb: '养护抽查',
authCode: 'MAINTENANCESPOTCHECK' authCode: 'MAINTENANCESPOTCHECK'
},
{
path: '/adjustLog',
key: 'adjustLog',
menuSelectKeys: ['adjustLog'],
component: AdjustLog,
breadcrumb: '调整日志',
authCode: 'ADJUSTLOG'
} }
] ]
} }

2
web/client/src/sections/organization/containers/authority.js

@ -14,7 +14,7 @@ const Authority = (props) => {
const r1 = ['USERMANAGE', 'AUTHORIMANAGE', 'OVERLOADMANAGE', 'ROADMANAGE', 'BRIDGEMANAGE', 'MAINTENANCEMANAGE', 'TRANSPORTATIONMANAGE', const r1 = ['USERMANAGE', 'AUTHORIMANAGE', 'OVERLOADMANAGE', 'ROADMANAGE', 'BRIDGEMANAGE', 'MAINTENANCEMANAGE', 'TRANSPORTATIONMANAGE',
'CONSERVATIONMANAGE', 'PATROLMANAGE', 'PUBLICTRANSPORTMANAGE', 'FILEMANAGE', 'PUBLICITYVIDEO', 'FEEDBACKMANAGE', 'REPORTMANAGE', 'CONSERVATIONMANAGE', 'PATROLMANAGE', 'PUBLICTRANSPORTMANAGE', 'FILEMANAGE', 'PUBLICITYVIDEO', 'FEEDBACKMANAGE', 'REPORTMANAGE',
'ASSESSMANAGE', 'VIDEOCENTER', 'BUILDINGPROJECT', 'WXPATROLREPORT', 'WXMAINTENANCEREPORT', 'WXFEEDBACKMANAGE', 'WXBUILDINGROAD', 'ASSESSMANAGE', 'VIDEOCENTER', 'BUILDINGPROJECT', 'WXPATROLREPORT', 'WXMAINTENANCEREPORT', 'WXFEEDBACKMANAGE', 'WXBUILDINGROAD',
'WXTODOANDONE', 'MAINTENANCESPOTCHECK' 'WXTODOANDONE', 'MAINTENANCESPOTCHECK', 'ADJUSTLOG'
] ]
const [depUserCopy, setDepUserCopy] = useState([])//用于存放除了自己的管理的数组,即自己不能调整自己是否为管理员 const [depUserCopy, setDepUserCopy] = useState([])//用于存放除了自己的管理的数组,即自己不能调整自己是否为管理员
const [depSelectedKeys, setDepSelectedKeys] = useState([]) const [depSelectedKeys, setDepSelectedKeys] = useState([])

Loading…
Cancel
Save