From 19147855fa31c1319c54f0dcac12df548f5f1dcd Mon Sep 17 00:00:00 2001
From: 严智鑫 <test>
Date: 星期五, 09 五月 2025 14:53:10 +0800
Subject: [PATCH] Merge branch 'master' of http://159.223.171.199:10439/r/Haier_MES_II

---
 gmms/WebContent/bigScreen/twoglassCut.jsp |  322 ++++++++++++++++++++++++-----------------------------
 1 files changed, 145 insertions(+), 177 deletions(-)

diff --git a/gmms/WebContent/bigScreen/twoglassCut.jsp b/gmms/WebContent/bigScreen/twoglassCut.jsp
index 79400e5..22c0ad4 100644
--- a/gmms/WebContent/bigScreen/twoglassCut.jsp
+++ b/gmms/WebContent/bigScreen/twoglassCut.jsp
@@ -139,6 +139,10 @@
             background-color: #007bff;
             color: white;
         }
+        #biaoti{
+            color:black;
+            margin-left: 350px;
+        }
     </style>
 </head>
 <body>
@@ -158,16 +162,16 @@
 
             <!-- 浜у搧澶х被涓嬫媺妗� -->
             <select id="product-category-select">
-                <option value="">閫夋嫨浜у搧澶х被</option>
-                <option value="浜у搧澶х被1">浜у搧澶х被1</option>
-                <option value="浜у搧澶х被2">浜у搧澶х被2</option>
-                <option value="浜у搧澶х被3">浜у搧澶х被3</option>
+                <option value="">鍏ㄩ儴</option>
+                <option value="1">娑堟瘨鏌�</option>
+                <option value="2">钂哥儰绠�</option>
+                <option value="3">鐑熸満</option>
             </select>
 
             <!-- 宸ョ▼涓嬫媺妗� -->
             <select id="project-select">
                 <option value="">鑾遍槼鍘ㄧ數</option>
-                <option value="宸ョ▼1">宸ョ▼1</option>
+
             </select>
 
             <!-- 寮�濮嬫棩鏈� -->
@@ -177,10 +181,10 @@
             <input type="date" id="end-date" />
 
             <!-- 鏌ヨ鎸夐挳 -->
-            <button onclick="filterData()">鏌ヨ</button>
-
+            <button @click="filterData()">鏌ヨ</button>
+            <h2 id="biaoti">{{title}}</h2>
             <!-- 閲嶇疆鎸夐挳 -->
-            <button class="reset-btn" onclick="resetFilters()">閲嶇疆</button>
+<%--            <button class="reset-btn" onclick="resetFilters()">閲嶇疆</button>--%>
         </div>
     </div>
 
@@ -213,6 +217,8 @@
                 <div id="trendChart1" class="chart"></div>
                 <div id="trendChart2" class="chart"></div>
                 <div id="trendChart3" class="chart"></div>
+                <!-- 鏄剧ず鏇茬嚎鍥� -->
+                <div id="trendChart4" class="chart"></div>
 
             </div>
 
@@ -271,59 +277,42 @@
             yield:[{}],
             machineElectric:[{}],
             machineWater:[{}],
