From 785f19de446a2e2010cf926ad27dc387ae0eb35d Mon Sep 17 00:00:00 2001 From: zhaobing Date: Thu, 13 Jul 2023 15:36:28 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat:=E6=8C=87=E6=B4=BE=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=9A=84=E5=AE=8C=E5=96=84+=E6=9D=83=E9=99=90=E7=9A=84?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/report/index.js | 14 +-- api/app/lib/routes/data/index.js | 12 +- api/sequelize-automate.config.js | 2 +- web/client/src/layout/index.js | 2 +- .../src/sections/auth/containers/login.js | 6 +- .../fillion/components/buildingTable.js | 6 +- .../sections/fillion/components/datajuji.js | 2 +- .../fillion/components/editGuanlang.js | 108 +++++++++--------- .../components/feedback/nominateModal.js | 40 ++++--- .../fillion/components/highwaysTable.js | 2 +- .../fillion/components/maintenanceTable.js | 10 +- .../fillion/components/operationalTable.js | 2 +- .../fillion/components/patrolTable.js | 55 +++++---- .../fillion/components/project/project.js | 2 +- .../fillion/components/transportationTable.js | 4 +- .../src/sections/fillion/containers/assess.js | 16 +-- .../sections/fillion/containers/building.js | 2 +- .../sections/fillion/containers/highways.js | 16 +-- .../src/sections/fillion/containers/task.js | 2 +- .../fillion/containers/transportation.js | 24 ++-- web/client/src/sections/fillion/nav-item.js | 59 +++++----- web/client/src/sections/fillion/routes.js | 5 +- .../organization/containers/authority.js | 13 +-- .../sections/organization/containers/user.js | 29 ++--- .../src/sections/organization/nav-item.js | 6 +- 25 files changed, 234 insertions(+), 205 deletions(-) diff --git a/api/app/lib/controllers/report/index.js b/api/app/lib/controllers/report/index.js index 59d87750..33344585 100644 --- a/api/app/lib/controllers/report/index.js +++ b/api/app/lib/controllers/report/index.js @@ -1,7 +1,7 @@ 'use strict'; const { QueryTypes } = require('sequelize'); -async function reportList (ctx) { +async function reportList(ctx) { try { const models = ctx.fs.dc.models; const { limit, page, startTime, endTime, keyword, userId, reportType, isTop, asc, projectType, handleState = '', performerId = '' } = ctx.query @@ -43,7 +43,7 @@ async function reportList (ctx) { where: { }, - attributes: ['id', 'road', 'time', 'projectType', 'roadSectionStart', 'roadSectionEnd', 'reportType', 'content', 'longitude', 'latitude', 'projectName', 'handleState'], + attributes: ['id', 'road', 'time', 'projectType', 'roadSectionStart', 'performerId', 'roadSectionEnd', 'reportType', 'content', 'longitude', 'latitude', 'projectName', 'handleState'], include: [{ model: models.User, attributes: ['name'] @@ -114,7 +114,7 @@ async function reportList (ctx) { } } -async function reportPosition (ctx) { +async function reportPosition(ctx) { try { const models = ctx.fs.dc.models; const { startTime, endTime, userId, reportType } = ctx.query @@ -164,7 +164,7 @@ async function reportPosition (ctx) { } } -async function reportDetail (ctx) { +async function reportDetail(ctx) { try { const models = ctx.fs.dc.models; const { reportId } = ctx.params @@ -186,7 +186,7 @@ async function reportDetail (ctx) { } } -async function reportHandle (ctx) { +async function reportHandle(ctx) { try { const { models } = ctx.fs.dc; @@ -216,7 +216,7 @@ async function reportHandle (ctx) { } } -async function createReport (ctx) { +async function createReport(ctx) { try { const { userId } = ctx.fs.api const models = ctx.fs.dc.models; @@ -238,7 +238,7 @@ async function createReport (ctx) { } } -async function deleteReport (ctx) { +async function deleteReport(ctx) { try { const models = ctx.fs.dc.models; const { reportId } = ctx.params; diff --git a/api/app/lib/routes/data/index.js b/api/app/lib/routes/data/index.js index 27b41684..913ade65 100644 --- a/api/app/lib/routes/data/index.js +++ b/api/app/lib/routes/data/index.js @@ -11,7 +11,7 @@ const dataIndex = require('../../controllers/data/index'); const task = require('../../controllers/data/task') const assess = require('../../controllers/data/assess') const videoCenter = require('../../controllers/data/videoCenter') - +const appointTask = require('../../controllers/data/appointed') module.exports = function (app, router, opts) { // 数据导出 @@ -24,7 +24,7 @@ module.exports = function (app, router, opts) { // 运政 //货运 - async function setFreightType (ctx, next) { + async function setFreightType(ctx, next) { ctx.request.body = { ...(ctx.request.body || {}), type: 'freight' @@ -41,7 +41,7 @@ module.exports = function (app, router, opts) { router.del('/vehicle/freight/:id', setFreightType, vehicle.del); //客运车 - async function setVehicleType (ctx, next) { + async function setVehicleType(ctx, next) { ctx.request.body = { ...(ctx.request.body || {}), type: 'vehicle' @@ -58,7 +58,7 @@ module.exports = function (app, router, opts) { router.del('/vehicle/:id', setVehicleType, vehicle.del); // 路政 - async function setRoadManageType (ctx, next) { + async function setRoadManageType(ctx, next) { ctx.request.body = { ...(ctx.request.body || {}), type: 'road_manage' @@ -202,4 +202,8 @@ module.exports = function (app, router, opts) { app.fs.api.logAttr['GET/videoCenter/list'] = { content: '获取萤石设备列表', visible: true }; router.get('/videoCenter/list', videoCenter.videoList(opts)); // 视频中心 END + // 指派任务 + app.fs.api.logAttr['PUT/appointTask'] = { content: '指派任务', visible: true }; + router.put('/appointTask', appointTask.appoint); + // 指派任务 END }; diff --git a/api/sequelize-automate.config.js b/api/sequelize-automate.config.js index 4d844600..bc1e2bec 100644 --- a/api/sequelize-automate.config.js +++ b/api/sequelize-automate.config.js @@ -27,7 +27,7 @@ module.exports = { dir: './app/lib/models', // 指定输出 models 文件的目录 typesDir: 'models', // 指定输出 TypeScript 类型定义的文件目录,只有 TypeScript / Midway 等会有类型定义 emptyDir: false, // !!! 谨慎操作 生成 models 之前是否清空 `dir` 以及 `typesDir` - tables: ['assess'], // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性 + tables: ['user_resource'], // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性 skipTables: [], // 指定跳过哪些表的 models,如 ['user'];如果为 null,则忽略改属性 tsNoCheck: false, // 是否添加 `@ts-nocheck` 注释到 models 文件中 ignorePrefix: [], // 生成的模型名称忽略的前缀,因为 项目中有以下表名是以 t_ 开头的,在实际模型中不需要, 可以添加多个 [ 't_data_', 't_',] ,长度较长的 前缀放前面 diff --git a/web/client/src/layout/index.js b/web/client/src/layout/index.js index d3d483c8..7b714fc8 100644 --- a/web/client/src/layout/index.js +++ b/web/client/src/layout/index.js @@ -61,7 +61,7 @@ const Root = props => { flat(routes); //将路由信息全部放在session,方便后面拿了用(权限控制的时候) - console.log('combineRoutes1', combineRoutes) + //console.log('combineRoutes1', combineRoutes) sessionStorage.setItem('allRoutes', JSON.stringify(combineRoutes)); return combineRoutes; } diff --git a/web/client/src/sections/auth/containers/login.js b/web/client/src/sections/auth/containers/login.js index 54dc9b31..dd46d798 100644 --- a/web/client/src/sections/auth/containers/login.js +++ b/web/client/src/sections/auth/containers/login.js @@ -35,7 +35,7 @@ const Login = props => { } else if (hasAuth && hasAuth.length > 0) { const path = hasAuth[0].path - console.log('sasa', `${path}`) + //console.log('sasa', `${path}`) dispatch(push(path)) } else { dispatch(push('/noContent')) @@ -86,7 +86,7 @@ const Login = props => { value={username} maxlength={11} onChange={e => { - console.log('e.target.value', e.target.value) + //('e.target.value', e.target.value) setUserName(e.target.value) setInputChanged(true) }} @@ -100,7 +100,7 @@ const Login = props => { value={password} onChange={e => { - console.log('setPassword', e.target.value) + //console.log('setPassword', e.target.value) setPassword(e.target.value) setInputChanged(true) }} diff --git a/web/client/src/sections/fillion/components/buildingTable.js b/web/client/src/sections/fillion/components/buildingTable.js index 16244de0..b4ca4b51 100644 --- a/web/client/src/sections/fillion/components/buildingTable.js +++ b/web/client/src/sections/fillion/components/buildingTable.js @@ -25,8 +25,8 @@ const BuildingTable = (props) => { const [differentiate, setDifferentiate] = useState('road') const [grade, setGrade] = useState('project') const [departmentInfo, setDepartment] = useState('') - const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'ROADMANAGE')[0].isshow === "true" ? true : '') - + const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.find(i => i.resourceId === 'BUILDINGPROJECT')?.isshow === "true" ? true : '') + console.log('user111', user) const ref = useRef() const [activeKey, setActiveKey] = useState('tab1'); //打开弹窗 @@ -309,7 +309,7 @@ const BuildingTable = (props) => { columns={columns[activeKey]} dataSource={counts || []} request={async (params) => { - console.log(whichofits) + //console.log(whichofits) if (whichofits == '在建项目') { const query = { entryName: sitename diff --git a/web/client/src/sections/fillion/components/datajuji.js b/web/client/src/sections/fillion/components/datajuji.js index 4d3838d7..1ba6cc65 100644 --- a/web/client/src/sections/fillion/components/datajuji.js +++ b/web/client/src/sections/fillion/components/datajuji.js @@ -60,7 +60,7 @@ const EditGuanlang = (props) => { const handleSave = () => { const data = form.getFieldsValue(true); - console.log(data, 'data') + //console.log(data, 'data') handleSaveScore(); } diff --git a/web/client/src/sections/fillion/components/editGuanlang.js b/web/client/src/sections/fillion/components/editGuanlang.js index b335e6e9..cc820974 100644 --- a/web/client/src/sections/fillion/components/editGuanlang.js +++ b/web/client/src/sections/fillion/components/editGuanlang.js @@ -1,7 +1,7 @@ import React, { useEffect, useState } from 'react'; -import { Modal, Form, Input, Select, DatePicker, AutoComplete, Col, Button,Row } from 'antd'; +import { Modal, Form, Input, Select, DatePicker, AutoComplete, Col, Button, Row } from 'antd'; -import { MinusCircleOutlined, PlusOutlined,PlusCircleOutlined } from '@ant-design/icons'; +import { MinusCircleOutlined, PlusOutlined, PlusCircleOutlined } from '@ant-design/icons'; const Search = Input.Search const { TextArea } = Input; import moment from 'moment'; @@ -60,8 +60,8 @@ const EditGuanlang = (props) => { const handleSave = () => { const data = form.getFieldsValue(true); - console.log(data,'data') - handleSaveScore(); + //console.log(data,'data') + handleSaveScore(); } const onFileUploaded = (fileList) => { @@ -86,8 +86,8 @@ const EditGuanlang = (props) => { footer={null} >
- - + + 配置属性 {/* */} @@ -95,38 +95,38 @@ const EditGuanlang = (props) => { - - + + - + - + - - + + - - + label={'语音支持'} + name={'endposition'}> + + @@ -135,65 +135,65 @@ const EditGuanlang = (props) => { style={{ width: 'calc(45%-4px' }} label={'内存'} name={'guanlangmaterial'} - rules={[{ required: true, message: '管廊材质不能为空' }]}> - + rules={[{ required: true, message: '管廊材质不能为空' }]}> + - + label={'序列设备号'} + name={'guanlanglayer'} + rules={[{ required: true, message: '序列设备号不能为空' }]}> + - + - + style={{ width: 'calc(45%-4px' }} + label={'安装位置'} + name={'guanlanglength'} + rules={[{ required: true, message: '安装位置不能为空' }]}> + + label={'通道号'} + name={'manageunit'} + rules={[{ required: true, message: '通道号不能为空' }]}> - - + + - - + + - - + label={'设备能力'} + name={'endposition'}> + + - , - isAnomaly && record.handleState != '已处理' ? - : null, - isAnomaly && record.handleState != '已处理' ? - - - - - ]} + isAnomaly && record.handleState != '已处理' && record.performerId === null ? + : null, + isAnomaly && record.handleState != '已处理' && record.performerId === null ? + < Popover + content={ + [ +
+ + +
+ ]} visible={noProcessingSelectRecord == record.id && noProcessingPopVisible} trigger="click" onClick={() => user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'FEEDBACKMANAGE' || 'FEEDBACKMANAGE')[0].isshow === "true" ? '' : setNoProcessingSelectRecord(record.id)} @@ -272,7 +276,7 @@ const DetailList = (props) => { onVisibleChange={(newVisible) => setNoProcessingPopVisible(newVisible)} > -
: null, + : null, @@ -307,7 +311,7 @@ const DetailList = (props) => { toolBarRender={false} search={false} /> - + ) }; @@ -500,7 +504,7 @@ const PatrolNameList = (props) => { } } - console.log('selectedKeys', selectedKeys, selected, selectedNodes, node) + // console.log('selectedKeys', selectedKeys, selected, selectedNodes, node) }; @@ -528,7 +532,7 @@ const PatrolNameList = (props) => {
handleSearch(e.target.value)} /> @@ -612,7 +616,7 @@ const PatrolTable = (props) => { }, [record, dateRange, selectProjectType]) const queryData = () => { - console.log(record, 'idididid') + //console.log(record, 'idididid') let userId = null if (user?.username === 'SuperAdmin' && record === 1) { userId = undefined @@ -628,7 +632,7 @@ const PatrolTable = (props) => { userId, reportType: reportType, projectType: selectProjectType, asc: true } - console.log(query, 'query1') + //console.log(query, 'query1') if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) { query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss') query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss') @@ -708,7 +712,8 @@ const PatrolTable = (props) => { record={record} activeTabKey1={activeTabKey1} userList={userList} - loading={userLoading} /> + loading={userLoading} + /> { const { visible, onVisibleChange, typecard, rewkeys, recortd, dispatch, setRecortd, setDelet, getData } = props - console.log('typecard', newlysay) + //console.log('typecard', newlysay) const [newlys, setNewlys] = useState() //必填数据 const [newlysay, setNewlysay] = useState() //处理hou const [records, setRecords] = useState()//处理 diff --git a/web/client/src/sections/fillion/components/transportationTable.js b/web/client/src/sections/fillion/components/transportationTable.js index 9c9d8f64..d4d4264d 100644 --- a/web/client/src/sections/fillion/components/transportationTable.js +++ b/web/client/src/sections/fillion/components/transportationTable.js @@ -44,7 +44,7 @@ const TransporTationTable = (props) => { }) setDepartment(departmentInfo) }, [user, depMessage]) - console.log('sad', departmentInfo) + //console.log('sad', departmentInfo) // useEffect(() => { // console.log('11111', depMessage) // }, [depMessage]) @@ -3809,7 +3809,7 @@ const TransporTationTable = (props) => { columns={columns[activeKey]} dataSource={counts || []} request={async (params) => { - console.log(whichofits) + //console.log(whichofits) if (whichofits == '县') { console.log('differentiate', '我我我我吧') diff --git a/web/client/src/sections/fillion/containers/assess.js b/web/client/src/sections/fillion/containers/assess.js index 7343db9a..1ce77a1a 100644 --- a/web/client/src/sections/fillion/containers/assess.js +++ b/web/client/src/sections/fillion/containers/assess.js @@ -26,14 +26,14 @@ export const unitList = [ '银三角管委会', '黄马乡', ] -function Assess (props) { +function Assess(props) { const { dispatch, assess } = props; const [assessModalVisible, setAssessModalVisible] = useState(false); const [editData, setEditData] = useState(null); const [query, setQuery] = useState({ page: 1, pageSize: 10 }) const [loading, setLoading] = useState(false); const [isCheck, setIsCheck] = useState(false) - + const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.find(i => i.resourceId === 'ASSESSMANAGE')?.isshow === "true" ? true : '') useEffect(() => { return () => { }; }, []); @@ -74,9 +74,10 @@ function Assess (props) { - +
{ setAssessModalVisible(true) setEditData(record) + disabled = { editAble } }}>编辑 - + ), @@ -157,7 +159,7 @@ function Assess (props) {
); } -function mapStateToProps (state) { +function mapStateToProps(state) { const { auth, assess } = state return { user: auth.user, diff --git a/web/client/src/sections/fillion/containers/building.js b/web/client/src/sections/fillion/containers/building.js index ca866608..b6f95796 100644 --- a/web/client/src/sections/fillion/containers/building.js +++ b/web/client/src/sections/fillion/containers/building.js @@ -12,7 +12,7 @@ const building = (props) => { setData(props) }, []); const exports = (ids, differentiate) => { - console.log('sssss1', ids, differentiate) + //console.log('sssss1', ids, differentiate) let idas = ids.toString() if (differentiate == 'bridge') { window.open( diff --git a/web/client/src/sections/fillion/containers/highways.js b/web/client/src/sections/fillion/containers/highways.js index a4636c8f..5964505b 100644 --- a/web/client/src/sections/fillion/containers/highways.js +++ b/web/client/src/sections/fillion/containers/highways.js @@ -9,16 +9,16 @@ const highways = (props) => { const [data, setData] = useState() useEffect(() => { // dispatch(getDepMessage()) - + setData(props) }, []); - const exports = (ids,counts) => { - console.log(counts); - let idas=ids.toString() - window.open( - '/_api/'+`data/export/?ids=${idas||''}&exp=${'overspeed'}&token=${user.token}`) - -} + const exports = (ids, counts) => { + //console.log(counts); + let idas = ids.toString() + window.open( + '/_api/' + `data/export/?ids=${idas || ''}&exp=${'overspeed'}&token=${user.token}`) + + } return ( <> diff --git a/web/client/src/sections/fillion/containers/task.js b/web/client/src/sections/fillion/containers/task.js index e68f86b8..761ac4b0 100644 --- a/web/client/src/sections/fillion/containers/task.js +++ b/web/client/src/sections/fillion/containers/task.js @@ -38,7 +38,7 @@ const Task = (props) => { } //选择安全是否消除 const changeSelect = async (value) => { - console.log('value', value) + //console.log('value', value) const task1 = await dispatch(getTask({ id: inputVal, isdanger: value === 'all' ? undefined : value === 'y' ? true : false })) setTaskRes(task1.payload?.data) setSelectVal(value) diff --git a/web/client/src/sections/fillion/containers/transportation.js b/web/client/src/sections/fillion/containers/transportation.js index afcf43df..f3da8d43 100644 --- a/web/client/src/sections/fillion/containers/transportation.js +++ b/web/client/src/sections/fillion/containers/transportation.js @@ -9,23 +9,23 @@ const transportation = (props) => { const [data, setData] = useState() useEffect(() => { // dispatch(getDepMessage()) - + setData(props) }, []); - //批量导出 - const exports = (ids,grade,differentiate) => { - console.log(differentiate); - let idas=ids.toString() - if(differentiate=='road'){ + //批量导出 + const exports = (ids, grade, differentiate) => { + //console.log(differentiate); + let idas = ids.toString() + if (differentiate == 'road') { window.open( - '/_api/'+`data/export/?ids=${idas||''}&exp=${differentiate}&roadLevel=${grade||''}&token=${user.token}`) - }if(differentiate=='project'){ + '/_api/' + `data/export/?ids=${idas || ''}&exp=${differentiate}&roadLevel=${grade || ''}&token=${user.token}`) + } if (differentiate == 'project') { window.open( - '/_api/'+`data/export/?ids=${idas||''}&exp=${differentiate}&token=${user.token}`) + '/_api/' + `data/export/?ids=${idas || ''}&exp=${differentiate}&token=${user.token}`) } - - -} + + + } return ( <> diff --git a/web/client/src/sections/fillion/nav-item.js b/web/client/src/sections/fillion/nav-item.js index 2755d728..1a4061ee 100644 --- a/web/client/src/sections/fillion/nav-item.js +++ b/web/client/src/sections/fillion/nav-item.js @@ -5,7 +5,7 @@ import { ReadOutlined } from '@ant-design/icons'; const SubMenu = Menu.SubMenu; export function getNavItem(user, dispatch) { const isshow = user?.userResources?. - filter(i => i.resourceId === 'OVERLOADMANAGE' || + some(i => i.resourceId === 'OVERLOADMANAGE' || i.resourceId === 'ROADMANAGE' || i.resourceId === 'BRIDGEMANAGE' || i.resourceId === 'MAINTENANCEMANAGE' || @@ -16,66 +16,67 @@ export function getNavItem(user, dispatch) { i.resourceId === 'PUBLICITYVIDEO' || i.resourceId === 'FEEDBACKMANAGE' || i.resourceId === 'REPORTMANAGE' || - i.resourceId === 'PATROLMANAGE')?.length !== 0 + i.resourceId === 'PATROLMANAGE' || + i.resourceId === 'ASSESSMANAGE' || + i.resourceId === 'VIDEOCENTER' || + i.resourceId === 'BUILDINGPROJECT' + ) return ( user?.username == 'SuperAdmin' || isshow ? } title={'数据管理'}> - {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'OVERLOADMANAGE')?.length !== 0 ? + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'OVERLOADMANAGE') ? 治超管理 : ''} {/* 任务管理 */} - {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'ROADMANAGE')?.length !== 0 ? + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'ROADMANAGE') ? 道路管理 : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'BRIDGEMANAGE')?.length !== 0 ? + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'BRIDGEMANAGE') ? 桥梁管理 : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'MAINTENANCEMANAGE')?.length !== 0 ? + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'MAINTENANCEMANAGE') ? 管养管理 : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'TRANSPORTATIONMANAGE')?.length !== 0 ? + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'TRANSPORTATIONMANAGE') ? 运政管理 : ''} {/* 执法管理 */} - {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'CONSERVATIONMANAGE')?.length !== 0 ? + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'CONSERVATIONMANAGE') ? 养护管理 : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'PATROLMANAGE')?.length !== 0 ? + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'PATROLMANAGE') ? 巡查管理 : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'FEEDBACKMANAGE')?.length !== 0 ? + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'FEEDBACKMANAGE') ? 异常反馈 : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'REPORTMANAGE')?.length !== 0 ? + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'REPORTMANAGE') ? 建设上报 : ''} - - {/* {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'FEEDBACKMANAGE')?.length !== 0 ? - - : ''} */} - - 在建项目 - - {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'PUBLICTRANSPORTMANAGE')?.length !== 0 ? + {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'BUILDINGPROJECT') ? + + 在建项目 + : ''} + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'PUBLICTRANSPORTMANAGE') ? 公交管理 : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'FILEMANAGE')?.length !== 0 ? + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'FILEMANAGE') ? 档案管理 : ''} @@ -85,19 +86,19 @@ export function getNavItem(user, dispatch) { {/* 接口管理 */} - {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'PUBLICITYVIDEO')?.length !== 0 ? - + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'PUBLICITYVIDEO') ? 宣传视频 : ''} - - - 考核评分 - - - 视频中心 - + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'ASSESSMANAGE') ? + + 考核评分 + : ''} + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'VIDEOCENTER') ? + + 视频中心 + : ''} : null ); } diff --git a/web/client/src/sections/fillion/routes.js b/web/client/src/sections/fillion/routes.js index a88cc2f7..37318966 100644 --- a/web/client/src/sections/fillion/routes.js +++ b/web/client/src/sections/fillion/routes.js @@ -52,7 +52,7 @@ export default [{ menuSelectKeys: ['fillionprocesssing'], component: Building, breadcrumb: '在建项目', - //authCode: 'ROADMANAGE' + authCode: 'BUILDINGPROJECT' } , { @@ -163,12 +163,15 @@ export default [{ menuSelectKeys: ['fillionassess'], component: Assess, breadcrumb: '考核评分', + authCode: 'ASSESSMANAGE' }, { path: '/videoCenter', key: 'fillionvideoCenter', menuSelectKeys: ['fillionvideoCenter'], component: VideoCenter, breadcrumb: '视频中心', + authCode: 'VIDEOCENTER' + } ] } diff --git a/web/client/src/sections/organization/containers/authority.js b/web/client/src/sections/organization/containers/authority.js index 749049cc..a5ec4e51 100644 --- a/web/client/src/sections/organization/containers/authority.js +++ b/web/client/src/sections/organization/containers/authority.js @@ -13,7 +13,8 @@ const Authority = (props) => { 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', - 'WXPATROLREPORT', 'WXMAINTENANCEREPORT', 'WXFEEDBACKMANAGE', 'WXBUILDINGROAD' + 'ASSESSMANAGE', 'VIDEOCENTER', 'BUILDINGPROJECT', 'WXPATROLREPORT', 'WXMAINTENANCEREPORT', 'WXFEEDBACKMANAGE', 'WXBUILDINGROAD', + 'WXTODOLIST', 'WXDONELIST' ] const [depUserCopy, setDepUserCopy] = useState([])//用于存放除了自己的管理的数组,即自己不能调整自己是否为管理员 const [depSelectedKeys, setDepSelectedKeys] = useState([]) @@ -69,7 +70,7 @@ const Authority = (props) => { const onshowchange = (e) => { setisshow(e.target.checked) } - console.log('depMessagedata', depMessagedata) + //console.log('depMessagedata', depMessagedata) useEffect(() => { dispatch(getResource()) @@ -87,7 +88,7 @@ const Authority = (props) => { }, [userResource]) useEffect(async () => { if (depMessage.length) { - console.log('depMessage', depMessage) + //('depMessage', depMessage) //超级管理员展示所有部门 if (user?.username === 'SuperAdmin') { setdepMessagedata(depMessage) @@ -98,7 +99,7 @@ const Authority = (props) => { //不是超级管理员,展示相应部门的数据 dispatch(getDepUser(user.departmentId)) const res = await dispatch(getDepById({ deptId: parseInt(user.departmentId) })) - console.log('resssss', res) + //console.log('resssss', res) setdepMessagedata(res.payload.data) // if (authDep.length > 0) { // dispatch(getDepUser(authDep[0]?.id)) @@ -118,9 +119,7 @@ const Authority = (props) => { // } // }, [depMessage]) useEffect(() => { - const copy = depUser.filter((item) => { - return item.id !== user.id//把自己筛选出去 - }) + const copy = [...new Set(depUser)] setDepUserCopy(copy) if (copy.length) { setUserSelectedKeys([copy[0].id]) diff --git a/web/client/src/sections/organization/containers/user.js b/web/client/src/sections/organization/containers/user.js index aad90c6d..c89563e2 100644 --- a/web/client/src/sections/organization/containers/user.js +++ b/web/client/src/sections/organization/containers/user.js @@ -29,10 +29,10 @@ const UserManage = (props) => { const [uid, setuid] = useState() const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'USERMANAGE')[0].isshow === "true" ? true : '')//控制操作(新增删除等操作,对应权限的'不可编辑')是否可操作 const [depMessagedata, setdepMessagedata] = useState(depMessage) - console.log('depMessagedata', depMessagedata) + //('depMessagedata', depMessagedata) useEffect(async () => { if (depMessage.length) { - console.log('depMessage', depMessage) + //console.log('depMessage', depMessage) //超级管理员展示所有部门 if (user?.username === 'SuperAdmin') { setdepMessagedata(depMessage) @@ -42,7 +42,7 @@ const UserManage = (props) => { //不是超级管理员,展示相应部门的数据 dispatch(getDepUser(user.departmentId)) const res = await dispatch(getDepById({ deptId: parseInt(user.departmentId) })) - console.log('resssss', res) + //('resssss', res) setdepMessagedata(res.payload.data) // setDepSelectedKeys([res.payload.data[0].id]) // dispatch(getDepUser(res.payload.data[0].id)) @@ -66,12 +66,13 @@ const UserManage = (props) => { dispatch(getDepMessage()) }, []) useEffect(() => { - console.log('depuser', depUser, user) - const copy = depUser.filter((item) => { - console.log('item1', item) - return item.id !== user.id//把自己筛选出去 - }) - console.log('copy', copy) + //console.log('depuser', depUser, user) + // const copy = depUser.filter((item) => { + // //console.log('item1', item) + // return item.id !== user.id//把自己筛选出去 + // }) + // //console.log('copy', copy) + const copy = [...new Set(depUser)] setDepUserCopy(copy) }, [depUser]) useEffect(() => { @@ -161,7 +162,7 @@ const UserManage = (props) => { //弹窗确认 const onConfirm = (values) => { - console.log('values.contract', values.contract) + //('values.contract', values.contract) if (modalType == 'edit') { dispatch(updateUser(modalRecord.id, values.contract)).then(res => { if (res.success) { @@ -226,8 +227,8 @@ const UserManage = (props) => { } //部门新增及编辑 const onDepConfirm = (data) => { - console.log('depModalType:', depModalType); - console.log('data:', data); + //console.log('depModalType:', depModalType); + //console.log('data:', data); if (depModalType == 'edit') { dispatch(updateDep(data)).then(res => { @@ -442,7 +443,9 @@ function mapStateToProps(state) { loading: depMessage.isRequesting, depMessage: depMessage.data || [], depUser: depUser.data || [], - user: auth.user + user: auth.user, + actions: global.actions + }; } diff --git a/web/client/src/sections/organization/nav-item.js b/web/client/src/sections/organization/nav-item.js index 604ea5a6..f9da3712 100644 --- a/web/client/src/sections/organization/nav-item.js +++ b/web/client/src/sections/organization/nav-item.js @@ -17,17 +17,17 @@ export function getNavItem(user, dispatch) { // dispatch(push('/fillion/infor')); // return null // } - const isshow = user?.userResources?.filter(i => i.resourceId === 'USERMANAGE' || i.resourceId === 'AUTHORIMANAGE')?.length !== 0 + const isshow = user?.userResources?.some(i => i.resourceId === 'USERMANAGE' || i.resourceId === 'AUTHORIMANAGE') return ( user?.username == 'SuperAdmin' || isshow ? } title={'授权管理'}> - {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'USERMANAGE')?.length !== 0 ? < Menu.Item key="userManage"> + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'USERMANAGE') ? < Menu.Item key="userManage"> 用户管理 : '' } - {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'AUTHORIMANAGE')?.length !== 0 ? + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'AUTHORIMANAGE') ? 权限管理 : ''} From b056b6ef59ef3940178cdfc32d8181aea4bf20d1 Mon Sep 17 00:00:00 2001 From: zhaobing Date: Thu, 13 Jul 2023 15:41:34 +0800 Subject: [PATCH 2/4] =?UTF-8?q?feat:=E6=9D=83=E9=99=90=E8=A1=A8=E6=9F=A5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/1.2.3/schema/5.alter_resource.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 scripts/1.2.3/schema/5.alter_resource.sql diff --git a/scripts/1.2.3/schema/5.alter_resource.sql b/scripts/1.2.3/schema/5.alter_resource.sql new file mode 100644 index 00000000..7582ee5a --- /dev/null +++ b/scripts/1.2.3/schema/5.alter_resource.sql @@ -0,0 +1,7 @@ +INSERT INTO resource (code, name, parent_resource) VALUES ('VIDEOCENTER', '视频中心', 'ALLSELECT') + +INSERT INTO resource (code, name, parent_resource) VALUES ('ASSESSMANAGE', '考核评分', 'ALLSELECT') + +INSERT INTO resource (code, name, parent_resource) VALUES ('BUILDINGPROJECT', '在建项目', 'ALLSELECT') + +INSERT INTO resource (code, name, parent_resource) VALUES ('WXTODOLIST', '小程序待办事项', 'ALLSELECT') \ No newline at end of file From a8ce30ce74fc04dddfa6fbdc913b23ce820bfbdf Mon Sep 17 00:00:00 2001 From: ww664853070 Date: Thu, 13 Jul 2023 16:31:36 +0800 Subject: [PATCH 3/4] =?UTF-8?q?(*)=E5=B7=B2=E5=8A=9E=E4=BA=8B=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/src/packages/patrol/index.jsx | 65 ++++++++++++++----------- weapp/src/packages/patrolView/index.jsx | 9 ++-- weapp/src/pages/home/index.jsx | 6 +-- weapp/src/pages/user/index.jsx | 4 +- 4 files changed, 46 insertions(+), 38 deletions(-) diff --git a/weapp/src/packages/patrol/index.jsx b/weapp/src/packages/patrol/index.jsx index 859da3ab..afefeb99 100644 --- a/weapp/src/packages/patrol/index.jsx +++ b/weapp/src/packages/patrol/index.jsx @@ -19,9 +19,8 @@ const Index = () => { const isSuperAdmin = userInfo && userInfo.username === 'SuperAdmin' ? true : false const router = useRouter() - const { params: { type, kind, wait } } = router + const { params: { type, kind, wait, handle } } = router const isView = type === 'view' ? true : false - const isPatrol = kind === 'patrol' || kind == 'conserve' ? true : false const isRoad = kind === 'road' ? true : false const isAnomaly = kind === 'anomaly' ? true : false @@ -57,6 +56,7 @@ const Index = () => { const [handleCenter, setHandleCenter] = useState('') const [handlePic, setHandlePic] = useState([]) const [handlePicPn, setHandlePicPn] = useState([]) + const [handleId, setHandleId] = useState([]) const prjType = isAnomaly ? @@ -101,11 +101,10 @@ const Index = () => { checked: false } ]) - useEffect(() => { if (isRoad) { Taro.setNavigationBarTitle({ title: '在建项目' }) - } else if (wait == 'wait') { + } else if (wait == 'wait' || handle == 'handle') { Taro.setNavigationBarTitle({ title: '待办事项' }) } else if (isAnomaly) { Taro.setNavigationBarTitle({ title: '异常反馈' }) @@ -141,6 +140,13 @@ const Index = () => { setConserveBeforePic(data.conserveBeforePic ? data.conserveBeforePic.map(item => ({ url: imgUrl + item })) : []) setConserveUnderwayPic(data.conserveUnderwayPic ? data.conserveUnderwayPic.map(item => ({ url: imgUrl + item })) : []) setConserveAfterPic(data.conserveAfterPic ? data.conserveAfterPic.map(item => ({ url: imgUrl + item })) : []) + setHandleId(data.id) + if (data.handleContent) { + setHandleCenter(data.handleContent) + } + if (data.handlePic.length) { + setHandlePic(data.handlePic) + } } else { Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' }) } @@ -483,6 +489,11 @@ const Index = () => { urls: [file.url] // 需要预览的图片http链接列表 }) } + function handleImgClicks(index, file) { + Taro.previewImage({ + urls: [file] // 需要预览的图片http链接列表 + }) + } useEffect(() => { if (!isView) { let newRoadList = roadList.filter(e => e.routeName.match(road)) @@ -512,15 +523,15 @@ const Index = () => { return } let handlePicList = [] - if(handlePic.length){ - handlePic.forEach(e=>{ + if (handlePic.length) { + handlePic.forEach(e => { handlePicList.push(e.url) }) } let data = { handleContent: str, handlePic: handlePicList, - handleState:'已处理' + handleState: '已处理' } Taro.showModal({ title: '提示', @@ -534,7 +545,7 @@ const Index = () => { Taro.showLoading({ title: '提交中' }) - request.post(postHandle(userInfo.id), data).then(res => { + request.post(postHandle(handleId), data).then(res => { Taro.hideLoading() if (res.statusCode == 200 || res.statusCode == 204) { Taro.showToast({ title: '提交成功', icon: 'none', duration: 1500 }) @@ -545,8 +556,7 @@ const Index = () => { Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' }) } }, err => { - console.log(err); - Taro.showToast({ title: err.message || '请求出错123', icon: 'none' }) + Taro.showToast({ title: err.message || '请求出错', icon: 'none' }) }) } } @@ -856,36 +866,35 @@ const Index = () => { 上报 } { - wait == 'wait' ? + wait == 'wait' || handle == 'handle' ? *处理内容: handleInput(e, 'wait')} - // disabled={isView} + disabled={handle == 'handle' ? true : false} maxLength={50} /> 处理图片: { - // isView ? - // - // {scenePic.map(item => ( - // handleImgClick(undefined, item)} /> - // ))} - // : - = 3 ? false : true} - files={handlePic} - onChange={(files, operationType, index) => handleImgChange(files, operationType, index, 'wait')} - onImageClick={handleImgClick} - /> + handle == 'handle' ? + + {handlePic.map(item => ( + handleImgClicks(undefined, item)} /> + ))} + : + = 3 ? false : true} + files={handlePic} + onChange={(files, operationType, index) => handleImgChange(files, operationType, index, 'wait')} + onImageClick={handleImgClick} + /> } - 提交 + {handle != 'handle' ? 提交 : ''} : '' } diff --git a/weapp/src/packages/patrolView/index.jsx b/weapp/src/packages/patrolView/index.jsx index 46efa25a..86cb0b8f 100644 --- a/weapp/src/packages/patrolView/index.jsx +++ b/weapp/src/packages/patrolView/index.jsx @@ -17,12 +17,13 @@ import conserveActiveIcon from '../../static/img/patrolView/conserve-active.svg' function Index() { const userInfo = Taro.getStorageSync('userInfo') || {}; const router = useRouter() - const { params: { filter, kind } } = router + const { params: { filter, kind, } } = router const isPatrol = kind === 'patrol' || kind == 'conserve' ? true : false const isRoad = kind === 'road' ? true : false const isAnomaly = kind === 'anomaly' ? true : false const isWait = kind === 'wait' ? true : false + const ishandle = kind == 'handle' ? true : false const [reportType, setReportType] = useState(kind || 'patrol') const [datePicker, setDatePicker] = useState('') @@ -73,9 +74,9 @@ function Index() { startTime: datePicker ? datePicker + ' 00:00:00' : '', endTime: datePicker ? datePicker + ' 23:59:59' : '', keyword: filterText, - reportType: isWait ? 'anomaly' : reportType, + reportType: isWait || ishandle ? 'anomaly' : reportType, userId: filter === 'my' ? userInfo.id : '', - handleState: isWait ? '待处理' : '', + handleState: isWait ? '待处理' : ishandle ? '已处理' : '', } request.get(getReportList(), data).then(res => { Taro.hideLoading() @@ -137,7 +138,7 @@ function Index() { } const handleDetail = index => { - Taro.navigateTo({ url: `/packages/patrol/index?type=view&id=${listData[index].id}&kind=${kind == 'wait' ? 'anomaly' : kind}&wait=${kind == 'wait' ? 'wait' : ''}` }) + Taro.navigateTo({ url: `/packages/patrol/index?type=view&id=${listData[index].id}&kind=${kind == 'wait' || kind == 'handle' ? 'anomaly' : kind}&wait=${kind == 'wait' ? 'wait' : ''}&handle=${kind == 'handle' ? 'handle' : ''}` }) } return ( diff --git a/weapp/src/pages/home/index.jsx b/weapp/src/pages/home/index.jsx index 48d397d5..6d62fd8a 100644 --- a/weapp/src/pages/home/index.jsx +++ b/weapp/src/pages/home/index.jsx @@ -103,15 +103,13 @@ const Index = () => { : '' } { - isSuperAdmin || isAdmin ? + judgeRight('WXTODOLIST') ? 待 办 事 项 toPatrolView('wait') - : () => toPatrol('wait') }> - {isSuperAdmin || isAdmin ? '查看' : '填报'} + 查看 : '' } diff --git a/weapp/src/pages/user/index.jsx b/weapp/src/pages/user/index.jsx index 6df2873c..f3e80b0d 100644 --- a/weapp/src/pages/user/index.jsx +++ b/weapp/src/pages/user/index.jsx @@ -112,11 +112,11 @@ const Index = ({ ...props }) => { : '' } { - judgeRight('WXFEEDBACKMANAGE') ? + judgeRight('WXDONELIST') ? toMyReport('handle')}> - {isSuperAdmin || isAdmin ? '已办事项' : '已办事项'} + 已办事项 From df04b75109fa75cedd69e955ca9e62fce1ad98a8 Mon Sep 17 00:00:00 2001 From: zhaobing Date: Thu, 13 Jul 2023 16:39:26 +0800 Subject: [PATCH 4/4] =?UTF-8?q?feat:=E5=88=A0=E9=99=A4=E8=87=AA=E5=B7=B1?= =?UTF-8?q?=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/client/src/layout/components/header/index.js | 2 +- .../src/sections/organization/containers/user.js | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/web/client/src/layout/components/header/index.js b/web/client/src/layout/components/header/index.js index 066188d8..35b5a83b 100644 --- a/web/client/src/layout/components/header/index.js +++ b/web/client/src/layout/components/header/index.js @@ -66,7 +66,7 @@ const Header = props => { > -
{user.name}
+
{user?.name}
} > {/* }> diff --git a/web/client/src/sections/organization/containers/user.js b/web/client/src/sections/organization/containers/user.js index c89563e2..e2c93dd0 100644 --- a/web/client/src/sections/organization/containers/user.js +++ b/web/client/src/sections/organization/containers/user.js @@ -13,7 +13,7 @@ import DepModal from '../components/depModal'; const TreeNode = Tree.TreeNode; const UserManage = (props) => { - const { dispatch, loading, depMessage, depUser, clientHeight, user } = props + const { dispatch, loading, depMessage, depUser, clientHeight, user, actions } = props const [modalVisible, setModalVisible] = useState(false); const [modalType, setModalType] = useState(); const [modalRecord, setModalRecord] = useState(); @@ -27,7 +27,7 @@ const UserManage = (props) => { const [depCrumbs, setDepCrumbs] = useState([]); const [depUserCopy, setDepUserCopy] = useState([])//用于存放除了自己的管理的数组,即自己不能调整自己是否为管理员 const [uid, setuid] = useState() - const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'USERMANAGE')[0].isshow === "true" ? true : '')//控制操作(新增删除等操作,对应权限的'不可编辑')是否可操作 + const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.find(i => i.resourceId === 'USERMANAGE')?.isshow === "true" ? true : '')//控制操作(新增删除等操作,对应权限的'不可编辑')是否可操作 const [depMessagedata, setdepMessagedata] = useState(depMessage) //('depMessagedata', depMessagedata) useEffect(async () => { @@ -87,6 +87,14 @@ const UserManage = (props) => { setDepCrumbs(list) }, [depSelectedKeys]) + //删除自己退出登录 + const conFirmHandler = (record) => { + delUsers([record.id]) + if (user?.id === record.id) { + dispatch(actions.auth.logout(user)); + history.push(`/signin`); + } + } const columns = [ { @@ -140,9 +148,7 @@ const UserManage = (props) => { , { - delUsers([record.id]) - }} + onConfirm={() => { conFirmHandler(record) }} disabled={editAble} >