wenlele 2 years ago
parent
commit
780af164c6
  1. 2
      api/.vscode/launch.json
  2. 53
      api/app/lib/controllers/data/anspectionNotificationPhone.js
  3. 106
      api/app/lib/controllers/luzheng/index.js
  4. 35
      api/app/lib/models/inspection_notification_phone.js
  5. 65
      api/app/lib/models/roadadministration.js
  6. 8
      api/app/lib/routes/data/index.js
  7. 21
      api/app/lib/routes/luzheng/index.js
  8. 8
      scripts/1.3.0/schema/6.roadadministration.sql
  9. 23
      weapp/src/packages/patrol/index.jsx
  10. 4
      web/client/src/sections/fillion/actions/index.js
  11. 51
      web/client/src/sections/fillion/actions/luzheng.js
  12. 24
      web/client/src/sections/fillion/actions/patrol.js
  13. 94
      web/client/src/sections/fillion/components/luzhengmodel.js
  14. 141
      web/client/src/sections/fillion/components/patrolTable.js
  15. 173
      web/client/src/sections/fillion/containers/luzheng.js
  16. 4
      web/client/src/sections/fillion/nav-item.js
  17. 12
      web/client/src/sections/fillion/routes.js
  18. 20
      web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js
  19. 2
      web/client/src/sections/quanju/containers/footer/leadership/right/hudongVideo.js
  20. 54
      web/client/src/sections/quanju/containers/public/olMap.js
  21. 8
      web/client/src/utils/webapi.js
  22. 30383
      web/log/development.txt

2
api/.vscode/launch.json

@ -15,7 +15,7 @@
"args": [
"-p 13400",
"-f http://localhost:13400",
"-g postgres://postgres:123@10.8.30.32:5432/highways4good",
"-g postgres://FashionAdmin:123456@10.8.16.184:5432/sihaogonglu",
// "-g postgres://FashionAdmin:123456@10.8.30.156:5432/highway4goodn0728",
"--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5",
"--qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa",

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

@ -0,0 +1,53 @@
'use strict';
const moment = require('moment')
async function getAnspectionNotificationPhone(ctx) {
try {
const models = ctx.fs.dc.models;
let findOption = {
where: {
},
order: [['id', 'DESC']]
}
const roadRes = await models.AnspectionNotificationPhone.findAll(findOption)
ctx.status = 200;
ctx.body = roadRes
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
async function addAnspectionNotificationPhone(ctx) {
try {
// const transaction = await ctx.fs.dc.orm.transaction();
const models = ctx.fs.dc.models;
const data = ctx.request.body;
await models.AnspectionNotificationPhone.destroy({ where: {} })
let dataList = []
data.phone && data.phone.map(e => {
dataList.push({
phone: e
})
})
await models.AnspectionNotificationPhone.bulkCreate(dataList);
await transaction.commit();
ctx.status = 204
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
module.exports = {
getAnspectionNotificationPhone, addAnspectionNotificationPhone
};

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

@ -0,0 +1,106 @@
'use strict'
//查询路政
async function getRoadadministration(ctx, next) {
try {
const { limit = 10, page,keyword,startTime,endTime} = ctx.query;
// const distinct = 'false' == includeCount ? false : true//gis大屏需要总设备,后台管理不需要include的统计
const models = ctx.fs.dc.models;
let where = {};
if(startTime && endTime){
where.enforcementdate = {
where: { enforcementdate: { $between: [moment(startTime).format('YYYY-MM-DD'), moment(endTime).format('YYYY-MM-DD')] } },
}
}
let findObj = {
order: [["id", "desc"]],
where: where,
};
if (page && limit) {
findObj.limit = Number(limit)
findObj.offset = Number(page - 1) * Number(limit)
}
let rslt = await models.Roadadministration.findAndCountAll(findObj);
ctx.body = rslt;
ctx.status = 200;
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
"message": "获取路政数据失败"
}
}
}
// 新增路政
function addRoadadministration(opts) {
return async function (ctx, next) {
const models = ctx.fs.dc.models;
try {
let rslt = ctx.request.body;
await models.Roadadministration.create(rslt)
ctx.status = 204;
ctx.body = { message: '添加路政数据成功' }
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = { message: '添加路政失败' }
}
}
}
// 删除路政
function delRoadadministration(opts) {
return async function (ctx, next) {
try {
const models = ctx.fs.dc.models;
const { id } = ctx.params;
await models.Roadadministration.destroy({
where: {
id: id
}
})
ctx.status = 204;
ctx.body = { message: '删除路政信息' }
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = { message: '删除健康体检' }
}
}
}
// 修改路政
function editRoadadministration(opts) {
return async function (ctx, next) {
try {
const models = ctx.fs.dc.models;
const { id } = ctx.params;
const body = ctx.request.body;
await models.Roadadministration.update(
body,
{ where: { id: id, } }
)
ctx.status = 204;
ctx.body = { message: '修改健康体检数据成功' }
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = { message: '修改健康体检数据失败' }
}
}
}
module.exports = {
getRoadadministration,
addRoadadministration,
delRoadadministration,
editRoadadministration
}

35
api/app/lib/models/inspection_notification_phone.js

@ -0,0 +1,35 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const AnspectionNotificationPhone = sequelize.define("inspection_notification_phone", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "assess_id_uindex"
},
phone: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "联系电话",
primaryKey: false,
field: "phone",
autoIncrement: false
},
}, {
tableName: "inspection_notification_phone",
comment: "",
indexes: []
});
dc.models.AnspectionNotificationPhone = AnspectionNotificationPhone;
return AnspectionNotificationPhone;
};

