Browse Source

宣传视频模块

dev
yangsen 2 years ago
parent
commit
18081ef2dc
  1. 662
      web/client/src/sections/fillion/actions/infor.js
  2. 213
      web/client/src/sections/fillion/components/infor/videoUpload.js
  3. 316
      web/client/src/sections/fillion/components/promotionalTable.js
  4. 2
      web/client/src/utils/webapi.js

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

@ -1,15 +1,15 @@
import { basicAction } from '@peace/utils'
import { ApiTable } from '$utils'
export function getDepMessage() {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
actionType: 'GET_DEPARTMENT_MESSAGE',
url: ApiTable.getDepMessage,
msg: { error: '获取部门信息失败' },
reducer: { name: 'depMessage' }
});
export function getDepMessage () {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
actionType: 'GET_DEPARTMENT_MESSAGE',
url: ApiTable.getDepMessage,
msg: { error: '获取部门信息失败' },
reducer: { name: 'depMessage' }
});
}
// export function getReportStatistic(query) {
// return dispatch => basicAction({
@ -23,304 +23,348 @@ export function getDepMessage() {
// });
// }
export function getOperaTional(query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_OPERA_TIONAL',
url: ApiTable.getOperaTional,
msg: { error: '获取客运信息失败' },
});
}
export function putOperaTional(query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'PUT_OPERA_TIONAL',
url: ApiTable.putOperaTional,
msg: { error: '获取车辆信息失败' },
});
}
export function getSpecificVehicle(query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_SPECIFIC_VEHICLE',
url: ApiTable.getSpecificVehicle,
msg: { error: '获取车辆信息失败' },
});
}
export function putSpecificVehicle(query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'put_SPECIFIC_VEHICLE',
url: ApiTable.putSpecificVehicle,
msg: { option: '编辑车辆信息' },
});
}
export function putHouseholds(query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'put_HOUSEHOLDS',
url: ApiTable.putHouseholds,
msg: { option: '编辑业户信息' },
});
}
export function getHouseholds(query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_HOUSEHOLDS',
url: ApiTable.getHouseholds,
msg: { error: '获取业户信息失败' },
});
}
export function getRoadway(query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_ROADWAY',
url: ApiTable.getRoadway,
msg: { error: '获取道路信息失败' },
});
}
export function putRoadway(query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'PUT_ROADWAY',
url: ApiTable.putRoadway,
msg: { option: '编辑道路信息' },
});
}
export function getBridge(query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_BRIDGE',
url: ApiTable.getBridge,
msg: { error: '获取桥梁信息失败' },
});
}
export function putBridge(query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'PUT_BRIDGE',
url: ApiTable.putBridge,
msg: { option: '编辑桥梁信息' },
});
}
export function getProject(query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_PROJECT',
url: ApiTable.getProject,
msg: { error: '获取工程信息失败' },
});
}
export function putProject(query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'GET_PROJECT',
url: ApiTable.putProject,
msg: { option: '编辑工程信息' },
});
}
export function getHighways(query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_HIGHWAYS',
url: ApiTable.getHighways,
msg: { error: '获取路政信息失败' },
});
}
export function putHighways(query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'GET_HIGHWAYS',
url: ApiTable.putHighways,
msg: { option: '编辑路政信息' },
});
}
export function getCircuit(query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_CIRCUIT',
url: ApiTable.getCircuit,
msg: { error: '获取线路信息失败' },
});
}
export function putCircuit(query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'PUT_CIRCUIT',
url: ApiTable.putCircuit,
msg: { option: '编辑线路信息' },
});
}
export function getVehicle(query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_VEHICLE',
url: ApiTable.getVehicle,
msg: { error: '获取车辆信息失败' },
});
}
export function putVehicle(query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'PUT_VEHICLE',
url: ApiTable.putVehicle,
msg: { option: '编辑车辆信息' },
});
}
export function delRoadway(query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
actionType: 'DEL_ROADWAY',
url: ApiTable.delRoadway.replace("{roadId}", query?.roadId),
msg: { option: '删除车辆信息' },
});
}
export function delProject(query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
actionType: 'DEL_PROJECT',
url: ApiTable.delProject.replace("{projectId}", query?.projectId),
msg: { option: '删除工程信息' },
});
}
export function delBridge(query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
actionType: 'DEL_BRIDGE',
url: ApiTable.delBridge.replace("{bridgeId}", query?.bridgeId),
msg: { option: '删除桥梁信息' },
});
}
export function delSpecificVehicle(query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
actionType: 'DEL_SPECIFICVENICLE',
url: ApiTable.delSpecificVehicle.replace("{vehicleId}", query?.vehicleId),
msg: { option: '删除车辆信息' },
});
}
export function delHouseholds(query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
actionType: 'DEL_HOUSEHOLDS',
url: ApiTable.delHouseholds.replace("{businessId}", query?.businessId),
msg: { option: '删除业户信息' },
});
}
export function delCircuit(query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
actionType: 'DEL_CIRCUIT',
url: ApiTable.delCircuit.replace("{lineId}", query?.lineId),
msg: { option: '删除运营线路信息' },
});
}
export function delVehicle(query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
actionType: 'DEL_VEHICLE',
url: ApiTable.delVehicle.replace("{carId}", query?.carId),
msg: { option: '删除车辆信息' },
});
}
export function getPurchase(query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_PURCHASE',
url: ApiTable.getPurchase,
msg: { error: '获取治超信息失败' },
});
}
export function putPurchase(query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'PUT_PURCHASE',
url: ApiTable.putPurchase,
msg: { option: '编辑治超信息' },
});
}
export function delPurchase(query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
actionType: 'DEL_PURCHASE',
url: ApiTable.delPurchase.replace("{overspeedId}", query?.overspeedId),
msg: { option: '删除车辆信息' },
});
export function getOperaTional (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_OPERA_TIONAL',
url: ApiTable.getOperaTional,
msg: { error: '获取客运信息失败' },
});
}
export function putOperaTional (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'PUT_OPERA_TIONAL',
url: ApiTable.putOperaTional,
msg: { error: '获取车辆信息失败' },
});
}
export function getSpecificVehicle (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_SPECIFIC_VEHICLE',
url: ApiTable.getSpecificVehicle,
msg: { error: '获取车辆信息失败' },
});
}
export function putSpecificVehicle (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'put_SPECIFIC_VEHICLE',
url: ApiTable.putSpecificVehicle,
msg: { option: '编辑车辆信息' },
});
}
export function putHouseholds (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'put_HOUSEHOLDS',
url: ApiTable.putHouseholds,
msg: { option: '编辑业户信息' },
});
}
export function getHouseholds (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_HOUSEHOLDS',
url: ApiTable.getHouseholds,
msg: { error: '获取业户信息失败' },
});
}
export function getRoadway (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_ROADWAY',
url: ApiTable.getRoadway,
msg: { error: '获取道路信息失败' },
});
}
export function putRoadway (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'PUT_ROADWAY',
url: ApiTable.putRoadway,
msg: { option: '编辑道路信息' },
});
}
export function getBridge (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_BRIDGE',
url: ApiTable.getBridge,
msg: { error: '获取桥梁信息失败' },
});
}
export function putBridge (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'PUT_BRIDGE',
url: ApiTable.putBridge,
msg: { option: '编辑桥梁信息' },
});
}
export function getProject (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_PROJECT',
url: ApiTable.getProject,
msg: { error: '获取工程信息失败' },
});
}
export function putProject (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'GET_PROJECT',
url: ApiTable.putProject,
msg: { option: '编辑工程信息' },
});
}
export function getHighways (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_HIGHWAYS',
url: ApiTable.getHighways,
msg: { error: '获取路政信息失败' },
});
}
export function putHighways (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'GET_HIGHWAYS',
url: ApiTable.putHighways,
msg: { option: '编辑路政信息' },
});
}
export function getCircuit (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_CIRCUIT',
url: ApiTable.getCircuit,
msg: { error: '获取线路信息失败' },
});
}
export function putCircuit (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'PUT_CIRCUIT',
url: ApiTable.putCircuit,
msg: { option: '编辑线路信息' },
});
}
export function getVehicle (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_VEHICLE',
url: ApiTable.getVehicle,
msg: { error: '获取车辆信息失败' },
});
}
export function putVehicle (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'PUT_VEHICLE',
url: ApiTable.putVehicle,
msg: { option: '编辑车辆信息' },
});
}
export function delRoadway (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
actionType: 'DEL_ROADWAY',
url: ApiTable.delRoadway.replace("{roadId}", query?.roadId),
msg: { option: '删除车辆信息' },
});
}
export function delProject (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
actionType: 'DEL_PROJECT',
url: ApiTable.delProject.replace("{projectId}", query?.projectId),
msg: { option: '删除工程信息' },
});
}
export function delBridge (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
actionType: 'DEL_BRIDGE',
url: ApiTable.delBridge.replace("{bridgeId}", query?.bridgeId),
msg: { option: '删除桥梁信息' },
});
}
export function delSpecificVehicle (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
actionType: 'DEL_SPECIFICVENICLE',
url: ApiTable.delSpecificVehicle.replace("{vehicleId}", query?.vehicleId),
msg: { option: '删除车辆信息' },
});
}
export function delHouseholds (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
actionType: 'DEL_HOUSEHOLDS',
url: ApiTable.delHouseholds.replace("{businessId}", query?.businessId),
msg: { option: '删除业户信息' },
});
}
export function delCircuit (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
actionType: 'DEL_CIRCUIT',
url: ApiTable.delCircuit.replace("{lineId}", query?.lineId),
msg: { option: '删除运营线路信息' },
});
}
export function delVehicle (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
actionType: 'DEL_VEHICLE',
url: ApiTable.delVehicle.replace("{carId}", query?.carId),
msg: { option: '删除车辆信息' },
});
}
export function getPurchase (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_PURCHASE',
url: ApiTable.getPurchase,
msg: { error: '获取治超信息失败' },
});
}
export function putPurchase (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'PUT_PURCHASE',
url: ApiTable.putPurchase,
msg: { option: '编辑治超信息' },
});
}
export function delPurchase (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
actionType: 'DEL_PURCHASE',
url: ApiTable.delPurchase.replace("{overspeedId}", query?.overspeedId),
msg: { option: '删除车辆信息' },
});
}
export function getPropagata (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_PROPAGATA',
url: ApiTable.getpropagata,
msg: { error: '获取宣传视频信息失败' },
// reducer: { name: 'reportstatistic' }
});
}
export function putAddPropagata (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'PUT_PROPAGATA',
url: ApiTable.putpropagata,
msg: { error: '新增宣传视频信息失败' },
// reducer: { name: 'reportstatistic' }
});
}
export function putEditPropagata (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'PUT_PROPAGATA',
url: ApiTable.putpropagata,
msg: { error: '编辑宣传视频信息失败' },
// reducer: { name: 'reportstatistic' }
});
}
export function delPropagata (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
actionType: 'DEL_PROPAGATA',
url: ApiTable.delpropagata.replace("{publicityId}", query?.publicityId),
msg: { error: '删除宣传视频信息失败' },
// reducer: { name: 'reportstatistic' }
});
}

