suerprisePlus
2024-10-15 afd3fe35aeaae4f3984c94ca29d57b5a3a52107f
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
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
<template>
  <div class="msgBox">
 
    <div class="aside-title">
      <div>故障信息</div>
      <div @click="sendDataToParent()" class="closeMsg">
        X
      </div>
    </div>
    <div class="menuTable">
      <table>
        <tr>
          <th style="width: 100px;">设备名称</th>
          <th>设备位置</th>
          <th style="width: 100px;">操作</th>
        </tr>
        <tr v-for="(item, indx) in $store.state.mapLayers.msgList" :key="indx">
          <td>{{ item.msg }}</td>
          <td>{{ item.point }}</td>
          <td>
            <el-button @click="handleClick(item)" type="text" size="small">查看</el-button>
            <!-- <el-button @click="handleClick2(item)" type="text" size="small">分发</el-button> -->
          </td>
        </tr>
      </table>
    </div>
 
  </div>
</template>
 
<script>
import mapConfig from '../../assets/js/mapSdk/mapConfig';
 
 
export default {
  components: {
 
  },
  props: {
 
  },
  data() {
    return {
      label: null,
    }
  },
  watch: {
 
  },
  mounted() {
 
  },
  methods: {
    sendDataToParent() {
      this.removeLabel();
      console.log(23);
 
      this.$emit('childData', '子组件数据');
 
    },
    removeLabel() {
      if (this.label) {
        this.label.removeFromMap()
        this.label = null;
      }
    },
    handleClick(item) {
      this.removeLabel();
      // const point = mapConfig.getWKTParse(item.point)
      const point = item.point.split(" ")
      this.label = earthCtrl.factory.createLabel({
        lon: point[0],
        lat: point[1],
        alt: 40,
        text: item.msg,
        image: config.sdkImg + 'Workers/image/mark.png',
        // 文本偏移量
        pixelOffset: new SmartEarth.Cesium.Cartesian2(0, -50),
        // 图片偏移量
        iPixelOffset: new SmartEarth.Cesium.Cartesian2(0, -20)
      });
      earthCtrl.userScene.flyTo(this.label)
    },
    handleClick2(item) {
 
    },
    setMsgClose() {
 
    }
 
  }
}
</script>
 
<style lang="scss" scoped>
.msgBox {
  width: 100%;
  height: 100%;
  background: url(~@/assets/images/Screen/chartbg.png) no-repeat;
  background-size: 100% 100%;
  position: relative;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
 
  .aside-title {
    box-sizing: border-box;
    padding-left: 30px;
    font-size: 15px;
    font-family: YouSheBiaoTiHei, YouSheBiaoTiHei-Regular;
    color: #fff;
    width: 100%;
    height: 45px;
    line-height: 45px;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    display: flex;
 
    .closeMsg {
      margin-left: 64%;
      cursor: pointer;
    }
 
    .closeMsg :hover {
      color: #409EFF;
    }
 
  }
 
  .menuTable {
    margin: 5px;
    margin-top: 10px;
    text-align: center;
    flex: 1;
    overflow: auto;
 
    table {
      width: 100%;
      color: white;
 
      th {
        text-align: center;
 
      }
 
      td {
        line-height: 30px;
        border-bottom: 1px solid #409EFF;
        ;
      }
    }
  }
}
 
/*滚动条整体样式*/
::-webkit-scrollbar {
  /*高宽分别对应横竖滚动条的尺寸*/
  width: 5px;
  height: 1px;
}
 
/*滚动条里面小方块*/
::-webkit-scrollbar-thumb {
  border-radius: 5px;
  -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  background: #409EFF;
}
 
/*滚动条里面轨道*/
::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  background: rgba(237, 237, 237, .1);
}
</style>