diff --git a/src/pages/SecurityServiceOverview/SecurityState/FacilityWarn/index.tsx b/src/pages/SecurityServiceOverview/SecurityState/FacilityWarn/index.tsx index 6aaa2b9b5dce3975800e0736ee6f88e1380f9d38..24088b960ba4773c04a461ef53ab213f954f02fd 100644 --- a/src/pages/SecurityServiceOverview/SecurityState/FacilityWarn/index.tsx +++ b/src/pages/SecurityServiceOverview/SecurityState/FacilityWarn/index.tsx @@ -8,11 +8,9 @@ import StatusWiget from '../IndustryWarn/StatusWiget'; import styles from './index.less'; const FacilityWarn = ({ - warnLevel, setWarnLevel, }: { - warnLevel: number; setWarnLevel: (val: number) => void; }) => { @@ -53,12 +51,11 @@ const FacilityWarn = ({ //照明 const zm = useMemo(() => { - return { typeCode: 'zm', typeName: '照明', parentCode: null, - + children: [ { typeCode: 'dl', @@ -74,7 +71,7 @@ const FacilityWarn = ({ }, ], }; - }, [ zmm]); + }, [zmm]); //户外广告牌 const ggzp = useMemo(() => { // return data?.find((item: any) => item?.typeCode === 'ggzp'); @@ -90,6 +87,10 @@ const FacilityWarn = ({ typeName: '户外广告', parentCode: 'dlql', total: gg?.data?.data?.records?.[0]?.ggzpss ?? '--', + columnsFields: { + name: 'objcode', + descgldw:'deptname1' + }, }, { typeCode: 'dl', @@ -99,7 +100,7 @@ const FacilityWarn = ({ }, ], }; - }, [ gg]); + }, [gg]); //管廊 const gl = useMemo(() => { // return data?.find((item: any) => item?.typeCode === 'gl'); @@ -202,7 +203,7 @@ const FacilityWarn = ({ data={{ ...item, icon: require('@/assets/images/SecurityServiceOverview/ggp.png'), - + parentData: ggzp, }} style={{ width: 210 }} diff --git a/src/pages/SecurityServiceOverview/SecurityState/IndustryWarn/index.tsx b/src/pages/SecurityServiceOverview/SecurityState/IndustryWarn/index.tsx index 1477f3062c40ba513ad09f466a7da9628b9ba270..7942ff3e05c4c15c4a4bd3e52b6ec77c7d0c1edb 100644 --- a/src/pages/SecurityServiceOverview/SecurityState/IndustryWarn/index.tsx +++ b/src/pages/SecurityServiceOverview/SecurityState/IndustryWarn/index.tsx @@ -55,7 +55,14 @@ const IndustryWarn = ({ parentCode: 'dlql', typeField:'lb', total: dq?.data?.records?.[0]?.dl ?? '--', - listTypeCode: 'zzcc-aq-qlmxlb', + listTypeCode: 'zzcc-aq-dlmx', + columnsFields:{ + name:'roadname', + type:'jishuguanlifenlei', + descgldw:'guanlidanwei', + address:'region_name', + status:'objstate' + } }, { listTypeCode: 'zzcc-aq-qlmxlb', @@ -79,14 +86,27 @@ const IndustryWarn = ({ children: [ { typeCode: 'dl', + 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' + } }, { typeCode: 'dl', + listTypeCode:'zzcc-aq-hwgcmx', typeName: '环卫公厕', parentCode: 'dlql', + columnsFields:{ + address:'address', + descgldw:'yydw_name' + }, total: hwgf?.data?.records?.[0]?.hwgc ?? '--', }, { @@ -121,6 +141,7 @@ const IndustryWarn = ({ total:gfcz?.data?.records?.[0]?.fsfdc?? '--', }, { + listTypeCode: 'zzcc-aq-cccmx', typeCode: 'dl', typeName: '餐厨厂', parentCode: 'dlql', diff --git a/src/pages/SecurityServiceOverview/SecurityState/SecurityCqi/index.tsx b/src/pages/SecurityServiceOverview/SecurityState/SecurityCqi/index.tsx index 111306219cde9055f3b965905189669161af7146..19bfb90cc5f3814701d8e077384a561a9cc2594f 100644 --- a/src/pages/SecurityServiceOverview/SecurityState/SecurityCqi/index.tsx +++ b/src/pages/SecurityServiceOverview/SecurityState/SecurityCqi/index.tsx @@ -46,6 +46,7 @@ const StatusMap = { const SecurityCqi = ({ warnLevel }: { warnLevel: number }) => { const { initialState } = useModel('@@initialState'); const { areaId } = initialState; + const { selectAreaId } = useModel('safetyAreaId'); const [modalOpt, setModalOpt] = useState<{ open: boolean; title: string; @@ -56,6 +57,20 @@ const SecurityCqi = ({ warnLevel }: { warnLevel: number }) => { const { data: statisticalEvent } = useRequest( services.CityRiskApi.getstatisticalEvent, ); + const { data } = useRequest( + () => + services.DataBase.getSjdzInfoData({ + typeCode: 'zzcc-aq-yjtj', + data: { + regionCode: selectAreaId, + industryCode: '0401', + }, + }), + { + refreshDeps: [selectAreaId], + }, + ); + console.log(data); const { data: signData } = useRequest(() => { return services.Physicalsign.getComparisonIndexInstance({ @@ -65,6 +80,7 @@ const SecurityCqi = ({ warnLevel }: { warnLevel: number }) => { objectId: areaId, }); }); + const getState = (num: number) => { switch (num) { case 1: @@ -79,6 +95,7 @@ const SecurityCqi = ({ warnLevel }: { warnLevel: number }) => { return '正常'; } }; + return (
{
- + {warnLevel != 0 && ( + + )}
{ { - const [warnLevel, setWarnLevel] = useState(2); + const [warnLevel, setWarnLevel] = useState(1); return ( diff --git a/src/pages/SecurityServiceOverview/components/IndustrySign/index.tsx b/src/pages/SecurityServiceOverview/components/IndustrySign/index.tsx index f11012f501cf1cf1a399cfd9a2b220a49843e62f..5755088c749689257a4d3c14ae60d8f403751fa0 100644 --- a/src/pages/SecurityServiceOverview/components/IndustrySign/index.tsx +++ b/src/pages/SecurityServiceOverview/components/IndustrySign/index.tsx @@ -7,7 +7,7 @@ import { SearchOutlined } from '@ant-design/icons'; import { useModel } from '@umijs/max'; import { useDebounceFn, useRequest, useUpdateEffect } from 'ahooks'; import { Flex, Input } from 'antd'; -import { useState } from 'react'; +import { useMemo, useState } from 'react'; import { colorConfig } from '../../SecurityState/RightLayout/RiskNotice'; import BaseInfo from '../BaseInfo'; import styles from './index.less'; @@ -124,80 +124,82 @@ const IndustrySign = ({ param }: { param: any }) => { ); }; +// console.log(param); - const columns = [ - { - title: '序号', - dataIndex: 'name', - key: 'name', - width: 80, - ellipsis: true, - render: (text, record, index) => { - // 当前页码减1,乘以每页数量,再加上当前行的索引加1 - console.log(fetchParams?.data?.pageSize); - console.log(fetchParams?.data?.pageNo - 1); - - return `${ - (fetchParams?.data?.pageNo - 1) * fetchParams?.data?.pageSize + (index + 1) - }`; + const columns =useMemo(()=>{ + return [ + { + title: '序号', + dataIndex: 'name', + key: 'name', + width: 80, + ellipsis: true, + render: (text, record, index) => { + // 当前页码减1,乘以每页数量,再加上当前行的索引加1 + + + return `${ + (fetchParams?.data?.pageNo - 1) * fetchParams?.data?.pageSize + (index + 1) + }`; + }, }, - }, - { - width: 180, - ellipsis: true, - title: `${param?.title}名称`, - dataIndex: 'name', - key: 'name', - }, - { - width: 150, - ellipsis: true, - title: `${param?.title}类型`, - dataIndex: 'dictjglx_name', - key: 'dictjglx_name', - }, - { - title: '状态', - dataIndex: 'id', - key: 'id', - width: 80, - render: (val: string) => { - // return ( - // - // {val} - // - // ); + { + width: 180, + ellipsis: true, + title: `${param?.title}名称`, + dataIndex: param?.columnsFields?.name||'name', + key: 'name', }, - }, - { - title: '管理单位', - dataIndex: 'descgldw', - key: 'descgldw', - width: 200, - ellipsis: true, - }, - { - title: '位置', - dataIndex: 'dictdldj_name', - key: 'dictdldj_name', - width: 300, - ellipsis: true, - render: (val: string, record: any) => { - return ( -
-
{val}
- {val && ( - - )} -
- ); + { + width: 150, + ellipsis: true, + title: `${param?.title}类型`, + dataIndex:param?.columnsFields?.type|| 'dictjglx_name', + key: 'dictjglx_name', }, - }, - ]; + { + title: '状态', + dataIndex: param?.columnsFields?.status||'status', + key: 'id', + width: 80, + render: (val: string) => { + return ( + + {val} + + ); + }, + }, + { + title: '管理单位', + dataIndex:param?.columnsFields?.descgldw|| 'descgldw', + key: 'descgldw', + width: 200, + ellipsis: true, + }, + { + title: '位置', + dataIndex:param?.columnsFields?.address|| 'dictdldj_name', + key: 'dictdldj_name', + width: 300, + ellipsis: true, + render: (val: string, record: any) => { + return ( +
+
{val}
+ {val && ( + + )} +
+ ); + }, + }, + ]; + },[param]) const { run: InputChange } = useDebounceFn( (e) => { console.log(e.target.value); diff --git a/src/pages/SecurityServiceOverview/components/MapCantainer/EmphasisAreaMap/PopoverCardArea/index.tsx b/src/pages/SecurityServiceOverview/components/MapCantainer/EmphasisAreaMap/PopoverCardArea/index.tsx index 7240d4c06d608a9fb52a17c954dda2c8fa9eb9f2..69b696e4d3f2b36ed34fc0257e695c904a2435f9 100644 --- a/src/pages/SecurityServiceOverview/components/MapCantainer/EmphasisAreaMap/PopoverCardArea/index.tsx +++ b/src/pages/SecurityServiceOverview/components/MapCantainer/EmphasisAreaMap/PopoverCardArea/index.tsx @@ -148,7 +148,7 @@ const PopoverCardArea: React.FC = (props) => {
城市问题
78
- % +
diff --git a/src/pages/SecurityServiceOverview/components/MapCantainer/EmphasisAreaMap/index.tsx b/src/pages/SecurityServiceOverview/components/MapCantainer/EmphasisAreaMap/index.tsx index 3ae39bb02b5bcb3c59c25e74276d06818cedddf6..14822c75cb42b1e8e55c1ddef7610665e1701f4a 100644 --- a/src/pages/SecurityServiceOverview/components/MapCantainer/EmphasisAreaMap/index.tsx +++ b/src/pages/SecurityServiceOverview/components/MapCantainer/EmphasisAreaMap/index.tsx @@ -8,6 +8,7 @@ import risk1 from '@/assets/images/SecurityServiceOverview/risk/red.png'; import risk3 from '@/assets/images/SecurityServiceOverview/risk/yellow.png'; import CooglMap from '@/components/CooglMap'; import Modal from '@/components/HncyModal'; +import EventDetail from '@/pages/Common/Event/EventDetail'; import { useGlobalModalServices } from '@/pages/GlobalModalServices/provider'; import services from '@/services'; import { getColorByIndex, getCqiStatusStyle } from '@/utils/ui'; @@ -21,7 +22,6 @@ import PopoverCardKnotty from '../DistrictMap/PopoverCardKnotty'; import PopoverCardWarn from '../DistrictMap/PopoverCardWarn'; import styles from './index.less'; import PopoverCardArea from './PopoverCardArea'; -import EventDetail from '@/pages/Common/Event/EventDetail'; const EmphasisAreaMap: React.FC = () => { const colorConfig: Record< string, @@ -56,8 +56,8 @@ const EmphasisAreaMap: React.FC = () => { icon: 'blueIcon', }, }; - // 事件详情弹窗 - const [modalOpt, setModalOpt] = useState({ + // 事件详情弹窗 + const [modalOpt, setModalOpt] = useState({ open: false, title: '', eventId: '', @@ -129,7 +129,6 @@ const EmphasisAreaMap: React.FC = () => { }, ); - /** @description 移动视角到能显示全部覆盖物 */ useEffect(() => { setViewport(); @@ -201,7 +200,6 @@ const EmphasisAreaMap: React.FC = () => { const res = await services.Physicalsign.getObjectPolygon(params); if (res.code === 200) { if (res.data?.length) { - setAllAreaMapData(res.data); } } @@ -259,7 +257,13 @@ const EmphasisAreaMap: React.FC = () => { await services.Physicalsign.getComparisonIndexInstance( params, ); - + console.log(item); + + // const res1 = + // await services.Physicalsign.getTotalCountForKeyAreas({ + // keyAreaId: item?.objectId, + // eventStatus: '处置中', + // }); setAreaSelectd({ ...res?.data, @@ -379,7 +383,6 @@ const EmphasisAreaMap: React.FC = () => { top: -50, }} onDetail={(e) => { - // e?.stopPropagation(); // e?.nativeEvent?.stopImmediatePropagation(); setDetailModalOpt({ @@ -542,7 +545,6 @@ const EmphasisAreaMap: React.FC = () => { { setCheckedKeys(e); }} @@ -649,8 +651,8 @@ const EmphasisAreaMap: React.FC = () => { /> )} - {/**事件详情 */} - setModalOpt({ open: false, title: '', eventId: '' })} diff --git a/src/services/Physicalsign.ts b/src/services/Physicalsign.ts index 0abd925b6bbb89a427a71809795c5afa599a6d19..eb703f3edba627f5024a7cae6584a8879abdfe92 100644 --- a/src/services/Physicalsign.ts +++ b/src/services/Physicalsign.ts @@ -390,4 +390,14 @@ export async function getHighIncidenceSourceCountForKeyAreas( method: 'GET', params, }); +} + + +export async function getTotalCountForKeyAreas( + params: any, +): Promise { + return request(urlProxyApis(`/normalEvent/getTotalCountForKeyAreas`), { + method: 'GET', + params, + }); } \ No newline at end of file