Browse Source

更新排名,颜色显示

jason.lu 6 years ago
parent
commit
3a5cb4baed
3 changed files with 26 additions and 6 deletions
  1. 2 2
      js/dapingmu.js
  2. 14 2
      js/newRedrankvue.js
  3. 10 2
      lazhang.html

+ 2 - 2
js/dapingmu.js

@@ -106,8 +106,8 @@ function get_stop_scheudle() {
 function realtime_success(obj, sta) {
     var output = first_parse(this, obj);
     //在这里排序 spo\
-    console.log(" output : ");
-    console.log(output);
+    if(showNetwork) console.log(" output : ");
+    if(showNetwork) console.log(output);
 
     var i, j, k, z;
     failnum = 0;

+ 14 - 2
js/newRedrankvue.js

@@ -8,6 +8,7 @@ RedRankTable.parts    = 3;
 RedRankTable.partLen  = 4;
 RedRankTable.slideLen = RedRankTable.parts * RedRankTable.partLen;
 RedRankTable.curSlide = 0;
+RedRankTable.markerLen = 3;
 
 RedRankTable.drawData = function (data) {
     // showSlide
@@ -37,7 +38,18 @@ RedRankTable.showPart = function(slide, part, data){
         if("[用户:"+0+"]" === partList[partList.length - 1].workerName){
             partList[partList.length - 1].workerName = "-";
         }
-        partList[partList.length - 1].color = true;
+
+        partList[partList.length - 1].seq = i;
+
+        partList[partList.length - 1].isRed = false;
+        partList[partList.length - 1].isGreen = false;
+
+        if(i >= data.len() - this.markerLen && partList[partList.length - 1].passNum > 0) {
+            partList[partList.length - 1].isRed = true;
+        }
+        if(i <= this.markerLen && partList[partList.length - 1].passNum > 0) {
+            partList[partList.length - 1].isGreen = true;
+        }
     }
 
 
@@ -51,7 +63,7 @@ RedRankTable.showPart = function(slide, part, data){
     }
 };
 
-RedRankTable.tickInterval = 2000;
+RedRankTable.tickInterval = 6000;
 RedRankTable.tick = function(obj){
     var totalDataLen = obj.activeData != null ? obj.activeData.len() : 0;
     if(obj.slides !== Math.ceil(totalDataLen / obj.slideLen)){

+ 10 - 2
lazhang.html

@@ -1,4 +1,4 @@
-<html xmlns:v-on="http://www.w3.org/1999/xhtml">
+<html xmlns:v-on="http://www.w3.org/1999/xhtml" xmlns:v-bind="http://www.w3.org/1999/xhtml">
 <head>
     <meta charset="UTF-8">
     <meta http-equiv="X-UA-Compatible" content="IE=Edge">
@@ -49,6 +49,12 @@
         .middle-font{
              font-size: 1.02em;
         }
+        .green-bar {
+             background-color: #0f9d58;
+        }
+        .red-bar {
+             background-color: #732020;
+        }
     </style>
     <script src="css/third/hchart.js"></script>
     <script src="css/third/exporting.js"></script>
@@ -158,6 +164,7 @@
                     <table class="table table-bordered text-center table-striped">
                         <thead>
                         <tr>
+                            <th>名次</th>
                             <th @click="useId">人员</th>
                             <th @click="usePass">良品</th>
                             <th @click="useFail">坏品</th>
@@ -166,7 +173,8 @@
                         </tr>
                         </thead>
                         <tbody class="table-rank-0">
-                            <tr v-for="one in parto">
+                            <tr v-for="one in parto" v-bind:class="{'red-bar' : one.isRed, 'green-bar': one.isGreen}">
+                                <td>{{one.seq}}</td>
                                 <td>{{one.workerName}}</td>
                                 <td>{{one.passNum}}</td>
                                 <td>{{one.failNum}}</td>