-            val1: {
-            },
+            val1: {},
+            title:"<%= request.getParameter("name") %>",
 
         },
         methods:{
-            dingdanxiangqing(){
-                let HisArr="";
-                // HisArr = this.$echarts.init(document.getElementById('main2'));
-                let a = {
-                    value: this.shuzu1[0]['6_qualified'],
-                    name: "鎴愬搧",
-                    itemStyle: { color: '#53a2ff' },
-                    label:{fontSize:30}
-                }
-                let b = {
-                    value: this.shuzu1[0]['7_qualified_not'],
-                    name: "娆″搧",
-                    itemStyle: { color: 'darkseagreen' },
-                    label:{fontSize:30}
-                }
-                this.val1.title.text="鍚堟牸鐜�"
-                this.val1.title.top="45%"
-                this.val1.title.left="45%"
-                this.val1.title.textStyle.fontSize=30
-                this.val1.series[0].data[0]=a
-                this.val1.series[0].data[1]=b
-                HisArr.setOption(this.val1);
-            },
-            dingdanxiangqing1(){
-                let HisArr="";
-                // HisArr = this.$echarts.init(document.getElementById('main4'));
-                let a = {
-                    value: this.shuzu1[0]['2_smallglass_completed'],
+            // 鎻愪氦涓�娆℃煡璇㈠埛鏂�
+              filterData() {
+                 // 鑾峰彇浜у搧绫诲埆
+                 const type = document.getElementById('product-category-select').value;
+                 // 鑾峰彇鏃ユ湡閫夋嫨鍣ㄧ殑鍊�
+                 const startDate = document.getElementById('start-date').value;
+                 const endDate = document.getElementById('end-date').value;
 
-                    name: "宸插畬鎴�",
-                    itemStyle: { color: '#53a2ff' },
-                    label:{fontSize:30}
-                }
-                let b = {
-                    value: this.shuzu1[0]['3_smallglass_processing'],
-                    name: "鏈畬鎴�",
-                    itemStyle: { color: 'darkseagreen' },
-                    label:{fontSize:30}
+                 // 鏋勯�犳煡璇㈠弬鏁�
+                  let canshu1={
+                      line:<%= request.getParameter("id") %>,
+                      type: type,
+                      startDate: startDate,
+                      endDate: endDate
+                  }
+                 // 娓呯┖褰撳墠鏁版嵁
+                 this.shuzu = [];
+                 this.shuzu1 = [];
+                 // console.log("杈撳嚭");
+                 // console.log(canshu1);
+                 // 鎷兼帴SQL鏌ヨ璇彞
+                 let sql="{call machine_bigScreen('"+canshu1.line+"','"+canshu1.startDate+"','"+canshu1.endDate+"','"+canshu1.type+"')}";
+                 let flag = 2;
+                 this.loadAjxss('浠诲姟鏌ヨ鎴愬姛', sql, flag, "shuzu");
+                 let sql1="{call machine_bigScreen24('"+canshu.line+"')}";
+                 let flag1 = 2;
+                 // 璋冪敤鏁版嵁鍔犺浇鍑芥暟锛堜緥濡侫JAX璇锋眰锛�
+                  this.loadAjxss('浠诲姟鏌ヨ鎴愬姛', sql1, flag1, "shuzu1");
+                 //console.log(this.shuzu);
+    },
 
-                }
-                this.val1.title.text="璁㈠崟鍔犲伐"
-                this.val1.title.top="45%"
-                this.val1.title.left="45%"
-                this.val1.title.textStyle.fontSize=30
-                this.val1.series[0].data[0]=a
-                this.val1.series[0].data[1]=b
-                HisArr.setOption(this.val1);
-            },
             echarsInit() {
                 let datashijian = [];
                 let plans = [];
@@ -380,7 +369,6 @@
                 let shutdownTimes = [];
 
                 // 妫�鏌ユ暟鎹槸鍚﹀瓨鍦�
-                // if (this.shuzu && this.shuzu.length > 0) {
                     // 閬嶅巻 shuzu 鏁版嵁鎻愬彇鍋滄満鏃堕暱鏁版嵁
                     for (let i in this.shuzu) {
                         let date = this.shuzu[i]["0_createtime"];
@@ -390,14 +378,9 @@
                         let day = new Date(date);
                         let formattedDate = (day.getMonth() + 1) + "/" + day.getDate();
                         datashijian.push(formattedDate);
-
                         // 鍋滄満鏃堕暱
                         shutdownTimes.push(shutdownNum);
                     }
-
-                    console.log('鏃ユ湡:', datashijian);
-                    console.log('鍋滄満鏃堕暱:', shutdownTimes);
-
                     // 鍒濆鍖栧浘琛�
                     let HisArr = this.$echarts.init(document.getElementById('trendChart3'));
 
@@ -421,28 +404,105 @@
                         ]
                     };
 
-                    HisArr.setOption(option);
-                // } else {
-                //     console.error('shuzu 鏁版嵁涓虹┖鎴栨湭鍔犺浇');
-                //     console.log(this.shuzu);
-                // }
+                HisArr.setOption(option);
                 this.loading = false;
             },
