GuLiMmo
2024-03-22 d4d5d48934c3c9647ae73eb2e61cd6bd5a8bba69
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
<template>
  <div class="event-container" v-if="isActionEditShow">
    <div class="edit-box" v-if="currentPointEvent">
      <div class="header">
        <div class="action-name">
          <img :src="currentPointEvent.aciton.icon" alt="icon" />
          <span>{{ currentPointEvent.aciton.name }}</span>
        </div>
        <div class="action-index">{{ currentPointEvent.actionIndex }}</div>
        <div class="action-del">
          <span @click="handleDelAction"><DeleteOutlined /></span>
        </div>
      </div>
      <div class="event-edit">
        <template v-if="currentPointEvent.aciton.key === 'takePhoto'">
          1
        </template>
      </div>
    </div>
    <div class="map-box"></div>
  </div>
</template>
 
<script lang="ts" setup>
import { DeleteOutlined } from '@ant-design/icons-vue'
import { useMyStore } from '/@/store'
import { actionList } from '/@/utils/cesium/use-map-draw'
import { template as xmlTemplate } from '/@/utils/cesium/use-kmz-tsa'
 
const store = useMyStore()
// 事件编辑是否显示
const isActionEditShow = computed(() => store.state.waylineTool.isShow)
// 当前点事件
const selectedAction = computed(() => store.state.waylineTool.selectedAction)
 
const currentPointEvent = computed(() => {
  const placemarks = xmlTemplate.value.Folder.Placemark
  const pointIndex = store.state.waylineTool.selectedPoint
  if (pointIndex === undefined) return null
  const currentPoint = placemarks[pointIndex]
  const actions = currentPoint.actionGroup.action
  let actionIndex = 1
  if (Array.isArray(actions)) {
    actionIndex = actions.findIndex((item: { actionActuatorFunc: { '#text': string } }) => {
      return item.actionActuatorFunc['#text'] === selectedAction.value.key
    })
  }
  return {
    aciton: selectedAction.value,
    actionIndex: `${pointIndex + 1}-${actionIndex + 1}`,
  }
})
 
const handleDelAction = () => {}
</script>
 
<style lang="scss" scoped>
.event-container {
  width: 400px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: rgb(35, 35, 35);
  color: #fff;
  .edit-box {
    width: 400px;
    height: calc(100% - 300px);
    .header {
      padding: 0 15px;
      height: 50px;
      border-bottom: 1px solid rgb(79, 79, 79);
      display: flex;
      align-items: center;
      div {
        flex: 1;
        flex-shrink: 0;
      }
      .action-name {
        display: flex;
        align-items: center;
        img {
          width: 15px;
          height: 15px;
          margin-right: 3px;
        }
      }
      .action-index {
        text-align: center;
        font-weight: bold;
      }
      .action-del {
        display: flex;
        justify-content: flex-end;
        span {
          cursor: pointer;
          &:hover {
            color: #409eff;
          }
        }
      }
    }
    .event-edit {
      width: 100%;
      height: calc(100% - 50px);
      padding: 15px;
      overflow: auto;
    }
  }
  .map-box {
    width: 400px;
    height: 300px;
  }
}
</style>