diff --git a/src/pages/GlobalModalServices/modals/AdministPunish/NumTop5/index.tsx b/src/pages/GlobalModalServices/modals/AdministPunish/NumTop5/index.tsx index 7f2cd5d396ee140240e1fa44d6ec0ce7b1d9c016..80cbcb21132d3405518abe4cdb5c74bedf918d45 100644 --- a/src/pages/GlobalModalServices/modals/AdministPunish/NumTop5/index.tsx +++ b/src/pages/GlobalModalServices/modals/AdministPunish/NumTop5/index.tsx @@ -1,13 +1,13 @@ import EmptyWithConditions from '@/components/EmptyWithConditions'; import Tabs from '@/components/Tabs'; import BaseCard from '@/pages/GlobalModalServices/components/BaseCard'; +import Loading from '@/pages/GlobalModalServices/components/Loading'; import { ChildrenModalMethods } from '@/pages/GlobalModalServices/type'; import services from '@/services'; import { useRequest } from 'ahooks'; import { Flex, Progress, Space } from 'antd'; import React, { memo, useMemo, useState } from 'react'; import styles from './index.less'; -import Loading from '@/pages/GlobalModalServices/components/Loading'; /**中心城区 */ export const zxcq = [ '新都区', @@ -41,13 +41,13 @@ export const jqxc = [ const Top5: React.FC<{ modalDispatch: ChildrenModalMethods; searchTime: any; - total:number + total: number; }> = memo((props) => { - const { modalDispatch, searchTime ,total} = props; + const { modalDispatch, searchTime, total } = props; const [areaKey, setAreaKey] = useState('all'); //办案数量top5 - const { data: qysl,loading} = useRequest( + const { data: qysl, loading } = useRequest( () => services.DataBase.getSjdzInfoData({ typeCode: 'zzcc-xzcf-qysl', @@ -83,13 +83,9 @@ const Top5: React.FC<{ return list?.map((item: any) => ({ name: item?.gridName, num: item?.num, - percent:total? ( - (item?.num / - total) * - 100 - ).toFixed(2):0, + percent: total ? ((item?.num / total) * 100).toFixed(2) : 0, })); - }, [qysl, areaKey,total]); + }, [qysl, areaKey, total]); return ( @@ -131,52 +127,51 @@ const Top5: React.FC<{ />
- - {baList?.map((item: any, index: number) => { - return ( -
{ - modalDispatch.push('AdministPunishList', { - title: `${item?.name}行政处罚列表`, + + {baList?.map((item: any, index: number) => { + return ( +
{ + modalDispatch.push('AdministPunishList', { + title: `${item?.name}行政处罚列表`, - props: { - searchTime, - ssqy: item?.name, - }, - }); - }} - > - -
{item.name}
- -
- {item.num} - -
-
- {item.percent} - % -
-
-
- -
- ); - })} -
+ > + +
{item.name}
+ +
+ {item.num} + +
+
+ {item.percent} + % +
+
+
+ +
+ ); + })} +
-
); diff --git a/src/pages/GlobalModalServices/modals/AdministPunishList/index.tsx b/src/pages/GlobalModalServices/modals/AdministPunishList/index.tsx index bbef595bda52330dc7e2eb532a8232baf288e2cf..1e1a3ef153844fdaefed7f29dd48ea8bf6b34c12 100644 --- a/src/pages/GlobalModalServices/modals/AdministPunishList/index.tsx +++ b/src/pages/GlobalModalServices/modals/AdministPunishList/index.tsx @@ -3,24 +3,24 @@ import { useGlobalModalServices } from '@/pages/GlobalModalServices/provider'; import services from '@/services'; import { useRequest } from 'ahooks'; import { useMemo, useState } from 'react'; +import Loading from '../../components/Loading'; const AdministPunishList = (props: any) => { const [fetchParams, setFetchParams] = useState({ pageNo: 0, pageSize: 10, - }); const { dispatch } = useGlobalModalServices(); - const { data,loading } = useRequest( + const { data, loading } = useRequest( () => services.DataBase.getSjdzInfoData({ typeCode: 'zzcc-xzcf-xzcffylb', params: { ...fetchParams, ...props?.searchTime, - wfxw:props.wfxw, - ssqy:props.ssqy + wfxw: props.wfxw, + ssqy: props.ssqy, }, }), { @@ -99,28 +99,29 @@ const AdministPunishList = (props: any) => { }, [data]); return (
- { - setFetchParams({ - ...fetchParams, + + { + setFetchParams({ + ...fetchParams, - pageNo: page - 1, - pageSize: pageSize, - }); - }, - // hideOnSinglePage: true, - }} - /> + pageNo: page - 1, + pageSize: pageSize, + }); + }, + // hideOnSinglePage: true, + }} + /> +
); }; diff --git a/src/pages/GlobalModalServices/modals/AreaSynergy/AreaSynergyList/index.tsx b/src/pages/GlobalModalServices/modals/AreaSynergy/AreaSynergyList/index.tsx index 5bd57def205fc9fe8ddba42006a66edea5bdb556..576ec5e6a7bde7f0c68cedb2eb6a36673db7d762 100644 --- a/src/pages/GlobalModalServices/modals/AreaSynergy/AreaSynergyList/index.tsx +++ b/src/pages/GlobalModalServices/modals/AreaSynergy/AreaSynergyList/index.tsx @@ -13,7 +13,7 @@ const AreaSynergyList = (props:any) => { }); - const { data } = useRequest( + const { data ,loading} = useRequest( () => services.DataBase.getSjdzInfoData({ typeCode: 'zzcc-sqxt-fylb', @@ -29,7 +29,7 @@ const AreaSynergyList = (props:any) => { refreshDeps: [fetchParams], }, ); - console.log(data); + const { dispatch } = useGlobalModalServices(); const columns = useMemo(() => { @@ -110,7 +110,7 @@ const AreaSynergyList = (props:any) => { return (
{ @@ -23,7 +25,7 @@ const AreaSynergy = (props: any) => { }); //处罚趋势 - const { data: cfqsMonth } = useRequest( + const { data: cfqsMonth, loading: trendLoading } = useRequest( () => services.DataBase.getSjdzInfoData({ typeCode: 'zzcc-sqxt-sjtj', @@ -60,6 +62,12 @@ const AreaSynergy = (props: any) => { params: { ...searchTime, }, + }).then((res) => { + console.log(res); + + if (res.code === 200) { + return res.data.data.records; + } }), { refreshDeps: [searchTime], @@ -67,6 +75,8 @@ const AreaSynergy = (props: any) => { ); const items = useMemo(() => { + console.log(asjsltj); + return [ { key: '2', @@ -77,45 +87,39 @@ const AreaSynergy = (props: any) => { { key: '1', name: '超时', - count: asjsltj?.data?.data?.records?.find( - (item: any) => item.title === '超时', - )?.num, + count: asjsltj?.find((item: any) => item.title === '超时')?.num, unit: '件', isOverdue: '超时', }, { key: '3', name: '已办结', - count: asjsltj?.data?.data?.records?.find( - (item: any) => item.title === '总数', - )?.num, + count: asjsltj?.find((item: any) => item.title === '总数')?.num, unit: '件', }, { key: '3', name: '超期率', isOverdue: '超时', - count: ( - (asjsltj?.data?.data?.records?.find( - (item: any) => item.title === '超时', - )?.num / - asjsltj?.data?.data?.records?.find( - (item: any) => item.title === '总数', - )?.num) * - 100 - ).toFixed(2), + count: asjsltj + ? ( + (asjsltj?.find((item: any) => item.title === '超时')?.num / + asjsltj?.find((item: any) => item.title === '总数')?.num) * + 100 + ).toFixed(2) + : 0, unit: '%', }, ]; }, [asjsltj]); const total = useMemo(() => { - return asjsltj?.data?.data?.records?.find( + return asjsltj?.find( (item: any) => item.title === '总数', )?.num; }, [asjsltj]); //高发类别top5 - const { data: aflb } = useRequest( + const { data: aflb, loading: higtLoading } = useRequest( () => services.DataBase.getSjdzInfoData({ typeCode: 'zzcc-sqxt-awtmsfl', @@ -132,11 +136,11 @@ const AreaSynergy = (props: any) => { return list?.map((item) => ({ ...item, - percent: total?((item?.num / total) * 100).toFixed(2):0, + percent: total ? ((item?.num / total) * 100).toFixed(2) : 0, })); }, [aflb, total]); //处置区域top5 - const { data: qysl } = useRequest( + const { data: qysl, loading: areaLoading } = useRequest( () => services.DataBase.getSjdzInfoData({ typeCode: 'zzcc-sqxt-aqyfl', @@ -224,70 +228,77 @@ const AreaSynergy = (props: any) => {
- {cfqsMonth?.data?.data?.records?.length ? ( - ({ - name: item?.title, - value: item?.num, - }))} - style={{ width: 525, height: 80, marginTop: 16 }} - /> - ) : ( - - )} + + <> + {cfqsMonth?.data?.data?.records?.length ? ( + ({ + name: item?.title, + value: item?.num, + }))} + style={{ width: 525, height: 80, marginTop: 16 }} + /> + ) : ( + + )} + +
高发类型TOP5
+ + <> + {gflbList?.length ? ( +
+ {gflbList?.map((item: any, index: number) => { + return ( +
{ + dispatch.push('AreaSynergyList', { + title: `${item.title}市区协调处置事件列表`, + props: { + searchTime, + eventType: item?.title, + }, + }); + }} + > + +
{item?.title}
+ +
+ {item?.num} + +
+
+ {Number(item?.percent ?? 0)} + % +
+
+
- {gflbList?.length ? ( -
- {gflbList?.map((item, index) => { - return ( -
{ - dispatch.push('AreaSynergyList', { - title: `${item.title}市区协调处置事件列表`, - props: { - searchTime, - eventType: item?.title, - }, - }); - }} - > - -
{item?.title}
- -
- {item?.num} - -
-
- {Number(item?.percent ?? 0)} - % -
-
-
- - -
- ); - })} -
- ) : ( - - )} + +
+ ); + })} +
+ ) : ( + + )} + +
@@ -357,53 +368,56 @@ const AreaSynergy = (props: any) => { ]} />
+ + <> + {baList?.length ? ( +
+ {baList?.map((item, index) => { + return ( +
{ + dispatch.push('AreaSynergyList', { + title: `${item.title}市区协调处置事件列表`, + props: { + searchTime, + areaName: item.title, + }, + }); + }} + > + +
{item?.title}
+ +
+ {item?.num} + +
+
+ {Number(item?.percent ?? 0)} + % +
+
+
- {baList?.length ? ( -
- {baList?.map((item, index) => { - return ( -
{ - dispatch.push('AreaSynergyList', { - title: `${item.title}市区协调处置事件列表`, - props: { - searchTime, - areaName: item.title, - }, - }); - }} - > - -
{item?.title}
- -
- {item?.num} - -
-
- {Number(item?.percent ?? 0)} - % -
-
-
- - -
- ); - })} -
- ) : ( - - )} + +
+ ); + })} +
+ ) : ( + + )} + +
diff --git a/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DisposalSiteInfo/index.tsx b/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DisposalSiteInfo/index.tsx index b68c67ab15c8c8969b85751ab1be20fb2ac22218..c229167dc664fc9e97977d067c4d43ec09125661 100644 --- a/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DisposalSiteInfo/index.tsx +++ b/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DisposalSiteInfo/index.tsx @@ -1,4 +1,6 @@ -import React from 'react'; +import services from '@/services'; +import { useRequest } from 'ahooks'; +import React, { useMemo } from 'react'; import styles from './index.less'; interface InfoItemProps { @@ -6,13 +8,13 @@ interface InfoItemProps { label: string; unit: string; } -let isUsingValue = false; +let isUsingValue = true; const showValue = (value: number | string) => { - if(isUsingValue){ + if (isUsingValue) { return value; } return '--'; -} +}; const InfoItem: React.FC = ({ value, label, unit }) => (
@@ -32,28 +34,51 @@ interface DisposalSiteInfoProps { } const DisposalSiteInfo: React.FC = ({ searchTime }) => { - const infoData = [ - { - value: 482, - label: '固定式建筑垃圾消纳场数量', - unit: '个' - }, - { - value: 482, - label: '临时性建筑垃圾转动调配场数量', - unit: '个' - }, + const { data } = useRequest( + () => + services.DataBase.getSjdzInfoData({ + typeCode: 'zzcc-jzlj-gdslsxkc', + params: { + ...searchTime, + }, + }).then((res) => { + if (res.code === 200) { + return res?.data?.data?.records; + } + throw new Error('获取数据失败'); + }), { - value: 482.21, - label: '总容量', - unit: '万方' + refreshDeps: [searchTime], }, - { - value: 482.54, - label: '剩余库容', - unit: '万方' - } - ]; + ); + + + const infoData = useMemo(() => { + const gds = data?.find((item) => item.lx === 'gds'); + const lsx = data?.find((item) => item.lx === 'lsx'); + return [ + { + value: gds?.total ?? '--', + label: '固定式建筑垃圾消纳场数量', + unit: '个', + }, + { + value: lsx?.total??'--', + label: '临时性建筑垃圾转动调配场数量', + unit: '个', + }, + { + value: (gds?.zrl ?? 0) + (lsx?.zrl ?? 0), + label: '总容量', + unit: '万方', + }, + { + value: (gds?.sykr ?? 0) + (lsx?.sykr ?? 0), + label: '剩余库容', + unit: '万方', + }, + ]; + }, [data]); return (
@@ -67,4 +92,4 @@ const DisposalSiteInfo: React.FC = ({ searchTime }) => { ); }; -export default DisposalSiteInfo; \ No newline at end of file +export default DisposalSiteInfo; diff --git a/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DistributionChart/index.less b/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DistributionChart/index.less index 253d97d63fa08b63f96249c5930a4f9551351b2e..9e22cb9b7ad45de6e81b7e2afc91358373d1e8ca 100644 --- a/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DistributionChart/index.less +++ b/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DistributionChart/index.less @@ -8,17 +8,23 @@ padding: 20px 24px 0; :global { + .ant-tabs-ink-bar { + display: none !important; + } + .ant-tabs-nav { margin: 0; + &::before { border-bottom: none; } + } .ant-tabs-tab { padding: 0; margin-right: 40px; - + .ant-tabs-tab-btn { color: #BCCEE9; font-size: 22px; @@ -50,4 +56,4 @@ font-size: 16px; } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DistributionChart/index.tsx b/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DistributionChart/index.tsx index 33376fcb6b2ce6c59389d261f3097868cf78634f..5a99d48b81e853a36663ac8f9c9a370401e008df 100644 --- a/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DistributionChart/index.tsx +++ b/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DistributionChart/index.tsx @@ -1,7 +1,9 @@ -import React, { useState, useEffect, useRef } from 'react'; +import services from '@/services'; +import { useRequest } from 'ahooks'; +import { Tabs } from 'antd'; import * as echarts from 'echarts'; +import React, { useEffect, useRef, useState } from 'react'; import styles from './index.less'; -import { Tabs } from 'antd'; interface DistributionChartProps { searchTime: { @@ -10,10 +12,11 @@ interface DistributionChartProps { }; } -const DistributionChart: React.FC = ({ searchTime }) => { +const DistributionChart: React.FC = ({ + searchTime, +}) => { const chartRef = useRef(null); const [activeTab, setActiveTab] = useState('1'); - const tabItems = [ { key: '1', @@ -26,19 +29,67 @@ const DistributionChart: React.FC = ({ searchTime }) => ]; let isUsingValue = false; + //排放量 + const { data: emitData } = useRequest( + () => + services.DataBase.getSjdzInfoData({ + typeCode: 'zzcc-jzlj-aqytjpfl', + params: { + ...searchTime, + }, + }).then((res) => { + if (res.code === 200) { + return res?.data?.data?.records?.[0]; + } + throw new Error('获取数据失败'); + }), + { + refreshDeps: [searchTime], + }, + ); + + //倾倒点 + const { data: dumpData } = useRequest( + () => + services.DataBase.getSjdzInfoData({ + typeCode: 'zzcc-jzlj-wgqddwh', + params: { + ...searchTime, + }, + }).then((res) => { + if (res.code === 200) { + console.log(res); + + return res?.data?.data?.records?.[0]?.list; + } + throw new Error('获取数据失败'); + }), + { + refreshDeps: [searchTime], + }, + ); useEffect(() => { if (!chartRef.current) return; - + const chart = echarts.init(chartRef.current); - - // 模拟数据 - const data = Array(22).fill(0).map(() => ({ - wasteAmount: isUsingValue?Math.floor(Math.random() * 200 + 100):0, - siteCount: isUsingValue?Math.floor(Math.random() * 20 + 10):0, - })); - const maxValue = 300; // 固定背景柱的长度 + let data = []; + + if (activeTab == '1' && emitData) { + data = emitData?.list?.map((item) => ({ + ...item, + name: item.areaName, + value: item?.num, + })); + } + if (activeTab == '2' && emitData) { + data = dumpData?.map((item) => ({ + ...item, + name: item.areaName, + value: item?.num, + })); + } const option = { tooltip: { @@ -47,21 +98,48 @@ const DistributionChart: React.FC = ({ searchTime }) => borderColor: '#13659680', borderWidth: 1, textStyle: { - color: '#BCCEE9' - } + color: '#BCCEE9', + }, }, grid: { left: '1%', right: '3%', bottom: '3%', top: '20%', - containLabel: true + containLabel: true, }, xAxis: { type: 'category', - data: ['锦江区', '青羊区', '金牛区', '武侯区', '成华区', '龙泉驿区', '青白江区', '新都区', '温江区', '双流区', '郫都区', '新津区', '简阳市', '都江堰市', '彭州市', '邛崃市', '崇州市', '金堂县', '大邑县', '蒲江县', '新津县'], + data: + activeTab == '1' + ? emitData?.list?.map((item) => item?.areaName) + : dumpData?.map((item) => item?.areaName), + + // data: [ + // '锦江区', + // '青羊区', + // '金牛区', + // '武侯区', + // '成华区', + // '龙泉驿区', + // '青白江区', + // '新都区', + // '温江区', + // '双流区', + // '郫都区', + // '新津区', + // '简阳市', + // '都江堰市', + // '彭州市', + // '邛崃市', + // '崇州市', + // '金堂县', + // '大邑县', + // '蒲江县', + // '新津县', + // ], axisLine: { - show: false + show: false, }, // axisLine: { // lineStyle: { @@ -72,31 +150,31 @@ const DistributionChart: React.FC = ({ searchTime }) => color: '#E4EDFF', fontSize: 20, interval: 0, - } + }, }, yAxis: { type: 'value', - max: maxValue, + // max: maxValue, nameTextStyle: { color: '#BCCEE9', fontSize: 16, - padding: [0, 0, 0, 50] + padding: [0, 0, 0, 50], }, splitLine: { - show: false + show: false, }, axisLine: { - show: false + show: false, }, axisTick: { - show: false + show: false, }, axisLabel: { show: true, color: '#E4EDFF', fontSize: 16, // interval: 0, - } + }, }, series: [ { @@ -104,26 +182,27 @@ const DistributionChart: React.FC = ({ searchTime }) => barWidth: 20, z: 1, barGap: '-100%', - data: data.map(() => ({ - value: maxValue, + data: data.map((item) => ({ + ...item, itemStyle: { color: '#33658D', // color: 'rgba(57, 122, 183, 0.2)', - borderRadius: [15, 15, 15, 15] - } - })) + borderRadius: [15, 15, 15, 15], + }, + })), }, { type: 'bar', barWidth: 20, z: 2, barGap: '-100%', - data: data.map(item => ({ - value: activeTab === '1' ? item.wasteAmount : item.siteCount, + data: data.map((item) => ({ + // value: activeTab === '1' ? item.wasteAmount : item.siteCount, + ...item, itemStyle: { color: activeTab === '1' ? 'rgba(89, 238, 255, 0.6)' : '#FFB36B', - borderRadius: [15, 15, 15, 15] - } + borderRadius: [15, 15, 15, 15], + }, })), label: { show: true, @@ -132,10 +211,10 @@ const DistributionChart: React.FC = ({ searchTime }) => fontSize: 20, formatter: (params: any) => { return params.value; - } - } - } - ] + }, + }, + }, + ], }; chart.setOption(option); @@ -143,7 +222,7 @@ const DistributionChart: React.FC = ({ searchTime }) => return () => { chart.dispose(); }; - }, [activeTab]); + }, [activeTab, emitData]); return (
@@ -154,11 +233,13 @@ const DistributionChart: React.FC = ({ searchTime }) => items={tabItems} />
-
单位:{activeTab === '1' ? '万方' : '个'}
+
+ 单位:{activeTab === '1' ? '万方' : '个'} +
); }; -export default DistributionChart; \ No newline at end of file +export default DistributionChart; diff --git a/src/pages/GlobalModalServices/modals/ConstructionWaste/components/LicenseInfo/index.tsx b/src/pages/GlobalModalServices/modals/ConstructionWaste/components/LicenseInfo/index.tsx index e261458ba15ea322cac7dbea68d9cf47cdcc80f4..1c05e054671d5fb42d7f85a4c3ff3e5938863e11 100644 --- a/src/pages/GlobalModalServices/modals/ConstructionWaste/components/LicenseInfo/index.tsx +++ b/src/pages/GlobalModalServices/modals/ConstructionWaste/components/LicenseInfo/index.tsx @@ -1,5 +1,7 @@ -import React from 'react'; +import services from '@/services'; +import { useRequest } from 'ahooks'; import { Space } from 'antd'; +import React, { useMemo } from 'react'; import styles from './index.less'; interface LicenseCardProps { @@ -8,7 +10,11 @@ interface LicenseCardProps { unit?: string; } -const LicenseCard: React.FC = ({ value, label, unit = '件' }) => ( +const LicenseCard: React.FC = ({ + value, + label, + unit = '件', +}) => (
{label} @@ -51,34 +57,90 @@ interface LicenseInfoProps { } const LicenseInfo: React.FC = ({ searchTime }) => { + //顶部右侧数据 + const { data: infoData, loading: infoLoading } = useRequest( + () => + services.DataBase.getSjdzInfoData({ + typeCode: 'zzcc-jzlj-gfclqk', + params: { + ...searchTime, + }, + }).then((res) => { + if (res.code === 200) { + return res?.data?.data?.records?.[0]; + } + throw new Error('获取数据失败'); + }), + { + refreshDeps: [searchTime], + }, + ); + //顶部左侧数据 + const { data: infoLeftData } = useRequest( + () => + services.DataBase.getSjdzInfoData({ + typeCode: 'zzcc-jzlj-gfzsblqk', + params: { + ...searchTime, + }, + }).then((res) => { + if (res.code === 200) { + return res?.data?.data?.records?.[0]; + } + throw new Error('获取数据失败'); + }), + { + refreshDeps: [searchTime], + }, + ); + + let isUsingValue = true; - const cardData = isUsingValue - ? [ - { value: '--', label: '办证总量' }, - { value: '--', label: '排放证办理' }, - { value: '--', label: '消纳证办理' }, - { value: '--', label: '临时消纳备案' }, - { value: '--', label: '综合利用(回填)登记' }, - ] - : [ - { value: 1582, label: '办证总量' }, - { value: 482, label: '排放证办理' }, - { value: 22, label: '消纳证办理' }, - { value: 22, label: '临时消纳备案' }, - { value: 22, label: '综合利用(回填)登记' }, - ]; + // const cardData = isUsingValue + // ? [ + // { value: '--', label: '办证总量' }, + // { value: '--', label: '排放证办理' }, + // { value: '--', label: '消纳证办理' }, + // { value: '--', label: '临时消纳备案' }, + // { value: '--', label: '综合利用(回填)登记' }, + // ] + // : [ + // { value: 1582, label: '办证总量' }, + // { value: 482, label: '排放证办理' }, + // { value: 22, label: '消纳证办理' }, + // { value: 22, label: '临时消纳备案' }, + // { value: 22, label: '综合利用(回填)登记' }, + // ]; + + // const vehicleData = isUsingValue + // ? [ + // { total: '--', online: '--', label: '运输车辆' }, + // { total: '--', online: '--', label: '新能源车辆' }, + // { total: '--', online: '--', label: '燃油车辆' }, + // ] + // : [ + // { total: 1562, online: 98.56, label: '运输车辆' }, + // { total: 1562, online: 98.56, label: '新能源车辆' }, + // { total: 1562, online: 98.56, label: '燃油车辆' }, + // ]; + + const cardData = useMemo(() => { + return [ + { value: infoLeftData?.zs, label: '办证总量' }, + { value: infoLeftData?.pfz, label: '排放证办理' }, + { value: infoLeftData?.xnz, label: '消纳证办理' }, + { value: infoLeftData?.lsxnbas, label: '临时消纳备案' }, + { value: infoLeftData?.zhly, label: '综合利用(回填)登记' }, + ]; + }, [infoLeftData]); - const vehicleData = isUsingValue - ? [ - { total: '--', online: '--', label: '运输车辆' }, - { total: '--', online: '--', label: '新能源车辆' }, - { total: '--', online: '--', label: '燃油车辆' }, - ] - : [ - { total: 1562, online: 98.56, label: '运输车辆' }, - { total: 1562, online: 98.56, label: '新能源车辆' }, - { total: 1562, online: 98.56, label: '燃油车辆' }, - ]; + const vehicleData = useMemo(() => { + return [ + { total: infoData?.zs, online: infoData?.zszxl, label: '运输车辆' }, + { total: infoData?.xny, online: infoData?.ryczxl, label: '新能源车辆' }, + { total: infoData?.ryc, online: infoData?.xnyzxl, label: '燃油车辆' }, + ]; + }, [infoData]); return (
@@ -101,4 +163,4 @@ const LicenseInfo: React.FC = ({ searchTime }) => { ); }; -export default LicenseInfo; \ No newline at end of file +export default LicenseInfo; diff --git a/src/pages/GlobalModalServices/modals/ConstructionWaste/components/RecyclingInfo/index.tsx b/src/pages/GlobalModalServices/modals/ConstructionWaste/components/RecyclingInfo/index.tsx index 565dd30d1a7e604a9f22917764d5536f6e460b0d..88d99c43ef24b453fced9f659d82e3ef8b6be6a3 100644 --- a/src/pages/GlobalModalServices/modals/ConstructionWaste/components/RecyclingInfo/index.tsx +++ b/src/pages/GlobalModalServices/modals/ConstructionWaste/components/RecyclingInfo/index.tsx @@ -1,4 +1,6 @@ -import React from 'react'; +import services from '@/services'; +import { useRequest } from 'ahooks'; +import React, { useMemo } from 'react'; import styles from './index.less'; interface InfoItemProps { @@ -7,13 +9,13 @@ interface InfoItemProps { unit: string; } -let isUsingValue = false; +let isUsingValue = true; const showValue = (value: number | string) => { - if(isUsingValue){ + if (isUsingValue) { return value; } return '--'; -} +}; const InfoItem: React.FC = ({ value, label, unit }) => (
@@ -32,36 +34,79 @@ interface RecyclingInfoProps { } const RecyclingInfo: React.FC = ({ searchTime }) => { - const topData = [ + //综合利用 + const { data: syntheticsData } = useRequest( + () => + services.DataBase.getSjdzInfoData({ + typeCode: 'zzcc-jzlj-zhly', + params: { + ...searchTime, + }, + }).then((res) => { + if (res.code === 200) { + return res?.data?.data?.records?.[0]; + } + throw new Error('获取数据失败'); + }), { - value: 12, - label: '固定式建筑垃圾资源化利用厂', - unit: '个' + refreshDeps: [searchTime], }, + ); + //资源利用概况 + const { data: resourceData } = useRequest( + () => + services.DataBase.getSjdzInfoData({ + typeCode: 'zzcc-jzlj-gdslsxsl', + params: { + ...searchTime, + }, + }).then((res) => { + if (res.code === 200) { + return res?.data?.data?.records; + } + throw new Error('获取数据失败'); + }), { - value: 12, - label: '临时性建筑垃圾资源化利用厂', - unit: '个' + refreshDeps: [searchTime], }, - { - value: 1200, - label: '处置能力', - unit: '万吨/年' - } - ]; + ); - const bottomData = [ - { - value: 112, - label: '综合利用点数量', - unit: '个' - }, - { - value: 12, - label: '综合利用处置量', - unit: '万方' - } - ]; + const topData = useMemo(() => { + const gds = resourceData?.find((item: any) => item.lx === 'gds'); + const lsx = resourceData?.find((item: any) => item.lx === 'lsx'); + return [ + { + value: gds?.total ?? '--', + label: '固定式建筑垃圾资源化利用厂', + unit: '个', + }, + { + value: lsx?.total ?? '--', + label: '临时性建筑垃圾资源化利用厂', + unit: '个', + }, + { + value: (gds?.czl ?? 0) + (lsx?.czl ?? 0), + label: '处置能力', + unit: '万吨/年', + }, + ]; + }, [resourceData]); + + const bottomData = useMemo(() => { + return [ + { + value: syntheticsData?.total, + label: '综合利用点数量', + unit: '个', + }, + { + value: syntheticsData?.czl, + label: '综合利用处置量', + unit: '万方', + }, + ]; + }, [syntheticsData]); return (
@@ -85,4 +130,4 @@ const RecyclingInfo: React.FC = ({ searchTime }) => { ); }; -export default RecyclingInfo; \ No newline at end of file +export default RecyclingInfo; diff --git a/src/pages/GlobalModalServices/modals/ConstructionWaste/components/StatisticsChart/index.tsx b/src/pages/GlobalModalServices/modals/ConstructionWaste/components/StatisticsChart/index.tsx index beac0539acff52ec90f90e6ea0af5f22014d775a..bfa68dac18fab628d88282de1edefa47d2ddf098 100644 --- a/src/pages/GlobalModalServices/modals/ConstructionWaste/components/StatisticsChart/index.tsx +++ b/src/pages/GlobalModalServices/modals/ConstructionWaste/components/StatisticsChart/index.tsx @@ -1,5 +1,7 @@ -import React, { useEffect, useRef } from 'react'; +import services from '@/services'; +import { useRequest } from 'ahooks'; import * as echarts from 'echarts'; +import React, { useEffect, useMemo, useRef } from 'react'; import styles from './index.less'; interface StatisticsChartProps { @@ -11,27 +13,92 @@ interface StatisticsChartProps { const StatisticsChart: React.FC = ({ searchTime }) => { const chartRef = useRef(null); - let isUsingValue = false; - const data = [ - { name: '工程渣土', value: 16.23, percentage: 56.25, color: '#FF9B5D' }, - { name: '工程泥浆', value: 16.23, percentage: 56.25, color: '#FFE335' }, - { name: '装修垃圾', value: 16.23, percentage: 56.25, color: '#35B2FF' }, - { name: '工程垃圾', value: 16.23, percentage: 56.25, color: '#77E67B' }, - { name: '拆除垃圾', value: 16.23, percentage: 56.25, color: '#00FFB3' } - ]; + + const { data: charData } = useRequest( + () => + services.DataBase.getSjdzInfoData({ + typeCode: 'zzcc-jzlj-lxtjlssbpfl', + params: { + ...searchTime, + }, + }).then((res) => { + if (res.code === 200) { + return res?.data?.data?.records; + } + throw new Error('获取数据失败'); + }), + { + refreshDeps: [searchTime], + }, + ); + const { data: total } = useRequest( + () => + services.DataBase.getSjdzInfoData({ + typeCode: 'zzcc-jzlj-aqytjpfl', + params: { + ...searchTime, + }, + }).then((res) => { + if (res.code === 200) { + console.log(res); + + return res?.data?.data?.records?.[0]?.total; + } + throw new Error('获取数据失败'); + }), + { + refreshDeps: [searchTime], + }, + ); + + let isUsingValue = true; + const data = useMemo(() => { + const gczt = charData?.find((item) => item.name === 'gczt')?.num; + const gcnj = charData?.find((item) => item.name === 'gcnj')?.num; + const zxlj = charData?.find((item) => item.name === 'zxlj')?.num; + const gclj = charData?.find((item) => item.name === 'gclj')?.num; + const cclj = charData?.find((item) => item.name === 'cclj')?.num; + return [ + { + name: '工程渣土', + value: gczt, + percentage: ((gczt / total) * 100).toFixed(2), + color: '#FF9B5D', + }, + { + name: '工程泥浆', + value: gcnj, + percentage: ((gcnj / total) * 100).toFixed(2), + color: '#FFE335', + }, + { + name: '装修垃圾', + value: zxlj, + percentage: ((zxlj / total) * 100).toFixed(2), + color: '#35B2FF', + }, + { + name: '工程垃圾', + value: gclj, + percentage: ((gclj / total) * 100).toFixed(2), + color: '#77E67B', + }, + { name: '拆除垃圾', value: cclj, percentage: ((cclj / total) * 100).toFixed(2), color: '#00FFB3' }, + ]; + }, [charData, total]); const showValue = (value: number | string) => { - if(isUsingValue){ + if (isUsingValue) { return value; } return '--'; - } + }; useEffect(() => { if (!chartRef.current) return; - + const chart = echarts.init(chartRef.current); - + const option = { tooltip: { trigger: 'item', @@ -39,43 +106,43 @@ const StatisticsChart: React.FC = ({ searchTime }) => { borderColor: '#13659680', borderWidth: 1, textStyle: { - color: '#BCCEE9' - } + color: '#BCCEE9', + }, }, title: { - text: isUsingValue ? '5623.85' : '---.--', + text: isUsingValue ? total : '---.--', subtext: '共计(万方)', - left: '65px', // 根据需求调整位置 - top: '54px', // 根据需求调整位置 + left: '65px', // 根据需求调整位置 + top: '54px', // 根据需求调整位置 textStyle: { color: '#FFFFFF', fontSize: 24, fontFamily: 'D-DIN', - lineHeight: 31 + lineHeight: 31, }, subtextStyle: { color: '#BCCEE9', fontSize: 16, - lineHeight: 23 - } + lineHeight: 23, + }, }, series: [ { type: 'pie', radius: ['50%', '70%'], - center: ['40%', '35%'], // 调整环形图位置 - data: data.map(item => ({ + center: ['40%', '35%'], // 调整环形图位置 + data: data.map((item) => ({ name: item.name, value: item.value, itemStyle: { - color: item.color - } + color: item.color, + }, })), label: { - show: false - } - } - ] + show: false, + }, + }, + ], }; chart.setOption(option); @@ -83,7 +150,7 @@ const StatisticsChart: React.FC = ({ searchTime }) => { return () => { chart.dispose(); }; - }, []); + }, [total]); return (
@@ -96,14 +163,19 @@ const StatisticsChart: React.FC = ({ searchTime }) => {
{data.slice(0, 3).map((item, index) => (
-
+
{item.name}
{showValue(item.value)} 万方
-
{showValue(item.percentage)}%
+
+ {showValue(item.percentage)}% +
))} @@ -111,14 +183,19 @@ const StatisticsChart: React.FC = ({ searchTime }) => {
{data.slice(3).map((item, index) => (
-
+
{item.name}
{showValue(item.value)} 万方
-
{showValue(item.percentage)}%
+
+ {showValue(item.percentage)}% +
))} @@ -129,4 +206,4 @@ const StatisticsChart: React.FC = ({ searchTime }) => { ); }; -export default StatisticsChart; \ No newline at end of file +export default StatisticsChart; diff --git a/src/pages/GlobalModalServices/modals/ConstructionWaste/index.less b/src/pages/GlobalModalServices/modals/ConstructionWaste/index.less index 429a7d6d3352abc58e857104fbf98ab12e13a321..13ff1c30ba878d6f32d898753b30bda66d8da27f 100644 --- a/src/pages/GlobalModalServices/modals/ConstructionWaste/index.less +++ b/src/pages/GlobalModalServices/modals/ConstructionWaste/index.less @@ -26,47 +26,47 @@ white-space: nowrap; } - .headerLeft { - display: flex; - align-items: center; - margin-left: 30px; + +} +.headerLeft { + display: flex; + align-items: center; + margin-left: 30px; - :global { - .ant-picker { - background: transparent; - width: 280px; - padding: 4px 11px; + :global { + .ant-picker { + background: transparent; + width: 280px; + padding: 4px 11px; - &:hover { - background: rgba(255, 255, 255, 0.1); - } + &:hover { + background: rgba(255, 255, 255, 0.1); + } + + .ant-picker-input { + input { + color: #BCCEE9; + font-family: '微软雅黑'; + font-size: 18px; + text-align: center; - .ant-picker-input { - input { + &::placeholder { color: #BCCEE9; - font-family: '微软雅黑'; - font-size: 18px; - text-align: center; - - &::placeholder { - color: #BCCEE9; - opacity: 1; - } + opacity: 1; } } + } - .ant-picker-range-separator { - color: #BCCEE9; - } + .ant-picker-range-separator { + color: #BCCEE9; + } - .ant-picker-suffix { - color: #BCCEE9; - } + .ant-picker-suffix { + color: #BCCEE9; } } } } - .dateRangePicker { :global { .ant-picker-panel-container { diff --git a/src/pages/GlobalModalServices/modals/ConstructionWaste/index.tsx b/src/pages/GlobalModalServices/modals/ConstructionWaste/index.tsx index deeb9b0a67d3954c44477baf00c6dbf96c6b93f4..bda0b110b166f8fe0f323a78afc2ba11e556a0e5 100644 --- a/src/pages/GlobalModalServices/modals/ConstructionWaste/index.tsx +++ b/src/pages/GlobalModalServices/modals/ConstructionWaste/index.tsx @@ -1,18 +1,18 @@ -import React, { useEffect, useState } from 'react'; -import dayjs from 'dayjs'; -import { DatePicker } from 'antd'; import { DownOutlined } from '@ant-design/icons'; -import styles from './index.less'; -import LicenseInfo from './components/LicenseInfo'; -import DistributionChart from './components/DistributionChart'; -import StatisticsChart from './components/StatisticsChart'; +import { DatePicker } from 'antd'; +import dayjs from 'dayjs'; +import { useEffect, useState } from 'react'; import DisposalSiteInfo from './components/DisposalSiteInfo'; +import DistributionChart from './components/DistributionChart'; +import LicenseInfo from './components/LicenseInfo'; import RecyclingInfo from './components/RecyclingInfo'; +import StatisticsChart from './components/StatisticsChart'; +import styles from './index.less'; const { RangePicker } = DatePicker; const ConstructionWaste = (props: any) => { - const [searchTime, setSearchTime] = useState({ + const [searchTime, setSearchTime] = useState({ startTime: dayjs().startOf('month').format('YYYY-MM-DD'), endTime: dayjs().endOf('month').format('YYYY-MM-DD'), }); @@ -22,7 +22,7 @@ const ConstructionWaste = (props: any) => { headerLeft: (
{ if (dates) { setSearchTime({ @@ -38,7 +38,9 @@ const ConstructionWaste = (props: any) => { placeholder={['开始时间', '结束时间']} variant="borderless" popupClassName={styles.dateRangePicker} - getPopupContainer={trigger => trigger.parentElement || document.body} + getPopupContainer={(trigger) => + trigger.parentElement || document.body + } />
), @@ -64,4 +66,4 @@ const ConstructionWaste = (props: any) => { ); }; -export default ConstructionWaste; \ No newline at end of file +export default ConstructionWaste; diff --git a/src/pages/GlobalModalServices/modals/DyaPatrol/DyaPatrolList/index.tsx b/src/pages/GlobalModalServices/modals/DyaPatrol/DyaPatrolList/index.tsx index 53ea666c32826d717291fc4227ebd9275ed5819f..b7946a82326e2fa8f2ca936b0b56fe9c8a1976c6 100644 --- a/src/pages/GlobalModalServices/modals/DyaPatrol/DyaPatrolList/index.tsx +++ b/src/pages/GlobalModalServices/modals/DyaPatrol/DyaPatrolList/index.tsx @@ -2,11 +2,10 @@ import BlueTable from '@/components/BlueTable'; import { useGlobalModalServices } from '@/pages/GlobalModalServices/provider'; import services from '@/services'; import { useRequest } from 'ahooks'; -import { log } from 'echarts/types/src/util/log.js'; import { useMemo, useState } from 'react'; -const DyaPatrolList = (props:any) => { +const DyaPatrolList = (props: any) => { const [fetchParams, setFetchParams] = useState({ data: { pageNo: 1, @@ -15,18 +14,17 @@ const DyaPatrolList = (props:any) => { }); const { dispatch } = useGlobalModalServices(); - const { data } = useRequest( + const { data, loading } = useRequest( () => services.DataBase.getSjdzInfoData({ typeCode: 'zzcc-rcxc-fylb', params: { ...fetchParams, ...props?.search, - ssqy:props?.ssqy, - bm:props?.bm, + ssqy: props?.ssqy, + bm: props?.bm, ...props?.searchTime, - sbr:props?.sbr, - + sbr: props?.sbr, }, }), { @@ -34,7 +32,7 @@ const DyaPatrolList = (props:any) => { }, ); console.log(data); - + const columns = useMemo(() => { return [ { @@ -83,10 +81,9 @@ const DyaPatrolList = (props:any) => {
{ dispatch.push('DyaPatrolDetails', { - // title:'行政处罚详情' + // title:'行政处罚详情' props: { id: record.zj, - }, }); }} @@ -107,7 +104,7 @@ const DyaPatrolList = (props:any) => { return (
{ console.log(total); //工作子新 - const { data: starData } = useRequest( + const { data: starData, loading: starLoading } = useRequest( () => services.DataBase.getSjdzInfoData({ typeCode: 'zzcc-rcxc-zdxmfztj', params: { ...searchTime, + endTime: + searchTime.key == 'day' + ? dayjs().format('YYYY-MM-DD') + : searchTime.endTime, }, }), { @@ -56,7 +61,7 @@ const DyaPatrol = (props: any) => { ); //处罚趋势本月本年本日 - const { data: cfqsYear } = useRequest( + const { data: cfqsYear, loading: yearLoading } = useRequest( () => services.DataBase.getSjdzInfoData({ typeCode: 'zzcc-rcxc-ryntj', @@ -75,7 +80,7 @@ const DyaPatrol = (props: any) => { }, ); //处罚趋势时间段 - const { data: cfqsMonth } = useRequest( + const { data: cfqsMonth, loading: trendLoading } = useRequest( () => services.DataBase.getSjdzInfoData({ typeCode: 'zzcc-rcxc-sjcxmrsl', @@ -104,7 +109,7 @@ const DyaPatrol = (props: any) => { }, [cfqsYear, cfqsMonth, searchTime]); //高发时段 - const { data: timeData } = useRequest( + const { data: timeData, loading: higtTimeLoading } = useRequest( () => services.DataBase.getSjdzInfoData({ typeCode: 'zzcc-rcxc-xssllb', @@ -118,7 +123,7 @@ const DyaPatrol = (props: any) => { ); //高发类型 - const { data: typeTop } = useRequest( + const { data: typeTop, loading: higtLoading } = useRequest( () => services.DataBase.getSjdzInfoData({ typeCode: 'zzcc-rcxc-lxsltj', @@ -142,7 +147,7 @@ const DyaPatrol = (props: any) => { }, [typeTop, total]); //区域top5 - const { data: areaTop } = useRequest( + const { data: areaTop, loading: areaTopLoading } = useRequest( () => services.DataBase.getSjdzInfoData({ typeCode: 'zzcc-rcxc-qyfztj', @@ -183,7 +188,7 @@ const DyaPatrol = (props: any) => { })); }, [areaTop, areaKey, total]); //部门top5 - const { data: qysl } = useRequest( + const { data: qysl, loading: bmTopLoading } = useRequest( () => services.DataBase.getSjdzInfoData({ typeCode: 'zzcc-rcxc-abmfztj', @@ -226,14 +231,6 @@ const DyaPatrol = (props: any) => { const tp3List = useMemo(() => { return [ - { - key: '2', - name: starData?.data?.data?.records?.[1]?.sbr, - count: starData?.data?.data?.records?.[1]?.num, - works: starData?.data?.data?.records?.[1]?.zd, - bg: require('@/assets/images/administPunish/starBg2.png'), - icon: require('@/assets/images/administPunish/star1.png'), - }, { key: '1', name: starData?.data?.data?.records?.[0]?.sbr, @@ -242,6 +239,14 @@ const DyaPatrol = (props: any) => { bg: require('@/assets/images/administPunish/starBg1.png'), icon: require('@/assets/images/administPunish/star2.png'), }, + { + key: '2', + name: starData?.data?.data?.records?.[1]?.sbr, + count: starData?.data?.data?.records?.[1]?.num, + works: starData?.data?.data?.records?.[1]?.zd, + bg: require('@/assets/images/administPunish/starBg2.png'), + icon: require('@/assets/images/administPunish/star1.png'), + }, { key: '3', name: starData?.data?.data?.records?.[2]?.sbr, @@ -334,14 +339,19 @@ const DyaPatrol = (props: any) => { %
*/}
- {qsList?.length ? ( - - ) : ( - - )} + + <> + {' '} + {qsList?.length ? ( + + ) : ( + + )} + +
@@ -375,111 +385,127 @@ const DyaPatrol = (props: any) => { ]} />
+ + <> + {typeTop5list?.length ? ( +
+ {typeTop5list?.map((item, index) => { + return ( +
{ + const param = + classType === '0' + ? { wtdl: item?.name } + : { wtxl: item?.name }; + dispatch.push('DyaPatrolList', { + title: '巡查处置列表', + props: { + search: param, + searchTime, + }, + }); + }} + > + +
{item.name}
+ +
+ {item?.num} + +
+
+ + {Number(item?.percent ?? 0).toFixed(2)} + + % +
+
+
- {typeTop5list?.length ? ( -
- {typeTop5list?.map((item, index) => { - return ( -
{ - const param = - classType === '0' - ? { wtdl: item?.name } - : { wtxl: item?.name }; - dispatch.push('DyaPatrolList', { - title: '巡查处置列表', - props: { - search: param, - searchTime, - }, - }); - }} - > - -
{item.name}
- -
- {item?.num} - -
-
- {Number(item?.percent ?? 0).toFixed(2)} - % -
-
-
- - -
- ); - })} -
- ) : ( - - )} + +
+ ); + })} +
+ ) : ( + + )} + +
高发时段分析
- {timeData?.data?.data?.records?.length ? ( - ({ - name: item?.sj ? item?.sj + '时' : '', - value: item?.num, - }))} - style={{ width: 525, height: 80 }} - /> - ) : ( - - )} + + <> + {timeData?.data?.data?.records?.length ? ( + ({ + name: item?.sj ? item?.sj + '时' : '', + value: item?.num, + }))} + style={{ width: 525, height: 80 }} + /> + ) : ( + + )} + +
工作之星
- {starData?.data?.data?.records?.length ? ( -
- {tp3List?.map((item) => { - return ( -
{ - dispatch.push('DyaPatrolList', { - title: '巡查处置列表', - props: { - sbr: item.name, - searchTime, - }, - }); - }} - > - -
- {item.name} - {item.count} - {item.count && } -
-
{item.works}
-
- ); - })} -
- ) : ( - - )} + + <> + {starData?.data?.data?.records?.length ? ( +
+ {tp3List?.map((item, index) => { + return ( +
{ + dispatch.push('DyaPatrolList', { + title: '巡查处置列表', + props: { + sbr: item.name, + searchTime, + }, + }); + }} + > + +
+ {item.name} + {item.count} + {item.count && ( + + )} +
+
{item.works}
+
+ ); + })} +
+ ) : ( + + )} + +
@@ -541,146 +567,148 @@ const DyaPatrol = (props: any) => { /> {activeKey === '1' ? (
- { - return { - onClick: (event) => { - dispatch.push('DyaPatrolList', { - title: '巡查处置列表', - props: { - ssqy: record?.ssqy, - searchTime, - }, - }); - }, // 点击行时触发 - }; - }} - scroll={{ y: 350 }} - dataSource={areaTopList || []} - columns={[ - { - title: '排名', - dataIndex: 'wh', - key: 'descgldw', - width: 100, - ellipsis: true, - render: (_: any, rows: any, index: number) => { - return ( -
TOP{index + 1}
- ); + + { + return { + onClick: (event) => { + dispatch.push('DyaPatrolList', { + title: '巡查处置列表', + props: { + ssqy: record?.ssqy, + searchTime, + }, + }); + }, // 点击行时触发 + }; + }} + scroll={{ y: 350 }} + dataSource={areaTopList || []} + columns={[ + { + title: '排名', + dataIndex: 'wh', + key: 'descgldw', + width: 100, + ellipsis: true, + render: (_: any, rows: any, index: number) => { + return ( +
TOP{index + 1}
+ ); + }, }, - }, - { - title: '区域', - dataIndex: 'ssqy', - key: 'ssqy', - width: 150, - ellipsis: true, - }, - { - title: '占比', - dataIndex: 'percent', - key: 'percent', - width: 90, - ellipsis: true, - render: (val: string) => { - return
{val}%
; + { + title: '区域', + dataIndex: 'ssqy', + key: 'ssqy', + width: 150, + ellipsis: true, }, - }, - { - title: '巡查处置问题数', - dataIndex: 'num', - key: 'num', - width: 200, - ellipsis: true, - render: (val) => { - return ( -
- {val} - -
- ); + { + title: '占比', + dataIndex: 'percent', + key: 'percent', + width: 90, + ellipsis: true, + render: (val: string) => { + return
{val}%
; + }, + }, + { + title: '巡查处置问题数', + dataIndex: 'num', + key: 'num', + width: 200, + ellipsis: true, + render: (val) => { + return ( +
+ {val} + +
+ ); + }, }, - }, - ]} - pagination={false} - /> + ]} + pagination={false} + /> +
) : ( -
- { - return { - onClick: (event) => { - dispatch.push('DyaPatrolList', { - title: '巡查处置列表', - props: { - bm: record?.bm, - searchTime, - }, - }); - }, // 点击行时触发 - }; - }} - columns={[ - { - title: '排名', - dataIndex: 'wh', - key: 'descgldw', - width: 100, - ellipsis: true, - render: (_: any, rows: any, index: number) => { - return ( -
TOP{index + 1}
- ); +
+ + { + return { + onClick: (event) => { + dispatch.push('DyaPatrolList', { + title: '巡查处置列表', + props: { + bm: record?.bm, + searchTime, + }, + }); + }, // 点击行时触发 + }; + }} + columns={[ + { + title: '排名', + dataIndex: 'wh', + key: 'descgldw', + width: 100, + ellipsis: true, + render: (_: any, rows: any, index: number) => { + return ( +
TOP{index + 1}
+ ); + }, }, - }, - { - title: '上报部门', - dataIndex: 'bm', - key: 'bm', - width: 150, - ellipsis: true, - }, - { - title: '所属区域', - dataIndex: 'areaname', - key: 'areaname', - width: 150, - ellipsis: true, - }, - { - title: '占比', - dataIndex: 'percent', - key: 'percent', - width: 90, - ellipsis: true, - render: (val) => { - return
{val}%
; + { + title: '上报部门', + dataIndex: 'bm', + key: 'bm', + width: 150, + ellipsis: true, }, - }, - { - title: '巡查处置问题数', - dataIndex: 'num', - key: 'num', - width: 100, - ellipsis: true, - render: (num: string) => { - return ( -
- {num} - -
- ); + { + title: '所属区域', + dataIndex: 'areaname', + key: 'areaname', + width: 150, + ellipsis: true, + }, + { + title: '占比', + dataIndex: 'percent', + key: 'percent', + width: 90, + ellipsis: true, + render: (val) => { + return
{val}%
; + }, + }, + { + title: '巡查处置问题数', + dataIndex: 'num', + key: 'num', + width: 100, + ellipsis: true, + render: (num: string) => { + return ( +
+ {num} + +
+ ); + }, }, - }, - ]} - pagination={false} - /> + ]} + pagination={false} + /> +
)}
diff --git a/src/pages/GlobalModalServices/modals/LivingGarbage/index.tsx b/src/pages/GlobalModalServices/modals/LivingGarbage/index.tsx index 1f5f59d7c4816a1b669d410d1ad59a899f36d097..d56a3238f17df13d467bd09e2fc4a488f12b410a 100644 --- a/src/pages/GlobalModalServices/modals/LivingGarbage/index.tsx +++ b/src/pages/GlobalModalServices/modals/LivingGarbage/index.tsx @@ -57,7 +57,7 @@ const LivingGarbage: React.FC = () => { const disposalList = [ { name: isUsingValue ? '万兴环保发电二期' : '--', value: isUsingValue ? 22.33 : '--' }, { name: isUsingValue ? '九江环保发电厂' : '--', value: isUsingValue ? 22.33 : '--' }, - { name: isUsingValue ? '享福环保发电厂' : '--', value: isUsingValue ? 22.33 : '--' }, + { name: isUsingValue ? '祥福环保发电厂' : '--', value: isUsingValue ? 22.33 : '--' }, { name: isUsingValue ? '宝林环保发电厂' : '--', value: isUsingValue ? 22.33 : '--' }, { name: isUsingValue ? '隆丰环保发电厂' : '--', value: isUsingValue ? 22.33 : '--' }, { name: isUsingValue ? '邓双环保发电厂' : '--', value: isUsingValue ? 22.33 : '--' }, @@ -68,9 +68,9 @@ const LivingGarbage: React.FC = () => { // 模拟管廊列表数据 const pipelineList = [ - { name: isUsingValue ? '焚烧厂名称1' : '--', location: { x: 103.96, y: 30.658842 } }, - { name: isUsingValue ? '焚烧厂名称1' : '--', location: { x: 103.96, y: 30.658842 } }, - { name: isUsingValue ? '焚烧厂名称3' : '--', location: { x: 103.96, y: 30.658842 } }, + { name: isUsingValue ? '环保发电厂名称1' : '--', location: { x: 103.96, y: 30.658842 } }, + { name: isUsingValue ? '环保发电厂名称1' : '--', location: { x: 103.96, y: 30.658842 } }, + { name: isUsingValue ? '环保发电厂名称3' : '--', location: { x: 103.96, y: 30.658842 } }, { name: isUsingValue ? '填埋场1' : '--', location: { x: 103.96, y: 30.658842 } }, { name: isUsingValue ? '填埋场2' : '--', location: { x: 103.96, y: 30.658842 } }, ]; @@ -159,8 +159,8 @@ const LivingGarbage: React.FC = () => {
图层图例
- 焚烧厂 - 焚烧厂 + 环保发电厂 + 环保发电厂
填埋场 diff --git a/src/pages/GlobalModalServices/modals/PipeGalleryDetail/components/AssessmentInfo/index.tsx b/src/pages/GlobalModalServices/modals/PipeGalleryDetail/components/AssessmentInfo/index.tsx index de49b950873fe3e1e9bc41e073549db96b067f0e..0fbc45913e4ee03a76ad11e7aace14a5474b30e6 100644 --- a/src/pages/GlobalModalServices/modals/PipeGalleryDetail/components/AssessmentInfo/index.tsx +++ b/src/pages/GlobalModalServices/modals/PipeGalleryDetail/components/AssessmentInfo/index.tsx @@ -1,8 +1,11 @@ import React from 'react'; import styles from './index.less'; import DescriptionItem from '@/components/DescriptionItem'; +import { useGlobalModalServices } from '@/pages/GlobalModalServices/provider'; const AssessmentInfo: React.FC = () => { + const { dispatch } = useGlobalModalServices(); + const commonUnitStyle = { // fontFamily: 'D-DIN Exp', fontSize: '36px', @@ -34,6 +37,16 @@ const AssessmentInfo: React.FC = () => { unitStyle={{...commonUnitStyle, fontFamily: 'D-DIN Exp'}} // unitStyle={commonUnitStyle} labelStyle={commonLabelStyle} + onClick={() => { + if (true) { + // 管廊检测评估弹窗-本体 + dispatch.push('PipelineAssessment', { + props: { + facilityType: 'main', + }, + }); + } + }} /> { // unitStyle={{...commonUnitStyle, fontFamily: 'D-DIN Exp'}} unitStyle={commonUnitStyle} labelStyle={commonLabelStyle} + onClick={() => { + if (true) { + // 管廊检测评估弹窗-附属设施检测评估基础信息 + dispatch.push('PipelineAssessment', { + props: { + facilityType: 'auxiliary', + }, + }); + } + }} />
diff --git a/src/pages/GlobalModalServices/modals/PipeGalleryDetail/components/InspectionInfo/index.tsx b/src/pages/GlobalModalServices/modals/PipeGalleryDetail/components/InspectionInfo/index.tsx index 48685de0fee23fdcfb46c474abad81f6fe57610a..7c3693f8dbce519346dd6bdc5bb241d0ea16f019 100644 --- a/src/pages/GlobalModalServices/modals/PipeGalleryDetail/components/InspectionInfo/index.tsx +++ b/src/pages/GlobalModalServices/modals/PipeGalleryDetail/components/InspectionInfo/index.tsx @@ -1,8 +1,11 @@ import React from 'react'; import styles from './index.less'; import DescriptionItem from '@/components/DescriptionItem'; +import { useGlobalModalServices } from '@/pages/GlobalModalServices/provider'; const InspectionInfo: React.FC = () => { + const { dispatch } = useGlobalModalServices(); + const commonValueStyle = { fontFamily: 'D-DIN Exp', fontSize: '36px', @@ -39,6 +42,12 @@ const InspectionInfo: React.FC = () => { valueStyle={commonValueStyle} labelStyle={commonLabelStyle} unitStyle={commonUnitStyle} + onClick={() => { + if (true) { + // 管廊巡检列表弹窗 + dispatch.push('PipelineInspection', {}); + } + }} /> { valueStyle={commonValueStyle} labelStyle={commonLabelStyle} unitStyle={commonUnitStyle} + onClick={() => { + if (true) { + // 巡检发现病害列表弹窗 + dispatch.push('PipelineDefectList', {}); + } + }} />
diff --git a/src/pages/GlobalModalServices/modals/PipeGalleryDetail/components/MaintenanceInfo/index.tsx b/src/pages/GlobalModalServices/modals/PipeGalleryDetail/components/MaintenanceInfo/index.tsx index 872ac99d2dad9cac1f4b79c8d14236f36cf7d4d7..73c69cca1f28874b3ee3ad2ac1b796c5d4346b53 100644 --- a/src/pages/GlobalModalServices/modals/PipeGalleryDetail/components/MaintenanceInfo/index.tsx +++ b/src/pages/GlobalModalServices/modals/PipeGalleryDetail/components/MaintenanceInfo/index.tsx @@ -4,8 +4,11 @@ import DescriptionItem from '@/components/DescriptionItem'; import pipeMapCheck from '@/assets/images/pipe-map-check.png'; import { Popover } from 'antd'; import questionMark from '@/assets/images/questionMark.png'; +import { useGlobalModalServices } from '@/pages/GlobalModalServices/provider'; const MaintenanceInfo: React.FC = () => { + const { dispatch } = useGlobalModalServices(); + const commonValueStyle = { fontFamily: 'D-DIN Exp', fontSize: '36px', @@ -65,6 +68,14 @@ const MaintenanceInfo: React.FC = () => { valueStyle={commonValueStyle} labelStyle={commonLabelStyle} unitStyle={commonUnitStyle} + onClick={() => { + if (true) { + // 管廊维护列表弹窗 + dispatch.push('PipelineMaintenance', { + // title: `${item.name}综合管廊`, + }); + } + }} />
diff --git a/src/pages/GlobalModalServices/modals/PipeGalleryDetail/components/MonitorInfo/index.tsx b/src/pages/GlobalModalServices/modals/PipeGalleryDetail/components/MonitorInfo/index.tsx index d3af38b7b69ec08b376bbb583842095ced2fdfa7..2e4f2884effb38e61dce2851018533cb91553472 100644 --- a/src/pages/GlobalModalServices/modals/PipeGalleryDetail/components/MonitorInfo/index.tsx +++ b/src/pages/GlobalModalServices/modals/PipeGalleryDetail/components/MonitorInfo/index.tsx @@ -1,8 +1,11 @@ import React from 'react'; import styles from './index.less'; import DescriptionItem from '@/components/DescriptionItem'; +import { useGlobalModalServices } from '@/pages/GlobalModalServices/provider'; const MonitorInfo: React.FC = () => { + const { dispatch } = useGlobalModalServices(); + const commonValueStyle = { fontFamily: 'D-DIN Exp', fontSize: '36px', @@ -29,7 +32,7 @@ const MonitorInfo: React.FC = () => { 监测信息
-
+
{ valueStyle={{...commonValueStyle, background: '#FFB05A'}} labelStyle={commonLabelStyle} unitStyle={commonUnitStyle} + onClick={() => { + if (true) { + // 监控中心详情弹窗; 暂时放这里,正确应该是点地图上面的监控中心 + dispatch.push('PipelineMonitorDetail', { + }); + } + }} />
diff --git a/src/pages/GlobalModalServices/modals/PipelineAssessment/index.tsx b/src/pages/GlobalModalServices/modals/PipelineAssessment/index.tsx index bebebc5843f28f27de433abc2a6df651956054a0..b98700dc566edb3606ee065e2d88444c7d6c631e 100644 --- a/src/pages/GlobalModalServices/modals/PipelineAssessment/index.tsx +++ b/src/pages/GlobalModalServices/modals/PipelineAssessment/index.tsx @@ -1,10 +1,15 @@ -import React, { useState } from 'react'; +import React, { useState, useEffect } from 'react'; import { Flex } from 'antd'; import { DatePicker } from 'antd'; import dayjs from 'dayjs'; import styles from './index.less'; import BlueTable from '@/components/BlueTable'; import type { ColumnsType } from 'antd/es/table'; +import { useGlobalModalServices } from '@/pages/GlobalModalServices/provider'; + +interface PipelineAssessmentProps { + facilityType?: string; +} interface MainAssessmentType { pipelineName: string; @@ -25,9 +30,18 @@ interface AuxiliaryAssessmentType { suggestion: string; } -const PipelineAssessment: React.FC = () => { +const PipelineAssessment: React.FC = ({ facilityType: defaultFacilityType }) => { const [year, setYear] = useState(dayjs()); - const [facilityType, setFacilityType] = useState('main'); + const [facilityType, setFacilityType] = useState(defaultFacilityType || 'main'); + const { dispatch } = useGlobalModalServices(); + + // 当外部传入的facilityType变化时更新内部状态 + useEffect(() => { + if (defaultFacilityType) { + setFacilityType(defaultFacilityType); + } + }, [defaultFacilityType]); + let isUsingValue = true; // 管廊本体检测评估信息表格列配置 @@ -80,7 +94,12 @@ const PipelineAssessment: React.FC = () => { key: 'operation', width: 120, render: () => ( - 详情 + { + if (true) { + dispatch.push('PipelineAssessmentDetail', { + }); + } + }}>详情 ) } ]; @@ -163,7 +182,11 @@ const PipelineAssessment: React.FC = () => { {/* 评估时间 */} date && setYear(date)} + onChange={(date) => { + if (date) { + setYear(date); + } + }} picker="year" format="YYYY年" className={styles.datePicker} diff --git a/src/pages/GlobalModalServices/modals/PipelineAssessmentDetail/index.less b/src/pages/GlobalModalServices/modals/PipelineAssessmentDetail/index.less new file mode 100644 index 0000000000000000000000000000000000000000..73491df685fbef93c492bfcb80d1f3404ac07fa6 --- /dev/null +++ b/src/pages/GlobalModalServices/modals/PipelineAssessmentDetail/index.less @@ -0,0 +1,47 @@ +.container { + width: 1190px; + height: 858px; + + .content { + height: 100%; + overflow-y: auto; + padding: 20px 30px; + } + + .infoWrapper { + display: flex; + gap: 60px; + } + + .leftInfo { + flex: 1; + } + + .rightInfo { + width: 600px; + } + + .infoItem { + display: flex; + // margin-bottom: 20px; + + .label { + min-width: 180px; + text-align: right; + color: rgb(188, 206, 233); + font-size: 18px; + font-weight: 400; + line-height: 50px; + margin-right: 8px; + } + + .value { + flex: 1; + color: #FFFFFF; + font-size: 18px; + font-weight: 400; + line-height: 50px; + word-break: break-all; + } + } +} \ No newline at end of file diff --git a/src/pages/GlobalModalServices/modals/PipelineAssessmentDetail/index.tsx b/src/pages/GlobalModalServices/modals/PipelineAssessmentDetail/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..12b0762e821ca54d60ec56085d47288d0ee0a1dd --- /dev/null +++ b/src/pages/GlobalModalServices/modals/PipelineAssessmentDetail/index.tsx @@ -0,0 +1,67 @@ +import React from 'react'; +import styles from './index.less'; + +interface InfoItemProps { + label: string; + value: string; + style?: React.CSSProperties; +} + +const InfoItem: React.FC = ({ label, value, style }) => ( +
+ {label}: + {value} +
+); + +const PipelineAssessmentDetail: React.FC = () => { + const leftInfoItems = [ + { label: '管廊名称', value: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' }, + { label: '检测评估类别名称', value: 'XXXXXXXXXXXXXXX' }, + { label: '开始日期', value: '2024-12-24' }, + { label: '完成日期', value: '2024-12-24' }, + { label: '主要内容', value: 'XXXXXXXXXXXXXXX' }, + { label: '结果', value: 'XXXXXXXXXXXXXXXXXXXXXXX' }, + { label: '主要问题', value: 'XXXXXXXXXXXXXXX' }, + { label: '维护建议', value: 'XXXXXXXXXXXXXXXXXXXXXXX' }, + { label: '备注', value: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' }, + ]; + + // const rightInfoItems = [ + // { label: '结束日期', value: '2024-12-24' }, + // { label: '联系人', value: 'XXXXXXXXXXXXXXX' }, + // { label: '相对地面位置', value: '2024-12-24' }, + // { label: '层数', value: 'XXXXXXXXXXXXXXX' }, + // { label: '建筑面积(平方米)', value: 'XXXXXXXXXXXXXXX' }, + // { label: '管廊名称', value: 'XXXXXXXXXXXXXXXXXXXXXXX' }, + // ]; + + return ( +
+
+
+
+ {leftInfoItems.map((item, index) => ( + + ))} +
+ {/*
+ {rightInfoItems.map((item, index) => ( + + ))} +
*/} +
+
+
+ ); +}; + +export default PipelineAssessmentDetail; \ No newline at end of file diff --git a/src/pages/GlobalModalServices/modals/PipelineInspection/index.tsx b/src/pages/GlobalModalServices/modals/PipelineInspection/index.tsx index a4c46d799a600866dc6747e27f7c9a1aa05fc874..5017a05425c153bfee04f1ac19ed280b3c65441a 100644 --- a/src/pages/GlobalModalServices/modals/PipelineInspection/index.tsx +++ b/src/pages/GlobalModalServices/modals/PipelineInspection/index.tsx @@ -5,6 +5,7 @@ import dayjs from 'dayjs'; import styles from './index.less'; import BlueTable from '@/components/BlueTable'; import type { ColumnsType } from 'antd/es/table'; +import { useGlobalModalServices } from '@/pages/GlobalModalServices/provider'; interface DataType { planName: string; @@ -16,6 +17,8 @@ interface DataType { } const PipelineInspection: React.FC = () => { + const { dispatch } = useGlobalModalServices(); + const [dateRange, setDateRange] = useState<[dayjs.Dayjs, dayjs.Dayjs]>([ dayjs().startOf('month'), dayjs().endOf('month') @@ -64,7 +67,13 @@ const PipelineInspection: React.FC = () => { key: 'operation', width: 120, render: () => ( - 详情 + { + if (true) { + dispatch.push('PipelineInspectionDetail', { + }); + } + }}>详情 ) } ]; diff --git a/src/pages/GlobalModalServices/modals/PipelineInspectionDetail/index.less b/src/pages/GlobalModalServices/modals/PipelineInspectionDetail/index.less new file mode 100644 index 0000000000000000000000000000000000000000..73491df685fbef93c492bfcb80d1f3404ac07fa6 --- /dev/null +++ b/src/pages/GlobalModalServices/modals/PipelineInspectionDetail/index.less @@ -0,0 +1,47 @@ +.container { + width: 1190px; + height: 858px; + + .content { + height: 100%; + overflow-y: auto; + padding: 20px 30px; + } + + .infoWrapper { + display: flex; + gap: 60px; + } + + .leftInfo { + flex: 1; + } + + .rightInfo { + width: 600px; + } + + .infoItem { + display: flex; + // margin-bottom: 20px; + + .label { + min-width: 180px; + text-align: right; + color: rgb(188, 206, 233); + font-size: 18px; + font-weight: 400; + line-height: 50px; + margin-right: 8px; + } + + .value { + flex: 1; + color: #FFFFFF; + font-size: 18px; + font-weight: 400; + line-height: 50px; + word-break: break-all; + } + } +} \ No newline at end of file diff --git a/src/pages/GlobalModalServices/modals/PipelineInspectionDetail/index.tsx b/src/pages/GlobalModalServices/modals/PipelineInspectionDetail/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..444cffdee0c61ea9f114d4962c21be0889064acc --- /dev/null +++ b/src/pages/GlobalModalServices/modals/PipelineInspectionDetail/index.tsx @@ -0,0 +1,68 @@ +import React from 'react'; +import styles from './index.less'; + +interface InfoItemProps { + label: string; + value: string; + style?: React.CSSProperties; +} + +const InfoItem: React.FC = ({ label, value, style }) => ( +
+ {label}: + {value} +
+); + +const PipelineInspectionDetail: React.FC = () => { + const leftInfoItems = [ + { label: '巡检计划名称', value: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' }, + { label: '开始日期', value: '2024-12-24' }, + { label: '结束日期', value: '2024-12-24' }, + { label: '联系电话', value: 'XXXXXXXXXXXXXXX' }, + { label: '联系人', value: 'XXXXXXXXXXXXXXX' }, + { label: '管廊名称', value: 'XXXXXXXXXXXXXXXXXXXXXXX' }, + { label: '巡检周期', value: 'XXXXXXXXXXXXXXX' }, + { label: '巡检范围', value: 'XXXXXXXXXXXXXXXXXXXXXXX' }, + { label: '巡检结果', value: 'XXXXXXXXXXXXXXX' }, + { label: '备注', value: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' }, + ]; + + // const rightInfoItems = [ + // { label: '结束日期', value: '2024-12-24' }, + // { label: '联系人', value: 'XXXXXXXXXXXXXXX' }, + // { label: '相对地面位置', value: '2024-12-24' }, + // { label: '层数', value: 'XXXXXXXXXXXXXXX' }, + // { label: '建筑面积(平方米)', value: 'XXXXXXXXXXXXXXX' }, + // { label: '管廊名称', value: 'XXXXXXXXXXXXXXXXXXXXXXX' }, + // ]; + + return ( +
+
+
+
+ {leftInfoItems.map((item, index) => ( + + ))} +
+ {/*
+ {rightInfoItems.map((item, index) => ( + + ))} +
*/} +
+
+
+ ); +}; + +export default PipelineInspectionDetail; \ No newline at end of file diff --git a/src/pages/GlobalModalServices/modals/PipelineMaintenance/index.tsx b/src/pages/GlobalModalServices/modals/PipelineMaintenance/index.tsx index 9b1f387c96370e70c83e7a1e5d5def1d59a139fa..94e9fcbe18aa3a20d5b136cc3b822bc26b746cc4 100644 --- a/src/pages/GlobalModalServices/modals/PipelineMaintenance/index.tsx +++ b/src/pages/GlobalModalServices/modals/PipelineMaintenance/index.tsx @@ -5,6 +5,7 @@ import dayjs from 'dayjs'; import styles from './index.less'; import BlueTable from '@/components/BlueTable'; import type { ColumnsType } from 'antd/es/table'; +import { useGlobalModalServices } from '@/pages/GlobalModalServices/provider'; interface MaintenanceDataType { pipelineName: string; @@ -32,6 +33,7 @@ const PipelineMaintenance: React.FC = () => { ]); const [facilityType, setFacilityType] = useState('all'); const [activeTab, setActiveTab] = useState('daily'); + const { dispatch } = useGlobalModalServices(); let isUsingValue = true; const columnsMaintenance: ColumnsType = [ @@ -76,7 +78,13 @@ const PipelineMaintenance: React.FC = () => { key: 'operation', width: 120, render: () => ( - 详情 + { + if (true) { + dispatch.push('PipelineMaintenanceDetail', { + }); + } + }}>详情 ) } ]; diff --git a/src/pages/GlobalModalServices/modals/PipelineMaintenanceDetail/index.less b/src/pages/GlobalModalServices/modals/PipelineMaintenanceDetail/index.less new file mode 100644 index 0000000000000000000000000000000000000000..db21c33910d73c95f38222b8a170b9ff54492839 --- /dev/null +++ b/src/pages/GlobalModalServices/modals/PipelineMaintenanceDetail/index.less @@ -0,0 +1,47 @@ +.container { + width: 1151px; + height: 858px; + + .content { + height: 100%; + overflow-y: auto; + padding: 20px 30px; + } + + .infoWrapper { + display: flex; + gap: 60px; + } + + .leftInfo { + flex: 1; + } + + .rightInfo { + width: 600px; + } + + .infoItem { + display: flex; + // margin-bottom: 20px; + + .label { + min-width: 180px; + text-align: right; + color: rgb(188, 206, 233); + font-size: 18px; + font-weight: 400; + line-height: 50px; + margin-right: 8px; + } + + .value { + flex: 1; + color: #FFFFFF; + font-size: 18px; + font-weight: 400; + line-height: 50px; + word-break: break-all; + } + } +} \ No newline at end of file diff --git a/src/pages/GlobalModalServices/modals/PipelineMaintenanceDetail/index.tsx b/src/pages/GlobalModalServices/modals/PipelineMaintenanceDetail/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..0dd529d3a66ae50e98e849343ad597edfe8d7ced --- /dev/null +++ b/src/pages/GlobalModalServices/modals/PipelineMaintenanceDetail/index.tsx @@ -0,0 +1,66 @@ +import React from 'react'; +import styles from './index.less'; + +interface InfoItemProps { + label: string; + value: string; + style?: React.CSSProperties; +} + +const InfoItem: React.FC = ({ label, value, style }) => ( +
+ {label}: + {value} +
+); + +const PipelineMaintenanceDetail: React.FC = () => { + const leftInfoItems = [ + { label: '管廊名称', value: 'XXXXXXXXXXXXXXX' }, + { label: '病害设施设备名称', value: 'XXXXXXXXXXXXXXX' }, + { label: '病害发现日期', value: '2024-12-24' }, + { label: '完成日期', value: 'XXXXXXXXXXXXXXX' }, + { label: '工程量', value: 'XXXXXXXXXXXXXXX' }, + { label: '计量单位名称', value: 'XXXXXXXXXXXXXXXXXXXXXXX' }, + { label: '维修消耗材料', value: 'XXXXXXXXXXXXXXX' }, + { label: '备注', value: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' }, + ]; + + // const rightInfoItems = [ + // { label: '值班电话', value: 'XXXXXXXXXXXXXXXXXXXXXXX' }, + // { label: '位置描述', value: 'XXXXXXXXXXXXXXX' }, + // { label: '相对地面位置', value: '2024-12-24' }, + // { label: '层数', value: 'XXXXXXXXXXXXXXX' }, + // { label: '建筑面积(平方米)', value: 'XXXXXXXXXXXXXXX' }, + // { label: '管廊名称', value: 'XXXXXXXXXXXXXXXXXXXXXXX' }, + // ]; + + return ( +
+
+
+
+ {leftInfoItems.map((item, index) => ( + + ))} +
+ {/*
+ {rightInfoItems.map((item, index) => ( + + ))} +
*/} +
+
+
+ ); +}; + +export default PipelineMaintenanceDetail; \ No newline at end of file diff --git a/src/pages/GlobalModalServices/modals/PipelineMonitor/index.tsx b/src/pages/GlobalModalServices/modals/PipelineMonitor/index.tsx index 48d6bda3940d9824418a066f73c0085caeb57700..507c564499a9da1cd84aa1c296a40a4098fbf82d 100644 --- a/src/pages/GlobalModalServices/modals/PipelineMonitor/index.tsx +++ b/src/pages/GlobalModalServices/modals/PipelineMonitor/index.tsx @@ -20,7 +20,7 @@ const PipelineMonitor: React.FC = () => { const [deviceType, setDeviceType] = useState('all'); const [monitorResult, setMonitorResult] = useState('all'); - let isUsingValue = false; + let isUsingValue = true; const columns: ColumnsType = [ { diff --git a/src/pages/GlobalModalServices/modals/PipelineMonitorDetail/index.less b/src/pages/GlobalModalServices/modals/PipelineMonitorDetail/index.less new file mode 100644 index 0000000000000000000000000000000000000000..a19e9e26826c152714bf86e3390f51a53f9c1703 --- /dev/null +++ b/src/pages/GlobalModalServices/modals/PipelineMonitorDetail/index.less @@ -0,0 +1,47 @@ +.container { + width: 1335px; + height: 858px; + + .content { + height: 100%; + overflow-y: auto; + padding: 20px 30px; + } + + .infoWrapper { + display: flex; + gap: 60px; + } + + .leftInfo { + flex: 1; + } + + .rightInfo { + width: 600px; + } + + .infoItem { + display: flex; + // margin-bottom: 20px; + + .label { + min-width: 180px; + text-align: right; + color: rgb(188, 206, 233); + font-size: 18px; + font-weight: 400; + line-height: 50px; + margin-right: 8px; + } + + .value { + flex: 1; + color: #FFFFFF; + font-size: 18px; + font-weight: 400; + line-height: 50px; + word-break: break-all; + } + } +} \ No newline at end of file diff --git a/src/pages/GlobalModalServices/modals/PipelineMonitorDetail/index.tsx b/src/pages/GlobalModalServices/modals/PipelineMonitorDetail/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..ba385f13e9afb535271f8a1727e455146a4b854e --- /dev/null +++ b/src/pages/GlobalModalServices/modals/PipelineMonitorDetail/index.tsx @@ -0,0 +1,60 @@ +import React from 'react'; +import styles from './index.less'; + +interface InfoItemProps { + label: string; + value: string; + style?: React.CSSProperties; +} + +const InfoItem: React.FC = ({ label, value, style }) => ( +
+ {label}: + {value} +
+); + +const PipelineMonitorDetail: React.FC = () => { + const leftInfoItems = [ + { label: '监控中心名称', value: 'XXXXXXXXXXXXXXX' }, + { label: '运营管理单位', value: 'XXXXXXXXXXXXXXX' }, + { label: '设防烈度', value: 'XXXXXXXXXXXXXXX' }, + { label: '值班电话', value: 'XXXXXXXXXXXXXXX' }, + { label: '位置描述', value: 'XXXXXXXXXXXXXXX' }, + { label: '相对地面位置', value: 'XXXXXXXXXXXXXXXXXXXXXXX' }, + { label: '层数', value: 'XXXXXXXXXXXXXXX' }, + { label: '建筑面积(平方米)', value: '20020412.24' }, + { label: '管廊名称', value: 'XXXXXXXXXXXXXXXXXXXXXXX' }, + { label: '备注', value: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' }, + ]; + +// const rightInfoItems = [ +// { label: '值班电话', value: 'XXXXXXXXXXXXXXXXXXXXXXX' }, +// { label: '位置描述', value: 'XXXXXXXXXXXXXXX' }, +// { label: '相对地面位置', value: '2024-12-24' }, +// { label: '层数', value: 'XXXXXXXXXXXXXXX' }, +// { label: '建筑面积(平方米)', value: 'XXXXXXXXXXXXXXX' }, +// { label: '管廊名称', value: 'XXXXXXXXXXXXXXXXXXXXXXX' }, +// ]; + + return ( +
+
+
+
+ {leftInfoItems.map((item, index) => ( + + ))} +
+ {/*
+ {rightInfoItems.map((item, index) => ( + + ))} +
*/} +
+
+
+ ); +}; + +export default PipelineMonitorDetail; \ No newline at end of file diff --git a/src/pages/GlobalModalServices/modals/PipelinePassage/PipeCorridorSensesTheSituation/index.tsx b/src/pages/GlobalModalServices/modals/PipelinePassage/PipeCorridorSensesTheSituation/index.tsx index 7746fa38454f9502be60706facd75e8ab45975b8..083ab21989e622e1e717164dba7f4e9b8d32c4ed 100644 --- a/src/pages/GlobalModalServices/modals/PipelinePassage/PipeCorridorSensesTheSituation/index.tsx +++ b/src/pages/GlobalModalServices/modals/PipelinePassage/PipeCorridorSensesTheSituation/index.tsx @@ -15,7 +15,7 @@ const PipeCorridorSensesTheSituation: React.FC = () => { const [activeTab, setActiveTab] = useState('1'); const { dispatch } = useGlobalModalServices(); - let isTrigger = true; + let isTrigger = false; const tabItems = useMemo( () => [ @@ -112,8 +112,8 @@ const PipeCorridorSensesTheSituation: React.FC = () => { key={item.name} onClick={() => { if (isTrigger) { + // 管廊-监测信息弹窗 dispatch.push('PipelineMonitor', { - // title: `${item.name}综合管廊`, }); } }} diff --git a/src/pages/GlobalModalServices/modals/PipelinePassage/PipeGalleryMaintenanceStatus/index.tsx b/src/pages/GlobalModalServices/modals/PipelinePassage/PipeGalleryMaintenanceStatus/index.tsx index 2b1fc3e8b05b44300452b6b1f448e2597c3ea176..d53684168c25dacfbe0fb7da264e3835109cb1e1 100644 --- a/src/pages/GlobalModalServices/modals/PipelinePassage/PipeGalleryMaintenanceStatus/index.tsx +++ b/src/pages/GlobalModalServices/modals/PipelinePassage/PipeGalleryMaintenanceStatus/index.tsx @@ -7,12 +7,10 @@ import DescriptionItem from '@/components/DescriptionItem'; import questionMark from '@/assets/images/questionMark.png'; import styles from './index.less'; import option from './option'; -import { useGlobalModalServices } from '@/pages/GlobalModalServices/provider'; /** @name 管廊维护情况 */ const PipeGalleryMaintenanceStatus: React.FC = () => { const chartRef = useRef(); - const { dispatch } = useGlobalModalServices(); const INFO = useMemo(() => { return [ @@ -96,14 +94,7 @@ const PipeGalleryMaintenanceStatus: React.FC = () => { headerRight={ //
2024年12月
// //
2024年11月 21日 -2024年12月20日
-
{ - if (false) { - dispatch.push('PipelineAssessment', { - // title: `${item.name}综合管廊`, - }); - } - }}> +
2024年12月 { } title="管廊维护情况" > - { - if (false) { - dispatch.push('PipelineMaintenance', { - // title: `${item.name}综合管廊`, - }); - } - }}> + {INFO.map((item) => { return ( { })}
-
{ - if (false) { - dispatch.push('PipelineInspection', { - // title: `${item.name}综合管廊`, - }); - } - }}>近6个月维护趋势
+
近6个月维护趋势
{ const chartRef = useRef(); - const { dispatch } = useGlobalModalServices(); const colors = [ '#5DDDFF', @@ -54,14 +52,7 @@ const PipelineSituation: React.FC = () => { 全市入廊投运管线情况 6 类管线 - { - if (false) { - dispatch.push('PipelineDefectList', { - // title: `${item.name}综合管廊`, - }); - } - }}>948 公里 + 948 公里 } > diff --git a/src/pages/GlobalModalServices/modals/SanitationEvent/index.tsx b/src/pages/GlobalModalServices/modals/SanitationEvent/index.tsx index 6d8a08d53199bd0e32e137b19a70bc22b9dcaab4..c0fbac623707e2e00acabbdc8fa4ca4e68dca179 100644 --- a/src/pages/GlobalModalServices/modals/SanitationEvent/index.tsx +++ b/src/pages/GlobalModalServices/modals/SanitationEvent/index.tsx @@ -114,7 +114,7 @@ const CgftEvent = (props: any) => { }, ]; }, [count]); - console.log(count); + return (
diff --git a/src/pages/GlobalModalServices/modals/SanitationResource/index.less b/src/pages/GlobalModalServices/modals/SanitationResource/index.less index a1d306925c39f27b683e27b9ed9c167a73700624..5a11a245c4fc7cbe5438269f427e8ead81347910 100644 --- a/src/pages/GlobalModalServices/modals/SanitationResource/index.less +++ b/src/pages/GlobalModalServices/modals/SanitationResource/index.less @@ -160,7 +160,7 @@ justify-content: space-between; align-items: center; - + } .content { @@ -235,21 +235,28 @@ .title { font-size: 22px; color: rgb(203, 237, 255); - font-family: '钉钉进步体'; + display: flex; justify-content: space-between; align-items: center; - .rW{ + + .title { + font-family: '钉钉进步体'; + } + + .rW { display: flex; - align-items: center; + align-items: center; + .square { width: 10px; height: 10px; background-color: rgb(50, 177, 255); margin-right: 7px; + font-size: 16px; } } - + } } diff --git a/src/pages/GlobalModalServices/modals/SanitationResource/index.tsx b/src/pages/GlobalModalServices/modals/SanitationResource/index.tsx index 6d3c509aed2cf4b70104edab9175251299ef600d..6a5aefaa3454d849bf08d3a9154fb6c661e9c42d 100644 --- a/src/pages/GlobalModalServices/modals/SanitationResource/index.tsx +++ b/src/pages/GlobalModalServices/modals/SanitationResource/index.tsx @@ -341,18 +341,19 @@ const SanitationDisp = () => {
- 各年龄区间环卫从业人员分布 + 各年龄区间环卫从业人员分布
-
+
{ const { dispatch } = useGlobalModalServices(); /** 疑难问题基础数据 */ const [DEDataSource, setDEDataSource] = useState(); - const { data } = useRequest( + const { data, loading: dataLoading } = useRequest( () => services.CityProblemApi.getContentStatisticsV3(searchParams), { refreshDeps: [searchParams], @@ -277,173 +277,180 @@ const OperatingSituation = () => { />
-
- - {platformList?.map((item) => { - return ( - -
{ - item?.onClick?.(); - }} - > -
{item?.name}
- + +
+ + {platformList?.map((item) => { + return ( + +
{ + item?.onClick?.(); + }} + > +
{item?.name}
+ -
- - {commonStatistic(convertUnits(item.value)?.num, 30)} - - - {convertUnits(item.value)?.unit} - +
+ + {commonStatistic(convertUnits(item.value)?.num, 30)} + + + {convertUnits(item.value)?.unit} + +
-
- -
- ); - })} -
- {/* + + ); + })} + + {/* */} -
-
-
城市管理类问题总数
-
{ - // dispatch.push('GeneralSituation', { - // title: '事件总体情况', - // }); - dispatch.push('UrbanOperation', { - title: '总体情况', - props: { - // sourceSystemCode: data?.data?.items?.find( - // (item: any) => item.code === 'wnywxt', - // )?.code, - datetType: searchParams?.type, - lineData: data?.data?.timeItems[ - '城市管理综合问题总数' - ]?.map((item: any) => ({ +
+
+
城市管理类问题总数
+
{ + // dispatch.push('GeneralSituation', { + // title: '事件总体情况', + // }); + dispatch.push('UrbanOperation', { + title: '总体情况', + props: { + // sourceSystemCode: data?.data?.items?.find( + // (item: any) => item.code === 'wnywxt', + // )?.code, + datetType: searchParams?.type, + lineData: data?.data?.timeItems[ + '城市管理综合问题总数' + ]?.map((item: any) => ({ + ...item, + name: item.time, + })), + time: dayjs(searchParams?.time).format('YYYY-MM'), + showSourceSelect: true, + sourceType: 'all', + }, + }); + }} + > + {commonStatistic(convertUnits(data?.data?.total?.value)?.num, 38)} + + {convertUnits(data?.data?.total?.value)?.unit} + +
+
+
+
+ ({ ...item, - name: item.time, - })), - time: dayjs(searchParams?.time).format('YYYY-MM'), - showSourceSelect: true, - sourceType: 'all', - }, - }); - }} - > - {commonStatistic(convertUnits(data?.data?.total?.value)?.num, 38)} - - {convertUnits(data?.data?.total?.value)?.unit} - + name: + searchParams?.type === '3' ? item.time + '时' : item.time, + }), + ) || [] + } + style={{ width: '100%', height: 104 }} + />
-
-
- ({ - ...item, - name: - searchParams?.type === '3' ? item.time + '时' : item.time, - }), - ) || [] - } - style={{ width: '100%', height: 104 }} - /> -
-
- -
-
- {commonStatistic( - convertUnits(data?.data?.accept?.value)?.num, - )} - - {convertUnits(data?.data?.accept?.value)?.unit} - +
+
+ +
+
+ {commonStatistic( + convertUnits(data?.data?.accept?.value)?.num, + )} + + {convertUnits(data?.data?.accept?.value)?.unit} + +
+
立案
-
立案
-
-
{ - // dispatch.push('ToDisposed', { - // title: '待处置事件', - // }); - }} - > - -
-
- {commonStatistic(convertUnits(data?.data?.need?.value)?.num)} - - {convertUnits(data?.data?.need?.value)?.unit} - +
{ + // dispatch.push('ToDisposed', { + // title: '待处置事件', + // }); + }} + > + +
+
+ {commonStatistic(convertUnits(data?.data?.need?.value)?.num)} + + {convertUnits(data?.data?.need?.value)?.unit} + +
+
应处置
-
应处置
-
-
- -
-
- {commonStatistic(convertUnits(data?.data?.close?.value)?.num)} - - {convertUnits(data?.data?.close?.value)?.unit} - +
+ +
+
+ {commonStatistic(convertUnits(data?.data?.close?.value)?.num)} + + {convertUnits(data?.data?.close?.value)?.unit} + +
+
已处置
-
已处置
-
-
- -
-
- - - % +
+ +
+
+ + + % +
+
处置率
-
处置率
-
- {/*
+ {/*
疑难问题
{
*/} -
{ - dispatch.push('DifficultEvents', { - title: '疑难问题', - }); - }} - style={{ cursor: 'pointer' }} - > -
城市管理类疑难问题
-
- {commonStatistic( - convertUnits(DEDataSource?.cityManageEventTotal)?.num, - 30, - )} - - {convertUnits(DEDataSource?.cityManageEventTotal)?.unit} - +
{ + dispatch.push('DifficultEvents', { + title: '疑难问题', + }); + }} + style={{ cursor: 'pointer' }} + > +
城市管理类疑难问题
+
+ {commonStatistic( + convertUnits(DEDataSource?.cityManageEventTotal)?.num, + 30, + )} + + {convertUnits(DEDataSource?.cityManageEventTotal)?.unit} + +
-
+
); }; diff --git a/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/Advertisement/index.tsx b/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/Advertisement/index.tsx index 7886d843f3933f077178fe769d2a602cc65dca64..7c62e5cf694c2c90bdf1bfa968a4725d9f1d13bf 100644 --- a/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/Advertisement/index.tsx +++ b/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/Advertisement/index.tsx @@ -74,7 +74,14 @@ const Advertisement: React.FC = () => { valueStyle={commonValueStyle1} labelStyle={commonLabelStyle} unitStyle={commonUnitStyle} - decimals={0} + decimals={ + formatNumber(Number(eventCount), { + one: '件', + myriad: '万件', + })?.unit == '件' + ? 0 + : 2 + } style={{ justifyContent: 'start' }} direction={'horizontal'} onClick={() => { diff --git a/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/EnvironmentalHealth/index.tsx b/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/EnvironmentalHealth/index.tsx index dfcb1e5e523f59443eb13e137f3926a82db67aa2..340c94a754bb6fdd1c0b52be993ce2e57085bc5e 100644 --- a/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/EnvironmentalHealth/index.tsx +++ b/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/EnvironmentalHealth/index.tsx @@ -82,7 +82,7 @@ const EnvironmentalHealth: React.FC = () => { ); }, [hwrysl]); - console.log(hwryTotal); + return (
diff --git a/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/LawEnforcement/index.tsx b/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/LawEnforcement/index.tsx index 33f336c111cc2011949d69dcc79abf8af8b2f0f5..6fc6234feb827a338d5ddfb48a64ffc9caddf6ca 100644 --- a/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/LawEnforcement/index.tsx +++ b/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/LawEnforcement/index.tsx @@ -4,6 +4,7 @@ import industry6_3 from '@/assets/images/industryNew/industry6-3.png'; import DescriptionItem from '@/components/DescriptionItem'; import { useGlobalModalServices } from '@/pages/GlobalModalServices/provider'; import services from '@/services'; +import { convertUnits, formatNumber } from '@/utils/ui'; import { useRequest } from 'ahooks'; import { Flex } from 'antd'; import React from 'react'; @@ -47,14 +48,24 @@ const LawEnforcement: React.FC = () => {
{ dispatch.push('AdministPunish'); }} @@ -63,14 +74,25 @@ const LawEnforcement: React.FC = () => {
{ dispatch.push('AreaSynergy'); }} @@ -79,13 +101,24 @@ const LawEnforcement: React.FC = () => {
{ dispatch.push('DyaPatrol'); diff --git a/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/WasteDisposal/index.tsx b/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/WasteDisposal/index.tsx index 070cfa635b0847f4ed1c5aedd2d5733076c0d5db..f60aa5560bc1f4ebff9bda36b62fbead45bdb3c7 100644 --- a/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/WasteDisposal/index.tsx +++ b/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/WasteDisposal/index.tsx @@ -4,13 +4,50 @@ import industryTitle1 from '@/assets/images/industryNew/industryTitle1.png'; import industryTitle2 from '@/assets/images/industryNew/industryTitle2.png'; import DescriptionItem from '@/components/DescriptionItem'; import { useGlobalModalServices } from '@/pages/GlobalModalServices/provider'; +import services from '@/services'; +import { useRequest } from 'ahooks'; import { Flex } from 'antd'; +import dayjs from 'dayjs'; import React from 'react'; import styles from './index.less'; const WasteDisposal: React.FC = () => { const { dispatch } = useGlobalModalServices(); + const { data: emitTotal } = useRequest(() => + services.DataBase.getSjdzInfoData({ + typeCode: 'zzcc-jzlj-aqytjpfl', + params: { + startTime: dayjs().startOf('month').format('YYYY-MM-DD'), + endTime: dayjs().endOf('month').format('YYYY-MM-DD'), + }, + }).then((res) => { + if (res.code === 200) { + return res?.data?.data?.records?.[0]?.total; + } + throw new Error('获取数据失败'); + }), + ); + + + const { data: dumpTotal } = useRequest( + () => + services.DataBase.getSjdzInfoData({ + typeCode: 'zzcc-jzlj-wgqddwh', + params: { + startTime: dayjs().startOf('month').format('YYYY-MM-DD'), + endTime: dayjs().endOf('month').format('YYYY-MM-DD'), + }, + }).then((res) => { + if (res.code === 200) { + console.log(res); + + return res?.data?.data?.records?.[0]?.total; + } + throw new Error('获取数据失败'); + }), + + ); const commonValueStyle = { background: 'linear-gradient(180deg, #9CF8F7 0%, #25BBFF 100%)', WebkitBackgroundClip: 'text', @@ -113,7 +150,7 @@ const WasteDisposal: React.FC = () => { { style={commonStyle} /> { const { dispatch } = useGlobalModalServices(); + const [sensorCount, setSensorCount] = useState(0); const handleClick = (item: { url?: string; onClick?: () => void }) => { if (item.onClick) { @@ -47,7 +50,7 @@ const ResourceElements: React.FC = () => { name: '接入感知源', unit: '万个', path: '', - value: 251, + value: sensorCount, }, { @@ -69,6 +72,25 @@ const ResourceElements: React.FC = () => { path: '', }, ]; + + + /** 获取数据 */ + const getData = () => { + services.DataBase.getGzInfoData({ + typeCode: 'gz-sbzs', + }).then((res) => { + if (res.code === 200) { + // 将感知源数量转换为万个单位 + const sensorCountInTenThousand = (res.data?.sensorCount || 0) / 10000; + setSensorCount(sensorCountInTenThousand); + } + }); + }; + + useEffect(() => { + getData(); + }, []); + return (
=> { timeout: 300000, }); }; + +//获取数据底座数据 -- +// 使用:1、感知源个数 +export const getGzInfoData = (data: any): Promise => { + return request(urlProxyApis(`/sjdzInterfaceInfo/getGzInfoData`), { + data, + method: 'post', + timeout: 300000, + }); +};