上海市东方医院导视
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

31 lines
732 B

import { ref, computed, onBeforeUnmount } from 'vue'
export const useSetCameraViews = pauseFn => {
const map = {
'3D': {
text: '2D',
image: require('@/assets/images/nav/2D.svg')
},
'2D': {
text: '3D',
image: require('@/assets/images/nav/3D.svg')
}
}
const text = ref(window.pathCameraState)
const cameraViews = computed(() => map[text.value])
//设置导航视角 2D或者3D
function setCameraViews() {
pauseFn?.()
window.Map_QM.pathRePlay()
const _text = text.value === '2D' ? '3D' : '2D'
window.Map_QM.changePathDir(_text)
text.value = _text
}
onBeforeUnmount(() => {
window.pathCameraState = '2D'
})
return { cameraViews, setCameraViews }
}