Ver Fonte

生态修复默认山水工程

maxiaoxiao há 1 ano atrás
pai
commit
1bef4de2e0
2 ficheiros alterados com 13 adições e 12 exclusões
  1. 7 6
      src/components/echartsTemplate/3dBar.vue
  2. 6 6
      src/views/cockpitNew1/stxf.vue

+ 7 - 6
src/components/echartsTemplate/3dBar.vue

@@ -35,7 +35,7 @@ let option = {
     axisLabel: {
       color: "#fff",
       rotate: 0,
-      interval: 0,//代表显示所有x轴标签显示//设置为 1,表示『隔一个标签显示一个标签』
+      interval: 0, //代表显示所有x轴标签显示//设置为 1,表示『隔一个标签显示一个标签』
     },
     // 不显示x轴刻度
     axisTick: {
@@ -92,7 +92,7 @@ let seriesItem = {
             xAxisPoint: api.coord([api.value(0), 0]),
           },
           style: {
-            fill: colors[params.seriesIndex][0],
+            fill: colors[params.seriesIndex % 3][0],
             //   new echarts.graphic.LinearGradient(0, 0, 0, 1, [
             //     {
             //       offset: 0,
@@ -116,7 +116,7 @@ let seriesItem = {
             xAxisPoint: api.coord([api.value(0), 0]),
           },
           style: {
-            fill: colors[params.seriesIndex][1],
+            fill: colors[params.seriesIndex % 3][1],
             //   new echarts.graphic.LinearGradient(0, 0, 0, 1, [
             //     {
             //       offset: 0,
@@ -143,11 +143,11 @@ let seriesItem = {
             fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
               {
                 offset: 0,
-                color: colors[params.seriesIndex][2],
+                color: colors[params.seriesIndex % 3][2],
               },
               {
                 offset: 1,
-                color: colors[params.seriesIndex][3],
+                color: colors[params.seriesIndex % 3][3],
               },
             ]),
           },
@@ -244,9 +244,10 @@ export default {
     options3d(v) {
       option.grid.bottom = v.gridbottom;
       option.xAxis.data = v.xData;
+      option.series = [];
       v.yData.forEach((item, k) => {
         let o = cloneDeep(seriesItem); // JSON.parse(JSON.stringify(seriesItem));
-        // o.name = v.legend[k];
+        o.name = v.xData[k];
         o.data = item;
         // if (v.interval) {
         //   option.xAxis.axisLabel.interval = 0;

+ 6 - 6
src/views/cockpitNew1/stxf.vue

@@ -48,7 +48,7 @@ export default {
         { value: "ssxf", label: "山水工程" },
         { value: "haxf", label: "海岸线保护" },
       ],
-      tab: "tdxf",
+      tab: "ssxf",
       paramdatas: {},
       sdlist: {
         tdxf: [
@@ -96,12 +96,12 @@ export default {
       } else {
         this.sdata.tdxf = { xzqhdm_number: 100, zlmj: 0, tzje: 20 };
         this.sdata.haxf = { xzqhdm_number: 40, zlmj: 30, tzje: 3 };
-        this.eData.gridbottom = '10%';
+        this.eData.gridbottom = "10%";
         this.eData.xData = ["农用地", "建设用地", "生态修复", "历史文化保护"];
         this.eData.yData = [
-          [10, 10, 10, 10],
-          [10, 10, 30, 10],
-          [10, 10, 10, 40],
+          [10, 10, 10],
+          [10, 10, 30],
+          [10, 10, 10],
         ];
         this.$nextTick(() => {
           this.$refs.echartRef.setOptions(this.eData);
@@ -120,7 +120,7 @@ export default {
     GetQueryList(datas) {
       this.eData.xData = [];
       this.eData.yData = [];
-      this.eData.gridbottom = '40%';
+      this.eData.gridbottom = "40%";
       let params = {
         ...datas,
         jscType: `jsc_stxf_ywlx_${this.tab}`, // "jsc_stxf_ywlx_ssxf"