ww664853070 2 years ago
parent
commit
556ccfe222
  1. 18
      api/app/lib/controllers/data/index.js
  2. 2
      api/app/lib/controllers/data/videoCenter.js
  3. 4
      api/app/lib/controllers/overview/building.js
  4. 3
      api/app/lib/controllers/report/index.js
  5. 6
      api/app/lib/models/project.js
  6. 9
      api/app/lib/models/report.js
  7. 39
      api/app/lib/schedule/index.js
  8. 8
      scripts/1.2.3/schema/7.update_project.sql
  9. 2
      scripts/1.2.4/schema/1.update_report.sql
  10. 1
      weapp/src/packages/patrol/index.jsx
  11. 8
      weapp/src/packages/patrolView/index.jsx
  12. 2
      web/client/src/sections/fillion/components/maintenanceTable.js
  13. 31
      web/client/src/sections/fillion/components/patrolTable.js
  14. 4
      web/client/src/sections/fillion/nav-item.js
  15. 4
      web/client/src/sections/organization/containers/user.js
  16. 2
      web/client/src/sections/quanju/containers/footer/build/index.js
  17. 134
      web/client/src/sections/quanju/containers/footer/conserve/right/right-bottom.js
  18. 4
      web/client/src/sections/quanju/containers/footer/conserve/right/right-top.js
  19. 45
      web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js
  20. 14
      web/client/src/sections/quanju/containers/public/olMap.js

18
api/app/lib/controllers/data/index.js

