巴林闲侠 2 years ago
parent
commit
9c023eb0d9
  1. 2
      api/app/lib/controllers/report/index.js
  2. 6
      api/app/lib/routes/data/index.js
  3. 2
      api/sequelize-automate.config.js
  4. 7
      scripts/1.2.3/schema/5.alter_resource.sql
  5. 43
      weapp/src/packages/patrol/index.jsx
  6. 9
      weapp/src/packages/patrolView/index.jsx
  7. 6
      weapp/src/pages/home/index.jsx
  8. 4
      weapp/src/pages/user/index.jsx
  9. 2
      web/client/src/layout/components/header/index.js
  10. 2
      web/client/src/layout/index.js
  11. 6
      web/client/src/sections/auth/containers/login.js
  12. 6
      web/client/src/sections/fillion/components/buildingTable.js
  13. 2
      web/client/src/sections/fillion/components/datajuji.js
  14. 2
      web/client/src/sections/fillion/components/editGuanlang.js
  15. 40
      web/client/src/sections/fillion/components/feedback/nominateModal.js
  16. 2
      web/client/src/sections/fillion/components/highwaysTable.js
  17. 10
      web/client/src/sections/fillion/components/maintenanceTable.js
  18. 2
      web/client/src/sections/fillion/components/operationalTable.js
  19. 29
      web/client/src/sections/fillion/components/patrolTable.js
  20. 2
      web/client/src/sections/fillion/components/project/project.js
  21. 4
      web/client/src/sections/fillion/components/transportationTable.js
  22. 8
      web/client/src/sections/fillion/containers/assess.js
  23. 2
      web/client/src/sections/fillion/containers/building.js
  24. 2
      web/client/src/sections/fillion/containers/highways.js
  25. 2
      web/client/src/sections/fillion/containers/task.js
  26. 2
      web/client/src/sections/fillion/containers/transportation.js
  27. 47
      web/client/src/sections/fillion/nav-item.js
  28. 5
      web/client/src/sections/fillion/routes.js
  29. 13
      web/client/src/sections/organization/containers/authority.js
  30. 45
      web/client/src/sections/organization/containers/user.js
  31. 6
      web/client/src/sections/organization/nav-item.js

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

@ -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']

6
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) {
// 数据导出
@ -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
};

2
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_',] ,长度较长的 前缀放前面

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

