Browse Source

Merge branch 'dev' of https://gitea.anxinyun.cn/gao.zhiyuan/Highways4Good into dev

release_0.0.1
巴林闲侠 2 years ago
parent
commit
fe837dbf2c
  1. BIN
      web/client/assets/images/quanju/gonglugongcheng.png
  2. BIN
      web/client/assets/images/quanju/gonglugongli.png
  3. BIN
      web/client/assets/images/quanju/gongluzong.png
  4. BIN
      web/client/assets/images/quanju/xuanchuanlan.jpg
  5. 170
      web/client/src/sections/fillion/components/promotionalTable.js
  6. 4
      web/client/src/sections/fillion/containers/index.js
  7. 43
      web/client/src/sections/fillion/containers/promotional.js
  8. 5
      web/client/src/sections/fillion/nav-item.js
  9. 8
      web/client/src/sections/fillion/routes.js
  10. 6
      web/client/src/sections/quanju/containers/example.js
  11. 30
      web/client/src/sections/quanju/containers/footer/build/index.js
  12. 2
      web/client/src/sections/quanju/containers/public/module.js

BIN
web/client/assets/images/quanju/gonglugongcheng.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
web/client/assets/images/quanju/gonglugongli.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
web/client/assets/images/quanju/gongluzong.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
web/client/assets/images/quanju/xuanchuanlan.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

170
web/client/src/sections/fillion/components/promotionalTable.js

