From 18081ef2dc839fb74c34aa2a9bfd049bad2462a0 Mon Sep 17 00:00:00 2001 From: yangsen <952208207@qq.com> Date: Fri, 29 Jul 2022 09:24:27 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=AE=A3=E4=BC=A0=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/fillion/actions/infor.js | 662 ++++++++++-------- .../fillion/components/infor/videoUpload.js | 213 ++++++ .../fillion/components/promotionalTable.js | 316 +++++---- web/client/src/utils/webapi.js | 2 +- 4 files changed, 731 insertions(+), 462 deletions(-) create mode 100644 web/client/src/sections/fillion/components/infor/videoUpload.js diff --git a/web/client/src/sections/fillion/actions/infor.js b/web/client/src/sections/fillion/actions/infor.js index faa48253..dd4d0e29 100644 --- a/web/client/src/sections/fillion/actions/infor.js +++ b/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' } + }); } \ No newline at end of file diff --git a/web/client/src/sections/fillion/components/infor/videoUpload.js b/web/client/src/sections/fillion/components/infor/videoUpload.js new file mode 100644 index 00000000..460dd75a --- /dev/null +++ b/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 ( +
占比{((roads?.["县"] / (roads?.["乡"] + roads?.["村"] + roads?.["县"])) * 100).toFixed(2)}%
+占比{((roads?.["县"] / (roads?.["乡"] + roads?.["村"] + roads?.["县"])) * 100).toFixed(2)}%
{roads?.["县"].toFixed(3)}公里县道道路
乡村道道路{(roads?.["乡"] + roads?.["村"]).toFixed(3)}公里
-占比{(((roads?.["乡"] + roads?.["村"]) / (roads?.["乡"] + roads?.["村"] + roads?.["县"])) * 100).toFixed(2)}%
+占比{(((roads?.["乡"] + roads?.["村"]) / (roads?.["乡"] + roads?.["村"] + roads?.["县"])) * 100).toFixed(2)}%
占比{((roads?.["县"] / (roads?.["乡"] + roads?.["村"] + roads?.["县"])) * 100).toFixed(2)}%
+占比{((roads?.["县"] / (roads?.["乡"] + roads?.["村"] + roads?.["县"])) * 100).toFixed(2)}%
{roads?.["县"].toFixed(0)}个县涵洞
乡村涵洞{(roads?.["乡"] + roads?.["村"]).toFixed(0)}个
-占比{(((roads?.["乡"] + roads?.["村"]) / (roads?.["乡"] + roads?.["村"] + roads?.["县"])) * 100).toFixed(2)}%
+占比{(((roads?.["乡"] + roads?.["村"]) / (roads?.["乡"] + roads?.["村"] + roads?.["县"])) * 100).toFixed(2)}%
占比{((roads?.["大桥"] / (roads?.["小桥"] + roads?.["中桥"] + roads?.["大桥"])) * 100).toFixed(2)}%
+占比{((roads?.["大桥"] / (roads?.["小桥"] + roads?.["中桥"] + roads?.["大桥"])) * 100).toFixed(2)}%
{roads?.["大桥"]}座大桥
中小桥梁{roads?.["小桥"] + roads?.["中桥"]}座
-占比{(((roads?.["小桥"] + roads?.["中桥"]) / (roads?.["小桥"] + roads?.["中桥"] + roads?.["大桥"])) * 100).toFixed(2)}%
+占比{(((roads?.["小桥"] + roads?.["中桥"]) / (roads?.["小桥"] + roads?.["中桥"] + roads?.["大桥"])) * 100).toFixed(2)}%