2 次代码提交 89bfdf64f0 ... ca39a38441

作者 SHA1 备注 提交日期
  Guichuan Yu ca39a38441 Merge remote-tracking branch 'origin/master' 6 年之前
  Guichuan Yu 116f515eb4 Change stuff and realtime JS made 6 年之前
共有 3 个文件被更改,包括 39 次插入16 次删除
  1. 10 0
      js/lazhang-data.js
  2. 26 14
      js/lazhang-display.js
  3. 3 2
      lazhang.html

+ 10 - 0
js/lazhang-data.js

@@ -104,6 +104,16 @@ function load_flows_history_data(nnm) {
 function load_flows_history_realtime_data() {
     get_data("fcBiFlowDaily/list?type=1&flowId=" + flowId, history_success);
 }
+function get_stop_scheudle1() {
+    var out = confirm("真的要下班吗?");
+    if(out == true){
+        get_stop_scheudle();
+
+    }
+    else{
+
+    }
+}
 
 function get_stop_scheudle() {
     get_data("fcWorkSchedule/stopSchedule?scheduleId=" + scheduleId, stopSuccess);

+ 26 - 14
js/lazhang-display.js

@@ -33,17 +33,22 @@ function showChart() {
     var passdata = [];
     var faildata = [];
     var passmax = 0;
+    var failratemax=0;
 
     for (i = 0; i < passNumber.length; i++) {
         if (stackmax < stackeverynum[i]) {
             stackmax = stackeverynum[i];
         }
-        if (failmax < failrate[i]) {
-            failmax = failrate[i];
+        if (failmax < failNumber[i]) {
+            failmax = failNumber[i];
+        }
+        if (failratemax< failrate[i]) {
+            failratemax = failrate[i];
         }
         if (passmax < passNumber[i]) {
             passmax = passNumber[i];
         }
+
         data.push(stackeverynum[i]);
         ratedata.push(Math.floor(failrate[i]));
         passdata.push(passNumber[i]);
@@ -54,9 +59,10 @@ function showChart() {
     showEachSpot1();
     showEachSpot2();
 
-
+    failratemax = Math.max(failratemax, 5);
     stackmax = Math.max(stackmax, 5);
     failmax = Math.max(failmax, 5);
+    passmax =  Math.max(passmax,failmax,stackmax);
 
     stackAndFailChart = Highcharts.chart('graph-1', {
         chart: {
@@ -71,16 +77,16 @@ function showChart() {
             labels: {
                 format: '{value}',
                 style: {
-                    color: Highcharts.getOptions().colors[0],
+                    color: "#ffffff",
                     fontSize: '1.5em'
                 }
             },
             min: 0,
             max: passmax * 1.5,
             title: {
-
+                text: '数量',
                 style: {
-                    color: Highcharts.getOptions().colors[0],
+                    color: '#ffffff',
                     fontSize: '1em'
                 }
             }
@@ -131,18 +137,18 @@ function showChart() {
             title: {
                 text: '不良率',
                 style: {
-                    color: 'red',
+                    color: '#ffffff',
                     fontSize: '1em'
                 }
             },
             min: 0,
-            max: 1.5 * failmax,
+            max: 1.5 * failratemax,
             labels: {
                 formatter: function () {
                     return Math.floor(this.value) + "%";
                 },
                 style: {
-                    color: 'red',
+                    color: '#ffffff',
                     fontSize: '20px'
                 }
             },
@@ -181,12 +187,16 @@ function updateChart() {
     var passdata = [];
     var faildata = [];
     var passmax = 0;
+    var failratemax=0;
     for (i = 0; i < passNumber.length; i++) {
         if (stackmax < stackeverynum[i]) {
             stackmax = stackeverynum[i];
         }
-        if (failmax < failrate[i]) {
-            failmax = failrate[i];
+        if (failmax < failNumber[i]) {
+            failmax = failNumber[i];
+        }
+        if (failratemax < failrate[i]) {
+            failratemax= failrate[i];
         }
         if (passmax < passNumber[i]) {
             passmax = passNumber[i];
@@ -196,9 +206,11 @@ function updateChart() {
         passdata.push(passNumber[i]);
         faildata.push(failNumber[i])
     }
-
+    failratemax = Math.max(failratemax, 5);
     stackmax = Math.max(stackmax, 5);
     failmax = Math.max(failmax, 5);
+    passmax =  Math.max(passmax,failmax,stackmax);
+
 
     // https://api.hcharts.cn/highcharts#Series.addPoint;
 
@@ -207,8 +219,8 @@ function updateChart() {
     stackAndFailChart.series[2].setData(data);
     FailChart.series[0].setData(ratedata);
 
-    if (failmax > FailChart.yAxis[0].getExtremes().max * 1.3 || failmax < FailChart.yAxis[0].getExtremes().max * 0.5) {
-        FailChart.yAxis[0].setExtremes(0, failmax * 1.5);
+    if (failratemax > FailChart.yAxis[0].getExtremes().max * 1.3 || failratemax < FailChart.yAxis[0].getExtremes().max * 0.5) {
+        FailChart.yAxis[0].setExtremes(0, failratemax * 1.5);
     }
     if (passmax > stackAndFailChart.yAxis[0].getExtremes().max * 1.3 || passmax < stackAndFailChart.yAxis[0].getExtremes().max * 0.5) {
         stackAndFailChart.yAxis[0].setExtremes(0, passmax * 1.5);

+ 3 - 2
lazhang.html

@@ -91,9 +91,10 @@
         <div class="navbar-header">
             <a class="navbar-brand" href="index.html">工厂产能监控系统</a>
         </div>
-        <div style="color:#fff" class="text-center"><img src="images/logo.jpg" style="width: 10%;"> 深圳市度彼电子有限公司</div>
-        <div onclick="get_stop_scheudle()" class="btn btn-warning"> 下班 </div>
+        <div style="color:#fff" class="text-center"><img src="images/logo.jpg" style="width: 10%;"> 深圳市度彼电子有限公司——激光厂产线1</div>
+
         <font color="#ffffff"><span id="nowDateTimeSpan"></span></font>
+        <div onclick="get_stop_scheudle1()" class="btn btn-warning"> 下班 </div>
     </div>
 
 </nav>