From ef20532d9ada39cb35ee7fb2d07b8cbe64366332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?zhaobing=E2=80=99?= Date: Thu, 31 Aug 2023 16:16:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=91=8A=E8=AD=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/3.1/schema/3.updata_struc_off .sql | 11 ++++++ .../projectGroup/containers/bigscreen.jsx | 38 +++++++++++-------- 2 files changed, 34 insertions(+), 15 deletions(-) create mode 100644 script/3.1/schema/3.updata_struc_off .sql diff --git a/script/3.1/schema/3.updata_struc_off .sql b/script/3.1/schema/3.updata_struc_off .sql new file mode 100644 index 0000000..8f61563 --- /dev/null +++ b/script/3.1/schema/3.updata_struc_off .sql @@ -0,0 +1,11 @@ + + alter table t_structure_off + add totnum integer; + +comment on column t_structure_off.totnum is '测点总数'; + +alter table t_structure_off + add offnum integer; + +comment on column t_structure_off.offnum is '离线个数'; + diff --git a/web/client/src/sections/projectGroup/containers/bigscreen.jsx b/web/client/src/sections/projectGroup/containers/bigscreen.jsx index 14d5e4b..8790292 100644 --- a/web/client/src/sections/projectGroup/containers/bigscreen.jsx +++ b/web/client/src/sections/projectGroup/containers/bigscreen.jsx @@ -94,12 +94,17 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou return combinedMax; } return max; - }, -Infinity) - const bigD = Math.ceil(maxCombinedValue / 50) * 50 - 50, 40, 30, 20, 10, 0 - setXData([bigD, (bigD - bigD / 5), (bigD - bigD * 2 / 5), (bigD - bigD * 3 / 5), (bigD - bigD * 4 / 5), 0, (bigD - bigD * 4 / 5), (bigD - bigD * 3 / 5), (bigD - bigD * 2 / 5), (bigD - bigD / 5), bigD]) - setBiggest(bigD) - }, []) + }, -Infinity) + console.log('setAlarmData4',maxCombinedValue) + const bigD= Math.ceil(maxCombinedValue/50)*50 + if(bigD==0){ + setXData([5,4,3,2,1,0,1,2,3,4,5])//最大值为0,默认横坐标 + }else{ + setXData([bigD,(bigD-bigD/5),(bigD-bigD*2/5),(bigD-bigD*3/5),(bigD-bigD*4/5),0,(bigD-bigD*4/5),(bigD-bigD*3/5),(bigD-bigD*2/5),(bigD-bigD/5),bigD]) + } + setBiggest(bigD) + },[]) + // const mockData=[ // {id: 1,name: '测试结构物测试结构物',alarmCount: 200,dealAlarmCount: 23}, // {id: 2,name: '测试结构物2',alarmCount: 300,dealAlarmCount: 22}, @@ -180,6 +185,7 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou + function formatDate (date) { var year = date.getFullYear(); var month = String(date.getMonth() + 1).padStart(2, '0'); @@ -241,6 +247,8 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou }, [proportion]); +console.log('setAlarmData3',alarmData) + console.log(groupStatisticOnline); return (
@@ -423,7 +431,7 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
- {mockData && mockData.length > 0 ? (
@@ -443,10 +451,10 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
{mockData[0]?.name?.length > 5 ? {mockData[0]?.name.substring(0, 5) + '...'} : mockData[0]?.name}
-
+
0? ((mockData[0].alarmCount / biggest) * 100 || '%'):0), height: '100%' }}>
-
+
0? ((mockData[0].dealAlarmCount / biggest) * 100 || '%'):0), height: '100%' }}>
) : '' @@ -458,10 +466,10 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
{mockData[1]?.name?.length > 5 ? {mockData[1]?.name.substring(0, 5) + '...'} : mockData[0]?.name}
-
+
0? ((mockData[1].alarmCount / biggest) * 100 || '%'):0), height: '100%' }}>
-
+
0? ((mockData[1].dealAlarmCount / biggest) * 100 || '%'):0), height: '100%' }}>
) : '' @@ -473,10 +481,10 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
{mockData[2]?.name?.length > 5 ? {mockData[2]?.name.substring(0, 5) + '...'} : mockData[0]?.name}
-
+
0? ((mockData[2].alarmCount / biggest) * 100 || '%'):0), height: '100%' }}>
-
+
0? ((mockData[2].dealAlarmCount / biggest) * 100 || '%'):0), height: '100%' }}>
) : '' @@ -490,10 +498,10 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
{item.name?.length > 5 ? {item.name.substring(0, 5) + '...'} : item.name}
-
+
0?((item.alarmCount / biggest) * 100 || '%'):0), height: '100%' }}>
-
+
0? ((item.dealAlarmCount / biggest) * 100 || '%'):0), height: '100%' }}>