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 ( +
+ { + props.type_ys ?
+ +
+ + + + + + + +
+
+
+ : +
+ handleOkEdit(record)} onCancel={handleCancel}> +
{ + return { url: item } + }) + }} + onFinish={onFinish} + onFinishFailed={onFinishFailed} + autoComplete="off" + + > + + + + + + + + + +
+
+
+ } +
+ ) +} + + + +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); \ No newline at end of file diff --git a/web/client/src/sections/fillion/components/promotionalTable.js b/web/client/src/sections/fillion/components/promotionalTable.js index 3b8a42b9..8922356e 100644 --- a/web/client/src/sections/fillion/components/promotionalTable.js +++ b/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 ( -
-
- ); - }, - }, - ] - return ( - -
- { 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
- dataSource={(counts || {}).rows || []} - request={async (params) => { + onClickEnable(record)} defaultChecked={true ? record.enable == true : false} />
+ } + }, + { + title: '操作', + dataIndex: 'creatTime', + valueType: 'dateTimeRange', + hideInSearch: true, + width: 120, + fixed: 'right', + render: (dom, record) => { + return
+ + { 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(), - // { props.exports(rowSelected, counts) }}> - // - // - // ], - // }} + dispatch(delPropagata(query)).then(() => { + dispatch(getPropagata()).then((res) => { + setCounts(res.payload.data) + }) + }) + } + } + + > + + +
+ + } + }, + { + key: "direction", + hideInTable: true, + dataIndex: "direction", + order: 6, + renderFormItem: (item, { type, defaultRender, ...rest }, form, record) => { + return ( +
+ +
+ ); + }, + }, + ] - > -
+ //获取数据 + useEffect(() => { + const vedio = dispatch(getPropagata()).then((res) => { + setCounts(res.payload.data) + console.log(res.payload.data) + }) + }, []) -
- ) + + return ( + + +
+ { + 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([]); + }} + > +
+
+ ) } -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); \ No newline at end of file diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index 9b025ac0..3d83370b 100644 --- a/web/client/src/utils/webapi.js +++ b/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}', From 3bbfedb6d8a0be0a44e47477d0e31c2e8364a6de Mon Sep 17 00:00:00 2001 From: liujiangyong Date: Fri, 29 Jul 2022 09:25:42 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E8=A7=86=E9=A2=91=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/src/app.config.js | 3 +- weapp/src/config.js | 7 +- weapp/src/packages/video/index.config.js | 3 + weapp/src/packages/video/index.jsx | 85 ++++++++++++++++++++++++ weapp/src/packages/video/index.scss | 28 ++++++++ weapp/src/pages/home/index.jsx | 4 +- 6 files changed, 125 insertions(+), 5 deletions(-) create mode 100644 weapp/src/packages/video/index.config.js create mode 100644 weapp/src/packages/video/index.jsx create mode 100644 weapp/src/packages/video/index.scss diff --git a/weapp/src/app.config.js b/weapp/src/app.config.js index db0918a6..a846996f 100644 --- a/weapp/src/app.config.js +++ b/weapp/src/app.config.js @@ -10,7 +10,8 @@ export default { 'patrol/index', 'patrolView/index', 'changePassword/index', - 'changePassword/success/index' + 'changePassword/success/index', + 'video/index', ] }], permission: { diff --git a/weapp/src/config.js b/weapp/src/config.js index 0182ed94..9648c0ca 100644 --- a/weapp/src/config.js +++ b/weapp/src/config.js @@ -8,9 +8,10 @@ const baseConfig = { }; const development = { - baseUrl: 'https://c5a6-117-90-37-10.ap.ngrok.io', - webUrl: 'https://smartwater.anxinyun.cn', - pcode: 'fce4afe2-5b6a-408a-ab18-a2afa7fa027c', + baseUrl: 'http://221.230.55.29:31919', + // baseUrl: 'https://c5a6-117-90-37-10.ap.ngrok.io', + // webUrl: 'https://smartwater.anxinyun.cn', + // pcode: 'fce4afe2-5b6a-408a-ab18-a2afa7fa027c', imgUrl: 'http://test.resources.anxinyun.cn/', // requestCache: true, //开启异步请求缓存 ...baseConfig diff --git a/weapp/src/packages/video/index.config.js b/weapp/src/packages/video/index.config.js new file mode 100644 index 00000000..1490b5e0 --- /dev/null +++ b/weapp/src/packages/video/index.config.js @@ -0,0 +1,3 @@ +export default { + navigationBarTitleText: '视频监控' +} \ No newline at end of file diff --git a/weapp/src/packages/video/index.jsx b/weapp/src/packages/video/index.jsx new file mode 100644 index 00000000..adc835ef --- /dev/null +++ b/weapp/src/packages/video/index.jsx @@ -0,0 +1,85 @@ +import React, { useState, useEffect } from 'react' +import Taro from '@tarojs/taro' +import { View, Image, Input, Picker, LivePlayer } from '@tarojs/components' +import request from '@/services/request' +import './index.scss' +import '../patrolView/index.scss' +import patrolIcon from '../../static/img/patrolView/patrol.svg' +import patrolActiveIcon from '../../static/img/patrolView/patrol-active.svg' +import conserveIcon from '../../static/img/patrolView/conserve.svg' +import conserveActiveIcon from '../../static/img/patrolView/conserve-active.svg' +import chevronDown from '../../static/img/patrolView/chevron-down.png' +import searchIcon from '../../static/img/patrolView/search.png' + +function Index() { + const [isBus, setIsBus] = useState(true) + const [filterText, setFilterText] = useState('') + const [videoList, setVideoList] = useState([]) + + useEffect(() => { + getVideoList() + }, []) + + const getVideoList = () => { + let nextVideoList = [] + for (let i = 0; i < 10; i++) { + nextVideoList.push({ title: '视频' + i, url: '链接' + i }) + } + setVideoList(nextVideoList) + } + + const onTypeChange = bool => { + setIsBus(bool) + } + + const handleConfirm = e => { + + } + + const handleInput = e => { + + } + + return ( + + + onTypeChange(true)}> + + 公交 + + + onTypeChange(false)}> + + 道路 + + + + + 路段: + + {'请选择'} + + + + + + + + + + { + videoList && videoList.map(v => { + return ( + + {v.title} + + + ) + }) + } + + + ) +} + +export default Index diff --git a/weapp/src/packages/video/index.scss b/weapp/src/packages/video/index.scss new file mode 100644 index 00000000..b69f8771 --- /dev/null +++ b/weapp/src/packages/video/index.scss @@ -0,0 +1,28 @@ +page { + background-color: #f6f6f6; + + .video-box { + padding-top: 180px; + + .video-card { + background-color: #fff; + height: 488px; + margin-bottom: 20px; + display: flex; + flex-direction: column; + align-items: left; + + .title { + height: 88px; + margin-left: 30px; + display: flex; + align-items: center; + } + + .video { + height: 400px; + width: 100%; + } + } + } +} \ No newline at end of file diff --git a/weapp/src/pages/home/index.jsx b/weapp/src/pages/home/index.jsx index 3df1e359..fde2864b 100644 --- a/weapp/src/pages/home/index.jsx +++ b/weapp/src/pages/home/index.jsx @@ -38,7 +38,9 @@ const Index = () => { } function toVideo() { - + Taro.navigateTo({ + url: '/packages/video/index' + }) } return ( From 8d7fb8f6025fb59aa2322de741d3473e25ab166b Mon Sep 17 00:00:00 2001 From: xingyongchun Date: Fri, 29 Jul 2022 09:55:19 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/client/src/sections/fillion/components/bridgeTable.js | 2 +- web/client/src/sections/fillion/components/inforTable.js | 8 ++++---- .../sections/fillion/components/transportationTable.js | 2 +- web/client/src/sections/fillion/nav-item.js | 7 ++----- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/web/client/src/sections/fillion/components/bridgeTable.js b/web/client/src/sections/fillion/components/bridgeTable.js index c6761572..2fcaf7d8 100644 --- a/web/client/src/sections/fillion/components/bridgeTable.js +++ b/web/client/src/sections/fillion/components/bridgeTable.js @@ -1815,7 +1815,7 @@ const BrideTable = (props) => { } if (whichofits == 'gongcheng') { const query = { type: 'bridge', - // type:sitename + entryName:sitename } setRowSelected([]); const res = await dispatch(getProject(query)); diff --git a/web/client/src/sections/fillion/components/inforTable.js b/web/client/src/sections/fillion/components/inforTable.js index 44b26b61..aa351cfb 100644 --- a/web/client/src/sections/fillion/components/inforTable.js +++ b/web/client/src/sections/fillion/components/inforTable.js @@ -132,16 +132,16 @@ const InForTable = (props) => { { - setOverrunRateUpper(value.currentTarget.value) + setOverrunRateFloor(value.currentTarget.value) }} - placeholder='输入超限率上限' /> + placeholder='超限率下限' /> { - setOverrunRateFloor(value.currentTarget.value) + setOverrunRateUpper(value.currentTarget.value) }} - placeholder='输入超限率下限' /> + placeholder='超限率上限' /> diff --git a/web/client/src/sections/fillion/components/transportationTable.js b/web/client/src/sections/fillion/components/transportationTable.js index 53cba191..b21154da 100644 --- a/web/client/src/sections/fillion/components/transportationTable.js +++ b/web/client/src/sections/fillion/components/transportationTable.js @@ -3827,7 +3827,7 @@ const TransporTationTable = (props) => { if (whichofits == 'gongcheng') { const query = { type: 'road', - // type:sitename + entryName:sitename } setRowSelected([]); const res = await dispatch(getProject(query)); diff --git a/web/client/src/sections/fillion/nav-item.js b/web/client/src/sections/fillion/nav-item.js index 56f660d7..e7e0cf62 100644 --- a/web/client/src/sections/fillion/nav-item.js +++ b/web/client/src/sections/fillion/nav-item.js @@ -32,12 +32,9 @@ export function getNavItem(user, dispatch) { 公交管理 - - 档案管理 - - + {/* 视频管理 - + */} 宣传视频 From c276432d65c2bda917c8795feec9ce6dbb2fae91 Mon Sep 17 00:00:00 2001 From: wangyue Date: Fri, 29 Jul 2022 09:57:38 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=92=8C=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../containers/footer/leadership/centerleft/daolu.js | 8 ++++---- .../containers/footer/leadership/centerleft/handong.js | 8 ++++---- .../footer/leadership/centerleft/qiqoliang.js | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js index c08e3389..9c7132c4 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js @@ -62,21 +62,21 @@ const Right = (props) => {
-

