diff --git a/src/components/V2504/AreaBarList/index.less b/src/components/V2504/AreaBarList/index.less index 350a3a2234e5567f9baa85eac0b59e5aafd1c856..36f5fa27063494e856fa8ec3a96626fe11ccb016 100644 --- a/src/components/V2504/AreaBarList/index.less +++ b/src/components/V2504/AreaBarList/index.less @@ -78,7 +78,7 @@ align-items: center; justify-content: flex-end; // width: 100%; - margin-left: 5px; + margin-left: 10px; // min-width: 60px; } diff --git a/src/pages/Home_v_2504/components/MapStateContext.tsx b/src/pages/Home_v_2504/components/MapStateContext.tsx index 7e01f4092411d26fbc7a7c0a1e821a7e8d84d47a..b038848c4c1311217f3bd5c019c8c848e5f59c16 100644 --- a/src/pages/Home_v_2504/components/MapStateContext.tsx +++ b/src/pages/Home_v_2504/components/MapStateContext.tsx @@ -956,6 +956,10 @@ export const useDataType = (typeStr: string) => { return DATA_TYPE.MUNICIPAL.MUNICIPAL_EVENT; case '景观照明': return DATA_TYPE.LANDSCAPE_LIGHTING.LIGHTING_EVENT; + case '生活垃圾': + return DATA_TYPE.DOMESTIC_WASTE.WASTE_EVENT; + case '建筑垃圾': + return DATA_TYPE.CONSTRUCTION_WASTE.CONSTRUCTION_EVENT; default: return DATA_TYPE.RESTAURANT_OIL.OIL_SMOKE_EVENT; diff --git a/src/pages/Home_v_2504/components/SubPages/ConstructionWaste/components/LeftContent/DeclaredEmission/index.less b/src/pages/Home_v_2504/components/SubPages/ConstructionWaste/components/LeftContent/DeclaredEmission/index.less new file mode 100644 index 0000000000000000000000000000000000000000..38e9a1a0cc5109e3c29f46ae4b77c8583f14635e --- /dev/null +++ b/src/pages/Home_v_2504/components/SubPages/ConstructionWaste/components/LeftContent/DeclaredEmission/index.less @@ -0,0 +1,16 @@ +.container { + width: 530px; + height: 311px; + background: linear-gradient(180.00deg, rgba(77, 107, 178, 0.3), rgba(8, 153, 255, 0.01) 100%); + border-radius: 15px; + // box-shadow: inset 0px 0px 23px 0px rgba(31, 87, 222, 0.5); + padding-bottom: 20px; + display: flex; + flex-direction: column; + } + + .content { + flex: 1; + margin-top: 10px; + overflow: hidden; + } \ No newline at end of file diff --git a/src/pages/Home_v_2504/components/SubPages/ConstructionWaste/components/LeftContent/DeclaredEmission/index.tsx b/src/pages/Home_v_2504/components/SubPages/ConstructionWaste/components/LeftContent/DeclaredEmission/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..849acc0db325744d73140eeb29f2766ec87742ef --- /dev/null +++ b/src/pages/Home_v_2504/components/SubPages/ConstructionWaste/components/LeftContent/DeclaredEmission/index.tsx @@ -0,0 +1,275 @@ +import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react' +import styles from './index.less'; +import HncyCard from '@/pages/Home_v_2504/components/common/Card' +import AreaBarList, { AreaBarItem } from '@/components/V2504/AreaBarList' +import ModuleTitleWithTabs from '@/pages/Home_v_2504/components/common/ModuleTitleWithTabs' +import useLatestValue from '@/pages/Home_v_2504/hooks/useLatestValue'; +import { useDataType, useMapState } from '@/pages/Home_v_2504/components/MapStateContext'; +import useApiControl, { formatDateTime } from '@/pages/Home_v_2504/hooks/useApiControl'; +import { getDistrictHighFrequencyArea } from '@/services/CityProblem'; +import { CarAreaProps } from '@/pages/Home_v_2504/components/SubPages/Environment/components/LeftContent/components/CarArea'; + +// 类型定义 +export interface DeclaredEmissionProps { + dateType?: string; + dateRange?: { startTime: string; endTime: string }; + dataTypeKey?: string; +} + +// 区域类型定义 +export type AreaType = 'all' | 'urban' | 'central' | 'county'; +const DeclaredEmission: React.FC = ({ + dateType, + dateRange, + dataTypeKey = '建筑垃圾' +}) => { + + // 地图状态 + const { mapState } = useMapState(); + const mapStateRef = useLatestValue(mapState); + + // 当前选中的区域类型 + const [currentTab, setCurrentTab] = useState('all'); + const currentTabRef = useLatestValue(currentTab); + + // 环卫人员区域数据 + // const [data, setData] = useState([]); + const [data, setData] = useState([ + { name: '锦江区', count: 456, percentage: 97.2 }, + { name: '金牛区', count: 400, percentage: 83.5 }, + { name: '成华区', count: 322, percentage: 70.8 }, + { name: '青羊区', count: 186, percentage: 65.6 }, + { name: '双流区', count: 152, percentage: 12.9 }, + { name: '武侯区', count: 122, percentage: 10.6 }, + { name: '龙泉驿区', count: 121, percentage: 10.5 }, + { name: '温江区', count: 120, percentage: 10.4 }, + { name: '新都区', count: 119, percentage: 10.3 }, + { name: '郫都区', count: 118, percentage: 10.2 }, + { name: '都江堰市', count: 117, percentage: 10.1 } + ]); + + // 处理Tab切换 + const handleTabChange = (tab: string) => { + setCurrentTab(tab as AreaType); + }; + + // 转换日期类型为API参数 + const translateDateType = useCallback((type: string) => { + switch (type) { + case 'year': return '1'; + case 'month': return '2'; + case 'day': return '3'; + case 'range': return '4'; + default: return '2'; // 默认月视图 + } + }, []); + + // 区域编码生成函数 + const getRegionCodes = (areaType: AreaType, regionCode: string) => { + // 默认所有区域 + if (areaType === 'all') { + return regionCode.length > 4 + ? regionCode + : regionCode === '5101' + ? '510104,510105,510106,510107,510108,510112,510113,510114,510115,510116,510117,510121,510129,510131,510132,510181,510182,510183,510184,510185' + : ''; + } + + // 城市新区 + if (areaType === 'urban') { + return '510112,510113,510114,510115,510116,510117'; + } + + // 中心城区 + if (areaType === 'central') { + return '510104,510105,510106,510107,510108'; + } + + // 县市新城 + if (areaType === 'county') { + return '510121,510129,510131,510132,510181,510182,510183,510184,510185'; + } + + return ''; + }; + + // 构建API请求参数 + const buildApiParams = useCallback(() => { + const currentMapState = mapStateRef.current; + + // 如果没有必要的时间参数,返回null表示不应该发起请求 + if (!currentMapState.leftPanelTime?.startTime || !currentMapState.leftPanelTime?.endTime) { + return null; + } + + // 使用当前时间类型,如果不存在则使用props或默认值 + const effectiveType = currentMapState.leftPanelTime.type || dateType || 'month'; + + // 基础参数对象 + const params: any = { + type: translateDateType(effectiveType) + }; + + // 处理日期参数 + if (effectiveType === 'range') { + params.customizeStart = formatDateTime(currentMapState.rightPanelTime.startTime); + params.customizeEnd = formatDateTime(currentMapState.rightPanelTime.endTime, true); + } else { + // 年、月、日视图使用time参数 + params.time = formatDateTime(currentMapState.rightPanelTime.startTime); + } + + // 获取区域编码列表 + const districtCodeList = getRegionCodes(currentTabRef.current, currentMapState.regionCode); + if (districtCodeList) { + params.districtCodeList = districtCodeList; + } + + // 处理区域参数 + if (currentMapState.regionCode === '5101') { + // 成都,这两个参数就不传 + params.districtCode = undefined; + params.streetCode = undefined; + } else if (currentMapState.regionCode.length === 6) { + // 区县级别 + params.districtCode = currentMapState.regionCode; + } else if (currentMapState.regionCode.length === 9) { + // 街道级别 + params.districtCode = currentMapState.regionCode.substring(0, 6); + params.streetCode = currentMapState.regionCode; + } + + // 使用传入的dataTypeKey获取对应的subTypeCode + params.subTypeCode = useDataType(dataTypeKey); + + return params; + }, [mapStateRef, currentTabRef, dateType, translateDateType, dataTypeKey]); + + // 使用useApiControl管理环卫人员区域API调用 + const highFrequencyApi = useApiControl({ + apiFunction: async (params) => { + console.log('发起环卫人员区域请求,参数:', params); + const response = await getDistrictHighFrequencyArea(params); + + if (response.code === 200 && response.data) { + return response.data; + } + + throw new Error('获取环卫人员区域数据失败'); + }, + onSuccess: (data) => { + if (!data || !Array.isArray(data) || data.length === 0) { + setData([]); + return; + } + + // 如果接口返回数据都是0,生成模拟数据 + // if (data.every(item => parseFloat(item.value) === 0 && parseFloat(item.percent) === 0)) { + // data = [ + // { name: '锦江区', value: 456, percent: '97.2' }, + // { name: '金牛区', value: 400, percent: '83.5' }, + // { name: '成华区', value: 322, percent: '70.8' }, + // { name: '青羊区', value: 186, percent: '65.6' }, + // { name: '双流区', value: 152, percent: '12.9' }, + // { name: '武侯区', value: 122, percent: '10.6' }, + // { name: '龙泉驿区', value: 121, percent: '10.5' }, + // { name: '温江区', value: 120, percent: '10.4' }, + // { name: '新都区', value: 119, percent: '10.3' }, + // { name: '郫都区', value: 118, percent: '10.2' }, + // { name: '都江堰市', value: 117, percent: '10.1' } + // ]; + // console.log('使用模拟环卫人员区域数据'); + // } + + // 转换接口返回的数据格式为图表需要的格式 + const formattedData = data.map((item: any) => ({ + name: item.name, + percentage: parseFloat(item.percent) || 0, + count: parseInt(item.value) || 0 + })); + + console.log('环卫人员区域数据成功:'); + setData(formattedData); + }, + onError: (error) => { + console.error('获取环卫人员区域数据出错:', error); + setData([]); + }, + apiName: '环卫人员区域', + debounceTime: 300, + cacheTime: 5000 // 缓存5秒,避免频繁刷新时重复请求 + }); + + // 使用 useMemo 跟踪 rightPanelTime 的实际变化 + const memoizedRightPanelTime = useMemo(() => { + return { + type: mapState.rightPanelTime.type, + startTime: mapState.rightPanelTime.startTime, + endTime: mapState.rightPanelTime.endTime + }; + }, [ + mapState.rightPanelTime.type, + mapState.rightPanelTime.startTime, + mapState.rightPanelTime.endTime + ]); + + // 跟踪上一次的API参数,避免重复调用 + const prevApiParamsRef = useRef(''); + + // 在地图状态变化和Tab变化时加载数据 + useEffect(() => { + const params = buildApiParams(); + + // 如果没有必要的参数,不发送请求 + if (!params) { + console.log('缺少必要的日期参数,不加载环卫人员区域数据'); + return; + } + + // 参数签名,用于比较参数是否有实际变化 + const paramsSignature = JSON.stringify(params); + + // 检查参数是否真正变化,防止重复调用 + if (paramsSignature === prevApiParamsRef.current) { + console.log('环卫人员区域参数未变化,跳过重复加载'); + return; + } + + console.log('加载建筑垃圾-申报排放量数据,参数:', params); + // highFrequencyApi.callApi(params); + + // 更新上一次参数签名 + prevApiParamsRef.current = paramsSignature; + + }, [mapState.regionCode, memoizedRightPanelTime, currentTab, buildApiParams, highFrequencyApi]); + + return ( +
+ +
+ +
+
+ ) +} + +export default DeclaredEmission; \ No newline at end of file diff --git a/src/pages/Home_v_2504/components/SubPages/ConstructionWaste/components/LeftContent/ViolationDumpingLocation/index.less b/src/pages/Home_v_2504/components/SubPages/ConstructionWaste/components/LeftContent/ViolationDumpingLocation/index.less new file mode 100644 index 0000000000000000000000000000000000000000..38e9a1a0cc5109e3c29f46ae4b77c8583f14635e --- /dev/null +++ b/src/pages/Home_v_2504/components/SubPages/ConstructionWaste/components/LeftContent/ViolationDumpingLocation/index.less @@ -0,0 +1,16 @@ +.container { + width: 530px; + height: 311px; + background: linear-gradient(180.00deg, rgba(77, 107, 178, 0.3), rgba(8, 153, 255, 0.01) 100%); + border-radius: 15px; + // box-shadow: inset 0px 0px 23px 0px rgba(31, 87, 222, 0.5); + padding-bottom: 20px; + display: flex; + flex-direction: column; + } + + .content { + flex: 1; + margin-top: 10px; + overflow: hidden; + } \ No newline at end of file diff --git a/src/pages/Home_v_2504/components/SubPages/ConstructionWaste/components/LeftContent/ViolationDumpingLocation/index.tsx b/src/pages/Home_v_2504/components/SubPages/ConstructionWaste/components/LeftContent/ViolationDumpingLocation/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..846c7e6dd78151544b25bf828700f4e77dab9287 --- /dev/null +++ b/src/pages/Home_v_2504/components/SubPages/ConstructionWaste/components/LeftContent/ViolationDumpingLocation/index.tsx @@ -0,0 +1,277 @@ +import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react' +import styles from './index.less'; +import HncyCard from '@/pages/Home_v_2504/components/common/Card' +import AreaBarList, { AreaBarItem } from '@/components/V2504/AreaBarList' +import ModuleTitleWithTabs from '@/pages/Home_v_2504/components/common/ModuleTitleWithTabs' +import useLatestValue from '@/pages/Home_v_2504/hooks/useLatestValue'; +import { useDataType, useMapState } from '@/pages/Home_v_2504/components/MapStateContext'; +import useApiControl, { formatDateTime } from '@/pages/Home_v_2504/hooks/useApiControl'; +import { getDistrictHighFrequencyArea } from '@/services/CityProblem'; +import { CarAreaProps } from '@/pages/Home_v_2504/components/SubPages/Environment/components/LeftContent/components/CarArea'; +import { DeclaredEmissionProps } from '../DeclaredEmission'; + +// 类型定义 +export interface ViolationDumpingLocationProps { + dateType?: string; + dateRange?: { startTime: string; endTime: string }; + dataTypeKey?: string; +} + +// 区域类型定义 +export type AreaType = 'all' | 'urban' | 'central' | 'county'; +const ViolationDumpingLocation: React.FC = ({ + dateType, + dateRange, + dataTypeKey = '建筑垃圾' +}) => { + + // 地图状态 + const { mapState } = useMapState(); + const mapStateRef = useLatestValue(mapState); + + // 当前选中的区域类型 + const [currentTab, setCurrentTab] = useState('all'); + const currentTabRef = useLatestValue(currentTab); + + // 环卫人员区域数据 + // const [data, setData] = useState([]); + const [data, setData] = useState([ + { name: '锦江区', count: 456, percentage: 97.2 }, + { name: '金牛区', count: 400, percentage: 83.5 }, + { name: '成华区', count: 322, percentage: 70.8 }, + { name: '青羊区', count: 186, percentage: 65.6 }, + { name: '双流区', count: 152, percentage: 12.9 }, + { name: '武侯区', count: 122, percentage: 10.6 }, + { name: '龙泉驿区', count: 121, percentage: 10.5 }, + { name: '温江区', count: 120, percentage: 10.4 }, + { name: '新都区', count: 119, percentage: 10.3 }, + { name: '郫都区', count: 118, percentage: 10.2 }, + { name: '都江堰市', count: 117, percentage: 10.1 } + ]); + + // 处理Tab切换 + const handleTabChange = (tab: string) => { + setCurrentTab(tab as AreaType); + }; + + // 转换日期类型为API参数 + const translateDateType = useCallback((type: string) => { + switch (type) { + case 'year': return '1'; + case 'month': return '2'; + case 'day': return '3'; + case 'range': return '4'; + default: return '2'; // 默认月视图 + } + }, []); + + // 区域编码生成函数 + const getRegionCodes = (areaType: AreaType, regionCode: string) => { + // 默认所有区域 + if (areaType === 'all') { + return regionCode.length > 4 + ? regionCode + : regionCode === '5101' + ? '510104,510105,510106,510107,510108,510112,510113,510114,510115,510116,510117,510121,510129,510131,510132,510181,510182,510183,510184,510185' + : ''; + } + + // 城市新区 + if (areaType === 'urban') { + return '510112,510113,510114,510115,510116,510117'; + } + + // 中心城区 + if (areaType === 'central') { + return '510104,510105,510106,510107,510108'; + } + + // 县市新城 + if (areaType === 'county') { + return '510121,510129,510131,510132,510181,510182,510183,510184,510185'; + } + + return ''; + }; + + // 构建API请求参数 + const buildApiParams = useCallback(() => { + const currentMapState = mapStateRef.current; + + // 如果没有必要的时间参数,返回null表示不应该发起请求 + if (!currentMapState.leftPanelTime?.startTime || !currentMapState.leftPanelTime?.endTime) { + return null; + } + + // 使用当前时间类型,如果不存在则使用props或默认值 + const effectiveType = currentMapState.leftPanelTime.type || dateType || 'month'; + + // 基础参数对象 + const params: any = { + type: translateDateType(effectiveType) + }; + + // 处理日期参数 + if (effectiveType === 'range') { + params.customizeStart = formatDateTime(currentMapState.rightPanelTime.startTime); + params.customizeEnd = formatDateTime(currentMapState.rightPanelTime.endTime, true); + } else { + // 年、月、日视图使用time参数 + params.time = formatDateTime(currentMapState.rightPanelTime.startTime); + } + + // 获取区域编码列表 + const districtCodeList = getRegionCodes(currentTabRef.current, currentMapState.regionCode); + if (districtCodeList) { + params.districtCodeList = districtCodeList; + } + + // 处理区域参数 + if (currentMapState.regionCode === '5101') { + // 成都,这两个参数就不传 + params.districtCode = undefined; + params.streetCode = undefined; + } else if (currentMapState.regionCode.length === 6) { + // 区县级别 + params.districtCode = currentMapState.regionCode; + } else if (currentMapState.regionCode.length === 9) { + // 街道级别 + params.districtCode = currentMapState.regionCode.substring(0, 6); + params.streetCode = currentMapState.regionCode; + } + + // 使用传入的dataTypeKey获取对应的subTypeCode + params.subTypeCode = useDataType(dataTypeKey); + + return params; + }, [mapStateRef, currentTabRef, dateType, translateDateType, dataTypeKey]); + + // 使用useApiControl管理环卫人员区域API调用 + const highFrequencyApi = useApiControl({ + apiFunction: async (params) => { + console.log('发起环卫人员区域请求,参数:', params); + const response = await getDistrictHighFrequencyArea(params); + + if (response.code === 200 && response.data) { + return response.data; + } + + throw new Error('获取环卫人员区域数据失败'); + }, + onSuccess: (data) => { + if (!data || !Array.isArray(data) || data.length === 0) { + setData([]); + return; + } + + // 如果接口返回数据都是0,生成模拟数据 + // if (data.every(item => parseFloat(item.value) === 0 && parseFloat(item.percent) === 0)) { + // data = [ + // { name: '锦江区', value: 456, percent: '97.2' }, + // { name: '金牛区', value: 400, percent: '83.5' }, + // { name: '成华区', value: 322, percent: '70.8' }, + // { name: '青羊区', value: 186, percent: '65.6' }, + // { name: '双流区', value: 152, percent: '12.9' }, + // { name: '武侯区', value: 122, percent: '10.6' }, + // { name: '龙泉驿区', value: 121, percent: '10.5' }, + // { name: '温江区', value: 120, percent: '10.4' }, + // { name: '新都区', value: 119, percent: '10.3' }, + // { name: '郫都区', value: 118, percent: '10.2' }, + // { name: '都江堰市', value: 117, percent: '10.1' } + // ]; + // console.log('使用模拟环卫人员区域数据'); + // } + + // 转换接口返回的数据格式为图表需要的格式 + const formattedData = data.map((item: any) => ({ + name: item.name, + percentage: parseFloat(item.percent) || 0, + count: parseInt(item.value) || 0 + })); + + console.log('环卫人员区域数据成功:'); + setData(formattedData); + }, + onError: (error) => { + console.error('获取环卫人员区域数据出错:', error); + setData([]); + }, + apiName: '环卫人员区域', + debounceTime: 300, + cacheTime: 5000 // 缓存5秒,避免频繁刷新时重复请求 + }); + + // 使用 useMemo 跟踪 rightPanelTime 的实际变化 + const memoizedRightPanelTime = useMemo(() => { + return { + type: mapState.rightPanelTime.type, + startTime: mapState.rightPanelTime.startTime, + endTime: mapState.rightPanelTime.endTime + }; + }, [ + mapState.rightPanelTime.type, + mapState.rightPanelTime.startTime, + mapState.rightPanelTime.endTime + ]); + + // 跟踪上一次的API参数,避免重复调用 + const prevApiParamsRef = useRef(''); + + // 在地图状态变化和Tab变化时加载数据 + useEffect(() => { + const params = buildApiParams(); + + // 如果没有必要的参数,不发送请求 + if (!params) { + console.log('缺少必要的日期参数,不加载环卫人员区域数据'); + return; + } + + // 参数签名,用于比较参数是否有实际变化 + const paramsSignature = JSON.stringify(params); + + // 检查参数是否真正变化,防止重复调用 + if (paramsSignature === prevApiParamsRef.current) { + console.log('环卫人员区域参数未变化,跳过重复加载'); + return; + } + + console.log('加载建筑垃圾-疑似违规倾倒点位数据,参数:', params); + // highFrequencyApi.callApi(params); + + // 更新上一次参数签名 + prevApiParamsRef.current = paramsSignature; + + }, [mapState.regionCode, memoizedRightPanelTime, currentTab, buildApiParams, highFrequencyApi]); + + return ( +
+ +
+ +
+
+ ) +} + +export default ViolationDumpingLocation; \ No newline at end of file diff --git a/src/pages/Home_v_2504/components/SubPages/ConstructionWaste/components/LeftContent/index.tsx b/src/pages/Home_v_2504/components/SubPages/ConstructionWaste/components/LeftContent/index.tsx index c89be596233f73bf3d27d8ff3a7c1b7e44fa5af3..60e39c7c62df0280fac35d9d958b7e56e3f93afe 100644 --- a/src/pages/Home_v_2504/components/SubPages/ConstructionWaste/components/LeftContent/index.tsx +++ b/src/pages/Home_v_2504/components/SubPages/ConstructionWaste/components/LeftContent/index.tsx @@ -8,7 +8,8 @@ import CertificateOverview from './CertificateOverview'; import styles from './index.less'; import VehicleOverview from './VehicleOverview'; import DeclareDischargeType from './DeclareDischargeType'; - +import DeclaredEmission from './DeclaredEmission'; +import ViolationDumpingLocation from './ViolationDumpingLocation'; /** * 建筑垃圾左侧内容组件 */ @@ -51,12 +52,12 @@ const LeftContent: React.FC = () => { {/* 疑似违规倾倒点位 */} -
+
{/* 申报排放量 */} -
+
diff --git a/src/pages/Home_v_2504/components/common/ModuleTitleWithTabs/index.less b/src/pages/Home_v_2504/components/common/ModuleTitleWithTabs/index.less index 74610c5afce76cc093cc3e8ae86fefc24109821a..261755cf650e2269b4fa8f22d97ce28c0ccfeb58 100644 --- a/src/pages/Home_v_2504/components/common/ModuleTitleWithTabs/index.less +++ b/src/pages/Home_v_2504/components/common/ModuleTitleWithTabs/index.less @@ -6,26 +6,6 @@ width: 100%; } -// .titleWrapper { -// display: flex; -// align-items: center; -// } - -// .titleBar { -// width: 3px; -// height: 20px; -// background: linear-gradient(to bottom, #31C6FA, #23EBE2); -// margin-right: 10px; -// border-radius: 1.5px; -// } - -// .title { -// font-size: 18px; -// font-weight: 500; -// color: #FFFFFF; -// font-family: 'DingTalk JinBuTi'; -// } - .tabsContainer { display: flex; align-items: center; @@ -33,6 +13,9 @@ margin-right: 21px; margin-top: 15px; } +.compactTabsContainer { + margin-right: 8px; +} .tab { height: 28px; diff --git a/src/pages/Home_v_2504/components/common/ModuleTitleWithTabs/index.tsx b/src/pages/Home_v_2504/components/common/ModuleTitleWithTabs/index.tsx index 7e1716764ba5248c727ace0125b5043b2a854a19..2a5035cb492cae7456dc4c0a65c2104f4d28dac8 100644 --- a/src/pages/Home_v_2504/components/common/ModuleTitleWithTabs/index.tsx +++ b/src/pages/Home_v_2504/components/common/ModuleTitleWithTabs/index.tsx @@ -17,6 +17,7 @@ export interface ModuleTitleWithTabsProps { className?: string; // 是否启用区县级别检测,启用后当区域为区县级时隐藏子筛选 enableDistrictCheck?: boolean; + isCompact?: boolean; } const ModuleTitleWithTabs: React.FC = ({ @@ -25,7 +26,8 @@ const ModuleTitleWithTabs: React.FC = ({ activeKey, onTabChange, className, - enableDistrictCheck = false + enableDistrictCheck = false, + isCompact = false }) => { // 获取地图状态以检查当前区域级别 const { mapState } = useMapState(); @@ -51,7 +53,9 @@ const ModuleTitleWithTabs: React.FC = ({ /> {shouldShowTabs && ( -
+
{tabs.map(tab => (