@ -0,0 +1,170 @@
import React, { useEffect, useState } from 'react';
import { connect } from 'react-redux';
import { Spin, Button, Popconfirm, Badge } from 'antd';
import ProTable from '@ant-design/pro-table';
import './protable.less'
import moment from 'moment';
import { getReportStatistic } from "../actions/infor"
const promotionalTable = (props) => {
const { dispatch, user, depData, depMessage, depLoading } = props
const [rowSelected, setRowSelected] = useState([])
const [regionId, setRegionId] = useState()//区域id
const [placeType, setPlaceType] = useState()//场所
const [day, setDay] = useState([moment('2022-03-01').format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')])//日期
const [sitename, setSitename] = useState()//场所名称
const [counts, setCounts] = useState()//shuju
useEffect(() => {
setRegionId(user.departmentId)
}, [user])
const columns =
[{
title: '序号',
search: false,
dataIndex: 'containers',
fixed: 'left',
width: 120,
render: (dom, record) => {
return record.address
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
},
{
title: '视频名称',
dataIndex: 'placeName',
fixed: 'left',
width: 120,
options: 1,
backgroundColor: "#ffffff",
fieldProps: {
onChange: (value, cs) => {
setSitename(value.currentTarget.value)
},
placeholder: '请输入视频名称进行搜索',
getPopupContainer: (triggerNode) => triggerNode.parentNode,
},
},
{
title: '修改时间',
search: false,
dataIndex: 'time2',
valueType: 'dateRange',
// align: 'right',
width: 120,
render: (dom, record) => {
return record.address
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
},
{
key: "direction",
hideInTable: true,
dataIndex: "direction",
order: 6,
renderFormItem: (item, { type, defaultRender, ...rest }, form) => {
return (
<div> <Button
type="primary"
style={{ width: "100px" }}
onClick={() => {
dispatch(push(`article/update/post`));
}}
>
新增
</Button>
</div>
);
},
},
]
return (
<Spin spinning={false}>
<div className='protable-transpor'>
<ProTable
scroll={{ x: 800 }}
options={false}
ref={c => { finishedProductTable = c; }}
style={{ width: "100% ", overflow: "auto", height: '760px' }}
rowKey='id'
onReset={(v) => {
const { id } = depMessage[0]
console.log(id)
setRegionId(id)
setPlaceType(-1)
setDay([moment('2022-03-01').format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')])
setSitename('')
}}
rowSelection={{
selectedRowKeys: rowSelected,
onChange: (selectedRowKeys) => {
setRowSelected(selectedRowKeys);
},
}}
columns={columns}
dataSource={(counts || {}).rows || []}
request={async (params) => {
const query = {
startDate: day[0],
endDate: day[1],
placeType: placeType,
regionId: regionId,
placeName: sitename,
limit: params.pageSize,
offset: ((params.current ? params.current : 1) - 1) * params.pageSize
}
setRowSelected([]);
const res = await dispatch(getReportStatistic(query));
setCounts(res.payload.data)
return {
...res,
total: res.payload.data ? res.payload.data.count : 0
}
}}
// search={{
// defaultCollapsed: false,
// optionRender: (searchConfig, formProps, dom) => [
// ...dom.reverse(),
// <Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, counts) }}>
// <Button
// >
// 导出
// </Button>
// </Popconfirm>
// ],
// }}
>
</ProTable></div>
</Spin >
)
}
function mapStateToProps(state) {
const { auth, depMessage } = state;
const pakData = (dep) => {
return dep.map((d) => {
return {
title: d.name,
value: d.id,
// children: d.type >= 2 ? [] : pakData(d.subordinate)
children: pakData(d.subordinate)
}
})
}
let depData = pakData(depMessage.data || [])
return {
user: auth.user,
depMessage: depMessage.data || [],
depLoading: depMessage.isRequesting,
depData,
};
}
export default connect(mapStateToProps)(promotionalTable);

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

@ -8,5 +8,5 @@ import OperaTional from './operational';
import Enforce from './enforce';
import Public from './public';
import Videois from './videois';
export { Infor,transportation,BridgeTable,HigHways,OperaTional,Enforce,Public,Videois };
import PromoTional from './promotional';
export { Infor,transportation,BridgeTable,HigHways,OperaTional,Enforce,Public,Videois,PromoTional };

43
web/client/src/sections/fillion/containers/promotional.js

@ -0,0 +1,43 @@
import React, { useEffect, useState } from 'react';
import { connect } from 'react-redux';
import '../style.less';
import { getDepMessage, getReportStatistic } from "../actions/infor"
import EnforceTable from '../components/enforceTable';
import PromoTionalTable from '../components/promotionalTable';
const superagent = require('superagent');
const promotional = (props) => {
const { dispatch, user } = props
const [data, setData] = useState()
useEffect(() => {
// dispatch(getDepMessage())
dispatch(getReportStatistic())
setData(props)
}, []);
// //批量导出
// const exports = (ids, counts) => {
// // console.log(user);
// let reportIds = [];
// if (ids.length)
// reportIds = ids
// else
// reportIds = (counts || {}).ids || [];
// superagent.post('/_report/http')
// .send({ id: reportIds.map(i => Number(i)) }).end((err, res) => {
// const resTextIs = res.text.split('/').pop()
// window.open(
// '/_api/' +
// `attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`)
// })
// }
return (
<> <PromoTionalTable data={data} />
</>
)
}
function mapStateToProps(state) {
const { auth } = state
return {
user: auth.user,
}
}
export default connect(mapStateToProps)(promotional);

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

@ -29,6 +29,9 @@ export function getNavItem(user, dispatch) {
<Menu.Item key="fillionvideois">
<Link to="/fillion/videois">视频管理</Link>
</Menu.Item>
<Menu.Item key="fillionpromotional">
<Link to="/fillion/promotional">宣传视频</Link>
</Menu.Item>
</SubMenu>
);
}
}

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

@ -7,6 +7,7 @@ import { OperaTional } from './containers';
import { Enforce } from './containers';
import { Public } from './containers';
import { Videois } from './containers';
import { PromoTional } from './containers';
export default [{
type: 'inner',
route: {
@ -66,6 +67,13 @@ export default [{
component: Videois,
breadcrumb: '视频管理',
}
, {
path: '/promotional',
key: 'fillionpromotional',
menuSelectKeys: ['fillionpromotional'],
component: PromoTional,
breadcrumb: '视频管理',
}
]
}
}];

6
web/client/src/sections/quanju/containers/example.js

@ -11,9 +11,9 @@ const Example = (props) => {
const { dispatch, actions, user, loading } = props
const [tabKey, setTabKey] = useState('leadership')
useEffect(() => {
dispatch(actions.example.getMembers(user.orgId))
}, [])
// useEffect(() => {
// dispatch(actions.example.getMembers(user.orgId))
// }, [])
const tabChange = (tab) => {
//leader 领导驾驶舱 site 工地 toilet 公厕 light 照明 water水质 encomic经济 environment 生态环境 security 智慧安监
// setCurrentTab(tab);

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

@ -5,19 +5,37 @@ import LeftBottom from './Leftbottom'
import RightTop from './Righttop'
import Rightcenter from './Rightcenter'
import Rightbottom from './Rightbottom'
import Module from '../../public/module'
import './style.less'
const Build = () => {
return (
<div className='bgbuild'>
<div className='bgbuild-left'>
<LeftTop/>
<LeftCenter/>
<LeftBottom/>
<Module title={"各种状态公路数量统计"} style={{ width: "100%",
height:" 33%"
}}>
<div>
在建公路数量
</div>
</Module>
<Module title={"各乡镇道路占比统计"} style={{ width: "100%",
height:" 33%",marginTop:'3%'
}}></Module>
<Module title={"道路统计"} style={{ width: "100%",
height:" 30%",marginTop:'3%'
}}></Module>
</div>
<div className='bgbuild-right'>
<RightTop/>
<Rightcenter/>
<Rightbottom/>
<Module title={"宣传栏"} style={{ width: "100%",
height:" 33%"
}}></Module>
<Module title={"各乡镇在建公路工程"} style={{ width: "100%",
height:" 33%",marginTop:'3%'
}}></Module>
<Module title={"公路等级统计"} style={{ width: "100%",
height:" 30%",marginTop:'3%'
}}></Module>
</div>
</div>
)

2
web/client/src/sections/quanju/containers/public/module.js

@ -12,7 +12,7 @@ const Module = (props) => {
<span style={{ position: "absolute", color: "#FFFFFF", fontSize: "24px", fontFamily: "YouSheBiaoTiHei", left: "10%" }}>{title || []}</span>
<img src='/assets/images/quanju/mokuaitou.png' style={{ width: "100%", height: "28px", position: "absolute", top: "12px" }} />
</div>
<div style={{ width: "100%", height: "70%" }}>
<div style={{ width: "100%", height: `calc(100% - 40px)` }}>
{children}
</div>
</div>

Loading…
Cancel
Save