diff --git a/src/assets/images/openIcon.png b/src/assets/images/openIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..067f6795f6a8cc7a6f0da6cbc126a4784d7ed9e3 Binary files /dev/null and b/src/assets/images/openIcon.png differ diff --git a/src/assets/images/packUpIcon.png b/src/assets/images/packUpIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..57dce329f10dc11d1b773a32c26a0f87fe06807a Binary files /dev/null and b/src/assets/images/packUpIcon.png differ diff --git a/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DistributionChart/index.less b/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DistributionChart/index.less index 9e22cb9b7ad45de6e81b7e2afc91358373d1e8ca..2105035f3bea8ada62faef20025fc0ef7bf28c0c 100644 --- a/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DistributionChart/index.less +++ b/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DistributionChart/index.less @@ -34,7 +34,7 @@ } .ant-tabs-tab-active .ant-tabs-tab-btn { - color: #CBEDFF; + color: rgb(255, 255, 255) !important; } .ant-tabs-ink-bar { diff --git a/src/pages/GlobalModalServices/modals/ConstructionWaste/components/StatisticsChart/index.tsx b/src/pages/GlobalModalServices/modals/ConstructionWaste/components/StatisticsChart/index.tsx index bfa68dac18fab628d88282de1edefa47d2ddf098..faf568f9a9e6681157cae8e629b1ba4f38da1a7a 100644 --- a/src/pages/GlobalModalServices/modals/ConstructionWaste/components/StatisticsChart/index.tsx +++ b/src/pages/GlobalModalServices/modals/ConstructionWaste/components/StatisticsChart/index.tsx @@ -83,7 +83,12 @@ const StatisticsChart: React.FC = ({ searchTime }) => { percentage: ((gclj / total) * 100).toFixed(2), color: '#77E67B', }, - { name: '拆除垃圾', value: cclj, percentage: ((cclj / total) * 100).toFixed(2), color: '#00FFB3' }, + { + name: '拆除垃圾', + value: cclj, + percentage: (((cclj / total)) * 100).toFixed(2), + color: '#00FFB3', + }, ]; }, [charData, total]); diff --git a/src/pages/GlobalModalServices/modals/LivingGarbage/PopoverCard/index.less b/src/pages/GlobalModalServices/modals/LivingGarbage/PopoverCard/index.less new file mode 100644 index 0000000000000000000000000000000000000000..c360ddbb27dbf37eae9ee496e9b5900374345054 --- /dev/null +++ b/src/pages/GlobalModalServices/modals/LivingGarbage/PopoverCard/index.less @@ -0,0 +1,155 @@ +.container { + position: relative; + background: rgba(27, 124, 181, 0.2); + width: 382x; + height: 229px; + padding: 10px 10px; + + .title { + font-size: 24px; + color: rgb(255, 255, 255); + font-family: DingTalk JinBuTi; + width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + + .header { + display: flex; + align-items: center; + + .cqiWarp { + display: flex; + align-items: center; + + .cqi { + display: flex; + align-items: center; + font-size: 38px; + font-weight: 700; + + .tag { + font-size: 14px; + margin-left: 10px; + margin-right: 10px; + padding: 0 5px; + border-radius: 5px; + } + } + } + + .title { + font-size: 22px; + font-weight: 700; + color: #b3d6f7; + font-family: DingTalk JinBuTi; + + } + + .compare { + font-size: 18px; + display: flex; + + .tips { + color: #fff; + } + + .compareNum { + color: #57ef58; + } + } + + .title_time { + color: rgb(217, 217, 217); + font-size: 18px; + font-weight: 400; + } + } + + + .fx { + display: flex; + margin-top: 30px; + + .countWarp { + font-size: 16px; + color: rgb(255, 255, 255); + display: flex; + align-items: center; + width: 50%; + + .count { + font-size: 24px; + background: linear-gradient(to bottom, rgb(170, 255, 246), rgb(37, 187, 255)); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-clip: text; + font-weight: 700; + margin-left: 5px; + margin-right: 5px; + } + } + } + + .cardSection { + margin-top: 20px; + display: flex; + justify-content: space-between; + + .card { + width: 100px; + height: 76px; + border-radius: 14px; + cursor: pointer; + padding: 10px; + + .name { + font-size: 18px; + color: #fff; + line-height: 1; + text-align: center; + margin-bottom: 10px; + } + + .value { + font-size: 28px; + line-height: 1; + font-weight: 700; + font-family: D-DIN; + text-align: center; + } + } + } + + .btnWarp { + display: flex; + align-items: center; + justify-content: center; + + .checkBtn { + border-radius: 25px; + background: linear-gradient(180deg, + rgb(28, 192, 255), + rgb(82, 148, 255) 100%); + width: 106px; + + color: rgb(255, 255, 255); + + font-size: 18px; + text-align: center; + line-height: 40px; + margin-top: 32px; + cursor: pointer; + } + } + + .close { + position: absolute; + right: 10px; + top: 10px; + + } + + +} \ No newline at end of file diff --git a/src/pages/GlobalModalServices/modals/LivingGarbage/PopoverCard/index.tsx b/src/pages/GlobalModalServices/modals/LivingGarbage/PopoverCard/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..d0bd26e7e8f9b7ec0c454bc192ec32c693d408c1 --- /dev/null +++ b/src/pages/GlobalModalServices/modals/LivingGarbage/PopoverCard/index.tsx @@ -0,0 +1,61 @@ +import { Descriptions } from 'antd'; +import React, { useMemo } from 'react'; +import styles from './index.less'; +interface PropsType { + data: DistrictAPI.RealtimeIndexDTO; +} +/** @name 气泡卡片 */ +const PopoverCard: React.FC = (props) => { + const { data } = props; + const items = useMemo(() => { + return [ + { + key: '1', + label: '管理单位:', + children:data?.manageunitname, + }, + { + key: '2', + label: '所在位置:', + children:data?.address, + }, + { + key: '3', + label: '建设时间:', + children:data?.jcsscreatetime, + }, + { + key: '4', + label: '处理能力(万吨):', + children:data?.czcln, + }, + ]; + }, [data]); + return ( +
+
{data?.czcmc || 'dadadadad'}
+
+ +
+ + +
+ ); +}; + +export default PopoverCard; diff --git a/src/pages/GlobalModalServices/modals/LivingGarbage/index.less b/src/pages/GlobalModalServices/modals/LivingGarbage/index.less index f5a12b818ef70070f32ecb91b5238839c4fdf526..00dbf898302d2ced714e1bf6a97230c4640c0a78 100644 --- a/src/pages/GlobalModalServices/modals/LivingGarbage/index.less +++ b/src/pages/GlobalModalServices/modals/LivingGarbage/index.less @@ -1,8 +1,8 @@ .container { display: flex; gap: 20px; -// padding: 0 20px 0 20px; -// padding: 20px; + // padding: 0 20px 0 20px; + // padding: 20px; .leftContent { width: 577px; @@ -63,7 +63,7 @@ } .disposalStatus { - height: 676px; + height: 865px; background: rgba(57, 122, 183, 0.2); border-radius: 20px; padding: 27px; @@ -199,15 +199,15 @@ } .listContent { - height: 370px; + height: 545px; overflow-y: auto; - + .listItem { display: flex; align-items: center; margin-bottom: 15px; padding-left: 9px; - + .name { color: rgb(228, 237, 255); font-family: 思源黑体; @@ -215,13 +215,16 @@ font-weight: 400; line-height: 29px; width: 200px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; } - + .progress { width: 165px; margin: 0 15px; } - + .value { color: rgb(89, 238, 255); font-family: D-DIN; @@ -248,8 +251,8 @@ z-index: 1; padding: 15px; background: rgba(12, 60, 112, 0.7); - border-radius: 20px ; - // backdrop-filter: blur(20px); + border-radius: 20px; + // backdrop-filter: blur(20px); .mapTitle { position: absolute; @@ -306,6 +309,42 @@ line-height: 21px; } } + + .treeTitle { + display: flex; + align-items: center; + width: 150px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + + img { + margin-right: 5px; + width: 19px; + height: 18px; + + } + } + + :global { + .ant-tree { + background-color: rgba(12, 60, 112, 0.135) !important; + } + + .ant-tree .ant-tree-switcher { + display: none !important; + } + + .ant-tree .ant-tree-checkbox .ant-tree-checkbox-inner { + background-color: #48779d88 !important; + border: #99fdfa 1px solid !important; + } + + .ant-tree-node-content-wrapper.ant-tree-node-selected, + .ant-tree-checkbox+span.ant-tree-node-selected { + background-color: rgba(12, 60, 112, 0.197) !important; + } + } } .collapseBtn { @@ -324,31 +363,32 @@ cursor: pointer; z-index: 3; transition: all 0.3s; - + .btnText { - display: flex; - flex-direction: column; - align-items: center; - - span { - color: rgb(179, 214, 247); - font-size: 18px; - font-weight: 400; - line-height: 24px; - } + display: flex; + flex-direction: column; + align-items: center; + + span { + color: rgb(179, 214, 247); + font-size: 18px; + font-weight: 400; + line-height: 24px; + } } .collapseIcon { - color: rgb(179, 214, 247); - font-size: 12px; - transition: all 0.3s; + color: rgb(179, 214, 247); + font-size: 12px; + transition: all 0.3s; } &.collapsed { - right: 0; - .collapseIcon { - transform: rotate(180deg); - } + right: 0; + + .collapseIcon { + transform: rotate(180deg); + } } } @@ -368,18 +408,18 @@ background: rgba(12, 60, 112, 0.7); border-radius: 20px 0px 0px 20px; backdrop-filter: blur(20px); - + &.collapsed { width: 0px; - + .listContent { display: none; } - + .listTitle { display: none; } - + .collapseBtn { transform: rotate(180deg); @@ -402,7 +442,7 @@ align-items: center; padding: 0 16px; position: relative; - // border-bottom: 1px solid rgba(67, 131, 182, 0.7); + // border-bottom: 1px solid rgba(67, 131, 182, 0.7); .listTitle { color: #fff; @@ -413,7 +453,7 @@ } .listContent { - // padding: 0 16px; + // padding: 0 16px; height: calc(100% - 50px); overflow-y: auto; @@ -427,11 +467,11 @@ cursor: pointer; justify-content: space-between; - background: rgba(67, 177, 255, 0.37); + background: #113e73; border-radius: 18px; - + &:hover { - background: rgba(37, 187, 255, 0.1); + background: #1f5e99; } .name { @@ -457,8 +497,120 @@ } } } + + .itemWrap { + + .item { + padding: 0 31px; + height: 60px; + display: flex; + align-items: center; + border-radius: 18px; + // padding: 10px 20px; + margin: 10px 20px; + cursor: pointer; + justify-content: space-between; + + + + + &:hover { + background: #1f5e99; + } + + .name { + color: #E4EDFF; + font-size: 20px; + font-weight: 700; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + flex: 1; + } + + .locationIcon { + width: 20px; + height: 20px; + cursor: pointer; + margin-left: 10px; + opacity: 0.8; + transition: opacity 0.3s; + + + } + } + } + + } + } + + .markWrap { + width: 130px; + height: 90px; + cursor: pointer; + + .name { + width: 100%; + height: 40px; + background-color: rgb(30, 37, 84); + border-radius: 10px; + padding: 0 10px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + line-height: 40px; + } + + .iconWrap { + width: 100%; + display: flex; + justify-content: center; + margin-top: 10px; + + img { + width: 40px; + height: 40px; + } } } } } -} \ No newline at end of file +} + +.window { + box-sizing: border-box; + border: 2px solid rgba(64, 146, 217, 0.95); + border-radius: 10px; + background: rgb(3, 85, 135); + width: 180px; + + &::after { + position: absolute; + content: ''; + /**三角形 */ + width: 0; + height: 0; + border-style: solid; + border-width: 10px 10px 0 10px; + border-color: rgb(3, 85, 135) transparent transparent transparent; + bottom: -7px; + left: 50%; + transform: translateX(-50%); + z-index: 999; + } + + &::before { + position: absolute; + content: ''; + /**三角形 */ + width: 0; + height: 0; + border-style: solid; + border-width: 10px 10px 0 10px; + border-color: rgba(64, 146, 217, 0.95) transparent transparent transparent; + bottom: -10px; + left: 50%; + transform: translateX(-50%); + z-index: 998; + } +} \ No newline at end of file diff --git a/src/pages/GlobalModalServices/modals/LivingGarbage/index.tsx b/src/pages/GlobalModalServices/modals/LivingGarbage/index.tsx index d56a3238f17df13d467bd09e2fc4a488f12b410a..8ae6b247b73f66da82075eabe524c8b69bb75093 100644 --- a/src/pages/GlobalModalServices/modals/LivingGarbage/index.tsx +++ b/src/pages/GlobalModalServices/modals/LivingGarbage/index.tsx @@ -1,120 +1,170 @@ -import { Progress } from 'antd'; -import ReactEcharts from 'echarts-for-react'; -import React, { useRef, useState } from 'react'; -import CooglMap from '@/components/CooglMap'; -import styles from './index.less'; import livingGarbageIcon from '@/assets/images/livingGarbage.png'; -import livingGarbageMap1 from '@/assets/images/livingGarbageMap1.png'; -import livingGarbageMap2 from '@/assets/images/livingGarbageMap2.png'; -import { RightOutlined, EnvironmentOutlined } from '@ant-design/icons'; import locationIcon from '@/assets/images/location.png'; +import openIcon from '@/assets/images/openIcon.png'; +import packUpIcon from '@/assets/images/packUpIcon.png'; +import CooglMap from '@/components/CooglMap'; +import services from '@/services'; +import { convertUnits } from '@/utils/ui'; +import { RightOutlined } from '@ant-design/icons'; +import { useRequest } from 'ahooks'; +import { Progress, Tree } from 'antd'; +import dayjs from 'dayjs'; +import React, { useMemo, useRef, useState } from 'react'; +import styles from './index.less'; +import PopoverCard from './PopoverCard'; const LivingGarbage: React.FC = () => { const [isListVisible, setIsListVisible] = useState(true); const mapRef = useRef(); + const [expand, setExpand] = useState(); + const [areaSelectd, setAreaSelectd] = useState(undefined); + const [checkedKeys, setCheckedKeys] = useState(['生活垃圾末端处置设施']); + let isUsingValue = true; - let isUsingValue = false; - - // 地图配置 -// const mapConfig = { -// center: [104.06, 30.67], -// zoom: 10, -// minZoom: 9, -// maxZoom: 18, -// pitch: 0, -// }; - - // 环形进度图配置 - const getOption = () => ({ - series: [{ - type: 'gauge', - startAngle: 90, - endAngle: -270, - pointer: { show: false }, - progress: { - show: true, - overlap: false, - roundCap: true, - clip: false, - itemStyle: { - color: '#52FF76' - } + const searchTime = { + startTime: dayjs().startOf('month').format('YYYY-MM-DD'), + endTime: dayjs().endOf('month').format('YYYY-MM-DD'), + }; + + const { data: infoData } = useRequest(() => + services.DataBase.getSjdzInfoData({ + typeCode: 'zzcc-shlj-czzl', + params: { + ...searchTime, }, - axisLine: { - lineStyle: { - width: 6, - color: [[1, 'rgba(191, 225, 255, 0.26)']] - } + }).then((res) => { + if (res.code === 200) { + return res?.data?.data?.records?.[0]; + } + throw new Error('获取数据失败'); + }), + ); + + const { data: burnData } = useRequest(() => + services.DataBase.getSjdzInfoData({ + typeCode: 'zzcc-shlj-gfscczl', + params: { + ...searchTime, }, - splitLine: { show: false }, - axisTick: { show: false }, - axisLabel: { show: false }, - data: [{ value: 78.56 }], - detail: { show: false } - }] - }); - - 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 : '--' }, - { name: isUsingValue ? '万兴环保发电厂一期' : '--', value: isUsingValue ? 22.33 : '--' }, - { name: isUsingValue ? '金堂环保发电厂' : '--', value: isUsingValue ? 22.33 : '--' }, - ]; - - // 模拟管廊列表数据 - 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 ? '填埋场2' : '--', location: { x: 103.96, y: 30.658842 } }, - ]; + }).then((res) => { + if (res.code === 200) { + return res?.data?.data?.records; + } + throw new Error('获取数据失败'); + }), + ); + + const { data: typeData } = useRequest(() => + services.DataBase.getSjdzInfoData({ + typeCode: 'zzcc-shlj-ljclslb', + }).then((res) => { + if (res.code === 200) { + return res?.data?.data?.records; + } + throw new Error('获取数据失败'); + }), + ); + + const { data: pointData } = useRequest(() => + services.DataBase.getSjdzInfoData({ + typeCode: 'zzcc-shlj-ljcfylb', + params: { + pageNo: 0, + pageSize: 50, + }, + }).then((res) => { + if (res.code === 200) { + return res?.data?.data?.records?.[0]?.list; + } + throw new Error('获取数据失败'); + }), + ); + + const { runAsync: getDetails } = useRequest( + services.DataBase.getSjdzInfoData, + { manual: true }, + ); + const treeData = useMemo(() => { + setCheckedKeys(typeData?.map((item) => item?.czclx)); + return [ + { + title: '生活垃圾末端处置设施', + key: '生活垃圾末端处置设施', + children: typeData?.map((item) => ({ + title: ( +
+ + {item?.czclx} +
+ ), + key: item?.czclx, + })), + }, + ]; + }, [typeData]); + + const leftList = useMemo(() => { + return typeData?.map((item) => ({ + ...item, + children: pointData?.filter((it: any) => item?.czclx === it.czclx), + })); + }, [typeData, pointData]); // 定位功能 - const handleLocation = (location: { x: number; y: number }) => { - mapRef.current?.setCenter([location.x, location.y]); + const handleLocation = async(location: { x: number; y: number }) => { + try { + const res = await getDetails({ + typeCode: 'zzcc-shlj-ljcfylb', + params: { + czcid: location?.czcid, + }, + }); + mapRef?.current?.flyTo({ + destination: { + x: Number(location?.longitude), + y: Number(location?.latitude), + z: 23961, + }, + orientation:{ + pitch: 20, + } + }); + + setAreaSelectd(res?.data?.data?.records?.[0]?.list?.[0]); + } catch (error) { + console.log(error); + } + }; + return (
- {/* 资源化利用率 */} -
-
资源化利用率
-
2024年12月
-
{isUsingValue ? 78.56 : '--'}
- % -
- -
-
- {/* 生活垃圾处置情况 */}
生活垃圾处置情况
-
2024年12月
- +
{dayjs().format('YYYY年MM月')}
+
垃圾处理 处置总量 - {isUsingValue ? 187.25 : '--'} + {infoData?.total ?? '--'} 万吨
焚烧量
-
{isUsingValue ? 17.25 : '--'}
+
{infoData?.fsl ?? '--'}
万吨
填埋量
-
{isUsingValue ? 156.21 : '--'}
+
{infoData?.tml ?? '--'}
万吨
@@ -125,18 +175,26 @@ const LivingGarbage: React.FC = () => { 单位:万吨
- {disposalList.map((item, index) => ( + {burnData?.map((item: any, index: number) => (
- {item.name} - - {isUsingValue ? item.value : '--'} + + {item?.name} + + + + {convertUnits(item?.czl)?.num} +
))}
@@ -145,7 +203,10 @@ const LivingGarbage: React.FC = () => {
-
+
{ center={{ x: 103.96, y: 30.658842 }} mode="3D" > + {pointData + ?.filter((it) => checkedKeys?.includes(it.czclx)) + ?.map((item) => { + return ( + { + try { + const res = await getDetails({ + typeCode: 'zzcc-shlj-ljcfylb', + params: { + czcid: item.czcid, + }, + }); + console.log(res); + + setAreaSelectd(res?.data?.data?.records?.[0]?.list?.[0]); + } catch (error) { + console.log(error); + } + }} + > +
+
+ {item?.czcmc} +
+
+ +
+
+
+ ); + })} + + {areaSelectd && ( + { + setAreaSelectd(undefined); + }} + > +
+ +
+
+ )} + {/* 地图标题 - 移到地图内部 */}
生活垃圾处置厂分布
图层图例
-
- 环保发电厂 - 环保发电厂 -
-
- 填埋场 - 填埋场 -
+ + {typeData?.length ? ( + { + setCheckedKeys(e); + }} + checkedKeys={checkedKeys} + treeData={treeData} + /> + ) : null}
- {/* 右侧列表 */} - {/* 收起按钮独立放置 */} -
setIsListVisible(!isListVisible)} + {/* 右侧列表 */} + {/* 收起按钮独立放置 */} +
setIsListVisible(!isListVisible)} > - {isListVisible &&( + {isListVisible && (
- - + +
- )} - + )} +
-
+
-
生活垃圾处置厂列表
+
- {pipelineList.map((item, index) => ( -
- {item.name} - handleLocation(item.location)} - alt="定位" - /> -
- ))} + {leftList?.map((item, index) => { + return ( +
+
{ + if (expand === item?.czclx) { + setExpand(undefined); + return; + } + + setExpand(item?.czclx); + }} + > + {item?.czclx}{`(${item?.children?.length})`} + 定位 +
+ {expand === item?.czclx && ( +
+ {item?.children?.map((it, index) => ( +
handleLocation(it)} + > + + {it?.czcmc} + + 定位 +
+ ))} +
+ )} +
+ ); + })}
@@ -211,4 +371,4 @@ const LivingGarbage: React.FC = () => { ); }; -export default LivingGarbage; \ No newline at end of file +export default LivingGarbage; diff --git a/src/pages/NewHome/MapCantainer/DistrictMap/PopoverCard/index.less b/src/pages/NewHome/MapCantainer/DistrictMap/PopoverCard/index.less new file mode 100644 index 0000000000000000000000000000000000000000..3ef9edaf36ceebbdf78a0251be198c3adb38d4b2 --- /dev/null +++ b/src/pages/NewHome/MapCantainer/DistrictMap/PopoverCard/index.less @@ -0,0 +1,133 @@ +.container { + position: relative; + height: 278px; + width: 463px; + z-index: 1; + + .bg { + content: ''; + position: absolute; + inset: 0; + -webkit-backdrop-filter: blur(10px); + z-index: 0; + border-radius: 15px; + backdrop-filter: blur(10px); + background-color: rgba(27, 124, 181, 0.8); + } + + .close { + position: absolute; + right: 10px; + z-index: 1; + top: 10px; + } + + .topBox { + height: 116px; + border-radius: 15px 15px 0px 0px; + background: rgba(9, 195, 92, 0.8); + z-index: 1; + padding: 15px 18px; + position: relative; + } + + .bottomBox { + height: 162px; + position: relative; + padding: 15px 18px; + font-size: 16px; + font-weight: 400; + z-index: 1; + } + + .flex { + flex-direction: row; + display: flex; + align-items: center; + } + + .leftBox_title { + color: rgb(255, 255, 255); + font-family: DingTalk JinBuTi; + font-size: 28px; + } + + .leftBox_cqi { + color: rgb(255, 255, 255); + + font-size: 16px; + line-height: 1; + } + + .leftBox_value { + font-family: D-DIN; + font-size: 38px; + margin-left: 13px; + margin-right: 8px; + line-height: 1; + color: rgb(255, 255, 255); + } + + .leftBox_status { + color: rgb(217, 217, 217); + font-size: 16px; + } + + .checkBtn { + border-radius: 25px; + background: linear-gradient( + 180deg, + rgb(28, 192, 255), + rgb(82, 148, 255) 100% + ); + width: 106px; + + color: rgb(255, 255, 255); + + font-size: 16px; + text-align: center; + line-height: 40px; + + cursor: pointer; + // align-items: center; + margin: 0 auto; + margin-top: 10px; + } + + .rightValue { + color: rgb(9, 195, 92); + font-family: D-DIN; + font-size: 28px; + } +} + +.info { + flex-direction: row; + display: flex; + gap: 48px; +} + +.item { +} + +.value { + color: rgb(155, 255, 252); + font-family: D-DIN; + font-size: 34px; + line-height: 1; + font-weight: 700; +} + +.infoFlex { + display: flex; + flex-direction: row; + gap: 8px; + align-items: flex-end; +} + +.status { + display: flex; + margin-left: 22px; + flex-direction: row; + align-items: center; +} diff --git a/src/pages/NewHome/MapCantainer/DistrictMap/PopoverCard/index.tsx b/src/pages/NewHome/MapCantainer/DistrictMap/PopoverCard/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..62d2fcd6c2f547eb445eabc65d214b255af280d1 --- /dev/null +++ b/src/pages/NewHome/MapCantainer/DistrictMap/PopoverCard/index.tsx @@ -0,0 +1,80 @@ +import { getCqiStatusTexts } from '@/utils/ui'; +import { CaretDownOutlined, CaretUpOutlined } from '@ant-design/icons'; +import React from 'react'; +import styles from './index.less'; + +interface PropsType { + data: DistrictAPI.RealtimeIndexDTO; +} +/** @name 气泡卡片 */ +const PopoverCard: React.FC = (props) => { + const { data } = props; + return ( +
+
+
+
{data.objectName}
+
+
实时CQI
+
+ {Number(data?.qualitySign)} +
+
+ {getCqiStatusTexts(Number(data?.qualitySign))?.desc} +
+
+
较5分钟前
+ {data.status === 'up' ? ( + + ) : ( + + )} +
+ {data?.diffValue ?? 0} +
+
+
+
+
+
+
+
+
{data?.eventCount ?? 0}
+
+
+
当前问题总数
+
+
+
+
0
+
+
+
安全风险
+
+
+ +
+ 查看详情 +
+
+ +
+ +
+
+ ); +}; + +export default PopoverCard; diff --git a/src/pages/NewHome/MapCantainer/DistrictMap/PopoverCardKnotty/index.less b/src/pages/NewHome/MapCantainer/DistrictMap/PopoverCardKnotty/index.less new file mode 100644 index 0000000000000000000000000000000000000000..59cbabaa061a1a5d17b00ce310087e08d36c8e00 --- /dev/null +++ b/src/pages/NewHome/MapCantainer/DistrictMap/PopoverCardKnotty/index.less @@ -0,0 +1,89 @@ +.container { + position: relative; + background: rgba(27, 124, 181, 0.2); + width: 453px; + height: 406px; +padding: 10px 10px; + .title { + font-size: 24px; + color: rgb(255, 255, 255); + font-family: DingTalk JinBuTi; + width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } +.imgWarp{ + position: relative; + .img { + margin-top: 20px; + width: 100%; + height: 177px; + border-radius: 10px; + } + .tag { + position: absolute; + left:10px; + bottom: 10px; + display: inline-block; + width: 83px; + height: 24px; + border-radius: 12px; + background: linear-gradient(180deg, + rgba(26, 66, 110, 0), + rgb(122, 94, 111) 100%); + color: #ff7a7a; + text-align: center; + font-size: 16px; + line-height: 23px; + margin: 0 10px 0 20px; + background-size: 100% 100%; + } + .tag1{ + position: absolute; + left:10px; + bottom: 10px; + display: inline-block; + padding: 0 5px; + height: 24px; + border-radius: 12px; + background: rgba(26, 67, 110, 0.419); + + text-align: center; + font-size: 16px; + line-height: 23px; + margin: 0 10px 0 20px; + background-size: 100% 100%; + } +} + .btnWarp{ + display: flex; + align-items: center; + justify-content: center; + + .checkBtn { + border-radius: 25px; + background: linear-gradient(180deg, + rgb(28, 192, 255), + rgb(82, 148, 255) 100%); + width: 106px; + + color: rgb(255, 255, 255); + + font-size: 18px; + text-align: center; + line-height: 40px; + margin-top: 20px; + cursor: pointer; + } + } + + .close { + position: absolute; + right: 10px; + top: 10px; + + } + + +} \ No newline at end of file diff --git a/src/pages/NewHome/MapCantainer/DistrictMap/PopoverCardKnotty/index.tsx b/src/pages/NewHome/MapCantainer/DistrictMap/PopoverCardKnotty/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..f47b57b15d91993706b8ced4f02733257a4285f4 --- /dev/null +++ b/src/pages/NewHome/MapCantainer/DistrictMap/PopoverCardKnotty/index.tsx @@ -0,0 +1,115 @@ +import blueBg from '@/assets/images/SecurityServiceOverview/right/blueBg.png'; +import orangeBg from '@/assets/images/SecurityServiceOverview/right/orangeBg.png'; +import redBg from '@/assets/images/SecurityServiceOverview/right/redBg.png'; +import yellowBg from '@/assets/images/SecurityServiceOverview/right/yellowBg.png'; +import LabelImgText from '@/components/LabelImgText'; +import { joinPictureHttp } from '@/utils/comm'; +import React, { CSSProperties } from 'react'; +import styles from './index.less'; +interface PropsType { + data: DistrictAPI.RealtimeIndexDTO; +} +/** @name 气泡卡片 */ +const PopoverCardKnotty: React.FC = (props) => { + const { data } = props; + const colorConfig: Record< + string, + { + color: CSSProperties['color']; + bg: string; + icon: string; + } + > = { + 红色风险: { + //红色风险 + color: '#FFBCBC', + bg: redBg, + icon: 'redIcon', + }, + 橙色风险: { + //橙色风险 + color: '#FDDFCE', + bg: orangeBg, + icon: 'orangeIcon', + }, + 黄色风险: { + //黄色风险 + color: '#FFE892', + bg: yellowBg, + icon: 'yellowIcon', + }, + 一般风险: { + //一般风险 + color: '#BFE4FF', + bg: blueBg, + icon: 'blueIcon', + }, + }; + console.log(data); + const valueStyle = { + color: '#fff', + fontSize: 16, + }; + const labelStyle = { + color: '#CBEDFF', + fontSize: 16, + }; + return ( +
+
+ {data?.standardEventTitle || '道路交通设施'} +
+
+ + {/*
+ {data?.risklevel} +
*/} +
{data?.caseStatusText}
+
+
+ + +
+
+
+ 查看详情 +
+
+ + +
+ ); +}; + +export default PopoverCardKnotty; diff --git a/src/pages/NewHome/MapCantainer/DistrictMap/PopoverCardWarn/index.less b/src/pages/NewHome/MapCantainer/DistrictMap/PopoverCardWarn/index.less new file mode 100644 index 0000000000000000000000000000000000000000..81b84616e914ed5b4b93a9e1654cefa64948d936 --- /dev/null +++ b/src/pages/NewHome/MapCantainer/DistrictMap/PopoverCardWarn/index.less @@ -0,0 +1,92 @@ +.container { + position: relative; + background: rgba(27, 124, 181, 0.2); + width: 453px; + height: 406px; + padding: 10px 10px; + + .title { + font-size: 24px; + color: rgb(255, 255, 255); + font-family: DingTalk JinBuTi; + width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + + .imgWarp { + position: relative; + + .img { + margin-top: 20px; + width: 100%; + height: 177px; + border-radius: 10px; + } + + .tag { + position: absolute; + left: 10px; + bottom: 14px; + display: inline-block; + width: 83px; + height: 24px; + border-radius: 12px; + + text-align: center; + font-size: 16px; + line-height: 23px; + margin: 0 10px 0 20px; + background-size: 100% 100%; + } + + .tag1 { + position: absolute; + left: 100px; + bottom: 10px; + display: inline-block; + width: 83px; + height: 24px; + border-radius: 12px; + background: rgba(26, 66, 110, 0.3); + + text-align: center; + font-size: 16px; + line-height: 23px; + margin: 0 10px 0 20px; + background-size: 100% 100%; + } + } + + .btnWarp { + display: flex; + align-items: center; + justify-content: center; + + .checkBtn { + border-radius: 25px; + background: linear-gradient(180deg, + rgb(28, 192, 255), + rgb(82, 148, 255) 100%); + width: 106px; + + color: rgb(255, 255, 255); + + font-size: 18px; + text-align: center; + line-height: 40px; + margin-top: 20px; + cursor: pointer; + } + } + + .close { + position: absolute; + right: 10px; + top: 10px; + + } + + +} \ No newline at end of file diff --git a/src/pages/NewHome/MapCantainer/DistrictMap/PopoverCardWarn/index.tsx b/src/pages/NewHome/MapCantainer/DistrictMap/PopoverCardWarn/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..4c19a4f43c9adca906ff47a9a1f041b1d216af1c --- /dev/null +++ b/src/pages/NewHome/MapCantainer/DistrictMap/PopoverCardWarn/index.tsx @@ -0,0 +1,70 @@ +import blueBg from '@/assets/images/SecurityServiceOverview/right/blueBg.png'; +import orangeBg from '@/assets/images/SecurityServiceOverview/right/orangeBg.png'; +import redBg from '@/assets/images/SecurityServiceOverview/right/redBg.png'; +import yellowBg from '@/assets/images/SecurityServiceOverview/right/yellowBg.png'; +import LabelImgText from '@/components/LabelImgText'; +import React, { CSSProperties } from 'react'; +import styles from './index.less'; +import { colorConfig } from '..'; +interface PropsType { + data: DistrictAPI.RealtimeIndexDTO; +} +/** @name 气泡卡片 */ +const PopoverCardWarn: React.FC = (props) => { + const { data } = props; + + console.log(data); + const valueStyle = { + color: '#fff', + fontSize: 16, + }; + const labelStyle = { + color: '#CBEDFF', + fontSize: 16, + }; + return ( +
+
{data?.riskdescription}
+
+ +
+ +
+
{data?.status}
+
+
+ + +
+
+
+ 查看详情 +
+
+ + +
+ ); +}; + +export default PopoverCardWarn; diff --git a/src/pages/NewHome/MapCantainer/DistrictMap/index.less b/src/pages/NewHome/MapCantainer/DistrictMap/index.less new file mode 100644 index 0000000000000000000000000000000000000000..81725b186fe989a1a9e41fa0af653943e9b96d5d --- /dev/null +++ b/src/pages/NewHome/MapCantainer/DistrictMap/index.less @@ -0,0 +1,284 @@ +.container { + position: relative; + overflow: hidden; + width: 100%; + height: 100%; + border-radius: 20px; +} + +.districtName { + position: absolute; + top: 0; + left: 0; + padding: 12px 30px; + border-radius: 20px 0px 20px 0px; + background: rgba(23, 125, 186, 0.9); + color: rgb(255, 255, 255); + font-family: DingTalk JinBuTi; + font-size: 30px; + line-height: 1; +} + +.statusBar { + position: absolute; + top: 10px; + right: 10px; + + // width: 625px; +} + +.leftWarp { + position: absolute; + left: 20px; + top: 100px; + width: 222px; + height: 433px; + + border-radius: 20px; + padding: 16px 25px; + + .menuBg { + background: rgba(12, 60, 112, 0.7); + border-radius: 20px; + -webkit-backdrop-filter: blur(10px); + backdrop-filter: blur(10px); + + background: rgba(12, 60, 112, 0.7); + position: absolute; + inset: 0; + z-index: 100; + } + + .warnWarp { + .warnItem { + width: 100%; + height: 70px; + border-radius: 6px; + padding: 0 24px 0 70px; + color: var(--color); + margin-bottom: 20px; + position: relative; + + .icon { + width: 100px; + position: absolute; + top: -25px; + left: -24px; + } + + .title { + font-size: 18px; + font-family: DingTalk JinBuTi; + } + + .address { + width: 110px; + font-size: 14px; + } + + .time { + font-size: 14px; + width: 70px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + } + } + + .eventWarp { + position: relative; + z-index: 1000; + + .title { + color: rgb(228, 237, 255); + text-align: center; + font-size: 24px; + font-family: DingTalk JinBuTi; + } + + .listWarp { + margin-top: 20px; + height: 340px; + overflow: auto; + + .items { + width: 167px; + height: 97px; + border-radius: 10px; + background-color: #48779d; + position: relative; + margin-bottom: 20px; + + .img { + width: 167px; + height: 97px; + border-radius: 10px; + object-fit: cover; + } + + .bottomWarp { + position: absolute; + bottom: 0; + height: 32px; + width: 100%; + display: flex; + justify-content: center; + align-items: center; + background-color: rgba(0, 0, 0, 0.5); + font-size: 18px; + border-radius: 0px 0px 10px 10px; + } + + .time { + position: absolute; + top: 10px; + right: 10px; + height: 32px; + background-color: rgba(0, 0, 0, 0.5); + border-radius: 10px; + height: 28px; + padding: 0 10px; + display: flex; + align-items: center; + justify-content: center; + } + } + } + + .otherWarp { + display: flex; + justify-content: center; + + .other { + width: 60px; + height: 27px; + border-radius: 20px; + background-color: rgba(22, 134, 255, 0.5); + display: flex; + justify-content: center; + align-items: center; + } + } + } +} + +.mark { + width: 16px; + height: 16px; + border-radius: 50%; + margin-right: 8px; +} + +.mapController { + position: absolute; + right: 30px; + bottom: 30px; + + z-index: 100; + + > div { + width: 40px; + height: 40px; + border-radius: 4px; + + background: rgb(0, 71, 113); + display: flex; + align-items: center; + justify-content: center; + font-size: 18px; + cursor: pointer; + color: #a8cde8; + margin-top: 10px; + } +} + +.indexMarker { + width: 44px; + height: 44px; + box-sizing: border-box; + border: 3px solid rgba(255, 255, 255, 0.5); + box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.5); + background: var(--bg-color); + border-radius: 22px; + display: flex; + align-items: center; + justify-content: center; + font-family: D-DIN; + color: var(--color); +} + +.window { + box-sizing: border-box; + border: 2px solid rgba(64, 146, 217, 0.95); + border-radius: 10px; + background: rgb(3, 85, 135); + width: 460px; + + &::after { + position: absolute; + content: ''; + /**三角形 */ + width: 0; + height: 0; + border-style: solid; + border-width: 10px 10px 0 10px; + border-color: rgb(3, 85, 135) transparent transparent transparent; + bottom: -7px; + left: 50%; + transform: translateX(-50%); + z-index: 999; + } +} +.window1 { + box-sizing: border-box; + + &::after { + position: absolute; + content: ''; + /**三角形 */ + width: 0; + height: 0; + border-style: solid; + border-width: 10px 10px 0 10px; + border-color: rgb(3, 85, 135) transparent transparent transparent; + bottom: -7px; + left: 50%; + transform: translateX(-50%); + z-index: 999; + } +} +.modalTitle { + .title { + background: linear-gradient(180deg, rgb(255, 255, 255), rgb(181, 229, 255)); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-clip: text; + font-family: DingTalk JinBuTi; + font-size: 30px; + margin-left: -10px; + } + + .tag { + display: inline-block; + width: 83px; + height: 24px; + border-radius: 12px; + background: linear-gradient( + 180deg, + rgba(26, 66, 110, 0), + rgb(122, 94, 111) 100% + ); + color: #ff7a7a; + text-align: center; + font-size: 16px; + line-height: 23px; + margin: 0 10px 0 20px; + background-size: 100% 100%; + } + + .type { + font-size: 16px; + color: #bccee9; + } +} diff --git a/src/pages/NewHome/MapCantainer/DistrictMap/index.tsx b/src/pages/NewHome/MapCantainer/DistrictMap/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..f8bd0a44e13e92a24fe7c6f8b279d8da77adfd63 --- /dev/null +++ b/src/pages/NewHome/MapCantainer/DistrictMap/index.tsx @@ -0,0 +1,379 @@ +import blueBg from '@/assets/images/SecurityServiceOverview/right/blueBg.png'; +import orangeBg from '@/assets/images/SecurityServiceOverview/right/orangeBg.png'; +import redBg from '@/assets/images/SecurityServiceOverview/right/redBg.png'; +import yellowBg from '@/assets/images/SecurityServiceOverview/right/yellowBg.png'; +import risk1 from '@/assets/images/urbanSituation/risk1.svg'; +import risk2 from '@/assets/images/urbanSituation/risk2.svg'; +import risk3 from '@/assets/images/urbanSituation/risk3.svg'; +import risk4 from '@/assets/images/urbanSituation/risk4.svg'; + +import CooglMap from '@/components/CooglMap'; +import Modal from '@/components/HncyModal'; +import { useGlobalModalServices } from '@/pages/GlobalModalServices/provider'; +import services from '@/services'; +import { smoothScrollTo } from '@/utils'; +import BMapService from '@/utils/mapService'; +import { getColorByIndex } from '@/utils/ui'; +import { IMG_URL } from '@/utils/variables'; +import { useModel, useRequest } from '@umijs/max'; +import { Flex } from 'antd'; +import dayjs from 'dayjs'; +import React, { CSSProperties, useEffect, useRef, useState } from 'react'; + +import Apps from '../components/Apps'; +import LeftTab from '../components/LeftTab'; +import RiskIssue from '../RiskIssue'; +import styles from './index.less'; +import PopoverCard from './PopoverCard'; +import BaseInfo from '@/pages/SecurityServiceOverview/components/BaseInfo'; +export const colorConfig: Record< + string, + { + color: CSSProperties['color']; + bg: string; + icon: string; + bigIcon: string; + tag: string; + } +> = { + 红色预警: { + //红色风险 + color: '#FFBCBC', + bg: redBg, + icon: risk1, + bigIcon: 'redIcon', + tag: require('@/assets/images/SecurityServiceOverview/dtyjtag1.png'), + }, + 橙色预警: { + //橙色风险 + color: '#FDDFCE', + bg: orangeBg, + icon: risk2, + bigIcon: 'orangeIcon', + tag: require('@/assets/images/SecurityServiceOverview/dtyjtag2.png'), + }, + 黄色预警: { + //黄色风险 + color: '#FFE892', + bg: yellowBg, + icon: risk3, + bigIcon: 'yellowIcon', + tag: require('@/assets/images/SecurityServiceOverview/dtyjtag3.png'), + }, + 一般预警: { + //一般风险 + color: '#BFE4FF', + bg: blueBg, + icon: risk4, + bigIcon: 'blueIcon', + tag: require('@/assets/images/SecurityServiceOverview/dtyjtag4.png'), + }, +}; +/** 地图 */ +const DistrictMap: React.FC = () => { + const { initialState } = useModel('@@initialState'); + const { areaId } = initialState; + const { dispatch } = useGlobalModalServices(); + const [playingStatus, setPlayingStatus] = useState(true); + //区域选择 + const [selected, setSelected] = useState(); + + const [checkedKeys, setCheckedKeys] = useState([ + // '安全风险', + // '红色预警', + // '橙色预警', + // '黄色预警', + // '一般预警', + '城市问题', + '其他问题', + '突出问题', + ]); + const MapRef = useRef(); + + const eventHtmlRef = useRef(null); + const { indexs } = useModel('regionalIndex', (store) => ({ + indexs: store.indexs, + })); + + // 预警事件详情弹窗 + const [detailModalOpt, setDetailModalOpt] = useState({ + open: false, + title: '', + eventId: '', + }); + + const [leftTabKey, setLeftTabKey] = useState('1'); + const [data, setData] = useState([]); + const [eventData, setEventData] = useState([]); + + useEffect(() => { + services.Physicalsign.getObjectPolygon({ + physicalSignType: 1, + objectHierarchy: 1, + // objectId: '510107', + }).then((res) => { + setData(res.data); + }); + + //最新事件 + services.CityProblemApi.getUpToDateEvent({ + page: 1, + count: 10, + }).then((res: any) => { + console.log('getUpToDateEvent', res); + if (res.code === 200) { + setEventData(res.data?.items); + } + }); + }, []); + + useEffect(() => { + let intervalId!: NodeJS.Timeout; + if (!eventHtmlRef.current) { + return; + } + const viewBoxH = eventHtmlRef.current?.clientHeight; + const childrenMaxH = (eventHtmlRef.current?.firstChild as HTMLImageElement) + ?.clientHeight; + + // 进度条速度 + const speed = 15; + if (playingStatus) { + // 开始计时任务 + intervalId = setInterval(() => { + if (!eventHtmlRef.current) { + clearInterval(intervalId); + } + + if ( + (eventHtmlRef.current as HTMLDivElement)?.scrollHeight - viewBoxH <= + (eventHtmlRef.current as HTMLDivElement)?.scrollTop + ) { + eventHtmlRef.current?.scrollTo({ top: 0, behavior: 'instant' }); + return; + } + + smoothScrollTo(eventHtmlRef.current as HTMLDivElement, 300, speed); + }, 300); + } else { + // 清除定时器 + clearInterval(intervalId); + } + // 在组件卸载时清除定时器 + return () => { + clearInterval(intervalId); + }; + }, [playingStatus]); + + const { data: signData } = useRequest(() => + services.districtController.getListIndexInstance({ + physicalSignType: '1', + indexType: '1', + indexId: '', + objectId: areaId, + indexHierarchy: '1', + objectHierarchy: '1', + }), + ); + + /** 标题渲染 */ + const titleRender = () => { + return ( + +
{detailModalOpt?.riskdescription}
+ + + + {detailModalOpt?.industry_name_dl}-{detailModalOpt?.name} + +
+ ); + }; + + return ( +
+ + {leftTabKey === '1' ? ( + <> + {/**区域 */} + {data?.map((item, index) => { + return item?.multiPoints?.map((it: any, idx: number) => { + return ( + + ); + }); + })} + {data?.map((item, index) => { + const point = [Number(item.centerX), Number(item.centerY)]; + + return ( + { + const obj = signData?.find( + (signItem: any) => item.objectId === signItem?.objectId, + ); + setSelected({ + ...item, + eventCount: obj?.eventCount, + diffValue: obj?.diffValue, + desc: obj?.desc, + }); + }} + > +
+ {Number(item.qualitySign)} +
+
+ ); + })} + {selected && ( + { + setSelected(undefined); + }} + onDetail={(e) => { + dispatch.push('districtIndex', { + title: selected?.objectName + '运行情况', + props: { + data: selected, + indexs: indexs, + }, + }); + }} + > +
+ +
+
+ )} + + ) : ( + + )} +
+ +
+ + +
+
+
+ +
+
最新事件
+
{ + setPlayingStatus(false); + }} + onMouseLeave={() => { + setPlayingStatus(true); + }} + > + {eventData?.map((item, index) => { + return ( +
{ + dispatch.push('EventDetail', { + title: '事件详情', + w: 'fit-content', + props: { + eventId: item?.eventId, + }, + }); + }} + > + +
{item?.mainTypeName}
+
+ {dayjs(item?.reportTime).format('YYYY-MM-DD')} +
+ {/*
{item?.reportTime}分钟前
*/} +
+ ); + })} +
+ {/*
+
更多
+
*/} +
+
+ {/* 风险事件详情 */} + { + setDetailModalOpt({ + open: false, + title: '事件详情', + eventId: '', + }); + }} + width={2650} + height={900} + > + {detailModalOpt?.open && ( + { + setDetailModalOpt({ + ...detailModalOpt, + position: val?.region_name, + + riskLevelName: val?.risklevel, + }); + }} + /> + )} + +
+ ); +}; + +export default DistrictMap; diff --git a/src/pages/NewHome/MapCantainer/EmphasisAreaMap/PopoverCardArea/index.less b/src/pages/NewHome/MapCantainer/EmphasisAreaMap/PopoverCardArea/index.less new file mode 100644 index 0000000000000000000000000000000000000000..0a48a14479fe26b6be2d176c912fb05cc9d184d6 --- /dev/null +++ b/src/pages/NewHome/MapCantainer/EmphasisAreaMap/PopoverCardArea/index.less @@ -0,0 +1,155 @@ +.container { + position: relative; + background: rgba(27, 124, 181, 0.2); + width: 553px; + height: 406px; + padding: 10px 10px; + + .title { + font-size: 24px; + color: rgb(255, 255, 255); + font-family: DingTalk JinBuTi; + width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + + .header { + display: flex; + align-items: center; + + .cqiWarp { + display: flex; + align-items: center; + + .cqi { + display: flex; + align-items: center; + font-size: 38px; + font-weight: 700; + + .tag { + font-size: 14px; + margin-left: 10px; + margin-right: 10px; + padding: 0 5px; + border-radius: 5px; + } + } + } + + .title { + font-size: 22px; + font-weight: 700; + color: #b3d6f7; + font-family: DingTalk JinBuTi; + + } + + .compare { + font-size: 18px; + display: flex; + + .tips { + color: #fff; + } + + .compareNum { + color: #57ef58; + } + } + + .title_time { + color: rgb(217, 217, 217); + font-size: 18px; + font-weight: 400; + } + } + + + .fx { + display: flex; + margin-top: 30px; + + .countWarp { + font-size: 16px; + color: rgb(255, 255, 255); + display: flex; + align-items: center; + width: 50%; + + .count { + font-size: 24px; + background: linear-gradient(to bottom, rgb(170, 255, 246), rgb(37, 187, 255)); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-clip: text; + font-weight: 700; + margin-left: 5px; + margin-right: 5px; + } + } + } + + .cardSection { + margin-top: 20px; + display: flex; + justify-content: space-between; + + .card { + width: 100px; + height: 76px; + border-radius: 14px; + cursor: pointer; + padding: 10px; + + .name { + font-size: 18px; + color: #fff; + line-height: 1; + text-align: center; + margin-bottom: 10px; + } + + .value { + font-size: 28px; + line-height: 1; + font-weight: 700; + font-family: D-DIN; + text-align: center; + } + } + } + + .btnWarp { + display: flex; + align-items: center; + justify-content: center; + + .checkBtn { + border-radius: 25px; + background: linear-gradient(180deg, + rgb(28, 192, 255), + rgb(82, 148, 255) 100%); + width: 106px; + + color: rgb(255, 255, 255); + + font-size: 18px; + text-align: center; + line-height: 40px; + margin-top: 32px; + cursor: pointer; + } + } + + .close { + position: absolute; + right: 10px; + top: 10px; + + } + + +} \ No newline at end of file diff --git a/src/pages/NewHome/MapCantainer/EmphasisAreaMap/PopoverCardArea/index.tsx b/src/pages/NewHome/MapCantainer/EmphasisAreaMap/PopoverCardArea/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..bd5cca1aee7634c8c832e81993c1c4afdf033abd --- /dev/null +++ b/src/pages/NewHome/MapCantainer/EmphasisAreaMap/PopoverCardArea/index.tsx @@ -0,0 +1,176 @@ +import { cqiDisplay, getCqiStatusStyle, getCqiStatusTexts } from '@/utils/ui'; +import { CaretDownOutlined, CaretUpOutlined } from '@ant-design/icons'; +import dayjs from 'dayjs'; +import React, { useMemo } from 'react'; +import styles from './index.less'; +interface PropsType { + data: DistrictAPI.RealtimeIndexDTO; +} +/** @name 气泡卡片 */ +const PopoverCardArea: React.FC = (props) => { + const { data } = props; + + const valueStyle = { + color: '#fff', + fontSize: 16, + }; + const labelStyle = { + color: '#CBEDFF', + fontSize: 16, + }; + const cards = useMemo(() => { + console.log(data?.currentIndex?.indexs); + + return [ + { + name: '安全', + value: + data?.currentIndex?.indexs?.find((item: any) => item.name === '安全') + ?.value ?? 0, + ...getCqiStatusStyle( + data?.currentIndex?.indexs?.find((item: any) => item.name === '安全') + ?.value, + ), + }, + { + name: '整洁', + value: + data?.currentIndex?.indexs?.find((item: any) => item.name === '整洁') + ?.value ?? 0, + ...getCqiStatusStyle( + data?.currentIndex?.indexs?.find((item: any) => item.name === '整洁') + ?.value, + ), + }, + { + name: '有序', + value: + data?.currentIndex?.indexs?.find((item: any) => item.name === '有序') + ?.value ?? 0, + ...getCqiStatusStyle( + data?.currentIndex?.indexs?.find((item: any) => item.name === '有序') + ?.value, + ), + }, + { + name: '便民', + value: + data?.currentIndex?.indexs?.find((item: any) => item.name === '便民') + ?.value ?? 0, + ...getCqiStatusStyle( + data?.currentIndex?.indexs?.find((item: any) => item.name === '便民') + ?.value, + ), + }, + { + name: '美观', + value: '--', + id: data?.currentIndex?.indexs?.find( + (item: any) => item.name === '美观', + )?.id, + color: '#57EF58', + background: 'rgba(39, 211, 134, 0.2)', + // value: + // data?.currentIndex?.indexs?.find((item: any) => item.name === '美观') + // ?.value ?? 0, + // ...getCqiStatusStyle( + // data?.currentIndex?.indexs?.find((item: any) => item.name === '美观') + // ?.value, + // ), + }, + ]; + }, [data]); + + return ( +
+
{data?.objectName}
+
+
+
+ {data?.currentIndex?.cqi} + + {getCqiStatusTexts(data?.currentIndex?.cqi)?.text} + +
+
+ +
+ + 较{dayjs().diff(data?.indexTime, 'h')}小时前 + +
+ {data?.status === 'up' ? ( + + ) : ( + + )} +
+ {data?.diffValue} +
+
+
+
+ +
{getCqiStatusTexts(data?.currentIndex?.cqi)?.desc}
+ +
+ {cards.map((item, index) => ( +
+
{item.name}
+
+ {cqiDisplay(item.value)} +
+
+ ))} +
+
+
+ 安全风险 +
--
+ {/* */} +
+
+ 城市问题 +
{data?.issueCount}
+ +
+
+
+
+ 查看详情 +
+
+ + +
+ ); +}; + +export default PopoverCardArea; diff --git a/src/pages/NewHome/MapCantainer/EmphasisAreaMap/index.less b/src/pages/NewHome/MapCantainer/EmphasisAreaMap/index.less new file mode 100644 index 0000000000000000000000000000000000000000..2caad4dc78d8bf39265f7c3a875880c059748d49 --- /dev/null +++ b/src/pages/NewHome/MapCantainer/EmphasisAreaMap/index.less @@ -0,0 +1,252 @@ +.container { + height: 100%; + width: 100%; + overflow: hidden; + position: relative; + border-radius: 20px; + + > img { + cursor: pointer; + } + + > img:nth-of-type(1) { + position: absolute; + left: 700px; + top: 200px; + } + + > img:nth-of-type(2) { + position: absolute; + left: 1100px; + top: 340px; + } +} + +.mapController { + position: absolute; + right: 30px; + bottom: 30px; + z-index: 1001; + + > div { + width: 40px; + height: 40px; + border-radius: 4px; + + background: rgb(0, 71, 113); + display: flex; + align-items: center; + justify-content: center; + font-size: 18px; + cursor: pointer; + color: #a8cde8; + margin-top: 10px; + } +} + +.statusBar { + position: absolute; + top: 10px; + right: 10px; + padding: 20px 20px; + z-index: 997; + border-radius: 10px; + color: rgb(203, 227, 240); + font-size: 16px; +} + +.mark { + width: 16px; + height: 16px; + border-radius: 50%; + margin-right: 8px; +} + +.leftList { + width: 352px; + height: 605px; + z-index: 997; + // box-sizing: content-box; + + position: absolute; + left: 10px; + top: 100px; + // overflow: auto; + + .bg { + position: absolute; + inset: 0; + border-radius: 20px; + -webkit-backdrop-filter: blur(20px); + backdrop-filter: blur(20px); + background: rgba(12, 60, 112, 0.7); + } + + .listContent { + position: relative; + padding: 16px 25px; + } +} + +.listTitle { + color: rgb(179, 214, 247); + font-family: DingTalk JinBuTi; + font-size: 22px; + font-weight: 400; + margin-bottom: 10px; +} + +.listItem { + height: 60px; + padding: 0 24px; + color: rgb(228, 237, 255); + font-family: D-DIN; + font-size: 20px; + border-radius: 18px; + margin-bottom: 10px; + cursor: pointer; + + background: rgba(67, 177, 255, 0.13); +} + +.childWrap { + margin-top: 5px; + margin-bottom: 10px; + border-radius: 18px; + background: rgba(67, 177, 255, 0.13); + + .childItem { + border-radius: 18px; + + height: 60px; + padding: 0 24px; + + > :first-child { + color: rgb(228, 237, 255); + font-family: D-DIN; + font-size: 20px; + } + + > :last-child { + font-family: D-DIN; + font-size: 28px; + font-weight: 700; + } + + &:hover { + background: rgba(67, 177, 255, 0.37); + } + } +} + +.indexMarker { + display: flex; + flex-direction: column; + align-items: center; + width: 100px; + height: 100px; + pointer-events: none; +} + +.markerIcon { + width: 22px; + height: 22px; + box-sizing: border-box; + border: 4px solid rgb(87, 239, 88); + background: rgba(87, 239, 88, 0.1); + border-radius: 50%; + border-color: var(--b-color); +} + +.markerContent { + background-color: rgba(33, 50, 88, 0.9); + border-radius: 10px; + + font-weight: 700; + white-space: nowrap; + margin-bottom: 10px; + display: flex; + align-items: center; + padding: 4px 15px; + cursor: pointer; + + > span { + font-size: 28px; + font-family: D-DIN; + margin-left: 12px; + color: var(--b-color); + } +} + +.modalTitle { + .title { + background: linear-gradient(180deg, rgb(255, 255, 255), rgb(181, 229, 255)); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-clip: text; + font-family: DingTalk JinBuTi; + font-size: 30px; + margin-left: -10px; + } + + .tag { + display: inline-block; + width: 83px; + height: 24px; + border-radius: 12px; + background: linear-gradient( + 180deg, + rgba(26, 66, 110, 0), + rgb(122, 94, 111) 100% + ); + color: #ff7a7a; + text-align: center; + font-size: 16px; + line-height: 23px; + margin: 0 10px 0 20px; + background-size: 100% 100%; + } + + .type { + font-size: 16px; + color: #bccee9; + } +} + +.window { + box-sizing: border-box; + border: 2px solid rgba(64, 146, 217, 0.95); + border-radius: 10px; + background: rgb(3, 85, 135); + width: 460px; + + &::after { + position: absolute; + content: ''; + /**三角形 */ + width: 0; + height: 0; + border-style: solid; + border-width: 10px 10px 0 10px; + border-color: rgb(3, 85, 135) transparent transparent transparent; + bottom: -7px; + left: 50%; + transform: translateX(-50%); + z-index: 999; + } + + &::before { + position: absolute; + content: ''; + /**三角形 */ + width: 0; + height: 0; + border-style: solid; + border-width: 10px 10px 0 10px; + border-color: rgba(64, 146, 217, 0.95) transparent transparent transparent; + bottom: -10px; + left: 50%; + transform: translateX(-50%); + z-index: 998; + } +} diff --git a/src/pages/NewHome/MapCantainer/EmphasisAreaMap/index.tsx b/src/pages/NewHome/MapCantainer/EmphasisAreaMap/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..951c45e963ab6d4fba8605fcbf35068559475df9 --- /dev/null +++ b/src/pages/NewHome/MapCantainer/EmphasisAreaMap/index.tsx @@ -0,0 +1,363 @@ +import CooglMap from '@/components/CooglMap'; +import Modal from '@/components/HncyModal'; +import { useGlobalModalServices } from '@/pages/GlobalModalServices/provider'; +import services from '@/services'; +import { cqiDisplay, getColorByIndex, getCqiStatusStyle } from '@/utils/ui'; +import { Flex, Space } from 'antd'; +import React, { useEffect, useRef, useState } from 'react'; + +import Apps from '../components/Apps'; +import LeftTab from '../components/LeftTab'; +import { colorConfig } from '../DistrictMap'; +import RiskIssue from '../RiskIssue'; +import styles from './index.less'; +import PopoverCardArea from './PopoverCardArea'; +import BaseInfo from '@/pages/SecurityServiceOverview/components/BaseInfo'; +const EmphasisAreaMap: React.FC = () => { + const [checkedKeys, setCheckedKeys] = useState([ + '城市问题', + '其他问题', + '突出问题', + ]); + + //区域切换 + const [center, setCenter] = useState(); + + //区域 + const [areaSelectd, setAreaSelectd] = useState(); + + const [expand, setExpand] = useState(); + const ref = useRef(0); + const { dispatch } = useGlobalModalServices(); + + const MapRef = useRef(); + const [leftTabKey, setLeftTabKey] = useState('1'); + + // 事件详情弹窗 + const [detailModalOpt, setDetailModalOpt] = useState({ + open: false, + title: '', + eventId: '', + }); + const [areaList, setAreaList] = useState([]); + const [allAreaMapData, setAllAreaMapData] = useState([]); + + /** + * @description 设置地图视野 + */ + const setViewport = () => { + // const map = MapRef.current?.map as BMapGL.Map; + // if (map) { + // map.setViewport([p1, p2]); + // } + }; + + // /** @description 移动视角到能显示全部覆盖物 */ + // useEffect(() => { + // setViewport(); + // }, [MapRef.current]); + + // 重点区域列表 + const getImportantAreaList = async () => { + const params = { + physicalSignType: 1, + objectHierarchy: 19, + }; + const res = await services.Physicalsign.getGroupObjectPhysicalSignIndex( + params, + ); + + if (res.code === 200) { + setAreaList(res.data); + } + }; + + useEffect(() => { + getImportantAreaList(); + }, []); + + const getObjectPolygon = async () => { + const params = { + physicalSignType: 1, + objectHierarchy: 19, + }; + const res = await services.Physicalsign.getObjectPolygon(params); + if (res.code === 200 && res.data?.length) { + setAllAreaMapData(res.data); + } + }; + + useEffect(() => { + getObjectPolygon(); + }, []); + + /** 标题渲染 */ + const titleRender = () => { + return ( + +
{detailModalOpt?.eventType}
+ + {detailModalOpt?.riskLevelName} + + {detailModalOpt?.position} +
+ ); + }; + + return ( +
+ + {leftTabKey === '1' ? ( + <> + {allAreaMapData?.map((item: any) => ( + { + try { + const params = { + physicalSignType: '1', // 1实况指数 3周期指数 + indexType: '1', // 指数体系类型 0:内评价 1:外评价 + indexHierarchy: '1,2', // 指数层级,从1开始,多个用,逗号隔开 + objectId: item?.objectId, // 区域网格id + indexId: '', // 指数id + }; + const res = + await services.Physicalsign.getComparisonIndexInstance( + params, + ); + + const res1 = + await services.Physicalsign.getTotalCountForKeyAreas({ + keyAreaId: item?.objectId, + eventStatus: '处置中', + }); + + setAreaSelectd({ + ...res?.data, + centerX: item?.centerX, + centerY: item?.centerY, + objectName: item?.objectName, + issueCount: res1?.data, + }); + } catch (error) { + console.log(error); + } + }} + key={item.objectId} + > +
+
+ {item?.objectName} + + {cqiDisplay(item?.qualitySign)} + +
+
+
+
+ ))} + {areaSelectd && ( + { + console.log('areaSelectd', areaSelectd); + dispatch.push('KeyAreaDetail', { + title: areaSelectd.objectName, + props: { + objectId: areaSelectd?.currentIndex?.objectId, + cqi: areaSelectd?.currentIndex?.cqi, + }, + }); + }} + onClose={(e) => { + setAreaSelectd(undefined); + // console.log('close', e); + }} + > +
+ +
+
+ )} + {allAreaMapData && ( + <> + {center?.multiPoints?.map((item: any, index: number) => { + return ( + + ); + })} + + )} + + ) : ( + + )} +
+
+
+
+
重点区域列表
+
+ {areaList?.map((item: any, index: number) => { + return ( +
+ { + if (expand === index) { + setExpand(undefined); + return; + } + ref.current = index; + + setExpand(index); + }} + > +
{item?.objGroup}
+ +
{item?.objects?.length}
+
+ {index === expand ? ( + + ) : ( + + )} +
+
+ {expand === index && ( +
+ {item?.objects.map((child: any, child_index: any) => { + return ( + { + const data = allAreaMapData?.find( + (it) => it.objectId === child?.objectId, + ); + console.log(data); + + MapRef?.current?.flyTo({ + destination: { + x: Number(data?.centerX), + y: Number(data?.centerY), + z: 23961, + }, + }); + setLeftTabKey('1'); + setCenter(data); + }} + > +
{child.objectName}
+
+ {cqiDisplay(child.cqi)} +
+
+ ); + })} +
+ )} +
+ ); + })} +
+
+
+ +
+ + +
+ {/* 事件详情 */} + { + setDetailModalOpt({ + open: false, + title: '事件详情', + eventId: '', + }); + }} + width={2650} + height={900} + > + {detailModalOpt?.open && ( + { + setDetailModalOpt({ + ...detailModalOpt, + position: val?.position, + eventType: val?.event_type, + riskLevelName: val?.risklevel, + }); + }} + /> + )} + +
+ ); +}; + +export default EmphasisAreaMap; diff --git a/src/pages/NewHome/MapCantainer/RiskIssue/index.less b/src/pages/NewHome/MapCantainer/RiskIssue/index.less new file mode 100644 index 0000000000000000000000000000000000000000..efed354df92ba89a2407b7d98aa9bcb2374b96af --- /dev/null +++ b/src/pages/NewHome/MapCantainer/RiskIssue/index.less @@ -0,0 +1,74 @@ +.window { + box-sizing: border-box; + border: 2px solid rgba(64, 146, 217, 0.95); + border-radius: 10px; + background: rgb(3, 85, 135); + width: 460px; + + &::after { + position: absolute; + content: ''; + /**三角形 */ + width: 0; + height: 0; + border-style: solid; + border-width: 10px 10px 0 10px; + border-color: rgb(3, 85, 135) transparent transparent transparent; + bottom: -7px; + left: 50%; + transform: translateX(-50%); + z-index: 999; + } + } + .window1 { + box-sizing: border-box; + + &::after { + position: absolute; + content: ''; + /**三角形 */ + width: 0; + height: 0; + border-style: solid; + border-width: 10px 10px 0 10px; + border-color: rgb(3, 85, 135) transparent transparent transparent; + bottom: -7px; + left: 50%; + transform: translateX(-50%); + z-index: 999; + } + } + .modalTitle { + .title { + background: linear-gradient(180deg, rgb(255, 255, 255), rgb(181, 229, 255)); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-clip: text; + font-family: DingTalk JinBuTi; + font-size: 30px; + margin-left: -10px; + } + + .tag { + display: inline-block; + width: 83px; + height: 24px; + border-radius: 12px; + background: linear-gradient( + 180deg, + rgba(26, 66, 110, 0), + rgb(122, 94, 111) 100% + ); + color: #ff7a7a; + text-align: center; + font-size: 16px; + line-height: 23px; + margin: 0 10px 0 20px; + background-size: 100% 100%; + } + + .type { + font-size: 16px; + color: #bccee9; + } + } \ No newline at end of file diff --git a/src/pages/NewHome/MapCantainer/RiskIssue/index.tsx b/src/pages/NewHome/MapCantainer/RiskIssue/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..a210aa71acccd6b57c22776166b232c71159fb9e --- /dev/null +++ b/src/pages/NewHome/MapCantainer/RiskIssue/index.tsx @@ -0,0 +1,163 @@ +import CooglMap from '@/components/CooglMap'; +import { useGlobalModalServices } from '@/pages/GlobalModalServices/provider'; +import services from '@/services'; +import { useRequest } from 'ahooks'; +import { memo, useEffect, useState } from 'react'; +import { colorConfig } from '../DistrictMap'; +import PopoverCardKnotty from '../DistrictMap/PopoverCardKnotty'; +import PopoverCardWarn from '../DistrictMap/PopoverCardWarn'; +import styles from './index.less'; +const RiskIssue = ({ + checkedKeys, + setDetailModalOpt, +}: // setModalOpt, +{ + checkedKeys: any[]; + // setModalOpt: (val: any) => void; + setDetailModalOpt: (val: any) => void; +}) => { + const { dispatch } = useGlobalModalServices(); + + const [eventData, setEventData] = useState([]); + //风险 + const [fxSelectd, setFxSelectd] = useState(); + //问题 + const [kontSelectd, setKontSelectd] = useState(); + + //预警点位 + const { data: earlyData } = useRequest(() => + services.DataBase.getSjdzInfoData({ + typeCode: 'zzcc-aq-yjxx', + params: { + pageNo: 1, + pageSize: 10, + }, + }), + ); + console.log(earlyData); + + useEffect(() => { + //最新事件 + services.CityProblemApi.getUpToDateEvent({ + page: 1, + count: 10, + // protrudeFlag: '1', + }).then((res: any) => { + console.log('getUpToDateEvent', res); + if (res.code === 200) { + setEventData(res.data?.items); + } + }); + }, []); + + return ( + <> + {earlyData?.data?.data?.records + ?.filter((item: any) => checkedKeys?.includes(item?.risklevel)) + ?.map((item: any, index: number) => { + const point = [Number(item?.longitude), Number(item?.latitude)]; + + return ( + { + try { + console.log(item); + + setFxSelectd(item); + } catch (error) { + console.log(error); + } + }} + > + + + ); + })} + {eventData + ?.filter((item) => + checkedKeys?.includes( + item?.protrudeFlag == '2' ? '突出问题' : '其他问题', + ), + ) + ?.map((item, index) => { + const point = [Number(item?.lon), Number(item?.lat)]; + return ( + { + setKontSelectd(item); + }} + > + + + ); + })} + {/**预警popover */} + {fxSelectd && ( + { + setDetailModalOpt({ + open: true, + eventId: fxSelectd?.riskId, + ...fxSelectd, + }); + }} + onClose={(e) => { + setFxSelectd(undefined); + }} + > +
+ +
+
+ )} + {/**问题popover */} + {kontSelectd && ( + { + dispatch.push('EventDetail', { + title: '事件详情', + w: 'fit-content', + props: { + eventId: kontSelectd?.eventId, + }, + }); + }} + onClose={(e) => { + setKontSelectd(undefined); + }} + > +
+ +
+
+ )} + + ); +}; +export default memo(RiskIssue); diff --git a/src/pages/NewHome/MapCantainer/components/Apps/index.less b/src/pages/NewHome/MapCantainer/components/Apps/index.less new file mode 100644 index 0000000000000000000000000000000000000000..fbbafa3eed87026d8df7381b5197e677e7a5e004 --- /dev/null +++ b/src/pages/NewHome/MapCantainer/components/Apps/index.less @@ -0,0 +1,26 @@ +.container { + position: relative; + width: 208px; + // height: 202px; + margin-top: 25px; +} + +.bg { + position: absolute; + inset: 0; + -webkit-backdrop-filter: blur(20px); + backdrop-filter: blur(20px); + border-radius: 20px; + background: rgba(12, 60, 112, 0.7); +} + +.content { + position: relative; + z-index: 1; + padding: 20px; +} + +.title { + color: rgb(188, 206, 233); + font-size: 18px; +} diff --git a/src/pages/NewHome/MapCantainer/components/Apps/index.tsx b/src/pages/NewHome/MapCantainer/components/Apps/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..a590900006a35e22dc6e8dbd312b6582fde8da57 --- /dev/null +++ b/src/pages/NewHome/MapCantainer/components/Apps/index.tsx @@ -0,0 +1,51 @@ +import { Space } from 'antd'; +import React from 'react'; +import styles from './index.less'; + +const Apps: React.FC = () => { + const apps = [ + { + key: '2', + img: require('@/assets/images/aqyztTab.png'), + onclick: () => { + window.open( + `${window.location.origin}/cd-comprehensive/securityServiceOverview`, + '_blank', + ); + }, + }, + // { + // key: '3', + // img: require('@/assets/images/youyanyizhangtu.png'), + // onclick: () => { + // window.open('https://10.1.174.34:13000'); + // }, + // }, + ]; + + return ( +
+
+
+
应用场景
+ + {apps?.map((item) => { + return ( + { + item?.onclick(); + }} + style={{ width: 175, height: 48, cursor: 'pointer' }} + /> + ); + })} + +
+
+ ); +}; + +export default Apps; diff --git a/src/pages/NewHome/MapCantainer/components/LeftTab/index.less b/src/pages/NewHome/MapCantainer/components/LeftTab/index.less new file mode 100644 index 0000000000000000000000000000000000000000..7e9018923c6dde6cb87515324385c94f816fe688 --- /dev/null +++ b/src/pages/NewHome/MapCantainer/components/LeftTab/index.less @@ -0,0 +1,88 @@ +.container { + padding: 20px; + z-index: 997; + position: relative; + width: 208px; + border-radius: 10px; + color: rgb(203, 227, 240); + font-size: 16px; + + .menuBg { + background: rgba(12, 60, 112, 0.7); + border-radius: 20px; + -webkit-backdrop-filter: blur(20px); + backdrop-filter: blur(20px); + background: rgba(12, 60, 112, 0.7); + position: absolute; + inset: 0; + z-index: 100; + } + .title { + color: rgb(188, 206, 233); + font-size: 18px; + margin-bottom: 10px; + } + + .leftTab { + background: rgba(19, 145, 224, 0.464); + width: 175px; + height: 35px; + border-radius: 15px; + padding-left: 10px; + display: flex; + align-items: center; + margin-bottom: 10px; + cursor: pointer; + } + + .itemWarp { + display: flex; + align-items: center; + margin-bottom: 8px; + } + + .rowItem { + margin-top: 16px; + + img { + width: 20px; + height: 20px; + } + } + + .treeTitle { + display: flex; + align-items: center; + + img { + margin-left: -10px; + margin-right: 5px; + width: 19px; + height: 18px; + } + } + .mark { + width: 16px; + height: 16px; + border-radius: 50%; + margin-right: 8px; + } + :global { + .ant-tree { + background-color: rgba(12, 60, 112, 0.135) !important; + } + .ant-tree .ant-tree-switcher { + display: none !important; + } + + .ant-tree .ant-tree-checkbox .ant-tree-checkbox-inner { + background-color: #48779d88 !important; + border: #99fdfa 1px solid !important; + } + + .ant-tree-node-content-wrapper.ant-tree-node-selected, + .ant-tree-checkbox + span.ant-tree-node-selected { + background-color: rgba(12, 60, 112, 0.197) !important; + } + } +} diff --git a/src/pages/NewHome/MapCantainer/components/LeftTab/index.tsx b/src/pages/NewHome/MapCantainer/components/LeftTab/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..3e7871154e4e176651498e4137185a685cd96730 --- /dev/null +++ b/src/pages/NewHome/MapCantainer/components/LeftTab/index.tsx @@ -0,0 +1,159 @@ +import risk1 from '@/assets/images/urbanSituation/risk1.svg'; +import risk2 from '@/assets/images/urbanSituation/risk2.svg'; +import risk3 from '@/assets/images/urbanSituation/risk3.svg'; +import risk4 from '@/assets/images/urbanSituation/risk4.svg'; +import { ConfigProvider, Tree } from 'antd'; +import { memo } from 'react'; +import styles from './index.less'; +const LeftTab = ({ + leftTabKey, + checkedKeys, + setLeftTabKey, + setCheckedKeys, +}: { + leftTabKey: string; + checkedKeys: any[]; + setLeftTabKey: (val: any) => void; + setCheckedKeys: (val: any[]) => void; +}) => { + return ( +
+
+
+
图层图例
+
setLeftTabKey('1')} + > + CQI +
+ +
+
+
良好态 >95
+
+
+
+
正常态 85-95
+
+
+
+
预警态 <85
+
+
+
+
应急态
+
+
setLeftTabKey('2')} + > + 风险预警与问题分布 +
+ {leftTabKey == '2' && ( + + { + setCheckedKeys(e); + }} + checkedKeys={checkedKeys} + treeData={[ + { + title: '安全风险', + key: '安全风险', + disabled: true, + children: [ + { + title: ( +
+ 红色风险 +
+ ), + key: '红色预警', + disabled: true, + }, + { + title: ( +
+ 橙色风险 +
+ ), + disabled: true, + key: '橙色预警', + }, + { + title: ( +
+ 黄色风险 +
+ ), + disabled: true, + key: '黄色预警', + }, + { + title: ( +
+ 一般风险 +
+ ), + disabled: true, + key: '一般预警', + }, + ], + }, + { + title: '城市问题', + key: '城市问题', + children: [ + { + title: ( +
+ + 其他问题 +
+ ), + key: '其他问题', + }, + { + title: ( +
+ + 突出问题 +
+ ), + key: '突出问题', + }, + ], + }, + ]} + /> +
+ )} +
+
+ ); +}; + +export default memo(LeftTab); diff --git a/src/pages/NewHome/MapCantainer/index.less b/src/pages/NewHome/MapCantainer/index.less new file mode 100644 index 0000000000000000000000000000000000000000..cf09ad65ef2e1812fc1a2fd05bce01f6658aad7a --- /dev/null +++ b/src/pages/NewHome/MapCantainer/index.less @@ -0,0 +1,25 @@ +.container { + width: 100%; + height: 100%; + position: relative; + + .topTabsWarp { + position: absolute; + top: 30px; + left: 10px; + z-index: 997; + } + + .botTabWarp { + position: absolute; + bottom: 20px; + left: 34%; + display: flex; + justify-content: center; + z-index: 997; + } + .mapContent { + width: 100%; + height: 100%; + } +} diff --git a/src/pages/NewHome/MapCantainer/index.tsx b/src/pages/NewHome/MapCantainer/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..a214e533ec9e906dc0cccf7813d6dd724c3d27f1 --- /dev/null +++ b/src/pages/NewHome/MapCantainer/index.tsx @@ -0,0 +1,37 @@ +import Tabs from '@/components/Tabs'; +import React, { useMemo, useState } from 'react'; +import DistrictMap from './DistrictMap'; +import EmphasisAreaMap from './EmphasisAreaMap'; +import styles from './index.less'; +const Map: Record = { + '1': DistrictMap, + '2': EmphasisAreaMap, +}; + +const MapContainer = () => { + const [topKey, setTopKey] = useState('1'); + + const renderMap = useMemo(() => { + const MapComponent = Map[topKey]; + return ; + }, [topKey]); + + return ( +
+
+ { + setTopKey(e); + }} + /> +
+
{renderMap}
+
+ ); +}; +export default MapContainer; diff --git a/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/WasteDisposal/index.tsx b/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/WasteDisposal/index.tsx index f60aa5560bc1f4ebff9bda36b62fbead45bdb3c7..5afdd8ba85d9bd6cdc2ac3c849c31fad6ea62d3e 100644 --- a/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/WasteDisposal/index.tsx +++ b/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/WasteDisposal/index.tsx @@ -28,25 +28,36 @@ const WasteDisposal: React.FC = () => { throw new Error('获取数据失败'); }), ); + const { data: infoData } = useRequest(() => + services.DataBase.getSjdzInfoData({ + typeCode: 'zzcc-shlj-czzl', + 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]; + } + 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); - 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('获取数据失败'); - }), - + return res?.data?.data?.records?.[0]?.total; + } + throw new Error('获取数据失败'); + }), ); const commonValueStyle = { background: 'linear-gradient(180deg, #9CF8F7 0%, #25BBFF 100%)', @@ -104,17 +115,18 @@ const WasteDisposal: React.FC = () => { { unitStyle={commonUnitStyle} decimals={2} style={commonStyle} + onClick={handleLivingGarbageClick} /> { unitStyle={commonUnitStyle} decimals={2} style={commonStyle} + onClick={handleClick} />