BI修复文件命名错误警告
parent
0619dcb940
commit
cb74b2f690
|
|
@ -1,16 +1,17 @@
|
|||
|
||||
import "./index.less";
|
||||
import img1 from "~/assets/images/public/bigScreen/smalltitle.png";
|
||||
import img2 from "~/assets/images/public/bigScreen/bg13.png";
|
||||
import img3 from "~/assets/images/public/bigScreen/bg14.png";
|
||||
import img4 from "~/assets/images/public/bigScreen/more1.png";
|
||||
|
||||
import img1 from "~/assets/images/public/bigScreen/smalltitle.png";
|
||||
import "./index.less";
|
||||
|
||||
function BottomScreen() {
|
||||
return (
|
||||
<div className="bottom-container_con">
|
||||
<div className="top_container">
|
||||
<div className="title">管理九项 <img src={img4} alt=""/></div>
|
||||
<div className="title">
|
||||
管理九项
|
||||
<img src={img4} alt="" />
|
||||
</div>
|
||||
<div className="con">
|
||||
<div className="item">安全管理台账</div>
|
||||
<div className="item active">双重预防管理</div>
|
||||
|
|
@ -1,19 +1,13 @@
|
|||
|
||||
import "./index.less";
|
||||
import img9 from "~/assets/images/public/bigScreen/bg9.png";
|
||||
import img8 from "~/assets/images/public/bigScreen/bg10.png";
|
||||
import img7 from "~/assets/images/public/bigScreen/ico3.png";
|
||||
import img1 from "~/assets/images/public/bigScreen/smalltitle.png";
|
||||
import img2 from "~/assets/images/public/weather/1.png";
|
||||
import img3 from "~/assets/images/public/bigScreen/w_ico1.png";
|
||||
import img4 from "~/assets/images/public/bigScreen/w_ico2.png";
|
||||
import img5 from "~/assets/images/public/bigScreen/tablebg1.png";
|
||||
import img6 from "~/assets/images/public/bigScreen/tablebg2.png";
|
||||
import img7 from "~/assets/images/public/bigScreen/ico3.png";
|
||||
import img8 from "~/assets/images/public/bigScreen/bg10.png";
|
||||
import img9 from "~/assets/images/public/bigScreen/bg9.png";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import img3 from "~/assets/images/public/bigScreen/w_ico1.png";
|
||||
import img4 from "~/assets/images/public/bigScreen/w_ico2.png";
|
||||
import img2 from "~/assets/images/public/weather/1.png";
|
||||
import "./index.less";
|
||||
|
||||
function LeftScreen() {
|
||||
return (
|
||||
|
|
@ -68,21 +62,28 @@ function LeftScreen() {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div className=" block2">
|
||||
<div className="top" style={{ backgroundImage: `url(${img1})` }}>
|
||||
重大危险源运行情况
|
||||
</div>
|
||||
<div className="main">
|
||||
<div className="warning"> <img src={img7} alt=""/> 北区二号罐液位过低</div>
|
||||
<div className="warning">
|
||||
{" "}
|
||||
<img src={img7} alt="" />
|
||||
{" "}
|
||||
北区二号罐液位过低
|
||||
</div>
|
||||
<div className="main_item">
|
||||
<div className="list" style={{ backgroundImage: `url(${img8})` }}>
|
||||
<div className="title">二级重大危险源(1个)</div>
|
||||
<div className="main_con">
|
||||
<div className="item">储罐数:3</div>
|
||||
<div className="item ">再用数:3</div>
|
||||
<div className="item ">停用数: <span className="fcr">2</span></div>
|
||||
<div className="item ">
|
||||
停用数:
|
||||
<span className="fcr">2</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="list" style={{ backgroundImage: `url(${img8})` }}>
|
||||
|
|
@ -90,7 +91,10 @@ function LeftScreen() {
|
|||
<div className="main_con">
|
||||
<div className="item">储罐数:10</div>
|
||||
<div className="item ">再用数:10</div>
|
||||
<div className="item ">停用数: <span className="fcr">0</span></div>
|
||||
<div className="item ">
|
||||
停用数:
|
||||
<span className="fcr">0</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,20 +1,13 @@
|
|||
|
||||
import "./index.less";
|
||||
import img1 from "~/assets/images/public/bigScreen/smalltitle.png";
|
||||
import img5 from "~/assets/images/public/bigScreen/tablebg1.png";
|
||||
import img6 from "~/assets/images/public/bigScreen/tablebg2.png";
|
||||
import img8 from "~/assets/images/public/bigScreen/bg11.png";
|
||||
import img9 from "~/assets/images/public/bigScreen/bg12.png";
|
||||
import img2 from "~/assets/images/public/bigScreen/ico6.png";
|
||||
import img3 from "~/assets/images/public/bigScreen/ico7.png";
|
||||
import img4 from "~/assets/images/public/bigScreen/ico8.png";
|
||||
import img7 from "~/assets/images/public/bigScreen/ico9.png";
|
||||
import img8 from "~/assets/images/public/bigScreen/bg11.png";
|
||||
import img9 from "~/assets/images/public/bigScreen/bg12.png";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import img1 from "~/assets/images/public/bigScreen/smalltitle.png";
|
||||
import img5 from "~/assets/images/public/bigScreen/tablebg1.png";
|
||||
import img6 from "~/assets/images/public/bigScreen/tablebg2.png";
|
||||
import "./index.less";
|
||||
|
||||
function RightScreen() {
|
||||
return (
|
||||
|
|
@ -64,8 +57,6 @@ function RightScreen() {
|
|||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div className=" block2">
|
||||
<div className="top" style={{ backgroundImage: `url(${img1})` }}>
|
||||
|
|
@ -207,8 +198,6 @@ function RightScreen() {
|
|||
<div className="table-item">未处置</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
import img2 from "~/assets/images/public/bigScreen/close.png";
|
||||
import img1 from "~/assets/images/public/bigScreen/topbg.png";
|
||||
import "./index.less";
|
||||
|
||||
function SearchScreen() {
|
||||
return (
|
||||
<div className="search_container">
|
||||
<div className="top" style={{ backgroundImage: `url(${img1})` }}>
|
||||
<div className="list active">分公司列表</div>
|
||||
<div className="list">相关方列表</div>
|
||||
<div className="close">
|
||||
<img src={img2} alt="" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="main">
|
||||
<div className="search_con">
|
||||
<input type="text" placeholder="请输入公司名称" className="input" />
|
||||
</div>
|
||||
<div className="con">
|
||||
<div className="item">
|
||||
<div className="name">新益公司</div>
|
||||
<div className="btn">快捷登录</div>
|
||||
</div>
|
||||
<div className="item">
|
||||
<div className="name">新益公司</div>
|
||||
<div className="btn">快捷登录</div>
|
||||
</div>
|
||||
<div className="item">
|
||||
<div className="name">新益公司</div>
|
||||
<div className="btn">快捷登录</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default SearchScreen;
|
||||
|
|
@ -1,632 +0,0 @@
|
|||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import * as echarts from 'echarts';
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { NS_BI } from "~/enumerate/namespace";
|
||||
|
||||
import smallTitleImg from '../../../../assets/images/public/bigScreen/smalltitle.png'
|
||||
import temperature from '../../../../assets/images/public/bigScreen/img10.png'
|
||||
import windSpeed from '../../../../assets/images/public/bigScreen/img11.png'
|
||||
import hazardIcon from '../../../../assets/images/public/bigScreen/ico3.png'
|
||||
|
||||
import SunIcon from '../../../../assets/images/public/weather/1.png'
|
||||
import CloudIcon from '../../../../assets/images/public/weather/2.png'
|
||||
import CloudSunIcon from '../../../../assets/images/public/weather/3.png'
|
||||
import ThunderstormIcon from '../../../../assets/images/public/weather/4.png'
|
||||
import MildRainIcon from '../../../../assets/images/public/weather/5.png'
|
||||
// 中雨 6.png
|
||||
import ModerateRainIcon from '../../../../assets/images/public/weather/6.png'
|
||||
// 大雨 7.png
|
||||
import HeavyRainIcon from '../../../../assets/images/public/weather/7.png'
|
||||
// 暴雨 8.png
|
||||
import StormRainIcon from '../../../../assets/images/public/weather/8.png'
|
||||
// 小雪 9.png
|
||||
import SnowIcon from '../../../../assets/images/public/weather/9.png'
|
||||
// 中雪 10.png
|
||||
import ModerateSnowIcon from '../../../../assets/images/public/weather/10.png'
|
||||
// 大雪 11.png
|
||||
import HeavySnowIcon from '../../../../assets/images/public/weather/11.png'
|
||||
// 雨夹雪 12.png
|
||||
import SnowRainIcon from '../../../../assets/images/public/weather/12.png'
|
||||
// 雾 13.png
|
||||
import FogIcon from '../../../../assets/images/public/weather/13.png'
|
||||
// 霾 14.png
|
||||
import HazeIcon from '../../../../assets/images/public/weather/14.png'
|
||||
// 浮尘 15.png
|
||||
import DustIcon from '../../../../assets/images/public/weather/15.png'
|
||||
// 沙尘暴 16.png
|
||||
import DuststormIcon from '../../../../assets/images/public/weather/16.png'
|
||||
|
||||
|
||||
|
||||
// 天气类型与图标映射表
|
||||
const weatherIconMap = {
|
||||
// 晴天
|
||||
'晴天': <img src={SunIcon} style={{ width: 30, height: 30 }} />,
|
||||
'晴': <img src={SunIcon} style={{ width: 30, height: 30 }} />,
|
||||
// 多云
|
||||
'多云': <img src={CloudSunIcon} style={{ width: 30, height: 30 }} />,
|
||||
'阴': <img src={CloudIcon} style={{ width: 30, height: 30 }} />,
|
||||
// 雷阵雨
|
||||
'雷阵雨': <img src={ThunderstormIcon} style={{ width: 30, height: 30 }} />,
|
||||
// 小雨
|
||||
'小雨': <img src={MildRainIcon} style={{ width: 30, height: 30 }} />,
|
||||
// 中雨
|
||||
'中雨': <img src={ModerateRainIcon} style={{ width: 30, height: 30 }} />,
|
||||
// 大雨
|
||||
'大雨': <img src={HeavyRainIcon} style={{ width: 30, height: 30 }} />,
|
||||
// 暴雨
|
||||
'暴雨': <img src={StormRainIcon} style={{ width: 30, height: 30 }} />,
|
||||
// 小雪
|
||||
'小雪': <img src={SnowIcon} style={{ width: 30, height: 30 }} />,
|
||||
// 中雪
|
||||
'中雪': <img src={ModerateSnowIcon} style={{ width: 30, height: 30 }} />,
|
||||
// 大雪
|
||||
'大雪': <img src={HeavySnowIcon} style={{ width: 30, height: 30 }} />,
|
||||
// 雨夹雪
|
||||
'雨夹雪': <img src={SnowRainIcon} style={{ width: 30, height: 30 }} />,
|
||||
// 雾
|
||||
'雾': <img src={FogIcon} style={{ width: 30, height: 30 }} />,
|
||||
// 霾
|
||||
'霾': <img src={HazeIcon} style={{ width: 30, height: 30 }} />,
|
||||
// 浮尘
|
||||
'浮尘': <img src={DustIcon} style={{ width: 30, height: 30 }} />,
|
||||
// 沙尘暴
|
||||
'沙尘暴': <img src={DuststormIcon} style={{ width: 30, height: 30 }} />,
|
||||
// 默认图标
|
||||
'默认': <img src={SunIcon} style={{ width: 30, height: 30 }} />
|
||||
};
|
||||
|
||||
// 根据天气中文名称获取对应图标
|
||||
const getWeatherIcon = (weatherName) => {
|
||||
// 遍历天气映射表,找到匹配的图标
|
||||
for (const [key, icon] of Object.entries(weatherIconMap)) {
|
||||
if (weatherName.includes(key)) {
|
||||
return icon;
|
||||
}
|
||||
}
|
||||
// 如果没有匹配的,返回默认图标
|
||||
return weatherIconMap['默认'];
|
||||
};
|
||||
|
||||
// 根据预警级别获取颜色
|
||||
const getAlertColor = (level) => {
|
||||
switch (level) {
|
||||
case '蓝色预警':
|
||||
return '#1E90FF';
|
||||
case '黄色预警':
|
||||
return '#FFA500';
|
||||
case '橙色预警':
|
||||
return '#FF4500';
|
||||
case '红色预警':
|
||||
return '#FF0000';
|
||||
default:
|
||||
return '#fff';
|
||||
}
|
||||
};
|
||||
|
||||
// 天气预报卡片组件
|
||||
const WeatherCard = (props) => {
|
||||
const [weatherData, setWeatherData] = useState({
|
||||
text: '晴天',
|
||||
temp: '36.5',
|
||||
wind_class: '8级',
|
||||
})
|
||||
const [weatherIcon, setWeatherIcon] = useState()
|
||||
const [alert, setAlert] = useState([])
|
||||
const [currentAlertIndex, setCurrentAlertIndex] = useState(0)
|
||||
useEffect(() => {
|
||||
const fetchWeatherData = async () => {
|
||||
try {
|
||||
const response = await fetch('https://api.map.baidu.com/weather/v1/?district_id=130300&data_type=all&ak=dIqOi34IlTg5FkNck1vqoBpLhPAj36S1');
|
||||
const data = await response.json();
|
||||
setWeatherData(data.result.now);
|
||||
setWeatherIcon(getWeatherIcon(data.result.now.text));
|
||||
setAlert(Array.isArray(data.result.alerts) ? data.result.alerts : []);
|
||||
} catch (error) {
|
||||
console.error('获取天气数据失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
fetchWeatherData();
|
||||
}, []);
|
||||
|
||||
// 添加定时器实现预警信息自动切换
|
||||
useEffect(() => {
|
||||
if (!alert?.length || alert.length <= 1) return;
|
||||
|
||||
const alertInterval = setInterval(() => {
|
||||
setCurrentAlertIndex((prevIndex) =>
|
||||
prevIndex === (alert?.length || 0) - 1 ? 0 : prevIndex + 1
|
||||
);
|
||||
}, 3000);
|
||||
|
||||
return () => clearInterval(alertInterval);
|
||||
}, [alert?.length]);
|
||||
|
||||
|
||||
return (
|
||||
<div className="card">
|
||||
<div className="card-header" style={{ backgroundImage: `url(${smallTitleImg})` }}>
|
||||
<div className="card-header__text">天气预报情况</div>
|
||||
</div>
|
||||
<div className="weather-card__content">
|
||||
<div className="weather-main">
|
||||
<div className="weather-icon">
|
||||
<div className="icon-container">
|
||||
<div className="icon">{weatherIcon}</div>
|
||||
</div>
|
||||
<div className="buttom">{weatherData.text}</div>
|
||||
</div>
|
||||
<div className="weather-info">
|
||||
<div className="weather-info__item">
|
||||
<img src={temperature} />
|
||||
<div className="weather-info__text">
|
||||
<p>温度:</p>
|
||||
<p>{weatherData.temp}℃</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="weather-info__item">
|
||||
<img src={windSpeed} />
|
||||
<div className="weather-info__text">
|
||||
<p>风速:</p>
|
||||
<p>{weatherData.wind_class}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="weather-alert" style={{ position: 'relative', height: '30px', overflow: 'hidden' }}>
|
||||
{alert?.length === 1 ? (
|
||||
<p style={{ color: getAlertColor(alert[0].level), margin: '0', padding: '5px 0' }}>{alert[0].title}</p>
|
||||
) : alert?.length > 1 ? (
|
||||
<div
|
||||
className="alert-slider"
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: '0',
|
||||
left: '0',
|
||||
width: '100%',
|
||||
transform: `translateY(${-currentAlertIndex * 30}px)`,
|
||||
transition: 'transform 0.5s ease-in-out'
|
||||
}}
|
||||
>
|
||||
{alert.map((item, index) => (
|
||||
<p
|
||||
key={index}
|
||||
className="alert-item"
|
||||
style={{
|
||||
color: getAlertColor(item.level),
|
||||
margin: '0',
|
||||
padding: '5px 0',
|
||||
height: '30px',
|
||||
lineHeight: '20px'
|
||||
}}
|
||||
>
|
||||
{item.title}
|
||||
</p>
|
||||
))}
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
// 防汛状态组件
|
||||
const FloodControlStatus = () => {
|
||||
const floodData = [
|
||||
{ company: '新益公司', status: '未处置', measures: '--' },
|
||||
{ company: '二公司', status: '已处置', measures: '远离大树、电线杆、简易房等...' },
|
||||
{ company: '六公司', status: '处置中', measures: '关闭门窗,加固模板、棚架、广告...' },
|
||||
{ company: '一公司', status: '未处置', measures: '--' },
|
||||
{ company: '三公司', status: '已处置', measures: '远离大树、电线杆、简易房等...' },
|
||||
{ company: '五公司', status: '处置中', measures: '关闭门窗,加固模板、棚架、广告...' }
|
||||
];
|
||||
|
||||
const tableBodyRef = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
const tableBody = tableBodyRef.current;
|
||||
if (!tableBody) return;
|
||||
|
||||
// 获取实际行高
|
||||
const firstRow = tableBody.querySelector('.table-row');
|
||||
const rowHeight = firstRow ? firstRow.offsetHeight : 30;
|
||||
const originalDataLength = floodData.length;
|
||||
|
||||
let scrollTop = 0;
|
||||
|
||||
const scrollInterval = setInterval(() => {
|
||||
scrollTop += 1;
|
||||
|
||||
// 当滚动到原始数据末尾时,无缝重置到起始位置
|
||||
if (scrollTop >= originalDataLength * rowHeight) {
|
||||
scrollTop = 0;
|
||||
}
|
||||
|
||||
tableBody.scrollTop = scrollTop;
|
||||
}, 50);
|
||||
|
||||
return () => clearInterval(scrollInterval);
|
||||
}, [floodData]);
|
||||
|
||||
return (
|
||||
<div className="alert-control-card">
|
||||
<div className="card-body">
|
||||
<div className="table-header">
|
||||
<span>公司名称</span>
|
||||
<span>处置状态</span>
|
||||
<span>预防措施</span>
|
||||
</div>
|
||||
<div className="table-body" ref={tableBodyRef}>
|
||||
{[...floodData, ...floodData].map((item, index) => (
|
||||
<div key={index} className="table-row">
|
||||
<span>{item.company}</span>
|
||||
<span className={`status-${item.status === '已处置' ? 'done' : item.status === '处置中' ? 'processing' : 'pending'}`}>
|
||||
{item.status}
|
||||
</span>
|
||||
<span>{item.measures}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
// 重大危险源组件
|
||||
const MajorHazards = () => {
|
||||
const [selectedHazard, setSelectedHazard] = useState('北区二号罐液位过低');
|
||||
|
||||
const hazards = [
|
||||
{ id: 1, name: '北区二号罐液位过低', level: '二级', type: '液位低' },
|
||||
// 可以添加更多危险源
|
||||
];
|
||||
|
||||
const tankStatusList = [
|
||||
{ name: '东区二号罐', status: '正常' },
|
||||
{ name: '北区二号罐', status: '液位低' },
|
||||
{ name: '东区三号罐', status: '正常' },
|
||||
{ name: '北区二号罐', status: '正常' }
|
||||
];
|
||||
|
||||
const alarmHandlingData = [
|
||||
{ type: '温度待处置数/预警个数', value: '0/0' },
|
||||
{ type: '压力待处置数/预警个数', value: '0/0' },
|
||||
{ type: '液位待处置数/预警个数', value: '1/1' }
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="card hazards-card">
|
||||
<div className="card-header" style={{ backgroundImage: `url(${smallTitleImg})` }}>
|
||||
<div className="card-header__text">重大危险源运行情况</div>
|
||||
</div>
|
||||
<div className="card-body">
|
||||
{/* 告警中的危险源 */}
|
||||
<div className="selected-hazard">
|
||||
<div className="hazard-item">
|
||||
<img src={hazardIcon} />
|
||||
<span className="hazard-name">{selectedHazard}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 危险源统计 */}
|
||||
<div className="hazard-levels">
|
||||
<div className="hazard-level">
|
||||
<div className="hazard-level__title">二级重大危险源 (1个)</div>
|
||||
<div className="hazard-level__content">
|
||||
<div className="hazard-level__item">储罐数: 3</div>
|
||||
<div className="hazard-level__item">再用数: 3</div>
|
||||
<div className="hazard-level__item">停用数: 0</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="hazard-level">
|
||||
<div className="hazard-level__title">三级重大危险源 (2个)</div>
|
||||
<div className="hazard-level__content">
|
||||
<div className="hazard-level__item">储罐数: 10</div>
|
||||
<div className="hazard-level__item">再用数: 10</div>
|
||||
<div className="hazard-level__item">停用数: 0</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 储罐状态和报警处置情况容器 */}
|
||||
<div className="tank-alarm-container">
|
||||
{/* 储罐状态列表 */}
|
||||
<div className="tank-status-list">
|
||||
<div className="tank-status-scroller">
|
||||
<div className="tank-status-scroll-content">
|
||||
{/* 原始数据 */}
|
||||
{tankStatusList.map((tank, index) => (
|
||||
<div key={`original-${index}`} className="tank-status-item">
|
||||
<span className="tank-name">{tank.name}</span>
|
||||
<span className={`tank-status ${tank.status === '正常' ? 'normal' : 'warning'}`}>
|
||||
{tank.status}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
{/* 复制数据用于无缝滚动 */}
|
||||
{tankStatusList.map((tank, index) => (
|
||||
<div key={`duplicate-${index}`} className="tank-status-item">
|
||||
<span className="tank-name">{tank.name}</span>
|
||||
<span className={`tank-status ${tank.status === '正常' ? 'normal' : 'warning'}`}>
|
||||
{tank.status}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 报警处置情况 */}
|
||||
<div className="alarm-handling">
|
||||
<div className="alarm-handling__title">报警处置情况</div>
|
||||
<div className="alarm-handling__content">
|
||||
{alarmHandlingData.map((item, index) => (
|
||||
<div key={index} className="alarm-handling__item">
|
||||
<span className="item-label">{item.type}</span>
|
||||
<span className="item-value">{item.value}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// 领域整改情况统计组件
|
||||
const DomainRectification = ({ chartRef }) => {
|
||||
const initChart = () => {
|
||||
if (chartRef.current) {
|
||||
const chart = echarts.init(chartRef.current);
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
backgroundColor: 'rgba(35, 53, 93, 0.8)',
|
||||
borderColor: 'rgba(66, 105, 143, 0.8)',
|
||||
borderWidth: 1,
|
||||
textStyle: {
|
||||
color: '#fff'
|
||||
},
|
||||
formatter: function (params) {
|
||||
let result = params[0].name + '<br/>';
|
||||
params.forEach(item => {
|
||||
result += `${item.seriesName}: ${item.value}<br/>`;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['整改隐患数', '未整改隐患数', '整改率'],
|
||||
textStyle: {
|
||||
color: '#fff'
|
||||
},
|
||||
right: 10,
|
||||
top: 0
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '10%',
|
||||
top: '20%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: ['输电', '电力', '流机', '技术中心', '铁运', '煤炭', '新益公司'],
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#42698f'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#fff',
|
||||
rotate: 45
|
||||
}
|
||||
},
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '数量',
|
||||
min: 0,
|
||||
max: 100,
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#42698f'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#fff'
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: 'rgba(66, 105, 143, 0.3)'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '整改率',
|
||||
min: 0,
|
||||
max: 100,
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#42698f'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#fff',
|
||||
formatter: '{value}%'
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
}
|
||||
}
|
||||
],
|
||||
series: function() {
|
||||
const rectified = [35, 40, 90, 50, 60, 75, 45];
|
||||
const unrectified = [8, 12, 5, 15, 20, 10, 5];
|
||||
|
||||
// Calculate rectification rate (rectified / total * 100, rounded to 2 decimals)
|
||||
const calculateRate = () => {
|
||||
return rectified.map((r, index) => {
|
||||
const total = r + unrectified[index];
|
||||
return total > 0 ? parseFloat(((r / total) * 100).toFixed(2)) : 0;
|
||||
});
|
||||
};
|
||||
|
||||
return [
|
||||
{
|
||||
name: '整改隐患数',
|
||||
type: 'bar',
|
||||
stack: 'hidden',
|
||||
barWidth: 10,
|
||||
data: rectified,
|
||||
itemStyle: {
|
||||
color: '#faad14'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '未整改隐患数',
|
||||
type: 'bar',
|
||||
stack: 'hidden',
|
||||
barWidth: 10,
|
||||
data: unrectified,
|
||||
itemStyle: {
|
||||
color: '#ff4d4f'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '整改率',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: calculateRate(),
|
||||
itemStyle: {
|
||||
color: '#52c41a'
|
||||
},
|
||||
lineStyle: {
|
||||
width: 2
|
||||
},
|
||||
symbolSize: 8
|
||||
}
|
||||
];
|
||||
}()
|
||||
};
|
||||
chart.setOption(option);
|
||||
|
||||
// 响应式调整
|
||||
window.addEventListener('resize', () => {
|
||||
chart.resize();
|
||||
});
|
||||
|
||||
return chart;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const chart = initChart();
|
||||
return () => {
|
||||
if (chart) {
|
||||
chart.dispose();
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="card">
|
||||
<div className="card-header" style={{ backgroundImage: `url(${smallTitleImg})` }}>
|
||||
<div className="card-header__text">领域整改情况统计</div>
|
||||
</div>
|
||||
<div className="card-body">
|
||||
<div className="chart-container" ref={chartRef} style={{ width: '100%', height: '180px' }}></div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
// 公司作业情况组件
|
||||
const CompanyOperationStatus = () => {
|
||||
const operationData = [
|
||||
{ company: '秦港股份七公司', total: 16630, rectified: 15432, pending: 529, verified: 338 },
|
||||
{ company: '秦港股份二公司', total: 12771, rectified: 11321, pending: 151, verified: 249 },
|
||||
{ company: '秦港股份一公司', total: 12451, rectified: 11321, pending: 151, verified: 249 },
|
||||
{ company: '秦港股份三公司', total: 5533, rectified: 64455, pending: 151, verified: 249 }
|
||||
];
|
||||
|
||||
const tableBodyRef = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
const tableBody = tableBodyRef.current;
|
||||
if (!tableBody) return;
|
||||
|
||||
// 获取实际行高
|
||||
const firstRow = tableBody.querySelector('.table-row');
|
||||
const rowHeight = firstRow ? firstRow.offsetHeight : 30;
|
||||
const originalDataLength = operationData.length;
|
||||
|
||||
let scrollTop = 0;
|
||||
|
||||
const scrollInterval = setInterval(() => {
|
||||
scrollTop += 1;
|
||||
|
||||
// 当滚动到原始数据末尾时,无缝重置到起始位置
|
||||
if (scrollTop >= originalDataLength * rowHeight) {
|
||||
scrollTop = 0;
|
||||
}
|
||||
|
||||
tableBody.scrollTop = scrollTop;
|
||||
}, 50);
|
||||
|
||||
return () => clearInterval(scrollInterval);
|
||||
}, [operationData]);
|
||||
|
||||
return (
|
||||
<div className="card operation-status-card">
|
||||
<div className="card-header" style={{ backgroundImage: `url(${smallTitleImg})` }}>
|
||||
<div className="card-header__text">当前各公司作业中情况</div>
|
||||
</div>
|
||||
<div className="card-body">
|
||||
<div className="table-header">
|
||||
<span>公司名称</span>
|
||||
<span>发现隐患数</span>
|
||||
<span>整改隐患数</span>
|
||||
<span>待整改</span>
|
||||
<span>待验收</span>
|
||||
</div>
|
||||
<div className="table-body" ref={tableBodyRef}>
|
||||
{[...operationData, ...operationData].map((item, index) => (
|
||||
<div key={index} className="table-row">
|
||||
<span>{item.company}</span>
|
||||
<span>{item.total}</span>
|
||||
<span>{item.rectified}</span>
|
||||
<span>{item.pending}</span>
|
||||
<span>{item.verified}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// 主左侧面板组件
|
||||
const LeftPanel = (props) => {
|
||||
const chartRef = useRef(null);
|
||||
|
||||
return (
|
||||
<div className="left-panel">
|
||||
<WeatherCard getWeather={props["getWeather"]} />
|
||||
<FloodControlStatus />
|
||||
<MajorHazards />
|
||||
<DomainRectification chartRef={chartRef} />
|
||||
<CompanyOperationStatus />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Connect([NS_BI], true)(LeftPanel);
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
|
||||
import "./index.less";
|
||||
import img1 from "~/assets/images/public/bigScreen/topbg.png";
|
||||
import img2 from "~/assets/images/public/bigScreen/close.png";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function SearchScreen() {
|
||||
return (
|
||||
<div className="search_container">
|
||||
<div className="top" style={{ backgroundImage: `url(${img1})` }}>
|
||||
<div className="list active">分公司列表</div>
|
||||
<div className="list">相关方列表</div>
|
||||
<div className="close">
|
||||
<img src={img2} alt=""/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="main">
|
||||
<div className="search_con">
|
||||
<input type="text" placeholder={"请输入公司名称"} className="input"/>
|
||||
</div>
|
||||
<div className="con">
|
||||
<div className="item">
|
||||
<div className="name">新益公司</div>
|
||||
<div className="btn">快捷登录</div>
|
||||
</div>
|
||||
<div className="item">
|
||||
<div className="name">新益公司</div>
|
||||
<div className="btn">快捷登录</div>
|
||||
</div>
|
||||
<div className="item">
|
||||
<div className="name">新益公司</div>
|
||||
<div className="btn">快捷登录</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default SearchScreen;
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
import { ArrowLeftOutlined } from "@ant-design/icons";
|
||||
import title from "../../../../assets/images/public/bigScreen/title.png";
|
||||
|
||||
const TopTitleArea = () => {
|
||||
const handleGoBack = () => {
|
||||
// navigate(-1);
|
||||
};
|
||||
|
||||
const handleGoToBackStage = () => {
|
||||
// navigate('/navPage');
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="top-title-area">
|
||||
<div className="top-title-area__img" style={{ backgroundImage: `url(${title})` }}>
|
||||
<div className="top-title-area__back" onClick={handleGoBack}>
|
||||
<ArrowLeftOutlined className="icon-arrow__left" />
|
||||
返回
|
||||
</div>
|
||||
<p className="top-title-area__img__text">秦港股份安全监管平台</p>
|
||||
<div className="top-title-area__img__box">
|
||||
<img
|
||||
className="top-title-area__img__guang"
|
||||
src="../../../../assets/images/public/bigScreen/guang.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<div className="top-title-area__right" onClick={handleGoToBackStage}>
|
||||
<div className="top-title-area__right__text">应用后台</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default TopTitleArea;
|
||||
|
|
@ -1,18 +1,18 @@
|
|||
import backgroundimg from "../../../assets/images/public/bigScreen/backgroundimg.jpg";
|
||||
import "./index.less";
|
||||
import Header from "../Bi/components/Header/index";
|
||||
import Leftpanel from "~/pages/Container/Bi/components/LeftPanel/index";
|
||||
import Rightpanel from "~/pages/Container/Bi/components/rightPanel/index";
|
||||
import Bottom from "~/pages/Container/Bi/components/Bottom/index";
|
||||
import Search from "~/pages/Container/Bi/components/search/index";
|
||||
import LeftPanel from "~/pages/Container/Bi/components/LeftPanel/index";
|
||||
import RightPanel from "~/pages/Container/Bi/components/RightPanel/index";
|
||||
import Search from "~/pages/Container/Bi/components/Search/index";
|
||||
import backgroundimg from "../../../assets/images/public/bigScreen/backgroundimg.jpg";
|
||||
import Header from "../Bi/components/Header/index";
|
||||
import "./index.less";
|
||||
|
||||
function BiScreen() {
|
||||
return (
|
||||
<div className="screen-container" style={{ backgroundImage: `url(${backgroundimg})` }}>
|
||||
<Header />
|
||||
<div className="screen-content">
|
||||
<Leftpanel/>
|
||||
<Rightpanel/>
|
||||
<LeftPanel />
|
||||
<RightPanel />
|
||||
<Bottom />
|
||||
<Search />
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue