diff --git a/src/pages/smartinspection/components/Inspectiontaskplan/InspectionTaskPlan.less b/src/pages/smartinspection/components/Inspectiontaskplan/InspectionTaskPlan.less index 3758561..547cde4 100644 --- a/src/pages/smartinspection/components/Inspectiontaskplan/InspectionTaskPlan.less +++ b/src/pages/smartinspection/components/Inspectiontaskplan/InspectionTaskPlan.less @@ -162,3 +162,35 @@ background-color:#B8E0D833 !important; } } + +// 仪表盘容器样式 - 复杂边框和阴影效果 +.dashboardContainer{ + border: 1px solid; + border-image-slice: 1; + border-image-source: conic-gradient(from 102.21deg at 52.75% 38.75%, rgba(249, 249, 249, 0.5) -32.95deg, rgba(64, 64, 64, 0.5) 10.52deg, rgba(64, 64, 64, 0.35) 32.12deg, #FFFFFF 60.28deg, rgba(255, 255, 255, 0.5) 107.79deg, rgba(64, 64, 64, 0.35) 187.59deg, #F9F9F9 207.58deg, #FFFFFF 287.31deg, rgba(249, 249, 249, 0.5) 327.05deg, rgba(64, 64, 64, 0.5) 370.52deg); + backdrop-filter: blur(15px); + box-shadow: -2px 4px 10px 0px rgba(145, 145, 145, 0.05), + -7px 17px 18px 0px rgba(145, 145, 145, 0.04), + -15px 37px 24px 0px rgba(145, 145, 145, 0.03); +} + +// 阈值配置区样式 - 带背景、边框和阴影效果 +.thresholdConfigContainer { + background: rgba(255, 255, 255, 0.3); + border: 1px solid; + border-image-source: conic-gradient(from 102.21deg at 52.75% 38.75%, rgba(249, 249, 249, 0.5) -32.95deg, rgba(64, 64, 64, 0.5) 10.52deg, rgba(64, 64, 64, 0.35) 32.12deg, #FFFFFF 60.28deg, rgba(255, 255, 255, 0.5) 107.79deg, rgba(64, 64, 64, 0.35) 187.59deg, #F9F9F9 207.58deg, #FFFFFF 287.31deg, rgba(249, 249, 249, 0.5) 327.05deg, rgba(64, 64, 64, 0.5) 370.52deg); + backdrop-filter: blur(15px); + box-shadow: -2px 4px 10px 0px rgba(145, 145, 145, 0.05), + -7px 17px 18px 0px rgba(145, 145, 145, 0.04), + -15px 37px 24px 0px rgba(145, 145, 145, 0.03); +} + +.chartContainer { + background: rgba(255, 255, 255, 0.3); + border: 1px solid; + border-image-source: conic-gradient(from 102.21deg at 52.75% 38.75%, rgba(249, 249, 249, 0.5) -32.95deg, rgba(64, 64, 64, 0.5) 10.52deg, rgba(64, 64, 64, 0.35) 32.12deg, #FFFFFF 60.28deg, rgba(255, 255, 255, 0.5) 107.79deg, rgba(64, 64, 64, 0.35) 187.59deg, #F9F9F9 207.58deg, #FFFFFF 287.31deg, rgba(249, 249, 249, 0.5) 327.05deg, rgba(64, 64, 64, 0.5) 370.52deg); + backdrop-filter: blur(15px); + box-shadow: -2px 4px 10px 0px rgba(145, 145, 145, 0.05), + -7px 17px 18px 0px rgba(145, 145, 145, 0.04), + -15px 37px 24px 0px rgba(145, 145, 145, 0.03); +} diff --git a/src/pages/smartinspection/components/Inspectiontaskplan/SmartInspectionPlan.js b/src/pages/smartinspection/components/Inspectiontaskplan/SmartInspectionPlan.js index 873d399..b6d4510 100644 --- a/src/pages/smartinspection/components/Inspectiontaskplan/SmartInspectionPlan.js +++ b/src/pages/smartinspection/components/Inspectiontaskplan/SmartInspectionPlan.js @@ -1628,7 +1628,7 @@ const SmartInspectionContent = () => { -
+
{
); case '温湿度检测': + // 创建一个React兼容的ECharts组件 + const EChartsGauge = ({ id, option, height, width }) => { + const chartRef = useRef(null); + const chartInstanceRef = useRef(null); + + useEffect(() => { + // 确保在浏览器环境中运行 + if (typeof window !== 'undefined' && chartRef.current) { + const echarts = require('echarts'); + + // 初始化图表 + if (!chartInstanceRef.current) { + chartInstanceRef.current = echarts.init(chartRef.current); + } + + // 设置配置 + chartInstanceRef.current.setOption(option); + + // 响应窗口大小变化 + const handleResize = () => { + if (chartInstanceRef.current) { + chartInstanceRef.current.resize(); + } + }; + + window.addEventListener('resize', handleResize); + + // 清理函数 + return () => { + window.removeEventListener('resize', handleResize); + if (chartInstanceRef.current) { + chartInstanceRef.current.dispose(); + chartInstanceRef.current = null; + } + }; + } + }, [option]); + + return ( +
+ ); + }; + + // 温度仪表盘配置 + const temperatureOption = { + series: [ + { + type: 'gauge', + startAngle: 180, + endAngle: 0, + min: 0, + max: 100, + splitNumber: 10, + itemStyle: { + color: 'rgba(4, 95, 94, 0.5)', + shadowColor: 'rgba(4, 95, 94, 0.7)', + shadowBlur: 10, + shadowOffsetX: 2, + shadowOffsetY: 2 + }, + progress: { + show: true, + roundCap: true, + width: 18, + itemStyle: { + color: 'rgba(4, 95, 94, 0.5)' + } + }, + pointer: { + icon: 'path://M2090.36389,615.30999 L2090.36389,615.30999 C2091.48372,615.30999 2092.40383,616.194028 2092.44859,617.312956 L2096.90698,728.755929 C2097.05155,732.369577 2094.2393,735.416212 2090.62566,735.56078 C2090.53845,735.564269 2090.45117,735.566014 2090.36389,735.566014 L2090.36389,735.566014 C2086.74736,735.566014 2083.81557,732.63423 2083.81557,729.017692 C2083.81557,728.930412 2083.81732,728.84314 2083.82081,728.755929 L2088.2792,617.312956 C2088.32396,616.194028 2089.24407,615.30999 2090.36389,615.30999 Z', + length: '75%', + width: 16, + offsetCenter: [0, '5%'], + itemStyle: { + color: 'rgba(4, 95, 94, 1)' + } + }, + axisLine: { + roundCap: true, + lineStyle: { + width: 18, + color: [ + [1, 'rgba(4, 95, 94, 0.5)'] + ] + } + }, + axisTick: { + splitNumber: 2, + lineStyle: { + width: 2, + color: '#999' + } + }, + splitLine: { + length: 12, + lineStyle: { + width: 3, + color: 'rgba(4, 95, 94, 0.8)' + } + }, + axisLabel: { + distance: 30, + color: 'rgba(4, 95, 94, 0.8)', + fontSize: 20 + }, + title: { + show: true, + offsetCenter: [0, '10%'], + fontSize: 18, + color: 'rgba(4, 95, 94, 0.8)' + }, + detail: { + backgroundColor: 'rgba(4, 95, 94, 0.2)', + borderColor: 'rgba(4, 95, 94, 0.5)', + borderWidth: 2, + width: '60%', + lineHeight: 40, + height: 40, + borderRadius: 8, + offsetCenter: [0, '35%'], + valueAnimation: true, + formatter: function (value) { + return '{value|' + value.toFixed(0) + '}{unit|°C}'; + }, + rich: { + value: { + fontSize: 20, + fontWeight: 'bolder', + color: 'rgba(4, 95, 94, 1)' + }, + unit: { + fontSize: 20, + color: 'rgba(4, 95, 94, 0.8)', + padding: [0, 0, -20, 10] + } + } + }, + data: [ + { + value: 28, + name: '温度' + } + ] + } + ] + }; + + // 湿度仪表盘配置 + const humidityOption = { + series: [ + { + type: 'gauge', + startAngle: 180, + endAngle: 0, + min: 0, + max: 100, + splitNumber: 10, + itemStyle: { + color: 'rgba(4, 95, 94, 0.5)', + shadowColor: 'rgba(4, 95, 94, 0.7)', + shadowBlur: 10, + shadowOffsetX: 2, + shadowOffsetY: 2 + }, + progress: { + show: true, + roundCap: true, + width: 18, + itemStyle: { + color: 'rgba(4, 95, 94, 0.5)' + } + }, + pointer: { + icon: 'path://M2090.36389,615.30999 L2090.36389,615.30999 C2091.48372,615.30999 2092.40383,616.194028 2092.44859,617.312956 L2096.90698,728.755929 C2097.05155,732.369577 2094.2393,735.416212 2090.62566,735.56078 C2090.53845,735.564269 2090.45117,735.566014 2090.36389,735.566014 L2090.36389,735.566014 C2086.74736,735.566014 2083.81557,732.63423 2083.81557,729.017692 C2083.81557,728.930412 2083.81732,728.84314 2083.82081,728.755929 L2088.2792,617.312956 C2088.32396,616.194028 2089.24407,615.30999 2090.36389,615.30999 Z', + length: '75%', + width: 16, + offsetCenter: [0, '5%'], + itemStyle: { + color: 'rgba(4, 95, 94, 1)' + } + }, + axisLine: { + roundCap: true, + lineStyle: { + width: 18, + color: [ + [1, 'rgba(4, 95, 94, 0.5)'] + ] + } + }, + axisTick: { + splitNumber: 2, + lineStyle: { + width: 2, + color: '#999' + } + }, + splitLine: { + length: 12, + lineStyle: { + width: 3, + color: 'rgba(4, 95, 94, 0.8)' + } + }, + axisLabel: { + distance: 30, + color: 'rgba(4, 95, 94, 0.8)', + fontSize: 20 + }, + title: { + show: true, + offsetCenter: [0, '10%'], + fontSize: 18, + color: 'rgba(4, 95, 94, 0.8)' + }, + detail: { + backgroundColor: 'rgba(4, 95, 94, 0.2)', + borderColor: 'rgba(4, 95, 94, 0.5)', + borderWidth: 2, + width: '60%', + lineHeight: 40, + height: 40, + borderRadius: 8, + offsetCenter: [0, '35%'], + valueAnimation: true, + formatter: function (value) { + return '{value|' + value.toFixed(0) + '}{unit|%}'; + }, + rich: { + value: { + fontSize: 20, + fontWeight: 'bolder', + color: 'rgba(4, 95, 94, 1)' + }, + unit: { + fontSize: 20, + color: 'rgba(4, 95, 94, 0.8)', + padding: [0, 0, -20, 10] + } + } + }, + data: [ + { + value: 55, + name: '湿度' + } + ] + } + ] + }; + + return ( +
+
+

| 温湿度检测

+
+ +
+
+
+

实时仪表盘

+ {/* 温度仪表盘 - 使用React兼容的ECharts组件 */} +
+ +
+ + {/* 湿度仪表盘 - 使用React兼容的ECharts组件 */} +
+ +
+
+ +
+

阈值配置区

+ +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ +
+
+

历史趋势图

+
+
+
+ + 温度(°C) +
+
+ + 湿度(%RH) +
+
+
+ {/* 模拟趋势图 */} + + {/* 网格线 */} + {[0, 25, 50, 75, 100].map((val, index) => ( + + + + {val} + + + ))} + {/* 时间标签 */} + {['00:00', '03:00', '06:00', '09:00', '12:00', '15:00', '18:00', '21:00', '24:00'].map((time, index) => ( + + {time} + + ))} + {/* 温度曲线 */} + + {/* 温度数据点 */} + {[50, 140, 230, 320, 410, 500, 590, 680, 750].map((x, index) => ( + + ))} + {/* 湿度曲线 */} + + {/* 湿度数据点 */} + {[50, 140, 230, 320, 410, 500, 590, 680, 750].map((x, index) => ( + + ))} + +
+
+
+
+
+
+ ); case '跑冒滴漏检测': case '仪器仪表采集': case '环境监测': @@ -1841,7 +2265,7 @@ const SmartInspectionContent = () => {