diff --git a/src/views/longoPeration/Patrolmanagement/pop-upbox.vue b/src/views/longoPeration/Patrolmanagement/pop-upbox.vue index c3c9f69..18ed8e6 100644 --- a/src/views/longoPeration/Patrolmanagement/pop-upbox.vue +++ b/src/views/longoPeration/Patrolmanagement/pop-upbox.vue @@ -229,14 +229,17 @@ val => { if (val) { console.log('val-----', val); - if (newfiberMapbox.map.getLayer('point_start')) { - newfiberMapbox.map.removeLayer('point_start'); - newfiberMapbox.map.removeLayer('point_end'); - newfiberMapbox.map.removeSource('point_start'); - newfiberMapbox.map.removeSource('point_end'); - newfiberMapbox.map.removeImage('point_start_icon'); - newfiberMapbox.map.removeImage('point_end_icon'); - } + setTimeout(() => { + if (newfiberMapbox.map.getLayer('point_start')) { + newfiberMapbox.map.removeLayer('point_start'); + newfiberMapbox.map.removeLayer('point_end'); + newfiberMapbox.map.removeSource('point_start'); + newfiberMapbox.map.removeSource('point_end'); + newfiberMapbox.map.removeImage('point_start_icon'); + newfiberMapbox.map.removeImage('point_end_icon'); + } + }, 1000); + if (!val.length) return; //起止点 diff --git a/src/views/longoPeration/Patrolmanagement/pop-upbox.vue b/src/views/longoPeration/Patrolmanagement/pop-upbox.vue index c3c9f69..18ed8e6 100644 --- a/src/views/longoPeration/Patrolmanagement/pop-upbox.vue +++ b/src/views/longoPeration/Patrolmanagement/pop-upbox.vue @@ -229,14 +229,17 @@ val => { if (val) { console.log('val-----', val); - if (newfiberMapbox.map.getLayer('point_start')) { - newfiberMapbox.map.removeLayer('point_start'); - newfiberMapbox.map.removeLayer('point_end'); - newfiberMapbox.map.removeSource('point_start'); - newfiberMapbox.map.removeSource('point_end'); - newfiberMapbox.map.removeImage('point_start_icon'); - newfiberMapbox.map.removeImage('point_end_icon'); - } + setTimeout(() => { + if (newfiberMapbox.map.getLayer('point_start')) { + newfiberMapbox.map.removeLayer('point_start'); + newfiberMapbox.map.removeLayer('point_end'); + newfiberMapbox.map.removeSource('point_start'); + newfiberMapbox.map.removeSource('point_end'); + newfiberMapbox.map.removeImage('point_start_icon'); + newfiberMapbox.map.removeImage('point_end_icon'); + } + }, 1000); + if (!val.length) return; //起止点 diff --git a/vite.config.js b/vite.config.js index d814042..ea36ec6 100644 --- a/vite.config.js +++ b/vite.config.js @@ -6,9 +6,9 @@ const Timestamp = new Date().getTime(); //随机时间戳 -const targetUrl = 'http://192.168.16.254:7200'; //孙逢时 +// const targetUrl = 'http://192.168.16.254:7200'; //孙逢时 // const targetUrl = 'http://192.168.20.52:7300'; //杨辉 -// const targetUrl = 'https://server2.wh-nf.cn:8082/prod-api'; //线上 +const targetUrl = 'https://server2.wh-nf.cn:8082/prod-api'; //线上 // https://vitejs.dev/config/ export default defineConfig(({ mode, command }) => {