|
|
|
@ -206,7 +206,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref, defineProps, defineEmits, onMounted, watch } from "vue"
|
|
|
|
|
import { ref, defineProps, defineEmits, onMounted, watch, onBeforeUnmount } from "vue"
|
|
|
|
|
import { CaretDownOutlined } from '@ant-design/icons-vue'
|
|
|
|
|
import { getAccountList } from '@/api/demo/system';
|
|
|
|
|
import { AddWorkspace, EditWorkspace } from '@/api/demo/projecthome'
|
|
|
|
@ -228,6 +228,7 @@ const props = defineProps(['addModal', 'modalType','map', 'updateProject'])
|
|
|
|
|
const emits = defineEmits(['update:addModal', 'getProjectList'])
|
|
|
|
|
|
|
|
|
|
let graphicLayer
|
|
|
|
|
let clickHandler
|
|
|
|
|
watch(() => props.map, (val) => {
|
|
|
|
|
if (val) {
|
|
|
|
|
initGraphicLayer(val)
|
|
|
|
@ -341,9 +342,16 @@ onMounted(() => {
|
|
|
|
|
deviceList.value = res
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const closeAddModal = () => {
|
|
|
|
|
emits('update:addModal',false)
|
|
|
|
|
if(graphicLayer){
|
|
|
|
|
graphicLayer.clear()
|
|
|
|
|
}
|
|
|
|
|
props.map.container.style.cursor = "default"
|
|
|
|
|
if (clickHandler) {
|
|
|
|
|
props.map.off('click', clickHandler)
|
|
|
|
|
clickHandler = null
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const closeChildSetting = () => {
|
|
|
|
|
childSetting.value.open = false
|
|
|
|
@ -388,7 +396,7 @@ const openChildSetting = (type) => {
|
|
|
|
|
const getLocationCenter = () => {
|
|
|
|
|
const container = props.map.container
|
|
|
|
|
container.style.cursor = "crosshair"
|
|
|
|
|
props.map.on('click', (event) => {
|
|
|
|
|
clickHandler = (event) => {
|
|
|
|
|
const cartesian = event.cartesian
|
|
|
|
|
if (!cartesian) return
|
|
|
|
|
const cartographic = Cesium.Cartographic.fromCartesian(cartesian)
|
|
|
|
@ -419,7 +427,8 @@ const getLocationCenter = () => {
|
|
|
|
|
})
|
|
|
|
|
graphicLayer.clear()
|
|
|
|
|
graphicLayer.addGraphic(pointGraphic)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
props.map.on('click', clickHandler)
|
|
|
|
|
}
|
|
|
|
|
const searchUser = (key: string) => {
|
|
|
|
|
getAccountList({page:1,limit:999,key,}).then(res => {
|
|
|
|
@ -475,6 +484,14 @@ const saveProject = () => {
|
|
|
|
|
emits('getProjectList')
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if(graphicLayer){
|
|
|
|
|
graphicLayer.clear()
|
|
|
|
|
}
|
|
|
|
|
props.map.container.style.cursor = "default"
|
|
|
|
|
if (clickHandler) {
|
|
|
|
|
props.map.off('click', clickHandler)
|
|
|
|
|
clickHandler = null
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|