|
@@ -0,0 +1,151 @@
|
|
|
+<template>
|
|
|
+ <div class="float-panel-right" :class="{ 'move-tool-spread': layoutStore.toolSpread === 'ky' }">
|
|
|
+ <i @click="handleClose" class="absolute right-4 top-4 size-5 cursor-pointer hover:scale-110">
|
|
|
+ <img src="@/assets/images/svg/close.svg" alt="" />
|
|
|
+ </i>
|
|
|
+ <div class="panel-title text-ellipsis">{{ mapStore.gridCode }}</div>
|
|
|
+
|
|
|
+ <ul class="des-list mt-2">
|
|
|
+ <li>
|
|
|
+ <span>总分</span><span class="value">{{ base.weightValue }}</span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <span>是否包含建筑</span><span class="value">{{ base.hasBuilding }}</span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <span>气象分</span><span class="value">{{ base.weatherValue }}</span>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+
|
|
|
+ <div class="sub-list mt-2">
|
|
|
+ <ul class="des-list">
|
|
|
+ <li>
|
|
|
+ <span>气温</span><span class="value">{{ base.temperature }} ℃</span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <span>风速</span><span class="value">{{ base.windPower }} m/s</span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <span>气压</span><span class="value">{{ base.pressure }} mPa</span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <span>湿度</span><span class="value">{{ base.humidity }} %</span>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { queryGridByCode } from '@/service/map.js'
|
|
|
+import useLayoutStore from '@/store/layout'
|
|
|
+import { useMapStore } from '@/store/map.js'
|
|
|
+import { onMounted, ref, watch } from 'vue'
|
|
|
+
|
|
|
+const mapStore = useMapStore()
|
|
|
+const layoutStore = useLayoutStore()
|
|
|
+
|
|
|
+const base = ref({
|
|
|
+ weatherValue: '0',
|
|
|
+})
|
|
|
+
|
|
|
+function handleClose() {
|
|
|
+ layoutStore.toggleRightFloatPanel('cube', false)
|
|
|
+}
|
|
|
+
|
|
|
+function getGridData() {
|
|
|
+ queryGridByCode({
|
|
|
+ code: mapStore.gridCode,
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.data.code == '200') {
|
|
|
+ const { data } = res.data
|
|
|
+ const { element } = data
|
|
|
+ base.value.weightValue = data.weightValue
|
|
|
+ base.value.hasBuilding = element.collision || element.collisionBuffer ? '是' : '否'
|
|
|
+ base.value.temperature = element.temperature
|
|
|
+ base.value.windPower = element.windPower
|
|
|
+ base.value.pressure = element.pressure
|
|
|
+ base.value.humidity = element.humidity
|
|
|
+ base.value.weatherValue = data.weatherValue
|
|
|
+ } else {
|
|
|
+ console.log('编码信息查询失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ getGridData()
|
|
|
+})
|
|
|
+
|
|
|
+watch(
|
|
|
+ () => mapStore.gridCode,
|
|
|
+ (val) => {
|
|
|
+ getGridData()
|
|
|
+ },
|
|
|
+ {
|
|
|
+ deep: true,
|
|
|
+ }
|
|
|
+)
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.float-panel-right {
|
|
|
+ width: 350px;
|
|
|
+}
|
|
|
+
|
|
|
+.panel-title {
|
|
|
+ width: 90%;
|
|
|
+ padding-right: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.des-list {
|
|
|
+ li {
|
|
|
+ height: 30px;
|
|
|
+ display: flex;
|
|
|
+ padding: 0 10px;
|
|
|
+ font-size: 14px;
|
|
|
+
|
|
|
+ span {
|
|
|
+ line-height: 30px;
|
|
|
+ text-shadow: 0px 4px 4px rgba(21, 41, 91, 0.45);
|
|
|
+ }
|
|
|
+
|
|
|
+ span:first-child {
|
|
|
+ position: relative;
|
|
|
+ width: 90px;
|
|
|
+ margin-right: 20px;
|
|
|
+ display: block;
|
|
|
+ text-align-last: justify;
|
|
|
+ text-align: justify;
|
|
|
+ text-justify: distribute-all-lines;
|
|
|
+ color: #ffffff;
|
|
|
+
|
|
|
+ &::after {
|
|
|
+ content: ':';
|
|
|
+ position: absolute;
|
|
|
+ display: block;
|
|
|
+ right: -15px;
|
|
|
+ top: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .value {
|
|
|
+ flex: 1;
|
|
|
+ width: 0;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ color: #65bfff;
|
|
|
+ text-shadow: 0px 4px 4px rgba(21, 41, 91, 0.45);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.sub-list {
|
|
|
+ padding: 5px 8px;
|
|
|
+ background-color: rgba(255, 255, 255, 0.1);
|
|
|
+ .des-list li span:first-child {
|
|
|
+ width: fit-content;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|