43
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))
@ -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,26 +866,25 @@ const Index = () => {
<AtButton type='primary' className='sub-btn' onClick={report}>上报</AtButton>
}
{
wait == 'wait' ? <view>
wait == 'wait' || handle == 'handle' ? <view>
<view className='patrol-img'><text style={{ color: 'red' }}>*</text>处理内容</view>
<AtTextarea
title='处理内容:'
// placeholder={isView ? '' : ''}
placeholder='请输入处理内容'
value={handleCenter}
onChange={(v, e) => handleInput(e, 'wait')}
// disabled={isView}
disabled={handle == 'handle' ? true : false}
maxLength={50}
/>
<View className='patrol-img'>
处理图片
{
// isView ?
// <View className='img-box'>
// {scenePic.map(item => (
// <Image className='img' src={item.url} onClick={() => handleImgClick(undefined, item)} />
// ))}
// </View> :
handle == 'handle' ?
<View className='img-box'>
{handlePic.map(item => (
<Image className='img' src={item} onClick={() => handleImgClicks(undefined, item)} />
))}
</View> :
<AtImagePicker
className='img-picker'
count={3 - handlePic.length}
@ -885,7 +894,7 @@ const Index = () => {
onImageClick={handleImgClick}
/>
}
<AtButton type='primary' className='sub-btn' onClick={handleOk}>提交</AtButton>
{handle != 'handle' ? <AtButton type='primary' className='sub-btn' onClick={handleOk}>提交</AtButton> : ''}
</View>
</view> : ''
}

9
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 (

6
weapp/src/pages/home/index.jsx

@ -103,15 +103,13 @@ const Index = () => {
</View> : ''
}
{
isSuperAdmin || isAdmin ?
judgeRight('WXTODOLIST') ?
<View className='card fill_wait'>
<View className='title'> </View>
<View className='btn' onClick={
isSuperAdmin || isAdmin ?
() => toPatrolView('wait')
: () => toPatrol('wait')
}>
{isSuperAdmin || isAdmin ? '查看' : '填报'}
查看
</View>
</View> : ''
}

4
weapp/src/pages/user/index.jsx

@ -112,11 +112,11 @@ const Index = ({ ...props }) => {
: ''
}
{
judgeRight('WXFEEDBACKMANAGE') ?
judgeRight('WXDONELIST') ?
<View className='box' onClick={() => toMyReport('handle')}>
<Image className='box-img' src={reportImg} />
<View className='box-txt'>
{isSuperAdmin || isAdmin ? '已办事项' : '已办事项'}
已办事项
</View>
<Image className='img' src={moreImg} />
</View>

2
web/client/src/layout/components/header/index.js

@ -66,7 +66,7 @@ const Header = props => {
>
<UserOutlined />
</div>
<div style={{ display: 'inline-block' }}>{user.name}</div>
<div style={{ display: 'inline-block' }}>{user?.name}</div>
</div>}
>
{/* <Menu.Item key="profile" icon={<UserOutlined />}>

2
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;
}

6
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)
}}

6
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

2
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();
}

2
web/client/src/sections/fillion/components/editGuanlang.js

@ -60,7 +60,7 @@ const EditGuanlang = (props) => {
const handleSave = () => {
const data = form.getFieldsValue(true);
console.log(data,'data')
//console.log(data,'data')
handleSaveScore();
}

40
web/client/src/sections/fillion/components/feedback/nominateModal.js

@ -2,40 +2,49 @@
import React, { useState, useEffect, useCallback, useRef } from 'react';
import { connect } from 'react-redux';
import { Spin } from 'antd';
import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect, ProFormSelect } from '@ant-design/pro-form';
import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect, ProFormSelect, Form } from '@ant-design/pro-form';
import { getDepUser } from '../../../organization/actions/user'
import { appointTask } from '../../actions/appointTask'
import { getReportList, } from '../../../fillion/actions/patrol';
import moment from 'moment';
import { v4 as uuidv4 } from 'uuid';
const NominateModal = (props) => {
const { recordId, visible, user, onCancel, depMessage, loading, depUser, clientHeight, depData, onVisibleChange, dispatch } = props
const { queryData, recordId, visible, user, onCancel, depMessage, loading, depUser, clientHeight, depData, onVisibleChange, dispatch } = props
const [depId, setDepId] = useState(null)
const [depUsers, setDepUsers] = useState()
const selectRef = useRef(null);
const formRef = useRef();
const [selectKey, setSelectKey] = useState(0);
const handleTreeSelectChange = async (value) => {
console.log('recordId', recordId)
//console.log('recordId', recordId)
setDepId(value)
// 根据选择的部门ID获取对应的用户数据
setDepUsers(null)
const res = await dispatch(getDepUser(value));
setDepUsers(res?.payload.data);
//setSelectKey(selectKey + 1)
// 清空第二个输入框的值
if (selectRef.current) {
selectRef.current.value = '';
selectRef.current.reset();
}
}
useEffect(() => {
setSelectKey(selectKey + 1)
}, [depUsers])
const handleFinish = async (values) => {
const { name } = values;
// 在这里使用第二个框的值进行网络请求或其他操作
await dispatch(appointTask({ recordId, performerId: name }))
//form.resetFields(); // 重置表单字段
//formRef.current.resetFields();
queryData()
onCancel()
// await dispatch(yourAction(name));
// 其他操作...
// 取消弹窗
onCancel();
};
const dispatchGetDepUser = useCallback(async () => {
if (depId) {
@ -51,15 +60,17 @@ const NominateModal = (props) => {
return (
<Spin spinning={false}>
<ModalForm
ref={formRef}
title='指派'
visible={visible}
onVisibleChange={onVisibleChange}
onFinish={handleFinish}
destroyOnClose
destroyOnClose={true}
initialValues={{ departmentId: null, name: null }}
>
<ProForm.Group>
<ProFormTreeSelect
name={['contract', 'departmentId']}
name={'departmentId'}
placeholder="请选择所属部门"
width="md"
label="所属部门"
@ -70,7 +81,7 @@ const NominateModal = (props) => {
children: 'subordinate'
}}
onSelect={(selectedKeys, { selected, selectedNodes }) => {
console.log('selected', selectedKeys)
//console.log('selected', selectedKeys)
if (selected) {
setDepSelectedKeys(selectedKeys)
@ -92,11 +103,12 @@ const NominateModal = (props) => {
}}
expandedKeys={["title"]}
/>
{depUsers ? <ProFormSelect
{depUsers && depUsers.length ? <ProFormSelect
key={selectKey} // 改变 key 值
ref={selectRef}
value={null} // 设置输入框的值为null
onValuesChange={(values) => { console.log('values1', values) }}
name="name"
//onValuesChange={(values) => { console.log('values1', values) }}
name={'name'}
label="指派人"
request={async () => {
if (depId) {

2
web/client/src/sections/fillion/components/highwaysTable.js

@ -310,7 +310,7 @@ const TransporTationTable = (props) => {
columns={columns[activeKey]}
dataSource={counts || []}
request={async (params) => {
console.log(whichofits)
//console.log(whichofits)
if (whichofits == 'sheshi') {
const query = {
}

10
web/client/src/sections/fillion/components/maintenanceTable.js

@ -158,7 +158,7 @@ const DetailList = (props) => {
align: 'center'
},
{
title: '养护人',
title: '上报人',
width: 100,
key: 'userName',
dataIndex: 'userName',
@ -235,7 +235,7 @@ const PatrolNameList = (props) => {
const [autoExpandParent, setAutoExpandParent] = useState(true);
const [defaultData, setDefaultData] = useState([]);
const [dataList, setDataList] = useState([]);
console.log('record', record)
//console.log('record', record)
useEffect(() => {
let departments = []
const generateData = (data, _preKey, _tns) => {
@ -419,12 +419,12 @@ const PatrolNameList = (props) => {
if (selected) {
if (selectedKeys[0].split("-").length - 1 >= 2) {
let id = selectedKeys[0].split('-')[selectedKeys[0].split('-').length - 1]
console.log('id', id)
//console.log('id', id)
onChange(id);
}
}
console.log('selectedKeys', selectedKeys, selected, selectedNodes, node)
//('selectedKeys', selectedKeys, selected, selectedNodes, node)
};
@ -435,7 +435,7 @@ const PatrolNameList = (props) => {
return (
<div className='spilce' style={{ height: '600px', width: '100%', overflow: 'auto' }} >
<Search
placeholder="请输入养护人名称"
placeholder="请输入养上报人"
value={searchValue}
onChange={(e) => handleSearch(e.target.value)}
/>

2
web/client/src/sections/fillion/components/operationalTable.js

@ -1983,7 +1983,7 @@ const OperaTionalTable = (props) => {
dataSource={counts || []}
request={async (params, sort, filter) => {
console.log(rewkeys)
// console.log(rewkeys)
if (rewkeys == 'keyun') {
const query = {}
setRowSelected([]);

29
web/client/src/sections/fillion/components/patrolTable.js

@ -35,7 +35,7 @@ export const reportTypeText = (text) => {
const DetailForm = (props) => {
const { visible, data, handleClose, loading, isAnomaly, isRoad, isPatrol } = props;
//('record12s', isAnomaly)
const [qndmn] = useState(localStorage.getItem('qndmn'));
const keyList = [
@ -121,6 +121,7 @@ const DetailList = (props) => {
const [noProcessingSelectRecord, setNoProcessingSelectRecord] = useState();
const [vis, setVis] = useState(false)//指派任务的弹窗显示与隐藏
const [recordId, setRecordId] = useState(0)//默认指派任务id
const [btnVis, setBtnVis] = useState(true)//指派按钮和不处理按钮的是否禁用
const checkDetail = (record) => {
dispatch(getReportDetail(record.id))
}
@ -224,7 +225,7 @@ const DetailList = (props) => {
align: 'center'
},
{
title: isRoad ? '上报人' : '巡查人',
title: '上报人',
width: 100,
key: 'userName',
dataIndex: 'userName',
@ -245,15 +246,18 @@ const DetailList = (props) => {
valueType: 'option',
align: 'center',
render: (text, record) => {
//('record12s', record)
return [
<Button
onClick={() => { checkDetail(record); handleOpen(); }}
style={{ marginRight: 10 }}>查看</Button>,
isAnomaly && record.handleState != '已处理' ?
<Button disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'FEEDBACKMANAGE' || 'FEEDBACKMANAGE')[0].isshow === "true" ? true : ''} onClick={() => { setVis(true); setRecordId(record.id) }}>指派</Button> : null,
isAnomaly && record.handleState != '已处理' ?
isAnomaly && record.handleState != '已处理' && record.performerId === null ?
<Button disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'FEEDBACKMANAGE' || 'FEEDBACKMANAGE')[0].isshow === "true" ? true : ''}
onClick={() => { setVis(true); setRecordId(record.id) }}>指派</Button> : null,
isAnomaly && record.handleState != '已处理' && record.performerId === null ?
< Popover
content={[
content={
[
<div style={{ width: '100%', height: 30 }}>
<Button onClick={() => setNoProcessingPopVisible(false)} style={{ float: "right" }} ></Button>
<Button type="primary" onClick={() => dispatch(handleReport(record.id, { handleState: '已处理' })).then(res => {
@ -307,7 +311,7 @@ const DetailList = (props) => {
toolBarRender={false}
search={false}
/>
<NominateModal recordId={recordId} dispatch={dispatch} visible={vis} onCancel={onCancel} onVisibleChange={setVis}></NominateModal>
<NominateModal queryData={queryData} hanldeChange={setBtnVis} recordId={recordId} dispatch={dispatch} visible={vis} onCancel={onCancel} onVisibleChange={setVis}></NominateModal>
</div>
)
};
@ -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) => {
<div className='spilce'>
<div className='spilce' style={{ height: '600px', width: '100%', overflow: 'auto' }} >
<Search
placeholder="请输入巡查人名称"
placeholder="请输入上报人员"
value={searchValue}
onChange={(e) => 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}
/>
</Card>
<Card
style={{ flex: 1 }}

2
web/client/src/sections/fillion/components/project/project.js

@ -19,7 +19,7 @@ const data = {
}
const ProjectModal = (props) => {
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()//处理

4
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', '我我我我吧')

8
web/client/src/sections/fillion/containers/assess.js

@ -33,7 +33,7 @@ function Assess (props) {
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,7 +74,8 @@ function Assess (props) {
</Form.Item>
</Form>
<Button type="primary" onClick={() => {
<Button type="primary" disabled={editAble}
onClick={() => {
setAssessModalVisible(true)
}}>新增</Button>
</div>
@ -110,6 +111,7 @@ function Assess (props) {
<Button type="link" onClick={() => {
setAssessModalVisible(true)
setEditData(record)
disabled = { editAble }
}}>编辑</Button>
<Popconfirm
title="确定删除此条数据吗?"
@ -123,7 +125,7 @@ function Assess (props) {
})
}}
>
<Button type="link" danger>删除</Button>
<Button type="link" danger disabled={editAble}>删除</Button>
</Popconfirm>
</span>
),

2
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(

2
web/client/src/sections/fillion/containers/highways.js

@ -13,7 +13,7 @@ const highways = (props) => {
setData(props)
}, []);
const exports = (ids, counts) => {
console.log(counts);
//console.log(counts);
let idas = ids.toString()
window.open(
'/_api/' + `data/export/?ids=${idas || ''}&exp=${'overspeed'}&token=${user.token}`)

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

2
web/client/src/sections/fillion/containers/transportation.js

@ -14,7 +14,7 @@ const transportation = (props) => {
}, []);
//批量导出
const exports = (ids, grade, differentiate) => {
console.log(differentiate);
//console.log(differentiate);
let idas = ids.toString()
if (differentiate == 'road') {
window.open(

47
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 ?
<SubMenu key="fillion" icon={<ReadOutlined />} title={'数据管理'}>
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'OVERLOADMANAGE')?.length !== 0 ?
{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?.filter(i => i.resourceId === 'ROADMANAGE')?.length !== 0 ?
{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?.filter(i => i.resourceId === 'BRIDGEMANAGE')?.length !== 0 ?
{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?.filter(i => i.resourceId === 'MAINTENANCEMANAGE')?.length !== 0 ?
{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?.filter(i => i.resourceId === 'TRANSPORTATIONMANAGE')?.length !== 0 ?
{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?.filter(i => i.resourceId === 'CONSERVATIONMANAGE')?.length !== 0 ?
{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?.filter(i => i.resourceId === 'PATROLMANAGE')?.length !== 0 ?
{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?.filter(i => i.resourceId === 'FEEDBACKMANAGE')?.length !== 0 ?
{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?.filter(i => i.resourceId === 'REPORTMANAGE')?.length !== 0 ?
{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?.filter(i => i.resourceId === 'FEEDBACKMANAGE')?.length !== 0 ?
: ''} */}
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'BUILDINGPROJECT') ?
<Menu.Item key="fillionbuilding">
<Link to="/fillion/processsing">在建项目</Link>
</Menu.Item>
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'PUBLICTRANSPORTMANAGE')?.length !== 0 ?
</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?.filter(i => i.resourceId === 'FILEMANAGE')?.length !== 0 ?
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'FILEMANAGE') ?
<Menu.Item key="fileCont">
<Link to="/fillion/file">档案管理</Link>
</Menu.Item> : ''}
@ -85,19 +86,19 @@ export function getNavItem(user, dispatch) {
{/* <Menu.Item key="jiekouguanli">
<Link to="/fillion/jiekouguanli">接口管理</Link>
</Menu.Item> */}
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'PUBLICITYVIDEO')?.length !== 0 ?
{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>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'VIDEOCENTER') ?
<Menu.Item key="fillionvideoCenter">
<Link to="/fillion/videoCenter">视频中心</Link>
</Menu.Item>
</Menu.Item> : ''}
</SubMenu> : null
);
}

