Browse Source

feat:异常反馈等四个模块权限调整+在建项目的创建

dev
zhaobing 1 year ago
parent
commit
ce7cb04b93
  1. 8
      api/.vscode/launch.json
  2. 14
      web/client/src/sections/fillion/components/bridgeTable.js
  3. 244
      web/client/src/sections/fillion/components/maintenanceTable.js
  4. 290
      web/client/src/sections/fillion/components/patrolTable.js
  5. 15
      web/client/src/sections/fillion/components/transportationTable.js
  6. 41
      web/client/src/sections/fillion/containers/building.js
  7. 8
      web/client/src/sections/fillion/containers/index.js
  8. 20
      web/client/src/sections/fillion/nav-item.js
  9. 12
      web/client/src/sections/fillion/routes.js
  10. 2
      web/package-lock.json
  11. 4
      web/package.json

8
api/.vscode/launch.json

@ -13,10 +13,10 @@
"NODE_ENV": "development"
},
"args": [
"-p 13400",
"-f http://localhost:13400",
// "-g postgres://postgres:123@10.8.30.32:5432/highways4good",
"-g postgres://FashionAdmin:123456@10.8.30.156:5432/highway4goodn0728",
"-p 13401",
"-f http://localhost:13401",
"-g postgres://postgres:123@10.8.30.32:5432/highways4good",
//"-g postgres://FashionAdmin:123456@10.8.30.156:5432/highway4goodn0728",
"--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5",
"--qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa",
"--qnbkt dev-highways4good",

14
web/client/src/sections/fillion/components/bridgeTable.js

@ -1774,13 +1774,13 @@ const BrideTable = (props) => {
setDifferentiate('bridge')
}}>桥梁{activeKey === 'tab1'}</span>,
},
{
key: 'tab2',
label: <span onClick={() => {
setWhichofits('gongcheng')
setDifferentiate('project')
}}>工程一览{activeKey === 'tab2'}</span>,
},
// {
// key: 'tab2',
// label: <span onClick={() => {
// setWhichofits('gongcheng')
// setDifferentiate('project')
// }}>工程一览{activeKey === 'tab2'}</span>,
// },
],
},

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

