zpf vor 11 Monaten
Ursprung
Commit
df0d3403b2

+ 1 - 1
src/views/cockpit/bjxm.vue

@@ -538,7 +538,7 @@ export default {
 
 #bjxm_echart {
   position: relative;
-  top: 0;
+  top: 0.4rem;
   width: 20.5rem;
   height: 10rem;
 }

+ 217 - 0
src/views/cockpit/common/Graph3D.vue

@@ -0,0 +1,217 @@
+<template>
+    <div id="BarGraph3D" ref="BarGraph3D"></div>
+</template>
+
+<script>
+//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+
+export default {
+    components: {},
+    props: {
+        legendData: {
+            type: Array,
+        },
+        xdata: {
+            type: Array,
+        },
+        result: {
+            type: Array,
+        }
+    },
+    watch: { // 监听到数据然后赋值
+        legendData(oldval, newval) {
+            this.ChangeData()
+        },
+        xdata(oldval, newval) {
+            this.ChangeData()
+        }, result(oldval, newval) {
+            this.ChangeData()
+        },
+        deep: true
+    },
+    data() {
+        return {
+            chart: null,
+            option: null,
+        };
+    },
+    //监听属性 类似于data概念
+    computed: {},
+    //监控data中的数据变化
+    watch: {},
+    //方法集合
+    methods: {
+        init_3DBarGraph_echart(legendData, xdata, result) {
+            const _this = this;
+            _this.chart = echarts.init(this.$refs.BarGraph3D);
+            // Mock数据
+            const mockData = {
+                // xdata: ['居民用地', '公共管理用地', '商业商服用地', '工矿用地', '工矿用地仓储用地', "交通运输用地"],
+                xdata: xdata,
+
+                result: result
+            }
+
+            const color = [
+                [{ offset: 0, color: 'rgba(183, 117, 12, 0.8)' }, { offset: 0.5, color: 'rgba(183, 117, 12, 0.8)' }, { offset: 0.5, color: 'rgba(249, 180, 71, 0.8)' }, { offset: 1, color: 'rgba(249, 180, 71, 0.8)' }],
+
+                [{ offset: 0, color: 'rgba(34, 129, 209, 0.8)' }, { offset: 0.5, color: 'rgba(34, 129, 209, 0.8)' }, { offset: 0.5, color: 'rgba(97, 173, 237, 0.8)' }, { offset: 1, color: 'rgba(97, 173, 237, 0.8)' }],
+
+            ]
+            const color2 = ['rgba(34, 129, 209, 0.8)', 'rgba(34, 129, 209, 0.8)',]
+
+            const tooltip = {
+                backgroundColor: 'RGBA(20, 106, 178, 0.4)',
+                trigger: "axis",
+                textStyle: { fontSize: '100%' },
+                formatter: params => {
+                    let rander = params.map(item =>
+                        `
+                    <div style='
+                        border:none;
+                        border-radius:3px;
+                        color:#FFF;
+                        font-size:12px
+                        '>
+                            ${item.seriesName ? item.seriesName : ''} ${item.value > 0 ? item.value : ''}
+                    </div>`).join('')
+                    return rander
+                }
+            }
+
+            const legend = {
+                data: legendData,      //图例名称
+
+                textStyle: { fontSize: 12, color: '#fff' },
+                itemWidth: 24,
+                itemHeight: 15,
+                itemGap: 15,
+                top: '5%',
+                right: '2%',
+                selectedMode: false
+            }
+            const grid = { top: '10%', left: '5%', right: '10%', bottom: '15%' }
+            // xAxis
+            const xAxis = {
+                axisTick: { show: false },
+                axisLine: { lineStyle: { color: '#BCD3E5' } },
+                axisLabel: {
+                    textStyle: { fontSize: 12, color: '#BCD3E5' },
+                },
+                axisLabel: {
+                    interval: 0,
+                    formatter: function (value) {
+                        // 当文字长度大于2时,使用slice方法截取字符串并拼接省略号;否则直接返回原文字
+                        if (value.length > 4) {
+                            return `${value.slice(0, 4)}...`;
+                        } else {
+                            return value;
+                        }
+                    },
+                },
+                data: mockData.xdata,
+            }
+
+            // yAxis
+            const yAxis = [{
+                axisTick: { show: false },
+                axisLine: { show: false },
+                splitLine: { lineStyle: { color: 'rgba(255,255,255, .05)' } },
+                axisLabel: { show: false, textStyle: { fontSize: 14, color: '#fff' } }
+            }, {
+                show: false,
+                splitLine: { show: false },
+                axisLine: { show: false },
+                axisTick: { show: false },
+            }]
+            const diamondData = mockData.result.reduce((pre, cur, index) => {
+                pre[index] = cur.data.map((el, id) => el + (pre[index - 1] ? pre[index - 1][id] : 0))
+                return pre
+            }, [])
+
+            let series = mockData.result.reduce((p, c, i, array) => {
+                p.push({
+                    z: i + 1,
+                    stack: '总量',
+                    type: 'bar',
+                    name: c.name,
+                    barGap: 18,
+                    barWidth: 18,
+                    data: c.data,
+                    itemStyle: { color: { type: 'linear', x: 0, x2: 1, y: 0, y2: 0, colorStops: color[i] } },
+                }, {
+                    z: i + 10,
+                    type: 'pictorialBar',
+                    symbolPosition: 'end',
+                    symbol: 'diamond',
+                    symbolOffset: [0, '-50%'],
+                    symbolSize: [18, 12],
+                    data: diamondData[i],
+                    itemStyle: { color: color2[i] },
+                    tooltip: { show: false },
+                })
+
+                // 是否最后一个了?
+                if (p.length === (array.length) * 2) {
+                    p.push({
+                        z: array.length * 2,
+                        type: "pictorialBar",
+                        symbolPosition: "start",
+                        data: mockData.result[0].data,
+                        symbol: "diamond",
+                        symbolOffset: ["0%", "50%"],
+                        symbolSize: [18, 10],
+                        itemStyle: { color: { type: 'linear', x: 0, x2: 1, y: 0, y2: 0, colorStops: color[0] } },
+                        tooltip: { show: false },
+                    })
+                    return p
+                }
+
+                return p
+            }, [])
+
+            const dataZoom = [{
+                show: false,
+                type: 'slider',
+                startValue: 0,
+                endValue: 7,
+                moveOnMouseWheel: true,
+                moveOnMouseMove: true,
+                zoomOnMouseWheel: false,
+            }]
+
+            _this.option = {
+
+                tooltip, legend, xAxis, yAxis, series, grid, dataZoom, backgroundColor: 'rgba(0, 0, 0, 0)'
+            }
+
+            this.chart.setOption(this.option);
+
+        },
+        setOptions(legendData, xdata, result) {
+            this.init_3DBarGraph_echart(legendData, xdata, result);
+        }
+    },
+    beforeCreate() { }, //生命周期 - 创建之前
+    created() { }, //生命周期 - 创建完成(可以访问当前this实例)
+    beforeMount() { }, //生命周期 - 挂载之前
+    mounted() {
+        const _this = this;
+        // this.init_3DBarGraph_echart(_this.$props.legendFlag, _this.$props.xdata, _this.$props.result);
+    }, //生命周期 - 挂在完成
+    beforeUpdate() { }, //生命周期 - 更新之前
+    updated() { }, //生命周期 - 更新之后
+    beforeDestroy() { }, //生命周期 - 销毁之前
+    destroy() { },//生命周期 - 销毁完成
+    activated() { }, //若组件实例是 <KeepAlive> 缓存树的一部分,当组件被插入到 DOM 中时调用。
+    deactivated() { } //若组件实例是 <KeepAlive> 缓存树的一部分,当组件从 DOM 中被移除时调用。
+};
+</script>
+<style  scoped>
+#BarGraph3D {
+    left: 0rem;
+    top: 0.1rem;
+    width: 27rem;
+    height: 11rem;
+}
+</style>

