From 55c125b183d64fde6cac6d2a667d809ec89b3c5a Mon Sep 17 00:00:00 2001 From: mhy <2624196756@qq.com> Date: Mon, 25 Nov 2024 19:20:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=9D=E5=A7=8B=E5=8C=96=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.ts | 5 ++++ .../pages/BaseElement/index.tsx | 12 +++++----- .../pages/BaseIndex/index.tsx | 23 +++++++++--------- .../pages/CarDetail/CarDetail.tsx | 12 +++++----- .../pages/CompletePeriod/index.tsx | 24 +++++++++---------- .../IntegratedCommand/pages/Map/index.tsx | 4 ++-- .../pages/OperationSupervision/index.tsx | 12 +++++----- .../IllegalDrivingModal.tsx | 19 +++++++++++++-- .../pages/RealtimeWarning/index.tsx | 10 ++++---- src/router/index.tsx | 4 +--- src/utils/utils.ts | 2 +- vite.config.ts | 2 +- 12 files changed, 74 insertions(+), 55 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index f1bf45d..f467431 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -39,4 +39,9 @@ export async function driverInfo(id: string) { // 喷头数据 export async function sprayerInfo(id: string) { return request.post(handleGateway('/supervisoryCommand/sprayData?carId=' + id, '/element')) +} + +// 预警数据 +export async function warnInfo(month: string) { + return request.post(handleGateway('/supervisoryCommand/gps/carAlarm?month=' + month, '/element')) } \ No newline at end of file diff --git a/src/pages/IntegratedCommand/pages/BaseElement/index.tsx b/src/pages/IntegratedCommand/pages/BaseElement/index.tsx index 71ef20a..00634b6 100644 --- a/src/pages/IntegratedCommand/pages/BaseElement/index.tsx +++ b/src/pages/IntegratedCommand/pages/BaseElement/index.tsx @@ -209,7 +209,7 @@ export default function () { icon: icon13, name: "作业标段", unit: "条", - value: 22, + value: 0, }, { icon: icon16, @@ -220,7 +220,7 @@ export default function () { ), - value: 22, + value: 0, }, ], }, @@ -230,14 +230,14 @@ export default function () { { icon: icon8, name: "一线管理人员", - total: 56, - value: 22, + total: 1, + value: 0, }, { icon: icon8, name: "环卫工人", - total: 56, - value: 22, + total: 1, + value: 0, }, ], }, diff --git a/src/pages/IntegratedCommand/pages/BaseIndex/index.tsx b/src/pages/IntegratedCommand/pages/BaseIndex/index.tsx index 1419127..d7fcc3b 100644 --- a/src/pages/IntegratedCommand/pages/BaseIndex/index.tsx +++ b/src/pages/IntegratedCommand/pages/BaseIndex/index.tsx @@ -1,15 +1,16 @@ import { Flex } from "antd"; import styles from "./index.module.css"; export default function () { - return ( - -
- 今日综合体征指数 95.6 -
- -
环卫作业 50/50
-
垃圾分类 45.6/50
-
-
- ); + return undefined +// ( +// +//
+// 今日综合体征指数 95.6 +//
+// +//
环卫作业 50/50
+//
垃圾分类 45.6/50
+//
+//
+// ); } diff --git a/src/pages/IntegratedCommand/pages/CarDetail/CarDetail.tsx b/src/pages/IntegratedCommand/pages/CarDetail/CarDetail.tsx index bd3517c..3dc130b 100644 --- a/src/pages/IntegratedCommand/pages/CarDetail/CarDetail.tsx +++ b/src/pages/IntegratedCommand/pages/CarDetail/CarDetail.tsx @@ -1,6 +1,6 @@ import { FC, useEffect, useState } from 'react' import styles from './CarDetail.module.less' -import { Button, Flex, Image } from 'antd' +import { Button, Flex, Image, message } from 'antd' import InstrumentpanelChart from '../../components/InstrumentpanelChart/InstrumentpanelChart' import { carBaseInfo, carCamera, carRealTimeInfo, driverInfo, sprayerInfo } from '@/api' import VideoDplayer from '../../components/VideoDplayer' @@ -20,10 +20,10 @@ const CarDetail: FC = (props) => { const [cameraList, setCameraList] = useState([]) const getCamera = async () => { - const res = await carCamera('4f7b39a774f6086961d850c344184122') - if (res.code === 0) { - setCameraList(res.data) - } + // const res = await carCamera(carId) + // if (res.code === 0) { + // setCameraList(res.data) + // } } const [baseInfo, setBaseInfo] = useState({}) @@ -102,7 +102,7 @@ const CarDetail: FC = (props) => { -
水量(T)
+
水量(L)
{realTimeInfo.weight}
diff --git a/src/pages/IntegratedCommand/pages/CompletePeriod/index.tsx b/src/pages/IntegratedCommand/pages/CompletePeriod/index.tsx index e8ca0bf..5df41b4 100644 --- a/src/pages/IntegratedCommand/pages/CompletePeriod/index.tsx +++ b/src/pages/IntegratedCommand/pages/CompletePeriod/index.tsx @@ -26,7 +26,7 @@ export default function () { >
- 垃圾总量658T + 垃圾总量0T
@@ -34,7 +34,7 @@ export default function () { @@ -42,7 +42,7 @@ export default function () { @@ -50,7 +50,7 @@ export default function () { @@ -58,7 +58,7 @@ export default function () { @@ -67,7 +67,7 @@ export default function () {
- 562T + 0T
垃圾收集点
@@ -76,7 +76,7 @@ export default function () {
- 562T + 0T
收运车辆
@@ -85,7 +85,7 @@ export default function () {
- 562T + 0T
转运站
@@ -94,7 +94,7 @@ export default function () {
- 562T + 0T
末端处置厂
@@ -106,7 +106,7 @@ export default function () { icon={icon25} title={"混装混运"} gap={6} - value={5} + value={0} valueStyle={{ color: "#fff" }} unit={"次"} /> @@ -115,7 +115,7 @@ export default function () { { }} /> })} - {overlays.map((item, index) => { + {/* {overlays.map((item, index) => { // @ts-ignore return - })} + })} */} setCarDetailShow(false)} carData={carData} /> diff --git a/src/pages/IntegratedCommand/pages/OperationSupervision/index.tsx b/src/pages/IntegratedCommand/pages/OperationSupervision/index.tsx index c40f68b..a77fec8 100644 --- a/src/pages/IntegratedCommand/pages/OperationSupervision/index.tsx +++ b/src/pages/IntegratedCommand/pages/OperationSupervision/index.tsx @@ -40,7 +40,7 @@ const Progress = () => { const CustomBarChart = () => { const xAxis = ["道路不洁", "暴露垃圾", "路面污染", "作业遗留", "其它问题"]; - const data = [68, 58, 44, 21, 10]; + const data = [10, 10, 10, 10, 10]; const sub = data.reduce((a, b) => a + b, 0); const length = 20; @@ -89,7 +89,7 @@ export default function () { @@ -103,7 +103,7 @@ export default function () { icon={icon27} title={"机械化作业率"} gap={31} - value={458} + value={0} unit={"%"} /> @@ -127,7 +127,7 @@ export default function () { - + ); } diff --git a/src/pages/IntegratedCommand/pages/RealtimeWarning/IllegalDrivingModal/IllegalDrivingModal.tsx b/src/pages/IntegratedCommand/pages/RealtimeWarning/IllegalDrivingModal/IllegalDrivingModal.tsx index 1f8a2a8..5567a4d 100644 --- a/src/pages/IntegratedCommand/pages/RealtimeWarning/IllegalDrivingModal/IllegalDrivingModal.tsx +++ b/src/pages/IntegratedCommand/pages/RealtimeWarning/IllegalDrivingModal/IllegalDrivingModal.tsx @@ -1,5 +1,5 @@ import BasicsModal from "@/components/BasicsModal/BasicsModal" -import { FC, useRef, useState } from "react" +import { FC, useEffect, useRef, useState } from "react" import styles from './IllegalDrivingModal.module.less' import head from '@/assets/images/bg/head2.png' import { DatePicker, Flex, Image } from "antd" @@ -7,6 +7,8 @@ import { CustomOverlay, Map, MapApiLoaderHOC, Marker, Polygon } from "react-bmap import styleJson from "@/assets/styles/custom_map_config.json"; import PersonnelDetail from "../PersonnelDetail/PersonnelDetail" import { debounce } from 'lodash' +import { warnInfo } from "@/api" +import dayjs from "dayjs" type IllegalDrivingModalProps = { @@ -21,6 +23,19 @@ const IllegalDrivingModal: FC = (props) => { const [list, setList] = useState([]) const [total, setTotal] = useState(0) + const [month, setMonth] = useState(dayjs().format('YYYY-MM')) + const getData = async () => { + // const res = await warnInfo(month) + // if (res.code === 200) { + // console.log(res); + // } + } + useEffect(() => { + if (open) { + getData() + } + }, [open, month]) + // 触底加载 const boxScroll = debounce(() => { if (scrollRef.current) { @@ -44,7 +59,7 @@ const IllegalDrivingModal: FC = (props) => {
车辆超速报警
当前
历史
- + setMonth(data as string)} />
diff --git a/src/pages/IntegratedCommand/pages/RealtimeWarning/index.tsx b/src/pages/IntegratedCommand/pages/RealtimeWarning/index.tsx index 112abf4..c3fc6d5 100644 --- a/src/pages/IntegratedCommand/pages/RealtimeWarning/index.tsx +++ b/src/pages/IntegratedCommand/pages/RealtimeWarning/index.tsx @@ -7,15 +7,15 @@ export default function () { const listData = [ { name: "违规驾驶报警", - total: 102, - value: 15, + total: 0, + value: 0, onClick: () => { setIllegalDrivingShow(true) } }, - { name: "人员SOS报警", total: 102, value: 15 }, - { name: "车载超速报警", total: 102, value: 15 }, - { name: "车辆超载报警", total: 102, value: 2 }, + { name: "人员SOS报警", total: 0, value: 0 }, + { name: "车载超速报警", total: 0, value: 0 }, + { name: "车辆超载报警", total: 0, value: 0 }, ] return
diff --git a/src/router/index.tsx b/src/router/index.tsx index 8acd133..5983e7f 100644 --- a/src/router/index.tsx +++ b/src/router/index.tsx @@ -27,8 +27,6 @@ const router = createBrowserRouter([ }, ], }, -], { - // basename: "/sanitation", -}) +]) export default router; diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 376223b..825731c 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -2,7 +2,7 @@ // 处理请求访问网关 const IS_PROD = process.env.NODE_ENV === 'production'; export const handleGateway = (url: string, gateway: string = '') => { - // return '/sanitation/api' + gateway + url + // return '/api' + gateway + url if (IS_PROD) { return '/api' + gateway + url diff --git a/vite.config.ts b/vite.config.ts index 5275334..976a905 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -25,7 +25,7 @@ export default defineConfig({ proxy: { "/api": { // target: "http://172.23.0.140:15999", // 唐 - target: "http://171.217.92.33:58089", // 测试服务 + target: "http://171.217.92.33:58089/element", // 测试服务 changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, ""), } -- GitLab