+            updateLineChart() {
+                let datatime = [];
+                let sum = [];
+                let hourFormatted
+                for (let i in this.shuzu1) {
+                    let hours = this.shuzu1[i]["0_hour"];
+                    let production = this.shuzu1[i]["1_total_num"];
+                    hourFormatted = new Date(hours).getHours().toString().padStart(2, '0') + ":00";
+                datatime.push(hourFormatted);
+                sum.push(production);
+
+                }
+                let HisArr = this.$echarts.init(document.getElementById('trendChart4'));
+                const option = {
+                    xAxis: {
+                        type: 'category',
+                        data: datatime,
+                        axisLabel: {
+                            formatter: '{value}:00'
+                        }
+                    },
+                    yAxis: {
+                        type: 'value'
+                    },
+                    series: [{
+                        data: sum,
+                        type: 'line',
+                        smooth: true,
+                        lineStyle: {
+                            color: 'blue'
+                        }
+                    }]
+                };
+
+                // 浣跨敤鏂版暟鎹洿鏂版洸绾垮浘
+                HisArr.setOption(option);
+                HisArr.resize();
+                this.loading = false;
+            }
+
         },
         watch:{
 
             shuzu(){
                 this.echarsInit();
                 this.echarsInit3();
+                this.updateLineChart();
             },
         },
-        mounted: function() {
+        async mounted(){
 
+            // 鑾峰彇閫変腑鐨勪骇鍝佺被鍒�
+            const type = document.getElementById('product-category-select').value;
+            // 鑾峰彇鏃ユ湡閫夋嫨鍣ㄧ殑鍊�
+            const startDate = document.getElementById('start-date').value;
+            const endDate = document.getElementById('end-date').value;
+            let canshu={
+                line:<%= request.getParameter("id") %>,
+                type: type,
+                startDate: startDate,
+                endDate: endDate
+        }
             this.shuzu = [];
-            let sql="{call machine_bigScreen(5,'','','')}";
+            let sql="{call machine_bigScreen('"+canshu.line+"','"+canshu.startDate+"','"+canshu.endDate+"','"+canshu.type+"')}";
             let flag = 2;
             this.loadAjxss('浠诲姟鏌ヨ鎴愬姛',sql,flag,"shuzu");
 
+            this.shuzu1 = [];
+            let sql1="{call machine_bigScreen24('"+canshu.line+"')}";
+            let flag1 = 2;
+            this.loadAjxss('浠诲姟鏌ヨ鎴愬姛',sql1,flag1,"shuzu1");
+
+
+
+
+
+            await setInterval(()=>{
+                // 鑾峰彇閫変腑鐨勪骇鍝佺被鍒�
+                const type = document.getElementById('product-category-select').value;
+                // 鑾峰彇鏃ユ湡閫夋嫨鍣ㄧ殑鍊�
+                const startDate = document.getElementById('start-date').value;
+                const endDate = document.getElementById('end-date').value;
+                let canshu={
+                    line:<%= request.getParameter("id") %>,
+                    type: type,
+                    startDate: startDate,
+                    endDate: endDate
+                }
+                // console.log("杈撳嚭锛�");
+                // console.log(canshu);
+                sql="{call machine_bigScreen('"+canshu.line+"','"+canshu.startDate+"','"+canshu.endDate+"','"+canshu.type+"')}";
+                this.interValLoadAjxs('浠诲姟鏌ヨ鎴愬姛',sql,flag,"shuzu")
+
+                sql1="{call machine_bigScreen24('"+canshu.line+"')}";
+                this.loadAjxss('24灏忔椂浜ч噺鏌ヨ',sql1,flag1,"shuzu1");
+            },5000)
         }
 
     })
@@ -450,43 +510,21 @@
     const trendChart1 = echarts.init(document.getElementById('trendChart1'));
     const trendChart2 = echarts.init(document.getElementById('trendChart2'));
     const trendChart3 = echarts.init(document.getElementById('trendChart3'));
