wenlele 2 years ago
parent
commit
7fcf98abbe
  1. 10
      .gitignore
  2. 2
      api/app/lib/controllers/data/anspectionNotificationPhone.js
  3. 4
      api/app/lib/controllers/data/appointed.js
  4. 18
      api/app/lib/controllers/data/vehicle.js
  5. 3
      api/app/lib/controllers/luzheng/index.js
  6. 9
      api/app/lib/models/project.js
  7. 73
      api/app/lib/models/report.js
  8. 4
      scripts/1.3.0/schema/6.update_report.sql
  9. 19
      scripts/1.3.1/schema/1create_table_telephone.sql
  10. 0
      scripts/1.3.1/schema/2.roadadministration.sql
  11. 2
      scripts/1.3.1/schema/3.alert_project.sql
  12. 3
      scripts/1.3.1/schema/3.insert_resource.sql
  13. 2
      web/client/src/sections/fillion/actions/infor.js
  14. 24
      web/client/src/sections/fillion/components/bridgeTable.js
  15. 11
      web/client/src/sections/fillion/components/feedback/nominateModalcopy.js
  16. 14
      web/client/src/sections/fillion/components/highwaysTable.js
  17. 41
      web/client/src/sections/fillion/components/luzhengmodel.js
  18. 37
      web/client/src/sections/fillion/components/maintenanceTable.js
  19. 31
      web/client/src/sections/fillion/components/patrolTable.js
  20. 3
      web/client/src/sections/fillion/components/project/project.js
  21. 21
      web/client/src/sections/fillion/components/transportationTable.js
  22. 326
      web/client/src/sections/fillion/components/uploads.js
  23. 61
      web/client/src/sections/fillion/containers/luzheng.js
  24. 1
      web/client/src/sections/fillion/containers/maintenanceSpotCheck.js
  25. 10
      web/client/src/sections/fillion/nav-item.js
  26. 12
      web/client/src/sections/quanju/containers/footer/build/Leftbottom.js
  27. 3
      web/client/src/sections/quanju/containers/footer/build/Rightbottom.js
  28. 2
      web/client/src/sections/quanju/containers/footer/build/Rightcenter.js
  29. 84
      web/client/src/sections/quanju/containers/footer/build/index.js
  30. 8
      web/client/src/sections/quanju/containers/footer/build/style.less
  31. 12
      web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js
  32. 8
      web/client/src/sections/quanju/containers/footer/leadership/centerleft/top.js
  33. 92
      web/client/src/sections/quanju/containers/footer/operation/right.js
  34. 28
      web/client/src/sections/quanju/containers/public/olMap.js

10
.gitignore

@ -139,8 +139,8 @@ dist
*package-lock.json *package-lock.json
*log/ *log/
*downloadFiles/ *downloadFiles/
web/client/assets/color.less web/client/assets/color.less*
package-lock.json package-lock.json*
development.text development.text*
web/package-lock.json web/package-lock.json*
web/log/development.txt web/log/development.txt*

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

@ -36,7 +36,7 @@ async function addAnspectionNotificationPhone(ctx) {
}) })
}) })
await models.AnspectionNotificationPhone.bulkCreate(dataList); await models.AnspectionNotificationPhone.bulkCreate(dataList);
await transaction.commit(); // await transaction.commit();
ctx.status = 204 ctx.status = 204
} catch (error) { } catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);

4
api/app/lib/controllers/data/appointed.js