65
api/app/lib/models/roadadministration.js

@ -0,0 +1,65 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const Roadadministration = sequelize.define("roadadministration", {
id: {
index: 1,
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true
},
enforcementdate: {
index: 2,
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
comment: '执法日期',
primaryKey: false,
field: "enforcementdate",
autoIncrement: false
},
roadname: {
index: 3,
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: '道路名称',
primaryKey: false,
field: "roadname",
autoIncrement: false
},
enforcementreslt: {
index: 4,
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: '执法结果',
primaryKey: false,
field: "enforcementreslt",
autoIncrement: false
},
picfile: {
index: 4,
type: DataTypes.JSON,
allowNull: true,
defaultValue: null,
comment: '执法图片',
primaryKey: false,
field: "picfile",
autoIncrement: false
}
}, {
tableName: "roadadministration",
comment: "路政管理",
indexes: []
});
dc.models.Roadadministration = Roadadministration;
return Roadadministration;
};

8
api/app/lib/routes/data/index.js

@ -12,6 +12,7 @@ const task = require('../../controllers/data/task')
const assess = require('../../controllers/data/assess')
const videoCenter = require('../../controllers/data/videoCenter')
const appointTask = require('../../controllers/data/appointed')
const anspectionNotificationPhone = require('../../controllers/data/anspectionNotificationPhone')
module.exports = function (app, router, opts) {
// 数据导出
@ -206,4 +207,11 @@ module.exports = function (app, router, opts) {
app.fs.api.logAttr['PUT/appointTask'] = { content: '指派任务', visible: true };
router.put('/appointTask', appointTask.appoint);
// 指派任务 END
//查询短信电话
app.fs.api.logAttr['GET/anspection/notification/phone'] = { content: '获取短信提醒电话', visible: true };
router.get('/anspection/notification/phone', anspectionNotificationPhone.getAnspectionNotificationPhone);
//添加
app.fs.api.logAttr['POST/anspection/notification/phone'] = { content: '导入道路数据', visible: true };
router.post('/anspection/notification/phone', anspectionNotificationPhone.addAnspectionNotificationPhone);
};

21
api/app/lib/routes/luzheng/index.js

@ -0,0 +1,21 @@
'use strict';
const Roadadministration = require('../../controllers/luzheng')
module.exports = function (app, router, opts) {
app.fs.api.logAttr['GET/getRoadadministration'] = { content: '获取路政数据', visible: false };
router.get('/getRoadadministration', Roadadministration.getRoadadministration);
app.fs.api.logAttr['POST/addRoadadministration'] = { content: '增加路政数据', visible: true };
router.post('/addRoadadministration', Roadadministration.addRoadadministration(opts));
app.fs.api.logAttr['DEL/delRoadadministration/:id'] = { content: '删除路政数据', visible: true };
router.del('/delRoadadministration/:id', Roadadministration.delRoadadministration(opts))
// // 修改健康体检
app.fs.api.logAttr['PUT/editRoadadministration/:id'] = { content: '修改路政数据', visible: true };
router.put('/editRoadadministration/:id', Roadadministration.editRoadadministration(opts))
};

8
scripts/1.3.0/schema/6.roadadministration.sql

@ -0,0 +1,8 @@
create table if not exists roadadministration
(
id serial not null primary key,
enforcementdate timestamp,
roadname varchar(255),
enforcementreslt varchar(255),
picfile jsonb
);

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

@ -1329,26 +1329,25 @@ const Index = () => {
/>
}
{
isView && isBeforeReport ? <>
<View className='horizontal-line hl-two'>
<View className='circle c-two'></View>
<View className='text t-two'>养护中</View>
</View>
{
isView ?
<View className='img-box'>
{conserveUnderwayPic.map(item => (
<Image className='img' src={item.url} onClick={() => handleImgClick(undefined, item)} />
))}
</View>
</> : null
// <AtImagePicker
// className='img-picker'
// count={3 - conserveUnderwayPic.length}
// showAddBtn={conserveUnderwayPic.length >= 3 ? false : true}
// files={conserveUnderwayPic}
// onChange={(files, operationType, index) => handleImgChange(files, operationType, index, 'conserveUnderwayPic')}
// onImageClick={handleImgClick}
// />
</View> :
<AtImagePicker
className='img-picker'
count={3 - conserveUnderwayPic.length}
showAddBtn={conserveUnderwayPic.length >= 3 ? false : true}
files={conserveUnderwayPic}
onChange={(files, operationType, index) => handleImgChange(files, operationType, index, 'conserveUnderwayPic')}
onImageClick={handleImgClick}
/>
}
<View className='horizontal-line hl-three'>

4
web/client/src/sections/fillion/actions/index.js

@ -6,11 +6,13 @@ import * as file from './file'
import * as assess from './assess'
import * as allDepUsers from './allDepUsers'
import * as getReportSpotPrepare from './extract'
import * as luzheng from './luzheng'
export default {
...infor,
...patrol,
...file,
...assess,
...allDepUsers,
...getReportSpotPrepare
...getReportSpotPrepare,
...luzheng
}

51
web/client/src/sections/fillion/actions/luzheng.js

@ -0,0 +1,51 @@
'use strict';
import { basicAction } from '@peace/utils'
import { ApiTable } from '$utils'
export function getRoadadministration (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_LU_ZHENG',
url: ApiTable.getRoadadministration,
msg: { option: '获取路政信息' },
// reducer: { name: 'chcekList' }
});
}
export function addRoadadministration (params) {
return dispatch => basicAction({
type: 'post',
data: params,
dispatch: dispatch,
actionType: 'ADD_LU_ZHENG',
url: ApiTable.addRoadadministration,
msg: { option: '新增路政信息' },
});
}
export function delRoadadministration (id) {
return dispatch => basicAction({
type: 'delete',
dispatch: dispatch,
actionType: 'DEL_LU_ZHENG',
url: ApiTable.delRoadadministration.replace(':id', id),
msg: { option: '删除路政信息' },
})
}
export function modifyRoadadministration (id, params) {
return dispatch => basicAction({
type: 'put',
data: params,
dispatch: dispatch,
actionType: 'EDIT_LU_ZHENG',
url: ApiTable.modifyRoadadministration.replace(':id', id),
msg: { option: '修改路政信息' },
});
}

