Sfoglia il codice sorgente

map change

pull/203/head
lixin 1 anno fa
parent
commit
f569f52d24
1 ha cambiato i file con 22 aggiunte e 2 eliminazioni
  1. +22
    -2
      src/views/task-manage/all-task/components/LiveDrawer.vue

+ 22
- 2
src/views/task-manage/all-task/components/LiveDrawer.vue Vedi File

@@ -41,7 +41,7 @@
</template>

<script>
import { defineComponent, computed, ref, reactive, toRefs, watch, nextTick } from 'vue'
import { defineComponent, computed, ref, reactive, toRefs, watch, nextTick, onBeforeUnmount } from 'vue'
import { Map, View, Feature } from 'ol'
import 'ol/ol.css'
import { Tile, Vector as VectorLayer } from 'ol/layer'
@@ -158,6 +158,14 @@ export default defineComponent({
})
}
liveStore.resetList()
originRef.value?.disposeVideo()
data.videoInfo = {
url: null,
status: 'init'
}
data.mapData = null
clearInterval(data.socket)
data.socket = null
}

/* 获取轨迹数据 */
@@ -238,7 +246,7 @@ export default defineComponent({
zoom: false
})
})
data.mapData.render()
// data.mapData.render()
}

/* 处理轨迹列表 */
@@ -360,6 +368,18 @@ export default defineComponent({
data.videoShow = value
}

onBeforeUnmount(() => {
liveStore.resetList()
originRef.value?.disposeVideo()
data.videoInfo = {
url: null,
status: 'init'
}
data.mapData = null
clearInterval(data.socket)
data.socket = null
})

return {
...toRefs(data),
originRef,

Loading…
Annulla
Salva