CODE 1 year ago
parent
commit
6199ec38d7
  1. 317
      api/app/lib/controllers/data/road.js
  2. 25
      api/app/lib/controllers/report/index.js
  3. 16
      web/client/src/sections/fillion/actions/index.js
  4. 100
      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. 10
      web/client/src/sections/fillion/containers/index.js
  9. 290
      web/client/src/sections/fillion/containers/maintenanceSpotCheck-new.js
  10. 200
      web/client/src/sections/fillion/nav-item.js
  11. 339
      web/client/src/sections/fillion/routes.js
  12. 492
      web/client/src/sections/organization/containers/authority.js

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

@ -2,176 +2,179 @@
const roadKeyMap = require('./road.json')
async function importIn (ctx) {
// 数据导入
try {
const models = ctx.fs.dc.models;
const { level, } = ctx.query;
const data = ctx.request.body;
const roadRes = await models.Road.findAll({
where: {
level
}
})
let preCreateArr = []
for (let d of data) {
if (roadRes.some(r => r.routeCode + r.sectionNo == d['路线代码'] + d['路段序号'])) {
//repeat
} else {
// await models.Road.create(d);
}
}
ctx.status = 204
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
// 数据导入
try {
const models = ctx.fs.dc.models;
const { level, } = ctx.query;
const data = ctx.request.body;
const roadRes = await models.Road.findAll({
where: {
level
}
})
let preCreateArr = []
for (let d of data) {
if (roadRes.some(r => r.routeCode + r.sectionNo == d['路线代码'] + d['路段序号'])) {
//repeat
} else {
// await models.Road.create(d);
}
}
ctx.status = 204
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
async function get (ctx) {
try {
const models = ctx.fs.dc.models;
const { codePrefix, level, road, sectionStart, sectionEnd } = ctx.query;
let findOption = {
where: {},
order: [['id', 'DESC']]
}
if (codePrefix) {
findOption.where.routeCode = { $like: `${codePrefix}%` }
}
if (level) {
findOption.where.level = level
}
if (road || sectionStart || sectionEnd) {
findOption.where['$or'] = {}
if (road) {
findOption.where['$or'].
routeName = { $like: `%${road}%` }
}
if (sectionStart) {
findOption.where['$or'].
startingPlaceName = { $like: `%${sectionStart}%` }
}
if (sectionEnd) {
findOption.where['$or'].
stopPlaceName = { $like: `%${sectionEnd}%` }
}
}
const roadRes = await models.Road.findAll(findOption)
ctx.status = 200;
ctx.body = roadRes
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
try {
const models = ctx.fs.dc.models;
const { codePrefix, level, road, sectionStart, sectionEnd, alterId } = ctx.query;
let findOption = {
where: {},
order: [['id', 'DESC']]
}
if (alterId) {
findOption.where.id = { $notIn: alterId }
}
if (codePrefix) {
findOption.where.routeCode = { $like: `${codePrefix}%` }
}
if (level) {
findOption.where.level = level
}
if (road || sectionStart || sectionEnd) {
findOption.where['$or'] = {}
if (road) {
findOption.where['$or'].
routeName = { $like: `%${road}%` }
}
if (sectionStart) {
findOption.where['$or'].
startingPlaceName = { $like: `%${sectionStart}%` }
}
if (sectionEnd) {
findOption.where['$or'].
stopPlaceName = { $like: `%${sectionEnd}%` }
}
}
const roadRes = await models.Road.findAll(findOption)
ctx.status = 200;
ctx.body = roadRes
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
async function getRoadSection (ctx) {
try {
const models = ctx.fs.dc.models;
const { level, road, sectionStart, sectionEnd } = ctx.query;
let findOption = {
where: {},
order: [['id', 'DESC']],
attributes: ['id', 'routeName', 'startingPlaceName', 'stopPlaceName', 'routeCode']
}
if (level) {
findOption.where.level = level
}
if (road || sectionStart || sectionEnd) {
findOption.where['$or'] = {}
if (road) {
findOption.where['$or'].
routeName = { $like: `%${road}%` }
}
if (sectionStart) {
findOption.where['$or'].
startingPlaceName = { $like: `%${sectionStart}%` }
}
if (sectionEnd) {
findOption.where['$or'].
stopPlaceName = { $like: `%${sectionEnd}%` }
}
}
const roadRes = await models.Road.findAll(findOption)
ctx.status = 200;
ctx.body = roadRes
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
try {
const models = ctx.fs.dc.models;
const { level, road, sectionStart, sectionEnd } = ctx.query;
let findOption = {
where: {},
order: [['id', 'DESC']],
attributes: ['id', 'routeName', 'startingPlaceName', 'stopPlaceName', 'routeCode']
}
if (level) {
findOption.where.level = level
}
if (road || sectionStart || sectionEnd) {
findOption.where['$or'] = {}
if (road) {
findOption.where['$or'].
routeName = { $like: `%${road}%` }
}
if (sectionStart) {
findOption.where['$or'].
startingPlaceName = { $like: `%${sectionStart}%` }
}
if (sectionEnd) {
findOption.where['$or'].
stopPlaceName = { $like: `%${sectionEnd}%` }
}
}
const roadRes = await models.Road.findAll(findOption)
ctx.status = 200;
ctx.body = roadRes
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
async function edit (ctx) {
try {
const models = ctx.fs.dc.models;
const data = ctx.request.body;
if (!data.roadId) {
await models.Road.create(data)
} else {
await models.Road.update(
data, {
where: {
id: data.roadId
}
})
}
ctx.status = 204
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
try {
const models = ctx.fs.dc.models;
const data = ctx.request.body;
if (!data.roadId) {
await models.Road.create(data)
} else {
await models.Road.update(
data, {
where: {
id: data.roadId
}
})
}
ctx.status = 204
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
async function del (ctx) {
try {
const models = ctx.fs.dc.models;
const { roadId } = ctx.params;
await models.Road.destroy({
where: {
id: roadId
}
})
ctx.status = 204
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
try {
const models = ctx.fs.dc.models;
const { roadId } = ctx.params;
await models.Road.destroy({
where: {
id: roadId
}
})
ctx.status = 204
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
module.exports = {
importIn,
getRoadSection,
get, edit, del,
importIn,
getRoadSection,
get, edit, del,
};

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

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

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

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

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

@ -2,7 +2,7 @@ import { basicAction } from '@peace/utils'
import { ApiTable } from '$utils'
import { Request } from '@peace/utils'
export function getDepMessage() {
export function getDepMessage () {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -24,7 +24,7 @@ export function getDepMessage() {
// });
// }
export function getOperaTional(query) {
export function getOperaTional (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -35,7 +35,7 @@ export function getOperaTional(query) {
});
}
export function putOperaTional(query) {
export function putOperaTional (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -46,7 +46,7 @@ export function putOperaTional(query) {
});
}
export function getSpecificVehicle(query) {
export function getSpecificVehicle (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -57,7 +57,7 @@ export function getSpecificVehicle(query) {
});
}
export function putSpecificVehicle(query) {
export function putSpecificVehicle (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -68,7 +68,7 @@ export function putSpecificVehicle(query) {
});
}
export function putHouseholds(query) {
export function putHouseholds (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -79,7 +79,7 @@ export function putHouseholds(query) {
});
}
export function getHouseholds(query) {
export function getHouseholds (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -90,7 +90,7 @@ export function getHouseholds(query) {
});
}
export function getRoadway(query) {
export function getRoadway (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -98,20 +98,20 @@ export function getRoadway(query) {
actionType: 'GET_ROADWAY',
url: ApiTable.getRoadway,
msg: { error: '获取道路信息失败' },
reducer: { name: 'road' }
});
}
export function putRoadway(query) {
export function putRoadway (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'PUT_ROADWAY',
url: ApiTable.putRoadway,
msg: { option: query?.roadId?'编辑':'新增' + '道路信息' },
msg: { option: query?.roadId ? '编辑' : '新增' + '道路信息' },
});
}
export function getBridge(query) {
export function getBridge (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -122,7 +122,7 @@ export function getBridge(query) {
});
}
export function putBridge(query) {
export function putBridge (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -133,7 +133,7 @@ export function putBridge(query) {
});
}
export function getProject(query) {
export function getProject (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -141,10 +141,10 @@ export function getProject(query) {
actionType: 'GET_PROJECT',
url: ApiTable.getProject,
msg: { error: '获取工程信息失败' },
reducer: { name: 'projectList' }
reducer: { name: 'projectList' }
});
}
export function putProject(query) {
export function putProject (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -155,7 +155,7 @@ export function putProject(query) {
});
}
export function getHighways(query) {
export function getHighways (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -166,7 +166,7 @@ export function getHighways(query) {
});
}
export function putHighways(query) {
export function putHighways (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -177,7 +177,7 @@ export function putHighways(query) {
});
}
export function getCircuit(query) {
export function getCircuit (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -188,7 +188,7 @@ export function getCircuit(query) {
});
}
export function putCircuit(query) {
export function putCircuit (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -199,7 +199,7 @@ export function putCircuit(query) {
});
}
export function getVehicle(query) {
export function getVehicle (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -210,7 +210,7 @@ export function getVehicle(query) {
});
}
export function putVehicle(query) {
export function putVehicle (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -221,7 +221,7 @@ export function putVehicle(query) {
});
}
export function delRoadway(query) {
export function delRoadway (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
@ -231,7 +231,7 @@ export function delRoadway(query) {
});
}
export function delProject(query) {
export function delProject (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
@ -241,7 +241,7 @@ export function delProject(query) {
});
}
export function delBridge(query) {
export function delBridge (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
@ -251,7 +251,7 @@ export function delBridge(query) {
});
}
export function delSpecificVehicle(query) {
export function delSpecificVehicle (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
@ -261,7 +261,7 @@ export function delSpecificVehicle(query) {
});
}
export function delHouseholds(query) {
export function delHouseholds (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
@ -271,7 +271,7 @@ export function delHouseholds(query) {
});
}
export function delCircuit(query) {
export function delCircuit (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
@ -281,7 +281,7 @@ export function delCircuit(query) {
});
}
export function delVehicle(query) {
export function delVehicle (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
@ -292,7 +292,7 @@ export function delVehicle(query) {
});
}
export function getPurchase(query) {
export function getPurchase (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -303,7 +303,7 @@ export function getPurchase(query) {
});
}
export function putPurchase(query) {
export function putPurchase (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -314,7 +314,7 @@ export function putPurchase(query) {
});
}
export function delPurchase(query) {
export function delPurchase (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
@ -325,7 +325,7 @@ export function delPurchase(query) {
});
}
export function getPropagata(query) {
export function getPropagata (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -336,7 +336,7 @@ export function getPropagata(query) {
// reducer: { name: 'reportstatistic' }
});
}
export function putAddPropagata(query) {
export function putAddPropagata (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -347,7 +347,7 @@ export function putAddPropagata(query) {
// reducer: { name: 'reportstatistic' }
});
}
export function putEditPropagata(query) {
export function putEditPropagata (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -358,7 +358,7 @@ export function putEditPropagata(query) {
// reducer: { name: 'reportstatistic' }
});
}
export function delPropagata(query) {
export function delPropagata (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
@ -369,7 +369,7 @@ export function delPropagata(query) {
});
}
export function getShippingList(query) {
export function getShippingList (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -380,7 +380,7 @@ export function getShippingList(query) {
});
}
export function putShippingList(query) {
export function putShippingList (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -391,7 +391,7 @@ export function putShippingList(query) {
});
}
//获取管养单位概况
export function getCustodyunit() {
export function getCustodyunit () {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -401,10 +401,10 @@ export function getCustodyunit() {
reducer: { name: 'roadMaintenances_management' }
});
}
export function getCustodyunitOne(query) {
export function getCustodyunitOne (query) {
return dispatch => basicAction({
type: 'get',
query:query,
query: query,
dispatch: dispatch,
actionType: 'GET_CUSTODY_UNIT_ONE',
url: ApiTable.getCustodyunit,
@ -412,7 +412,7 @@ export function getCustodyunitOne(query) {
// reducer: { name: 'roadMaintenances_management' }
});
}
export function postCustodyunit(query) {
export function postCustodyunit (query) {
return dispatch => basicAction({
type: 'post',
data: query,
@ -423,14 +423,14 @@ export function postCustodyunit(query) {
// reducer: { name: 'roadMaintenances' }
});
}
export function getxiuyangas(query) {
export function getxiuyangas (query) {
return dispatch => basicAction({
type: 'get',
query,
dispatch: dispatch,
actionType: 'GET_XIUYANG',
url: ApiTable.getXiuyang,
msg: { error: '获取信息失败' },
reducer: { name: 'xiuyang' }
type: 'get',
query,
dispatch: dispatch,
actionType: 'GET_XIUYANG',
url: ApiTable.getXiuyang,
msg: { error: '获取信息失败' },
reducer: { name: 'xiuyang' }
});
}

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);

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

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

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

@ -4,115 +4,117 @@ import { Menu } from 'antd';
import { ReadOutlined } from '@ant-design/icons';
const SubMenu = Menu.SubMenu;
export function getNavItem (user, dispatch) {
const isshow = user?.userResources?.
some(i => i.resourceId === 'OVERLOADMANAGE' ||
i.resourceId === 'ROADMANAGE' ||
i.resourceId === 'BRIDGEMANAGE' ||
i.resourceId === 'MAINTENANCEMANAGE' ||
i.resourceId === 'TRANSPORTATIONMANAGE' ||
i.resourceId === 'CONSERVATIONMANAGE' ||
i.resourceId === 'PUBLICTRANSPORTMANAGE' ||
i.resourceId === 'FILEMANAGE' ||
i.resourceId === 'PUBLICITYVIDEO' ||
i.resourceId === 'FEEDBACKMANAGE' ||
i.resourceId === 'REPORTMANAGE' ||
i.resourceId === 'PATROLMANAGE' ||
i.resourceId === 'ASSESSMANAGE' ||
i.resourceId === 'VIDEOCENTER' ||
i.resourceId === 'BUILDINGPROJECT' ||
i.resourceId === 'MAINTENANCESPOTCHECK' ||
i.resourceId === 'LUZHENG'
)
const isshow = user?.userResources?.
some(i => i.resourceId === 'OVERLOADMANAGE' ||
i.resourceId === 'ROADMANAGE' ||
i.resourceId === 'BRIDGEMANAGE' ||
i.resourceId === 'MAINTENANCEMANAGE' ||
i.resourceId === 'TRANSPORTATIONMANAGE' ||
i.resourceId === 'CONSERVATIONMANAGE' ||
i.resourceId === 'PUBLICTRANSPORTMANAGE' ||
i.resourceId === 'FILEMANAGE' ||
i.resourceId === 'PUBLICITYVIDEO' ||
i.resourceId === 'FEEDBACKMANAGE' ||
i.resourceId === 'REPORTMANAGE' ||
i.resourceId === 'PATROLMANAGE' ||
i.resourceId === 'ASSESSMANAGE' ||
i.resourceId === 'VIDEOCENTER' ||
i.resourceId === 'BUILDINGPROJECT' ||
i.resourceId === 'MAINTENANCESPOTCHECK' ||
i.resourceId === 'LUZHENG' ||
i.resourceId === 'ADJUSTLOG'
)
return (
user?.username == 'SuperAdmin' || isshow ?
<SubMenu key="fillion" icon={<ReadOutlined />} title={'数据管理'}>
{
user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'OVERLOADMANAGE') ?
<Menu.Item key="fillioninfor">
<Link to="/fillion/infor">治超管理</Link>
</Menu.Item> : ''
}
{/* <Menu.Item key="filliontask">
return (
user?.username == 'SuperAdmin' || isshow ?
<SubMenu key="fillion" icon={<ReadOutlined />} title={'数据管理'}>
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'OVERLOADMANAGE') ?
<Menu.Item key="fillioninfor">
<Link to="/fillion/infor">治超管理</Link>
</Menu.Item> : ''}
{/* <Menu.Item key="filliontask">
<Link to="/fillion/task">任务管理</Link>
</Menu.Item> */}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'LUZHENG') ?
<Menu.Item key="luzheng">
<Link to="/fillion/luzheng">路政管理</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'ROADMANAGE') ?
<Menu.Item key="filliontransportation">
<Link to="/fillion/transportation">道路管理</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'BRIDGEMANAGE') ?
<Menu.Item key="fillionbridge">
<Link to="/fillion/bridge">桥梁管理</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'MAINTENANCEMANAGE') ?
<Menu.Item key="fillionhighways">
<Link to="/fillion/highways">管养管理</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'TRANSPORTATIONMANAGE') ?
<Menu.Item key="fillionoperational">
<Link to="/fillion/operational">运政管理</Link>
</Menu.Item> : ''}
{/* <Menu.Item key="fillionenforce">
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'LUZHENG') ?
<Menu.Item key="luzheng">
<Link to="/fillion/luzheng">路政管理</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'ROADMANAGE') ?
<Menu.Item key="filliontransportation">
<Link to="/fillion/transportation">道路管理</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'BRIDGEMANAGE') ?
<Menu.Item key="fillionbridge">
<Link to="/fillion/bridge">桥梁管理</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'MAINTENANCEMANAGE') ?
<Menu.Item key="fillionhighways">
<Link to="/fillion/highways">管养管理</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'TRANSPORTATIONMANAGE') ?
<Menu.Item key="fillionoperational">
<Link to="/fillion/operational">运政管理</Link>
</Menu.Item> : ''}
{/* <Menu.Item key="fillionenforce">
<Link to="/fillion/enforce">执法管理</Link>
</Menu.Item> */}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'CONSERVATIONMANAGE') ?
<Menu.Item key="fillionmaintenance">
<Link to="/fillion/maintenance">养护管理</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'PATROLMANAGE') ?
<Menu.Item key="fillionpatrol">
<Link to="/fillion/patrol">巡查管理</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'FEEDBACKMANAGE') ?
<Menu.Item key="fillionpatrolanomaly">
<Link to="/fillion/patrol_anomaly">异常反馈</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'REPORTMANAGE') ?
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'CONSERVATIONMANAGE') ?
<Menu.Item key="fillionmaintenance">
<Link to="/fillion/maintenance">养护管理</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'PATROLMANAGE') ?
<Menu.Item key="fillionpatrol">
<Link to="/fillion/patrol">巡查管理</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'FEEDBACKMANAGE') ?
<Menu.Item key="fillionpatrolanomaly">
<Link to="/fillion/patrol_anomaly">异常反馈</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'REPORTMANAGE') ?
<Menu.Item key="fillionpatrolroad">
<Link to="/fillion/patrol_road">建设上报</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'BUILDINGPROJECT') ?
<Menu.Item key="fillionbuilding">
<Link to="/fillion/processsing">在建项目</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'PUBLICTRANSPORTMANAGE') ?
<Menu.Item key="fillionpublic">
<Link to="/fillion/public">公交管理</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'FILEMANAGE') ?
<Menu.Item key="fileCont">
<Link to="/fillion/file">档案管理</Link>
</Menu.Item> : ''}
{/* <Menu.Item key="fillionvideois">
<Menu.Item key="fillionpatrolroad">
<Link to="/fillion/patrol_road">建设上报</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'BUILDINGPROJECT') ?
<Menu.Item key="fillionbuilding">
<Link to="/fillion/processsing">在建项目</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'PUBLICTRANSPORTMANAGE') ?
<Menu.Item key="fillionpublic">
<Link to="/fillion/public">公交管理</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'FILEMANAGE') ?
<Menu.Item key="fileCont">
<Link to="/fillion/file">档案管理</Link>
</Menu.Item> : ''}
{/* <Menu.Item key="fillionvideois">
<Link to="/fillion/videois">视频管理</Link>
</Menu.Item> */}
{/* <Menu.Item key="jiekouguanli">
{/* <Menu.Item key="jiekouguanli">
<Link to="/fillion/jiekouguanli">接口管理</Link>
</Menu.Item> */}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'PUBLICITYVIDEO') ?
<Menu.Item key="fillionpromotional">
<Link to="/fillion/promotional">宣传视频</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'PUBLICITYVIDEO') ?
<Menu.Item key="fillionpromotional">
<Link to="/fillion/promotional">宣传视频</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'ASSESSMANAGE') ?
<Menu.Item key="fillionassess">
<Link to="/fillion/assess">考核评分</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'VIDEOCENTER') ?
<Menu.Item key="fillionvideoCenter">
<Link to="/fillion/videoCenter">视频中心</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'MAINTENANCESPOTCHECK') ?
<Menu.Item key="maintenanceSpotCheck">
<Link to="/fillion/maintenanceSpotCheck">养护抽查</Link>
</Menu.Item> : ''}
</SubMenu> : null
);
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'ASSESSMANAGE') ?
<Menu.Item key="fillionassess">
<Link to="/fillion/assess">考核评分</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'VIDEOCENTER') ?
<Menu.Item key="fillionvideoCenter">
<Link to="/fillion/videoCenter">视频中心</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'MAINTENANCESPOTCHECK') ?
<Menu.Item key="maintenanceSpotCheck">
<Link to="/fillion/maintenanceSpotCheck">养护抽查</Link>
</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
);
}

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

