Browse Source

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

dev
zhaobing 2 years 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" "NODE_ENV": "development"
}, },
"args": [ "args": [
"-p 13400", "-p 13401",
"-f http://localhost:13400", "-f http://localhost:13401",
// "-g postgres://postgres:123@10.8.30.32:5432/highways4good", "-g postgres://postgres:123@10.8.30.32:5432/highways4good",
"-g postgres://FashionAdmin:123456@10.8.30.156:5432/highway4goodn0728", //"-g postgres://FashionAdmin:123456@10.8.30.156:5432/highway4goodn0728",
"--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5", "--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5",
"--qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa", "--qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa",
"--qnbkt dev-highways4good", "--qnbkt dev-highways4good",

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

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

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

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

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

@ -1,9 +1,11 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import './protable.less' 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 ProTable from '@ant-design/pro-table';
import { DownOutlined, RightOutlined, CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons';
import { getReportList, getReportDetail, handleReport } from '../actions/patrol'; 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 { httpDel } from '@peace/utils'
import { PinyinHelper } from '@peace/utils'; import { PinyinHelper } from '@peace/utils';
import PatrolGis from './gis/patrolGis'; import PatrolGis from './gis/patrolGis';
@ -302,14 +304,198 @@ const DetailList = (props) => {
const PatrolNameList = (props) => { const PatrolNameList = (props) => {
const { Search } = Input;
const [users, setUsers] = useState([]); 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 [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(() => { useEffect(() => {
if (userList && userList instanceof Array && userList.length) { if (userList && userList instanceof Array && userList.length) {
// setSelectRoad(userList[0].id) setSelectRoad(userList[0].id)
// onChange(userList[0]); // onChange(userList[0]);
} }
if (activeTabKey1 == 'tab2') { if (activeTabKey1 == 'tab2') {
@ -318,38 +504,38 @@ const PatrolNameList = (props) => {
}, [userList, activeTabKey1]) }, [userList, activeTabKey1])
const columns = [
{
title: '巡查人员',
key: 'name',
dataIndex: 'name',
align: 'center'
},
];
useEffect(() => { useEffect(() => {
if (userList) { if (userList) {
setUsers(userList) setUsers(userList)
} }
}, [userList]) }, [userList])
var timer = null; if (loading) {
const doUserNameSearch = (e) => { return <div>Loading...</div>
const name = e.target.value;
if (timer) {
clearTimeout(timer)
} else {
setTimeout(() => {
let users = userList.filter(user => PinyinHelper.isSearchMatched(user.name, name));
setUsers(users);
}, 500);
}
} }
return ( return (
<div className='spilce'> <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} columns={columns}
dataSource={users} dataSource={users}
loading={loading} loading={loading}
@ -377,7 +563,9 @@ const PatrolNameList = (props) => {
}, },
}; };
}} }}
/></div> />
*/}
</div>
); );
}; };
@ -385,8 +573,8 @@ const PatrolNameList = (props) => {
const PatrolTable = (props) => { const PatrolTable = (props) => {
const { user, userList, reportList, dispatch, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports, pathname } = props; const { clientHeight, user, userList, reportList, dispatch, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports, pathname } = props;
const [record, setRecord] = useState(); const [record, setRecord] = useState(1);
const [dateRange, setDateRange] = useState(); const [dateRange, setDateRange] = useState();
const [selectProjectType, setSelectProjectType] = useState(''); const [selectProjectType, setSelectProjectType] = useState('');
const [detailVisible, setDetailVisible] = useState(false) const [detailVisible, setDetailVisible] = useState(false)
@ -413,7 +601,23 @@ const PatrolTable = (props) => {
}, [record, dateRange, selectProjectType]) }, [record, dateRange, selectProjectType])
const queryData = () => { 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] != '')) { if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) {
query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss') 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') query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
@ -468,13 +672,13 @@ const PatrolTable = (props) => {
setActiveTabKey1(key); setActiveTabKey1(key);
}; };
const handleChangeRecord = (newRecord) => { // const handleChangeRecord = (newRecord) => {
let target = null; // let target = null;
if (!record || (newRecord && newRecord.id != record.id)) { // if (!record || (newRecord && newRecord.id != record.id)) {
target = newRecord; // target = newRecord;
} // }
setRecord(target); // setRecord(target);
} // }
const handleExport = () => { const handleExport = () => {
if (reportList && reportList instanceof Array && reportList.length) { if (reportList && reportList instanceof Array && reportList.length) {
@ -487,7 +691,9 @@ const PatrolTable = (props) => {
<div className='card-protable'> <div className='card-protable'>
<Card > <Card >
<PatrolNameList <PatrolNameList
onChange={(record) => handleChangeRecord(record)} clientHeight={clientHeight} user={user}
dispatch={dispatch}
onChange={(record) => setRecord(record)}
record={record} record={record}
activeTabKey1={activeTabKey1} activeTabKey1={activeTabKey1}
userList={userList} userList={userList}
@ -542,8 +748,8 @@ const PatrolTable = (props) => {
); );
}; };
function mapStateToProps (state) { function mapStateToProps(state) {
const { auth, depMessage, userList, reportList, reportDetail } = state; const { auth, depMessage, userList, reportList, reportDetail, global } = state;
const pakData = (dep) => { const pakData = (dep) => {
return dep.map((d) => { return dep.map((d) => {
return { return {
@ -565,6 +771,8 @@ function mapStateToProps (state) {
reportListLoading: reportList.isRequesting, reportListLoading: reportList.isRequesting,
reportDetail: reportDetail.data, reportDetail: reportDetail.data,
reportDetailLoading: reportDetail.isRequesting, reportDetailLoading: reportDetail.isRequesting,
clientHeight: global.clientHeight,
}; };
} }
export default connect(mapStateToProps)(PatrolTable); export default connect(mapStateToProps)(PatrolTable);

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

@ -3780,14 +3780,15 @@ const TransporTationTable = (props) => {
setGrade('村') setGrade('村')
}}>村道{activeKey === 'tab3'}</span>, }}>村道{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 Task from './task'
import Assess from './assess' import Assess from './assess'
import VideoCenter from './videoCenter'; 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 { Menu } from 'antd';
import { ReadOutlined } from '@ant-design/icons'; import { ReadOutlined } from '@ant-design/icons';
const SubMenu = Menu.SubMenu; const SubMenu = Menu.SubMenu;
export function getNavItem (user, dispatch) { export function getNavItem(user, dispatch) {
const isshow = user?.userResources?. const isshow = user?.userResources?.
filter(i => i.resourceId === 'OVERLOADMANAGE' || filter(i => i.resourceId === 'OVERLOADMANAGE' ||
i.resourceId === 'ROADMANAGE' || i.resourceId === 'ROADMANAGE' ||
@ -26,8 +26,8 @@ export function getNavItem (user, dispatch) {
<Link to="/fillion/infor">治超管理</Link> <Link to="/fillion/infor">治超管理</Link>
</Menu.Item> : ''} </Menu.Item> : ''}
{/* <Menu.Item key="filliontask"> {/* <Menu.Item key="filliontask">
<Link to="/fillion/task">任务管理</Link> <Link to="/fillion/task">任务管理</Link>
</Menu.Item> */} </Menu.Item> */}
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'ROADMANAGE')?.length !== 0 ? {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'ROADMANAGE')?.length !== 0 ?
<Menu.Item key="filliontransportation"> <Menu.Item key="filliontransportation">
<Link to="/fillion/transportation">道路管理</Link> <Link to="/fillion/transportation">道路管理</Link>
@ -55,6 +55,16 @@ export function getNavItem (user, dispatch) {
<Menu.Item key="fillionpatrol"> <Menu.Item key="fillionpatrol">
<Link to="/fillion/patrol">巡查管理</Link> <Link to="/fillion/patrol">巡查管理</Link>
</Menu.Item> : ''} </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 ? {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'PUBLICTRANSPORTMANAGE')?.length !== 0 ?
<Menu.Item key="fillionpublic"> <Menu.Item key="fillionpublic">
<Link to="/fillion/public">公交管理</Link> <Link to="/fillion/public">公交管理</Link>
@ -74,11 +84,7 @@ export function getNavItem (user, dispatch) {
<Menu.Item key="fillionpromotional"> <Menu.Item key="fillionpromotional">
<Link to="/fillion/promotional">宣传视频</Link> <Link to="/fillion/promotional">宣传视频</Link>
</Menu.Item> : ''} </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 ? {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'REPORTMANAGE')?.length !== 0 ?
<Menu.Item key="fillionpatrolroad"> <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 { Patrol } from './containers'
import { File } from './containers'; import { File } from './containers';
import { Jiekouguanli } from './containers' import { Jiekouguanli } from './containers'
import { Task, Assess, VideoCenter } from './containers' import { Task, Assess, VideoCenter, } from './containers'
import { Building } from './containers'
export default [{ export default [{
type: 'inner', type: 'inner',
@ -44,6 +45,15 @@ export default [{
breadcrumb: '道路管理', breadcrumb: '道路管理',
authCode: 'ROADMANAGE' authCode: 'ROADMANAGE'
},
{
path: '/building',
key: 'fillionbuilding',
menuSelectKeys: ['fillionbuilding'],
component: Building,
breadcrumb: '在建项目',
//authCode: 'ROADMANAGE'
} }
, { , {
path: '/bridge', path: '/bridge',

2
web/package-lock.json

@ -7519,7 +7519,7 @@
}, },
"lodash": { "lodash": {
"version": "4.17.21", "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==" "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
}, },
"lodash-es": { "lodash-es": {

4
web/package.json

@ -6,7 +6,11 @@
"scripts": { "scripts": {
"test": "mocha", "test": "mocha",
"start": "cross-env NODE_ENV=development npm run start-params", "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: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", "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-dev": "export NODE_ENV=development&&webpack --config webpack.config.js",
"build": "export NODE_ENV=production&&webpack --config webpack.config.prod.js", "build": "export NODE_ENV=production&&webpack --config webpack.config.prod.js",

Loading…
Cancel
Save