whycwx
2021-09-29 6a67b7054caa33f2999e8b05538e39ccea55ed07
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
<template>
  <div class="echarts-wrapper">
    <div class="echarts-content" ref="chinaMap" id="chinaMap">
 
    </div>
  </div>
</template>
 
<script>
import * as echarts from 'echarts';
import { 
    getAllMapOutlineAction,
} from "../../assets/js/api";
export default {
  name: "chinaMap",
  chart: "",
  props: {
    id: {
      require: true,
      type: String,
      default: "",
    },
    name: {
      type: String,
      default: ""
    },
    top: {
      type: Number,
      default: 15,
    },
    bottom: {
      type: Number,
      default: 60
    },
    space: {
      type: Number,
      default: 4
    },
  },
  data() {
    return {
 
    }
  },
  methods: {
      getAllMapOutlineAction() {
        //查询激活轮廓图
        getAllMapOutlineAction().then((res) => {
            let rs = JSON.parse(res.data.result);
            if (rs.code == 1) {
                let data = rs.data;
                data.map((item, index) => {
                if (item.status == 1) {
                    this.mapName = item.name;
                }
                });
            }
            if (!this.mapName) {
                this.mapStyle = "百度地图";
            }
            this.mapNameCopy = this.mapName;
            this.$nextTick(() => {
                // this.initPage();
            });
            })
            .catch((err) => {
            console.log(err);
            });
    },
  },
  mounted() {
    // 初始化页面
    this.getAllMapOutlineAction();
    
  },
  destroyed() {
 
  }
}
</script>
 
<style scoped>
 
</style>