@ -14,184 +14,193 @@ import { File } from './containers';
import { Jiekouguanli } from './containers'
import { Task, Assess, VideoCenter, } from './containers'
import { Building } from './containers'
import { MaintenanceSpotCheck } from './containers'
import { MaintenanceSpotCheckNew, AdjustLog } from './containers'
import Luzheng from './containers/luzheng';
export default [{
type: 'inner',
route: {
path: '/fillion',
key: 'fillion',
breadcrumb: '数据管理',
menuSelectKeys: ['fillion'],
menuOpenKeys: ['fillion'],
childRoutes: [{
path: '/infor',
key: 'fillioninfor',
menuSelectKeys: ['fillioninfor'],
component: Infor,
breadcrumb: '治超管理',
authCode: 'OVERLOADMANAGE'
},
{
path: '/luzheng',
key: 'luzheng',
menuSelectKeys: ['luzheng'],
component: Luzheng,
breadcrumb: '路政管理',
authCode: 'OVERLOADMANAGE'
},
{
path: '/task',
key: 'filliontask',
menuSelectKeys: ['filliontask'],
component: Task,
breadcrumb: '任务管理',
//authCode: 'OVERLOADMANAGE'
}, {
path: '/transportation',
key: 'filliontransportation',
menuSelectKeys: ['filliontransportation'],
component: transportation,
breadcrumb: '道路管理',
authCode: 'ROADMANAGE'
type: 'inner',
route: {
path: '/fillion',
key: 'fillion',
breadcrumb: '数据管理',
menuSelectKeys: ['fillion'],
menuOpenKeys: ['fillion'],
childRoutes: [{
path: '/infor',
key: 'fillioninfor',
menuSelectKeys: ['fillioninfor'],
component: Infor,
breadcrumb: '治超管理',
authCode: 'OVERLOADMANAGE'
},
{
path: '/luzheng',
key: 'luzheng',
menuSelectKeys: ['luzheng'],
component: Luzheng,
breadcrumb: '路政管理',
authCode: 'OVERLOADMANAGE'
},
{
path: '/task',
key: 'filliontask',
menuSelectKeys: ['filliontask'],
component: Task,
breadcrumb: '任务管理',
//authCode: 'OVERLOADMANAGE'
}, {
path: '/transportation',
key: 'filliontransportation',
menuSelectKeys: ['filliontransportation'],
component: transportation,
breadcrumb: '道路管理',
authCode: 'ROADMANAGE'
},
{
path: '/processsing',
key: 'fillionprocesssing',
menuSelectKeys: ['fillionprocesssing'],
component: Building,
breadcrumb: '在建项目',
authCode: 'BUILDINGPROJECT'
},
{
path: '/processsing',
key: 'fillionprocesssing',
menuSelectKeys: ['fillionprocesssing'],
component: Building,
breadcrumb: '在建项目',
authCode: 'BUILDINGPROJECT'
}
, {
path: '/bridge',
key: 'fillionbridge',
menuSelectKeys: ['fillionbridge'],
component: BridgeTable,
breadcrumb: '桥梁管理',
authCode: 'BRIDGEMANAGE'
}
, {
path: '/bridge',
key: 'fillionbridge',
menuSelectKeys: ['fillionbridge'],
component: BridgeTable,
breadcrumb: '桥梁管理',
authCode: 'BRIDGEMANAGE'
}
, {
path: '/highways',
key: 'fillionhighways',
menuSelectKeys: ['fillionhighways'],
component: HigHways,
breadcrumb: '管养管理',
authCode: 'MAINTENANCEMANAGE'
}
, {
path: '/highways',
key: 'fillionhighways',
menuSelectKeys: ['fillionhighways'],
component: HigHways,
breadcrumb: '管养管理',
authCode: 'MAINTENANCEMANAGE'
}, {
path: '/operational',
key: 'fillionoperational',
menuSelectKeys: ['fillionoperational'],
component: OperaTional,
breadcrumb: '运政管理',
authCode: 'TRANSPORTATIONMANAGE'
}, {
path: '/operational',
key: 'fillionoperational',
menuSelectKeys: ['fillionoperational'],
component: OperaTional,
breadcrumb: '运政管理',
authCode: 'TRANSPORTATIONMANAGE'
}, {
path: '/enforce',
key: 'fillionenforce',
menuSelectKeys: ['fillionenforce'],
component: Enforce,
breadcrumb: '执法管理',
}, {
path: '/maintenance',
key: 'fillionmaintenance',
menuSelectKeys: ['fillionmaintenance'],
component: Maintenance,
breadcrumb: '养护管理',
authCode: 'CONSERVATIONMANAGE'
}, {
path: '/patrol',
key: 'fillionpatrol',
menuSelectKeys: ['fillionpatrol'],
component: Patrol,
breadcrumb: '巡查管理',
authCode: 'PATROLMANAGE'
}, {
path: '/enforce',
key: 'fillionenforce',
menuSelectKeys: ['fillionenforce'],
component: Enforce,
breadcrumb: '执法管理',
}, {
path: '/maintenance',
key: 'fillionmaintenance',
menuSelectKeys: ['fillionmaintenance'],
component: Maintenance,
breadcrumb: '养护管理',
authCode: 'CONSERVATIONMANAGE'
}, {
path: '/patrol',
key: 'fillionpatrol',
menuSelectKeys: ['fillionpatrol'],
component: Patrol,
breadcrumb: '巡查管理',
authCode: 'PATROLMANAGE'
}, {
path: '/patrol_anomaly',
key: 'fillionpatrolanomaly',
menuSelectKeys: ['fillionpatrolanomaly'],
component: Patrol,
breadcrumb: '异常反馈',
authCode: 'FEEDBACKMANAGE'
}, {
path: '/patrol_anomaly',
key: 'fillionpatrolanomaly',
menuSelectKeys: ['fillionpatrolanomaly'],
component: Patrol,
breadcrumb: '异常反馈',
authCode: 'FEEDBACKMANAGE'
}, {
path: '/patrol_road',
key: 'fillionpatrolroad',
menuSelectKeys: ['fillionpatrolroad'],
component: Patrol,
breadcrumb: '建设上报',
authCode: 'REPORTMANAGE'
}, {
path: '/patrol_road',
key: 'fillionpatrolroad',
menuSelectKeys: ['fillionpatrolroad'],
component: Patrol,
breadcrumb: '建设上报',
authCode: 'REPORTMANAGE'
}, {
path: '/public',
key: 'fillionpublic',
menuSelectKeys: ['fillionpublic'],
component: Public,
breadcrumb: '公交管理',
authCode: 'PUBLICTRANSPORTMANAGE'
}, {
path: '/public',
key: 'fillionpublic',
menuSelectKeys: ['fillionpublic'],
component: Public,
breadcrumb: '公交管理',
authCode: 'PUBLICTRANSPORTMANAGE'
},
{
path: '/file',
key: 'fileCont',
menuSelectKeys: ['fileCont'],
component: File,
breadcrumb: '档案管理',
authCode: 'FILEMANAGE'
},
{
path: '/file',
key: 'fileCont',
menuSelectKeys: ['fileCont'],
component: File,
breadcrumb: '档案管理',
authCode: 'FILEMANAGE'
},
{
path: '/videois',
key: 'fillionvideois',
menuSelectKeys: ['fillionvideois'],
component: Videois,
breadcrumb: '视频管理',
authCode: 'PUBLICITYVIDEO'
},
{
path: '/videois',
key: 'fillionvideois',
menuSelectKeys: ['fillionvideois'],
component: Videois,
breadcrumb: '视频管理',
authCode: 'PUBLICITYVIDEO'
},
{
path: '/jiekouguanli',
key: 'jiekouguanli',
menuSelectKeys: ['jiekouguanli'],
component: Jiekouguanli,
breadcrumb: '接口管理',
}, {
path: '/promotional',
key: 'fillionpromotional',
menuSelectKeys: ['fillionpromotional'],
component: PromoTional,
breadcrumb: '视频管理',
authCode: 'PUBLICITYVIDEO'
}, {
path: '/assess',
key: 'fillionassess',
menuSelectKeys: ['fillionassess'],
component: Assess,
breadcrumb: '考核评分',
authCode: 'ASSESSMANAGE'
}, {
path: '/videoCenter',
key: 'fillionvideoCenter',
menuSelectKeys: ['fillionvideoCenter'],
component: VideoCenter,
breadcrumb: '视频中心',
authCode: 'VIDEOCENTER'
},
{
path: '/jiekouguanli',
key: 'jiekouguanli',
menuSelectKeys: ['jiekouguanli'],
component: Jiekouguanli,
breadcrumb: '接口管理',
}, {
path: '/promotional',
key: 'fillionpromotional',
menuSelectKeys: ['fillionpromotional'],
component: PromoTional,
breadcrumb: '视频管理',
authCode: 'PUBLICITYVIDEO'
}, {
path: '/assess',
key: 'fillionassess',
menuSelectKeys: ['fillionassess'],
component: Assess,
breadcrumb: '考核评分',
authCode: 'ASSESSMANAGE'
}, {
path: '/videoCenter',
key: 'fillionvideoCenter',
menuSelectKeys: ['fillionvideoCenter'],
component: VideoCenter,
breadcrumb: '视频中心',
authCode: 'VIDEOCENTER'
},
{
path: '/maintenanceSpotCheck',
key: 'maintenanceSpotCheck',
menuSelectKeys: ['maintenanceSpotCheck'],
component: MaintenanceSpotCheck,
breadcrumb: '养护抽查',
authCode: 'MAINTENANCESPOTCHECK'
},
{
path: '/maintenanceSpotCheck',
key: 'maintenanceSpotCheck',
menuSelectKeys: ['maintenanceSpotCheck'],
component: MaintenanceSpotCheckNew,
breadcrumb: '养护抽查',
authCode: 'MAINTENANCESPOTCHECK'
}
]
}
},
{
path: '/adjustLog',
key: 'adjustLog',
menuSelectKeys: ['adjustLog'],
component: AdjustLog,
breadcrumb: '调整日志',
authCode: 'ADJUSTLOG'
}
]
}
}];

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