213
web/client/src/sections/fillion/components/infor/videoUpload.js

@ -0,0 +1,213 @@
import React, { useState, useEffect } from 'react';
import { connect } from 'react-redux';
import { Modal, Form, Button, Input, Card, List } from 'antd';
import Uploads from "../../../../components/Upload/index"
import { putAddPropagata } from '../../actions/infor';
import { putEditPropagata } from '../../actions/infor';
import { getPropagata } from '../../actions/infor';
const VideoUpload = (props) => {
// const [counts, setCounts] = useState()//shuju
const { dispatch, record, counts, setCounts } = props
const [success, setSuccess] = useState() //状态
const [form] = Form.useForm();
//弹窗
const [isModalVisible, setIsModalVisible] = useState(false);
const showModal = () => {
setIsModalVisible(true);
}
const showModalEdit = () => {
setIsModalVisible(true);
};
//新增
const handleOkAdd = () => {
form.validateFields().then((values) => {
const videoAddress = values.video.map((item) => {
return item.storageUrl
})
const videoname = values.videoname
const data = { name: videoname, video: videoAddress }
dispatch(putAddPropagata(data)).then(() => {
dispatch(getPropagata()).then((res) => {
setCounts(res.payload.data)
})
})
setIsModalVisible(false);
}
);
};
//编辑
const handleOkEdit = (record) => {
form.validateFields().then((values) => {
const videoAddress = values.video.map((item) => {
return item.storageUrl
})
const videoname = values.username
const id = record.id
const video = record.video
const data = { publicityId: id, name: videoname, video: video }
dispatch(putEditPropagata(data)).then(() => {
dispatch(getPropagata()).then((res) => {
setCounts(res.payload.data)
})
})
}
);
setIsModalVisible(false);
};
const handleCancel = () => {
setIsModalVisible(false);
};
const onFinish = (values) => {
console.log('Success:', values);
};
const onFinishFailed = (errorInfo) => {
console.log('Failed:', errorInfo);
};
return (
<div >
{
props.type_ys ? <div><Button type='primary' onClick={showModal}>新增</Button>
<Modal visible={isModalVisible} onOk={handleOkAdd} onCancel={handleCancel}>
<Form
form={form}
name="basic"
labelCol={{
span: 5,
}}
wrapperCol={{
span: 16,
}}
initialValues={{
remember: true,
}}
onFinish={onFinish}
onFinishFailed={onFinishFailed}
autoComplete="off"
>
<Form.Item
label="视频名称"
name="videoname"
rules={[
{
required: true,
message: '请输入视频名称!',
max: 50,
},
]}
>
<Input
placeholder="请输入视频名称" />
</Form.Item>
<Form.Item
label="选择视频"
name="video"
>
<Uploads
maxFilesNum={10}
fileTypes={['mp4']}
maxFileSize={200}
/>
</Form.Item>
</Form>
</Modal>
</div>
:
<div><Button type='link' onClick={showModalEdit} style={{ Position: "absolute", left: "-50px", top: "32px" }}>编辑</Button>
<Modal visible={isModalVisible} onOk={() => handleOkEdit(record)} onCancel={handleCancel}>
<Form
form={form}
name="basic"
labelCol={{
span: 5,
}}
wrapperCol={{
span: 16,
}}
initialValues={{
username: record.name, video: record.video.map((item) => {
return { url: item }
})
}}
onFinish={onFinish}
onFinishFailed={onFinishFailed}
autoComplete="off"
>
<Form.Item
label="视频名称"
name="username"
rules={[
{
required: false,
message: '没有做出任何修改!',
max: 50,
},
]}
>
<Input
placeholder="请输入视频名称"
/>
</Form.Item>
<Form.Item
label="选择视频"
name="video"
>
<Uploads
maxFilesNum={10}
fileTypes={['mp4']}
maxFileSize={200}
/>
</Form.Item>
</Form>
</Modal>
</div>
}
</div >
)
}
function mapStateToProps (state) {
const { depMessage } = state;
const pakData = (dep) => {
return dep.map((d) => {
return {
title: d.name,
value: d.id,
children: pakData(d.subordinate)
}
})
}
let depData = pakData(depMessage.data || [])
return {
loading: depMessage.isRequesting,
depData,
};
}
export default connect(mapStateToProps)(VideoUpload);

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