+ 106 - 20
src/views/cockpit/tdsy.vue

@@ -94,8 +94,27 @@
         <pie3d id="tdgy_echart_gyyd" unit="公顷" :legendFlag=true ref="tdgy_echart_gyyd"></pie3d>
       </div>
       <div v-show="left_value == left_options[2].value">
-        <DialWatch class="hysy_dial_watch" :dial_watch_info="dial_watch_info" ref="hysy_dial_watch" />
-        <BarGraph3D class="hysy_bar_graph" ref="hysy_bar_graph" />
+        <div class="conten_hy">
+          <div class="item">
+            <div class="icon">
+              <div class="icon_zxkg"></div>
+            </div>
+            <div class="text_hy">
+              <p class="p_hy">完成出让海域</p>
+              <span class="span_hy">{{ wccchy }}</span>公顷
+            </div>
+          </div>
+          <div class="item">
+            <div class="icon">
+              <div class="icon_zxkg"></div>
+            </div>
+            <div class="text_hy">
+              <p class="p_hy">完成出让项目</p>
+              <span class="span_hy">{{ wcccxm }}</span>个
+            </div>
+          </div>
+        </div>
+        <Graph3D class="hysy_bar_graph" ref="hysy_bar_graph" />
 
       </div>
     </div>
@@ -112,12 +131,14 @@
 import { QueryOne, QueryList } from "../../api/cockpitNew";
 import pie3d from "../../components/echartsTemplate/3dPie.vue";
 import DialWatch from './common/DialWatch.vue';