@ -9,282 +9,282 @@ import Resource from '../components/resource';
import user from './user';
const Authority = (props) => {
const CheckboxGroup = Checkbox.Group;
const { dispatch, loading, depMessage, depUser, resource, userResource, clientHeight, user } = props
const r1 = ['USERMANAGE', 'AUTHORIMANAGE', 'OVERLOADMANAGE', 'ROADMANAGE', 'BRIDGEMANAGE', 'MAINTENANCEMANAGE', 'TRANSPORTATIONMANAGE',
'CONSERVATIONMANAGE', 'PATROLMANAGE', 'PUBLICTRANSPORTMANAGE', 'FILEMANAGE', 'PUBLICITYVIDEO', 'FEEDBACKMANAGE', 'REPORTMANAGE',
'ASSESSMANAGE', 'VIDEOCENTER', 'BUILDINGPROJECT', 'WXPATROLREPORT', 'WXMAINTENANCEREPORT', 'WXFEEDBACKMANAGE', 'WXBUILDINGROAD',
'WXTODOANDONE', 'MAINTENANCESPOTCHECK'
]
const [depUserCopy, setDepUserCopy] = useState([])//用于存放除了自己的管理的数组,即自己不能调整自己是否为管理员
const [depSelectedKeys, setDepSelectedKeys] = useState([])
const [userSelectedKeys, setUserSelectedKeys] = useState([])
const [depSelected, setDepSelected] = useState()
const [userSelected, setUserSelected] = useState()
const [resCode, setResCode] = useState(userResource.map(i => i.resourceId))
const [useName, setUseName] = useState()// 选中名字
const [userType, setUserType] = useState()
const [depMessagedata, setdepMessagedata] = useState(depMessage)
const CheckboxGroup = Checkbox.Group;
const { dispatch, loading, depMessage, depUser, resource, userResource, clientHeight, user } = props
const r1 = ['USERMANAGE', 'AUTHORIMANAGE', 'OVERLOADMANAGE', 'ROADMANAGE', 'BRIDGEMANAGE', 'MAINTENANCEMANAGE', 'TRANSPORTATIONMANAGE',
'CONSERVATIONMANAGE', 'PATROLMANAGE', 'PUBLICTRANSPORTMANAGE', 'FILEMANAGE', 'PUBLICITYVIDEO', 'FEEDBACKMANAGE', 'REPORTMANAGE',
'ASSESSMANAGE', 'VIDEOCENTER', 'BUILDINGPROJECT', 'WXPATROLREPORT', 'WXMAINTENANCEREPORT', 'WXFEEDBACKMANAGE', 'WXBUILDINGROAD',
'WXTODOANDONE', 'MAINTENANCESPOTCHECK', 'ADJUSTLOG'
]
const [depUserCopy, setDepUserCopy] = useState([])//用于存放除了自己的管理的数组,即自己不能调整自己是否为管理员
const [depSelectedKeys, setDepSelectedKeys] = useState([])
const [userSelectedKeys, setUserSelectedKeys] = useState([])
const [depSelected, setDepSelected] = useState()
const [userSelected, setUserSelected] = useState()
const [resCode, setResCode] = useState(userResource.map(i => i.resourceId))
const [useName, setUseName] = useState()// 选中名字
const [userType, setUserType] = useState()
const [depMessagedata, setdepMessagedata] = useState(depMessage)
const rescodeall = resource[0]?.resources?.map(i => ({ label: i.name, value: i.code }))
//console.log(resource[0]?.resources?.map(i => ({ label: i.name, value: i.code })), '这个是总的骂')
const [indeterminate, setIndeterminate] = useState(false);
const [checkAll, setCheckAll] = useState(true);
const [rescheckAll, setrescheckAll] = useState(false)
const [isshow, setisshow] = useState(false);
const rescodeall = resource[0]?.resources?.map(i => ({ label: i.name, value: i.code }))
//console.log(resource[0]?.resources?.map(i => ({ label: i.name, value: i.code })), '这个是总的骂')
const [indeterminate, setIndeterminate] = useState(false);
const [checkAll, setCheckAll] = useState(true);
const [rescheckAll, setrescheckAll] = useState(false)
const [isshow, setisshow] = useState(false);
let plainOptions = depUser.map(i => ({ label: i.name, value: i.id }));
const [checkedList, setCheckedList] = useState(depUser.map(i => i.id));
const onChange = (list) => {
// console.log(list,'选择的')
setCheckedList(list);
setIndeterminate(!!list.length && list.length < plainOptions.length);
// setResCode(userResource.map(i=>i.resourceId))
setCheckAll(list.length === plainOptions.length);
dispatch(getUserResource(list))
// if(list.length === plainOptions.length){
// setUseName('全部用户')
// }
};
let plainOptions = depUser.map(i => ({ label: i.name, value: i.id }));
const [checkedList, setCheckedList] = useState(depUser.map(i => i.id));
const onChange = (list) => {
// console.log(list,'选择的')
setCheckedList(list);
setIndeterminate(!!list.length && list.length < plainOptions.length);
// setResCode(userResource.map(i=>i.resourceId))
setCheckAll(list.length === plainOptions.length);
dispatch(getUserResource(list))
// if(list.length === plainOptions.length){
// setUseName('全部用户')
// }
};
// console.log(userSelectedKeys,'当前1')
const onresChange = (d) => {
setResCode(d)
setrescheckAll(d.length === r1.length)
}
const onresCheckAllChange = (d) => {
setrescheckAll(d.target.checked)
setResCode(d.target.checked ? r1 : [])
// console.log(userSelectedKeys,'当前1')
const onresChange = (d) => {
setResCode(d)
setrescheckAll(d.length === r1.length)
}
const onresCheckAllChange = (d) => {
setrescheckAll(d.target.checked)
setResCode(d.target.checked ? r1 : [])
}
const onCheckAllChange = (e) => {
setCheckedList(e.target.checked ? plainOptions.map(i => i.value) : []);
setIndeterminate(false);
// if(e.target.checked){
// setUseName('全部用户')
// }
}
const onCheckAllChange = (e) => {
setCheckedList(e.target.checked ? plainOptions.map(i => i.value) : []);
setIndeterminate(false);
// if(e.target.checked){
// setUseName('全部用户')
// }
setCheckAll(e.target.checked);
// setResCode(userResource.map(i=>i.resourceId))
};
const onshowchange = (e) => {
setisshow(e.target.checked)
}
//console.log('depMessagedata', depMessagedata)
setCheckAll(e.target.checked);
// setResCode(userResource.map(i=>i.resourceId))
};
const onshowchange = (e) => {
setisshow(e.target.checked)
}
//console.log('depMessagedata', depMessagedata)
useEffect(() => {
dispatch(getResource())
if (!(depMessage && depMessage.length)) {
dispatch(getDepMessage())
}
setResCode(userResource.map(i => i.resourceId))
setisshow(userResource.some(i => i.isshow === "true"))
setrescheckAll(userResource.map(i => i.resourceId).length === 14)
}, [])
useEffect(() => {
setResCode(userResource.map(i => i.resourceId))
setisshow(userResource.some(i => i.isshow === "true"))
setrescheckAll(userResource.map(i => i.resourceId).length === 14)
}, [userResource])
useEffect(async () => {
if (depMessage.length) {
//('depMessage', depMessage)
//超级管理员展示所有部门
if (user?.username === 'SuperAdmin') {
setdepMessagedata(depMessage)
dispatch(getDepUser(depMessage[0]?.id))
setDepSelectedKeys([depMessage[0]?.id])
setDepSelected([depMessage[0]?.name])
} else {
//不是超级管理员,展示相应部门的数据
dispatch(getDepUser(user.departmentId))
const res = await dispatch(getDepById({ deptId: parseInt(user.departmentId) }))
//console.log('resssss', res)
setdepMessagedata(res.payload.data)
// if (authDep.length > 0) {
// dispatch(getDepUser(authDep[0]?.id))
// setDepSelectedKeys([authDep[0]?.id])
// setDepSelected([authDep[0]?.name])
// }
}
useEffect(() => {
dispatch(getResource())
if (!(depMessage && depMessage.length)) {
dispatch(getDepMessage())
}
setResCode(userResource.map(i => i.resourceId))
setisshow(userResource.some(i => i.isshow === "true"))
setrescheckAll(userResource.map(i => i.resourceId).length === 14)
}, [])
useEffect(() => {
setResCode(userResource.map(i => i.resourceId))
setisshow(userResource.some(i => i.isshow === "true"))
setrescheckAll(userResource.map(i => i.resourceId).length === 14)
}, [userResource])
useEffect(async () => {
if (depMessage.length) {
//('depMessage', depMessage)
//超级管理员展示所有部门
if (user?.username === 'SuperAdmin') {
setdepMessagedata(depMessage)
dispatch(getDepUser(depMessage[0]?.id))
setDepSelectedKeys([depMessage[0]?.id])
setDepSelected([depMessage[0]?.name])
} else {
//不是超级管理员,展示相应部门的数据
dispatch(getDepUser(user.departmentId))
const res = await dispatch(getDepById({ deptId: parseInt(user.departmentId) }))
//console.log('resssss', res)
setdepMessagedata(res.payload.data)
// if (authDep.length > 0) {
// dispatch(getDepUser(authDep[0]?.id))
// setDepSelectedKeys([authDep[0]?.id])
// setDepSelected([authDep[0]?.name])
// }
}
}
}
}, [depMessage])
// useEffect(() => {
// if(user.username!=='SuperAdmin'){
// dispatch(getDepMessage(user.departmentId))
// }
// }, [depMessage])
useEffect(() => {
const copy = [...new Set(depUser)]
setDepUserCopy(copy)
if (copy.length) {
setUserSelectedKeys([copy[0].id])
setUserSelected(copy[0].username)
dispatch(getUserResource(copy[0].id))
setUseName(copy[0].name)
}
setCheckedList(copy.map(i => i.id))
}, [depUser])
// console.log(depUser,'用户信息')
const handleSave = () => {
// console.log( userSelectedKeys[0],'当前选中的id')
// checkedList.map(i=>{
// dispatch(postUserRes({ userId: i, resCode: resCode,isShow:isshow })).then(res => {
// if (res.success) {
// dispatch(getUserResource(i))
// }
// })
// dispatch(postUserReso({ userId: i, resCode: resCode,isShow:isshow }))
// })
}, [depMessage])
// useEffect(() => {
// if(user.username!=='SuperAdmin'){
// dispatch(getDepMessage(user.departmentId))
// }
// }, [depMessage])
useEffect(() => {
const copy = [...new Set(depUser)]
setDepUserCopy(copy)
if (copy.length) {
setUserSelectedKeys([copy[0].id])
setUserSelected(copy[0].username)
dispatch(getUserResource(copy[0].id))
setUseName(copy[0].name)
}
setCheckedList(copy.map(i => i.id))
}, [depUser])
// console.log(depUser,'用户信息')
const handleSave = () => {
// console.log( userSelectedKeys[0],'当前选中的id')
// checkedList.map(i=>{
// dispatch(postUserRes({ userId: i, resCode: resCode,isShow:isshow })).then(res => {
// if (res.success) {
// dispatch(getUserResource(i))
// }
// })
// dispatch(postUserReso({ userId: i, resCode: resCode,isShow:isshow }))
// })
dispatch(postUserRes({ userId: userSelectedKeys[0], resCode: resCode, isShow: isshow })).then(res => {
if (res.success) {
dispatch(getUserResource(userSelectedKeys[0]))
}
})
dispatch(postUserReso({ userId: userSelectedKeys[0], resCode: resCode, isShow: isshow }))
}
dispatch(postUserRes({ userId: userSelectedKeys[0], resCode: resCode, isShow: isshow })).then(res => {
if (res.success) {
dispatch(getUserResource(userSelectedKeys[0]))
}
})
dispatch(postUserReso({ userId: userSelectedKeys[0], resCode: resCode, isShow: isshow }))
}
return (
<Spin spinning={loading}>
<Row gutter={16}>
<Col span={4} style={{ height: '100%' }}>
<Card title="部门" bordered={false} bodyStyle={{ padding: 8, paddingTop: 24 }}>
{
depMessagedata.length ?
<Tree
height={clientHeight - 100}
defaultExpandedKeys={[depMessagedata[0].id]}
selectedKeys={depSelectedKeys}
onSelect={(selectedKeys, { selected, selectedNodes, node }) => {
setUserType(selectedNodes[0].type)
setCheckedList(depUserCopy.map(i => i.id))
// setResCode(userResource.map(i=>i.resourceId))
return (
<Spin spinning={loading}>
<Row gutter={16}>
<Col span={4} style={{ height: '100%' }}>
<Card title="部门" bordered={false} bodyStyle={{ padding: 8, paddingTop: 24 }}>
{
depMessagedata.length ?
<Tree
height={clientHeight - 100}
defaultExpandedKeys={[depMessagedata[0].id]}
selectedKeys={depSelectedKeys}
onSelect={(selectedKeys, { selected, selectedNodes, node }) => {
setUserType(selectedNodes[0].type)
setCheckedList(depUserCopy.map(i => i.id))
// setResCode(userResource.map(i=>i.resourceId))
if (selected) {
setCheckedList(depUserCopy.map(i => i.id))
setDepSelectedKeys(selectedKeys)
setDepSelected(selectedNodes[0].name || "")
dispatch(getDepUser(selectedKeys[0]))
if (selected) {
setCheckedList(depUserCopy.map(i => i.id))
setDepSelectedKeys(selectedKeys)
setDepSelected(selectedNodes[0].name || "")
dispatch(getDepUser(selectedKeys[0]))
// setResCode(userResource.map(i=>i.resourceId))
// setResCode(userResource.map(i=>i.resourceId))
}
}
}}
treeData={depMessagedata}
fieldNames={{
title: 'name',
key: 'id',
children: 'subordinate'
}}
/> : ''
}
</Card>
</Col>
<Col span={4} style={{ height: '100%', }}>
<Card title={` 用户列表`} bordered={false} bodyStyle={{ padding: 8, paddingTop: 24 }}>
{
depUserCopy?.length ?
<Tree
height={clientHeight - 100}
defaultSelectedKeys={[depUserCopy[0]?.id]}
selectedKeys={userSelectedKeys}
onSelect={(selectedKeys, { selected, selectedNodes, node, event }) => {
const name = node.name
setUseName(name)
}}
treeData={depMessagedata}
fieldNames={{
title: 'name',
key: 'id',
children: 'subordinate'
}}
/> : ''
}
</Card>
</Col>
<Col span={4} style={{ height: '100%', }}>
<Card title={` 用户列表`} bordered={false} bodyStyle={{ padding: 8, paddingTop: 24 }}>
{
depUserCopy?.length ?
<Tree
height={clientHeight - 100}
defaultSelectedKeys={[depUserCopy[0]?.id]}
selectedKeys={userSelectedKeys}
onSelect={(selectedKeys, { selected, selectedNodes, node, event }) => {
const name = node.name
setUseName(name)
if (selected) {
// console.log(selectedKeys,'选中的selectedKeys')
// console.log(selectedNodes[0].username || '','node')
// console.log(selectedKeys[0],'请求的值')
setUserSelectedKeys(selectedKeys)
setUserSelected(selectedNodes[0].username || '')
dispatch(getUserResource(selectedKeys[0]))
}
if (selected) {
// console.log(selectedKeys,'选中的selectedKeys')
// console.log(selectedNodes[0].username || '','node')
// console.log(selectedKeys[0],'请求的值')
setUserSelectedKeys(selectedKeys)
setUserSelected(selectedNodes[0].username || '')
dispatch(getUserResource(selectedKeys[0]))
}
}}
treeData={depUserCopy}
fieldNames={{
title: 'name',
key: 'id'
}}
/> : <Empty />
}}
treeData={depUserCopy}
fieldNames={{
title: 'name',
key: 'id'
}}
/> : <Empty />
// <div>
// <Checkbox indeterminate={indeterminate} onChange={onCheckAllChange} checked={checkAll} disabled={user?.department?.type==="qifu"&&user?.userResources?.filter(i=>i.resourceId==='AUTHORIMANAGE')[0].isShow==="true"?true:''}>
// 全选
// </Checkbox>
// <div>
// <Checkbox indeterminate={indeterminate} onChange={onCheckAllChange} checked={checkAll} disabled={user?.department?.type==="qifu"&&user?.userResources?.filter(i=>i.resourceId==='AUTHORIMANAGE')[0].isShow==="true"?true:''}>
// 全选
// </Checkbox>
// <CheckboxGroup options={plainOptions} value={checkedList} onChange={onChange} disabled={user?.department?.type==="qifu"&&user?.userResources?.filter(i=>i.resourceId==='AUTHORIMANAGE')[0].isShow==="true"?true:''}/>
// </div> : <Empty />
// <CheckboxGroup options={plainOptions} value={checkedList} onChange={onChange} disabled={user?.department?.type==="qifu"&&user?.userResources?.filter(i=>i.resourceId==='AUTHORIMANAGE')[0].isShow==="true"?true:''}/>
// </div> : <Empty />
}
</Card>
</Col>
<Col span={16} style={{ height: '100%', }}>
<Checkbox onChange={onshowchange} checked={isshow} disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'AUTHORIMANAGE')[0]?.isshow === "true" ? true : ''}>
不可编辑
</Checkbox>
{depUserCopy?.length ?
<Card title={` 功能范围`} bordered={false} bodyStyle={{ padding: 8, paddingTop: 24 }}>
{/* <Resource
}
</Card>
</Col>
<Col span={16} style={{ height: '100%', }}>
<Checkbox onChange={onshowchange} checked={isshow} disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'AUTHORIMANAGE')[0]?.isshow === "true" ? true : ''}>
不可编辑
</Checkbox>
{depUserCopy?.length ?
<Card title={` 功能范围`} bordered={false} bodyStyle={{ padding: 8, paddingTop: 24 }}>
{/* <Resource
userSelected={userSelected}
roleData={resource}
userRole={userResource}
setResCode={setResCode}
userType={user?.department?.type==="qifu"&&user?.userResources?.filter(i=>i.resourceId==='AUTHORIMANAGE')[0].isShow==="true"?4:userType}
/> */}
<div>
<Checkbox
onChange={onresCheckAllChange}
checked={rescheckAll}
disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'AUTHORIMANAGE')[0].isshow === "true" ? true : ''}
>
全选
</Checkbox>
<CheckboxGroup
options={rescodeall}
value={resCode}
onChange={onresChange}
disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'AUTHORIMANAGE')[0].isshow === "true" ? true : ''}
/>
</div>
<Row type="flex" justify="center" style={{ marginBottom: 16, marginTop: 16, textAlign: 'center' }}>
<Col span="24">
<Button
disabled={userSelected === "SuperAdmin" || userType === 4}
onClick={handleSave}
style={{ width: '60%' }}
type='primary'>保存修改</Button>
</Col></Row>
</Card>
: <Card title={`[]功能范围`} bordered={false} bodyStyle={{ padding: 8, paddingTop: 24 }}>
<Empty />
</Card>
}
</Col>
</Row>
</Spin >
)
<div>
<Checkbox
onChange={onresCheckAllChange}
checked={rescheckAll}
disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'AUTHORIMANAGE')[0].isshow === "true" ? true : ''}
>
全选
</Checkbox>
<CheckboxGroup
options={rescodeall}
value={resCode}
onChange={onresChange}
disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'AUTHORIMANAGE')[0].isshow === "true" ? true : ''}
/>
</div>
<Row type="flex" justify="center" style={{ marginBottom: 16, marginTop: 16, textAlign: 'center' }}>
<Col span="24">
<Button
disabled={userSelected === "SuperAdmin" || userType === 4}
onClick={handleSave}
style={{ width: '60%' }}
type='primary'>保存修改</Button>
</Col></Row>
</Card>
: <Card title={`[]功能范围`} bordered={false} bodyStyle={{ padding: 8, paddingTop: 24 }}>
<Empty />
</Card>
}
</Col>
</Row>
</Spin >
)
}
function mapStateToProps(state) {
const { userResource, resource, depMessage, depUser, global, auth } = state;
return {
clientHeight: global.clientHeight,
loading: depMessage.isRequesting || depUser.isRequesting || resource.isRequesting,
userResource: userResource.data || [],
resource: resource.data || [],
depMessage: depMessage.data || [],
depUser: depUser.data || [],
user: auth.user
};
function mapStateToProps (state) {
const { userResource, resource, depMessage, depUser, global, auth } = state;
return {
clientHeight: global.clientHeight,
loading: depMessage.isRequesting || depUser.isRequesting || resource.isRequesting,
userResource: userResource.data || [],
resource: resource.data || [],
depMessage: depMessage.data || [],
depUser: depUser.data || [],
user: auth.user
};
}
export default connect(mapStateToProps)(Authority);
Loading…
Cancel
Save