diff --git a/src/pages/Container/Map/components/BottomUtils/branchOfficeUtilsList.js b/src/pages/Container/Map/components/BottomUtils/branchOfficeUtilsList.js index 67ff9fb..ee41444 100644 --- a/src/pages/Container/Map/components/BottomUtils/branchOfficeUtilsList.js +++ b/src/pages/Container/Map/components/BottomUtils/branchOfficeUtilsList.js @@ -25,7 +25,7 @@ import pointIco36 from "~/assets/images/map_bi/point/ico36.png"; export const branchOfficeUtilsList = [ { - label: "重点作业", + label: "危险作业", type: "danger", list: [ { @@ -92,16 +92,16 @@ export const branchOfficeUtilsList = [ request: "getEightWorkInfoScreenWorkList", titleKey: "checkNo", }, - { - label: "摄像头", - check: false, - type: "dangerCamera", - markIcon: pointIco3, - }, + // { + // label: "摄像头", + // check: false, + // type: "dangerCamera", + // markIcon: pointIco3, + // }, ], }, { - label: "口门门禁", + label: "封闭区域", type: "door", list: [ { @@ -239,7 +239,7 @@ export const branchOfficeUtilsList = [ ], }, { - label: "重点工程", + label: "重点作业", type: "keyProject", list: [ { @@ -274,9 +274,9 @@ export const branchOfficeUtilsList = [ }, ], }, - { - label: "封闭区域", - type: "closedArea", - list: [], - }, + // { + // label: "封闭区域", + // type: "closedArea", + // list: [], + // }, ]; diff --git a/src/pages/Container/Map/components/BottomUtils/index.less b/src/pages/Container/Map/components/BottomUtils/index.less index ab5e936..d2cefe5 100644 --- a/src/pages/Container/Map/components/BottomUtils/index.less +++ b/src/pages/Container/Map/components/BottomUtils/index.less @@ -9,6 +9,7 @@ &.port { top: 920px; + .option { position: relative; cursor: pointer; @@ -91,6 +92,7 @@ &.branch_office { top: 1020px; + .option { position: relative; cursor: pointer; diff --git a/src/pages/Container/Map/components/BottomUtils/portUtilsList.js b/src/pages/Container/Map/components/BottomUtils/portUtilsList.js index 4fc089a..7963dd6 100644 --- a/src/pages/Container/Map/components/BottomUtils/portUtilsList.js +++ b/src/pages/Container/Map/components/BottomUtils/portUtilsList.js @@ -61,10 +61,10 @@ import ico28 from "~/assets/images/map_bi/bottom_utils/second/ico28.png"; import ico28On from "~/assets/images/map_bi/bottom_utils/second/ico28_on.png"; import ico29 from "~/assets/images/map_bi/bottom_utils/second/ico29.png"; import ico29On from "~/assets/images/map_bi/bottom_utils/second/ico29_on.png"; -import ico30 from "~/assets/images/map_bi/bottom_utils/second/ico30.png"; -import ico30On from "~/assets/images/map_bi/bottom_utils/second/ico30_on.png"; -import ico31 from "~/assets/images/map_bi/bottom_utils/second/ico31.png"; -import ico31On from "~/assets/images/map_bi/bottom_utils/second/ico31_on.png"; +// import ico30 from "~/assets/images/map_bi/bottom_utils/second/ico30.png"; +// import ico30On from "~/assets/images/map_bi/bottom_utils/second/ico30_on.png"; +// import ico31 from "~/assets/images/map_bi/bottom_utils/second/ico31.png"; +// import ico31On from "~/assets/images/map_bi/bottom_utils/second/ico31_on.png"; import ico32 from "~/assets/images/map_bi/bottom_utils/second/ico32.png"; import ico32On from "~/assets/images/map_bi/bottom_utils/second/ico32_on.png"; // 地图点位图片资源 @@ -89,9 +89,9 @@ import pointIco19 from "~/assets/images/map_bi/point/ico19.png"; import pointIco30 from "~/assets/images/map_bi/point/ico30.png"; import pointIco31 from "~/assets/images/map_bi/point/ico31.png"; import pointIco32 from "~/assets/images/map_bi/point/ico32.png"; -import pointIco34 from "~/assets/images/map_bi/point/ico34.png"; +// import pointIco34 from "~/assets/images/map_bi/point/ico34.png"; import pointIco35 from "~/assets/images/map_bi/point/ico35.png"; -import pointIco36 from "~/assets/images/map_bi/point/ico36.png"; +// import pointIco36 from "~/assets/images/map_bi/point/ico36.png"; export const portUtilsList = [ { @@ -110,22 +110,22 @@ export const portUtilsList = [ request: "getPrimeportMkmjScreenList", titleKey: "mkmjName", }, - { - label: "人员", - check: false, - img: ico30, - checkImg: ico30On, - markIcon: pointIco36, - type: "person", - }, - { - label: "车辆", - check: false, - img: ico31, - checkImg: ico31On, - markIcon: pointIco34, - type: "car", - }, + // { + // label: "人员", + // check: false, + // img: ico30, + // checkImg: ico30On, + // markIcon: pointIco36, + // type: "person", + // }, + // { + // label: "车辆", + // check: false, + // img: ico31, + // checkImg: ico31On, + // markIcon: pointIco34, + // type: "car", + // }, { label: "人员闸机", check: false, @@ -229,7 +229,7 @@ export const portUtilsList = [ { img: bottomImg6, checkImg: bottomImg6On, - label: "重点作业", + label: "危险作业", type: "danger", list: [ { @@ -312,14 +312,14 @@ export const portUtilsList = [ request: "getEightWorkInfoScreenWorkList", titleKey: "checkNo", }, - { - label: "摄像头", - check: false, - type: "dangerCamera", - img: ico3, - checkImg: ico3On, - markIcon: pointIco3, - }, + // { + // label: "摄像头", + // check: false, + // type: "dangerCamera", + // img: ico3, + // checkImg: ico3On, + // markIcon: pointIco3, + // }, ], }, { @@ -389,7 +389,7 @@ export const portUtilsList = [ { img: bottomImg12, checkImg: bottomImg12On, - label: "重点工程", + label: "重点作业", type: "keyProject", list: [ { diff --git a/src/pages/Container/Map/components/Content/IndexInfo/Bottom/VideoPatrolPanel/index.js b/src/pages/Container/Map/components/Content/IndexInfo/Bottom/VideoPatrolPanel/index.js index 9a9d971..036d2f4 100644 --- a/src/pages/Container/Map/components/Content/IndexInfo/Bottom/VideoPatrolPanel/index.js +++ b/src/pages/Container/Map/components/Content/IndexInfo/Bottom/VideoPatrolPanel/index.js @@ -64,7 +64,9 @@ function VideoPatrolPanel(props) { className="index-info-video-patrol__screen" style={{ backgroundImage: `url(${background})` }} > - + {playUrl ? ( diff --git a/src/pages/Container/Map/components/Content/IndexInfo/LeftPanel/HazardSourcePanel/index.js b/src/pages/Container/Map/components/Content/IndexInfo/LeftPanel/HazardSourcePanel/index.js index db0374a..db876ac 100644 --- a/src/pages/Container/Map/components/Content/IndexInfo/LeftPanel/HazardSourcePanel/index.js +++ b/src/pages/Container/Map/components/Content/IndexInfo/LeftPanel/HazardSourcePanel/index.js @@ -18,14 +18,14 @@ function HazardSourcePanel() {
@@ -54,7 +54,7 @@ function HazardSourcePanel() { 报警处置情况

温度待处置数/报警个数:0/0

压力待处置数/报警个数:0/0

-

液位待处置数/报警个数:1/1

+

液位待处置数/报警个数:0/0

diff --git a/src/pages/Container/Map/components/Content/IndexInfo/RightPanel/GatePanel/index.js b/src/pages/Container/Map/components/Content/IndexInfo/RightPanel/GatePanel/index.js index 0f09aaa..83111a1 100644 --- a/src/pages/Container/Map/components/Content/IndexInfo/RightPanel/GatePanel/index.js +++ b/src/pages/Container/Map/components/Content/IndexInfo/RightPanel/GatePanel/index.js @@ -7,9 +7,9 @@ import "./index.less"; function GatePanel() { const items = [ ["一级口门进出统计", gateBackground], - ["进入申请待审批", gateBackground], - ["封闭区域人员情况", closedBackground], - ["封闭区域作业情况", closedBackground], + ["一级口门进出审批", gateBackground], + ["封闭区域进出统计", closedBackground], + ["封闭区域进出审批", closedBackground], ]; return ( - +
{data.map(item => (
diff --git a/src/pages/Container/Map/components/Content/IndexInfo/index.js b/src/pages/Container/Map/components/Content/IndexInfo/index.js index 7d56317..4eaa190 100644 --- a/src/pages/Container/Map/components/Content/IndexInfo/index.js +++ b/src/pages/Container/Map/components/Content/IndexInfo/index.js @@ -2,6 +2,7 @@ import Bottom from "./Bottom"; import Btn from "./Btn"; import LeftPanel from "./LeftPanel"; import RightPanel from "./RightPanel"; + // import Search from "./Search"; function IndexInfo(props) { diff --git a/src/pages/Container/Map/components/Content/branchOffice/Camera/index.js b/src/pages/Container/Map/components/Content/branchOffice/Camera/index.js index 8ce8d49..42e0bd1 100644 --- a/src/pages/Container/Map/components/Content/branchOffice/Camera/index.js +++ b/src/pages/Container/Map/components/Content/branchOffice/Camera/index.js @@ -14,6 +14,7 @@ const gridList = [ { title: "九宫格", value: 9, gridColumnCount: 3, gridRowCount: 3 }, { title: "单画面", value: 1, gridColumnCount: 1, gridRowCount: 1 }, ]; + function Camera(props) { const { portArea, currentBranchOffice } = useContext(Context); @@ -127,7 +128,13 @@ function Camera(props) {
- +
diff --git a/src/pages/Container/Map/components/Content/branchOffice/IndexLeft/WeatherPreventionPanel/index.js b/src/pages/Container/Map/components/Content/branchOffice/IndexLeft/WeatherPreventionPanel/index.js index 9776510..f3ccc8a 100644 --- a/src/pages/Container/Map/components/Content/branchOffice/IndexLeft/WeatherPreventionPanel/index.js +++ b/src/pages/Container/Map/components/Content/branchOffice/IndexLeft/WeatherPreventionPanel/index.js @@ -9,20 +9,14 @@ import Panel from "~/pages/Container/Map/components/Content/branchOffice/Panel"; import { getAlertColor, getWeatherIcon } from "~/utils/weather"; import "./index.less"; -const records = [ - { department: "技术部", requiredDevices: 150, anchoredDevices: 142 }, - { department: "销售部", requiredDevices: 80, anchoredDevices: 76 }, - { department: "市场部", requiredDevices: 60, anchoredDevices: 58 }, - { department: "运营部", requiredDevices: 120, anchoredDevices: 115 }, - { department: "客服部", requiredDevices: 90, anchoredDevices: 88 }, - { department: "财务部", requiredDevices: 30, anchoredDevices: 29 }, - { department: "人事部", requiredDevices: 25, anchoredDevices: 24 }, - { department: "研发部", requiredDevices: 200, anchoredDevices: 195 }, - { department: "质量部", requiredDevices: 45, anchoredDevices: 42 }, - { department: "采购部", requiredDevices: 35, anchoredDevices: 33 }, +const statistics = [ + { label: "部门数", value: 10 }, + { label: "人员数", value: 1250 }, + { label: "相关单位数", value: 23 }, + { label: "相关方人员数", value: 1680 }, ]; -/** 负责查询并展示天气、预警和部门设备锚定情况。 */ +/** 负责查询并展示天气、预警及人员相关统计。 */ function WeatherPreventionPanel(props) { const [weather, setWeather] = useState({}); const [alerts, setAlerts] = useState([]); @@ -63,24 +57,30 @@ function WeatherPreventionPanel(props) {
- - {alerts.map((item, index) => ( -
- {item.title} -
- ))} -
+ { + alerts.length > 0 + ? ( + + {alerts.map((item, index) => ( +
+ {item.title} +
+ ))} +
+ ) + :
当前暂无气象预警
+ }
- +
@@ -104,26 +104,16 @@ function WeatherMetric({ icon, label, value }) { ); } -/** 天气预防区块内的部门设备锚定列表。 */ -function DepartmentTable({ records }) { +/** 天气预防区块内的部门及相关方统计块。 */ +function Statistics() { return ( -
-
-
部门名称
-
需锚定设备数
-
已锚定设备数
-
-
- - {records.map((item, index) => ( -
-
{item.department}
-
{item.requiredDevices}
-
{item.anchoredDevices}
-
- ))} -
-
+
+ {statistics.map(item => ( +
+
{item.label}
+
{item.value}
+
+ ))}
); } diff --git a/src/pages/Container/Map/components/Content/branchOffice/IndexLeft/WeatherPreventionPanel/index.less b/src/pages/Container/Map/components/Content/branchOffice/IndexLeft/WeatherPreventionPanel/index.less index 9608156..cba39a2 100644 --- a/src/pages/Container/Map/components/Content/branchOffice/IndexLeft/WeatherPreventionPanel/index.less +++ b/src/pages/Container/Map/components/Content/branchOffice/IndexLeft/WeatherPreventionPanel/index.less @@ -58,28 +58,28 @@ .branch-office-weather-prevention__alerts { height: 20px; - margin-top: 10px; overflow-y: hidden; } +.branch-office-weather-prevention__no-alerts { + font-size: 14px; + color: #fff; +} + .branch-office-weather-prevention__alert { font-size: 14px; font-weight: bold; } -.branch-office-weather-prevention__table { - margin-top: 5px; -} - -.branch-office-weather-prevention__table-body { - height: 60px; - overflow-y: hidden; -} - -.branch-office-weather-prevention__row { +.branch-office-weather-prevention__statistics { display: grid; - grid-template-columns: repeat(3, 1fr); + grid-template-columns: repeat(2, 1fr); + gap: 6px; margin-top: 5px; +} + +.branch-office-weather-prevention__statistic { + padding: 8px 10px; background-image: linear-gradient(to bottom, rgba(0, 42, 85, 0.38), rgba(1, 37, 74, 0.47), @@ -89,11 +89,18 @@ border-image: linear-gradient(to top, rgba(8, 41, 87, 0.5), rgba(64, 152, 255, 0.5)) 1; + display: flex; + align-items: center; + justify-content: space-between; } -.branch-office-weather-prevention__row div { - padding: 5px; +.branch-office-weather-prevention__statistic-label { color: #fff; font-size: 12px; - text-align: center; +} + +.branch-office-weather-prevention__statistic-value { + color: #00e7ff; + font-size: 18px; + font-weight: bold; } diff --git a/src/pages/Container/Map/components/Content/branchOffice/IndexRight/ClosedAreaPersonnelPanel/index.js b/src/pages/Container/Map/components/Content/branchOffice/IndexRight/ClosedAreaPersonnelPanel/index.js deleted file mode 100644 index 3ed3ec1..0000000 --- a/src/pages/Container/Map/components/Content/branchOffice/IndexRight/ClosedAreaPersonnelPanel/index.js +++ /dev/null @@ -1,245 +0,0 @@ -import { useMount } from "ahooks"; -import * as echarts from "echarts"; -import { useRef } from "react"; -import Panel from "~/pages/Container/Map/components/Content/branchOffice/Panel"; -import "./index.less"; - -const records = [ - { name: "技术部1", unitCount: 95, personnelCount: 92 }, - { name: "技术部2", unitCount: 95, personnelCount: 92 }, - { name: "技术部3", unitCount: 95, personnelCount: 92 }, - { name: "技术部4", unitCount: 95, personnelCount: 92 }, - { name: "技术部5", unitCount: 95, personnelCount: 92 }, - { name: "技术部6", unitCount: 95, personnelCount: 92 }, - { name: "技术部7", unitCount: 95, personnelCount: 92 }, - { name: "技术部8", unitCount: 95, personnelCount: 92 }, - { name: "技术部9", unitCount: 95, personnelCount: 92 }, - { name: "技术部0", unitCount: 95, personnelCount: 92 }, -]; - -/** 负责展示封闭区域人员状态图表,并管理图表实例生命周期。 */ -function ClosedAreaPersonnelPanel() { - const chartInstance = useRef(null); - const chartRef = useRef(null); - - const initEcharts = (mainRef, chartInstance, data) => { - chartInstance.current = echarts.init(mainRef.current); - - const option = { - color: ["#F1C416", "#0AFCFF"], - tooltip: { - trigger: "axis", - axisPointer: { - type: "shadow", - label: { - backgroundColor: "#6a7985", - }, - }, - }, - grid: { - left: "1%", - right: "4%", - bottom: "6%", - top: 30, - padding: "0 0 10 0", - containLabel: true, - }, - legend: { - right: 10, - top: 0, - itemGap: 16, - itemWidth: 18, - itemHeight: 10, - textStyle: { - color: "#fff", - fontStyle: "normal", - fontFamily: "微软雅黑", - fontSize: 12, - }, - }, - dataZoom: [ - { - type: "inside", - xAxisIndex: 0, - start: 0, - end: 50, - zoomOnMouseWheel: "shift", - moveOnMouseWheel: true, - moveOnMouseMove: true, - }, - { - type: "slider", - height: 6, - bottom: 0, - show: true, - start: 0, - end: 50, - handleSize: 3, - handleStyle: { - color: "#DCE2E8", - }, - xAxisIndex: [0], - filterMode: "filter", - showDetail: false, - }, - ], - xAxis: [ - { - type: "category", - boundaryGap: true, - data: data.map(item => item.name), - axisLabel: { - interval: 0, - margin: 15, - textStyle: { - color: "#fff", - fontStyle: "normal", - fontFamily: "微软雅黑", - fontSize: 12, - }, - }, - axisTick: { - show: false, - }, - axisLine: { - lineStyle: { - color: "#fff", - opacity: 0.2, - }, - }, - splitLine: { - show: false, - }, - }, - ], - yAxis: [ - { - type: "value", - splitNumber: 5, - axisLabel: { - textStyle: { - color: "#fff", - fontStyle: "normal", - fontFamily: "微软雅黑", - fontSize: 12, - }, - }, - axisLine: { - show: false, - }, - axisTick: { - show: false, - }, - splitLine: { - show: true, - lineStyle: { - color: ["#fff"], - opacity: 0.06, - }, - }, - }, - ], - series: [ - { - name: "单位人员数", - type: "pictorialBar", - symbol: "roundRect", - symbolOffset: [-5, 0], - symbolMargin: "1", - barWidth: "10%", - barMaxWidth: "20%", - animationDelay: (dataIndex, params) => { - return params.index * 50; - }, - itemStyle: { - normal: { - color: () => { - return new echarts.graphic.LinearGradient(0, 0, 1, 1, [ - { - offset: 0, - color: "#F1C416", - }, - { - offset: 1, - color: "#FF2F01", - }, - ]); - }, - }, - }, - z: 1, - barGap: 0, - symbolRepeat: true, - symbolSize: [14, 5], - data: data.map(item => item.unitCount), - animationEasing: "elasticOut", - stack: "2", - }, - { - name: "相关方人员数", - type: "pictorialBar", - symbol: "roundRect", - barWidth: "10%", - symbolOffset: [5, 0], - barMaxWidth: "20%", - symbolMargin: "1", - animationDelay: (dataIndex, params) => { - return params.index * 50; - }, - itemStyle: { - normal: { - color: () => { - return new echarts.graphic.LinearGradient(0, 0, 1, 1, [ - { - offset: 0, - color: "#0AFCFF", - }, - { - offset: 1, - color: "#0CA1FE", - }, - ]); - }, - }, - }, - z: 1, - barGap: 0, - symbolRepeat: true, - symbolSize: [14, 5], - data: data.map(item => item.personnelCount), - animationEasing: "elasticOut", - stack: "1", - }, - ], - }; - - chartInstance.current.setOption(option); - }; - - useMount(() => { - initEcharts(chartRef, chartInstance, records); - - return () => { - if (chartInstance.current) { - chartInstance.current.dispose(); - chartInstance.current = null; - } - }; - }); - - return ( - -
-
-
- - ); -} - -export default ClosedAreaPersonnelPanel; diff --git a/src/pages/Container/Map/components/Content/branchOffice/IndexRight/ClosedAreaPersonnelPanel/index.less b/src/pages/Container/Map/components/Content/branchOffice/IndexRight/ClosedAreaPersonnelPanel/index.less deleted file mode 100644 index 49dc520..0000000 --- a/src/pages/Container/Map/components/Content/branchOffice/IndexRight/ClosedAreaPersonnelPanel/index.less +++ /dev/null @@ -1,12 +0,0 @@ -.branch-office-index-right__personnel { - margin-top: 10px; -} - -.branch-office-closed-area-personnel__content { - padding: 10px 15px; -} - -.branch-office-closed-area-personnel__chart { - width: 100%; - height: 200px; -} diff --git a/src/pages/Container/Map/components/Content/branchOffice/IndexRight/KeyWorkStatsPanel/index.js b/src/pages/Container/Map/components/Content/branchOffice/IndexRight/KeyWorkStatsPanel/index.js index fb28859..6be4b34 100644 --- a/src/pages/Container/Map/components/Content/branchOffice/IndexRight/KeyWorkStatsPanel/index.js +++ b/src/pages/Container/Map/components/Content/branchOffice/IndexRight/KeyWorkStatsPanel/index.js @@ -7,46 +7,18 @@ import Panel from "~/pages/Container/Map/components/Content/branchOffice/Panel"; import { Context } from "~/pages/Container/Map/js/context"; import "./index.less"; -/** 负责合并两类作业统计并展示部门维度数据。 */ +/** 负责展示部门维度的重点作业统计。 */ function KeyWorkStatsPanel(props) { const { portArea, currentBranchOffice } = useContext(Context); const [data, setData] = useState([]); useEffect(() => { const loadData = async () => { - const [{ data: eightWorkData }, { data: keyProjectData }] - = await Promise.all([ - props.getEightWorkInfoScreenDepartmentStatistics({ - portArea, - corpinfoId: currentBranchOffice, - }), - props.getKeyProjectLargeScreenDepartmentStatistics({ - portArea, - corpinfoId: currentBranchOffice, - }), - ]); - const departmentMap = new Map( - (keyProjectData || []).map(item => [ - item.departmentId, - { - departmentName: item.departmentName, - fourNewHomeworkCount: item.fourNewHomeworkCount, - eightWorkCount: 0, - morePeopleCount: item.morePeopleCount, - }, - ]), - ); - (eightWorkData || []).forEach((item) => { - const department = departmentMap.get(item.departmentId) || { - departmentName: item.departmentName, - fourNewHomeworkCount: 0, - eightWorkCount: 0, - morePeopleCount: 0, - }; - department.eightWorkCount = item.workCount || 0; - departmentMap.set(item.departmentId, department); + const { data } = await props.getKeyProjectLargeScreenDepartmentStatistics({ + portArea, + corpinfoId: currentBranchOffice, }); - setData([...departmentMap.values()]); + setData(data || []); }; loadData(); }, []); @@ -61,7 +33,8 @@ function KeyWorkStatsPanel(props) {
部门名称
三人以上作业数
-
危险作业数
+
夜间作业数
+
其他作业数
四新作业数
@@ -69,8 +42,6 @@ function KeyWorkStatsPanel(props) { spinning={ props.biStatistics .getKeyProjectLargeScreenDepartmentStatisticsLoading - || props.biStatistics - .getEightWorkInfoScreenDepartmentStatisticsLoading } > @@ -81,7 +52,8 @@ function KeyWorkStatsPanel(props) { >
{item.departmentName}
{item.morePeopleCount}
-
{item.eightWorkCount}
+
{item.nightWorkCount}
+
{item.otherWorkCount}
{item.fourNewHomeworkCount}
))} diff --git a/src/pages/Container/Map/components/Content/branchOffice/IndexRight/KeyWorkStatsPanel/index.less b/src/pages/Container/Map/components/Content/branchOffice/IndexRight/KeyWorkStatsPanel/index.less index 0d2c255..c1e2a5b 100644 --- a/src/pages/Container/Map/components/Content/branchOffice/IndexRight/KeyWorkStatsPanel/index.less +++ b/src/pages/Container/Map/components/Content/branchOffice/IndexRight/KeyWorkStatsPanel/index.less @@ -17,7 +17,7 @@ .branch-office-key-work-stats__row { display: grid; - grid-template-columns: repeat(4, 1fr); + grid-template-columns: 1fr 1.5fr 1fr 1fr 1fr; margin-top: 5px; background-color: rgba(17, 51, 112, 0.8); } diff --git a/src/pages/Container/Map/components/Content/branchOffice/IndexRight/VideoPatrolPanel/index.js b/src/pages/Container/Map/components/Content/branchOffice/IndexRight/VideoPatrolPanel/index.js new file mode 100644 index 0000000..ded26fc --- /dev/null +++ b/src/pages/Container/Map/components/Content/branchOffice/IndexRight/VideoPatrolPanel/index.js @@ -0,0 +1,86 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Spin } from "antd"; +import { useContext, useEffect, useState } from "react"; +import AliPlayer from "zy-react-library/components/Video/AliPlayer"; +import videoBackground from "~/assets/images/public/bigScreen/bg14.png"; +import { NS_BI_STATISTICS } from "~/enumerate/namespace"; +import Panel from "~/pages/Container/Map/components/Content/branchOffice/Panel"; +import { Context } from "~/pages/Container/Map/js/context"; +import "./index.less"; + +/** 将接口返回的企业分组或平铺摄像头数据统一为可播放的视频列表。 */ +const formatVideoList = (data = []) => data.flatMap(item => ( + Array.isArray(item.fixedCameraCOList) ? item.fixedCameraCOList : [item] +)); + +/** 负责加载分公司摄像头并支持手动切换播放画面。 */ +function VideoPatrolPanel(props) { + const { portArea, currentBranchOffice } = useContext(Context); + const [videoList, setVideoList] = useState([]); + const [activeCameraNumber, setActiveCameraNumber] = useState(""); + const [playUrl, setPlayUrl] = useState(""); + + const selectVideo = async (video) => { + setActiveCameraNumber(video.cameraNumber); + setPlayUrl(""); + const { data, success } = await props.getFixedCameraPlayUrl({ + indexCode: video.cameraNumber, + }); + if (success) + setPlayUrl(data?.url || ""); + }; + + useEffect(() => { + const loadVideoList = async () => { + const { data } = await props.getFixedCameraVideoList({ + portArea, + corpinfoId: currentBranchOffice, + pageIndex: 1, + pageSize: 9999, + }); + const videos = formatVideoList(data || []); + setVideoList(videos); + if (videos.length) + selectVideo(videos[0]); + }; + + loadVideoList(); + }, []); + + return ( + +
+ +
+ {videoList.map(video => ( +
selectVideo(video)} + > + {video.videoName} +
+ ))} +
+
+
+ + {playUrl + ? + :
暂无视频
} +
+
+
+
+ ); +} + +export default Connect([NS_BI_STATISTICS], true)(VideoPatrolPanel); diff --git a/src/pages/Container/Map/components/Content/branchOffice/IndexRight/VideoPatrolPanel/index.less b/src/pages/Container/Map/components/Content/branchOffice/IndexRight/VideoPatrolPanel/index.less new file mode 100644 index 0000000..166bd87 --- /dev/null +++ b/src/pages/Container/Map/components/Content/branchOffice/IndexRight/VideoPatrolPanel/index.less @@ -0,0 +1,60 @@ +.branch-office-index-right__video-patrol { + margin-top: 10px; +} + +.branch-office-video-patrol__content { + display: flex; + gap: 10px; + padding: 10px 15px; +} + +.branch-office-video-patrol__menu { + width: 120px; + height: 180px; + padding: 5px; + overflow-y: auto; + background: rgb(13, 56, 119); + border-radius: 5px; +} + +.branch-office-video-patrol__menu-item { + display: block; + width: 100%; + padding: 0 8px; + margin-bottom: 5px; + overflow: hidden; + color: #fff; + font-size: 12px; + line-height: 30px; + text-align: center; + text-overflow: ellipsis; + white-space: nowrap; + cursor: pointer; + background: rgba(18, 96, 181, 0.4); + border: 0; + border-radius: 5px; +} + +.branch-office-video-patrol__menu-item--active, +.branch-office-video-patrol__menu-item:hover { + background: rgb(18, 96, 181); +} + +.branch-office-video-patrol__screen { + flex: 1; + height: 180px; + padding: 10px; + background-size: 100% 100%; +} + +.branch-office-video-patrol__screen .ant-spin-nested-loading, +.branch-office-video-patrol__screen .ant-spin-container { + height: 100%; +} + +.branch-office-video-patrol__empty { + height: 100%; + color: #fff; + line-height: 160px; + text-align: center; +} diff --git a/src/pages/Container/Map/components/Content/branchOffice/IndexRight/index.js b/src/pages/Container/Map/components/Content/branchOffice/IndexRight/index.js index d53d2d6..3d6203c 100644 --- a/src/pages/Container/Map/components/Content/branchOffice/IndexRight/index.js +++ b/src/pages/Container/Map/components/Content/branchOffice/IndexRight/index.js @@ -1,16 +1,16 @@ import AreaAlarmPanel from "./AreaAlarmPanel"; -import ClosedAreaPersonnelPanel from "./ClosedAreaPersonnelPanel"; import GateAndClosedAreaPanel from "./GateAndClosedAreaPanel"; import KeyWorkStatsPanel from "./KeyWorkStatsPanel"; +import VideoPatrolPanel from "./VideoPatrolPanel"; /** 分公司首页右侧区域仅负责按展示顺序组合业务区块。 */ function IndexRight() { return (
- - + +
); } diff --git a/src/pages/Container/Map/components/Content/branchOffice/MenJin/GateApplicationPanel/index.js b/src/pages/Container/Map/components/Content/branchOffice/MenJin/GateApplicationPanel/index.js index b88e58b..8caa99f 100644 --- a/src/pages/Container/Map/components/Content/branchOffice/MenJin/GateApplicationPanel/index.js +++ b/src/pages/Container/Map/components/Content/branchOffice/MenJin/GateApplicationPanel/index.js @@ -68,7 +68,9 @@ function GateApplicationPanel(props) {
结束时间
- + {isVisible && ( {data.map((item, index) => ( diff --git a/src/pages/Container/Map/components/Content/branchOffice/Panel/index.less b/src/pages/Container/Map/components/Content/branchOffice/Panel/index.less index 6d6cc67..3d31609 100644 --- a/src/pages/Container/Map/components/Content/branchOffice/Panel/index.less +++ b/src/pages/Container/Map/components/Content/branchOffice/Panel/index.less @@ -25,11 +25,8 @@ &__content { border: 1px solid; border-top: none; - border-image: linear-gradient( - to bottom, - rgba(58, 122, 149, 0), - rgba(58, 122, 149, 1) - ) - 1; + border-image: linear-gradient(to bottom, + rgba(58, 122, 149, 0), + rgba(58, 122, 149, 1)) 1; } } diff --git a/src/pages/Container/Map/components/Content/branchOffice/WeiXian/DepartmentWorkPanel/index.js b/src/pages/Container/Map/components/Content/branchOffice/WeiXian/DepartmentWorkPanel/index.js index 7011c8f..cc88699 100644 --- a/src/pages/Container/Map/components/Content/branchOffice/WeiXian/DepartmentWorkPanel/index.js +++ b/src/pages/Container/Map/components/Content/branchOffice/WeiXian/DepartmentWorkPanel/index.js @@ -13,39 +13,7 @@ function DepartmentWorkPanel(props) { const [data, setData] = useState([]); useEffect(() => { const loadData = async () => { - const [{ data: eightWorkData }, { data: keyProjectData }] - = await Promise.all([ - props.getEightWorkInfoScreenDepartmentStatistics({ - portArea, - corpinfoId: currentBranchOffice, - }), - props.getKeyProjectLargeScreenDepartmentStatistics({ - portArea, - corpinfoId: currentBranchOffice, - }), - ]); - const departmentMap = new Map( - (keyProjectData || []).map(item => [ - item.departmentId, - { - departmentName: item.departmentName, - fourNewHomeworkCount: item.fourNewHomeworkCount, - eightWorkCount: 0, - morePeopleCount: item.morePeopleCount, - }, - ]), - ); - (eightWorkData || []).forEach((item) => { - const department = departmentMap.get(item.departmentId) || { - departmentName: item.departmentName, - fourNewHomeworkCount: 0, - eightWorkCount: 0, - morePeopleCount: 0, - }; - department.eightWorkCount = item.workCount || 0; - departmentMap.set(item.departmentId, department); - }); - setData([...departmentMap.values()]); + }; loadData(); }, []); @@ -58,18 +26,12 @@ function DepartmentWorkPanel(props) {
部门名称
-
四新作业
-
危险作业
-
三人以上作业数
+
作业类型
+
作业状态
{data.map((item, index) => ( @@ -77,7 +39,6 @@ function DepartmentWorkPanel(props) {
{item.departmentName}
{item.fourNewHomeworkCount}
{item.eightWorkCount}
-
{item.morePeopleCount}
))} diff --git a/src/pages/Container/Map/components/Content/branchOffice/WeiXian/DepartmentWorkPanel/index.less b/src/pages/Container/Map/components/Content/branchOffice/WeiXian/DepartmentWorkPanel/index.less index c080b36..7cb428d 100644 --- a/src/pages/Container/Map/components/Content/branchOffice/WeiXian/DepartmentWorkPanel/index.less +++ b/src/pages/Container/Map/components/Content/branchOffice/WeiXian/DepartmentWorkPanel/index.less @@ -17,7 +17,7 @@ .branch-office-department-work__row { display: grid; - grid-template-columns: repeat(4, 1fr); + grid-template-columns: repeat(3, 1fr); margin-top: 5px; color: #fff; font-size: 12px; diff --git a/src/pages/Container/Map/components/Content/branchOffice/WeiXian/KeyWorkPanel/index.js b/src/pages/Container/Map/components/Content/branchOffice/WeiXian/KeyWorkPanel/index.js index d39ee35..18f9a12 100644 --- a/src/pages/Container/Map/components/Content/branchOffice/WeiXian/KeyWorkPanel/index.js +++ b/src/pages/Container/Map/components/Content/branchOffice/WeiXian/KeyWorkPanel/index.js @@ -1,133 +1,97 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime"; -import { Spin } from "antd"; -import { useContext, useEffect, useState } from "react"; -import CountUp from "react-countup"; -import firstBackground from "~/assets/images/map_bi/content/bg9.png"; -import secondBackground from "~/assets/images/map_bi/content/bg10.png"; +import * as echarts from "echarts"; +import { useEffect, useRef } from "react"; import { NS_BI_STATISTICS } from "~/enumerate/namespace"; import Panel from "~/pages/Container/Map/components/Content/branchOffice/Panel"; -import { Context } from "~/pages/Container/Map/js/context"; import "./index.less"; -const defaultStatistics = [ - { - title: ( - <> - 四新 -
- 作业 - - ), - currentCount: 0, - doingCount: 0, - archivedCount: 0, - }, - { - title: ( - <> - 危险 -
- 作业 - - ), - currentCount: 0, - doingCount: 0, - archivedCount: 0, - }, - { - title: ( - <> - 三人及 -
- 以上作业 - - ), - currentCount: 0, - doingCount: 0, - archivedCount: 0, - }, +const records = [ + { name: "动火作业", archivedCount: 24, workingCount: 6, approvalCount: 3 }, + { name: "受限空间", archivedCount: 18, workingCount: 4, approvalCount: 2 }, + { name: "高处作业", archivedCount: 32, workingCount: 8, approvalCount: 5 }, + { name: "吊装作业", archivedCount: 16, workingCount: 3, approvalCount: 1 }, + { name: "临时用电", archivedCount: 27, workingCount: 7, approvalCount: 4 }, + { name: "动土作业", archivedCount: 12, workingCount: 2, approvalCount: 2 }, + { name: "断路作业", archivedCount: 15, workingCount: 5, approvalCount: 3 }, + { name: "盲板抽堵", archivedCount: 9, workingCount: 1, approvalCount: 1 }, ]; -/** 负责查询并展示各重点作业的执行状态。 */ -function KeyWorkPanel(props) { - const { portArea, currentBranchOffice } = useContext(Context); - const [data, setData] = useState(defaultStatistics); +/** 展示八类危险作业在已归档、作业中和审批中三个状态下的数量。 */ +function KeyWorkPanel() { + const chartRef = useRef(null); + const chartInstance = useRef(null); + useEffect(() => { - const loadData = async () => { - const [{ data: eightWorkData }, { data: keyProjectData }] - = await Promise.all([ - props.getEightWorkInfoDangerWorkStatistics({ - portArea, - corpinfoId: currentBranchOffice, - }), - props.getKeyProjectLargeScreenStatistics({ - portArea, - corpinfoId: currentBranchOffice, - }), - ]); - setData([ - { - ...defaultStatistics[0], - currentCount: keyProjectData?.fourNewHomeworkStartCount, - doingCount: keyProjectData?.fourNewHomeworkDoingCount, - archivedCount: keyProjectData?.fourNewHomeworkArchiveCount, + chartInstance.current = echarts.init(chartRef.current); + chartInstance.current.setOption({ + color: ["#74CB3F", "#00AEFF", "#FFA800"], + tooltip: { + trigger: "axis", + axisPointer: { type: "shadow" }, + }, + legend: { + top: 0, + right: 0, + data: ["已归档", "作业中", "审批中"], + itemWidth: 12, + itemHeight: 10, + textStyle: { + color: "#fff", + fontSize: 12, }, - { - ...defaultStatistics[1], - currentCount: eightWorkData?.doingCount, - doingCount: eightWorkData?.workingCount, - archivedCount: eightWorkData?.archivedCount, + }, + grid: { + top: 35, + right: 10, + bottom: 10, + left: 10, + containLabel: true, + }, + xAxis: { + type: "category", + data: records.map(item => item.name), + axisTick: { show: false }, + axisLine: { + lineStyle: { color: "rgba(255, 255, 255, 0.25)" }, }, - { - ...defaultStatistics[2], - currentCount: keyProjectData?.morePeopleStartCount, - doingCount: keyProjectData?.morePeopleDoingCount, - archivedCount: keyProjectData?.morePeopleArchiveCount, + axisLabel: { + color: "#fff", + fontSize: 10, }, - ]); + }, + yAxis: { + type: "value", + axisLabel: { + color: "#fff", + fontSize: 10, + }, + axisLine: { show: false }, + axisTick: { show: false }, + splitLine: { + lineStyle: { + color: "rgba(255, 255, 255, 0.12)", + type: "dashed", + }, + }, + }, + series: [ + { name: "已归档", type: "bar", barMaxWidth: 14, data: records.map(item => item.archivedCount) }, + { name: "作业中", type: "bar", barMaxWidth: 14, data: records.map(item => item.workingCount) }, + { name: "审批中", type: "bar", barMaxWidth: 14, data: records.map(item => item.approvalCount) }, + ], + }); + + return () => { + chartInstance.current?.dispose(); + chartInstance.current = null; }; - loadData(); }, []); + return ( - - -
- {data.map((item, index) => ( -
-
{item.title}
-
- - - -
-
- ))} -
-
+ +
); } -function Statistic({ label, value }) { - return ( -
-
{label}
-
- -
-
- ); -} - export default Connect([NS_BI_STATISTICS], true)(KeyWorkPanel); diff --git a/src/pages/Container/Map/components/Content/branchOffice/WeiXian/KeyWorkPanel/index.less b/src/pages/Container/Map/components/Content/branchOffice/WeiXian/KeyWorkPanel/index.less index fa8a707..c4250d8 100644 --- a/src/pages/Container/Map/components/Content/branchOffice/WeiXian/KeyWorkPanel/index.less +++ b/src/pages/Container/Map/components/Content/branchOffice/WeiXian/KeyWorkPanel/index.less @@ -2,69 +2,8 @@ margin-top: 10px; } -.branch-office-key-work__list { +.branch-office-key-work__chart { + width: 100%; + height: 240px; padding: 10px 15px; } - -.branch-office-key-work__item { - display: flex; - align-items: center; - padding: 12px 0; - margin-top: 5px; - color: #fff; - background-repeat: no-repeat; - background-size: 100% 100%; -} - -.branch-office-key-work__item:first-child { - margin-top: 0; -} - -.branch-office-key-work__title { - display: flex; - align-items: center; - justify-content: center; - width: 65px; - height: 50px; - margin-left: 15px; - font-size: 14px; - font-weight: bold; - text-align: center; - border: 1px solid #167ce4; - border-radius: 4px; -} - -.branch-office-key-work__statistics { - display: flex; - flex: 1; - align-items: center; - justify-content: space-between; - margin: 0 30px; - text-align: center; -} - -.branch-office-key-work__label { - font-weight: bold; -} - -.branch-office-key-work__value { - font-size: 16px; -} - -.branch-office-key-work__statistics -> div:nth-child(1) -.branch-office-key-work__value { - color: #00aeff; -} - -.branch-office-key-work__statistics -> div:nth-child(2) -.branch-office-key-work__value { - color: #ffa800; -} - -.branch-office-key-work__statistics -> div:nth-child(3) -.branch-office-key-work__value { - color: #74cb3f; -} diff --git a/src/pages/Container/Map/components/Content/branchOffice/WeiXian/KeyWorkStatsPanel/index.js b/src/pages/Container/Map/components/Content/branchOffice/WeiXian/KeyWorkStatsPanel/index.js index 8f5a5d1..c6ac4ae 100644 --- a/src/pages/Container/Map/components/Content/branchOffice/WeiXian/KeyWorkStatsPanel/index.js +++ b/src/pages/Container/Map/components/Content/branchOffice/WeiXian/KeyWorkStatsPanel/index.js @@ -11,14 +11,9 @@ import { Context } from "~/pages/Container/Map/js/context"; import "./index.less"; const defaultStatistics = [ - { title: "四新作业", icon: fourNewIcon, currentCount: 0, applyCount: 0 }, - { title: "危险作业", icon: dangerIcon, currentCount: 0, applyCount: 0 }, - { - title: "三人及以上作业", - icon: multiPersonIcon, - currentCount: 0, - applyCount: 0, - }, + { title: "审批中", icon: fourNewIcon, count: 0 }, + { title: "作业中", icon: dangerIcon, count: 0 }, + { title: "已归档", icon: multiPersonIcon, count: 0 }, ]; /** 负责查询并展示重点作业当前数量与申请数量。 */ @@ -28,46 +23,14 @@ function KeyWorkStatsPanel(props) { useEffect(() => { const loadData = async () => { - const [{ data: eightWorkData }, { data: keyProjectData }] - = await Promise.all([ - props.getEightWorkInfoDangerWorkStatistics({ - portArea, - corpinfoId: currentBranchOffice, - }), - props.getKeyProjectLargeScreenStatistics({ - portArea, - corpinfoId: currentBranchOffice, - }), - ]); - setData([ - { - ...defaultStatistics[0], - currentCount: keyProjectData?.fourNewHomeworkStartCount, - applyCount: keyProjectData?.fourNewHomeworkApplyCount, - }, - { - ...defaultStatistics[1], - currentCount: eightWorkData?.workingCount, - applyCount: eightWorkData?.appliedCount, - }, - { - ...defaultStatistics[2], - currentCount: keyProjectData?.morePeopleStartCount, - applyCount: keyProjectData?.morePeopleApplyCount, - }, - ]); + }; loadData(); }, []); return ( - - + +
{data.map(item => (
- 当前作业数: - -
-
- 申请数: - +
))} diff --git a/src/pages/Container/Map/components/Content/branchOffice/WeiXian/KeyWorkStatsPanel/index.less b/src/pages/Container/Map/components/Content/branchOffice/WeiXian/KeyWorkStatsPanel/index.less index abc1dcb..4fcba2a 100644 --- a/src/pages/Container/Map/components/Content/branchOffice/WeiXian/KeyWorkStatsPanel/index.less +++ b/src/pages/Container/Map/components/Content/branchOffice/WeiXian/KeyWorkStatsPanel/index.less @@ -25,4 +25,5 @@ .branch-office-key-work-stats__info { margin-top: 5px; font-size: 12px; + text-align: center; } diff --git a/src/pages/Container/Map/components/Content/branchOffice/XiaoFang/FireInspectionRecordPanel/index.js b/src/pages/Container/Map/components/Content/branchOffice/XiaoFang/FireInspectionRecordPanel/index.js new file mode 100644 index 0000000..6db63ac --- /dev/null +++ b/src/pages/Container/Map/components/Content/branchOffice/XiaoFang/FireInspectionRecordPanel/index.js @@ -0,0 +1,45 @@ +import SeamlessScroll from "zy-react-library/components/SeamlessScroll"; +import Panel from "~/pages/Container/Map/components/Content/branchOffice/Panel"; +import "./index.less"; + +const records = [ + { inspectionForm: "码头消防点位检查表", principal: "张建国", pointCount: 28, status: "已完成" }, + { inspectionForm: "堆场消防点位检查表", principal: "李海峰", pointCount: 36, status: "已完成" }, + { inspectionForm: "仓储区消防点位检查表", principal: "王立新", pointCount: 22, status: "点检中" }, + { inspectionForm: "办公区消防点位检查表", principal: "赵明远", pointCount: 18, status: "待点检" }, + { inspectionForm: "散货区消防点位检查表", principal: "陈志强", pointCount: 31, status: "已完成" }, + { inspectionForm: "危化品区消防点位检查表", principal: "刘海涛", pointCount: 16, status: "异常" }, + { inspectionForm: "维修区消防点位检查表", principal: "孙志伟", pointCount: 24, status: "点检中" }, +]; + +/** 展示消防点位检查表的负责人、点位数量和当前点检状态。 */ +function FireInspectionRecordPanel() { + return ( + +
+
+
+
消防点位检查表
+
负责人
+
点位数
+
状态
+
+
+ + {records.map(item => ( +
+
{item.inspectionForm}
+
{item.principal}
+
{item.pointCount}
+
{item.status}
+
+ ))} +
+
+
+
+
+ ); +} + +export default FireInspectionRecordPanel; diff --git a/src/pages/Container/Map/components/Content/branchOffice/XiaoFang/FireInspectionRecordPanel/index.less b/src/pages/Container/Map/components/Content/branchOffice/XiaoFang/FireInspectionRecordPanel/index.less new file mode 100644 index 0000000..295df75 --- /dev/null +++ b/src/pages/Container/Map/components/Content/branchOffice/XiaoFang/FireInspectionRecordPanel/index.less @@ -0,0 +1,33 @@ +.branch-office-fire__inspection-record { + margin-top: 10px; +} + +.branch-office-fire-inspection-record__content { + padding: 10px 15px; +} + +.branch-office-fire-inspection-record__table { + margin-top: 5px; +} + +.branch-office-fire-inspection-record__body { + height: 155px; + overflow-y: hidden; +} + +.branch-office-fire-inspection-record__row { + display: grid; + grid-template-columns: 2fr 1fr 1fr 1fr; + margin-top: 5px; + background-color: rgba(17, 51, 112, 0.8); +} + +.branch-office-fire-inspection-record__row div { + padding: 5px; + overflow: hidden; + color: #fff; + font-size: 12px; + text-align: center; + text-overflow: ellipsis; + white-space: nowrap; +} diff --git a/src/pages/Container/Map/components/Content/branchOffice/XiaoFang/FirePumpRoomPanel/index.js b/src/pages/Container/Map/components/Content/branchOffice/XiaoFang/FirePumpRoomPanel/index.js deleted file mode 100644 index 56b88ec..0000000 --- a/src/pages/Container/Map/components/Content/branchOffice/XiaoFang/FirePumpRoomPanel/index.js +++ /dev/null @@ -1,126 +0,0 @@ -import { useState } from "react"; -import SeamlessScroll from "zy-react-library/components/SeamlessScroll"; -import Panel from "~/pages/Container/Map/components/Content/branchOffice/Panel"; -import "./index.less"; - -const tabs = ["消防水罐", "消防泵", "消防管线"]; -const records = [ - { - pumpRoomName: "一号消防泵房", - liquidLevel: 2.5, - waterPressure: 0.45, - status: 1, - }, - { - pumpRoomName: "二号消防泵房", - liquidLevel: 1.8, - waterPressure: 0.38, - status: 1, - }, - { - pumpRoomName: "三号消防泵房", - liquidLevel: 3.2, - waterPressure: 0.52, - status: 1, - }, - { - pumpRoomName: "四号消防泵房", - liquidLevel: 0.5, - waterPressure: 0.25, - status: 2, - }, - { - pumpRoomName: "五号消防泵房", - liquidLevel: 2.8, - waterPressure: 0.48, - status: 1, - }, - { - pumpRoomName: "六号消防泵房", - liquidLevel: 1.2, - waterPressure: 0.32, - status: 3, - }, - { - pumpRoomName: "七号消防泵房", - liquidLevel: 3.5, - waterPressure: 0.55, - status: 1, - }, - { - pumpRoomName: "八号消防泵房", - liquidLevel: 2.1, - waterPressure: 0.42, - status: 1, - }, - { - pumpRoomName: "九号消防泵房", - liquidLevel: 0.8, - waterPressure: 0.28, - status: 2, - }, - { - pumpRoomName: "十号消防泵房", - liquidLevel: 2.9, - waterPressure: 0.5, - status: 1, - }, -]; - -/** 负责展示消防泵房本地设备数据及分类标签状态。 */ -function FirePumpRoomPanel() { - const [activeIndex, setActiveIndex] = useState(0); - - return ( - - {tabs.map((item, index) => ( -
setActiveIndex(index)} - > - {item} -
- ))} -
- )} - > -
-
-
-
泵房名称
-
液位(米)
-
水压(mpa)
-
状态
-
-
- - {records.map((item, index) => ( -
-
{item.pumpRoomName}
-
{item.liquidLevel}
-
{`${item.waterPressure}MPa`}
-
- {item.status === 1 - ? "正常" - : item.status === 2 - ? "异常" - : "维护中"} -
-
- ))} -
-
-
-
-
- ); -} - -export default FirePumpRoomPanel; diff --git a/src/pages/Container/Map/components/Content/branchOffice/XiaoFang/FirePumpRoomPanel/index.less b/src/pages/Container/Map/components/Content/branchOffice/XiaoFang/FirePumpRoomPanel/index.less deleted file mode 100644 index 351eb77..0000000 --- a/src/pages/Container/Map/components/Content/branchOffice/XiaoFang/FirePumpRoomPanel/index.less +++ /dev/null @@ -1,57 +0,0 @@ -.branch-office-fire__pump-room { - margin-top: 10px; -} - -.branch-office-fire-pump-room__tabs { - display: flex; -} - -.branch-office-fire-pump-room__tab { - padding: 2px 6px; - color: #fff; - font-size: 12px; - cursor: pointer; - background-color: rgba(36, 115, 239, 0.27); - border: 1px solid #5d718c; - border-radius: 2px; -} - -.branch-office-fire-pump-room__tab--active { - background-color: #2473ef; - border-color: #2473ef; -} - -.branch-office-fire-pump-room__content { - padding: 10px 15px; -} - -.branch-office-fire-pump-room__table { - margin-top: 5px; -} - -.branch-office-fire-pump-room__body { - height: 155px; - overflow-y: hidden; -} - -.branch-office-fire-pump-room__row { - display: grid; - grid-template-columns: repeat(4, 1fr); - margin-top: 5px; - background-color: rgba(17, 51, 112, 0.8); -} - -.branch-office-fire-pump-room__row div { - padding: 5px; - color: #fff; - font-size: 12px; - text-align: center; -} - -.branch-office-fire-pump-room__row .branch-office-fire-pump-room__status--1 { - color: #60b321; -} - -.branch-office-fire-pump-room__row .branch-office-fire-pump-room__status--2 { - color: #f18308; -} diff --git a/src/pages/Container/Map/components/Content/branchOffice/XiaoFang/index.js b/src/pages/Container/Map/components/Content/branchOffice/XiaoFang/index.js index ca81a4e..bd30766 100644 --- a/src/pages/Container/Map/components/Content/branchOffice/XiaoFang/index.js +++ b/src/pages/Container/Map/components/Content/branchOffice/XiaoFang/index.js @@ -1,6 +1,6 @@ import FireAlarmRecordPanel from "./FireAlarmRecordPanel"; import FireDeviceStatusPanel from "./FireDeviceStatusPanel"; -import FirePumpRoomPanel from "./FirePumpRoomPanel"; +import FireInspectionRecordPanel from "./FireInspectionRecordPanel"; import VolunteerFireTeamPanel from "./VolunteerFireTeamPanel"; /** 分公司消防模块仅负责按展示顺序组合业务区块。 */ @@ -8,9 +8,9 @@ function XiaoFang() { return (
- - + +
); } diff --git a/src/pages/Container/Map/components/Content/modal/ConfinedSpaceWork/index.js b/src/pages/Container/Map/components/Content/modal/ConfinedSpaceWork/index.js index a519e65..40b7108 100644 --- a/src/pages/Container/Map/components/Content/modal/ConfinedSpaceWork/index.js +++ b/src/pages/Container/Map/components/Content/modal/ConfinedSpaceWork/index.js @@ -178,7 +178,7 @@ function ConfinedSpaceWork(props) { {info?.info?.step_14?.signPath && }
-
{ info?.info?.step_14?.status !== 0 && info?.info?.step_14?.signTime}
+
{info?.info?.step_14?.status !== 0 && info?.info?.step_14?.signTime}
{/*
{info?.info?.step_14?.remarks}
*/} 管理单位发包部门意见 diff --git a/src/pages/Container/Map/components/Content/modal/ElectricityWork/index.js b/src/pages/Container/Map/components/Content/modal/ElectricityWork/index.js index 4caed2f..3444502 100644 --- a/src/pages/Container/Map/components/Content/modal/ElectricityWork/index.js +++ b/src/pages/Container/Map/components/Content/modal/ElectricityWork/index.js @@ -129,7 +129,11 @@ function ElectricityWork(props) { )) - : 暂无数据 + : ( + + 暂无数据 + + ) } )) - : 暂无数据 + : ( + + 暂无数据 + + ) } 动火要求安全措施安全提示 @@ -188,7 +192,11 @@ function HotWork(props) { )) - : 暂无数据 + : ( + + 暂无数据 + + ) } diff --git a/src/pages/Container/Map/components/Content/modal/KeyProject/index.js b/src/pages/Container/Map/components/Content/modal/KeyProject/index.js index 643f8b5..99edb46 100644 --- a/src/pages/Container/Map/components/Content/modal/KeyProject/index.js +++ b/src/pages/Container/Map/components/Content/modal/KeyProject/index.js @@ -123,7 +123,11 @@ const KeyProject = (props) => { dataSource={info.keyProjectCameraList || []} columns={[ { title: "视频名称", dataIndex: "cameraName" }, - { title: "视频类型", dataIndex: "cameraType", render: (_, record) => getLabelName({ status: record.cameraType, list: VIDEO_TYPE }) }, + { + title: "视频类型", + dataIndex: "cameraType", + render: (_, record) => getLabelName({ status: record.cameraType, list: VIDEO_TYPE }), + }, ]} disabledResizer options={false} diff --git a/src/pages/Container/Map/components/Content/modal/VideoPlay/index.js b/src/pages/Container/Map/components/Content/modal/VideoPlay/index.js index 53557f2..c6cfc55 100644 --- a/src/pages/Container/Map/components/Content/modal/VideoPlay/index.js +++ b/src/pages/Container/Map/components/Content/modal/VideoPlay/index.js @@ -1,13 +1,13 @@ -import { Connect } from "@cqsjjb/jjb-dva-runtime"; -import { useEffect, useState } from "react"; +import {Connect} from "@cqsjjb/jjb-dva-runtime"; +import {useEffect, useState} from "react"; import AliPlayer from "zy-react-library/components/Video/AliPlayer"; -import { NS_BI_MARK_INFO } from "~/enumerate/namespace"; +import {NS_BI_MARK_INFO} from "~/enumerate/namespace"; const VideoPlay = (props) => { const [playUrl, setPlayUrl] = useState(""); const getData = async () => { - const { data, success } = await props.getFixedCameraPlayUrl({ indexCode: props.cameraNumber }); + const {data, success} = await props.getFixedCameraPlayUrl({indexCode: props.cameraNumber}); if (success && data) setPlayUrl(data.url); }; @@ -20,11 +20,11 @@ const VideoPlay = (props) => {
{playUrl ? ( - - ) + + ) : ( -
暂无视频
- )} +
暂无视频
+ )}
); }; diff --git a/src/pages/Container/Map/components/Content/modal/eightWordPubilc/index.less b/src/pages/Container/Map/components/Content/modal/eightWordPubilc/index.less index 4694440..a082ea4 100644 --- a/src/pages/Container/Map/components/Content/modal/eightWordPubilc/index.less +++ b/src/pages/Container/Map/components/Content/modal/eightWordPubilc/index.less @@ -10,7 +10,7 @@ padding: 8px; } - .title{ + .title { font-weight: 600; background-color: #0b1544; width: 200px; diff --git a/src/pages/Container/Map/components/Content/port/Panel/index.less b/src/pages/Container/Map/components/Content/port/Panel/index.less index dfba62a..20fa302 100644 --- a/src/pages/Container/Map/components/Content/port/Panel/index.less +++ b/src/pages/Container/Map/components/Content/port/Panel/index.less @@ -1,9 +1,7 @@ .port-panel { - background-image: linear-gradient( - to bottom, - rgba(0, 0, 0, 0), - rgba(0, 0, 0, 0.8) - ); + background-image: linear-gradient(to bottom, + rgba(0, 0, 0, 0), + rgba(0, 0, 0, 0.8)); &__title { display: flex; @@ -44,12 +42,9 @@ &__content { border: 1px solid; border-top: none; - border-image: linear-gradient( - to bottom, - rgba(58, 122, 149, 0), - rgba(58, 122, 149, 1) - ) - 1; + border-image: linear-gradient(to bottom, + rgba(58, 122, 149, 0), + rgba(58, 122, 149, 1)) 1; } } diff --git a/src/pages/Container/Map/components/Content/port/RenYuan/OnlineLocationInfoPanel/index.js b/src/pages/Container/Map/components/Content/port/RenYuan/OnlineLocationInfoPanel/index.js new file mode 100644 index 0000000..87fc0a6 --- /dev/null +++ b/src/pages/Container/Map/components/Content/port/RenYuan/OnlineLocationInfoPanel/index.js @@ -0,0 +1,43 @@ +import SeamlessScroll from "zy-react-library/components/SeamlessScroll"; +import Panel from "~/pages/Container/Map/components/Content/port/Panel"; +import "./index.less"; + +const records = [ + { corpName: "港区建设有限公司", onlinePersonnelCount: 126, onlineVehicleCount: 18 }, + { corpName: "临港工程有限公司", onlinePersonnelCount: 98, onlineVehicleCount: 12 }, + { corpName: "海港设备安装有限公司", onlinePersonnelCount: 75, onlineVehicleCount: 9 }, + { corpName: "港航建设集团", onlinePersonnelCount: 142, onlineVehicleCount: 21 }, + { corpName: "东港物流有限公司", onlinePersonnelCount: 86, onlineVehicleCount: 16 }, + { corpName: "港区能源有限公司", onlinePersonnelCount: 63, onlineVehicleCount: 7 }, + { corpName: "海运工程有限公司", onlinePersonnelCount: 109, onlineVehicleCount: 14 }, +]; + +/** 展示各公司当前在线定位的人员和车辆数量。 */ +function OnlineLocationInfoPanel() { + return ( + +
+
+
+
公司名称
+
在线定位人员数
+
在线定位车辆数
+
+
+ + {records.map(item => ( +
+
{item.corpName}
+
{item.onlinePersonnelCount}
+
{item.onlineVehicleCount}
+
+ ))} +
+
+
+
+
+ ); +} + +export default OnlineLocationInfoPanel; diff --git a/src/pages/Container/Map/components/Content/port/RenYuan/OnlineLocationInfoPanel/index.less b/src/pages/Container/Map/components/Content/port/RenYuan/OnlineLocationInfoPanel/index.less new file mode 100644 index 0000000..9829a83 --- /dev/null +++ b/src/pages/Container/Map/components/Content/port/RenYuan/OnlineLocationInfoPanel/index.less @@ -0,0 +1,33 @@ +.port-personnel__online-location-info { + margin-top: 10px; +} + +.port-online-location-info__content { + padding: 10px; +} + +.port-online-location-info__table { + margin-top: 5px; +} + +.port-online-location-info__body { + height: 155px; + overflow-y: hidden; +} + +.port-online-location-info__row { + display: grid; + grid-template-columns: 1.5fr 1fr 1fr; + margin-top: 5px; + background: rgba(42, 86, 158, 0.53); +} + +.port-online-location-info__cell { + padding: 5px; + overflow: hidden; + color: #fff; + font-size: 12px; + text-align: center; + text-overflow: ellipsis; + white-space: nowrap; +} diff --git a/src/pages/Container/Map/components/Content/port/RenYuan/index.js b/src/pages/Container/Map/components/Content/port/RenYuan/index.js index b910b9d..1081e77 100644 --- a/src/pages/Container/Map/components/Content/port/RenYuan/index.js +++ b/src/pages/Container/Map/components/Content/port/RenYuan/index.js @@ -1,11 +1,13 @@ import AlarmListPanel from "./AlarmListPanel"; import LocationInfoPanel from "./LocationInfoPanel"; +import OnlineLocationInfoPanel from "./OnlineLocationInfoPanel"; /** 人员定位模块仅负责按展示顺序组合业务区块。 */ function RenYuan() { return (
+
); diff --git a/src/pages/Container/Map/components/Content/port/WeiXian/WorkRecordPanel/index.less b/src/pages/Container/Map/components/Content/port/WeiXian/WorkRecordPanel/index.less index 02c7488..a9932c3 100644 --- a/src/pages/Container/Map/components/Content/port/WeiXian/WorkRecordPanel/index.less +++ b/src/pages/Container/Map/components/Content/port/WeiXian/WorkRecordPanel/index.less @@ -1,22 +1,28 @@ .port-danger-work__record { margin-top: 10px; } + .port-danger-work-record__content { padding: 10px; } + .port-danger-work-record__table { margin-top: 5px; } + .port-danger-work-record__table-body { height: 400px; overflow-y: hidden; } + .port-danger-work-record__row { display: flex; } + .port-danger-work-record__row:nth-child(odd) { background-color: rgba(42, 86, 158, 0.53); } + .port-danger-work-record__cell { flex: 1; padding: 5px; @@ -24,14 +30,17 @@ font-size: 12px; text-align: center; } + .port-danger-work-record__cell:first-child { flex: none; flex-basis: 50px; text-align: left; } + .port-danger-work-record__cell:nth-child(2) { flex-basis: 20%; } + .port-danger-work-record__rank { display: flex; align-items: center; @@ -44,15 +53,19 @@ line-height: 1; border-radius: 2px; } + .port-danger-work-record__rank--first { background: linear-gradient(135deg, #ff6d73, #f23f47); } + .port-danger-work-record__rank--second { background: linear-gradient(135deg, #ffb856, #ff871f); } + .port-danger-work-record__rank--third { background: linear-gradient(135deg, #ffe477, #f6be1b); } + .port-danger-work-record__rank--default { background: linear-gradient(135deg, #5a8fdc, #3367b4); } diff --git a/src/pages/Container/Map/components/Content/port/WeiXian/WorkStatusPanel/index.less b/src/pages/Container/Map/components/Content/port/WeiXian/WorkStatusPanel/index.less index b395e66..f66c311 100644 --- a/src/pages/Container/Map/components/Content/port/WeiXian/WorkStatusPanel/index.less +++ b/src/pages/Container/Map/components/Content/port/WeiXian/WorkStatusPanel/index.less @@ -3,11 +3,13 @@ justify-content: space-between; padding: 13px 15px; } + .port-danger-work-status__option { display: flex; flex-direction: column; align-items: center; } + .port-danger-work-status__icon { width: 70px; height: 70px; @@ -16,11 +18,13 @@ background-repeat: no-repeat; background-size: 100% 100%; } + .port-danger-work-status__icon img { width: 25px; height: 26px; animation: portDangerWorkStatusSlideY 2s infinite; } + .port-danger-work-status__label { display: flex; justify-content: center; @@ -34,6 +38,7 @@ background-repeat: no-repeat; background-size: 100% 100%; } + @keyframes portDangerWorkStatusSlideY { 0% { transform: translateY(0); diff --git a/src/pages/Container/Map/components/Content/port/WeiXian/WorkTrendPanel/index.less b/src/pages/Container/Map/components/Content/port/WeiXian/WorkTrendPanel/index.less index 77a2d76..f4ed648 100644 --- a/src/pages/Container/Map/components/Content/port/WeiXian/WorkTrendPanel/index.less +++ b/src/pages/Container/Map/components/Content/port/WeiXian/WorkTrendPanel/index.less @@ -1,9 +1,11 @@ .port-danger-work__trend { margin-top: 10px; } + .port-danger-work-trend__content { padding: 10px 15px; } + .port-danger-work-trend__chart { width: 100%; height: 240px; diff --git a/src/pages/Container/Map/components/Content/port/ZhongDian/KeyProjectPanel/index.less b/src/pages/Container/Map/components/Content/port/ZhongDian/KeyProjectPanel/index.less index 97e8fb1..ea0ed33 100644 --- a/src/pages/Container/Map/components/Content/port/ZhongDian/KeyProjectPanel/index.less +++ b/src/pages/Container/Map/components/Content/port/ZhongDian/KeyProjectPanel/index.less @@ -1,6 +1,7 @@ .port-key-supervision__project { margin-top: 10px; } + .port-key-project__options { position: relative; display: flex; @@ -10,12 +11,14 @@ height: 150px; padding: 10px 15px; } + .port-key-project__option { display: flex; align-items: center; justify-content: space-around; width: 50%; } + .port-key-project__icon { width: 70px; height: 70px; @@ -25,15 +28,18 @@ background-repeat: no-repeat; background-size: 100% 100%; } + .port-key-project__icon img { width: 25px; height: 26px; animation: portKeyProjectSlideY 2s infinite; } + .port-key-project__info { flex: 1; text-align: center; } + .port-key-project__label { width: 120px; height: 24px; @@ -45,20 +51,22 @@ background-repeat: no-repeat; background-size: 100% 100%; } + .port-key-project__count { margin-top: 13px; - font-family: - "PingFang SC", "Helvetica Neue", "Hiragino Sans GB", "Segoe UI", - "Microsoft YaHei", "微软雅黑", sans-serif; + font-family: "PingFang SC", "Helvetica Neue", "Hiragino Sans GB", "Segoe UI", + "Microsoft YaHei", "微软雅黑", sans-serif; font-weight: bold; background: linear-gradient(to top, #48bbf0, #fff); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; } + .port-key-project__count span { font-size: 24px; } + @keyframes portKeyProjectSlideY { 0% { transform: translateY(0); diff --git a/src/pages/Container/Map/components/Content/port/ZhongDian/KeyWorkInfoPanel/index.js b/src/pages/Container/Map/components/Content/port/ZhongDian/KeyWorkInfoPanel/index.js new file mode 100644 index 0000000..a7d7367 --- /dev/null +++ b/src/pages/Container/Map/components/Content/port/ZhongDian/KeyWorkInfoPanel/index.js @@ -0,0 +1,54 @@ +import SeamlessScroll from "zy-react-library/components/SeamlessScroll"; +import Panel from "~/pages/Container/Map/components/Content/port/Panel"; +import "./index.less"; + +const records = [ + { corpName: "港区建设有限公司", projectName: "码头泊位改造工程", projectStatus: "进行中" }, + { corpName: "临港工程有限公司", projectName: "堆场智能化升级工程", projectStatus: "未开工" }, + { corpName: "海港设备安装有限公司", projectName: "装卸设备检修工程", projectStatus: "完工申请中" }, + { corpName: "港航建设集团", projectName: "航道疏浚维护工程", projectStatus: "已结束" }, + { corpName: "东港物流有限公司", projectName: "散货泊位扩建工程", projectStatus: "进行中" }, + { corpName: "港区能源有限公司", projectName: "岸电设施建设工程", projectStatus: "开工申请中" }, + { corpName: "海运工程有限公司", projectName: "仓储区消防改造工程", projectStatus: "未开工" }, + { corpName: "海运工程有限公司", projectName: "仓储区消防改造工程", projectStatus: "未开工" }, + { corpName: "海运工程有限公司", projectName: "仓储区消防改造工程", projectStatus: "未开工" }, + { corpName: "海运工程有限公司", projectName: "仓储区消防改造工程", projectStatus: "未开工" }, + { corpName: "海运工程有限公司", projectName: "仓储区消防改造工程", projectStatus: "未开工" }, + { corpName: "海运工程有限公司", projectName: "仓储区消防改造工程", projectStatus: "未开工" }, + { corpName: "海运工程有限公司", projectName: "仓储区消防改造工程", projectStatus: "未开工" }, + { corpName: "海运工程有限公司", projectName: "仓储区消防改造工程", projectStatus: "未开工" }, + { corpName: "海运工程有限公司", projectName: "仓储区消防改造工程", projectStatus: "未开工" }, + { corpName: "海运工程有限公司", projectName: "仓储区消防改造工程", projectStatus: "未开工" }, + { corpName: "海运工程有限公司", projectName: "仓储区消防改造工程", projectStatus: "未开工" }, + { corpName: "海运工程有限公司", projectName: "仓储区消防改造工程", projectStatus: "未开工" }, +]; + +/** 展示重点作业的所属公司、工程名称和当前工程状态。 */ +function KeyWorkInfoPanel() { + return ( + +
+
+
+
所属公司
+
工程名称
+
工程状态
+
+
+ + {records.map((item, index) => ( +
+
{item.corpName}
+
{item.projectName}
+
{item.projectStatus}
+
+ ))} +
+
+
+
+
+ ); +} + +export default KeyWorkInfoPanel; diff --git a/src/pages/Container/Map/components/Content/port/ZhongDian/KeyWorkInfoPanel/index.less b/src/pages/Container/Map/components/Content/port/ZhongDian/KeyWorkInfoPanel/index.less new file mode 100644 index 0000000..4d822bd --- /dev/null +++ b/src/pages/Container/Map/components/Content/port/ZhongDian/KeyWorkInfoPanel/index.less @@ -0,0 +1,33 @@ +.port-key-supervision__work-info { + margin-top: 10px; +} + +.port-key-work-info__content { + padding: 10px 15px; +} + +.port-key-work-info__table { + margin-top: 5px; +} + +.port-key-work-info__body { + height: 350px; + overflow-y: hidden; +} + +.port-key-work-info__row { + display: grid; + grid-template-columns: 1fr 1.5fr 1fr; + margin-top: 5px; + background-color: rgba(17, 51, 112, 0.8); +} + +.port-key-work-info__cell { + padding: 5px; + overflow: hidden; + color: #fff; + font-size: 12px; + text-align: center; + text-overflow: ellipsis; + white-space: nowrap; +} diff --git a/src/pages/Container/Map/components/Content/port/ZhongDian/VideoLocationPanel/index.less b/src/pages/Container/Map/components/Content/port/ZhongDian/VideoLocationPanel/index.less index 3beaf4f..3e08155 100644 --- a/src/pages/Container/Map/components/Content/port/ZhongDian/VideoLocationPanel/index.less +++ b/src/pages/Container/Map/components/Content/port/ZhongDian/VideoLocationPanel/index.less @@ -2,17 +2,20 @@ display: flex; justify-content: space-between; } + .port-video-location__option { display: flex; flex-direction: row; align-items: center; } + .port-video-location__image { width: 225px; height: 160px; background-repeat: no-repeat; background-size: 100% 100%; } + .port-video-location__statistic { display: flex; flex: 1; @@ -20,9 +23,11 @@ font-size: 14px; line-height: 3; } + .port-video-location__statistic > div:first-child { margin-right: 5px; } + .port-video-location__statistic span { font-size: 14px; } diff --git a/src/pages/Container/Map/components/Content/port/ZhongDian/index.js b/src/pages/Container/Map/components/Content/port/ZhongDian/index.js index 18cf9cd..90d50b5 100644 --- a/src/pages/Container/Map/components/Content/port/ZhongDian/index.js +++ b/src/pages/Container/Map/components/Content/port/ZhongDian/index.js @@ -1,4 +1,5 @@ import KeyProjectPanel from "./KeyProjectPanel"; +import KeyWorkInfoPanel from "./KeyWorkInfoPanel"; import VideoLocationPanel from "./VideoLocationPanel"; /** 重点监管模块仅负责按展示顺序组合业务区块。 */ @@ -7,6 +8,7 @@ function ZhongDian() {
+
); } diff --git a/src/pages/Container/Map/components/Header/index.js b/src/pages/Container/Map/components/Header/index.js index 27eedaf..03c4402 100644 --- a/src/pages/Container/Map/components/Header/index.js +++ b/src/pages/Container/Map/components/Header/index.js @@ -6,6 +6,7 @@ import guangImg from "~/assets/images/map_bi/guang.png"; import topImg1 from "~/assets/images/map_bi/top1.png"; import topImg2 from "~/assets/images/map_bi/top2.png"; import { Context } from "~/pages/Container/Map/js/context"; +import { closeWindow } from "~/utils/weather"; import "./index.less"; // 标题切换时先让旧标题离开,再让新标题进入,上下滑动和淡入淡出效果。 @@ -16,19 +17,18 @@ const headerAnimation = { }; function Header(props) { - const { currentPort, currentBranchOffice, mapMethods, portArea, headerTitle, actions, closePopup } = useContext(Context); + const { + currentPort, + currentBranchOffice, + mapMethods, + portArea, + headerTitle, + actions, + closePopup, + } = useContext(Context); const isPortTitle = headerTitle === "秦港股份安全监管平台"; - const closeWindow = () => { - window.close(); - setTimeout(() => { - if (!window.closed && !window.opener) { - window.location.href = "https://gbs-gateway.qhdsafety.com/"; - } - }, 500); - }; - const onBack = () => { closePopup(); sessionStorage.removeItem("mapCurrentBranchOfficeId"); diff --git a/src/pages/Container/Map/components/RightUtils/index.js b/src/pages/Container/Map/components/RightUtils/index.js index 54e470b..2359b46 100644 --- a/src/pages/Container/Map/components/RightUtils/index.js +++ b/src/pages/Container/Map/components/RightUtils/index.js @@ -6,6 +6,7 @@ import tooltipImg2 from "~/assets/images/map_bi/right_utils/branch_office/bg11.p import buttonBg from "~/assets/images/map_bi/right_utils/branch_office/button.png"; import tooltipImg1 from "~/assets/images/map_bi/right_utils/port/tooltip.png"; import { Context } from "~/pages/Container/Map/js/context"; +import { closeWindow } from "~/utils/weather"; import { utilsList } from "./utilsList"; import "./index.less"; @@ -83,12 +84,7 @@ function RightUtils(props) { switch (type) { case "back": - window.close(); - setTimeout(() => { - if (!window.closed && !window.opener) { - window.location.href = "https://gbs-gateway.qhdsafety.com/"; - } - }, 500); + closeWindow(); break; case "full": props.toggleFullscreen(); diff --git a/src/utils/weather.js b/src/utils/weather.js index 033866f..400a734 100644 --- a/src/utils/weather.js +++ b/src/utils/weather.js @@ -50,3 +50,12 @@ export const getWeatherIcon = (weatherName) => { export const getAlertColor = (level) => { return { 蓝色预警: "#1E90FF", 黄色预警: "#FFA500", 橙色预警: "#FF4500", 红色预警: "#FF0000" }[level] || "#fff"; }; + +export const closeWindow = () => { + window.close(); + setTimeout(() => { + if (!window.closed && !window.opener) { + window.location.href = "https://gbs-gateway.qhdsafety.com/"; + } + }, 500); +};