Browse Source

(*)隐藏车辆抓拍管理

dev
tangxilong 1 year ago
parent
commit
f5a38e3f36
  1. 4
      api/.vscode/launch.json
  2. 220
      web/client/src/sections/fillion/containers/carimages.js
  3. 4
      web/client/src/sections/fillion/nav-item.js
  4. 16
      web/client/src/sections/fillion/routes.js

4
api/.vscode/launch.json

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

220
web/client/src/sections/fillion/containers/carimages.js

@ -1,124 +1,124 @@
import React, { useState, useEffect } from 'react' // import React, { useState, useEffect } from 'react'
import { connect } from 'react-redux' // import { connect } from 'react-redux'
import { getCarImages } from '../actions/carimages' // import { getCarImages } from '../actions/carimages'
import ProTable from '@ant-design/pro-table' // import ProTable from '@ant-design/pro-table'
import { Form, Space, DatePicker, Button, Select, Popconfirm, Image, Tooltip } from 'antd' // import { Form, Space, DatePicker, Button, Select, Popconfirm, Image, Tooltip } from 'antd'
import moment from 'moment' // import moment from 'moment'
function Carimages (props) { // function Carimages (props) {
const { dispatch, assess, user } = props // const { dispatch, assess, user } = 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 [datasource, setdatasource] = useState([]) // const [datasource, setdatasource] = useState([])
const [dateRange, setDateRange] = useState(['1970-1-1', '2099-12-31']) // const [dateRange, setDateRange] = useState(['1970-1-1', '2099-12-31'])
const { RangePicker } = DatePicker // 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 : '') // const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.find(i => i.resourceId === 'ASSESSMANAGE')?.isshow === "true" ? true : '')
useEffect(() => { // useEffect(() => {
return () => { } // return () => { }
}, []) // }, [])
useEffect(() => { // useEffect(() => {
getData() // getData()
}, [query]) // }, [query])
const getData = () => { // const getData = () => {
console.log(query, 'query') // console.log(query, 'query')
dispatch(getCarImages({ ...query })).then(res => { // dispatch(getCarImages({ ...query })).then(res => {
if (res?.success) { // if (res?.success) {
setdatasource(res?.payload?.data?.rows) // setdatasource(res?.payload?.data?.rows)
settotal(res?.payload?.data?.count) // settotal(res?.payload?.data?.count)
} // }
}) // })
} // }
return ( // return (
<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({ // setQuery({
...query, page: 1, unit: v.unit, startTime: v?.time && moment(v?.time[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'), // ...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') // endTime: v?.time && moment(v?.time[1]).add(1, 'days').endOf('day').format('YYYY-MM-DD HH:mm:ss')
}) // })
}}> // }}>
{/* <Form.Item> // {/* <Form.Item>
<Button type="primary" htmlType="submit">搜索</Button> // <Button type="primary" htmlType="submit">搜索</Button>
</Form.Item> */} // </Form.Item> */}
</Form> // </Form>
{/* <Button type="primary" disabled={editAble} // {/* <Button type="primary" disabled={editAble}
onClick={() => { // onClick={() => {
setAssessModalVisible(true) // setAssessModalVisible(true)
}}>新增</Button> */} // }}>新增</Button> */}
</div> // </div>
<ProTable // <ProTable
columns={[ // columns={[
{ // {
title: '序号', // title: '序号',
dataIndex: 'id', // dataIndex: 'id',
key: 'id', // key: 'id',
defaultSortOrder: 'ascend', // defaultSortOrder: 'ascend',
}, // },
{ // {
title: '抓拍图片', // title: '抓拍图片',
dataIndex: 'url', // dataIndex: 'url',
key: 'url', // key: 'url',
render: (t, r) => { // render: (t, r) => {
if (r?.url && r?.id) { // if (r?.url && r?.id) {
return <span style={{ marginRight: 10 }}> // return <span style={{ marginRight: 10 }}>
<Image src={r?.url} width={200} /> // <Image src={r?.url} width={200} />
</span> // </span>
} else { // } else {
return '--' // return '--'
} // }
} // }
}, // },
{ // {
title: '日期', // title: '日期',
dataIndex: 'time', // dataIndex: 'time',
key: 'time', // key: 'time',
render: (t, r) => { // render: (t, r) => {
const localTime = moment.utc(r?.time).format('YYYY-MM-DD HH:mm:ss') // const localTime = moment.utc(r?.time).format('YYYY-MM-DD HH:mm:ss')
return r?.time ? localTime : '--' // return r?.time ? localTime : '--'
} // }
}, // },
]} // ]}
dataSource={datasource || []} // dataSource={datasource || []}
loading={loading} // loading={loading}
pagination={{ // pagination={{
total: total || 0, // total: total || 0,
pageSize: 10, // pageSize: 10,
defaultPageSize: 10, // defaultPageSize: 10,
showSizeChanger: false, // showSizeChanger: false,
onChange: (page, pageSize) => { // onChange: (page, pageSize) => {
setQuery({ // setQuery({
...query, // ...query,
page, // page,
limit: pageSize // limit: pageSize
}) // })
} // }
}} // }}
rowKey="key" // rowKey="key"
toolBarRender={false} // toolBarRender={false}
search={false} // search={false}
/> // />
</div> // </div>
) // )
} // }
function mapStateToProps (state) { // function mapStateToProps (state) {
const { auth, assess } = state // const { auth, assess } = state
return { // return {
user: auth.user, // user: auth.user,
assess: assess.data || [], // assess: assess.data || [],
} // }
} // }
export default connect(mapStateToProps)(Carimages) // export default connect(mapStateToProps)(Carimages)

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

@ -73,10 +73,10 @@ export function getNavItem (user, dispatch) {
<Link to="/fillion/infor">治超管理</Link> <Link to="/fillion/infor">治超管理</Link>
</Menu.Item> : ''} </Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'OVERLOADMANAGE') ? {/* {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'OVERLOADMANAGE') ?
<Menu.Item key="fillioncarimages"> <Menu.Item key="fillioncarimages">
<Link to="/fillion/carimages">车辆抓拍管理</Link> <Link to="/fillion/carimages">车辆抓拍管理</Link>
</Menu.Item> : ''} </Menu.Item> : ''}*/}
</SubMenu> </SubMenu>
: '' : ''
} }

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

@ -33,14 +33,14 @@ export default [{
breadcrumb: '治超管理', breadcrumb: '治超管理',
authCode: 'OVERLOADMANAGE' authCode: 'OVERLOADMANAGE'
}, },
{ // {
path: '/carimages', // path: '/carimages',
key: 'fillioncarimages', // key: 'fillioncarimages',
menuSelectKeys: ['fillioncarimages'], // menuSelectKeys: ['fillioncarimages'],
component: Carimages, // component: Carimages,
breadcrumb: '车辆抓拍管理', // breadcrumb: '车辆抓拍管理',
authCode: 'OVERLOADMANAGE' // authCode: 'OVERLOADMANAGE'
}, // },
{ {
path: '/luzheng', path: '/luzheng',
key: 'luzheng', key: 'luzheng',

Loading…
Cancel
Save