Browse Source

map change

tags/v1.2.0
lixin 1 year ago
parent
commit
2b29cec47f
5 changed files with 40 additions and 43 deletions
  1. +1
    -1
      .env.localhost
  2. +14
    -3
      src/views/dashboard/components/FireAlarm.vue
  3. +3
    -5
      src/views/dashboard/components/OneMap.vue
  4. +18
    -19
      src/views/dashboard/components/Underlay.vue
  5. +4
    -15
      src/views/dashboard/components/WarningDrawer.vue

+ 1
- 1
.env.localhost View File

@@ -5,7 +5,7 @@ VITE_PUBLIC_PATH = '/'
VITE_APP_USE_MOCK = false

# proxy
VITE_PROXY = [["/api-local","http://127.0.0.1:8002/api"],["/api-mock","http://127.0.0.1:8003"]]
VITE_PROXY = [["/api-local","https://lcxj-test.t-aaron.com/api"],["/api-mock","http://127.0.0.1:8003"]]

# base api
VITE_APP_GLOB_BASE_API = '/api-local'

+ 14
- 3
src/views/dashboard/components/FireAlarm.vue View File

@@ -30,7 +30,7 @@
</p>
<p class="dispatch-detail">
<span>飞行高度:</span>
<n-slider v-model:value="flyHeight" :default-value="100" :format-tooltip="formatHeight" :max="600" :show-tooltip="true" />
<n-slider v-model:value="flyHeight" :default-value="100" :format-tooltip="formatHeight" :max="600" @update:value="limitMin" />
</p>
<p class="execute-btn" @click="test">立即执行</p>
<p class="alarm-title">任务记录</p>
@@ -200,6 +200,10 @@ export default {
})
}

const limitMin = (value) => {
data.flyHeight = data.flyHeight >= 100 ? value : 100
}

// 可用机场列表
const showUsableAirport = (info) => {
data.usableAirport.length = 0
@@ -257,8 +261,8 @@ export default {

if (res.code === 0) {
getRecord(parseInt(data.warningInfo?.id))
handleExecute()
}
handleExecute(parseInt(data.missionId))
}

// 忽略预警
@@ -266,6 +270,7 @@ export default {
const res = await ignoreWarning(data.warningInfo.id)
if (res.code === 0) {
closeWarning()
data.warningDesc = ''
}
}

@@ -277,6 +282,7 @@ export default {
})
if (res.code === 0) {
closeWarning()
data.warningDesc = ''
}
}

@@ -297,7 +303,8 @@ export default {
closeWarning,
ignore,
confirm,
handleExecute
handleExecute,
limitMin
}
}
}
@@ -589,5 +596,9 @@ export default {
}
}

.n-slider-handle-indicator{
margin: 0 !important;
}

</style>


+ 3
- 5
src/views/dashboard/components/OneMap.vue View File

@@ -31,7 +31,7 @@

<fire-alarm ref="Warning" :data="warningDetail" :airport="airportsAll" @start="handleExecute" />

<WarningDrawer :id="missionId" v-model:visible="drawerShow" />
<WarningDrawer v-model:visible="drawerShow" />

</template>

@@ -110,8 +110,7 @@ export default {
warningList: [],
warningLayers: [],
warningDetail: {},
drawerShow: false,
missionId: 0
drawerShow: false
})

const getMapOptions = computed(() => {
@@ -677,9 +676,8 @@ export default {
monitorVideo.value?.disposeVideo()
}

const handleExecute = (id) => {
const handleExecute = () => {
data.drawerShow = true
data.missionId = id
}

onMounted(() => {

+ 18
- 19
src/views/dashboard/components/Underlay.vue View File

@@ -24,21 +24,16 @@ export default {
id: {
type: String,
default: 'underlay'
},
idd: {
type: Number,
default: 0
}
},
setup(props) {
setup(props, { emit }) {
const data = reactive({
map: null,
drawerShow: false,
trackLayer: null,
trackInfo: null,
// 轨迹数据
trackList: [],
id: 0
trackList: []
})

const getMapOptions = computed(() => {
@@ -47,18 +42,22 @@ export default {
}
})

watch(() => props.idd, (value) => {
if (value) {
console.log('hhh', value)
} else {
console.log('hhh', value)
}
// getTrackData(id).then(res => {
// if (res.trackList.length > 0) {
// initTrack(formatTradeList(res.trackList), 'route')
// }
// })
})
// watch(() => props.idd, (value) => {
// if (value) {
// console.log('hhh', value)
// } else {
// console.log('hhh', value)
// }

// })

// if (props.ttest) {
// getTrackData(props.ttest.missionId).then(res => {
// if (res.trackList.length > 0) {
// initTrack(formatTradeList(res.trackList), 'route')
// }
// })
// }

/**
* 初始化地图

+ 4
- 15
src/views/dashboard/components/WarningDrawer.vue View File

@@ -55,7 +55,7 @@

</div>
<div ref="mapRef" class="warn__back">
<Underlay :idd="missionId" />
<Underlay />
</div>
<div ref="videoRef" class="inner">
111111111111
@@ -69,7 +69,7 @@ import { defineComponent, ref, reactive, toRefs, computed, watch, nextTick } fro
import Underlay from './Underlay.vue'
import ControlPanel from './ControlPanel.vue'
import SpeedChart from './SpeedChart.vue'
export default defineComponent({
export default {
name: 'WarningDrawer',
components: { Underlay, ControlPanel, SpeedChart },
props: {
@@ -82,10 +82,6 @@ export default defineComponent({
data: {
type: Object,
default: () => {}
},
id: {
type: Number,
default: 0
}
},
emits: {
@@ -101,8 +97,7 @@ export default defineComponent({
showControl: false,
operate: '悬停',
control: '手动控制',
chartData: {},
missionId: 0
chartData: {}
})

/* 获取抽屉的信息 */
@@ -162,12 +157,6 @@ export default defineComponent({
}
})

watch(() => props.id, (id) => {
if (id) {
data.missionId = id
}
})

const handleOperate = () => {
data.operate = data.operate === '悬停' ? '继续飞行' : '悬停'
}
@@ -208,7 +197,7 @@ export default defineComponent({
endOrder
}
}
})
}
</script>

<style scoped lang='scss'>

Loading…
Cancel
Save