巴林闲侠 1 year ago
parent
commit
edfa0c24cb
  1. 4
      api/app/lib/controllers/data/vehicle.js
  2. 4
      scripts/1.3.1/data/1_insert_report_data/Dockerfilenew
  3. 10
      web/client/src/sections/fillion/components/highwaysTable.js
  4. 101
      web/client/src/sections/fillion/components/luzhengmodel.js
  5. 88
      web/client/src/sections/fillion/containers/luzheng.js
  6. 2
      web/client/src/sections/fillion/containers/maintenanceSpotCheck.js
  7. 4
      web/client/src/sections/quanju/containers/footer/leadership/centerleft/qiqoliang.js

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

@ -7,8 +7,8 @@ async function get(ctx) {
const { type } = ctx.request.body;
const { name } = ctx.query;
const sequelize = ctx.fs.dc.orm
const sqlStr = `select sum(p.road_marking) 标线,sum(p.roadside_ditch) 边沟,
sum(p.guardrail) 护栏, sum(p.roadside_trees) 行道树,sum(p.wrong_lane) 错车道
const sqlStr = `select sum(p.road_marking) "标线(米)",sum(p.roadside_ditch) "边沟(米)",
sum(p.guardrail) "护栏(米)", sum(p.roadside_trees) "行道树(棵)",sum(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,

4
scripts/1.3.1/data/1_insert_report_data/Dockerfilenew

@ -1,7 +1,7 @@
FROM repository.anxinyun.cn/base-images/nodejs12:20.10.12.2
COPY . /var/app
COPY ./scripts/1.3.1/data/1_insert_report_data /var/app
WORKDIR /var/app
RUN npm cache clean -f
RUN rm -rf package-lock.json
RUN npm install --registry http://10.8.30.22:7000
RUN npm install --registry https://nexus.ngaiot.com/repository/fs-npm/
CMD ["node", "index.js"]

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

@ -270,6 +270,7 @@ const TransporTationTable = (props) => {
multipleLine: true,
menu: {
type: 'tab',
activeKey,
onChange: (key) => setActiveKey(key),
items: [
@ -298,7 +299,7 @@ const TransporTationTable = (props) => {
options={false}
ref={c => { finishedProductTable = c; }}
style={{ width: "100% ", overflow: "auto", height: '760px' }}
rowKey='id'
//rowKey='id'
onReset={(v) => {
setSitename('')
}}
@ -317,7 +318,12 @@ const TransporTationTable = (props) => {
}
setRowSelected([]);
const res = await dispatch(getHighways(query));
let rslt = res.payload.data?.vehicleRes?.filter(item => item.name !== '路牌名')
let rslt = res.payload.data?.vehicleRes?.map(item => {
return {
...item,
name: item.name + "(个)"
}
})
const additionalProperties = Object.entries(res.payload.data?.conserveData[0]).map(([key, value]) => ({
id: null,
name: key,

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

@ -4,47 +4,78 @@ import { Form, Input, Select, DatePicker, InputNumber, Button, Modal } from 'ant
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"
// import Uploads from '../../../components/Upload/index'
import { getRoadadministration, addRoadadministration, delRoadadministration, modifyRoadadministration } from '../actions/luzheng';
// import Uploads from "../../../../components/Upload/index"
// import Uploads from '../../../components/Upload/index'
import Uploads from './uploads'
const { Option } = Select;
const LuzhengModel = ({ editData, check, visible, onCancel, dispatch }) => {
const [form] = Form.useForm();
console.log(editData,'editData')
// console.log(editData,'editData')
return (
<Modal
title="路政信息"
open={visible}
visible={visible}
footer={check?null:undefined}
// cancelButtonProps={{
// disabled: check,
// }}
cancelButtonProps={{
disabled: check,
}}
footer={!check ? [
<Button key="submit" type="primary" onClick={() => {
if (check) {
return onCancel()
}
form.validateFields().then(values => {
if (editData) {
dispatch(modifyRoadadministration(editData?.id, {
...values
})).then(res => {
if (res.success) {
onCancel()
}
})
} else {
dispatch(addRoadadministration({
...values,
})).then(res => {
if (res.success) {
onCancel()
}
})
}
})
}}>
确定
</Button>,
<Button onClick={onCancel}>
取消
</Button>
] : null}
onOk={() => {
if (check) {
return onCancel()
}
form.validateFields().then(values => {
if(editData){
dispatch(modifyRoadadministration(editData?.id,{
if (editData) {
dispatch(modifyRoadadministration(editData?.id, {
...values
})).then(res => {
if (res.success) {
onCancel()
}
})
}else{
} else {
dispatch(addRoadadministration({
...values,
})).then(res => {
if (res.success) {
onCancel()
}
})
})
}
})
}}
onCancel={() => {
@ -66,43 +97,43 @@ const LuzhengModel = ({ editData, check, visible, onCancel, dispatch }) => {
}}
>
<Form.Item name="enforcementdate" label="执法日期" rules={[{ required: true, message: '请填写' }]}>
{/* <Select>
{
unitList.map(item => (
<Option value={item} key={item} />
))
}
</Select> */}
<DatePicker/>
{/* <Select>
                        {
                            unitList.map(item => (
                                <Option value={item} key={item} />
                            ))
                        }
                    </Select> */}
<DatePicker />
</Form.Item>
<Form.Item name="roadname" label="执法道路" rules={[{ required: true, message: '请填写' },{ max: 100, message: '不可超过一百个字符' }]}>
<Input/>
<Form.Item name="roadname" label="执法道路" rules={[{ required: true, message: '请填写' }, { max: 100, message: '不可超过一百个字符' }]}>
<Input />
</Form.Item>
<Form.Item name="enforcementreslt" label="执法成果" rules={[{ required: true, message: '请填写' },{ max: 100, message: '不可超过一百个字符' }]}>
<Input/>
<Form.Item name="enforcementreslt" label="执法成果" rules={[{ required: true, message: '请填写' }, { max: 100, message: '不可超过一百个字符' }]}>
<Input />
</Form.Item>
<Form.Item name="picfile" label="执法图片">
<Uploads
maxFilesNum={3}
fileTypes={['png','jpg','jpeg']}
maxFileSize={200}
fileList={editData?.picfile}
listType ={'picture-card'}
isedit={editData?true:false}
/>
<Uploads
maxFilesNum={3}
fileTypes={['png', 'jpg', 'jpeg']}
maxFileSize={200}
fileList={editData?.picfile}
listType={'picture-card'}
isedit={editData ? true : false}
/>
</Form.Item>
</Form>
</Modal>
);
};
function mapStateToProps (state) {
function mapStateToProps(state) {
const { auth, assess } = state
return {
user: auth.user,
assess: assess.data || []
}
}
export default connect(mapStateToProps)(LuzhengModel);
export default connect(mapStateToProps)(LuzhengModel);

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

@ -1,10 +1,10 @@
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 { 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 ,Image} from 'antd'
import { Form, Space, DatePicker, Button, Select, Popconfirm, Image, Tooltip } from 'antd'
import moment from 'moment';
import { values } from 'lodash';
@ -35,13 +35,13 @@ function Assess(props) {
const [query, setQuery] = useState({ page: 1, pageSize: 10 })
const [loading, setLoading] = useState(false);
const [isCheck, setIsCheck] = useState(false)
const [datasource,setdatasource] = useState([])
const [datasource, setdatasource] = useState([])
const [dateRange, setDateRange] = useState(['1970-1-1', '2099-12-31']);
const { RangePicker } = DatePicker
const [total,settotal]= useState(0)
const [total, settotal] = useState(0)
const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.find(i => i.resourceId === 'ASSESSMANAGE')?.isshow === "true" ? true : '')
useEffect(() => {
return () => { };
}, []);
@ -51,9 +51,9 @@ function Assess(props) {
const getData = () => {
setLoading(true)
console.log(query,'query')
dispatch(getRoadadministration({...query})).then(res => {
if(res?.success){
console.log(query, 'query')
dispatch(getRoadadministration({ ...query })).then(res => {
if (res?.success) {
setdatasource(res?.payload?.data?.rows)
settotal(res?.payload?.data?.count)
setLoading(false)
@ -65,14 +65,16 @@ function Assess(props) {
<div>
<div style={{ marginBottom: '20px', display: 'flex', justifyContent: 'space-between' }}>
<Form layout="inline" onFinish={(v) => {
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') })
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="time" label="执行日期">
<RangePicker onChange={(date, dateString) => { setDateRange(dateString) }} style={{ marginRight: '50px' }} />
<RangePicker onChange={(date, dateString) => { setDateRange(dateString) }} style={{ marginRight: '50px' }} />
</Form.Item>
<Form.Item>
@ -90,40 +92,50 @@ function Assess(props) {
title: '执法日期',
dataIndex: 'enforcementdate',
key: 'enforcementdate',
render:(t,r)=>{
return r?.enforcementdate?moment(r?.enforcementdate).format('YYYY-MM-DD'):'--'
render: (t, r) => {
return r?.enforcementdate ? moment(r?.enforcementdate).format('YYYY-MM-DD') : '--'
}
},
{
title: '执法道路',
dataIndex: 'roadname',
key: 'roadname'
key: 'roadname',
render: (t, r) => {
return <Tooltip title={r?.roadname}>
<span className='shenglve'>{r?.roadname && r?.roadname?.length > 20 ? r?.roadname?.substr(0, 20) + '...' : r?.roadname}</span>
</Tooltip>
}
},
{
title: '执法成果',
dataIndex: 'enforcementreslt',
key: 'enforcementreslt',
render: (t, r) => {
return <Tooltip title={r?.enforcementreslt}>
<span className='shenglve'>{r?.enforcementreslt && r?.enforcementreslt?.length > 20 ? r?.enforcementreslt?.substr(0, 20) + '...' : r?.enforcementreslt}</span>
</Tooltip>
}
},
{
title: '执法图片',
dataIndex: '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 '--'
}
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 '--'
}
}
},
{
@ -139,8 +151,8 @@ function Assess(props) {
<Button type="link" onClick={() => {
setAssessModalVisible(true)
setEditData(record)
}} disabled = { editAble }>编辑</Button>
}} disabled={editAble}>编辑</Button>
<Popconfirm
title="确定删除此条数据吗?"
onConfirm={() => {
@ -148,8 +160,8 @@ function Assess(props) {
dispatch(delRoadadministration(record.id)).then(res => {
setLoading(false)
if (res.success) {
setQuery({...query, page: 1, pageSize: 10, limit: 10})
// getData(page)
setQuery({ ...query, page: 1, pageSize: 10, limit: 10 })
// getData(page)
}
})
}}
@ -167,7 +179,7 @@ function Assess(props) {
defaultPageSize: 10,
showSizeChanger: false,
onChange: (page, pageSize) => {
console.log(page,'page')
console.log(page, 'page')
setQuery({
...query,
page, limit: pageSize
@ -179,7 +191,7 @@ function Assess(props) {
search={false}
/>
{
assessModalVisible ? <AssessModal check={isCheck} visible={assessModalVisible} editData={editData} onCancel={() => {
assessModalVisible ? <AssessModal check={isCheck} visible={assessModalVisible} editData={editData} onCancel={() => {
getData()
setIsCheck(false)
setEditData(null)

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

@ -479,7 +479,7 @@ const MaintenanceSpotCheck = (props) => {
</Form.Item>
<Form.Item className="ant-row" >
<Button style={{ marginLeft: '40%' }} type='primary' onClick={extractHandler}>开始抽取</Button>
<Button style={{ marginLeft: '70%' }} type='primary' onClick={extractHandler}>开始抽取</Button>
</Form.Item>
<Form.Item label='抽查总数' name='result'>
<Input disabled />

4
web/client/src/sections/quanju/containers/footer/leadership/centerleft/qiqoliang.js

@ -94,7 +94,9 @@ const Right = (props) => {
{/* <div style={{ width: (roads?.["小桥"] / (roads?.["小桥"] + roads?.["中桥"] + roads?.["大桥"])).toFixed(2) * 100 + "%" || "", height: "20%", transform: "skewX(-45deg)", backgroundColor: "#18ABFF", float: "left", marginTop: "5.6%", borderRadius: "0 2% 2% 0" }}></div> */}
</div>
<div style={{ width: "96%", position: "relative", left: "2%" }}>
<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?.["中桥"]) ? "" : roads?.["小桥"] + roads?.["中桥"]}</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" }}>159</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?.["中桥"]) ? "" : roads?.["小桥"] + roads?.["中桥"]}</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>
</div>
</div>

Loading…
Cancel
Save