5
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'
}
]
}

13
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])

45
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,12 +27,12 @@ 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)
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(() => {
@ -86,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 =
[
{
@ -139,9 +148,7 @@ const UserManage = (props) => {
<Button type="link" onClick={() => { openModal('edit', record) }} disabled={editAble}>编辑</Button>,
<Popconfirm
title="确认删除?"
onConfirm={() => {
delUsers([record.id])
}}
onConfirm={() => { conFirmHandler(record) }}
disabled={editAble}
>
<Button type="link" disabled={editAble}>删除</Button>
@ -161,7 +168,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 +233,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 +449,9 @@ function mapStateToProps(state) {
loading: depMessage.isRequesting,
depMessage: depMessage.data || [],
depUser: depUser.data || [],
user: auth.user
user: auth.user,
actions: global.actions
};
}

6
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 ?
<SubMenu key="organization" icon={<SettingOutlined />} 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">
<Link to="/organization/user">用户管理</Link>
</Menu.Item> : ''
}
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'AUTHORIMANAGE')?.length !== 0 ? <Menu.Item key="userAuthority">
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'AUTHORIMANAGE') ? <Menu.Item key="userAuthority">
<Link to="/organization/authority"> 权限管理</Link>
</Menu.Item> : ''}

Loading…
Cancel
Save