diff --git a/src/pages/SecurityServiceOverview/SecurityState/IndustryWarn/DisposeFlow/index.tsx b/src/pages/SecurityServiceOverview/SecurityState/IndustryWarn/DisposeFlow/index.tsx index d33f1f58632bb84a747fdb0c98b6f2a1ed174465..c6a509c987746b5cdec9c4d7c8c5f8b92a49105b 100644 --- a/src/pages/SecurityServiceOverview/SecurityState/IndustryWarn/DisposeFlow/index.tsx +++ b/src/pages/SecurityServiceOverview/SecurityState/IndustryWarn/DisposeFlow/index.tsx @@ -1,20 +1,34 @@ +import services from '@/services'; +import { getWarnTotal } from '@/utils/ui'; +import { useModel } from '@umijs/max'; import { useRequest } from 'ahooks'; import styles from './index.less'; -import services from '@/services'; const DisposeFlow = ({ countWidth, - typeCode, + industryCode, }: { countWidth?: number; - typeCode: string; + + industryCode?: string; }) => { - const { data } = useRequest(() => { - return services.CityRiskApi.getstatisticalEvent({ - parentTypeCode:typeCode, - }); - }); - console.log(data); - + const { selectAreaId } = useModel('safetyAreaId'); + + const { data } = useRequest( + () => + services.DataBase.getSjdzInfoData({ + typeCode: 'zzcc-aq-yjtj', + data: { + regionCode: selectAreaId, + industryCode: industryCode, + }, + }), + { + refreshDeps: [selectAreaId], + ready: !!industryCode, + }, + ); + // console.log(data?.data?.data?.records?.[0]?.yjqktj); + return (
@@ -25,7 +39,7 @@ const DisposeFlow = ({ />
预警
- {data?.data?.monthEventTotal??'--'} + {getWarnTotal(data?.data?.data?.records?.[0]?.yjqktj)?.total ?? '--'}
@@ -42,8 +56,7 @@ const DisposeFlow = ({ />
处置
- - {data?.data?.zgzEventTotal??'--'} + {getWarnTotal(data?.data?.data?.records?.[0]?.yjqktj)?.czz ?? '--'}
办结
- {data?.data?.yxcEventTotal??'--'} + {getWarnTotal(data?.data?.data?.records?.[0]?.yjqktj)?.ycz ?? '--'}
diff --git a/src/pages/SecurityServiceOverview/SecurityState/IndustryWarn/index.tsx b/src/pages/SecurityServiceOverview/SecurityState/IndustryWarn/index.tsx index 7942ff3e05c4c15c4a4bd3e52b6ec77c7d0c1edb..fd87eaec4a649a81a47bbe155a752271508127e4 100644 --- a/src/pages/SecurityServiceOverview/SecurityState/IndustryWarn/index.tsx +++ b/src/pages/SecurityServiceOverview/SecurityState/IndustryWarn/index.tsx @@ -13,21 +13,19 @@ const IndustryWarn = ({ warnLevel: number; setWarnLevel: (val: number) => void; }) => { - //道路桥梁 - const { data: dq } = useRequest(services.DataBase.getSjdzInfoData, { - defaultParams: [ - { - typeCode: 'zzcc-aq-qldlsl', - - }, - ], - }); + //道路桥梁 + const { data: dq } = useRequest(services.DataBase.getSjdzInfoData, { + defaultParams: [ + { + typeCode: 'zzcc-aq-qldlsl', + }, + ], + }); //环卫 const { data: hwgf } = useRequest(services.DataBase.getSjdzInfoData, { defaultParams: [ { typeCode: 'zzcc-aq-hwgcsl', - }, ], }); @@ -36,7 +34,6 @@ const IndustryWarn = ({ defaultParams: [ { typeCode: 'zzcc-aq-tmcfssl', - }, ], }); @@ -53,23 +50,23 @@ const IndustryWarn = ({ typeCode: 'zzcc-aq-dllxfz', typeName: '道路', parentCode: 'dlql', - typeField:'lb', + typeField: 'lb', total: dq?.data?.records?.[0]?.dl ?? '--', listTypeCode: 'zzcc-aq-dlmx', - columnsFields:{ - name:'roadname', - type:'jishuguanlifenlei', - descgldw:'guanlidanwei', - address:'region_name', - status:'objstate' - } + columnsFields: { + name: 'roadname', + type: 'jishuguanlifenlei', + descgldw: 'guanlidanwei', + address: 'region_name', + status: 'objstate', + }, }, { listTypeCode: 'zzcc-aq-qlmxlb', typeName: '桥梁', - typeField:'lx', + typeField: 'lx', parentCode: 'dlql', - typeCode:'zzcc-aq-qllxfz', + typeCode: 'zzcc-aq-qllxfz', total: dq?.data?.records?.[0]?.ql ?? '--', }, ], @@ -86,26 +83,26 @@ const IndustryWarn = ({ children: [ { typeCode: 'dl', - listTypeCode:"zzcc-aq-ljzymx", + listTypeCode: 'zzcc-aq-ljzymx', typeName: '垃圾转运站', parentCode: 'dlql', total: hwgf?.data?.records?.[0]?.zyz ?? '--', - columnsFields:{ - name:'objcode', - type:'industry_name', - descgldw:'deptname1', - address:'region_name', - status:'objstate' - } + columnsFields: { + name: 'objcode', + type: 'industry_name', + descgldw: 'deptname1', + address: 'region_name', + status: 'objstate', + }, }, { typeCode: 'dl', - listTypeCode:'zzcc-aq-hwgcmx', + listTypeCode: 'zzcc-aq-hwgcmx', typeName: '环卫公厕', parentCode: 'dlql', - columnsFields:{ - address:'address', - descgldw:'yydw_name' + columnsFields: { + address: 'address', + descgldw: 'yydw_name', }, total: hwgf?.data?.records?.[0]?.hwgc ?? '--', }, @@ -132,20 +129,20 @@ const IndustryWarn = ({ typeCode: 'dl', typeName: '填埋场', parentCode: 'dlql', - total:gfcz?.data?.records?.[0]?.tmc?? '--', + total: gfcz?.data?.records?.[0]?.tmc ?? '--', }, { typeCode: 'dl', typeName: '焚烧发电厂', parentCode: 'dlql', - total:gfcz?.data?.records?.[0]?.fsfdc?? '--', + total: gfcz?.data?.records?.[0]?.fsfdc ?? '--', }, { listTypeCode: 'zzcc-aq-cccmx', typeCode: 'dl', typeName: '餐厨厂', parentCode: 'dlql', - total:gfcz?.data?.records?.[0]?.canchu?? '--', + total: gfcz?.data?.records?.[0]?.canchu ?? '--', }, ], }; @@ -165,7 +162,7 @@ const IndustryWarn = ({ extra={} >
-
+
{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 0a630a828ea537de86ace8e763ebbe2565dec762..cfca0c040fea6f03115043c5eecfe142fc276252 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 19bfb90cc5f3814701d8e077384a561a9cc2594f..326a9efb284a27d7faa493318cd312cc58145487 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 1b90f72aa5ed5df10987d65fdc028a77e72fdc19..1a19d3e8f679e17c10fcbb23cb9add0e608ebb5d 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 6a6e42995138af4bd22d318424cb85389bf34194..2ad80459f55155e3795b229b45394979cc7af89b 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 21956d5b04d399e1a5607b550273cfa7f68790a0..189b7ad97f4d7f27b6700a657d04e5806fb0d681 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 5ec0350a1a45a73b4c8a519018d63fd2a3648c68..ba1c26331170ab9b119ea3b6f897d9ecd3f8387d 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 727e1e58da901a782144d015be70688299b46514..1be196010f95c9049fd6afa4ce5ea52e904df8e3 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 fe3afaae17d0677a9e4396af2fa5e46161e01f22..85caf1206f7a10c6a66238bba536bbb450a4c7d5 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, + }; +};