suerprisePlus
2024-06-12 0b7865733542931c7c3fcf74febd30fe145af957
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<template>
  <div id="sdkContainer" class="mapView">
    <div class="infoBox" v-show="errInfoFlag">
      <div id="inforMessage"></div>
      <div class="infoBottom">
        <button @click="setQueryErroInfo(true)">询问</button>
        <button @click="setQueryErroInfo(false)">关闭</button>
      </div>
    </div>
  </div>
</template>
 
<script>
import configInfo from "../../assets/js/msg/configInfo.js";
import mapView from "./../../assets/js/map/mapView.js";
import bus from "./../../assets/js/bus.js";
import mapServer from "../../assets/js/map/mapServer.js";
export default {
  data() {
    return {
      errInfoMessage: null,
      errInfoFlag: false
    };
  },
  computed: {
    erroInfo() {
      return this.$store.state.erroInfoMessage;
    }
  },
  watch: {
    erroInfo(nVal, Oval) {
      if (nVal) {
        this.setErrorMessage(nVal);
      }
    }
  },
  methods: {
    setMapViewStart() {
      mapView.initMap();
     
    },
    setErrorMessage(res) {
      this.errInfoMessage = res;
      const obj = configInfo.errorInfo(res);
      document.getElementById("inforMessage").innerHTML = obj;
      this.errInfoFlag = true;
      this.$store.state.erroInfoMessage = null;
    },
    setQueryErroInfo(res) {
      if (res) {
        const obj = JSON.parse(JSON.stringify(this.errInfoMessage));
        bus.$emit("mapInfo", {
          type: "erroInfo",
          value: obj.val
        });
     
      }
      this.$nextTick(() => {
        this.errInfoFlag = false;
        document.getElementById("inforMessage").innerHTML = "";
        this.errInfoMessage = null;
      });
    }
  },
 
  mounted() {
    this.setMapViewStart();
  }
};
</script>
 
<style scoped>
.mapView {
  width: 100%;
  height: 100%;
  position: absolute;
}
.infoBox {
  left: 50%;
  top: 50%;
  position: absolute;
  z-index: 40;
  border-radius: 10px;
  border: 1px solid #797979;
  background-color: #000000;
  box-sizing: border-box;
  padding: 10px;
  font-family: "Arial", sans-serif;
  color: white;
  transform: translate(-50%, -50%);
}
.infoBottom {
  margin-top: 10px;
  float: right;
}
.infoBottom :first-child {
  margin-right: 10px;
}
.infoBottom button {
  width: 50px;
 
  padding: 2px 2px 2px 2px;
  border-radius: 5px;
  background-color: #797979;
  box-sizing: border-box;
  font-family: "Arial", sans-serif;
  color: #ffffff;
  text-align: center;
  line-height: normal;
  font-size: 12px;
}
</style>
<style>
.infoTitle {
  font-size: 16px;
  line-height: 30px;
}
.infoCount {
  font-size: 14px;
  line-height: 30px;
}
</style>