占比{((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)}%

diff --git a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/handong.js b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/handong.js index 05670dbc..1575e9c9 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/handong.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/handong.js @@ -66,21 +66,21 @@ const Right = (props) => {
-

占比{((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)}%

diff --git a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/qiqoliang.js b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/qiqoliang.js index 7d16c944..07b08076 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/qiqoliang.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/qiqoliang.js @@ -61,21 +61,21 @@ const Right = (props) => {
-

占比{((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)}%

From b67e6d3d48ef2d25d67ad49990322e34f7798aa7 Mon Sep 17 00:00:00 2001 From: xingyongchun Date: Fri, 29 Jul 2022 09:59:00 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=9B=91=E6=B5=8B=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/client/src/sections/fillion/components/inforTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/client/src/sections/fillion/components/inforTable.js b/web/client/src/sections/fillion/components/inforTable.js index aa351cfb..7aa17c1e 100644 --- a/web/client/src/sections/fillion/components/inforTable.js +++ b/web/client/src/sections/fillion/components/inforTable.js @@ -197,7 +197,7 @@ const InForTable = (props) => { dataIndex: 'createdAt', valueType: 'date', render: (dom, record) => { - return record.testTime.slice(0,10) + return record.testTime?.slice(0,10) }, fieldProps: { onChange: (value, cs) => {