lihao 4 anos atrás
pai
commit
6ba5531416

+ 1 - 1
public/index.html

@@ -5,7 +5,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
+    <link href="https://cdn.bootcdn.net/ajax/libs/element-ui/2.15.3/theme-chalk/index.min.css" rel="stylesheet">
     <title><%= htmlWebpackPlugin.options.title %></title>
   </head>
   <body>

+ 5 - 4
src/components/fangxincha/barChart.vue

@@ -20,6 +20,7 @@ export default {
     //   });
     // },
 	  myEcharts(){
+      var token = localStorage.getItem("token")
       var chipStates = this.chipStates
 		  this.myChart = this.echarts.init(document.getElementById('barchartCon'));
 		  this.option = {
@@ -49,7 +50,7 @@ export default {
 			  },
         xAxis: {
             type: 'category',
-            data: chipStates.map(o=>o.productTypeName),//[ '2016', '2017', '2018', '2019', '2020', '2021'],
+            data: token?(chipStates.map(o=>o.productTypeName)):[ '2016', '2017', '2018', '2019', '2020', '2021'],
             axisLine:{
               lineStyle:{
                 color:"#0E61B6",
@@ -101,7 +102,7 @@ export default {
             barMaxWidth:15,
             barMinWidth :10,
             barMinHeight :5,
-            data: chipStates.map(o=>o.state10),//[120, 132, 101, 134, 90, 230, 210]
+            data: token?chipStates.map(o=>o.state10):[120, 132, 101, 134, 90, 230, 210]
           },
           {
             name: '实时温控',
@@ -109,7 +110,7 @@ export default {
             barMaxWidth:15,
             barMinWidth :10,
             barMinHeight :5,
-            data:  chipStates.map(o=>o.state11),//[120, 132, 101, 134, 90, 230, 210]
+            data: token?chipStates.map(o=>o.state11):[120, 132, 101, 134, 90, 230, 210]
           },
           {
             name: '追溯标签',
@@ -117,7 +118,7 @@ export default {
             barMaxWidth:15,
             barMinWidth :10,
             barMinHeight :5,
-            data:  chipStates.map(o=>o.state20),//[120, 132, 101, 134, 90, 230, 210]
+            data: token?chipStates.map(o=>o.state20):[120, 132, 101, 134, 90, 230, 210]
           },
         ]
 		  };

+ 2 - 1
src/components/fangxincha/huan2d.vue

@@ -50,7 +50,8 @@
     methods: {
       updataChart(){
         const that = this
-        this.chart.series[0].update({
+        var token = localStorage.getItem("token")
+        if(token)this.chart.series[0].update({
           data:that.chipCountData
         })
         // this.chart.series[0].update({