Browse Source

柯赛看板调整,不良现象没有数据的时候展示绿色

xiaost 8 months ago
parent
commit
009ad6481b

+ 4 - 4
src/components/prodlinechart/up2Chart/index.vue

@@ -70,11 +70,11 @@
                               label: {
                               label: {
                                 show: true,
                                 show: true,
                                 position: 'right',
                                 position: 'right',
-                                fontSize:18,
+                                fontSize:16,
                                 fontWeight: "bold",
                                 fontWeight: "bold",
                                 color:  "inherit"
                                 color:  "inherit"
                               },
                               },
-                            barWidth: 20,
+                            barWidth: 16,
                             itemStyle: {
                             itemStyle: {
                               color: "#ABA5FC"
                               color: "#ABA5FC"
                             },
                             },
@@ -86,11 +86,11 @@
                             label: {
                             label: {
                               show: true,
                               show: true,
                               position: 'right',
                               position: 'right',
-                              fontSize:18,
+                              fontSize:16,
                               fontWeight: "bold",
                               fontWeight: "bold",
                               color:  "inherit"
                               color:  "inherit"
                             },
                             },
-                            barWidth: 20,
+                            barWidth: 16,
                             itemStyle: {
                             itemStyle: {
                               color: "#8CF9B8"
                               color: "#8CF9B8"
                             },
                             },

+ 3 - 11
src/components/prodlinechart/up3Chart/chart.vue