@ -1,169 +1,181 @@
import React, { useEffect, useState } from 'react';
import React, { useEffect, useState} from 'react';
import { connect } from 'react-redux';
import { Spin, Button, Popconfirm, Badge } from 'antd';
import { Spin, Button, Popconfirm, Switch } from 'antd';
import ProTable from '@ant-design/pro-table';
import './protable.less'
import moment from 'moment';
import { getReportStatistic } from "../actions/infor"
import VideoUpload from './infor/videoUpload';
import { getPropagata } from '../actions/infor';
import { putEditPropagata } from '../actions/infor';
import { delPropagata } 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
const { dispatch, } = props
const [rowSelected, setRowSelected] = useState([])
const [counts, setCounts] = useState()//shuju
const onClickEnable = (record) => {
const id = record.id
const name = record.name
const video = record.video
const columns =
[{
title: '序号',
search: false,
dataIndex: 'containers',
const enable = true ? record.enable == false : true
const data = ({ publicityId: id, name: name, video: video, enable: enable })
dispatch(putEditPropagata(data)).then((res) => {
dispatch(getPropagata()).then((res) => {
setCounts(res.payload.data)
})
})
}
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}
const columns =
[{
title: '序号',
search: false,
dataIndex: 'containers',
fixed: 'left',
width: 120,
render: (dom, record, key) => {
return key + 1
}
},
{
title: '视频名称',
dataIndex: 'videoName',
fixed: 'left',
search: false,
width: 120,
options: 1,
render: (dom, record) => {
return record.name
}
},
{
title: '是否展示',
dataIndex: 'shuffling',
valueType: 'shufflingRange',
search: false,
width: 120,
fixed: 'right',
render: (dom, record) => {
return <div >
dataSource={(counts || {}).rows || []}
request={async (params) => {
<Switch checkedChildren="展示" unCheckedChildren="关闭" onClick={() => onClickEnable(record)} defaultChecked={true ? record.enable == true : false} /></div>
}
},
{
title: '操作',
dataIndex: 'creatTime',
valueType: 'dateTimeRange',
hideInSearch: true,
width: 120,
fixed: 'right',
render: (dom, record) => {
return <div style={{ position: 'relative', marginTop: '-30px' }}>
<VideoUpload record={record} counts={counts} setCounts={setCounts} />
<Popconfirm
title="是否确定删除?"
arrowPointAtCenter={true}
showArrow={true}
position="topRight"
onConfirm={
() => {
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
publicityId: record.id
}
}}
// search={{
// defaultCollapsed: false,
// optionRender: (searchConfig, formProps, dom) => [
// ...dom.reverse(),
// <Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, counts) }}>
// <Button
// >
// 导出
// </Button>
// </Popconfirm>
// ],
// }}
dispatch(delPropagata(query)).then(() => {
dispatch(getPropagata()).then((res) => {
setCounts(res.payload.data)
})
})
}
}
>
<Button type="link" float="right"
>删除</Button>
</Popconfirm>
</div>
}
},
{
key: "direction",
hideInTable: true,
dataIndex: "direction",
order: 6,
renderFormItem: (item, { type, defaultRender, ...rest }, form, record) => {
return (
<div>
<VideoUpload type_ys={1} counts={counts} setCounts={setCounts} />
</div>
);
},
},
]
>
</ProTable></div>
//获取数据
useEffect(() => {
const vedio = dispatch(getPropagata()).then((res) => {
setCounts(res.payload.data)
console.log(res.payload.data)
})
}, [])
</Spin >
)
return (
<Spin spinning={false}>
<div className='protable-transpor'>
<ProTable
scroll={{ x: 800 }}
options={false}
style={{ width: "100% ", overflow: "auto", height: '760px' }}
rowKey='id'
rowSelection={{
selectedRowKeys: rowSelected,
onChange: (selectedRowKeys) => {
setRowSelected(selectedRowKeys);
},
}}
form={{
submitter: false,
}}
columns={columns}
dataSource={counts || []}
request={async (params) => {
const query = {
limit: params.pageSize,
offset: ((params.current ? params.current : 1) - 1) * params.pageSize
}
setRowSelected([]);
}}
>
</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,
};
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);

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

@ -94,7 +94,7 @@ export const ApiTable = {
getRoadMaintenance: 'conserve/statistic',
//获取宣传数据
getpropagata: 'publicity',
getpropagata: 'publicity',putpropagata:'publicity',delpropagata:'/publicity/{publicityId}',
// <<<<<<< HEAD
// //公交信息
// getCircuit: 'bus/line', putCircuit: 'bus/line', delCircuit: 'bus/line/{lineId}',

Loading…
Cancel
Save