Ver Fonte

Merge branch 'master' of http://114.244.114.158:8802/siwei/real3d-portalsite

maxiaoxiao há 10 meses atrás
pai
commit
74991fae13

+ 18 - 12
src/views/cockpit/common/ThreeStackedBarAndLine.vue

@@ -16,7 +16,7 @@ export default {
     watch: {},
     //方法集合
     methods: {
-        init_echart(legendData, xdata, result) {
+        init_echart(obj) {
             const _this = this;
             _this.chart = echarts.init(this.$refs.ThreeStackedBarAndLine);
 
@@ -61,8 +61,7 @@ export default {
                 color: ['#efc943', '#4ee1ac', '#186bb8'],
 
                 legend: {
-                    data: ['临时用地面积', '正常使用', '剩余1个月', '已到期',],
-
+                    data: obj.legend_data,
                     top: '1%',
                     // textStyle: {
                     //     color: "#666666"
@@ -84,7 +83,7 @@ export default {
                 },
                 xAxis: [{
                     type: 'category',
-                    data: ['崖州区', '育才区', '天涯区', '吉阳区', '海棠区'],
+                    data: obj.x_data,
                     axisLabel: {
                         show: true,
                         fontSize: 12,
@@ -157,7 +156,7 @@ export default {
                     },
                 }],
                 series: [
-                
+
                     {
 
                         name: "临时用地面积",
@@ -169,7 +168,7 @@ export default {
                             }
                         },
                         yAxisIndex: 1, // 指定使用第二个Y轴  
-                        data: y1Data,
+                        data: obj.line_data,
                     }
                     , {
                         name: '剩余1个月',
@@ -177,7 +176,7 @@ export default {
                         stack: '渠道1',
                         barWidth: 14,
 
-                        data: [12, 12, 12, 12, 1, 2],
+                        data: obj.result[0],
                     },
                     {
                         name: '已到期',
@@ -185,7 +184,7 @@ export default {
                         stack: '渠道1',
                         barWidth: 14,
 
-                        data: [24, 12, 12, 0, 1, 2],
+                        data: obj.result[1],
                     },
                     {
                         name: '正常使用',
@@ -194,7 +193,7 @@ export default {
                         type: 'bar',
                         barWidth: 8,
                         stack: '渠道1',
-                        data: [12, 0, 0, 24, 21],
+                        data: obj.result[2],
                     },
                 ],
             }
@@ -202,8 +201,8 @@ export default {
             this.chart.setOption(option);
 
         },
-        setOptions(legendData, xdata, result) {
-            this.init_echart(legendData, xdata, result);
+        setOptions(obj) {
+            this.init_echart(obj);
         }
     },
     beforeCreate() { }, //生命周期 - 创建之前
@@ -212,7 +211,14 @@ export default {
     mounted() {
         const that = this;
         this.$nextTick((res) => {
-            this.init_echart();
+            // let obj = {
+            //     legend_data: ['临时用地面积', '正常使用', '剩余1个月', '已到期'],
+            //     x_data: ['崖州区', '天涯区', '吉阳区', '海棠区'],
+            //     line_data: [110, 90, 120, 70, 60],
+            //     result: [[12, 12, 12, 12, 1, 2], [24, 12, 12, 0, 1, 2], [12, 0, 0, 24, 21]]
+            // }
+            // this.setOptions(obj);
+
 
         })
     }, //生命周期 - 挂在完成

+ 39 - 12
src/views/cockpit/ydjc.vue

@@ -20,12 +20,12 @@
                 </div>
 
             </div>
-            <ThreeStackedBarAndLine v-if="xzqh_flag" class="qxjc_echart"></ThreeStackedBarAndLine>
+            <ThreeStackedBarAndLine ref="lsyd_echart" v-if="xzqh_flag" class="qxjc_echart"></ThreeStackedBarAndLine>
             <XZQHPieChart v-else="!xzqh_flag"></XZQHPieChart>
 
         </div>
         <!-- 临时用地(复垦监测) -->
-        <div v-show="value == options[1].value">
+        <!-- <div v-show="value == options[1].value">
             <div class="stacontent_ydjc">
                 <div class="item">
                     <span class="dlabel">应复垦面积:</span>
@@ -45,24 +45,24 @@
                 </div>
             </div>
             <ThreeStackedBarAndLine class="qxjc_echart"></ThreeStackedBarAndLine>
-        </div>
+        </div> -->
         <!-- 农专用地 -->
-        <div v-show="value == options[2].value">
+        <div v-show="value == options[1].value">
             <div class="stacontent_ydjc">
                 <div class="item">
                     <span class="dlabel">建设项目数:</span>
                     <span class="dvalue">1000个</span>
                 </div>
-                <div class="item">
+                <!-- <div class="item">
                     <span class="dlabel"> 项目用地面积:</span>
                     <span class="dvalue">543.89公顷</span>
-                </div>
+                </div> -->
                 <div class="item">
                     <span class="dlabel"> 农转用面积:</span>
                     <span class="dvalue">543.89公顷</span>
                 </div>
             </div>
-            <ThreeStackedBarAndLine v-if="xzqh_flag" class="qxjc_echart"></ThreeStackedBarAndLine>
+            <ThreeStackedBarAndLine ref="nzyd_echart" v-if="xzqh_flag" class="qxjc_echart"></ThreeStackedBarAndLine>
             <XZQHPieChart v-else="!xzqh_flag"></XZQHPieChart>
         </div>
     </div>
@@ -80,12 +80,12 @@ export default {
     data() {
         return {
             options: [
-                { value: "lsyd_qxjc", label: "临时用地(期限监测)" },
-                { value: "lsyd_fkjc", label: "临时用地(复垦监测)" },
-
+                // { value: "lsyd_qxjc", label: "临时用地(期限监测)" },
+                // { value: "lsyd_fkjc", label: "临时用地(复垦监测)" },
+                { value: "lsyd", label: "临时用地" },
                 { value: "nzyd", label: "农转用地" },
             ],
-            value: 'lsyd_qxjc',
+            value: 'lsyd',
             xzqh_flag: true
         };
     },
@@ -102,6 +102,25 @@ export default {
     methods: {
         changeChartsLeft(e) {
             console.log('e: ', e);
+            if (e == 'nzyd') {
+                let obj = {
+                    legend_data: ['临时用地面积', '正常使用', '剩余1个月', '已到期'],
+                    x_data: ['崖州区', '天涯区', '吉阳区', '海棠区'],
+                    line_data: [110, 90, 120, 70, 60],
+                    result: [[1, 1, 1, 1, 1, 2]]
+                }
+
+                this.$refs.nzyd_echart.setOptions(obj)
+            } else {
+                let obj = {
+                    legend_data: ['临时用地面积', '正常使用', '剩余1个月', '已到期'],
+                    x_data: ['崖州区', '天涯区', '吉阳区', '海棠区'],
+                    line_data: [110, 90, 120, 70, 60],
+                    result: [[12, 12, 12, 12, 1, 2], [24, 12, 12, 0, 1, 2], [12, 0, 0, 24, 21]]
+                }
+
+                this.$refs.lsyd_echart.setOptions(obj)
+            }
 
         },
         switch_xzqh(value) {
@@ -117,6 +136,14 @@ export default {
         const that = this;
         this.$nextTick((res) => {
             // this.init_info();
+            let obj = {
+                legend_data: ['临时用地面积', '正常使用', '剩余1个月', '已到期'],
+                x_data: ['崖州区', '天涯区', '吉阳区', '海棠区'],
+                line_data: [110, 90, 120, 70, 60],
+                result: [[12, 12, 12, 12, 1, 2], [24, 12, 12, 0, 1, 2], [12, 0, 0, 24, 21]]
+            }
+
+            this.$refs.lsyd_echart.setOptions(obj)
 
         })
     },
@@ -172,7 +199,7 @@ export default {
 
     /deep/ .el-input__inner {
         // padding-right: 30px;
-        width: 128px !important;
+        width: 90px !important;
         height: 24px !important;
         line-height: 24px;
         padding-left: 22px;