@@ -30,16 +30,7 @@ export default {
     cdata: {
     cdata: {
       handler (newData) {
       handler (newData) {
         this.options = {
         this.options = {
-          color: [
-            "#37a2da",
-            "#32c5e9",
-            "#9fe6b8",
-            "#ffdb5c",
-            "#ff9f7f",
-            "#fb7293",
-            "#e7bcf3",
-            "#8378ea"
-          ],
+          color: newData.color,
           tooltip: {
           tooltip: {
             trigger: "item",
             trigger: "item",
             formatter: "{b} : {c} ({d}%)"
             formatter: "{b} : {c} ({d}%)"
@@ -72,7 +63,8 @@ export default {
               label: {
               label: {
                 fontSize: 13,
                 fontSize: 13,
                 width: 120,
                 width: 120,
-                color:"inherit"
+                color:"inherit",
+                show:newData.labelShow,
               /*  formatter:function(param){
               /*  formatter:function(param){
                   let text = param.data.name;
                   let text = param.data.name;
                   if (text.length < 8) {
                   if (text.length < 8) {

+ 25 - 1
src/components/prodlinechart/up3Chart/index.vue

@@ -15,9 +15,21 @@ export default {
   data () {
   data () {
     return {
     return {
       timing :null,
       timing :null,
+      color1: [
+        "#f65e2b",
+        "#fb7293",
+        "#f85179",
+        "#f1305e",
+        "#fa0640",
+        "#d5093a",
+        "#ab032d"
+      ],
+      color2:[ "#8CF9B8"],
       cdata: {
       cdata: {
         xData:[],
         xData:[],
-        seriesData:[]
+        seriesData:[],
+        labelShow:true,
+        color:this.color1
       }
       }
     }
     }
   },
   },
@@ -71,6 +83,18 @@ export default {
                            ob.name = '其它'||totalsum-sum1||'pcs';
                            ob.name = '其它'||totalsum-sum1||'pcs';
                            seriesData0.push(ob);
                            seriesData0.push(ob);
                        }
                        }
+                      if(totalsum == 0){
+                        xData0.push('今日无不良现象');
+                        let ob = new Object();
+                        ob.value = 100;
+                        ob.name = '今日无不良现象';
+                        seriesData0.push(ob);
+                        this.cdata.labelShow = false;
+                        this.cdata.color = this.color2;
+                      }else{
+                        this.cdata.labelShow = true;
+                        this.cdata.color = this.color1;
+                      }
                        this.cdata.xData = xData0;
                        this.cdata.xData = xData0;
                        this.cdata.seriesData = seriesData0;
                        this.cdata.seriesData = seriesData0;
                       },(result)=>{
                       },(result)=>{

+ 4 - 4
src/components/zzchart/up2Chart/index.vue

@@ -70,11 +70,11 @@
                               label: {
                               label: {
                                 show: true,
                                 show: true,
                                 position: 'right',
                                 position: 'right',
-                                fontSize:18,
+                                fontSize:16,
                                 fontWeight: "bold",
                                 fontWeight: "bold",
                                 color:  "inherit"
                                 color:  "inherit"
                               },
                               },
-                            barWidth: 20,
+                            barWidth: 16,
                             itemStyle: {
                             itemStyle: {
                               color: "#ABA5FC"
                               color: "#ABA5FC"
                             },
                             },
@@ -86,11 +86,11 @@
                             label: {
                             label: {
                               show: true,
                               show: true,
                               position: 'right',
                               position: 'right',
-                              fontSize:18,
+                              fontSize:16,
                               fontWeight: "bold",
                               fontWeight: "bold",
                               color:  "inherit"
                               color:  "inherit"
                             },
                             },
-                            barWidth: 20,
+                            barWidth: 16,
                             itemStyle: {
                             itemStyle: {
                               color: "#8CF9B8"
                               color: "#8CF9B8"
                             },
                             },

+ 3 - 11
src/components/zzchart/up3Chart/chart.vue

@@ -30,16 +30,7 @@ export default {
     cdata: {
     cdata: {
       handler (newData) {
       handler (newData) {
         this.options = {
         this.options = {
-          color: [
-            "#37a2da",
-            "#32c5e9",
-            "#9fe6b8",
-            "#ffdb5c",
-            "#ff9f7f",
-            "#fb7293",
-            "#e7bcf3",
-            "#8378ea"
-          ],
+          color:newData.color,
           tooltip: {
           tooltip: {
             trigger: "item",
             trigger: "item",
             formatter: "{b} : {c} ({d}%)"
             formatter: "{b} : {c} ({d}%)"
@@ -72,7 +63,8 @@ export default {
               label: {
               label: {
                 fontSize: 13,
                 fontSize: 13,
                 width: 120,
                 width: 120,
-                color:"inherit"
+                color:"inherit",
+                show:newData.labelShow,
               /*  formatter:function(param){
               /*  formatter:function(param){
                   let text = param.data.name;
                   let text = param.data.name;
                   if (text.length < 8) {
                   if (text.length < 8) {

+ 25 - 1
src/components/zzchart/up3Chart/index.vue

@@ -15,9 +15,21 @@ export default {
   data () {
   data () {
     return {
     return {
       timing :null,
       timing :null,
+      color1: [
+        "#f65e2b",
+        "#fb7293",
+        "#f85179",
+        "#f1305e",
+        "#fa0640",
+        "#d5093a",
+        "#ab032d"
+      ],
+      color2:[ "#8CF9B8"],
       cdata: {
       cdata: {
         xData:[],
         xData:[],
-        seriesData:[]
+        seriesData:[],
+        labelShow:true,
+        color:this.color1
       }
       }
     }
     }
   },
   },
@@ -71,6 +83,18 @@ export default {
                            ob.name = '其它'||totalsum-sum1||'pcs';
                            ob.name = '其它'||totalsum-sum1||'pcs';
                            seriesData0.push(ob);
                            seriesData0.push(ob);
                        }
                        }
+                        if(totalsum == 0){
+                          xData0.push('今日无不良现象');
+                          let ob = new Object();
+                          ob.value = 100;
+                          ob.name = '今日无不良现象';
+                          seriesData0.push(ob);
+                          this.cdata.labelShow = false;
+                          this.cdata.color = this.color2;
+                        }else{
+                          this.cdata.labelShow = true;
+                          this.cdata.color = this.color1;
+                        }
                        this.cdata.xData = xData0;
                        this.cdata.xData = xData0;
                        this.cdata.seriesData = seriesData0;
                        this.cdata.seriesData = seriesData0;
                       },(result)=>{
                       },(result)=>{

+ 0 - 1
src/views/zz/index.vue

@@ -126,7 +126,6 @@ export default {
     bottom1
     bottom1
   },
   },
   created() {
   created() {
-     this.getlinedata();
      this.isFullScreen = document.fullscreenElement;
      this.isFullScreen = document.fullscreenElement;
   },
   },
   mounted() {
   mounted() {

+ 1 - 1
src/views/zz/up2.vue

@@ -18,7 +18,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import BarChart from '@/components/prodlinechart/up2Chart'
+import BarChart from '@/components/zzchart/up2Chart'
 import {mapState} from "vuex";
 import {mapState} from "vuex";
 
 
 export default {
 export default {

+ 1 - 1
src/views/zz/up3.vue

@@ -12,7 +12,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import BadChart from '../../components/prodlinechart/up3Chart'
+import BadChart from '../../components/zzchart/up3Chart'
 import {mapState} from "vuex";
 import {mapState} from "vuex";
 export default {
 export default {
   computed: {
   computed: {