@ -4,9 +4,9 @@ const moment = require('moment')
async function appoint(ctx) { async function appoint(ctx) {
try { try {
const models = ctx.fs.dc.models const models = ctx.fs.dc.models
const { recordId, performerId } = ctx.request.body const { recordId, performerId, handleOpinions } = ctx.request.body
await models.Report.update({ await models.Report.update({
performerId performerId, handleOpinions
}, { where: { id: recordId } }) }, { where: { id: recordId } })
ctx.status = 204; ctx.status = 204;
} catch (error) { } catch (error) {

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

@ -1,11 +1,20 @@
'use strict'; 'use strict';
const { QueryTypes } = require('sequelize');
async function get(ctx) { async function get(ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { type } = ctx.request.body; const { type } = ctx.request.body;
const { name } = ctx.query; const { name } = ctx.query;
const sequelize = ctx.fs.dc.orm
const sqlStr = `select count(p.road_marking) 标线,count(p.roadside_ditch) 边沟,
count(p.guardrail) 护栏, count(p.roadside_trees) 行道树,count(p.wrong_lane) 错车道
from (
select t.*,row_number() over (partition by t.luduan order by t.time desc ) rn from (
select code_road||'-'||road_section_start||'-'||road_section_end luduan,
road_marking,roadside_ditch,guardrail,roadside_trees,wrong_lane,time from report
where report_type='conserve') t ) p where p.rn=1`
const conserveData = await sequelize.query(sqlStr, { type: QueryTypes.SELECT })
let findOption = { let findOption = {
where: { where: {
type type
@ -17,9 +26,12 @@ async function get (ctx) {
} }
} }
const vehicleRes = await models.Statistic.findAll(findOption) const vehicleRes = await models.Statistic.findAll(findOption)
console.log('vehicleRes', vehicleRes)
ctx.status = 200; ctx.status = 200;
ctx.body = vehicleRes ctx.body = {
vehicleRes: vehicleRes.filter(item => item.dataValues.name === '标志牌' || item.dataValues.name === '养护责任牌')
, conserveData
}
} catch (error) { } catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400; ctx.status = 400;

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

@ -1,5 +1,6 @@
'use strict' 'use strict'
//查询路政 //查询路政
const moment = require('moment');
async function getRoadadministration(ctx, next) { async function getRoadadministration(ctx, next) {
try { try {
@ -10,7 +11,7 @@ async function getRoadadministration(ctx, next) {
if(startTime && endTime){ if(startTime && endTime){
where.enforcementdate = { where.enforcementdate = {
where: { enforcementdate: { $between: [moment(startTime).format('YYYY-MM-DD'), moment(endTime).format('YYYY-MM-DD')] } }, $between: [moment(startTime).format('YYYY-MM-DD'), moment(endTime).format('YYYY-MM-DD')]
} }
} }

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

@ -141,6 +141,15 @@ module.exports = dc => {
primaryKey: false, primaryKey: false,
field: "qutity_unit", field: "qutity_unit",
autoIncrement: false autoIncrement: false
},
roadCodeStart: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "开始的路段编码",
primaryKey: false,
field: "road_code_start",
autoIncrement: false
} }
}, { }, {
tableName: "project", tableName: "project",

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

@ -7,7 +7,6 @@ module.exports = dc => {
const sequelize = dc.orm; const sequelize = dc.orm;
const Report = sequelize.define("report", { const Report = sequelize.define("report", {
id: { id: {
index: 1,
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false, allowNull: false,
defaultValue: null, defaultValue: null,
@ -18,87 +17,78 @@ module.exports = dc => {
unique: "report_id_uindex" unique: "report_id_uindex"
}, },
reportType: { reportType: {
index: 2,
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false, allowNull: false,
defaultValue: null, defaultValue: null,
comment: "上报类型", comment: "上报类型 巡查:patrol / 养护:conserve",
primaryKey: false, primaryKey: false,
field: "report_type", field: "report_type",
autoIncrement: false autoIncrement: false
}, },
projectType: { projectType: {
index: 3,
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "工程类型", comment: "工程类型 道路:road / 桥梁:birdge / 涵洞:culvert",
primaryKey: false, primaryKey: false,
field: "project_type", field: "project_type",
autoIncrement: false autoIncrement: false
}, },
road: { road: {
index: 4,
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: '所属道路', comment: null,
primaryKey: false, primaryKey: false,
field: "road", field: "road",
autoIncrement: false autoIncrement: false
}, },
roadSectionStart: { roadSectionStart: {
index: 5,
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: '开始路段', comment: null,
primaryKey: false, primaryKey: false,
field: "road_section_start", field: "road_section_start",
autoIncrement: false autoIncrement: false
}, },
roadSectionEnd: { roadSectionEnd: {
index: 6,
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: '结束路段', comment: null,
primaryKey: false, primaryKey: false,
field: "road_section_end", field: "road_section_end",
autoIncrement: false autoIncrement: false
}, },
longitude: { longitude: {
index: 7,
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: '经度', comment: null,
primaryKey: false, primaryKey: false,
field: "longitude", field: "longitude",
autoIncrement: false autoIncrement: false
}, },
latitude: { latitude: {
index: 8,
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: '纬度', comment: null,
primaryKey: false, primaryKey: false,
field: "latitude", field: "latitude",
autoIncrement: false autoIncrement: false
}, },
content: { content: {
index: 9,
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: '具体内容', comment: null,
primaryKey: false, primaryKey: false,
field: "content", field: "content",
autoIncrement: false autoIncrement: false
}, },
scenePic: { scenePic: {
index: 10,
type: DataTypes.ARRAY(DataTypes.STRING), type: DataTypes.ARRAY(DataTypes.STRING),
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
@ -108,7 +98,6 @@ module.exports = dc => {
autoIncrement: false autoIncrement: false
}, },
conserveBeforePic: { conserveBeforePic: {
index: 11,
type: DataTypes.ARRAY(DataTypes.STRING), type: DataTypes.ARRAY(DataTypes.STRING),
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
@ -118,7 +107,6 @@ module.exports = dc => {
autoIncrement: false autoIncrement: false
}, },
conserveUnderwayPic: { conserveUnderwayPic: {
index: 12,
type: DataTypes.ARRAY(DataTypes.STRING), type: DataTypes.ARRAY(DataTypes.STRING),
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
@ -128,7 +116,6 @@ module.exports = dc => {
autoIncrement: false autoIncrement: false
}, },
conserveAfterPic: { conserveAfterPic: {
index: 13,
type: DataTypes.ARRAY(DataTypes.STRING), type: DataTypes.ARRAY(DataTypes.STRING),
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
@ -138,7 +125,6 @@ module.exports = dc => {
autoIncrement: false autoIncrement: false
}, },
userId: { userId: {
index: 14,
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
@ -148,52 +134,39 @@ module.exports = dc => {
autoIncrement: false autoIncrement: false
}, },
time: { time: {
index: 15,
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false, allowNull: false,
defaultValue: null, defaultValue: null,
comment: '创建日期', comment: null,
primaryKey: false, primaryKey: false,
field: "time", field: "time",
autoIncrement: false autoIncrement: false
}, },
address: { address: {
index: 16,
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: '具体位置', comment: null,
primaryKey: false, primaryKey: false,
field: "address", field: "address",
autoIncrement: false autoIncrement: false
}, },
projectName: { projectName: {
index: 17,
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "工程名称", comment: null,
primaryKey: false, primaryKey: false,
field: "project_name", field: "project_name",
autoIncrement: false autoIncrement: false
}, },
handleState: { handleState: {
index: 18,
type: DataTypes.STRING,
allowNull: false,
defaultValue: "已处理",
// comment: "处理状态",
primaryKey: false,
field: "handle_state",
autoIncrement: false
},
codeRoad: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "code_road", field: "handle_state",
autoIncrement: false autoIncrement: false
}, },
performerId: { performerId: {
@ -209,7 +182,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: "handle_content", field: "handle_content",
autoIncrement: false autoIncrement: false
@ -223,6 +196,15 @@ module.exports = dc => {
field: "handle_pic", field: "handle_pic",
autoIncrement: false autoIncrement: false
}, },
codeRoad: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "code_road",
autoIncrement: false
},
videoUrl: { videoUrl: {
type: DataTypes.ARRAY(DataTypes.STRING), type: DataTypes.ARRAY(DataTypes.STRING),
allowNull: true, allowNull: true,
@ -456,6 +438,15 @@ module.exports = dc => {
primaryKey: false, primaryKey: false,
field: "other_description", field: "other_description",
autoIncrement: false autoIncrement: false
},
handleOpinions: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "处理意见",
primaryKey: false,
field: "handle_opinions",
autoIncrement: false
} }
}, { }, {
tableName: "report", tableName: "report",

4
scripts/1.3.0/schema/6.update_report.sql

@ -0,0 +1,4 @@
alter table report
add handle_opinions varchar(1024);
comment on column report.handle_opinions is '处理意见';

19
scripts/1.3.1/schema/1create_table_telephone.sql

@ -0,0 +1,19 @@
CREATE SEQUENCE "public"."inspection_notification_phone_seq"
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
CREATE TABLE "public"."inspection_notification_phone" (
"id" int4 NOT NULL DEFAULT nextval('inspection_notification_phone_seq'::regclass),
"phone" varchar(255) COLLATE "pg_catalog"."default",
PRIMARY KEY ("id")
)
;
COMMENT ON COLUMN "public"."inspection_notification_phone"."phone" IS '电话号码';

0
scripts/1.3.0/schema/6.roadadministration.sql → scripts/1.3.1/schema/2.roadadministration.sql

2
scripts/1.3.1/schema/3.alert_project.sql

@ -0,0 +1,2 @@
alter table project
add road_code_start varchar(1024);

3
scripts/1.3.1/schema/3.insert_resource.sql

@ -0,0 +1,3 @@
INSERT INTO resource (code, name, parent_resource) VALUES ('LUZHENG', '路政管理', 'ALLSELECT');
DELETE FROM user_resource WHERE resource_id = 'OVERLOADMANAGE';
DELETE FROM resource WHERE code = 'OVERLOADMANAGE'

2
web/client/src/sections/fillion/actions/infor.js

@ -142,7 +142,7 @@ export function getProject(query) {
actionType: 'GET_PROJECT', actionType: 'GET_PROJECT',
url: ApiTable.getProject, url: ApiTable.getProject,
msg: { error: '获取工程信息失败' }, msg: { error: '获取工程信息失败' },
reducer: { name: 'projectList' }
}); });
} }
export function putProject(query) { export function putProject(query) {

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

@ -25,6 +25,9 @@ const BrideTable = (props) => {
const [whichofits, setWhichofits] = useState('qiaoliang') const [whichofits, setWhichofits] = useState('qiaoliang')
const [delet, setDelet] = useState() const [delet, setDelet] = useState()
const [differentiate, setDifferentiate] = useState('bridge') const [differentiate, setDifferentiate] = useState('bridge')
const [smallBridge, setSmallBridge] = useState([])
const [middleBridge, setMiddleBridge] = useState([])
const [bigBridge, setBigBridge] = useState([])
const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'BRIDGEMANAGE')[0].isshow === "true" ? true : '') const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'BRIDGEMANAGE')[0].isshow === "true" ? true : '')
const ref = useRef() const ref = useRef()
useEffect(() => { ref.current.reload() }, [whichofits, delet]) useEffect(() => { ref.current.reload() }, [whichofits, delet])
@ -161,7 +164,7 @@ const BrideTable = (props) => {
getPopupContainer: (triggerNode) => triggerNode.parentNode, getPopupContainer: (triggerNode) => triggerNode.parentNode,
} }
}, { }, {
title: '跨越地物类型1', title: '跨越地物类型',
search: false, search: false,
dataIndex: 'time8', dataIndex: 'time8',
valueType: 'dateRange', valueType: 'dateRange',
@ -175,7 +178,7 @@ const BrideTable = (props) => {
getPopupContainer: (triggerNode) => triggerNode.parentNode, getPopupContainer: (triggerNode) => triggerNode.parentNode,
} }
}, { }, {
title: '跨越地物名称1', title: '跨越地物名称',
search: false, search: false,
dataIndex: 'time9', dataIndex: 'time9',
valueType: 'dateRange', valueType: 'dateRange',
@ -1810,7 +1813,9 @@ const BrideTable = (props) => {
setRowSelected([]); setRowSelected([]);
const res = await dispatch(getBridge(query)); const res = await dispatch(getBridge(query));
// console.log(res) // console.log(res)
setSmallBridge(res.payload.data?.filter(item => item.bridgeClassification === '小桥'))
setMiddleBridge(res.payload.data?.filter(item => item.bridgeClassification === '中桥'))
setBigBridge(res.payload.data?.filter(item => item.bridgeClassification === '大桥'))
setCounts(res.payload.data) setCounts(res.payload.data)
return { return {
...res, ...res,
@ -1833,6 +1838,7 @@ const BrideTable = (props) => {
search={{ search={{
defaultCollapsed: false, defaultCollapsed: false,
optionRender: (searchConfig, formProps, dom) => [ optionRender: (searchConfig, formProps, dom) => [
<span style={{ marginRight: 80 }}>{`共有小桥${smallBridge.length}座,中桥${middleBridge.length}座,大桥${bigBridge.length}`}</span>,
...dom.reverse(), ...dom.reverse(),
<Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, differentiate) }} disabled={editAble}> <Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, differentiate) }} disabled={editAble}>
<Button <Button
@ -1847,7 +1853,8 @@ const BrideTable = (props) => {
> >
</ProTable> </ProTable>
</div> </div>
{modalVisible ? <UserModal {
modalVisible ? <UserModal
visible={modalVisible} visible={modalVisible}
onVisibleChange={setModalVisible} onVisibleChange={setModalVisible}
modalRecord={modalRecord} modalRecord={modalRecord}
@ -1858,8 +1865,10 @@ const BrideTable = (props) => {
setDelet={setDelet} setDelet={setDelet}
// sitename={sitename} // sitename={sitename}
setRecortd={setRecortd} setRecortd={setRecortd}
/> : ''} /> : ''
{modalVisibleyilan ? <ProjectModal }
{
modalVisibleyilan ? <ProjectModal
visible={modalVisibleyilan} visible={modalVisibleyilan}
onVisibleChange={setModalVisibleyilan} onVisibleChange={setModalVisibleyilan}
modalRecord={modalRecord} modalRecord={modalRecord}
@ -1868,7 +1877,8 @@ const BrideTable = (props) => {
setDelet={setDelet} setDelet={setDelet}
recortd={recortd} recortd={recortd}
setRecortd={setRecortd} setRecortd={setRecortd}
/> : ''} /> : ''
}
</Spin > </Spin >
) )
} }

11
web/client/src/sections/fillion/components/feedback/nominateModalcopy.js

@ -1,13 +1,14 @@
'use strict'; 'use strict';
import React, { useState, useEffect, useCallback, useRef } from 'react'; import React, { useState, useEffect, useCallback, useRef } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Spin, TreeSelect, Modal, Form, Select } from 'antd'; import { Spin, TreeSelect, Modal, Form, Select, Input } from 'antd';
import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect, ProFormSelect } from '@ant-design/pro-form'; import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect, ProFormSelect } from '@ant-design/pro-form';
import { getDepUser } from '../../../organization/actions/user' import { getDepUser } from '../../../organization/actions/user'
import { appointTask } from '../../actions/appointTask' import { appointTask } from '../../actions/appointTask'
import moment from 'moment'; import moment from 'moment'
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
const { TextArea } = Input;
const NominateModal = (props) => { const NominateModal = (props) => {
const { queryData, 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
@ -38,7 +39,7 @@ const NominateModal = (props) => {
} }
const handleFinish = () => { const handleFinish = () => {
form.validateFields().then(values => { form.validateFields().then(values => {
dispatch(appointTask({ recordId: recordId, performerId: values.nameId })).then((res) => { dispatch(appointTask({ recordId: recordId, performerId: values.nameId, handleOpinions: values.handleOpinions })).then((res) => {
if (res.success) { if (res.success) {
setSelectedUserId(null) setSelectedUserId(null)
queryData() queryData()
@ -92,9 +93,13 @@ const NominateModal = (props) => {
onChange={(value) => setSelectedUserId(value)} onChange={(value) => setSelectedUserId(value)}
> >
</Select> </Select>
</Form.Item> </Form.Item>
</div> </div>
</div> </div>
<Form.Item label='处理意见:' name='handleOpinions'>
<TextArea />
</Form.Item>
</Form> </Form>
</Modal> </Modal>
</Spin> </Spin>

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

@ -76,6 +76,7 @@ const TransporTationTable = (props) => {
fixed: 'left', fixed: 'left',
width: 120, width: 120,
render: (dom, record) => { render: (dom, record) => {
return record.count return record.count
}, },
fieldProps: { fieldProps: {
@ -90,13 +91,14 @@ const TransporTationTable = (props) => {
width: 160, width: 160,
fixed: 'right', fixed: 'right',
render: (dom, record) => { render: (dom, record) => {
console.log('record', record.id === null)
return <div><Button type="link" return <div><Button type="link"
onClick={() => { onClick={() => {
hightModal('edit', record) hightModal('edit', record)
setTypecard('compile') setTypecard('compile')
setRecortd(record) setRecortd(record)
}} }}
disabled={editAble} disabled={editAble && record.id === null}
>编辑</Button></div> >编辑</Button></div>
} }
@ -316,7 +318,15 @@ const TransporTationTable = (props) => {
} }
setRowSelected([]); setRowSelected([]);
const res = await dispatch(getHighways(query)); const res = await dispatch(getHighways(query));
setCounts(res.payload.data.filter(item => item.name !== '路牌名')) let rslt = res.payload.data?.vehicleRes?.filter(item => item.name !== '路牌名')
const additionalProperties = Object.entries(res.payload.data?.conserveData[0]).map(([key, value]) => ({
id: null,
name: key,
count: Number(value),
type: null
}))
additionalProperties.forEach(item => { rslt.push(item) })
setCounts(rslt)
return { return {
...res, ...res,
total: res.payload.data ? res.payload.data.count : 0 total: res.payload.data ? res.payload.data.count : 0

41
web/client/src/sections/fillion/components/luzhengmodel.js

@ -6,11 +6,13 @@ import { getAssess, delAssess, editAssess } from '../actions/assess';
import moment from 'moment'; import moment from 'moment';
import { getRoadadministration,addRoadadministration,delRoadadministration,modifyRoadadministration } from '../actions/luzheng'; import { getRoadadministration,addRoadadministration,delRoadadministration,modifyRoadadministration } from '../actions/luzheng';
// import Uploads from "../../../../components/Upload/index" // import Uploads from "../../../../components/Upload/index"
// import Uploads from '../../../components/Upload/index'
import Uploads from './uploads'
const { Option } = Select; const { Option } = Select;
const AssessModal = ({ editData, check, visible, onCancel, dispatch }) => { const LuzhengModel = ({ editData, check, visible, onCancel, dispatch }) => {
const [form] = Form.useForm(); const [form] = Form.useForm();
console.log(editData,'editData')
return ( return (
<Modal <Modal
title="路政信息" title="路政信息"
@ -24,15 +26,24 @@ const AssessModal = ({ editData, check, visible, onCancel, dispatch }) => {
return onCancel() return onCancel()
} }
form.validateFields().then(values => { form.validateFields().then(values => {
dispatch(editAssess({ if(editData){
dispatch(modifyRoadadministration(editData?.id,{
...values
})).then(res => {
if (res.success) {
onCancel()
}
})
}else{
dispatch(addRoadadministration({
...values, ...values,
month: moment(values.month).format('YYYY-MM-DD'),
assessId: editData ? editData.id : undefined
})).then(res => { })).then(res => {
if (res.success) { if (res.success) {
onCancel() onCancel()
} }
}) })
}
}) })
}} }}
onCancel={() => { onCancel={() => {
@ -43,7 +54,7 @@ const AssessModal = ({ editData, check, visible, onCancel, dispatch }) => {
form={form} form={form}
initialValues={editData ? { initialValues={editData ? {
...editData, ...editData,
month: moment(editData.month), enforcementdate: moment(editData.enforcementdate)
} : {}} } : {}}
disabled={check} disabled={check}
labelCol={{ labelCol={{
@ -64,20 +75,22 @@ const AssessModal = ({ editData, check, visible, onCancel, dispatch }) => {
<DatePicker/> <DatePicker/>
</Form.Item> </Form.Item>
<Form.Item name="roadname" label="执法道路" rules={[{ required: true, message: '请填写' }]}> <Form.Item name="roadname" label="执法道路" rules={[{ required: true, message: '请填写' },{ max: 100, message: '不可超过一百个字符' }]}>
<Input/> <Input/>
</Form.Item> </Form.Item>
<Form.Item name="enforcementreslt" label="执法成果" rules={[{ required: true, message: '请填写' }]}> <Form.Item name="enforcementreslt" label="执法成果" rules={[{ required: true, message: '请填写' },{ max: 100, message: '不可超过一百个字符' }]}>
<Input/> <Input/>
</Form.Item> </Form.Item>
<Form.Item name="picfile" label="执法图片"> <Form.Item name="picfile" label="执法图片">
{/* <Uploads <Uploads
maxFilesNum={1} maxFilesNum={3}
fileTypes={['mp4']} fileTypes={['png','jpg','jpeg']}
maxFileSize={200} maxFileSize={200}
/> */} fileList={editData?.picfile}
listType ={'picture-card'}
isedit={editData?true:false}
/>
</Form.Item> </Form.Item>
</Form> </Form>
</Modal> </Modal>
@ -91,4 +104,4 @@ function mapStateToProps (state) {
assess: assess.data || [] assess: assess.data || []
} }
} }
export default connect(mapStateToProps)(AssessModal); export default connect(mapStateToProps)(LuzhengModel);

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

@ -25,24 +25,25 @@ const DetailForm = (props) => {
{ key: '养护路段', name: 'roadSectionStart' }, { key: '养护路段', name: 'roadSectionStart' },
{ key: '具体位置', name: 'address' }, { key: '具体位置', name: 'address' },
{ key: '路面类型', name: 'roadType' }, { key: '路面类型', name: 'roadType' },
{ key: '路面宽度', name: 'roadWidth' }, { key: '路面宽度(米)', name: 'roadWidth' },
{ key: '错车道', name: 'wrongLane' }, { key: '错车道(个)', name: 'wrongLane' },
{ key: '行道树', name: 'roadsideTrees' }, { key: '行道树(棵)', name: 'roadsideTrees' },
{ key: '边沟', name: 'roadsideDitch' }, { key: '边沟(米)', name: 'roadsideDitch' },
{ key: '护栏', name: 'guardrail' }, { key: '护栏(米)', name: 'guardrail' },
{ key: '标线', name: 'roadMarking' }, { key: '标线(米)', name: 'roadMarking' },
{ key: '养护人员人数', name: 'maintenanceStaffCount' }, { key: '养护人员人数(人)', name: 'maintenanceStaffCount' },
{ key: '修整路肩', name: 'shoulderRepair' }, { key: '修整路肩(平方米)', name: 'shoulderRepair' },
{ key: '清理边沟', name: 'ditchCleaning' }, { key: '清理边沟(米)', name: 'ditchCleaning' },
{ key: '修补沥青路面', name: 'asphaltRepair' }, { key: '修补沥青路面(平方米)', name: 'asphaltRepair' },
{ key: '修补水泥路面', name: 'concreteRepair' }, { key: '修补水泥路面(平方米)', name: 'concreteRepair' },
{ key: '除草', name: 'grassMowing' }, { key: '除草(米)', name: 'grassMowing' },
{ key: '树刷白', name: 'treeWhitening' }, { key: '树刷白(株/公里)', name: 'treeWhitening' },
{ key: '桩刷白', name: 'pileWhitening' }, { key: '桩刷白(个)', name: 'pileWhitening' },
{ key: '维护护栏', name: 'guardrailMaintenance' }, { key: '维护护栏(个)', name: 'guardrailMaintenance' },
{ key: '修复端头', name: 'endHeadRepair' }, { key: '修复端头(块)', name: 'endHeadRepair' },
{ key: '其他养护内容', name: 'otherDescription' }, { key: '其他养护内容', name: 'otherDescription' },
{ key: '养护前图片', name: 'conserveBeforePic' }, { key: '养护前图片', name: 'conserveBeforePic' },
{ key: '养护中图片', name: 'conserveUnderwayPic' },
{ key: '养护后图片', name: 'conserveAfterPic' }, { key: '养护后图片', name: 'conserveAfterPic' },
{ key: '上报视频', name: 'videoUrl' }, { key: '上报视频', name: 'videoUrl' },
@ -69,7 +70,7 @@ const DetailForm = (props) => {
{ {
obj.name != 'conserveBeforePic' && obj.name != 'conserveAfterPic' && obj.name != 'roadSectionStart' && obj.name != 'videoUrl' && obj.name.indexOf('conserve') == -1 ? obj.name != 'conserveBeforePic' && obj.name != 'conserveAfterPic' && obj.name != 'roadSectionStart' && obj.name != 'videoUrl' && obj.name.indexOf('conserve') == -1 ?
<Input <Input
style={{ width: '70%' }} style={{ width: '60%' }}
value={ value={
obj.name == 'id' ? obj.name == 'id' ?
moment(data.time).format("YYYYMMDD") * 10000 + data.id moment(data.time).format("YYYYMMDD") * 10000 + data.id
@ -91,7 +92,7 @@ const DetailForm = (props) => {
</div> </div>
}) : '暂无图片' }) : '暂无图片'
} }
</div> : obj.name != 'videoUrl' ? <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}> </div> : obj.name != 'videoUrl' ? <div style={{ width: '60%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
<Input style={{ width: '100%' }} disabled value={data[obj.name] + '-' + data['roadSectionEnd']} /> <Input style={{ width: '100%' }} disabled value={data[obj.name] + '-' + data['roadSectionEnd']} />
</div> : <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}> </div> : <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>

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

@ -45,7 +45,7 @@ const DetailForm = (props) => {
const keyList = [ const keyList = [
// { key: '编号', name: 'id' }, // { key: '编号', name: 'id' },
// isPatrol ?'巡查管理详情' :isRoad ? '建设上报详情' : '异常反馈详情' // 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: isPatrol }, { key: '所在路段', name: 'road', skip: isPatrol },
@ -53,6 +53,7 @@ const DetailForm = (props) => {
{ key: '巡查内容', name: 'content', skip: isPatrol }, { key: '巡查内容', name: 'content', skip: isPatrol },
{ key: '路线代码', name: 'codeRoad', skip: !isAnomaly && isPatrol }, { key: '路线代码', name: 'codeRoad', skip: !isAnomaly && isPatrol },
{ key: '现场照片', name: 'scenePic', skip: isPatrol }, { key: '现场照片', name: 'scenePic', skip: isPatrol },
{ key: '处理意见', name: 'handleOpinions', skip: !isAnomaly },
{ key: '处理详情', name: 'handleContent', skip: !isAnomaly }, { key: '处理详情', name: 'handleContent', skip: !isAnomaly },
{ key: '处理图片', name: 'handlePic', skip: !isAnomaly }, { key: '处理图片', name: 'handlePic', skip: !isAnomaly },
{ key: '处理人', name: 'performerName', skip: !isAnomaly }, { key: '处理人', name: 'performerName', skip: !isAnomaly },
@ -89,13 +90,13 @@ const DetailForm = (props) => {
{ key: '巡查内容', name: 'content' }, { key: '巡查内容', name: 'content' },
{ key: '路线代码', name: 'codeRoad', skip: !isAnomaly && !isPatrol }, { key: '路线代码', name: 'codeRoad', skip: !isAnomaly && !isPatrol },
{ key: '现场照片', name: 'scenePic' }, { key: '现场照片', name: 'scenePic' },
{ key: '处理意见', name: 'handleOpinions', skip: !isAnomaly },
{ key: '处理详情', name: 'handleContent', skip: !isAnomaly }, { key: '处理详情', name: 'handleContent', skip: !isAnomaly },
{ key: '处理图片', name: 'handlePic', skip: !isAnomaly }, { key: '处理图片', name: 'handlePic', skip: !isAnomaly },
{ key: '处理人', name: 'performerName', skip: !isAnomaly } { key: '处理人', name: 'performerName', skip: !isAnomaly }
]; ];
const changeBoolean = (bool) => { const changeBoolean = (bool) => {
//console.log('bool', bool)
return bool ? '无异常' : '有异常' return bool ? '无异常' : '有异常'
} }
const renderContent = (data) => { const renderContent = (data) => {
@ -113,7 +114,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 != 'roadSectionStart' && obj.name != 'videoUrl' && obj.name.indexOf('conserve') == -1 ? obj.name != 'handlePic' && obj.name != 'scenePic' && obj.name != 'roadSectionStart' && obj.name != 'videoUrl' && obj.name.indexOf('conserve') == -1 ?
<Input <Input
style={{ width: '70%' }} style={{ width: '70%' }}
value={ value={
@ -616,7 +617,6 @@ const PatrolNameList = (props) => {
} }
} }
// console.log('selectedKeys', selectedKeys, selected, selectedNodes, node)
}; };
@ -713,6 +713,7 @@ const PatrolTable = (props) => {
const isPatrol = !isRoad && !isAnomaly const isPatrol = !isRoad && !isAnomaly
const reportType = isRoad ? 'road' : isAnomaly ? 'anomaly' : 'patrol'; const reportType = isRoad ? 'road' : isAnomaly ? 'anomaly' : 'patrol';
const [isModalOpen, setIsModalOpen] = useState(false); const [isModalOpen, setIsModalOpen] = useState(false);
const [phoneList, setPhoneList] = useState([]);
const [form] = Form.useForm(); const [form] = Form.useForm();
useEffect(() => { useEffect(() => {
queryData(); queryData();
@ -815,14 +816,13 @@ const PatrolTable = (props) => {
} }
} }
useEffect(() => { useEffect(() => {
console.log(anspectionNotificationPhoneList, '数据');
let phoneList = [] let phoneList = []
if (anspectionNotificationPhoneList && anspectionNotificationPhoneList.length) { if (anspectionNotificationPhoneList && anspectionNotificationPhoneList.length) {
phoneList = anspectionNotificationPhoneList.map(e => { phoneList = anspectionNotificationPhoneList.map(e => {
return e.phone return e.phone
}) })
} }
console.log(phoneList, '789789789789'); setPhoneList(phoneList)
}, [anspectionNotificationPhoneList]) }, [anspectionNotificationPhoneList])
const showModal = () => { const showModal = () => {
@ -832,7 +832,6 @@ const PatrolTable = (props) => {
const handleOk = () => { const handleOk = () => {
// setIsModalOpen(false); // setIsModalOpen(false);
form.validateFields().then(values => { form.validateFields().then(values => {
console.log(values, '----------');
dispatch(addAnspectionNotificationPhone(values)).then(res => { dispatch(addAnspectionNotificationPhone(values)).then(res => {
if (res.success) { if (res.success) {
setIsModalOpen(false); setIsModalOpen(false);
@ -862,7 +861,10 @@ const PatrolTable = (props) => {
sm: { span: 20, offset: 4 }, sm: { span: 20, offset: 4 },
}, },
}; };
let routerUrl = window.location.href
routerUrl = routerUrl.substring(routerUrl.length - 14)
console.log(routerUrl, '=========');
return ( return (
<div className='card-protable'> <div className='card-protable'>
<Card > <Card >
@ -908,7 +910,10 @@ const PatrolTable = (props) => {
: '' : ''
} }
<Button style={{ marginLeft: 20 }}>查询</Button> <Button style={{ marginLeft: 20 }}>查询</Button>
<Button onClick={() => { showModal() }} style={{ float: 'right', marginRight: 30 }}> 短信提醒</Button> {
routerUrl == 'patrol_anomaly' ? <Button onClick={() => { showModal() }} style={{ float: 'right', marginRight: 30 }}> 短信提醒</Button> : ''
}
{/* <Button style={{ marginLeft: 20 }} onClick={handleExport} >导出</Button> */} {/* <Button style={{ marginLeft: 20 }} onClick={handleExport} >导出</Button> */}
</div> : '' </div> : ''
@ -926,15 +931,7 @@ const PatrolTable = (props) => {
<Form form={form} name="dynamic_form_item" {...formItemLayoutWithOutLabel} > <Form form={form} name="dynamic_form_item" {...formItemLayoutWithOutLabel} >
<Form.List <Form.List
name="phone" name="phone"
// rules={[ initialValue={phoneList}
// {
// validator: async (_, names) => {
// if (!names || names.length < 1) {
// return Promise.reject(new Error('At least 2 passengers'));
// }
// },
// },
// ]}
> >
{(fields, { add, remove }, { errors }) => ( {(fields, { add, remove }, { errors }) => (
<> <>

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

@ -15,7 +15,8 @@ const data = {
"designUnit": "设计单位", "designUnit": "设计单位",
"constructionControlUnit": "监理单位", "constructionControlUnit": "监理单位",
//"startTime": "开工时间", //"startTime": "开工时间",
//"remark": "备注" //"remark": "备注",
"roadCodeStart": "起点路段编码",
} }
const ProjectModal = (props) => { const ProjectModal = (props) => {
const { visible, onVisibleChange, typecard, rewkeys, recortd, dispatch, setRecortd, setDelet, getData } = props const { visible, onVisibleChange, typecard, rewkeys, recortd, dispatch, setRecortd, setDelet, getData } = props

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

@ -24,6 +24,7 @@ const TransporTationTable = (props) => {
const [differentiate, setDifferentiate] = useState('road') const [differentiate, setDifferentiate] = useState('road')
const [grade, setGrade] = useState('县') const [grade, setGrade] = useState('县')
const [departmentInfo, setDepartment] = useState('') const [departmentInfo, setDepartment] = useState('')
const [roadData, setRoadData] = 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?.filter(i => i.resourceId === 'ROADMANAGE')[0].isshow === "true" ? true : '')
const ref = useRef() const ref = useRef()
useEffect(() => { ref.current.reload() }, [whichofits, delet]) useEffect(() => { ref.current.reload() }, [whichofits, delet])
@ -3761,6 +3762,7 @@ const TransporTationTable = (props) => {
setWhichofits('县') setWhichofits('县')
setDifferentiate('road') setDifferentiate('road')
setGrade('县') setGrade('县')
setRoadData([])
}}>县道{activeKey === 'tab1'}</span>, }}>县道{activeKey === 'tab1'}</span>,
}, },
{ {
@ -3769,6 +3771,7 @@ const TransporTationTable = (props) => {
setWhichofits('乡') setWhichofits('乡')
setGrade('乡') setGrade('乡')
setDifferentiate('road') setDifferentiate('road')
setRoadData([])
}}>乡道{activeKey === 'tab2'}</span>, }}>乡道{activeKey === 'tab2'}</span>,
}, },
@ -3778,6 +3781,7 @@ const TransporTationTable = (props) => {
setWhichofits('村') setWhichofits('村')
setDifferentiate('road') setDifferentiate('road')
setGrade('村') setGrade('村')
setRoadData([])
}}>村道{activeKey === 'tab3'}</span>, }}>村道{activeKey === 'tab3'}</span>,
}, },
@ -3819,8 +3823,8 @@ const TransporTationTable = (props) => {
} }
setRowSelected([]); setRowSelected([]);
const res = await dispatch(getRoadway(query)); const res = await dispatch(getRoadway(query));
// console.log(res) const uniqueArray = [...new Set(res.payload.data?.map(item => item.routeName))];
setRoadData(uniqueArray)
setCounts(departmentInfo ? res.payload.data.filter((item) => { setCounts(departmentInfo ? res.payload.data.filter((item) => {
return item.townshipCode === departmentInfo.areaCode return item.townshipCode === departmentInfo.areaCode
}) : res.payload.data) }) : res.payload.data)
@ -3836,6 +3840,8 @@ const TransporTationTable = (props) => {
} }
setRowSelected([]); setRowSelected([]);
const res = await dispatch(getRoadway(query)); const res = await dispatch(getRoadway(query));
const uniqueArray = [...new Set(res.payload.data?.map(item => item.routeName))];
setRoadData(uniqueArray)
setCounts(departmentInfo ? res.payload.data.filter((item) => { setCounts(departmentInfo ? res.payload.data.filter((item) => {
return item.townshipCode === departmentInfo.areaCode return item.townshipCode === departmentInfo.areaCode
}) : res.payload.data) }) : res.payload.data)
@ -3849,7 +3855,9 @@ const TransporTationTable = (props) => {
road: sitename road: sitename
} }
setRowSelected([]); setRowSelected([]);
const res = await dispatch(getRoadway(query)); const res = await dispatch(getRoadway(query))
const uniqueArray = [...new Set(res.payload.data?.map(item => item.routeName))];
setRoadData(uniqueArray)
setCounts(departmentInfo ? res.payload.data.filter((item) => { setCounts(departmentInfo ? res.payload.data.filter((item) => {
return item.townshipCode === departmentInfo.areaCode return item.townshipCode === departmentInfo.areaCode
}) : res.payload.data) }) : res.payload.data)
@ -3864,8 +3872,8 @@ const TransporTationTable = (props) => {
entryName: sitename entryName: sitename
} }
setRowSelected([]); setRowSelected([]);
const res = await dispatch(getProject(query)); const res = await dispatch(getProject(query))
setCounts(res.payload.data) console.log('56666666', res)
return { return {
...res, ...res,
total: res.payload.data ? res.payload.data.count : 0 total: res.payload.data ? res.payload.data.count : 0
@ -3875,6 +3883,7 @@ const TransporTationTable = (props) => {
search={{ search={{
defaultCollapsed: false, defaultCollapsed: false,
optionRender: (searchConfig, formProps, dom) => [ optionRender: (searchConfig, formProps, dom) => [
<span style={{ marginRight: 20 }}>{`共有${whichofits}道:${roadData.length || 0}`}</span>,
...dom.reverse(), ...dom.reverse(),
<Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, grade, differentiate) }} <Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, grade, differentiate) }}
disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'ROADMANAGE')[0].isshow === "true" ? true : ''} disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'ROADMANAGE')[0].isshow === "true" ? true : ''}
@ -3884,7 +3893,7 @@ const TransporTationTable = (props) => {
> >
导出 导出
</Button> </Button>
</Popconfirm> </Popconfirm>,
], ],
}} }}
> >

326
web/client/src/sections/fillion/components/uploads.js

@ -0,0 +1,326 @@
'use strict';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Spin, Upload, message, Modal, Card, Button } from 'antd';
import moment from 'moment';
import { PlusOutlined, UploadOutlined, CloseOutlined } from '@ant-design/icons';
class Uploads extends Component {
constructor(props) {
super(props);
this.ApiRoot = localStorage.getItem('tyApiRoot')
this.state = {
fileUploading: false,
fileList: [],
curPreviewPic: '',
delPicIng: false,
removeFilesList: []
};
}
dealName = (uploaded) => {
console.log(uploaded)
let realName = uploaded.split('/')[2]
let x1 = realName.split('.')
let x2 = x1[0].split('_')
let showName = `${x2[0]}.${x1[1]}`
return showName
}
setFileList = (value) => {
let defaultFileList = [];
defaultFileList = value.map((u, index) => {
let fileUrl = `${u.url}`;
return {
uid: -index - 1,
name: this.dealName(u.url),
status: 'done',
storageUrl: u.url,
url: fileUrl
};
});
// onChange(defaultFileList)
this.setState({
fileList: defaultFileList
});
};
componentDidMount () {
const { value } = this.props;
if (value) {
this.setFileList(value);
}
}
componentWillReceiveProps (np) {
const { dispatch, value: thisEditData, onChange } = this.props;
const { value: nextEditData, clearFileList } = np;
const setFileList = () => {
let defaultFileList = [];
defaultFileList = nextEditData.map((u, index) => {
let fileUrl = `${this.ApiRoot}/${u.storageUrl}`;
return {
uid: -index - 1,
name: this.dealName(u.storageUrl),
status: 'done',
storageUrl: u.storageUrl,
url: fileUrl,
size: u.size || -1
};
});
this.setState({
fileList: defaultFileList
});
};
if (nextEditData && nextEditData.length) {
if (!thisEditData || !this.state.fileList.length) {
setFileList();
} else if (nextEditData.length != thisEditData.length) {
setFileList();
} else {
let repeat = true;
for (let i = 0; i < thisEditData.length; i++) {
if (thisEditData[i] != nextEditData[i]) {
repeat = false;
break;
}
}
if (!repeat) {
setFileList();
}
}
}
if (clearFileList) {
this.setState({
fileList: []
});
}
// else{
// this.setState({
// fileList:[],
// })
// }
}
render () {
const UploadPath = {
project: ['txt', 'dwg', 'doc', 'docx', 'xls', 'xlsx', 'pdf', 'png', 'jpg', 'rar', 'zip'],
report: ['doc', 'docx', 'xls', 'xlsx', 'pdf'],
data: ['txt', 'xls', 'xlsx'],
image: ['png', 'jpg', 'svg', 'jpeg'],
three: ['js'],
video: ['mp4']
};
/**
* uploadType string 主要区别文件上传路径 以及类型 web/routes/attachment/index.js UploadPath key 值为准默认 project
* disabled boolean 上传是否可用
* maxFilesNum number 最大上传数量
* fileTypes array[string] 可允许上传的文件类型
* maxFileSize number 单个文件最大大小 M
* listType antd upload 组件的属性
* onChange function 文件数量变化时候回调 返回文件
* value array[obj] 编辑数据 [{url:'xxx', [size:999]}]
* onStateChange function 文件状态改变回调函数 上传中 return { uploading:true/false }
*/
const {
uploadType,
disabled,
maxFilesNum,
fileTypes,
maxFileSize,
listType,
onChange,
value,
showUploadList,
onStateChange
} = this.props;
const { fileList, curPreviewPic, delPicIng, removeFilesList } = this.state;
const that = this;
let uploadType_ = uploadType || 'project';
let maxFilesNum_ = maxFilesNum || 1;
let defaultFileTypes = fileTypes || UploadPath[uploadType_];
const uploadProps = {
name: 'checkFile_',
multiple: false,
showUploadList: showUploadList || true,
action: `${this.ApiRoot}/attachments/${uploadType_}`,
listType: listType || 'text',
disabled: disabled,
beforeUpload: (file) => {
if (fileList.length >= maxFilesNum_) {
message.warning(`最多选择${maxFilesNum_}个文件上传`);
return false;
}
if (file.name.length > 60) {
message.warning(`文件名过长(大于60字符),请修改后上传`);
return false;
}
const extNames = file.name.split('.');
var reg = /^[\.\s\u4e00-\u9fa5a-zA-Z0-9_-]{0,}$/;
if (!reg.exec(file.name)) {
message.warning(`文件名包含除字母、汉字、数字、中划线、下划线之外的字符,请修改后上传`);
return false;
}
let isDAE = false;
if (extNames.length > 0) {
let fileType = extNames[extNames.length - 1].toLowerCase();
isDAE = defaultFileTypes.some((f) => f == fileType);
}
if (!isDAE) {
message.error(`只能上传 ${defaultFileTypes.join()} 格式的文件!`);
return false;
}
const isLt = file.size / 1024 / 1024 < (maxFileSize || 3);
if (!isLt) {
message.error(`文件必须小于${maxFileSize || 3}MB!`);
return false;
}
this.setState({
fileUploading: true
});
if (onStateChange) {
onStateChange({ uploading: true });
}
},
onChange (info) {
const status = info.file.status;
if (status === 'uploading') {
that.setState({
fileList: info.fileList
});
}
if (status === 'done') {
let { uploaded, url } = info.file.response;
let size = info.file.size;
let nextFileList = fileList;
nextFileList[nextFileList.length - 1] = {
uid: -moment().unix(),
name: that.dealName(uploaded),
status: 'done',
storageUrl: uploaded,
url: url,
size: size
};
onChange(nextFileList);
that.setState({
fileUploading: false,
fileList: nextFileList
});
if (onStateChange) {
onStateChange({ uploading: false });
}
} else if (status === 'error') {
that.setState({
fileUploading: false
});
message.error(`${info.file.name} 上传失败,请重试`);
if (onStateChange) {
onStateChange({ uploading: false });
}
}
},
onRemove (file) {
let nextFileList = [];
fileList.map((f, i) => {
if (f.uid != file.uid) {
nextFileList.push(f);
}
});
let nextRemoveFiles = removeFilesList.concat([file.storageUrl]);
if (curPreviewPic == file.url) {
that.setState({
curPreviewPic: ''
});
}
onChange(nextFileList);
that.setState({
fileList: nextFileList,
removeFilesList: nextRemoveFiles
});
},
onPreview (file) {
let filePostfix = file.url.split('.').pop();
filePostfix = filePostfix.toLowerCase();
if (UploadPath.image.some((img) => img == filePostfix)) {
that.setState({
curPreviewPic: file.url
});
} else {
message.warn('仅支持图片预览');
}
}
};
let fileList_ = fileList
// .map(f => {
// if (f.storageUrl) {
// let realName = f.storageUrl.split('/').pop()
// if (f.name != realName) {
// f.name = realName
// }
// }
// return f
// })
console.log('fileList_:', fileList_);
return (
<div>
<Spin spinning={delPicIng}>
<Upload {...uploadProps} fileList={fileList_}>
{
disabled ? (
''
) :
listType == 'picture-card' ?
(
fileList.length >= maxFilesNum_ ? null : (
<div style={{}}>
<PlusOutlined />
<div>上传图片</div>
</div>
)
) : (
<Button disabled={fileList.length >= maxFilesNum_} icon={<UploadOutlined />}> 文件上传 </Button>
)
}
</Upload>
{
curPreviewPic ? (
<Card
bodyStyle={{
padding: 8
}}
>
<div style={{ marginBottom: 8 }} >
<span>文件预览</span>
<span
style={{ float: 'right' }}
onClick={() => { this.setState({ curPreviewPic: '' }); }}
>
<CloseOutlined style={{ fontSize: 20 }} />
</span>
</div>
<img style={{ width: '100%' }} src={curPreviewPic}></img>
</Card>
) : ''
}
</Spin>
</div>
);
}
}
function mapStateToProps (state) {
const { auth } = state
return {
user: auth.user
};
}
export default connect(mapStateToProps)(Uploads);

61
web/client/src/sections/fillion/containers/luzheng.js

@ -4,8 +4,9 @@ import { getAssess, delAssess, editAssess } from '../actions/assess';
import { getRoadadministration,addRoadadministration,delRoadadministration,modifyRoadadministration } from '../actions/luzheng'; import { getRoadadministration,addRoadadministration,delRoadadministration,modifyRoadadministration } from '../actions/luzheng';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import AssessModal from '../components/luzhengmodel'; import AssessModal from '../components/luzhengmodel';
import { Form, Space, DatePicker, Button, Select, Popconfirm } from 'antd' import { Form, Space, DatePicker, Button, Select, Popconfirm ,Image} from 'antd'
import moment from 'moment'; import moment from 'moment';
import { values } from 'lodash';
export const unitList = [ export const unitList = [
'县道', '县道',
@ -34,9 +35,13 @@ function Assess(props) {
const [query, setQuery] = useState({ page: 1, pageSize: 10 }) const [query, setQuery] = useState({ page: 1, pageSize: 10 })
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [isCheck, setIsCheck] = useState(false) const [isCheck, setIsCheck] = useState(false)
const [datasource,setdatasource] = useState([])
const [dateRange, setDateRange] = useState(['1970-1-1', '2099-12-31']);
const { RangePicker } = DatePicker
const [total,settotal]= useState(0)
const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.find(i => i.resourceId === 'ASSESSMANAGE')?.isshow === "true" ? true : '') const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.find(i => i.resourceId === 'ASSESSMANAGE')?.isshow === "true" ? true : '')
useEffect(() => { useEffect(() => {
dispatch(getRoadadministration()).then(res=>{console.log(res,'res')})
return () => { }; return () => { };
}, []); }, []);
@ -47,7 +52,11 @@ function Assess(props) {
const getData = () => { const getData = () => {
setLoading(true) setLoading(true)
dispatch(getRoadadministration(query)).then(res => { dispatch(getRoadadministration(query)).then(res => {
if(res?.success){
setdatasource(res?.payload?.data?.rows)
settotal(res?.payload?.data?.count)
setLoading(false) setLoading(false)
}
}) })
} }
@ -55,20 +64,14 @@ function Assess(props) {
<div> <div>
<div style={{ marginBottom: '20px', display: 'flex', justifyContent: 'space-between' }}> <div style={{ marginBottom: '20px', display: 'flex', justifyContent: 'space-between' }}>
<Form layout="inline" onFinish={(v) => { <Form layout="inline" onFinish={(v) => {
setQuery({ ...query, unit: v.unit, month: v.month ? moment(v.month).format() : undefined })
setQuery({ ...query, page:1,unit: v.unit,startTime : v?.time && moment(v?.time[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'),
endTime : v?.time && moment(v?.time[1]).add(1, 'days').endOf('day').format('YYYY-MM-DD HH:mm:ss') })
}}> }}>
<Form.Item name="unit" label="责任单位" >
<Select style={{ width: 200 }} placeholder="全部" allowClear>
{
unitList.map(item => (
<Option value={item} key={item} />
))
}
</Select>
</Form.Item>
<Form.Item name="month" label="考核月份">
<DatePicker picker="month" style={{ width: 200 }} /> <Form.Item name="time" label="执行日期">
<RangePicker onChange={(date, dateString) => { setDateRange(dateString) }} style={{ marginRight: '50px' }} />
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
@ -86,6 +89,9 @@ function Assess(props) {
title: '执法日期', title: '执法日期',
dataIndex: 'enforcementdate', dataIndex: 'enforcementdate',
key: 'enforcementdate', key: 'enforcementdate',
render:(t,r)=>{
return r?.enforcementdate?moment(r?.enforcementdate).format('YYYY-MM-DD'):'--'
}
}, },
{ {
title: '执法道路', title: '执法道路',
@ -101,6 +107,23 @@ function Assess(props) {
title: '执法图片', title: '执法图片',
dataIndex: 'picfile', dataIndex: 'picfile',
key: 'picfile', key: 'picfile',
render:(t,r)=>{
if(r?.picfile && r?.picfile?.length!==0){
return r?.picfile?.map(i=>{
return <span style={{marginRight:10}}>
<Image src={i?.url} width={80}/>
</span>
})
}else{
return '--'
}
}
}, },
{ {
title: '操作', title: '操作',
@ -115,13 +138,13 @@ function Assess(props) {
<Button type="link" onClick={() => { <Button type="link" onClick={() => {
setAssessModalVisible(true) setAssessModalVisible(true)
setEditData(record) setEditData(record)
disabled = { editAble }
}}>编辑</Button> }} disabled = { editAble }>编辑</Button>
<Popconfirm <Popconfirm
title="确定删除此条数据吗?" title="确定删除此条数据吗?"
onConfirm={() => { onConfirm={() => {
setLoading(true) setLoading(true)
dispatch(delAssess({ id: record.id })).then(res => { dispatch(delRoadadministration(record.id)).then(res => {
setLoading(false) setLoading(false)
if (res.success) { if (res.success) {
getData() getData()
@ -134,10 +157,10 @@ function Assess(props) {
</span> </span>
), ),
},]} },]}
dataSource={assess.rows || []} dataSource={datasource || []}
loading={loading} loading={loading}
pagination={{ pagination={{
total: assess?.count || 0, total: total || 0,
pageSize: 10, pageSize: 10,
defaultPageSize: 10, defaultPageSize: 10,
showSizeChanger: false, showSizeChanger: false,

1
web/client/src/sections/fillion/containers/maintenanceSpotCheck.js

@ -61,6 +61,7 @@ const DetailForm = (props) => {
{ key: '修复端头(块)', name: 'endHeadRepair' }, { key: '修复端头(块)', name: 'endHeadRepair' },
{ key: '其他养护内容', name: 'otherDescription' }, { key: '其他养护内容', name: 'otherDescription' },
{ key: '养护前图片', name: 'conserveBeforePic' }, { key: '养护前图片', name: 'conserveBeforePic' },
{ key: '养护中图片', name: 'conserveUnderwayPic' },
{ key: '养护后图片', name: 'conserveAfterPic' }, { key: '养护后图片', name: 'conserveAfterPic' },
{ key: '上报视频', name: 'videoUrl' }, { key: '上报视频', name: 'videoUrl' },

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

@ -20,20 +20,22 @@ export function getNavItem(user, dispatch) {
i.resourceId === 'ASSESSMANAGE' || i.resourceId === 'ASSESSMANAGE' ||
i.resourceId === 'VIDEOCENTER' || i.resourceId === 'VIDEOCENTER' ||
i.resourceId === 'BUILDINGPROJECT' || i.resourceId === 'BUILDINGPROJECT' ||
i.resourceId === 'MAINTENANCESPOTCHECK' i.resourceId === 'MAINTENANCESPOTCHECK' ||
i.resourceId === 'LUZHENG'
) )
return ( return (
user?.username == 'SuperAdmin' || isshow ? user?.username == 'SuperAdmin' || isshow ?
<SubMenu key="fillion" icon={<ReadOutlined />} title={'数据管理'}> <SubMenu key="fillion" icon={<ReadOutlined />} title={'数据管理'}>
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'OVERLOADMANAGE') ? {/* {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'OVERLOADMANAGE') ?
<Menu.Item key="fillioninfor"> <Menu.Item key="fillioninfor">
<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?.some(i => i.resourceId === 'OVERLOADMANAGE') ?
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'LUZHENG') ?
<Menu.Item key="luzheng"> <Menu.Item key="luzheng">
<Link to="/fillion/luzheng">路政管理</Link> <Link to="/fillion/luzheng">路政管理</Link>
</Menu.Item> : ''} </Menu.Item> : ''}

12
web/client/src/sections/quanju/containers/footer/build/Leftbottom.js

@ -21,6 +21,12 @@ function Leftbottom(props) {
{ name: '乡道', value: 17 }, { name: '乡道', value: 17 },
{ name: '村道', value: 4 }, { name: '村道', value: 4 },
] ]
//写死数据
const dataNo = [
{ name: '县', value: 207.8 },
{ name: '乡', value: 680.5 },
{ name: '村', value: 1800.7 },
]
const chartTitle = '道路总公里'; const chartTitle = '道路总公里';
const title = '基础设施安全监测版块'; const title = '基础设施安全监测版块';
let name = [], emptyName = [] let name = [], emptyName = []
@ -229,7 +235,8 @@ legend: {
label: { label: {
show: false show: false
}, },
data: data, data: dataNo,
// data: data,
}, },
], ],
}; };
@ -276,7 +283,8 @@ legend: {
<div className='build-left-bottom'> <div className='build-left-bottom'>
<span style={{ position: "absolute", width: "10%", color: "#FFF", backgroundColor: 'rgba(216, 240, 255, 0.1)', right: "5%", textAlign: "center", top: 0 }}>公里</span> <span style={{ position: "absolute", width: "10%", color: "#FFF", backgroundColor: 'rgba(216, 240, 255, 0.1)', right: "5%", textAlign: "center", top: 0 }}>公里</span>
<div className='build-left-bottom-title'> <div className='build-left-bottom-title'>
<h2>{total}</h2> <h2>2689.00</h2>
{/* <h2>{total}</h2> */}
<span>道路总公里</span> <span>道路总公里</span>
</div> </div>
<img src='/assets/images/quanju/chart-circle.png'></img> <img src='/assets/images/quanju/chart-circle.png'></img>

3
web/client/src/sections/quanju/containers/footer/build/Rightbottom.js

@ -217,7 +217,8 @@ function Rightbottom (props) {
</div> </div>
{/* <span style={{position:"absolute",width:"10%",color:"#FFF",backgroundColor:'rgba(216, 240, 255, 0.1)',right:"5%",textAlign:"center",top:0}}>段</span> */} {/* <span style={{position:"absolute",width:"10%",color:"#FFF",backgroundColor:'rgba(216, 240, 255, 0.1)',right:"5%",textAlign:"center",top:0}}>段</span> */}
<div className='build-right-bottom-title'> <div className='build-right-bottom-title'>
<h2>{total || 0}</h2> {/* <h2>{total || 0}</h2> */}
<h2>2689.00</h2>
<span>道路总公里</span> <span>道路总公里</span>
</div> </div>
{/* <div className='img1'> {/* <div className='img1'>

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

@ -27,7 +27,6 @@ const THIRD = "linear-gradient(360deg, rgba(148, 148, 255, 0.1) 0%, rgba(148, 14
const OTHER = "linear-gradient(360deg, rgba(28, 96, 253, 0) 0%, rgba(28, 96, 253, 0.2) 100%)" const OTHER = "linear-gradient(360deg, rgba(28, 96, 253, 0) 0%, rgba(28, 96, 253, 0.2) 100%)"
let TOTALS = data?.map(({ name, total }, index) => { let TOTALS = data?.map(({ name, total }, index) => {
let max = Math.max(...data.map(item=>item.total)) let max = Math.max(...data.map(item=>item.total))
// console.log(data.map(item=>item.total),'好朋友吗')
return { return {
name, name,
value: total, value: total,
@ -38,7 +37,6 @@ let new_TOTALS = TOTALS && TOTALS.length > 10 ? TOTALS.slice(0, 10) : TOTALS
function Cell(props) { function Cell(props) {
const { name, rank, value, percent, style = {},cebg } = props const { name, rank, value, percent, style = {},cebg } = props
let bg = RNAKS[rank] || OTHER let bg = RNAKS[rank] || OTHER
// console.log(percent,'百分比')
return <div style={{ return <div style={{
width: "100%", height: 34, display: "flex", justifyContent: 'center', width: "100%", height: 34, display: "flex", justifyContent: 'center',
alignItems: "center", marginTop: 7, marginBottom: 7, alignItems: "center", marginTop: 7, marginBottom: 7,

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

@ -13,9 +13,11 @@ import AutoRollComponent from './AutoRollComponent'
import './style.less' import './style.less'
import { getdaolutongji, getxuanchuan } from '../../../actions/example' import { getdaolutongji, getxuanchuan } from '../../../actions/example'
import { Carousel } from 'antd'; import { Carousel } from 'antd';
import { getProject } from '../../../../fillion/actions/infor'
// import { number } from 'echarts'; // import { number } from 'echarts';
const Build = (props) => { const Build = (props) => {
const { dispatch } = props const { dispatch, projectList } = props
let data1 = [ let data1 = [
{ name: "县", value: 207 }, { name: "县", value: 207 },
{ name: "乡", value: 729 }, { name: "乡", value: 729 },
@ -26,8 +28,6 @@ const Build = (props) => {
// {name: '二级公路', value: 17}, // {name: '二级公路', value: 17},
// {name: '三级公路', value: 17}, // {name: '三级公路', value: 17},
// {name: '四级公路', value: 30}, // {name: '四级公路', value: 30},
// ] // ]
const [buildingnumber, setbuildingnumber] = useState(0) const [buildingnumber, setbuildingnumber] = useState(0)
const [data, setdata] = useState([]) const [data, setdata] = useState([])
@ -43,22 +43,17 @@ const Build = (props) => {
const requestbuildingnumber = async () => { const requestbuildingnumber = async () => {
const res = await dispatch(getdaolutongji()); const res = await dispatch(getdaolutongji());
let alltype = Object.keys(res.payload.data?.roadType || {}).map((item) => ({ name: item, value: Number(keepThreeNum(res.payload.data.roadType[item])) })) let alltype = Object.keys(res.payload.data?.roadType || {}).map((item) => ({ name: item, value: Number(keepThreeNum(res.payload.data.roadType[item])) }))
// console.log(alltype,'打他啊')
setdata(alltype.filter(item => item.name === '县' || item.name === "乡" || item.name === '村')) setdata(alltype.filter(item => item.name === '县' || item.name === "乡" || item.name === '村'))
setbuildingnumber(res.payload.data) setbuildingnumber(res.payload.data)
console.log(res.payload.data, '哈哈哈')
} }
//获取宣传栏数据 //获取宣传栏数据
const requestxuanchuanlan = async () => { const requestxuanchuanlan = async () => {
const res = await dispatch(getxuanchuan()); const res = await dispatch(getxuanchuan());
// setdata(alltype.filter(item=>item.name!=='null')) // setdata(alltype.filter(item=>item.name!=='null'))
setxuandata(res.payload.data || []) setxuandata(res.payload.data || [])
console.log(res.payload.data, '宣传栏数据')
} }
let t1 = Object.values(buildingnumber?.townRoad || {}) let t1 = Object.values(buildingnumber?.townRoad || {})
let totalgongli = t1.length !== 0 ? t1.reduce((x, y) => x + y.mileage, 0) : 0 //乡镇道路占比总公里数 let totalgongli = t1.length !== 0 ? t1.reduce((x, y) => x + y.mileage, 0) : 0 //乡镇道路占比总公里数
@ -86,7 +81,6 @@ const Build = (props) => {
return b.number - a.number return b.number - a.number
}) })
list = list.filter(item => item.name !== "其他") list = list.filter(item => item.name !== "其他")
// console.log(list,'红红火')
//道路等级数据 //道路等级数据
let alldengji = Object.keys(buildingnumber?.roadLevel || {}).map((item) => ({ name: item, value: Number(keepThreeNum(buildingnumber.roadLevel[item])) })) let alldengji = Object.keys(buildingnumber?.roadLevel || {}).map((item) => ({ name: item, value: Number(keepThreeNum(buildingnumber.roadLevel[item])) }))
@ -95,10 +89,8 @@ const Build = (props) => {
onlineproject = onlineproject.sort((a, b) => { onlineproject = onlineproject.sort((a, b) => {
return b.total - a.total return b.total - a.total
}) })
//console.log('onlineproject', onlineproject)
let sunonlineproject = onlineproject?.reduce((x, y) => x + y.total, 0) let sunonlineproject = onlineproject?.reduce((x, y) => x + y.total, 0)
let buildingCount = buildingnumber?.buildingCount let buildingCount = buildingnumber?.buildingCount
//console.log('projectAll', projectAll)
//let projectAll= //let projectAll=
let safetyData = alldengji?.filter(item => item.name === '一级公路' || item.name === '二级公路' || item.name === '三级公路' || item.name === '四级公路' || item.name === '等外公路') let safetyData = alldengji?.filter(item => item.name === '一级公路' || item.name === '二级公路' || item.name === '三级公路' || item.name === '四级公路' || item.name === '等外公路')
let sundata = data?.reduce((x, y) => x + y.value, 0) let sundata = data?.reduce((x, y) => x + y.value, 0)
@ -107,10 +99,13 @@ const Build = (props) => {
useEffect(() => { useEffect(() => {
requestbuildingnumber(); requestbuildingnumber();
requestxuanchuanlan() requestxuanchuanlan()
dispatch(getProject())
}, []) }, [])
useEffect(() => { useEffect(() => {
lunbo.current.goTo(lunboindex) lunbo.current.goTo(lunboindex)
}, [lunboindex]) }, [lunboindex])
const rendercontent = () => { const rendercontent = () => {
return (<div className='build-left-center-content'> return (<div className='build-left-center-content'>
{list.map(({ name, number, gongli }, index) => <div className='build-left-center-item' key={index}> {list.map(({ name, number, gongli }, index) => <div className='build-left-center-item' key={index}>
@ -128,8 +123,6 @@ const Build = (props) => {
// "enable": true // "enable": true
// } // }
// ] // ]
// console.log(localStorage.getItem("qndmn"), '七牛')
// console.log(xuandata, "宣传")
let videos = [] let videos = []
if (xuandata && xuandata.length) { if (xuandata && xuandata.length) {
@ -143,7 +136,7 @@ const Build = (props) => {
} }
} }
} }
console.log(lunboindex)
return ( return (
<> <>
<div className='bgbuild-left'> <div className='bgbuild-left'>
@ -174,11 +167,13 @@ const Build = (props) => {
</div> : <NoData />} </div> : <NoData />}
</div> </div>
</Module> </Module>
<Module title={"各乡镇现有道路统计"} style={{ {/* <Module title={""} style={{
width: "100%", width: "100%",
height: " 33%", marginTop: '3%' height: " 33%", marginTop: '3%'
}} customize={true}> }} customize={true}>
{totalcount && totalcount !== 0 ? <div className='build-left-center'> {
totalcount && totalcount !== 0 ?
<div className='build-left-center'>
<div className='build-left-center-top'> <div className='build-left-center-top'>
<div> <div>
<img src='/assets/images/quanju/gonglugongli.png'></img> <img src='/assets/images/quanju/gonglugongli.png'></img>
@ -202,7 +197,45 @@ const Build = (props) => {
</div> </div>
<AutoRollComponent content={rendercontent()} containerStyle={{ position: "relative", height: "50%", }} <AutoRollComponent content={rendercontent()} containerStyle={{ position: "relative", height: "50%", }}
divHeight={"100%"} divId={"chart"} /> divHeight={"100%"} divId={"chart"} />
</div> : <NoData />} </div>
: <NoData />
}
</Module> */}
<Module title={"在建项目列表"} style={{
width: "100%",
height: " 33%", marginTop: '3%'
}} customize={true}>
{
totalcount && totalcount !== 0 ?
<div className='build-left-center' style={{ padding: 12 }}>
<div className='build-left-center'>
<div className='build-left-center-titile'>
<span>项目名称</span>
<span>项目规模(公里)</span>
<span>项目投资(万元)</span>
</div>
<AutoRollComponent content={
<div className='build-left-center-content'>
{
projectList.map((p, index) => {
return (
<div className='build-left-center-item' key={index}>
<span className='ellipsis' title={p.entryName}>{p.entryName}</span>
<span>{p.projectMileage}</span>
<span>{p.investment}</span>
</div>
)
})
}
</div>
}
containerStyle={{ position: "relative", height: "85%", }}
divHeight={"100%"} divId={"chart"}
/>
</div>
</div>
: <NoData />
}
</Module> </Module>
<Module title={"道路统计"} style={{ <Module title={"道路统计"} style={{
width: "100%", width: "100%",
@ -213,6 +246,7 @@ const Build = (props) => {
width='100%' width='100%'
height='100%' height='100%'
text='道路总公里' text='道路总公里'
//total={keepThreeNum(sundata)}
total={keepThreeNum(sundata)} total={keepThreeNum(sundata)}
// colorList={colorList} // colorList={colorList}
// underColorList={underColorList} // underColorList={underColorList}
@ -231,17 +265,13 @@ const Build = (props) => {
<Carousel dots={false} ref={lunbo} key={lunboindex}> <Carousel dots={false} ref={lunbo} key={lunboindex}>
{/* { {/* {
videos.map((v, i) => { videos.map((v, i) => {
console.log('first')
return i == lunboMsg.current.index ? return i == lunboMsg.current.index ?
<video src={`${localStorage.getItem("qndmn")}/${v}`} key={Math.random()} autoPlay={i == lunboMsg.current.index} onEnded={() => { <video src={`${localStorage.getItem("qndmn")}/${v}`} key={Math.random()} autoPlay={i == lunboMsg.current.index} onEnded={() => {
console.log('end', i + 1, videos.length)
if (i == videos.length - 1) { if (i == videos.length - 1) {
setlunboindex(0) setlunboindex(0)
lunboMsg.current.index = 0 lunboMsg.current.index = 0
lunbo.current.goTo(1) lunbo.current.goTo(1)
} else { } else {
console.log('first222', i + 1)
setlunboindex(i + 1) setlunboindex(i + 1)
lunboMsg.current.index = i + 1 lunboMsg.current.index = i + 1
lunbo.current.next() lunbo.current.next()
@ -256,23 +286,16 @@ const Build = (props) => {
if (item.video && item.video !== null && item.video.length !== 0) { if (item.video && item.video !== null && item.video.length !== 0) {
return item.video.map((i, index) => { return item.video.map((i, index) => {
// console.log(i,'视频')
console.log(index1, 'index1')
if (index1 === lunboindex) { if (index1 === lunboindex) {
// lunbo.current.goTo(lunboindex)
console.log("自动播放", index1)
return <video src={`${localStorage.getItem("qndmn")}/${i}`} autoPlay={true} ref={lunbovideo} onEnded={() => { return <video src={`${localStorage.getItem("qndmn")}/${i}`} autoPlay={true} ref={lunbovideo} onEnded={() => {
if (index1 < xuandata.filter(i => i.enable).length - 1) { if (index1 < xuandata.filter(i => i.enable).length - 1) {
// console.log(index1,xuandata,'触发了')
setlunboindex(lunboindex + 1) setlunboindex(lunboindex + 1)
} else { } else {
// console.log(index1,xuandata,'触发了')
setlunboindex(0) setlunboindex(0)
} }
}}></video> }}></video>
} else { } else {
// console.log("不自动播放",index1)
return <video src={`${localStorage.getItem("qndmn")}/${i}`} autoPlay={false} ></video> return <video src={`${localStorage.getItem("qndmn")}/${i}`} autoPlay={false} ></video>
} }
}) })
@ -308,7 +331,7 @@ const Build = (props) => {
) )
} }
function mapStateToProps (state) { function mapStateToProps (state) {
const { auth, depMessage } = state; const { auth, depMessage, projectList } = state;
const pakData = (dep) => { const pakData = (dep) => {
return dep.map((d) => { return dep.map((d) => {
return { return {
@ -325,6 +348,7 @@ function mapStateToProps(state) {
depMessage: depMessage.data || [], depMessage: depMessage.data || [],
depLoading: depMessage.isRequesting, depLoading: depMessage.isRequesting,
depData, depData,
projectList: projectList.data || []
}; };
} }
export default connect(mapStateToProps)(Build); export default connect(mapStateToProps)(Build);

8
web/client/src/sections/quanju/containers/footer/build/style.less

@ -158,6 +158,14 @@
height: 28px; height: 28px;
align-items: center; align-items: center;
.ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 144px;
display: inline-block;
}
&:hover { &:hover {
background: linear-gradient(270deg, rgba(0, 124, 230, 0) 0%, rgba(0, 70, 200, 0.8700) 100%); background: linear-gradient(270deg, rgba(0, 124, 230, 0) 0%, rgba(0, 70, 200, 0.8700) 100%);
} }

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

@ -104,8 +104,9 @@ const Right = (props) => {
<div style={{ width: "100%", height: "43%", position: "relative", left: "1%" }}> <div style={{ width: "100%", height: "43%", position: "relative", left: "1%" }}>
<div style={{ width: "96%", position: "relative", left: "2%" }}> <div style={{ width: "96%", position: "relative", left: "2%" }}>
{/* <Spin spinning={!roads} tip="Loading" > */} {/* <Spin spinning={!roads} tip="Loading" > */}
<p style={{ position: "absolute", color: "rgba(216,240,255,0.8)", top: "10px" }}>占比<span style={{ fontFamily: " PingFangSC-Regular, PingFang SC" }}>{isNaN(((roads?.["县"] / (roads?.["乡"] + roads?.["村"] + roads?.["县"])) * 100).toFixed(2)) ? "" : ((roads?.["县"] / (roads?.["乡"] + roads?.["村"] + roads?.["县"])) * 100).toFixed(2)}</span>%</p> <p style={{ position: "absolute", color: "rgba(216,240,255,0.8)", top: "10px" }}>占比<span style={{ fontFamily: " PingFangSC-Regular, PingFang SC" }}>{((207.8 / 2689) * 100).toFixed(2)}</span>%</p>
<p style={{ width: "50%", position: "absolute", right: "0%", fontFamily: "YouSheBiaoTiHei", textAlign: "right", fontSize: "24px", color: "#F5FCFF", marginLeft: "10%" }}>{isNaN(roads?.["县"].toFixed(3)) ? "" : roads?.["县"].toFixed(3)}<span style={{ color: "#F5FCFF", fontSize: "16px", fontFamily: "PingFangSC-Regular, PingFang SC", marginLeft: "5%" }}>公里</span><span style={{ fontSize: "18px", color: "rgba(216,240,255,0.8)", fontFamily: "PingFangSC-Regular, PingFang SC", marginLeft: "5%" }}></span></p> <p style={{ width: "50%", position: "absolute", right: "0%", fontFamily: "YouSheBiaoTiHei", textAlign: "right", fontSize: "24px", color: "#F5FCFF", marginLeft: "10%" }}>207.8<span style={{ color: "#F5FCFF", fontSize: "16px", fontFamily: "PingFangSC-Regular, PingFang SC", marginLeft: "5%" }}>公里</span><span style={{ fontSize: "18px", color: "rgba(216,240,255,0.8)", fontFamily: "PingFangSC-Regular, PingFang SC", marginLeft: "5%" }}></span></p>
{/* <p style={{ width: "50%", position: "absolute", right: "0%", fontFamily: "YouSheBiaoTiHei", textAlign: "right", fontSize: "24px", color: "#F5FCFF", marginLeft: "10%" }}>{isNaN(roads?.["县"].toFixed(3)) ? "" : roads?.["县"].toFixed(3)}<span style={{ color: "#F5FCFF", fontSize: "16px", fontFamily: "PingFangSC-Regular, PingFang SC", marginLeft: "5%" }}>公里</span><span style={{ fontSize: "18px", color: "rgba(216,240,255,0.8)", fontFamily: "PingFangSC-Regular, PingFang SC", marginLeft: "5%" }}>县道道路</span></p> */}
{/* </Spin> */} {/* </Spin> */}
</div> </div>
<div style={{ width: "96%", position: "relative", left: "2%", height: "50%" }}> <div style={{ width: "96%", position: "relative", left: "2%", height: "50%" }}>
@ -116,9 +117,12 @@ const Right = (props) => {
</div> </div>
<div style={{ width: "96%", position: "relative", left: "2%" }}> <div style={{ width: "96%", position: "relative", left: "2%" }}>
{/* <Spin spinning={!roads} tip="Loading" > */} {/* <Spin spinning={!roads} tip="Loading" > */}
<p style={{ width: "50%", position: "absolute", color: "rgba(216,240,255,0.8)", fontSize: "18px" }}>乡村道道路<span style={{ marginLeft: "4%", fontFamily: "YouSheBiaoTiHei", fontSize: "24px", color: "#F5FCFF" }}></span>2481.2<span style={{ marginLeft: "4%" }}></span></p>
<p style={{ width: "50%", position: "absolute", color: "rgba(216,240,255,0.8)", fontSize: "18px" }}>乡村道道路<span style={{ marginLeft: "4%", fontFamily: "YouSheBiaoTiHei", fontSize: "24px", color: "#F5FCFF" }}>{isNaN((roads?.["乡"] + roads?.["村"]).toFixed(3)) ? "" : (roads?.["乡"] + roads?.["村"]).toFixed(3)}</span><span style={{ marginLeft: "4%" }}></span></p> {/* <p style={{ width: "50%", position: "absolute", color: "rgba(216,240,255,0.8)", fontSize: "18px" }}>乡村道道路<span style={{ marginLeft: "4%", fontFamily: "YouSheBiaoTiHei", fontSize: "24px", color: "#F5FCFF" }}>{isNaN((roads?.["乡"] + roads?.["村"]).toFixed(3)) ? "" : (roads?.["乡"] + roads?.["村"]).toFixed(3)}</span><span style={{ marginLeft: "4%" }}>公里</span></p> */}
<p style={{ position: "absolute", right: "0", color: "rgba(216,240,255,0.8)", top: "10px" }}>占比<span>{isNaN((((roads?.["乡"] + roads?.["村"]) / (roads?.["乡"] + roads?.["村"] + roads?.["县"])) * 100).toFixed(2)) ? "" : (((roads?.["乡"] + roads?.["村"]) / (roads?.["乡"] + roads?.["村"] + roads?.["县"])) * 100).toFixed(2)}</span><span>%</span></p> <p style={{ position: "absolute", right: "0", color: "rgba(216,240,255,0.8)", top: "10px" }}>占比<span>{((2481.2 / 2689) * 100).toFixed(2)}</span><span>%</span></p>
{/* <p style={{ position: "absolute", right: "0", color: "rgba(216,240,255,0.8)", top: "10px" }}>占比<span>{isNaN((((roads?.["乡"] + roads?.["村"]) / (roads?.["乡"] + roads?.["村"] + roads?.["县"])) * 100).toFixed(2)) ? "" : (((roads?.["乡"] + roads?.["村"]) / (roads?.["乡"] + roads?.["村"] + roads?.["县"])) * 100).toFixed(2)}</span><span>%</span></p> */}
{/* </Spin> */} {/* </Spin> */}
</div> </div>

8
web/client/src/sections/quanju/containers/footer/leadership/centerleft/top.js

@ -39,7 +39,9 @@ const Leftcenter = (props) => {
</div> </div>
<div style={{ width: "50%", height: "100%", position: "absolute", left: "50%", top: "11%" }}> <div style={{ width: "50%", height: "100%", position: "absolute", left: "50%", top: "11%" }}>
<p style={{ fontSize: "2vh", color: "#D8F0FF", fontFamily: "PingFangSC-Regular, PingFang SC", marginTop: "3%" }}>道路统计<span style={{ marginLeft: "10px", color: "rgba(216,240,255,0.8000)" }}>公里</span></p> <p style={{ fontSize: "2vh", color: "#D8F0FF", fontFamily: "PingFangSC-Regular, PingFang SC", marginTop: "3%" }}>道路统计<span style={{ marginLeft: "10px", color: "rgba(216,240,255,0.8000)" }}>公里</span></p>
<p style={{ fontFamily: "YouSheBiaoTiHei", color: "#ffffff", fontSize: "2.5vh", marginTop: "-2%" }}>{isNaN((list?.["县"] + list?.["乡"] + list?.["村"]).toFixed(3)) ? "" : (list?.["县"] + list?.["乡"] + list?.["村"]).toFixed(3)}</p> {/* <p style={{ fontFamily: "YouSheBiaoTiHei", color: "#ffffff", fontSize: "2.5vh", marginTop: "-2%" }}>{isNaN((list?.["县"] + list?.["乡"] + list?.["村"]).toFixed(3)) ? "" : (list?.["县"] + list?.["乡"] + list?.["村"]).toFixed(3)}</p> */}
<p style={{ fontFamily: "YouSheBiaoTiHei", color: "#ffffff", fontSize: "2.5vh", marginTop: "-2%" }}>2689</p>
</div> </div>
</div> </div>
<div style={{ width: "30%", height: "10vh", backgroundColor: "", position: "relative", left: "35%", top: "-105%" }} onClick={() => { <div style={{ width: "30%", height: "10vh", backgroundColor: "", position: "relative", left: "35%", top: "-105%" }} onClick={() => {
@ -67,7 +69,9 @@ const Leftcenter = (props) => {
</div> </div>
<div style={{ width: "50%", height: "100%", position: "absolute", left: "50%", top: "8%" }}> <div style={{ width: "50%", height: "100%", position: "absolute", left: "50%", top: "8%" }}>
<p style={{ fontSize: "2vh", color: "#D8F0FF", fontFamily: "PingFangSC-Regular, PingFang SC", marginTop: "3%" }}>桥梁统计<span style={{ fontSize: "14px", marginLeft: "10px", color: "rgba(216,240,255,0.8000)" }}></span></p> <p style={{ fontSize: "2vh", color: "#D8F0FF", fontFamily: "PingFangSC-Regular, PingFang SC", marginTop: "3%" }}>桥梁统计<span style={{ fontSize: "14px", marginLeft: "10px", color: "rgba(216,240,255,0.8000)" }}></span></p>
<p style={{ fontFamily: "YouSheBiaoTiHei", color: "#00F1FF", fontSize: "2.5vh", marginTop: "-2%" }}>{isNaN((bridge?.["小桥"] + bridge?.["中桥"] + bridge?.["大桥"])) ? "" : (bridge?.["小桥"] + bridge?.["中桥"] + bridge?.["大桥"])}</p> <p style={{ fontFamily: "YouSheBiaoTiHei", color: "#00F1FF", fontSize: "2.5vh", marginTop: "-2%" }}>165</p>
{/* <p style={{ fontFamily: "YouSheBiaoTiHei", color: "#00F1FF", fontSize: "2.5vh", marginTop: "-2%" }}>{isNaN((bridge?.["小桥"] + bridge?.["中桥"] + bridge?.["大桥"])) ? "" : (bridge?.["小桥"] + bridge?.["中桥"] + bridge?.["大桥"])}</p> */}
</div> </div>
</div> </div>
</div> </div>

92
web/client/src/sections/quanju/containers/footer/operation/right.js

@ -1,8 +1,13 @@
import React, { useState } from 'react' import React, { useState } from 'react'
import { Carousel } from 'antd'; import { Carousel, Input } from 'antd';
import Module from '../../public/module' import Module from '../../public/module'
import AutoRollComponent from '../build/AutoRollComponent'
import { useEffect } from 'react';
import { connect } from 'react-redux';
import { busWillRun } from '../../public/olMap'
const Right = () => { let queryTimeout = null
const Right = ({ busRunTime }) => {
const [dataLists, setDataList] = useState([ const [dataLists, setDataList] = useState([
{ {
route: '147', route: '147',
@ -21,19 +26,86 @@ const Right = () => {
plate: '赣APJ337' plate: '赣APJ337'
} }
]) ])
const [busRunTimeList, setBusRunTimeList] = useState(busRunTime)
const [queryStr, setQueryStr] = useState('')
useEffect(() => {
setBusRunTimeList(
queryStr ?
busRunTime.filter(b => {
return b?.busNoChar?.indexOf(queryStr) > -1
})
: busRunTime
)
}, [queryStr, busRunTime])
const style = { height: "97%", marginTop: "3%" } const style = { height: "97%", marginTop: "3%" }
return ( return (
<div style={{ position: 'absolute', right: 0, width: "23%", height: "100%", marginRight: "1%", }}> <div style={{ position: 'absolute', right: 0, width: "23%", height: "100%", marginRight: "1%", }}>
<Module style={style} customize={true} title={"车辆视频监控"}> <Module style={style} customize={true}
// title={"车辆视频监控"}
title={"公交运营信息"}
>
<div style={{ width: '90%', height: '96%', margin: '2% 5%', overflow: 'hidden' }}> <div style={{ width: '90%', height: '96%', margin: '2% 5%', overflow: 'hidden' }}>
<div style={{ border: '1px solid rgba(10, 114, 255, 1)', backgroundColor: 'rgba(10, 114, 255, 0.1)' }}>
<img src='/assets/images/quanju/search.png' style={{ width: '5%', margin: '0 1.5% 1% 3.5%' }} />
<Input
style={{
width: '90%',
background: 'none',
backgroundColor: 'none',
color: 'rgba(216, 240, 255, 0.8)',
border: 'none',
boxShadow: 'none',
}}
placeholder="请输入车牌号"
onChange={(e) => {
if (queryTimeout) {
clearTimeout(queryTimeout)
}
queryTimeout = setTimeout(() => {
setQueryStr(e.target.value)
}, 600)
}}
/>
</div>
<Carousel <Carousel
autoplay autoplay
infinite infinite
autoplaySpeed={300000} // autoplaySpeed={300000}
autoplaySpeed={1000 * 3}
vertical={true} vertical={true}
slidesToShow={4} slidesToShow={4}
> >
{ {
busRunTimeList.map((d, index) => {
return (
<div key={index} style={{ width: '100%', height: '40%' }}>
<div className='busInformation'>
<img src='/assets/images/quanju/theBus.png' style={{ width: '15%', display: 'block', float: 'left' }} />
<span>
<h3>车辆牌照</h3>
<h5>{d.busNoChar}</h5>
<h3>调度状态</h3>
<h4>{busWillRun.find(w => w.value == d.willRun)?.text || '--'}</h4>
</span>
<span>
<h3>发车时间</h3>
<h5>{d.lastDepTime}</h5>
</span>
<span style={{ position: 'relative', left: '21%' }}>
<h3>司机</h3>
<h5>{d.employeeName}</h5>
<h3>工号</h3>
<h4>{d.opNo}</h4>
</span>
</div>
</div>
)
})
}
{/* {
dataLists.map((data, index) => ( dataLists.map((data, index) => (
<div key={index} style={{ width: '100%', height: '40%' }}> <div key={index} style={{ width: '100%', height: '40%' }}>
<div className='busInformation'> <div className='busInformation'>
@ -61,11 +133,19 @@ const Right = () => {
</div> </div>
</div> </div>
)) ))
} } */}
</Carousel> </Carousel>
</div> </div>
</Module> </Module>
</div> </div>
) )
} }
export default Right
function mapStateToProps (state) {
const { busRunTime, } = state;
return {
busRunTime: busRunTime.data || [],
};
}
export default connect(mapStateToProps)(Right);

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

@ -5,9 +5,21 @@ import Hua from '../footer/leadership/centerleft/hudong'
import moment from 'moment'; import moment from 'moment';
import { OlMapRequest } from '$utils' import { OlMapRequest } from '$utils'
export const busWillRun = [
{ text: '非运营', value: '0' },
{ text: '运营', value: '1' },
{ text: '维修', value: '2' },
{ text: '保养', value: '3' },
{ text: '专车', value: '4' },
{ text: '机动车', value: '5' },
{ text: '包车', value: '6' },
{ text: '班车', value: '7' },
{ text: '检车', value: '8' },
]
const OlMap = (props) => { const OlMap = (props) => {
const { dispatch, actions, user, olMapArcgisHost, olMapGeoDataHost, patrolList, roadProjectList, tab, busRunTime, busLine } = props const { dispatch, actions, user, olMapArcgisHost, olMapGeoDataHost, patrolList, roadProjectList, tab, busRunTime, busLine } = props
console.log(patrolList)
const [olMapOpenData, setOlMapOpenData] = useState([]) const [olMapOpenData, setOlMapOpenData] = useState([])
const [olMap, setOlMap] = useState() const [olMap, setOlMap] = useState()
const [pointItem, setPointItem] = useState({}) const [pointItem, setPointItem] = useState({})
@ -188,7 +200,6 @@ const OlMap = (props) => {
positioning: 'top-right' positioning: 'top-right'
}) })
// 请求路线坐标 // 请求路线坐标
console.log(d.code_road);
if (d.code_road) { if (d.code_road) {
let codeMap = { let codeMap = {
x: 'gpsxd', x: 'gpsxd',
@ -205,7 +216,6 @@ const OlMap = (props) => {
}) })
.then(res => { .then(res => {
if (res.status == 200 && res.body && res.body.code == 1) { if (res.status == 200 && res.body && res.body.code == 1) {
console.log(res);
const data = res.body.data const data = res.body.data
const { datalist } = data const { datalist } = data
if (datalist?.list?.length) { if (datalist?.list?.length) {
@ -365,17 +375,7 @@ const OlMap = (props) => {
}, { }, {
n: '调度状态', n: '调度状态',
v: d.willRun, v: d.willRun,
map: [ map: busWillRun,
{ text: '非运营', value: '0' },
{ text: '运营', value: '1' },
{ text: '维修', value: '2' },
{ text: '保养', value: '3' },
{ text: '专车', value: '4' },
{ text: '机动车', value: '5' },
{ text: '包车', value: '6' },
{ text: '班车', value: '7' },
{ text: '检车', value: '8' },
],
}, { }, {
n: '实际发车时间', n: '实际发车时间',
v: d.lastDepTime v: d.lastDepTime

Loading…
Cancel
Save