index.vue 10.9 KB
Newer Older
yaqizhang's avatar
yaqizhang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
<template>
    <div style="padding: 40px 40px 20px 40px;">
      <div class="bottletop">
          <div class="bottletopleft">
              <div class="bottop">
                  <div class="botbanner">
                     <div style="margin-left: 20px;position: absolute;">气瓶统计</div> 
                      <img src="../../../assets/mapinages/Group1129.png" alt="" style="width: 100%;height: 100%;position: absolute;top: 0;left: 0;">
                  </div>
                  <div class="botnumber">
                      <div class="botimage">
                          <img src="../../../assets/mapinages/Group1130.png" alt="" style="width: 100px;height: 100px;margin-top: 30px;">
                          <div class="ima">
                             <div style="color: #4CC4E0;font-weight: bolder;">358275</div><span style="color: #fff;">总计</span>
                          </div>
                      </div>
                      <div class="botnum">
                          <div class="numdiv">
                              <p style="color: #4CC4E0;">本月新增</p>
                              <span style="color: #EEC25B;font-size: 30px;">683</span><span style="color: #4CC4E0;"></span>
                          </div>
                          <div class="numdiv">
                            <p style="color: #4CC4E0;">本年新增</p>
                            <span style="color: #EEC25B;font-size: 30px;">683</span><span style="color: #4CC4E0;"></span>
                        </div>
                      </div>
                  </div>
              </div>
              <div class="bottop">
                <div class="botbanner">
                   <div style="margin-left: 20px;position: absolute;">气瓶配送统计</div> 
                    <img src="../../../assets/mapinages/Group1129.png" alt="" style="width: 100%;height: 100%;position: absolute;top: 0;left: 0;">
                </div>
                <div class="botnumber">
                    <div class="botimage">
                        <img src="../../../assets/mapinages/Group1130.png" alt="" style="width: 100px;height: 100px;margin-top: 30px;">
                        <div class="ima">
                           <div style="color: #4CC4E0;font-weight: bolder;">35358275</div><span style="color: #fff;">总计</span>
                        </div>
                    </div>
                    <div class="botnum">
                        <div class="numdiv">
                            <p style="color: #4CC4E0;">本月新增</p>
                            <span style="color: #EEC25B;font-size: 30px;">6833</span><span style="color: #4CC4E0;"></span>
                        </div>
                        <div class="numdiv">
                          <p style="color: #4CC4E0;">本年新增</p>
                          <span style="color: #EEC25B;font-size: 30px;">623483</span><span style="color: #4CC4E0;"></span>
                      </div>
                    </div>
                </div>
              </div>
          </div>
          <div class="bottletopcenter">
            <div id="map"></div>
          </div>
          <div class="bottletopright">
            <div class="bottop">
                <div class="botbanner">
                   <div style="margin-left: 20px;position: absolute;">气瓶充装统计</div> 
                    <img src="../../../assets/mapinages/Group1129.png" alt="" style="width: 100%;height: 100%;position: absolute;top: 0;left: 0;">
                </div>
                <div class="botnumber">
                    <div class="botimage">
                        <img src="../../../assets/mapinages/Group1130.png" alt="" style="width: 100px;height: 100px;margin-top: 30px;">
                        <div class="ima">
                           <div style="color: #4CC4E0;font-weight: bolder;">358275</div><span style="color: #fff;">总计</span>
                        </div>
                    </div>
                    <div class="botnum">
                        <div class="numdiv">
                            <p style="color: #4CC4E0;">本月新增</p>
                            <span style="color: #EEC25B;font-size: 30px;">6843</span><span style="color: #4CC4E0;"></span>
                        </div>
                        <div class="numdiv">
                          <p style="color: #4CC4E0;">本年新增</p>
                          <span style="color: #EEC25B;font-size: 30px;">6483</span><span style="color: #4CC4E0;"></span>
                      </div>
                    </div>
                </div>
            </div>
            <div class="bottop">
              <div class="botbanner">
                 <div style="margin-left: 20px;position: absolute;">瓶装燃气用户分析</div> 
                  <img src="../../../assets/mapinages/Group1129.png" alt="" style="width: 100%;height: 100%;position: absolute;top: 0;left: 0;">
              </div>
              <div class="botnumber">
yaqizhang's avatar
yaqizhang committed
88
                <div id="myChartpieone" :style="{width: '100%', height: '100%'}"></div>
yaqizhang's avatar
yaqizhang committed
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
              </div>
            </div>
          </div>
      </div>
      <div class="bottlebottom">
          <operationNum></operationNum>
      </div>
    </div>
  </template>
  
  <script>
  import * as echarts from 'echarts';
  import operationNum from "./components/operationNum";
  import { EditorMap } from "@/utils/mapClass/map";
  import { mapGetters } from "vuex";
yaqizhang's avatar
yaqizhang committed
104
  import Null from "@/components/bigWindow/Null.vue";