@ -224,94 +224,81 @@ const DetailList = (props) => {
const PatrolNameList = (props) => {
const { Search } = Input;
const [users, setUsers] = useState([]);
const { onChange, record, userList, loading, depMessage, depUser, clientHeight, dispatch } = props;
const { onChange, record, userList, loading, depMessage, depUser, clientHeight, dispatch, user } = props;
const [selectRoad, setSelectRoad] = useState();
const [selectedTree, setSelectedTree] = useState();
const [depSelectedKeys, setDepSelectedKeys] = useState([])
const [depAllUser, setDepAllUser] = useState([])
const [depMessagedata, setdepMessagedata] = useState(depMessage)
//const [depMessagedata, setdepMessagedata] = useState()//侧边栏的展示数据
const [expandedKeys, setExpandedKeys] = useState([]);
const [searchValue, setSearchValue] = useState('');
const [autoExpandParent, setAutoExpandParent] = useState(true);
//const [departments, setDepartments] = useState([])
// useEffect(() => {
// if (depAllUser && depAllUser.length > 0) {
// depAllUser.map((item) => {
// item.expanded = false
// departments.push(item)
// })
// }
// console.log('departments1', departments)
// }, [depAllUser])
const departments = [
{
id: 1,
name: '部门A',
users: [{ id: 1, name: '癌病' }, { id: 2, name: 'zjah' }],
expanded: true, // 初始状态展开
},
{
id: 2,
name: '部门B',
users: [{ id: 3, name: '癌病' }, { id: 4, name: 'zjah' }],
expanded: false, // 初始状态折叠
},
];
const defaultData = [];
const generateData = (data, _preKey, _tns) => {
const preKey = _preKey || '0';
const tns = _tns || defaultData;
const children = [];
data.forEach(department => {
const key = `${preKey}-${department.id}`;
const node = {
title: department.name,
key,
children: [],
};
console.log('lenght', department)
if (department.users.length > 0) { // 仅当部门有用户时添加子节点
department.users.forEach(user => {
node.children.push({
title: user.name,
key: `${key}-${user.id}`,
isLeaf: true, // 用户节点为叶子节点
});
});
}
const [defaultData, setDefaultData] = useState([]);
const [dataList, setDataList] = useState([]);
console.log('record', record)
useEffect(() => {
let departments = []
const generateData = (data, _preKey, _tns) => {
const preKey = _preKey || '0';
const tns = _tns || [];
const children = [];
data.forEach(department => {
const key = `${preKey}-${department.depId}`;
const node = {
title: department.depName.toString(),
key,
children: [],
};
if (department.children && department.children.length > 0) {
node.children = generateData(department.children, key, node.children);
}
if (department.users.length > 0) { // 仅当部门有用户时添加子节点
department.users.forEach(user => {
node.children.push({
title: user.name.toString(),
key: `${key}-${user.id}`,
isLeaf: true, // 用户节点为叶子节点
});
});
}
tns.push(node);
if (node.children.length > 0 && department.expanded) { // 仅当部门展开时添加子节点
children.push(key);
}
});
if (department.children && department.children.length > 0) {
const childKeys = generateData(department.children, key, node.children);
children.push(...childKeys);
}
return children;
};
console.log(depAllUser, 'sssllg')
generateData(depAllUser);
const dataList = [];
const generateList = (data) => {
for (let i = 0; i < data.length; i++) {
const item = data[i];
const { key, title } = item;
dataList.push({
key,
title,
tns.push(node);
if (node.children.length > 0 && department.expanded) { // 仅当部门展开时添加子节点
children.push(key);
}
});
if (item.children && item.children.length > 0) {
generateList(item.children);
}
return children;
};
if (user?.username === 'SuperAdmin') {
departments = [...new Set(depAllUser)]
} else {
let depAllUserCopy = []
depAllUser.map((item) => {
if (item.depId === user?.departmentId) {
depAllUserCopy.push(item)
}
})
departments = [...new Set(depAllUserCopy)]
}
};
generateList(defaultData);
const processedData = [];
const expandedKeys = generateData(departments, null, processedData);
setDefaultData(processedData);
setDataList(processedData.map(item => ({ key: item.key, title: item.title.toString(), children: item.children })));
setExpandedKeys(expandedKeys);
}, [depAllUser])
useEffect(() => {
dispatch(getAllDepUsers()).then((res) => {
if (res.success) setDepAllUser(res?.payload?.data)
})
}, [])
const getParentKey = (key, tree) => {
let parentKey;
for (let i = 0; i < tree.length; i++) {
@ -319,24 +306,40 @@ const PatrolNameList = (props) => {
if (node.children) {
if (node.children.some((item) => item.key === key)) {
parentKey = node.key;
} else if (getParentKey(key, node.children)) {
} else {
parentKey = getParentKey(key, node.children);
}
}
if (parentKey) {
break;
}
}
return parentKey;
};
const handleSearch = (value) => {
const expandedKeys = dataList
.map((item) => {
const filteredKeys = [];
const expandedKeys = [];
const loopTreeData = (data) => {
data.forEach((item) => {
if (item.title.indexOf(value) > -1) {
return getParentKey(item.key, defaultData);
filteredKeys.push(item.key);
let parentKey = getParentKey(item.key, defaultData);
while (parentKey) {
if (!expandedKeys.includes(parentKey)) {
expandedKeys.push(parentKey);
}
parentKey = getParentKey(parentKey, defaultData);
}
}
return null;
})
.filter((item, i, self) => item && self.indexOf(item) === i);
if (item.children) {
loopTreeData(item.children);
}
});
};
loopTreeData(defaultData);
setSearchValue(value);
setExpandedKeys(expandedKeys);
};
@ -344,6 +347,27 @@ const PatrolNameList = (props) => {
const handleExpand = (expandedKeys) => {
setExpandedKeys(expandedKeys);
};
const renderTreeNodes = (data) => {
return data.map((item) => {
const { key, title, children } = item;
const isLeaf = !children || children.length === 0;
return (
<Tree.TreeNode
key={key}
title={title}
icon={isLeaf ? null : (
expandedKeys.includes(key) ? <CaretDownOutlined /> : <CaretRightOutlined />
)}
isLeaf={isLeaf}
>
{children && children.length > 0 && renderTreeNodes(children)}
</Tree.TreeNode>
);
});
};
const treeData = useMemo(() => {
const loop = (data) =>
data.map((item) => {
@ -377,39 +401,52 @@ const PatrolNameList = (props) => {
});
return loop(defaultData);
}, [searchValue]);
}, [searchValue, defaultData]);
useEffect(() => {
if (userList && userList instanceof Array && userList.length) {
setSelectRoad(userList[0].id)
// onChange(userList[0]);
}
}, [userList])
useEffect(() => {
dispatch(getAllDepUsers()).then((res) => {
if (res.success) setDepAllUser(res?.payload?.data)
})
}, [])
useEffect(() => {
if (userList && userList instanceof Array) {
let users = userList.filter(user => user.remark != 'sp');
setUsers(users);
}
}, [userList])
const handleSelect = (selectedKeys, { selected, selectedNodes, node }) => {
if (selected) {
if (selectedKeys[0].split("-").length - 1 >= 2) {
let id = selectedKeys[0].split('-')[selectedKeys[0].split('-').length - 1]
console.log('id', id)
onChange(id);
}
}
console.log('selectedKeys', selectedKeys, selected, selectedNodes, node)
};
if (loading) {
return <div>Loading...</div>
}
return (
<div className='spilce'>
<div className='spilce' style={{ height: '600px', width: '100%', overflow: 'auto' }} >
<Search
placeholder="搜索"
placeholder="请输入养护人名称"
value={searchValue}
onChange={(e) => handleSearch(e.target.value)}
/>
{depAllUser.length > 0 && depAllUser && (
<Tree expandedKeys={expandedKeys} onExpand={handleExpand} treeData={treeData}>
</Tree>
)}
<Tree
expandedKeys={expandedKeys}
onExpand={handleExpand}
autoExpandParent={autoExpandParent}
onSelect={handleSelect}
>
{renderTreeNodes(treeData)}
</Tree>
</div>
);
@ -419,7 +456,7 @@ const PatrolNameList = (props) => {
const MaintenanceTable = (props) => {
const { userList, user, reportList, dispatch, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports, depMessage, depUser, clientHeight } = props;
const [record, setRecord] = useState();
const [record, setRecord] = useState(1);
const [dateRange, setDateRange] = useState();
const [detailVisible, setDetailVisible] = useState(false)
@ -443,8 +480,19 @@ const MaintenanceTable = (props) => {
}, [record, dateRange])
const queryData = () => {
let userId = null
if (user?.username === 'SuperAdmin' && record === 1) {
userId = undefined
} else if (user?.username === 'SuperAdmin' && record !== 1) {
userId = record
} else if (user?.username !== 'SuperAdmin' && record === 1) {
userId = user?.id
} else if (user?.username !== 'SuperAdmin' && record !== 1) {
userId = record
}
//: user?.username === 'SuperAdmin' && record === 1 ? record?.id : record ? record : user?.id
let query = {
userId: record?.id,
userId,
reportType: 'conserve',
asc: true
}
@ -482,7 +530,7 @@ const MaintenanceTable = (props) => {
<div className='card-protable'>
<Card >
<PatrolNameList
depMessage={depMessage} depUser={depUser} clientHeight={clientHeight} dispatch={dispatch}
depMessage={depMessage} depUser={depUser} clientHeight={clientHeight} dispatch={dispatch} user={user}
onChange={(record) => setRecord(record)} record={record} userList={userList} loading={userLoading} handelRefresh={handelRefresh} />
</Card>
<Card style={{ flex: 1 }} >

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

@ -1,9 +1,11 @@
import { connect } from 'react-redux';
import './protable.less'
import { Card, Button, Popconfirm, Badge, Col, Row, DatePicker, Input, Modal, Spin, Image, message, Popover, Select } from 'antd';
import { Card, Button, Popconfirm, Badge, Col, Row, DatePicker, Input, Modal, Spin, Image, message, Popover, Select, Tree } from 'antd';
import ProTable from '@ant-design/pro-table';
import { DownOutlined, RightOutlined, CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons';
import { getReportList, getReportDetail, handleReport } from '../actions/patrol';
import React, { useEffect, useState } from 'react';
import React, { useEffect, useState, useMemo } from 'react';
import { getAllDepUsers } from '../actions/allDepUsers'
import { httpDel } from '@peace/utils'
import { PinyinHelper } from '@peace/utils';
import PatrolGis from './gis/patrolGis';
@ -302,14 +304,198 @@ const DetailList = (props) => {
const PatrolNameList = (props) => {
const { Search } = Input;
const [users, setUsers] = useState([]);
const { onChange, record, userList, loading, activeTabKey1 } = props;
const { onChange, record, userList, loading, activeTabKey1, dispatch, user } = props;
const [selectRoad, setSelectRoad] = useState();
const [defaultData, setDefaultData] = useState([]);
const [expandedKeys, setExpandedKeys] = useState([]);
const [searchValue, setSearchValue] = useState('');
const [depAllUser, setDepAllUser] = useState([])
const [dataList, setDataList] = useState([]);
useEffect(() => {
let departments = []
const generateData = (data, _preKey, _tns) => {
const preKey = _preKey || '0';
const tns = _tns || [];
const children = [];
data.forEach(department => {
const key = `${preKey}-${department.depId}`;
const node = {
title: department.depName.toString(),
key,
children: [],
};
if (department.users.length > 0) { // 仅当部门有用户时添加子节点
department.users.forEach(user => {
node.children.push({
title: user.name.toString(),
key: `${key}-${user.id}`,
isLeaf: true, // 用户节点为叶子节点
});
});
}
if (department.children && department.children.length > 0) {
const childKeys = generateData(department.children, key, node.children);
children.push(...childKeys);
}
tns.push(node);
if (node.children.length > 0 && department.expanded) { // 仅当部门展开时添加子节点
children.push(key);
}
});
return children;
};
if (user?.username === 'SuperAdmin') {
departments = [...new Set(depAllUser)]
} else {
let depAllUserCopy = []
depAllUser.map((item) => {
if (item.depId === user?.departmentId) {
depAllUserCopy.push(item)
}
})
departments = [...new Set(depAllUserCopy)]
}
const processedData = [];
const expandedKeys = generateData(departments, null, processedData);
setDefaultData(processedData);
setDataList(processedData.map(item => ({ key: item.key, title: item.title.toString(), children: item.children })));
setExpandedKeys(expandedKeys);
}, [depAllUser])
useEffect(() => {
dispatch(getAllDepUsers()).then((res) => {
if (res.success) setDepAllUser(res?.payload?.data)
})
}, [])
const getParentKey = (key, tree) => {
let parentKey;
for (let i = 0; i < tree.length; i++) {
const node = tree[i];
if (node.children) {
if (node.children.some((item) => item.key === key)) {
parentKey = node.key;
} else {
parentKey = getParentKey(key, node.children);
}
}
if (parentKey) {
break;
}
}
return parentKey;
};
const handleSearch = (value) => {
const filteredKeys = [];
const expandedKeys = [];
const loopTreeData = (data) => {
data.forEach((item) => {
if (item.title.indexOf(value) > -1) {
filteredKeys.push(item.key);
let parentKey = getParentKey(item.key, defaultData);
while (parentKey) {
if (!expandedKeys.includes(parentKey)) {
expandedKeys.push(parentKey);
}
parentKey = getParentKey(parentKey, defaultData);
}
}
if (item.children) {
loopTreeData(item.children);
}
});
};
loopTreeData(defaultData);
setSearchValue(value);
setExpandedKeys(expandedKeys);
};
const handleExpand = (expandedKeys) => {
setExpandedKeys(expandedKeys);
};
const renderTreeNodes = (data) => {
return data.map((item) => {
const { key, title, children } = item;
const isLeaf = !children || children.length === 0;
return (
<Tree.TreeNode
key={key}
title={title}
icon={isLeaf ? null : (
expandedKeys.includes(key) ? <CaretDownOutlined /> : <CaretRightOutlined />
)}
isLeaf={isLeaf}
>
{children && children.length > 0 && renderTreeNodes(children)}
</Tree.TreeNode>
);
});
};
const treeData = useMemo(() => {
const loop = (data) =>
data.map((item) => {
const { title, key, children } = item;
const strTitle = title.toString();
const index = strTitle.indexOf(searchValue);
const beforeStr = strTitle.substring(0, index);
const afterStr = strTitle.slice(index + searchValue.length);
const titleNode = index > -1 ? (
<span>
{beforeStr}
<span style={{ color: '#f50' }}>{searchValue}</span>
{afterStr}
</span>
) : (
<span>{strTitle}</span>
);
if (children && children.length > 0) {
return {
title: titleNode,
key,
children: loop(children),
};
}
return {
title: titleNode,
key,
};
});
return loop(defaultData);
}, [searchValue, defaultData]);
const handleSelect = (selectedKeys, { selected, selectedNodes, node }) => {
if (selected) {
if (selectedKeys[0].split("-").length - 1 >= 2) {
let id = selectedKeys[0].split('-')[selectedKeys[0].split('-').length - 1]
console.log('id1', id)
onChange(id);
}
}
console.log('selectedKeys', selectedKeys, selected, selectedNodes, node)
};
useEffect(() => {
if (userList && userList instanceof Array && userList.length) {
// setSelectRoad(userList[0].id)
setSelectRoad(userList[0].id)
// onChange(userList[0]);
}
if (activeTabKey1 == 'tab2') {
@ -318,38 +504,38 @@ const PatrolNameList = (props) => {
}, [userList, activeTabKey1])
const columns = [
{
title: '巡查人员',
key: 'name',
dataIndex: 'name',
align: 'center'
},
];
useEffect(() => {
if (userList) {
setUsers(userList)
}
}, [userList])
var timer = null;
const doUserNameSearch = (e) => {
const name = e.target.value;
if (timer) {
clearTimeout(timer)
} else {
setTimeout(() => {
let users = userList.filter(user => PinyinHelper.isSearchMatched(user.name, name));
setUsers(users);
}, 500);
}
if (loading) {
return <div>Loading...</div>
}
return (
<div className='spilce'>
<ProTable
<div className='spilce' style={{ height: '600px', width: '100%', overflow: 'auto' }} >
<Search
placeholder="请输入巡查人名称"
value={searchValue}
onChange={(e) => handleSearch(e.target.value)}
/>
<Tree
expandedKeys={expandedKeys}
onExpand={handleExpand}
onSelect={handleSelect}
>
{renderTreeNodes(treeData)}
</Tree>
</div>
{/* <ProTable
columns={columns}
dataSource={users}
loading={loading}
@ -377,7 +563,9 @@ const PatrolNameList = (props) => {
},
};
}}
/></div>
/>
*/}
</div>
);
};
@ -385,8 +573,8 @@ const PatrolNameList = (props) => {
const PatrolTable = (props) => {
const { user, userList, reportList, dispatch, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports, pathname } = props;
const [record, setRecord] = useState();
const { clientHeight, user, userList, reportList, dispatch, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports, pathname } = props;
const [record, setRecord] = useState(1);
const [dateRange, setDateRange] = useState();
const [selectProjectType, setSelectProjectType] = useState('');
const [detailVisible, setDetailVisible] = useState(false)
@ -413,7 +601,23 @@ const PatrolTable = (props) => {
}, [record, dateRange, selectProjectType])
const queryData = () => {
let query = { userId: record?.id, reportType: reportType, projectType: selectProjectType, asc: true }
console.log(record, 'idididid')
let userId = null
if (user?.username === 'SuperAdmin' && record === 1) {
userId = undefined
} else if (user?.username === 'SuperAdmin' && record !== 1) {
userId = record
} else if (user?.username !== 'SuperAdmin' && record === 1) {
userId = user?.id
} else if (user?.username !== 'SuperAdmin' && record !== 1) {
userId = record
}
// user?.username === 'SuperAdmin' && record === 1 ? record?.id : record ? record : user?.id,
let query = {
userId,
reportType: reportType, projectType: selectProjectType, asc: true
}
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')
@ -468,13 +672,13 @@ const PatrolTable = (props) => {
setActiveTabKey1(key);
};
const handleChangeRecord = (newRecord) => {
let target = null;
if (!record || (newRecord && newRecord.id != record.id)) {
target = newRecord;
}
setRecord(target);
}
// const handleChangeRecord = (newRecord) => {
// let target = null;
// if (!record || (newRecord && newRecord.id != record.id)) {
// target = newRecord;
// }
// setRecord(target);
// }
const handleExport = () => {
if (reportList && reportList instanceof Array && reportList.length) {
@ -487,7 +691,9 @@ const PatrolTable = (props) => {
<div className='card-protable'>
<Card >
<PatrolNameList
onChange={(record) => handleChangeRecord(record)}
clientHeight={clientHeight} user={user}
dispatch={dispatch}
onChange={(record) => setRecord(record)}
record={record}
activeTabKey1={activeTabKey1}
userList={userList}
@ -542,8 +748,8 @@ const PatrolTable = (props) => {
);
};
function mapStateToProps (state) {
const { auth, depMessage, userList, reportList, reportDetail } = state;
function mapStateToProps(state) {
const { auth, depMessage, userList, reportList, reportDetail, global } = state;
const pakData = (dep) => {
return dep.map((d) => {
return {
@ -565,6 +771,8 @@ function mapStateToProps (state) {
reportListLoading: reportList.isRequesting,
reportDetail: reportDetail.data,
reportDetailLoading: reportDetail.isRequesting,
clientHeight: global.clientHeight,
};
}
export default connect(mapStateToProps)(PatrolTable);

15
web/client/src/sections/fillion/components/transportationTable.js

@ -3780,14 +3780,15 @@ const TransporTationTable = (props) => {
setGrade('村')
}}>村道{activeKey === 'tab3'}</span>,
}, {
key: 'tab4',
label: <span onClick={() => {
setWhichofits('gongcheng')
setDifferentiate('project')
}}>工程一览{activeKey === 'tab4'}</span>,
},
// {
// key: 'tab4',
// label: <span onClick={() => {
// setWhichofits('gongcheng')
// setDifferentiate('project')
// }}>工程一览{activeKey === 'tab4'}</span>,
// },
],
},
}}

41
web/client/src/sections/fillion/containers/building.js

@ -0,0 +1,41 @@
'use strict';
import React, { useState, useEffect } from 'react';
import { connect } from 'react-redux';
// import { Spin, Button, Popconfirm } from 'antd';
// import ProTable from '@ant-design/pro-table';
// //import './protable.less'
import moment from 'moment';
// import { getRoadway, getProject, delRoadway, delProject } from "../actions/infor"
// import UserModal from './infor/details';
// import ProjectModal from './project/project';
const Building = (props) => {
return (
<div>
hha
</div>
)
}
function mapStateToProps(state) {
const { auth, depMessage } = state;
// const pakData = (dep) => {
// return dep.map((d) => {
// return {
// title: d.name,
// value: d.id,
// // children: d.type >= 2 ? [] : pakData(d.subordinate)
// children: pakData(d.subordinate)
// }
// })
// }
// let depData = pakData(depMessage.data || [])
return {
user: auth.user,
// depMessage: depMessage.data || [],
// depLoading: depMessage.isRequesting,
// depData,
};
}
export default connect(mapStateToProps)(Building);

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

@ -16,4 +16,10 @@ import Jiekouguanli from './jiekouguanli';
import Task from './task'
import Assess from './assess'
import VideoCenter from './videoCenter';
export { Infor, transportation, BridgeTable, HigHways, OperaTional, Enforce, Public, Videois, PromoTional, Maintenance, Patrol, File, Jiekouguanli, Task, Assess, VideoCenter };
import Building from './building'
export {
Infor, transportation, BridgeTable, HigHways,
OperaTional, Enforce, Public, Videois, PromoTional,
Maintenance, Patrol, File, Jiekouguanli,
Task, Building, Assess, VideoCenter
};

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

@ -3,7 +3,7 @@ import { Link } from 'react-router-dom';
import { Menu } from 'antd';
import { ReadOutlined } from '@ant-design/icons';
const SubMenu = Menu.SubMenu;
export function getNavItem (user, dispatch) {
export function getNavItem(user, dispatch) {
const isshow = user?.userResources?.
filter(i => i.resourceId === 'OVERLOADMANAGE' ||
i.resourceId === 'ROADMANAGE' ||
@ -26,8 +26,8 @@ export function getNavItem (user, dispatch) {
<Link to="/fillion/infor">治超管理</Link>
</Menu.Item> : ''}
{/* <Menu.Item key="filliontask">
<Link to="/fillion/task">任务管理</Link>
</Menu.Item> */}
<Link to="/fillion/task">任务管理</Link>
</Menu.Item> */}
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'ROADMANAGE')?.length !== 0 ?
<Menu.Item key="filliontransportation">
<Link to="/fillion/transportation">道路管理</Link>
@ -55,6 +55,16 @@ export function getNavItem (user, dispatch) {
<Menu.Item key="fillionpatrol">
<Link to="/fillion/patrol">巡查管理</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'FEEDBACKMANAGE')?.length !== 0 ?
<Menu.Item key="fillionpatrolanomaly">
<Link to="/fillion/patrol_anomaly">异常反馈</Link>
</Menu.Item> : ''}
{/* {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'FEEDBACKMANAGE')?.length !== 0 ?
: ''} */}
<Menu.Item key="fillionbuilding">
<Link to="/fillion/building">在建项目</Link>
</Menu.Item>
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'PUBLICTRANSPORTMANAGE')?.length !== 0 ?
<Menu.Item key="fillionpublic">
<Link to="/fillion/public">公交管理</Link>
@ -74,11 +84,7 @@ export function getNavItem (user, dispatch) {
<Menu.Item key="fillionpromotional">
<Link to="/fillion/promotional">宣传视频</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'FEEDBACKMANAGE')?.length !== 0 ?
<Menu.Item key="fillionpatrolanomaly">
<Link to="/fillion/patrol_anomaly">异常反馈</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'REPORTMANAGE')?.length !== 0 ?
<Menu.Item key="fillionpatrolroad">

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

@ -12,7 +12,8 @@ import { Maintenance } from './containers'
import { Patrol } from './containers'
import { File } from './containers';
import { Jiekouguanli } from './containers'
import { Task, Assess, VideoCenter } from './containers'
import { Task, Assess, VideoCenter, } from './containers'
import { Building } from './containers'
export default [{
type: 'inner',
@ -44,6 +45,15 @@ export default [{
breadcrumb: '道路管理',
authCode: 'ROADMANAGE'
},
{
path: '/building',
key: 'fillionbuilding',
menuSelectKeys: ['fillionbuilding'],
component: Building,
breadcrumb: '在建项目',
//authCode: 'ROADMANAGE'
}
, {
path: '/bridge',

2
web/package-lock.json

@ -7519,7 +7519,7 @@
},
"lodash": {
"version": "4.17.21",
"resolved": "http://npm.anxinyun.cn/lodash/-/lodash-4.17.21.tgz",
"resolved": "http://10.8.30.22:7000/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"lodash-es": {

4
web/package.json

@ -6,7 +6,11 @@
"scripts": {
"test": "mocha",
"start": "cross-env NODE_ENV=development npm run start-params",
<<<<<<< Updated upstream
"start-params": "node server -p 5000 -u http://localhost:13400 --qndmn http://rfkimpwbb.hn-bkt.clouddn.com --vcmpWebUrl https://mediaconsole.ngaiot.com --vcmpMirrorId 24461524032354",
=======
"start-params": "node server -p 5000 -u http://localhost:13401 --qndmn http://rfkimpwbb.hn-bkt.clouddn.com --vcmpWebUrl https://mediaconsole.ngaiot.com --vcmpMirrorId 24461524032354",
>>>>>>> Stashed changes
"deploy": "export NODE_ENV=production&&npm run color && npm run build && node server",
"build-dev": "export NODE_ENV=development&&webpack --config webpack.config.js",
"build": "export NODE_ENV=production&&webpack --config webpack.config.prod.js",

Loading…
Cancel
Save