+    const trendChart4 = echarts.init(document.getElementById('trendChart4'));
+    // 鑾峰彇褰撳墠鏃ユ湡
+    const currentDate = new Date();
+
+    // 璁剧疆缁撴潫鏃ユ湡涓烘槑澶�
+    // currentDate.setDate(currentDate.getDate() + 1);
+    // const endDate = currentDate.toISOString().split('T')[0];
+    // document.getElementById('end-date').value = endDate;
+    //
+    // // 璁剧疆寮�濮嬫棩鏈熶负涓夊ぉ鍓�
+    // currentDate.setDate(currentDate.getDate() - 3);  // 鎭㈠鍒颁笁澶╁墠
+    // const startDate = currentDate.toISOString().split('T')[0];
+    // document.getElementById('start-date').value = startDate;
 
 
-
-    // 閰嶇疆绗竴涓浘琛� (鏌辩姸鍥� - 璁㈠崟璁″垝鍜岃鍗曞畬鎴�)
-    // const option1 = {
-    //     tooltip: {
-    //         trigger: 'axis'
-    //     },
-    //     legend: {
-    //         data: ['璁㈠崟璁″垝', '璁㈠崟瀹屾垚']
-    //     },
-    //     xAxis: {
-    //         type: 'category',
-    //         data: dates
-    //     },
-    //     yAxis: {
-    //         type: 'value'
-    //     },
-    //     series: [{
-    //         name: '璁㈠崟璁″垝',
-    //         type: 'bar',
-    //         data: plans,
-    //         itemStyle: {
-    //             color: 'rgba(54, 162, 235, 1)'
-    //         }
-    //     },
-    //         {
-    //             name: '璁㈠崟瀹屾垚',
-    //             type: 'bar',
-    //             data: overnums,
-    //             itemStyle: {
-    //                 color: 'rgba(75, 192, 192, 1)'
-    //             }
-    //         }
-    //     ]
-    // };
-    // trendChart1.setOption(option1);
 
     // 閰嶇疆绗簩涓浘琛� (鏌辩姸鍥� - 宸ョ▼涓嶈壇鍙版暟鍜屽伐绋嬩笉鑹巼)
     const option2 = {
@@ -523,81 +561,11 @@
     };
     trendChart2.setOption(option2);
 
-    // 閰嶇疆绗笁涓浘琛� (鏌辩姸鍥� - 鍋滄満鏃堕暱鍜屽仠鏈烘椂鐜�)
-    // const option3 = {
-    //     tooltip: {
-    //         trigger: 'axis'
-    //     },
-    //     legend: {
-    //         data: ['鍋滄満鏃堕暱', '鍋滄満鏃剁巼']
-    //     },
-    //     xAxis: {
-    //         type: 'category',
-    //         data: ['2025-03-30', '2025-03-31', '2025-04-01']
-    //     },
-    //     yAxis: {
-    //         type: 'value'
-    //     },
-    //     series: [{
-    //         name: '鍋滄満鏃堕暱',
-    //         type: 'bar',
-    //         data: [1, 2, 3],
-    //         itemStyle: {
-    //             color: 'rgba(255, 159, 64, 1)'
-    //         }
-    //     },
-    //         {
-    //             name: '鍋滄満鏃剁巼',
-    //             type: 'bar',
-    //             data: [0.02, 0.03, 0.04],
-    //             itemStyle: {
-    //                 color: 'rgba(153, 102, 255, 1)'
-    //             }
-    //         }
-    //     ]
-    // };
-    // trendChart3.setOption(option3);
 
-    // 鏍规嵁鏃ユ湡鑼冨洿杩囨护鏁版嵁
-    function filterData() {
-        const startDate = document.getElementById('start-date').value;
-        const endDate = document.getElementById('end-date').value;
-        // 妯℃嫙鏂扮殑鏁版嵁
-        const newData1 = {
-            labels: ['2025-03-30', '2025-03-31'],
-            datasets: [{
-                label: '璁㈠崟璁″垝',
-                data: [7098, 8000],
-                backgroundColor: 'rgba(54, 162, 235, 0.2)',
-                borderColor: 'rgba(54, 162, 235, 1)',
-                borderWidth: 1
-            }, {
-                label: '璁㈠崟瀹屾垚',
-                data: [7897, 8200],
-                backgroundColor: 'rgba(75, 192, 192, 0.2)',
-                borderColor: 'rgba(75, 192, 192, 1)',
-                borderWidth: 1
-            }]
-        };
-        trendChart1.setOption({
-            xAxis: {
-                data: newData1.labels
-            },
-            series: [{
-                data: newData1.datasets[0].data
-            },
-                {
-                    data: newData1.datasets[1].data
-                }
-            ]
-        });
-    }
 
-    // 閲嶇疆鎼滅储鏍�
-    function resetFilters() {
-        document.getElementById('start-date').value = '';
-        document.getElementById('end-date').value = '';
-    }
+
+
+
 
 </script>
 

--
Gitblit v1.8.0