+
{dlql?.children?.map((item: any) => {
return (
-
+
diff --git a/src/pages/SecurityServiceOverview/SecurityState/RightLayout/RiskNotice/index.tsx b/src/pages/SecurityServiceOverview/SecurityState/RightLayout/RiskNotice/index.tsx
index 0a630a82..cfca0c04 100644
--- a/src/pages/SecurityServiceOverview/SecurityState/RightLayout/RiskNotice/index.tsx
+++ b/src/pages/SecurityServiceOverview/SecurityState/RightLayout/RiskNotice/index.tsx
@@ -4,55 +4,56 @@ import orangeBg from '@/assets/images/SecurityServiceOverview/right/orangeBg.png
import redBg from '@/assets/images/SecurityServiceOverview/right/redBg.png';
import yellowBg from '@/assets/images/SecurityServiceOverview/right/yellowBg.png';
import Modal from '@/components/HncyModal';
+import BaseInfo from '@/pages/SecurityServiceOverview/components/BaseInfo';
import RiskWarn from '@/pages/SecurityServiceOverview/components/RiskWarn';
import services from '@/services';
import { DoubleRightOutlined } from '@ant-design/icons';
-import { useRequest } from '@umijs/max';
+import { useModel, useRequest } from '@umijs/max';
import { Flex, Space } from 'antd';
import classNames from 'classnames';
import dayjs from 'dayjs';
import { CSSProperties, useMemo, useState } from 'react';
import styles from './index.less';
-import BaseInfo from '@/pages/SecurityServiceOverview/components/BaseInfo';
type RiskLevelDto = {
label: string;
color: CSSProperties['color'];
num: number;
};
-export const colorConfig: Record<
-string,
-{
- color: CSSProperties['color'];
- bg: string;
- icon: string;
-}
+export const colorConfig: Record<
+ string,
+ {
+ color: CSSProperties['color'];
+ bg: string;
+ icon: string;
+ }
> = {
-红色风险: {
- //红色风险
- color: '#FFBCBC',
- bg: redBg,
- icon: 'redIcon',
-},
-橙色风险: {
- //橙色风险
- color: '#FDDFCE',
- bg: orangeBg,
- icon: 'orangeIcon',
-},
-黄色风险: {
- //黄色风险
- color: '#FFE892',
- bg: yellowBg,
- icon: 'yellowIcon',
-},
-一般风险: {
- //一般风险
- color: '#BFE4FF',
- bg: blueBg,
- icon: 'blueIcon',
-},
+ 红色预警: {
+ //红色风险
+ color: '#FFBCBC',
+ bg: redBg,
+ icon: 'redIcon',
+ },
+ 橙色预警: {
+ //橙色风险
+ color: '#FDDFCE',
+ bg: orangeBg,
+ icon: 'orangeIcon',
+ },
+ 黄色预警: {
+ //黄色风险
+ color: '#FFE892',
+ bg: yellowBg,
+ icon: 'yellowIcon',
+ },
+ 一般预警: {
+ //一般风险
+ color: '#BFE4FF',
+ bg: blueBg,
+ icon: 'blueIcon',
+ },
};
const RiskNotice: React.FC = () => {
+ const { selectAreaId } = useModel('safetyAreaId');
const [riskModalOpt, setRiskModalOpt] = useState<{
open: boolean;
title: string;
@@ -66,19 +67,35 @@ const RiskNotice: React.FC = () => {
const { data: eventData } = useRequest(() =>
services.CityRiskApi.getEventPage({ page: 1, count: 5 }),
);
- // 事件详情弹窗
- const [detailModalOpt, setDetailModalOpt] = useState<{
- open: boolean;
- title: string;
- eventId: string;
- eventType?:string|undefined;
- riskLevelName?:string;
- position?:string
- }>({
- open: false,
- title: '',
- eventId: '',
- });
+ const { data } = useRequest(
+ () =>
+ services.DataBase.getSjdzInfoData({
+ typeCode: 'zzcc-aq-yjxx',
+ data: {
+ regionCode: selectAreaId,
+ pageNo: 1,
+ pageSize: 5,
+ },
+ }),
+ {
+ refreshDeps: [selectAreaId],
+ },
+ );
+ // console.log(data);
+
+ // 事件详情弹窗zzcc-aq-yjxx
+ const [detailModalOpt, setDetailModalOpt] = useState<{
+ open: boolean;
+ title: string;
+ eventId: string;
+ eventType?: string | undefined;
+ riskLevelName?: string;
+ position?: string;
+ }>({
+ open: false,
+ title: '',
+ eventId: '',
+ });
const riskLevel: RiskLevelDto[] = useMemo(() => {
return [
{
@@ -104,7 +121,6 @@ const RiskNotice: React.FC = () => {
];
}, [levelData]);
-
/** 标题渲染 */
const titleRender = () => {
return (
@@ -128,25 +144,21 @@ const RiskNotice: React.FC = () => {
return (
-
- 风险预警
-
+
风险预警
- {riskLevel?.map((it) => (
-
-
{it.label}
-
{it.num}
-
- ))}
+ {riskLevel?.map((it) => (
+
+
{it.label}
+
{it.num}
+
+ ))}
-
- {eventData?.items?.map((it:any, index:number) => (
+ {data?.data?.records?.map((it: any, index: number) => (
{
key={index}
style={
{
- '--color': colorConfig[it?.riskLevelName]?.color,
- background: `url(${colorConfig[it?.riskLevelName]?.bg})`,
+ '--color': colorConfig[it?.risklevel]?.color,
+ background: `url(${colorConfig[it?.risklevel]?.bg})`,
backgroundSize: '100% 100%',
} as CSSProperties
}
- onClick={()=>{
+ onClick={() => {
setDetailModalOpt({
open: true,
- eventId: it?.asriskId,
+ eventId: it?.riskid,
...it,
});
}}
>
- {colorConfig[it?.riskLevelName]?.icon && (
+ {colorConfig[it?.risklevel]?.icon && (
)}
- {it?.eventType}
+ {it?.riskdescription}
- {it?.position}
+ {it?.region_name}
- {dayjs().diff(it?.warningTime, 'm')}分钟前
+ {dayjs().diff(it?.risktime, 'h')}小时前
@@ -208,10 +220,10 @@ const RiskNotice: React.FC = () => {
width={1500}
height={846}
>
-
+
- {/* 事件详情 */}
- {
diff --git a/src/pages/SecurityServiceOverview/SecurityState/SecurityCqi/index.tsx b/src/pages/SecurityServiceOverview/SecurityState/SecurityCqi/index.tsx
index 19bfb90c..326a9efb 100644
--- a/src/pages/SecurityServiceOverview/SecurityState/SecurityCqi/index.tsx
+++ b/src/pages/SecurityServiceOverview/SecurityState/SecurityCqi/index.tsx
@@ -63,14 +63,15 @@ const SecurityCqi = ({ warnLevel }: { warnLevel: number }) => {
typeCode: 'zzcc-aq-yjtj',
data: {
regionCode: selectAreaId,
- industryCode: '0401',
+ // industryCode: '0401',
},
}),
{
refreshDeps: [selectAreaId],
},
);
- console.log(data);
+console.log(data);
+
const { data: signData } = useRequest(() => {
return services.Physicalsign.getComparisonIndexInstance({
@@ -210,17 +211,31 @@ const SecurityCqi = ({ warnLevel }: { warnLevel: number }) => {
- {statisticalEvent?.monthEventTotal}
+ { data?.data?.records?.[0]?.yjqktj?.find(
+ (item) => item?.status == '未处理',
+ )?.num+data?.data?.records?.[0]?.yjqktj?.find(
+ (item) => item?.status == '已解除',
+ )?.num}
监测预警
-
{statisticalEvent?.zgzEventTotal}
+
+ {
+ data?.data?.records?.[0]?.yjqktj?.find(
+ (item) => item?.status == '未处理',
+ )?.num
+ }
+
处置中
- {statisticalEvent?.yxcEventTotal}
+ {
+ data?.data?.records?.[0]?.yjqktj?.find(
+ (item) => item?.status == '已解除',
+ )?.num
+ }
已处置
diff --git a/src/pages/SecurityServiceOverview/components/BaseInfo/DetMap/index.tsx b/src/pages/SecurityServiceOverview/components/BaseInfo/DetMap/index.tsx
index 1b90f72a..1a19d3e8 100644
--- a/src/pages/SecurityServiceOverview/components/BaseInfo/DetMap/index.tsx
+++ b/src/pages/SecurityServiceOverview/components/BaseInfo/DetMap/index.tsx
@@ -68,19 +68,19 @@ const DetMap = () => {
open: false,
title: '道路桥梁情况',
});
- const { data: mapMark } = useRequest(
- () => services.CityRiskApi.findListForMap(searchParams),
- {
- refreshDeps: [searchParams],
- },
- );
- //safetyRiskEventMap
- const { data: warnMark } = useRequest(
- () => services.CityRiskApi.safetyRiskEventMap(searchParams),
- {
- refreshDeps: [searchParams],
- },
- );
+ // const { data: mapMark } = useRequest(
+ // () => services.CityRiskApi.findListForMap(searchParams),
+ // {
+ // refreshDeps: [searchParams],
+ // },
+ // );
+ // //safetyRiskEventMap
+ // const { data: warnMark } = useRequest(
+ // () => services.CityRiskApi.safetyRiskEventMap(searchParams),
+ // {
+ // refreshDeps: [searchParams],
+ // },
+ // );
return (
diff --git a/src/pages/SecurityServiceOverview/components/BaseInfo/index.less b/src/pages/SecurityServiceOverview/components/BaseInfo/index.less
index 6a6e4299..2ad80459 100644
--- a/src/pages/SecurityServiceOverview/components/BaseInfo/index.less
+++ b/src/pages/SecurityServiceOverview/components/BaseInfo/index.less
@@ -6,9 +6,7 @@
}
.imgWarp {
- position: absolute;
- left: -550px;
- z-index: 9999;
+
width: 504px;
diff --git a/src/pages/SecurityServiceOverview/components/BaseInfo/index.tsx b/src/pages/SecurityServiceOverview/components/BaseInfo/index.tsx
index 21956d5b..189b7ad9 100644
--- a/src/pages/SecurityServiceOverview/components/BaseInfo/index.tsx
+++ b/src/pages/SecurityServiceOverview/components/BaseInfo/index.tsx
@@ -4,7 +4,6 @@ import services from '@/services';
import { imageOptions } from '@/utils/comm';
import { useRequest } from '@umijs/max';
import { Carousel, Image } from 'antd';
-import LineCharts from '../../SecurityState/SecurityCqi/LineCharts';
import Casecirculation from './Casecirculation';
import DetMap from './DetMap';
import styles from './index.less';
@@ -39,29 +38,29 @@ const BaseInfo: React.FC<{
};
return (
-
-
{data?.report_object}
-
- {[data?.photosZWW]?.map((item) => {
- return (
-
-
-
- );
- })}
-
-
-
+ {/*
*/}
+
+
{data?.report_object}
+
+ {[data?.photosZWW]?.map((item) => {
+ return (
+
+
+
+ );
+ })}
+
= (
{item.caseStatusText}
-
- {item.collectionModeName || item.eventTypeName}
-
+ {(item.collectionModeName || item.eventTypeName) && (
+
+ {item.collectionModeName || item.eventTypeName}
+
+ )}
上报时间:
diff --git a/src/pages/SecurityServiceOverview/components/MapCantainer/index.less b/src/pages/SecurityServiceOverview/components/MapCantainer/index.less
index 5ec0350a..ba1c2633 100644
--- a/src/pages/SecurityServiceOverview/components/MapCantainer/index.less
+++ b/src/pages/SecurityServiceOverview/components/MapCantainer/index.less
@@ -13,9 +13,10 @@
}
.botTabWarp {
- width: 100%;
+
position: absolute;
bottom: 20px;
+ left: 29%;
display: flex;
justify-content: center;
z-index: 997;
diff --git a/src/pages/SecurityServiceOverview/components/RiskWarn/index.tsx b/src/pages/SecurityServiceOverview/components/RiskWarn/index.tsx
index 727e1e58..1be19601 100644
--- a/src/pages/SecurityServiceOverview/components/RiskWarn/index.tsx
+++ b/src/pages/SecurityServiceOverview/components/RiskWarn/index.tsx
@@ -1,6 +1,7 @@
import Modal from '@/components/HncyModal';
import services from '@/services';
+import { useModel } from '@umijs/max';
import { useRequest } from 'ahooks';
import { Flex } from 'antd';
import { useRef, useState } from 'react';
@@ -22,10 +23,10 @@ const RiskWarn = ({ riskModalOpt }: { riskModalOpt: any }) => {
eventId: '',
});
const params = {
- page: 1,
- count: 10,
-
+ pageNo: 1,
+ pageSize: 10,
};
+ const { selectAreaId } = useModel('safetyAreaId');
const [listData, setListData] = useState
({
items: [],
loading: true,
@@ -34,25 +35,60 @@ const RiskWarn = ({ riskModalOpt }: { riskModalOpt: any }) => {
hasNext: false,
});
const [fetchParams, setFetchParams] = useState(params);
- const { data: eventData } = useRequest(
- () => services.CityRiskApi.getEventPage(fetchParams),
+ // const { data: eventData } = useRequest(
+ // () => services.CityRiskApi.getEventPage(fetchParams),
+ // {
+ // refreshDeps: [fetchParams],
+ // onSuccess: (res) => {
+ // console.log(res);
+
+ // setListData({
+ // ...res?.data,
+ // items: [
+ // ...listData.items,
+ // ...res?.data?.items?.map((item: any) => ({
+ // ...item,
+ // standardEventTitle: item?.eventType,
+ // caseStatusText: item?.currentStatus,
+ // reportTime: item?.warningTime,
+ // collectionModeName: item?.sourceType,
+ // })),
+ // ],
+ // });
+ // },
+ // },
+ // );
+ const { data } = useRequest(
+ () =>
+ services.DataBase.getSjdzInfoData({
+ typeCode: 'zzcc-aq-yjxx',
+ data: {
+ regionCode: selectAreaId,
+
+ ...fetchParams,
+ },
+ }),
{
- refreshDeps: [fetchParams],
+ refreshDeps: [selectAreaId, fetchParams],
onSuccess: (res) => {
- console.log(res);
-
+ console.log(res?.data?.data);
+ const data = res?.data?.data;
+ const list = [
+ ...listData?.items,
+ ...data?.records?.map((item: any) => ({
+ ...item,
+ standardEventTitle: item?.riskdescription,
+ caseStatusText: item?.status,
+ reportTime: item?.risktime,
+ collectionModeName: item?.sourceType,
+ position:item?.region_name+item?.name
+ })),
+ ];
+
+
setListData({
- ...res?.data,
- items: [
- ...listData.items,
- ...res?.data?.items?.map((item: any) => ({
- ...item,
- standardEventTitle: item?.eventType,
- caseStatusText: item?.currentStatus,
- reportTime: item?.warningTime,
- collectionModeName: item?.sourceType,
- })),
- ],
+ hasNext: list?.length < data?.page?.total,
+ items: list,
});
},
},
diff --git a/src/utils/ui.ts b/src/utils/ui.ts
index fe3afaae..85caf120 100644
--- a/src/utils/ui.ts
+++ b/src/utils/ui.ts
@@ -95,8 +95,7 @@ export const getCqiLineChartStyles = (data: string | number) => {
};
}
return style;
-}
-
+};
const document: any = window.document;
// 展开/全屏
@@ -130,3 +129,13 @@ export function isFullscreenElement() {
document.mozFullScreenElement;
return !!isFull;
}
+export const getWarnTotal = (data: any) => {
+ if (!data) return;
+ const ycz = data?.find((item) => item?.status === '已解除')?.num;
+ const czz = data?.find((item) => item?.status === '未处理')?.num;
+ return {
+ ycz,
+ czz,
+ total: ycz + czz,
+ };
+};
--
GitLab