@ -6,6 +6,7 @@ const request = require('superagent');
async function dataExport(ctx) { async function dataExport(ctx) {
try { try {
let tableAttributesCopy = {}
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { userId } = ctx.fs.api const { userId } = ctx.fs.api
const { exp, ids, roadLevel, municipalType, const { exp, ids, roadLevel, municipalType,
@ -36,7 +37,7 @@ async function dataExport(ctx) {
tableName: 'MunicipalBusiness', tableName: 'MunicipalBusiness',
}, },
{ {
n: '工程一览', n: '在建项目',
k: 'project', k: 'project',
tableName: 'Project', tableName: 'Project',
}, },
@ -87,8 +88,21 @@ async function dataExport(ctx) {
const exportData = await models[modalOption.tableName].findAll(findOption) const exportData = await models[modalOption.tableName].findAll(findOption)
const tableAttributes = models[modalOption.tableName].tableAttributes const tableAttributes = models[modalOption.tableName].tableAttributes
//过滤project部门字段
if (modalOption.tableName === 'Project') {
const { entryName, projectMileage, investment, buildUnit,
constructionControlUnit, designUnit, constructionUnit, qutityUnit, startTime, remark, done } = tableAttributes
tableAttributesCopy = {
entryName, projectMileage, investment, buildUnit,
constructionControlUnit, designUnit, constructionUnit, qutityUnit, startTime, remark, done
}
} else {
tableAttributesCopy = tableAttributes
}
let header = [] let header = []
for (let k in tableAttributes) { console.log('tableAttributesCopy', tableAttributesCopy)
for (let k in tableAttributesCopy) {
let comment = tableAttributes[k].comment let comment = tableAttributes[k].comment
if (k != 'id' && comment) { if (k != 'id' && comment) {
if (comment == '品名' && municipalType == '出租车') { if (comment == '品名' && municipalType == '出租车') {

2
api/app/lib/controllers/data/videoCenter.js

@ -38,7 +38,7 @@ function videoList (opts) {
}) })
ctx.status = 200; ctx.status = 200;
ctx.body = (deviceRes.data || []).map(item => { ctx.body = [] || (deviceRes.data || []).map(item => {
return { return {
...item, ...item,
token: yingshiToken, token: yingshiToken,

4
api/app/lib/controllers/overview/building.js

@ -38,7 +38,7 @@ async function roadState(ctx) {
}) })
//在建工程 //在建工程
const buildingCount = await models.Project.count({ const buildingCount = await models.Project.count({
where: { done: true } where: { done: false }
}) })
const bridgeRes = await models.Bridge.findAll({}) const bridgeRes = await models.Bridge.findAll({})
@ -196,7 +196,7 @@ async function roadState(ctx) {
} }
} }
if (p.buildUnit && p.done) { if (p.buildUnit && !p.done) {
let townName = p.buildUnit.replace('人民政府', '').replace('南昌县', '').replace('管委会', '') let townName = p.buildUnit.replace('人民政府', '').replace('南昌县', '').replace('管委会', '')
if (roadState.townProject[townName]) { if (roadState.townProject[townName]) {
roadState.townProject[townName] += 1 roadState.townProject[townName] += 1

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

@ -43,7 +43,8 @@ async function reportList(ctx) {
where: { where: {
}, },
attributes: ['id', 'road', 'time', 'projectType', 'roadSectionStart', 'performerId', 'roadSectionEnd', 'reportType', 'content', 'longitude', 'latitude', 'projectName', 'handleState', 'codeRoad'], attributes: ['id', 'road', 'time', 'projectType', 'roadSectionStart', 'performerId', 'roadSectionEnd', 'reportType',
'content', 'longitude', 'latitude', 'projectName', 'handleState', 'codeRoad', 'handleContent', 'handlePic','videoUrl'],
include: [{ include: [{
model: models.User, model: models.User,
attributes: ['name'] attributes: ['name']

6
api/app/lib/models/project.js

@ -47,7 +47,7 @@ module.exports = dc => {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "建设单位", comment: "业主单位",
primaryKey: false, primaryKey: false,
field: "build_unit", field: "build_unit",
autoIncrement: false autoIncrement: false
@ -101,7 +101,7 @@ module.exports = dc => {
type: DataTypes.BOOLEAN, type: DataTypes.BOOLEAN,
allowNull: false, allowNull: false,
defaultValue: null, defaultValue: null,
comment: null, comment: "是否已完成",
primaryKey: false, primaryKey: false,
field: "done", field: "done",
autoIncrement: false autoIncrement: false
@ -137,7 +137,7 @@ module.exports = dc => {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "质量检测单位", comment: "质量监督单位",
primaryKey: false, primaryKey: false,
field: "qutity_unit", field: "qutity_unit",
autoIncrement: false autoIncrement: false

9
api/app/lib/models/report.js

@ -223,6 +223,15 @@ module.exports = dc => {
field: "handle_pic", field: "handle_pic",
autoIncrement: false autoIncrement: false
}, },
videoUrl: {
type: DataTypes.ARRAY(DataTypes.STRING),
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "video_url",
autoIncrement: false
},
}, { }, {
tableName: "report", tableName: "report",
comment: "", comment: "",

39
api/app/lib/schedule/index.js

@ -0,0 +1,39 @@
'use strict';
const fs = require('fs');
const nodeSchedule = require('node-schedule');
// 将定时任务汇集未来可根据需要选取操作
module.exports = async function (app, opts) {
const scheduleInit = ({
interval, immediate, proRun, disabled
}, callback) => {
if (disabled) {
return;
}
if (proRun && opts.dev) {
return;
}
const j = nodeSchedule.scheduleJob(interval, callback);
if (immediate && (!proRun || (proRun && !opts.dev))) {
setTimeout(callback, 0)
}
return j;
}
app.fs.scheduleInit = scheduleInit
fs.readdirSync(__dirname).forEach((filename) => {
if (!['index.js'].some(f => filename == f)) {
const scheduleList = require(`./${filename}`)(app, opts)
for (let k of Object.keys(scheduleList)) {
console.info(`定时任务 ${k} 启动`);
}
app.fs.schedule = {
...app.fs.schedule,
...scheduleList,
}
}
});
};

8
scripts/1.2.3/schema/7.update_project.sql

@ -0,0 +1,8 @@
COMMENT ON COLUMN project.build_unit IS '业主单位';
COMMENT ON COLUMN project.qutity_unit IS '质量监督单位';
COMMENT ON COLUMN project.done IS '是否已完成';

2
scripts/1.2.4/schema/1.update_report.sql

@ -0,0 +1,2 @@
alter table report
add video_url varchar(1024) [];

1
weapp/src/packages/patrol/index.jsx

@ -161,6 +161,7 @@ const Index = () => {
// type: 'wgs84', // type: 'wgs84',
type: 'gcj02', type: 'gcj02',
isHighAccuracy: true, isHighAccuracy: true,
// isHighAccuracy: false,
highAccuracyExpireTime: 1000 * 6, highAccuracyExpireTime: 1000 * 6,
success: function (res) { success: function (res) {
setLongitude(res.longitude) setLongitude(res.longitude)

8
weapp/src/packages/patrolView/index.jsx

@ -14,7 +14,7 @@ import patrolActiveIcon from '../../static/img/patrolView/patrol-active.svg'
import conserveIcon from '../../static/img/patrolView/conserve.svg' import conserveIcon from '../../static/img/patrolView/conserve.svg'
import conserveActiveIcon from '../../static/img/patrolView/conserve-active.svg' import conserveActiveIcon from '../../static/img/patrolView/conserve-active.svg'
function Index() { function Index () {
const userInfo = Taro.getStorageSync('userInfo') || {}; const userInfo = Taro.getStorageSync('userInfo') || {};
const router = useRouter() const router = useRouter()
const { params: { filter, kind, } } = router const { params: { filter, kind, } } = router
@ -40,7 +40,7 @@ function Index() {
Taro.setNavigationBarTitle({ title: '在建项目' }) Taro.setNavigationBarTitle({ title: '在建项目' })
} else if (isAnomaly) { } else if (isAnomaly) {
Taro.setNavigationBarTitle({ title: '异常反馈' }) Taro.setNavigationBarTitle({ title: '异常反馈' })
}else if(ishandle){ } else if (ishandle) {
Taro.setNavigationBarTitle({ title: '已办事项' }) Taro.setNavigationBarTitle({ title: '已办事项' })
} else if (kind == 'conserve') { } else if (kind == 'conserve') {
Taro.setNavigationBarTitle({ title: '养护上报' }) Taro.setNavigationBarTitle({ title: '养护上报' })
@ -60,7 +60,7 @@ function Index() {
getList(page == 0 ? true : false) getList(page == 0 ? true : false)
}, [num]) }, [num])
function dealError(error) { function dealError (error) {
Taro.showToast({ Taro.showToast({
title: error, title: error,
icon: 'none', icon: 'none',
@ -77,7 +77,7 @@ function Index() {
endTime: datePicker ? datePicker + ' 23:59:59' : '', endTime: datePicker ? datePicker + ' 23:59:59' : '',
keyword: filterText, keyword: filterText,
reportType: isWait || ishandle ? 'anomaly' : reportType, reportType: isWait || ishandle ? 'anomaly' : reportType,
userId: filter === 'my' ? userInfo.id : '', userId: filter === 'my' && !ishandle ? userInfo.id : '',
handleState: isWait ? '待处理' : ishandle ? '已处理' : '', handleState: isWait ? '待处理' : ishandle ? '已处理' : '',
performerId: isWait || ishandle ? userInfo.id : '' performerId: isWait || ishandle ? userInfo.id : ''
} }

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

@ -23,10 +23,12 @@ const DetailForm = (props) => {
{ key: '所在路段', name: 'road' }, { key: '所在路段', name: 'road' },
{ key: '具体位置', name: 'address' }, { key: '具体位置', name: 'address' },
{ key: '巡查内容', name: 'content' }, { key: '巡查内容', name: 'content' },
{ key: '路线代码', name: 'codeRoad' },
// { key: '病害照片', name: 'scenePic' }, // { key: '病害照片', name: 'scenePic' },
{ key: '养护前', name: 'conserveBeforePic' }, { key: '养护前', name: 'conserveBeforePic' },
{ key: '养护中', name: 'conserveUnderwayPic' }, { key: '养护中', name: 'conserveUnderwayPic' },
{ key: '养护后', name: 'conserveAfterPic' }, { key: '养护后', name: 'conserveAfterPic' },
]; ];
const renderContent = (data) => { const renderContent = (data) => {

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

@ -40,21 +40,23 @@ const DetailForm = (props) => {
const keyList = [ const keyList = [
// { key: '编号', name: 'id' }, // { key: '编号', name: 'id' },
// isPatrol ?'巡查管理详情' :isRoad ? '建设上报详情' : '异常反馈详情'
{ key: '工程类型', name: 'projectType', skip: !isPatrol }, { key: '工程类型', name: 'projectType', skip: !isPatrol },
{ key: '反馈类型', name: 'projectType', skip: !isAnomaly }, { key: '反馈类型', name: 'projectType', skip: !isAnomaly },
{ key: '工程名称', name: 'projectName', skip: !isRoad }, { key: '工程名称', name: 'projectName', skip: !isRoad },
{ key: '所在路段', name: 'road', skip: isRoad }, { key: '所在路段', name: 'road', skip: isRoad },
{ key: '具体位置', name: 'address' }, { key: '具体位置', name: 'address' },
{ key: '巡查内容', name: 'content' }, { key: '巡查内容', name: 'content' },
{ key: '路线代码', name: 'codeRoad' }, { key: '路线代码', name: 'codeRoad', skip: !isAnomaly && !isPatrol },
{ key: '现场照片', name: 'scenePic' }, { key: '现场照片', name: 'scenePic' },
{ key: '处理详情', name: 'handleContent', skip: !isAnomaly },
{ key: '处理图片', name: 'handlePic', skip: !isAnomaly },
{ key: '处理人', name: 'performerName', skip: !isAnomaly }
]; ];
const renderContent = (data) => { const renderContent = (data) => {
if (data) { if (data) {
// Object.keys(data).map(key => { // Object.keys(data).map(key => {
// }) // })
return keyList.map(obj => { return keyList.map(obj => {
return ( return (
@ -62,9 +64,7 @@ const DetailForm = (props) => {
<div style={{ display: 'flex', width: '100%', justifyContent: 'space-between', margin: '12px 0' }}> <div style={{ display: 'flex', width: '100%', justifyContent: 'space-between', margin: '12px 0' }}>
<span style={{ fontSize: 16, color: 'gray', minWidth: '26%' }}>{obj.key}</span> <span style={{ fontSize: 16, color: 'gray', minWidth: '26%' }}>{obj.key}</span>
{ {
obj.name != 'scenePic' && obj.name != 'handlePic' ?
obj.name != 'scenePic' ?
<Input <Input
style={{ width: '70%' }} style={{ width: '70%' }}
value={ value={
@ -73,18 +73,19 @@ const DetailForm = (props) => {
: :
obj.name == 'projectType' ? obj.name == 'projectType' ?
reportTypeText(data[obj.name]) : reportTypeText(data[obj.name]) :
data[obj.name] data[obj.name] || null
} }
disabled disabled
/> />
: :
<div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}> <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
{ {
data.scenePic && data.scenePic instanceof Array ? data.scenePic.map(imgSrc => { data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
return <div style={{ width: '44%', margin: 6 }}> return <div style={{ width: '44%', margin: 6 }}>
<Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} /> <Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
</div> </div>
}) : '暂无图片' })
: '暂无图片'
} }
</div> </div>
@ -593,7 +594,7 @@ const PatrolTable = (props) => {
const [detailVisible, setDetailVisible] = useState(false) const [detailVisible, setDetailVisible] = useState(false)
const [activeTabKey1, setActiveTabKey1] = useState('tab1'); const [activeTabKey1, setActiveTabKey1] = useState('tab1');
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
const [reportDetailCopy, setReportDetailCopy] = useState({})//匹配执行者的名字
const isRoad = pathname.includes('road') const isRoad = pathname.includes('road')
const isAnomaly = pathname.includes('anomaly') const isAnomaly = pathname.includes('anomaly')
const isPatrol = !isRoad && !isAnomaly const isPatrol = !isRoad && !isAnomaly
@ -604,10 +605,10 @@ const PatrolTable = (props) => {
}, []) }, [])
useEffect(() => { useEffect(() => {
// if (userList && userList instanceof Array) { if (userList && userList instanceof Array && reportDetail && reportDetail instanceof Object) {
// setRecord(userList[0]); setReportDetailCopy(Object.assign(reportDetail, { performerName: userList.find(item => item.id === reportDetail.performerId)?.name }))
// } }
}, [userList]) }, [userList, reportDetail])
useEffect(() => { useEffect(() => {
queryData(); queryData();
@ -752,7 +753,7 @@ const PatrolTable = (props) => {
<DetailForm <DetailForm
visible={detailVisible} visible={detailVisible}
handleClose={handleClose} handleClose={handleClose}
data={reportDetail} data={reportDetailCopy}
loading={reportDetailLoading} loading={reportDetailLoading}
isPatrol={isPatrol} isRoad={isRoad} isAnomaly={isAnomaly} isPatrol={isPatrol} isRoad={isRoad} isAnomaly={isAnomaly}
/> />

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

@ -95,10 +95,10 @@ export function getNavItem(user, dispatch) {
<Menu.Item key="fillionassess"> <Menu.Item key="fillionassess">
<Link to="/fillion/assess">考核评分</Link> <Link to="/fillion/assess">考核评分</Link>
</Menu.Item> : ''} </Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'VIDEOCENTER') ? {/* {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'VIDEOCENTER') ?
<Menu.Item key="fillionvideoCenter"> <Menu.Item key="fillionvideoCenter">
<Link to="/fillion/videoCenter">视频中心</Link> <Link to="/fillion/videoCenter">视频中心</Link>
</Menu.Item> : ''} </Menu.Item> : ''} */}
</SubMenu> : null </SubMenu> : null
); );
} }

4
web/client/src/sections/organization/containers/user.js

@ -269,11 +269,11 @@ const UserManage = (props) => {
<div style={{ width: '30%' }} > <div style={{ width: '30%' }} >
{ {
selectedTree == id ? <> selectedTree == id ? <>
<FormOutlined onClick={() => { {user?.username === 'SuperAdmin' ? <FormOutlined onClick={() => {
setDepModalRecord(item) setDepModalRecord(item)
setDepModalVisible(true) setDepModalVisible(true)
setDepModalType('edit') setDepModalType('edit')
}} /> }} /> : null}
{user?.username === 'SuperAdmin' ? <Popconfirm title='是否确认删除?' onConfirm={() => { delDepartment(id) }} > {user?.username === 'SuperAdmin' ? <Popconfirm title='是否确认删除?' onConfirm={() => { delDepartment(id) }} >
<DeleteOutlined style={{ marginLeft: 5 }} /> <DeleteOutlined style={{ marginLeft: 5 }} />
</Popconfirm> : ''} </Popconfirm> : ''}

2
web/client/src/sections/quanju/containers/footer/build/index.js

@ -291,7 +291,7 @@ const Build = (props) => {
width: "100%", width: "100%",
height: " 33%", marginTop: '3%' height: " 33%", marginTop: '3%'
}} customize={true}> }} customize={true}>
{sunonlineproject !== 0 ? <Rightcenter data={onlineproject} sundata={sunonlineproject} /> : <NoData />} {sunonlineproject !== 0 ? <Rightcenter data={onlineproject} sundata={buildingCount} /> : <NoData />}
</Module> </Module>
<Module title={"各路段技术等级统计"} style={{ <Module title={"各路段技术等级统计"} style={{
width: "100%", width: "100%",

134
web/client/src/sections/quanju/containers/footer/conserve/right/right-bottom.js

@ -18,67 +18,79 @@ import PieChart from '../chart/pie-chart';
const type = ['culvert', '', 'road', 'bridge'] const type = ['culvert', '', 'road', 'bridge']
const RightBottom = (props) => { const RightBottom = (props) => {
const { roadMaintenances } = props const { roadMaintenances } = props
let totalData = null let totalData = null
let typesNum = null let typesNum = null
const list = roadMaintenances?.reportCount?.map((r, index) => { let list = roadMaintenances?.reportCount?.map((r, index) => {
totalData += Number(r.count) totalData += Number(r.count)
if (r.projectType === 'culvert' || 'road' || 'bridge') { if (r.projectType === 'culvert' || 'road' || 'bridge') {
typesNum += Number(r.count) typesNum += Number(r.count)
} }
switch (r.projectType) { switch (r.projectType) {
case 'road': case 'road':
return { case 'countyRoad':
name: '道路', case 'villageRoad':
value: r.count, case 'rusticRoad':
colorList: 'rgba(7,185,254,1)', return {
underColorList: 'rgba(7,185,254,0.5)' name: '道路',
value: r.count,
colorList: 'rgba(7,185,254,1)',
underColorList: 'rgba(7,185,254,0.5)'
}; };
case 'culvert': case 'culvert':
return { return {
name: '涵洞', name: '涵洞',
value: r.count, value: r.count,
colorList: 'rgba(4,251,240,1)', colorList: 'rgba(4,251,240,1)',
underColorList: 'rgba(4,251,240,0.5)' underColorList: 'rgba(4,251,240,0.5)'
}; };
case 'bridge': case 'bridge':
return { return {
name: '桥梁', name: '桥梁',
value: r.count, value: r.count,
colorList: 'rgba(28,96,254,1)', colorList: 'rgba(28,96,254,1)',
underColorList: 'rgba(28,96,254,0.5)' underColorList: 'rgba(28,96,254,0.5)'
}; };
case 'other': case 'other':
return { return {
name: '其他', name: '其他',
value: r.count, value: r.count,
colorList: 'rgba(255,194,20,1)', colorList: 'rgba(255,194,20,1)',
underColorList: 'rgba(255,194,20,0.5)' underColorList: 'rgba(255,194,20,0.5)'
}; };
} }
}).filter(f => f !== undefined) }).filter(f => f !== undefined)
console.log('list:',list);
let colorList = list?.map(c => c.colorList) list = list?.reduce((pre, cur) => {
let underColorList =list?.map(c => c.underColorList) let existIndex = pre.findIndex(p => p.name == cur.name)
const style = { height: "31%", marginTop: "3%" } if (existIndex > -1) {
return ( pre[existIndex].value = parseInt(pre[existIndex].value) + parseInt(cur.value)
<> } else {
<Module style={style} title={"养护完成情况"}> pre.push(cur)
{/* <div ref = {chartRef} style={{ width: '100%', height: '100%' }}></div> */} }
<PieChart return pre
data={list} }, [])
width='100%' let colorList = list?.map(c => c.colorList)
height='100%' let underColorList = list?.map(c => c.underColorList)
text='养护总数' const style = { height: "31%", marginTop: "3%" }
textLeft={'21%'} return (
numLeft={'22%'} <>
total={totalData || 0} <Module style={style} title={"养护完成情况"}>
colorList={colorList} {/* <div ref = {chartRef} style={{ width: '100%', height: '100%' }}></div> */}
underColorList={underColorList} <PieChart
/> data={list}
</Module> width='100%'
</> height='100%'
) text='养护总数'
textLeft={'21%'}
numLeft={'22%'}
total={totalData || 0}
colorList={colorList}
underColorList={underColorList}
/>
</Module>
</>
)
} }
export default RightBottom export default RightBottom

4
web/client/src/sections/quanju/containers/footer/conserve/right/right-top.js

@ -4,7 +4,7 @@ import Module from '../../../public/module'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import Lun from "../../leadership/right/lunbo" import Lun from "../../leadership/right/lunbo"
import { getRoadmaintain } from "../../../../actions/example" import { getRoadmaintain } from "../../../../actions/example"
import Hua from "../../leadership/right/hudong" import Hua from "../../leadership/centerleft/hudong"
import moment from 'moment' import moment from 'moment'
const iconSrc = [ const iconSrc = [
@ -48,7 +48,7 @@ const RightTop = (props) => {
useEffect(() => { useEffect(() => {
dispatch(getRoadmaintain()).then((res) => { dispatch(getRoadmaintain()).then((res) => {
setRoadmaintainList(res.payload.data.reportList.filter((item, index) => { setRoadmaintainList(res.payload.data.reportList.filter((item, index) => {
return item.projectType == "road" return item.projectType == "road" || item.projectType == "countyRoad" || item.projectType == "villageRoad" || item.projectType == "rusticRoad"
})) }))
}) })
}, []) }, [])

45
web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js

@ -16,16 +16,15 @@ const Right = (props) => {
const [shuzu, setShuzu] = useState([]) const [shuzu, setShuzu] = useState([])
useEffect(() => { useEffect(() => {
const daolus = dispatch(getRoadmaintain()).then((res) => { const daolus = dispatch(getRoadmaintain()).then((res) => {
// console.log(res);
setList(res.payload.data.reportList.filter((item, index) => { setList(res.payload.data.reportList.filter((item, index) => {
return item.projectType == "road" || item.projectType == "countyRoad" || item.projectType == "villageRoad" || item.projectType == "rusticRoad"
return item.projectType == "road"
}))
setNums(res.payload.data.reportCount.filter((item, index) => {
return item.projectType == "road"
})) }))
// console.log(res.payload.data); setNums(res.payload.data.reportCount.reduce((count, item) => {
if (item.projectType == "road" || item.projectType == "countyRoad" || item.projectType == "villageRoad" || item.projectType == "rusticRoad") {
count += parseInt(item.count)
}
return count
}, 0))
}) })
}, []) }, [])
useEffect(() => { useEffect(() => {
@ -35,7 +34,7 @@ const Right = (props) => {
// const // const
}) })
}, []) }, [])
// console.log("1211", nums); console.log("1211", nums);
const renderBody = () => { const renderBody = () => {
return ( return (
@ -64,18 +63,19 @@ const Right = (props) => {
<p style={{ textAlign: "left", width: "25%", position: "absolute", left: "5%", color: beijing == index ? "#ffffff" : "rgba(216,240,255,0.8)" }} >{item.road ? item.road : "--"}</p> <p style={{ textAlign: "left", width: "25%", position: "absolute", left: "5%", color: beijing == index ? "#ffffff" : "rgba(216,240,255,0.8)" }} >{item.road ? item.road : "--"}</p>
<p style={{ textAlign: "right", width: "30%", position: "absolute", right: "3%", color: beijing == index ? "#ffffff" : "rgba(216,240,255,0.8)" }}>{moment(item.time).format("YYYY-MM-DD HH:mm:ss") ? moment(item.time).format("YYYY-MM-DD HH:mm:ss") : "--"}</p> <p style={{ textAlign: "right", width: "30%", position: "absolute", right: "3%", color: beijing == index ? "#ffffff" : "rgba(216,240,255,0.8)" }}>{moment(item.time).format("YYYY-MM-DD HH:mm:ss") ? moment(item.time).format("YYYY-MM-DD HH:mm:ss") : "--"}</p>
{ {
num == index ? <div style={{ position: "fixed", width: "400px", height: "200px", zIndex: 100, left: "50%", marginTop: "0", top: "35%" }}> num == index ?
<img src='/assets/images/leadership/beijinglan.png' style={{ width: "100%", height: "100%" }} /> <div style={{ position: "fixed", width: "400px", height: "200px", zIndex: 100, left: "50%", marginTop: "0", top: "35%" }}>
<div style={{ width: "50%", height: "100%", position: "absolute", top: "0", }}> <img src='/assets/images/leadership/beijinglan.png' style={{ width: "100%", height: "100%" }} />
<Hua shuzu={[{ "imgs": item.conserveAfterPic ? item.conserveAfterPic[0] : "" }, { "imgs": item.conserveBeforePic ? item.conserveBeforePic[0] : "" }, { "imgs": item.conserveUnderwayPic ? item.conserveUnderwayPic[0] : "" }]} /> <div style={{ width: "50%", height: "100%", position: "absolute", top: "0", }}>
</div> <Hua shuzu={[{ "imgs": item.conserveAfterPic ? item.conserveAfterPic[0] : "" }, { "imgs": item.conserveBeforePic ? item.conserveBeforePic[0] : "" }, { "imgs": item.conserveUnderwayPic ? item.conserveUnderwayPic[0] : "" }]} />
<div style={{ position: "absolute", top: "0", width: "50%", left: "50%", paddingRight: "10px" }}> </div>
<p style={{ marginTop: "20px", color: "#FFFFFF", fontSize: "16px", fontFamily: "YouSheBiaoTiHei" }}>{item.roadSectionStart ? item.roadSectionStart : ""}{item.roadSectionStart && item.roadSectionEnd ? "——" : ""}{item.roadSectionEnd ? item.roadSectionEnd : ""}{item.roadSectionStart || item.roadSectionEnd ? "" : "--"}</p> <div style={{ position: "absolute", top: "0", width: "50%", left: "50%", paddingRight: "10px" }}>
<p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>养护类型<span style={{ color: "#EEF4FF", marginLeft: "30px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>日常养护</span></p> <p style={{ marginTop: "20px", color: "#FFFFFF", fontSize: "16px", fontFamily: "YouSheBiaoTiHei" }}>{item.roadSectionStart ? item.roadSectionStart : ""}{item.roadSectionStart && item.roadSectionEnd ? "——" : ""}{item.roadSectionEnd ? item.roadSectionEnd : ""}{item.roadSectionStart || item.roadSectionEnd ? "" : "--"}</p>
<p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>负责人<span style={{ color: "#EEF4FF", marginLeft: "45px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>{item.user?.name ? item.user.name : "--"}</span></p> <p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>养护类型<span style={{ color: "#EEF4FF", marginLeft: "30px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>日常养护</span></p>
<p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>日期<span style={{ color: "#EEF4FF", marginLeft: "60px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>{moment(item.time).format("YYYY-MM-DD") ? moment(item.time).format("YYYY-MM-DD") : "--"}</span></p> <p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>负责人<span style={{ color: "#EEF4FF", marginLeft: "45px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>{item.user?.name ? item.user.name : "--"}</span></p>
</div> <p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>日期<span style={{ color: "#EEF4FF", marginLeft: "60px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>{moment(item.time).format("YYYY-MM-DD") ? moment(item.time).format("YYYY-MM-DD") : "--"}</span></p>
</div> : "" </div>
</div> : ""
} }
</li> </li>
) )
@ -88,7 +88,6 @@ const Right = (props) => {
} }
return ( return (
<> <>
{/* <Spin spinning={!nums && list && roads} tip="Loading" size="large" > */}
<div style={{ width: "100%", height: "100%", float: "right", marginRight: "1%", position: "relative" }}> <div style={{ width: "100%", height: "100%", float: "right", marginRight: "1%", position: "relative" }}>
<div style={{ width: "100%", height: "43%", position: "relative", left: "1%" }}> <div style={{ width: "100%", height: "43%", position: "relative", left: "1%" }}>
@ -118,7 +117,7 @@ const Right = (props) => {
{/* <p>{title || []}</p> */} {/* <p>{title || []}</p> */}
<img src='/assets/images/quanju/icon.png' style={{ width: "24px", position: "absolute", left: "-1%", top: "18%" }} /> <img src='/assets/images/quanju/icon.png' style={{ width: "24px", position: "absolute", left: "-1%", top: "18%" }} />
<span style={{ position: "absolute", color: "#FFFFFF", fontSize: "24px", fontFamily: "YouSheBiaoTiHei", left: "19px" }}>养护事件</span> <span style={{ position: "absolute", color: "#FFFFFF", fontSize: "24px", fontFamily: "YouSheBiaoTiHei", left: "19px" }}>养护事件</span>
<p style={{ position: "absolute", color: "#D8F0FF", fontSize: "14px", right: "6%" }}><span style={{ marginLeft: "-20%" }}>道路</span><span style={{ fontSize: "18px", fontFamily: "YouSheBiaoTiHei", color: "#ffffff", marginLeft: "10%" }}>{nums ? nums[0]?.count : 0}</span><span style={{ marginLeft: "10%" }}></span></p> <p style={{ position: "absolute", color: "#D8F0FF", fontSize: "14px", right: "6%" }}><span style={{ marginLeft: "-20%" }}>道路</span><span style={{ fontSize: "18px", fontFamily: "YouSheBiaoTiHei", color: "#ffffff", marginLeft: "10%" }}>{nums}</span><span style={{ marginLeft: "10%" }}></span></p>
{/* <img src='/assets/images/leadership/zibiaoti.png' style={{ width: "95%", height: "34px", position: "absolute", top: "12px", left: "6%" }} /> */} {/* <img src='/assets/images/leadership/zibiaoti.png' style={{ width: "95%", height: "34px", position: "absolute", top: "12px", left: "6%" }} /> */}
</div> </div>
{/* <Spin spinning={true} style={{ height: "80%" }}> */} {/* <Spin spinning={true} style={{ height: "80%" }}> */}

14
web/client/src/sections/quanju/containers/public/olMap.js

@ -47,7 +47,7 @@ const OlMap = (props) => {
// console.log(p) // console.log(p)
}) })
olMapTool.map.on('singleclick', function (p) { olMapTool.map.on('singleclick', function (p) {
setOlMapOpenData([])
olMapTool.closeOverlay('clickOpen') olMapTool.closeOverlay('clickOpen')
olMapTool.removeGeometryLayer('geometry0') olMapTool.removeGeometryLayer('geometry0')
@ -70,8 +70,8 @@ const OlMap = (props) => {
// geometryType: 'Point', // geometryType: 'Point',
}, },
], ],
style: { stroke: { width: 10, color: '#9933FF' } }, style: { stroke: { width: 5, color: '#9933FF' } },
selectStyle: { stroke: { width: 5, color: '#9933FF' } }, selectStyle: { stroke: { width: 8, color: '#9933FF' } },
layerName: 'geometry' + index++ layerName: 'geometry' + index++
}); });
const config = { const config = {
@ -113,10 +113,10 @@ const OlMap = (props) => {
v: de['roadends'], v: de['roadends'],
}, { }, {
n: '路段里程', n: '路段里程',
v: v: de['f067']
!isNaN(de['roadends']) && !isNaN(de['roadstart']) ? // !isNaN(de['roadends']) && !isNaN(de['roadstart']) ?
de['roadends'] - de['roadstart'] // de['roadends'] - de['roadstart']
: '-', // : '-',
}, { }, {
n: '技术等级', n: '技术等级',
v: de['f014'], v: de['f014'],

Loading…
Cancel
Save