-import BarGraph3D from './common/BarGraph3D.vue';
+import Graph3D from './common/Graph3D.vue';
 
 export default {
-  components: { pie3d, DialWatch, BarGraph3D },
+  components: { pie3d, DialWatch, Graph3D },
   data() {
     return {
+      wccchy: "",
+      wcccxm: "",
       legendData: ['计划收储', '完成收储'],
       xdata: ['居民用地', '公共管理用地', '商业商服用地', '工矿用地', '工矿用地仓储用地', "交通运输用地"],
       result: [
@@ -241,15 +262,20 @@ export default {
 
         },
       }
-      let echart_data = 0;
-      if (data.data[0].sj_mj == 0) {
-        echart_data = 0
-      } else if (data.data[0].jh_mj == 0 && data.data[0].sj_mj > 0) {
-        echart_data = 100
-      } else {
-        echart_data = (data.data[0].sj_mj / data.data[0].jh_mj * 100).toFixed(2)
-      }
-      that.$refs.hysy_dial_watch.init_dial_watch(echart_data);
+
+      that.wccchy = that.dial_watch_info.lb.value
+      console.log('that.wccchy : ', that.wccchy);
+      that.wcccxm = that.dial_watch_info.rb.value
+
+      // let echart_data = 0;
+      // if (data.data[0].sj_mj == 0) {
+      //   echart_data = 0
+      // } else if (data.data[0].jh_mj == 0 && data.data[0].sj_mj > 0) {
+      //   echart_data = 100
+      // } else {
+      //   echart_data = (data.data[0].sj_mj / data.data[0].jh_mj * 100).toFixed(2)
+      // }
+      // that.$refs.hysy_dial_watch.init_dial_watch(echart_data);
       // store.state.cockpit_hysy.info = data.data[0]
     },
     async init_tdgy_gy_jg(params) {
@@ -785,7 +811,7 @@ export default {
       let xdata = [];
       let result = [
         {
-          name: "计划出让",
+          name: "",
           data: []
         },
         {
@@ -795,14 +821,14 @@ export default {
       ];
       data.data.forEach((res) => {
         xdata.push(res.yhlx_name);
-        result[0].data.push(res.jh_mj);
+        result[0].data.push(0);
         result[1].data.push(res.sj_mj);
 
       })
 
       that.xdata = xdata;
       that.result = result;
-      that.legendData = ['计划出让', '完成出让'];
+      that.legendData = ['完成出让'];
       this.$refs.hysy_bar_graph.setOptions(this.legendData, this.xdata, this.result);
 
     }
@@ -870,8 +896,7 @@ export default {
         font-size: 14px;
         font-weight: bold;
         position: relative;
-        bottom: -0.2rem;
-        right: -2.3rem;
+        bottom: 1.8rem;
       }
     }
 
@@ -1157,8 +1182,69 @@ export default {
 
 }
 
+.conten_hy {
+  position: relative;
+  left: 3rem;
+  top: 0rem;
+}
+
 .hysy_bar_graph {
-  top: -3.5rem !important;
-  height: 7.9rem !important;
+  top: 1.5rem !important;
+  height: 9.9rem !important;
+}
+
+
+
+.content {
+  position: absolute;
+  left: 5%;
+  width: 400px;
+  height: 220px;
+  top: 7rem;
+}
+
+.item {
+  width: 45%;
+  height: 30%;
+  display: inline-block;
+}
+
+.icon {
+  width: 50px;
+  padding: 1.5%;
+  border-radius: 8px;
+  display: inline-block;
+  height: 50px;
+}
+
+.icon_zxkg {
+  background: no-repeat 50%;
+  background-image: url("/static/images/overview/icongdbh0.png");
+  /* border: #00FFFF 1px solid; */
+  width: 45px;
+  height: 45px;
+  display: inline-block;
+}
+
+.text_hy {
+  display: inline-block;
+  // border: #00FFFF 1px solid;
+  width: 100px;
+
+  .p_hy {
+    font-kerning: normal;
+    font-family: "Arial Negreta", "Arial Normal", "Arial";
+    font-weight: 700;
+    font-style: normal;
+    font-size: 14px;
+    color: #ffffff;
+  }
+
+  .span_hy {
+    font-family: "Arial Negreta", "Arial Normal", "Arial";
+    font-weight: 700;
+    font-style: normal;
+    color: #68f4fb;
+  }
 }
 </style>

+ 1 - 1
src/views/cockpit/wpjg.vue

@@ -623,7 +623,7 @@ export default {
 
 #wpjg_echart {
   left: -1rem;
-  top: -0.5rem;
+  top: -0.9rem;
   width: 26rem;
   height: 12rem;
 }

+ 1 - 0
src/views/viewer.vue

@@ -98,6 +98,7 @@ export default {
             this.$refs.tdgy_ref.getInfo(this.params);
             this.$refs.tdgy_ref.init_tdgy_jt_jd(this.params);
             this.$refs.tdgy_ref.init_echart_data(this.params);
+            this.$refs.tdgy_ref.init_info(this.params);
 
 
             // 海域使用