24
web/client/src/sections/fillion/actions/patrol.js

@ -47,3 +47,27 @@ export function handleReport (reportId, data) {
msg: { option: '处理数据' },
});
}
export function getAnspectionNotificationPhone (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
actionType: 'GET_ANSPECTION_NOTIFICATION_PHONE',
url: ApiTable.getAnspectionNotificationPhone,
query,
msg: { error: '获取短信提醒电话' },
reducer: { name: 'anspectionNotificationPhoneList' }
});
}
export function addAnspectionNotificationPhone (data) {
return dispatch => basicAction({
type: 'post',
dispatch: dispatch,
actionType: 'POST_ANSPECTION_NOTIFICATION_PHONE',
url: ApiTable.getAnspectionNotificationPhone,
data: data,
msg: { option: '添加短信提醒' },
});
}

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

@ -0,0 +1,94 @@
import React, { useState, useEffect } from 'react';
import { connect } from 'react-redux';
import { Form, Input, Select, DatePicker, InputNumber, Button, Modal } from 'antd';
import { unitList } from '../containers/assess'
import { getAssess, delAssess, editAssess } from '../actions/assess';
import moment from 'moment';
import { getRoadadministration,addRoadadministration,delRoadadministration,modifyRoadadministration } from '../actions/luzheng';
// import Uploads from "../../../../components/Upload/index"
const { Option } = Select;
const AssessModal = ({ editData, check, visible, onCancel, dispatch }) => {
const [form] = Form.useForm();
return (
<Modal
title="路政信息"
open={visible}
visible={visible}
cancelButtonProps={{
disabled: check,
}}
onOk={() => {
if (check) {
return onCancel()
}
form.validateFields().then(values => {
dispatch(editAssess({
...values,
month: moment(values.month).format('YYYY-MM-DD'),
assessId: editData ? editData.id : undefined
})).then(res => {
if (res.success) {
onCancel()
}
})
})
}}
onCancel={() => {
onCancel()
}}
>
<Form
form={form}
initialValues={editData ? {
...editData,
month: moment(editData.month),
} : {}}
disabled={check}
labelCol={{
span: 6,
}}
wrapperCol={{
span: 18,
}}
>
<Form.Item name="enforcementdate" label="执法日期" rules={[{ required: true, message: '请填写' }]}>
{/* <Select>
{
unitList.map(item => (
<Option value={item} key={item} />
))
}
</Select> */}
<DatePicker/>
</Form.Item>
<Form.Item name="roadname" label="执法道路" rules={[{ required: true, message: '请填写' }]}>
<Input/>
</Form.Item>
<Form.Item name="enforcementreslt" label="执法成果" rules={[{ required: true, message: '请填写' }]}>
<Input/>
</Form.Item>
<Form.Item name="picfile" label="执法图片">
{/* <Uploads
maxFilesNum={1}
fileTypes={['mp4']}
maxFileSize={200}
/> */}
</Form.Item>
</Form>
</Modal>
);
};
function mapStateToProps (state) {
const { auth, assess } = state
return {
user: auth.user,
assess: assess.data || []
}
}
export default connect(mapStateToProps)(AssessModal);

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

