From 8119fdca34624e0654276fb080880c470ec3ca4e Mon Sep 17 00:00:00 2001 From: lijingqi <1437862981@qq.com> Date: Fri, 10 Jan 2025 17:48:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modals/UrbanOperation/index.less | 32 +++++---- .../modals/UrbanOperation/index.tsx | 72 +++++++++++++------ src/services/CityProblem.ts | 14 +++- 3 files changed, 81 insertions(+), 37 deletions(-) diff --git a/src/pages/GlobalModalServices/modals/UrbanOperation/index.less b/src/pages/GlobalModalServices/modals/UrbanOperation/index.less index 49ad1c65..9e563acd 100644 --- a/src/pages/GlobalModalServices/modals/UrbanOperation/index.less +++ b/src/pages/GlobalModalServices/modals/UrbanOperation/index.less @@ -30,22 +30,26 @@ width: calc(100% - 440px); } - .searchBox { - position: absolute; - top: -75px; - left: 300px; - - :global { - .ant-select-selector { - background: transparent !important; - border: none !important; + +} + +.searchBox { + + // top: -35px; + // left: 300px; + // z-index: 9999; + margin-left: 30px; + + :global { + .ant-select-selector { + background: transparent !important; + border: none !important; + color: #fff; + font-size: 20px; + + .ant-select-selection-placeholder { color: #fff; font-size: 20px; - - .ant-select-selection-placeholder { - color: #fff; - font-size: 20px; - } } } } diff --git a/src/pages/GlobalModalServices/modals/UrbanOperation/index.tsx b/src/pages/GlobalModalServices/modals/UrbanOperation/index.tsx index fb9eeb9e..e5acd580 100644 --- a/src/pages/GlobalModalServices/modals/UrbanOperation/index.tsx +++ b/src/pages/GlobalModalServices/modals/UrbanOperation/index.tsx @@ -73,10 +73,10 @@ const UrbanOperation = ({ const [areaStatistics, setAreaStatistics] = useState([]); // 获取左侧顶部事件相关统计 - const getCityStatistics = (value?: string) => { + const getCityStatistics = () => { const params = { sourceSystemCodeY: fetchParams.current.sourceSystemCodeY, - sourceSystemCode, + sourceSystemCode: fetchParams.current.sourceSystemCode, type: datetType, time, }; @@ -95,7 +95,7 @@ const UrbanOperation = ({ category: category, top: 3, sourceSystemCodeY: fetchParams.current.sourceSystemCodeY, - sourceSystemCode, + sourceSystemCode: fetchParams.current.sourceSystemCode, type: datetType, time, }; @@ -111,12 +111,12 @@ const UrbanOperation = ({ }; // 高发类别统计 - const getAreaAnalysis = (value?: string) => { + const getAreaAnalysis = () => { const params = { region: 'district', top: 3, sourceSystemCodeY: fetchParams.current.sourceSystemCodeY, - sourceSystemCode, + sourceSystemCode: fetchParams.current.sourceSystemCode, type: datetType, time, }; @@ -148,7 +148,14 @@ const UrbanOperation = ({ }, ); }; - + const { data: lineDataV1, run: getLineData } = useRequest(() => + services.CityProblemApi.getSourceSystemTrend({ + sourceSystemCodeY: fetchParams.current.sourceSystemCodeY, + sourceSystemCode: fetchParams.current.sourceSystemCode, + type: datetType, + time, + }), + ); const changeListTab = (value: string) => { fetchParams.current.caseStatus = value; fetchParams.current.page = 1; @@ -172,29 +179,29 @@ const UrbanOperation = ({ const options = Object.entries(data?.all).map((item) => { return { label: item[1], value: item[0] }; }); - setCaseSourceOptions([ - { label: '全部来源', value: 'all' }, - ...options, - ]); + setCaseSourceOptions([{ label: '全部来源', value: 'all' }, ...options]); } if (sourceType && sourceType === 'wnywxt') { const options = data?.wnywxt?.map((item) => ({ ...item, label: item?.name, })); - setCaseSourceOptions([ - { label: '全部来源', value: 'all' }, - ...options, - ]); + setCaseSourceOptions([{ label: '全部来源', value: 'all' }, ...options]); } }, }); const onChangeCaseSource = (value: string) => { console.log(value); - + // setSourceSystemCode(value); - fetchParams.current.sourceSystemCodeY = value=='all'?undefined:value; + if (sourceType === 'all') { + fetchParams.current.sourceSystemCode = value == 'all' ? undefined : value; + } else { + fetchParams.current.sourceSystemCodeY = + value == 'all' ? undefined : value; + } + fetchParams.current.caseStatus = ''; fetchParams.current.eventType = ''; fetchParams.current.page = 1; @@ -205,10 +212,11 @@ const UrbanOperation = ({ page: 1, hasNext: false, }); - getCityStatistics(value); + getCityStatistics(); getCategoryAnalysis(); - getAreaAnalysis(value); + getAreaAnalysis(); getEventsList(); + getLineData() }; useEffect(() => { getCityStatistics(); @@ -216,10 +224,30 @@ const UrbanOperation = ({ getAreaAnalysis(); getEventsList(); }, []); - + useEffect(() => { + if (showSourceSelect) { + modalDispatch.setOptions({ + headerLeft: () => { + return ( +