yaqizhang's avatar
yaqizhang committed
105 106 107 108 109 110 111 112 113
  // import { EditorMap } from "@/utils/mapClass/getPath.js";
  export default {
    components: {
        operationNum,
    },
    data() {
    return {
      //地图
      // map: null,
yaqizhang's avatar
yaqizhang committed
114 115 116 117 118 119 120 121 122 123 124
      arr:[
        {longitude:114.186007 , latitude:38.260288 , iconType:17},
        {longitude:114.185143, latitude:38.260178,  iconType:17},
        {longitude:114.186345 , latitude:38.261046 , iconType:17},
        {longitude:114.187007 , latitude:38.262288 , iconType:17},
        {longitude:114.186143, latitude:38.265178,  iconType:17},
        {longitude:114.187345 , latitude:38.267046 , iconType:17},
        {longitude:114.188007 , latitude:38.268288 , iconType:17},
        {longitude:114.189143, latitude:38.263178,  iconType:17},
        {longitude:114.189345 , latitude:38.269046 , iconType:17},
      ]
yaqizhang's avatar
yaqizhang committed
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
    }
  },
  computed: {
    ...mapGetters([ "systemSetting"])
  },
  mounted () {
        this.drawLine();
        const path = eval(this.systemSetting.map_center);
        this.map = new EditorMap(
          "map",
          {
            center: path,
            zoom: 14.5,
          },
          this
        );
yaqizhang's avatar
yaqizhang committed
141
          this.addDevice();
yaqizhang's avatar
yaqizhang committed
142 143
      },
      methods: {
yaqizhang's avatar
yaqizhang committed
144 145 146 147 148
        addDevice(data, component) {
          for(let i =0;i<this.arr.length;i++){
            this.map.addDevice(this.arr[i], Null);
          }
        },
yaqizhang's avatar
yaqizhang committed
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
        drawLine() {
        // 基于准备好的dom,初始化echarts实例
            let myChart1 = this.$echarts.init(document.getElementById("myChartpieone"));
            // 绘制图表
            myChart1.setOption({
              grid: {
                bottom: "7%",
                containLabel: true,
              },
              legend: {
                    orient:"horizontal",
                    icon: "circle",
                    x:'right',
                    y:' center',
                    width:'300',
                    padding:[25, 30,0, 0],
                    itemWidth:10,
                    textStyle:{
                        color:'#000',
                    },
                },
            tooltip: {
              trigger: 'item',
            },
            series: [
              {
                name: '任务概况',
                type: 'pie',
                radius: ['50%', '70%'],
                center: ['50%','60%'],
                data: [
                  { 
                    value: 40,
                    name: '居民',
                    itemStyle: { color: '#4CC4E0' }
                },
                  { 
                    value: 59,
                      name: '非居民' ,
                    itemStyle: { color: '#EEC25B' }
                  },
                ],
                labelLine:{
                        length:20,
                        length2:20,
                    },
                  label:{
                    color:'#fff',
                      fontSize: 14,
                      // formatter:"{b}\n\n",
                      // padding:[0,-55],
                      normal: {
                        show: true,
                        position: 'outer',
                        // formatter: '{d}%, {c} \n\n',
                        //模板变量有 {a}, {b},{c},{d},{e},分别表示系列名,数据名,数据值等。
                        formatter: "{a_set|{b}}{b_set|{d}%}",
                        // formatter: "{a_set|{b}}\n{c_set|{d}%}\n{b|}\n\n",
                        borderWidth: 10,
                        borderRadius: 4,
                        rich: {
                            a_set: {
                                color: "auto",
                                // lineHeight: 20,
                                align: "left",
                                // padding: [55, -40, -15, -40],
                            },
                            b_set:{
                                color: "auto",
                            },
                        }
                      }
                  },
                emphasis: {
                  itemStyle: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                  }
                }
              }
            ]
            });
        }

      }
  };
  </script>
  <style lang="scss" scoped>
    .bottletop{
        width: 100%;
        height: 450px;
yaqizhang's avatar
yaqizhang committed
241 242
        display: flex;

yaqizhang's avatar
yaqizhang committed
243 244
    }
    .bottletopleft{
yaqizhang's avatar
yaqizhang committed
245
        width: 27.5%;
yaqizhang's avatar
yaqizhang committed
246
        height: 100%;
yaqizhang's avatar
yaqizhang committed
247

yaqizhang's avatar
yaqizhang committed
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264
    }
    .bottop{
        width: 100%;
        height: 50%;
    }
    .botbanner{
        width: 100%;
        height: 30px;
        position: relative;
        font-weight: bolder;
    }
    .botnumber{
        width: 100%;
        height: 100%;
    }
    .botimage{
        float: left;
yaqizhang's avatar
yaqizhang committed
265
        width: 100px;
yaqizhang's avatar
yaqizhang committed
266 267 268 269 270 271 272 273 274 275 276 277 278
        height: 200px;
        position: relative;
        margin-left: 20px;
    }
    .ima{
        width: 100%;
        position: absolute;
        text-align: center;
        top: 0;
        margin-top: 60px;
    }
    .botnum{
        float: left;
yaqizhang's avatar
yaqizhang committed
279
        width: 65%;
yaqizhang's avatar
yaqizhang committed
280
        height: 200px;
yaqizhang's avatar
yaqizhang committed
281
        padding: 30px 0 25px 0;
yaqizhang's avatar
yaqizhang committed
282 283 284 285 286 287 288 289 290
    }
    .numdiv{
        width: 50%;
        text-align: center;
        float: left;
    }
    .bottletopcenter{
        width: 45%;
        height: 100%;
yaqizhang's avatar
yaqizhang committed
291
        /* float: left; */
yaqizhang's avatar
yaqizhang committed
292 293 294 295 296 297 298
        margin-left: 40px;
    }
    #map{
      width: 100%;
      height: 100%;
    }
    .bottletopright{
yaqizhang's avatar
yaqizhang committed
299
        width: 27.5%;
yaqizhang's avatar
yaqizhang committed
300
        height: 100%;
yaqizhang's avatar
yaqizhang committed
301
        /* float: left; */
yaqizhang's avatar
yaqizhang committed
302 303 304 305 306 307 308 309 310
        margin-left: 40px;
    }
    .bottlebottom{
        width: 100%;
        height: 340px;
        margin-top: 30px;
    }
  </style>