@ -1,9 +1,9 @@
import { connect } from 'react-redux';
import './protable.less'
import { Card, Button, Popconfirm, Badge, Col, Row, DatePicker, Input, Modal, Spin, Image, message, Popover, Select, Tree } from 'antd';
import { Card, Button, Popconfirm, Badge, Col, Row, DatePicker, Input, Modal, Spin, Image, message, Popover, Select, Tree, Form } from 'antd';
import ProTable from '@ant-design/pro-table';
import { DownOutlined, RightOutlined, CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons';
import { getReportList, getReportDetail, handleReport } from '../actions/patrol';
import { DownOutlined, RightOutlined, CaretDownOutlined, CaretRightOutlined, MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
import { getReportList, getReportDetail, handleReport, getAnspectionNotificationPhone, addAnspectionNotificationPhone } from '../actions/patrol';
import React, { useEffect, useState, useMemo } from 'react';
import { getAllDepUsers } from '../actions/allDepUsers'
import { httpDel } from '@peace/utils'
@ -15,6 +15,9 @@ import styles from './protable.less';
import moment from 'moment';
import NominateModalcopy from './feedback/nominateModalcopy';//指派的模块
export const reportTypeText = (text) => {
switch (text) {
case 'road': return '道路';
@ -697,7 +700,7 @@ const PatrolNameList = (props) => {
const PatrolTable = (props) => {
const { allDepUsers, clientHeight, user, userList, reportList, dispatch, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports, pathname } = props;
const { allDepUsers, clientHeight, user, userList, reportList, dispatch, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports, pathname, anspectionNotificationPhoneList } = props;
const [record, setRecord] = useState(1);
const [dateRange, setDateRange] = useState();
const [selectProjectType, setSelectProjectType] = useState('');
@ -709,8 +712,12 @@ const PatrolTable = (props) => {
const isAnomaly = pathname.includes('anomaly')
const isPatrol = !isRoad && !isAnomaly
const reportType = isRoad ? 'road' : isAnomaly ? 'anomaly' : 'patrol';
const [isModalOpen, setIsModalOpen] = useState(false);
const [form] = Form.useForm();
useEffect(() => {
queryData();
dispatch(getAnspectionNotificationPhone());
}, [])
useEffect(() => {
if (userList && userList instanceof Array && reportDetail && reportDetail instanceof Object) {
@ -807,6 +814,54 @@ const PatrolTable = (props) => {
exports(ids, reportType);
}
}
useEffect(() => {
console.log(anspectionNotificationPhoneList, '数据');
let phoneList = []
if (anspectionNotificationPhoneList && anspectionNotificationPhoneList.length) {
phoneList = anspectionNotificationPhoneList.map(e => {
return e.phone
})
}
console.log(phoneList, '789789789789');
}, [anspectionNotificationPhoneList])
const showModal = () => {
setIsModalOpen(true);
};
const handleOk = () => {
// setIsModalOpen(false);
form.validateFields().then(values => {
console.log(values, '----------');
dispatch(addAnspectionNotificationPhone(values)).then(res => {
if (res.success) {
setIsModalOpen(false);
}
})
}).catch(err => {
console.log(err);
})
};
const handleCancel = () => {
setIsModalOpen(false);
};
const formItemLayout = {
labelCol: {
xs: { span: 24 },
sm: { span: 4 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 20 },
},
};
const formItemLayoutWithOutLabel = {
wrapperCol: {
xs: { span: 24, offset: 0 },
sm: { span: 20, offset: 4 },
},
};
return (
<div className='card-protable'>
@ -853,6 +908,8 @@ const PatrolTable = (props) => {
: ''
}
<Button style={{ marginLeft: 20 }}>查询</Button>
<Button onClick={() => { showModal() }} style={{ float: 'right', marginRight: 30 }}> 短信提醒</Button>
{/* <Button style={{ marginLeft: 20 }} onClick={handleExport} >导出</Button> */}
</div> : ''
}
@ -865,13 +922,86 @@ const PatrolTable = (props) => {
isPatrol={isPatrol} isRoad={isRoad} isAnomaly={isAnomaly}
/>
</Card>
<Modal title="短信提醒" maskClosable={false} destroyOnClose={true} visible={isModalOpen} onOk={handleOk} onCancel={handleCancel}>
<Form form={form} name="dynamic_form_item" {...formItemLayoutWithOutLabel} >
<Form.List
name="phone"
// rules={[
// {
// validator: async (_, names) => {
// if (!names || names.length < 1) {
// return Promise.reject(new Error('At least 2 passengers'));
// }
// },
// },
// ]}
>
{(fields, { add, remove }, { errors }) => (
<>
{fields.map((field, index) => (
<Form.Item
{...(index === 0 ? formItemLayout : formItemLayoutWithOutLabel)}
label={index === 0 ? '联系电话' : ''}
required={false}
key={field.key}
>
<Form.Item
{...field}
validateTrigger={['onChange', 'onBlur']}
rules={[
// {
// required: true,
// whitespace: true,
// message: "请填入手机号!",
// },
{
validator: async (_, phone) => {
let re = /^1((3[\d])|(4[5,6,9])|(5[0-3,5-9])|(6[5-7])|(7[0-8])|(8[1-3,5-8])|(9[1,8,9]))\d{8}$/
if (!re.test(phone)) {
return Promise.reject(new Error('请输入正确的手机号!'));
}
},
},
]}
noStyle
>
<Input placeholder="请输入联系电话" style={{ width: '90%' }} />
</Form.Item>
<MinusCircleOutlined
style={{ marginLeft: 5 }}
onClick={() => remove(field.name)}
/>
</Form.Item>
))}
<Form.Item>
<Button
type="dashed"
onClick={() => add()}
style={{ width: '90%' }}
icon={<PlusOutlined />}
>
添加联系电话
</Button>
<Form.ErrorList errors={errors} />
</Form.Item>
</>
)}
</Form.List>
{/* <Form.Item>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item> */}
</Form>
</Modal>
</div>
);
};
function mapStateToProps(state) {
const { auth, depMessage, userList, reportList, reportDetail, global, allDepUsers } = state;
const { auth, depMessage, userList, reportList, reportDetail, global, allDepUsers, anspectionNotificationPhoneList } = state;
const pakData = (dep) => {
return dep.map((d) => {
return {
@ -895,6 +1025,7 @@ function mapStateToProps (state) {
reportDetail: reportDetail.data,
reportDetailLoading: reportDetail.isRequesting,
clientHeight: global.clientHeight,
anspectionNotificationPhoneList: anspectionNotificationPhoneList.data || []
};
}

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

@ -0,0 +1,173 @@
import React, { useState, useEffect } from 'react';
import { connect } from 'react-redux';
import { getAssess, delAssess, editAssess } from '../actions/assess';
import { getRoadadministration,addRoadadministration,delRoadadministration,modifyRoadadministration } from '../actions/luzheng';
import ProTable from '@ant-design/pro-table';
import AssessModal from '../components/luzhengmodel';
import { Form, Space, DatePicker, Button, Select, Popconfirm } from 'antd'
import moment from 'moment';
export const unitList = [
'县道',
'蒋巷镇',
'三江镇',
'塔城乡',
'泾口乡',
'八一乡',
'冈上镇',
'南新乡',
'富山乡',
'莲塘镇',
'金湖管理处',
'武阳镇',
'向塘镇',
'幽兰镇',
'广福镇',
'塘南镇',
'银三角管委会',
'黄马乡',
]
function Assess(props) {
const { dispatch, assess, user } = props;
const [assessModalVisible, setAssessModalVisible] = useState(false);
const [editData, setEditData] = useState(null);
const [query, setQuery] = useState({ page: 1, pageSize: 10 })
const [loading, setLoading] = useState(false);
const [isCheck, setIsCheck] = useState(false)
const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.find(i => i.resourceId === 'ASSESSMANAGE')?.isshow === "true" ? true : '')
useEffect(() => {
dispatch(getRoadadministration()).then(res=>{console.log(res,'res')})
return () => { };
}, []);
useEffect(() => {
getData()
}, [query])
const getData = () => {
setLoading(true)
dispatch(getRoadadministration(query)).then(res => {
setLoading(false)
})
}
return (
<div>
<div style={{ marginBottom: '20px', display: 'flex', justifyContent: 'space-between' }}>
<Form layout="inline" onFinish={(v) => {
setQuery({ ...query, unit: v.unit, month: v.month ? moment(v.month).format() : undefined })
}}>
<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>
<Form.Item>
<Button type="primary" htmlType="submit">搜索</Button>
</Form.Item>
</Form>
<Button type="primary" disabled={editAble}
onClick={() => {
setAssessModalVisible(true)
}}>新增</Button>
</div>
<ProTable
columns={[{
title: '执法日期',
dataIndex: 'enforcementdate',
key: 'enforcementdate',
},
{
title: '执法道路',
dataIndex: 'roadname',
key: 'roadname'
},
{
title: '执法成果',
dataIndex: 'enforcementreslt',
key: 'enforcementreslt',
},
{
title: '执法图片',
dataIndex: 'picfile',
key: 'picfile',
},
{
title: '操作',
key: 'action',
render: (text, record) => (
<span>
<Button type="link" onClick={() => {
setAssessModalVisible(true)
setEditData(record)
setIsCheck(true)
}}>详情</Button>
<Button type="link" onClick={() => {
setAssessModalVisible(true)
setEditData(record)
disabled = { editAble }
}}>编辑</Button>
<Popconfirm
title="确定删除此条数据吗?"
onConfirm={() => {
setLoading(true)
dispatch(delAssess({ id: record.id })).then(res => {
setLoading(false)
if (res.success) {
getData()
}
})
}}
>
<Button type="link" danger disabled={editAble}>删除</Button>
</Popconfirm>
</span>
),
},]}
dataSource={assess.rows || []}
loading={loading}
pagination={{
total: assess?.count || 0,
pageSize: 10,
defaultPageSize: 10,
showSizeChanger: false,
onChange: (page, pageSize) => {
setQuery({
...query,
page, limit: pageSize
})
}
}}
rowKey="key"
toolBarRender={false}
search={false}
/>
{
assessModalVisible ? <AssessModal check={isCheck} visible={assessModalVisible} editData={editData} onCancel={() => {
getData()
setIsCheck(false)
setEditData(null)
setAssessModalVisible(false)
}} /> : ''
}
</div>
);
}
function mapStateToProps(state) {
const { auth, assess } = state
return {
user: auth.user,
assess: assess.data || [],
}
}
export default connect(mapStateToProps)(Assess);

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

@ -33,6 +33,10 @@ export function getNavItem(user, dispatch) {
{/* <Menu.Item key="filliontask">
<Link to="/fillion/task">任务管理</Link>
</Menu.Item> */}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'OVERLOADMANAGE') ?
<Menu.Item key="luzheng">
<Link to="/fillion/luzheng">路政管理</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'ROADMANAGE') ?
<Menu.Item key="filliontransportation">
<Link to="/fillion/transportation">道路管理</Link>

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

@ -15,6 +15,7 @@ import { Jiekouguanli } from './containers'
import { Task, Assess, VideoCenter, } from './containers'
import { Building } from './containers'
import { MaintenanceSpotCheck } from './containers'
import Luzheng from './containers/luzheng';
export default [{
type: 'inner',
route: {
@ -30,7 +31,16 @@ export default [{
component: Infor,
breadcrumb: '治超管理',
authCode: 'OVERLOADMANAGE'
}, {
},
{
path: '/luzheng',
key: 'luzheng',
menuSelectKeys: ['luzheng'],
component: Luzheng,
breadcrumb: '路政管理',
authCode: 'OVERLOADMANAGE'
},
{
path: '/task',
key: 'filliontask',
menuSelectKeys: ['filliontask'],

20
web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js

@ -28,16 +28,16 @@ const Leftcenter = ({ videoCenterList }) => {
}, [videoCenterList])
useEffect(() => {
// const timer = setInterval(() => {
// if (num == list.length) {
// setNum(1);
// // setTu(list[0].img);
// } else {
// setNum(num + 1);
// // setTu(list[num].img);
// }
// }, 1000 * 60 * 5);
// return () => clearInterval(timer);
const timer = setInterval(() => {
if (num == list.length) {
setNum(1);
// setTu(list[0].img);
} else {
setNum(num + 1);
// setTu(list[num].img);
}
}, 1000 * 60 * 5);
return () => clearInterval(timer);
}, [num]);
const renderBody = () => {

2
web/client/src/sections/quanju/containers/footer/leadership/right/hudongVideo.js

@ -166,7 +166,7 @@ class ReactCarousel extends Component {
let { timer } = this.state;
timer = setInterval(() => {
this.next();
}, 300000);
}, 1000 * 60 * 5);
this.setState({
timer
})

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

@ -7,6 +7,7 @@ import { OlMapRequest } from '$utils'
const OlMap = (props) => {
const { dispatch, actions, user, olMapArcgisHost, olMapGeoDataHost, patrolList, roadProjectList, tab, busRunTime, busLine } = props
console.log(patrolList)
const [olMapOpenData, setOlMapOpenData] = useState([])
const [olMap, setOlMap] = useState()
const [pointItem, setPointItem] = useState({})
@ -66,10 +67,11 @@ const OlMap = (props) => {
olMapTool.closeOverlay('pointClickOpen')
olMapTool.removeGeometryLayer('geometry0')
// 请求路线坐标
request.post(`${olMapGeoDataHost || 'http://36.2.6.32:8811'}/geoserver-pg/rest/bufferSearch`)
.type('form')
.send({
params: `{"layerName":"view_by_line","pageSize":10,"pageNum":1,"filter":"","isReturnGeometry":"true","spatialRel":"INTERSECTS","orderByFields":" sort1, sort2, lxbm, sxxfx, qdzh asc", "spatialFilter":"point(${p.coordinate[0]} ${p.coordinate[1]})","distance":20}`
params: `{"layerName":"view_by_line","pageSize":1,"pageNum":1,"filter":"","isReturnGeometry":"true","spatialRel":"INTERSECTS","orderByFields":" sort1, sort2, lxbm, sxxfx, qdzh asc", "spatialFilter":"point(${p.coordinate[0]} ${p.coordinate[1]})","distance":20}`
})
.then(res => {
if (res.status == 200 && res.body && res.body.code == 1) {
@ -98,6 +100,7 @@ const OlMap = (props) => {
positioning: 'top-right'
}
// 注意 现在只取第一条数据 所以能在这里请求
// 这里请求的是路线的信息
request.post(`${olMapGeoDataHost || 'http://36.2.6.32:8811'}/geoserver-pg/rest/search`)
.type('form')
.send({
@ -184,6 +187,49 @@ const OlMap = (props) => {
autoPanMargin: 100,
positioning: 'top-right'
})
// 请求路线坐标
console.log(d.code_road);
if (d.code_road) {
let codeMap = {
x: 'gpsxd',
y: 'gpsyd',
c: 'gpscd',
}
let roadCodeStart = d.code_road[0]
let layerName = codeMap[roadCodeStart.toLowerCase()]
if (layerName) {
request.post(`${olMapGeoDataHost || 'http://36.2.6.32:8811'}/geoserver-pg/rest/search`)
.type('form')
.send({
params: `{"layerName":"${layerName}","filter":"(roadcode = '${d.code_road}')","spatialFilter":"","isReturnGeometry":"true","orderByFields":"roadcode, roadstart asc","spatialRel":"INTERSECTS","pageNum":1,"pageSize":99}`
})
.then(res => {
if (res.status == 200 && res.body && res.body.code == 1) {
console.log(res);
const data = res.body.data
const { datalist } = data
if (datalist?.list?.length) {
let index = 0
for (let d of datalist.list) {
olMap.addGeometryJMLayer({
features: [
{
geometry: d.shape,
geometryType: 'LineString',
// geometryType: 'Point',
},
],
style: { stroke: { width: 5, color: '#9933FF' } },
selectStyle: { stroke: { width: 8, color: '#9933FF' } },
layerName: 'geometry' + index++
});
}
}
}
})
}
}
}
},
geometry: [d.longitude, d.latitude],
@ -217,6 +263,10 @@ const OlMap = (props) => {
layerName: 'geometry_patrol_' + index
});
});
} else if (tab != 'conserve' && olMap) {
patrolList.forEach((d, index) => {
olMap.removeGeometryLayer('geometry_patrol_' + index)
})
}
}, [patrolList, olMap, tab])
@ -250,6 +300,8 @@ const OlMap = (props) => {
autoPanMargin: 100,
positioning: 'top-right'
})
// 查路线
}
},
geometry: [d.longitude, d.latitude],

8
web/client/src/utils/webapi.js

@ -304,7 +304,13 @@ export const ApiTable = {
//部门下所有员工
getAllDepUsers: 'allDepUsers',
//指派任务
appointTask: 'appointTask'
appointTask: 'appointTask',
//获取短信提醒电话
getAnspectionNotificationPhone:'/anspection/notification/phone',
modifyRoadadministration:'editRoadadministration/:id',
delRoadadministration:'delRoadadministration/:id',
addRoadadministration:'/addRoadadministration',
getRoadadministration:'/getRoadadministration'
};

30383
web/log/development.txt

File diff suppressed because it is too large
Loading…
Cancel
Save