|
@@ -520,12 +520,12 @@
|
|
|
|
|
|
<script setup lang="tsx" name="singleData">
|
|
<script setup lang="tsx" name="singleData">
|
|
import * as echarts from 'echarts';
|
|
import * as echarts from 'echarts';
|
|
-import { ref, computed, onMounted, reactive, watch, onDeactivated, onActivated } from "vue";
|
|
|
|
|
|
+import { ref, onMounted, reactive, watch, onDeactivated, onActivated,computed } from "vue";
|
|
import { useGlobalStore } from "@/stores/modules/global";
|
|
import { useGlobalStore } from "@/stores/modules/global";
|
|
import { getDataItemList, getPlatformList, getRgDataList, getTacRecordList } from "@/api/modules/allData";
|
|
import { getDataItemList, getPlatformList, getRgDataList, getTacRecordList } from "@/api/modules/allData";
|
|
import { Platform } from "@/api/interface";
|
|
import { Platform } from "@/api/interface";
|
|
-
|
|
|
|
import { ElLoading } from "element-plus";
|
|
import { ElLoading } from "element-plus";
|
|
|
|
+import {useUserStore} from "@/stores/modules/user";
|
|
|
|
|
|
/* 全局请求 loading */
|
|
/* 全局请求 loading */
|
|
const loading = ref()
|
|
const loading = ref()
|
|
@@ -549,7 +549,6 @@ const endFullLoading = () => {
|
|
loading.value.close();
|
|
loading.value.close();
|
|
};
|
|
};
|
|
const timeValue = ref(1);
|
|
const timeValue = ref(1);
|
|
-
|
|
|
|
const queryInfo = ref(0)
|
|
const queryInfo = ref(0)
|
|
const pageable = ref({
|
|
const pageable = ref({
|
|
data_type: true,
|
|
data_type: true,
|
|
@@ -1087,23 +1086,16 @@ const queryas = ref<Platform>({
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
-const platformList = ref<any>([])
|
|
|
|
|
|
+const userStore = useUserStore();
|
|
|
|
+const platformList =ref<any>(computed(() => userStore.stations))
|
|
const selectPlatform = ref()
|
|
const selectPlatform = ref()
|
|
|
|
|
|
const getPlatforms = async () => {
|
|
const getPlatforms = async () => {
|
|
- startFullLoading()
|
|
|
|
-
|
|
|
|
- const { data } = await getPlatformList(queryas.value);
|
|
|
|
-
|
|
|
|
- platformList.value = data.list
|
|
|
|
- pageable.value.as_code = data.list[0].as_code
|
|
|
|
- selectPlatform.value = data.list[0]
|
|
|
|
|
|
+ pageable.value.as_code = platformList.value[0].as_code
|
|
|
|
+ selectPlatform.value = platformList.value[0]
|
|
getList()
|
|
getList()
|
|
// getHistoryList()
|
|
// getHistoryList()
|
|
weatherInfo()
|
|
weatherInfo()
|
|
- endFullLoading()
|
|
|
|
-
|
|
|
|
-
|
|
|
|
};
|
|
};
|
|
|
|
|
|
const changeStation = (e) => {
|
|
const changeStation = (e) => {
|
|
@@ -1216,8 +1208,9 @@ const getList = async () => {
|
|
showHumidity()
|
|
showHumidity()
|
|
showPressure()
|
|
showPressure()
|
|
showWindSpeed()
|
|
showWindSpeed()
|
|
- currentValue.value = dataItemInfo.value[312] && dataItemInfo.value[312] != 0 && dataItemInfo.value[312] != '--' ? dataItemInfo.value[302] : dataItemInfo.value[302] && dataItemInfo.value[302] != 0 ? dataItemInfo.value[302] : 0
|
|
|
|
- mincurrentValue.value = dataItemInfo.value[311] && dataItemInfo.value[311] != 0 && dataItemInfo.value[311] != '--' ? dataItemInfo.value[301] : dataItemInfo.value[301] && dataItemInfo.value[301] != 0 ? dataItemInfo.value[302] : 0
|
|
|
|
|
|
+ currentValue.value = dataItemInfo.value[312] && dataItemInfo.value[312] != 0 && dataItemInfo.value[312] != '--' ? dataItemInfo.value[302] : dataItemInfo.value[302] && dataItemInfo.value[302] != 0 ? dataItemInfo.value[302] : '--'
|
|
|
|
+ // currentValue.value = dataItemInfo.value[312] && dataItemInfo.value[312] != 0 && dataItemInfo.value[312] != '--' ? dataItemInfo.value[302] : dataItemInfo.value[302] && dataItemInfo.value[302] != 0 ? dataItemInfo.value[302] : 0
|
|
|
|
+ mincurrentValue.value = dataItemInfo.value[311] && dataItemInfo.value[311] != 0 && dataItemInfo.value[311] != '--' ? dataItemInfo.value[301] : dataItemInfo.value[301] && dataItemInfo.value[301] != 0 ? dataItemInfo.value[302] : '--'
|
|
selectElement.value = res.data.list ? dataItemInfo.value?.data_list.filter(itemB => customizeColumns.value.some(itemA => itemA.data_id === itemB.data_id)) : [];
|
|
selectElement.value = res.data.list ? dataItemInfo.value?.data_list.filter(itemB => customizeColumns.value.some(itemA => itemA.data_id === itemB.data_id)) : [];
|
|
const ids = [601, 602, 603, 604, 605]
|
|
const ids = [601, 602, 603, 604, 605]
|
|
dangerWeather.value = res.data.list ? dataItemInfo.value.data_list
|
|
dangerWeather.value = res.data.list ? dataItemInfo.value.data_list
|
|
@@ -1354,8 +1347,8 @@ const options = [{
|
|
value: 3,
|
|
value: 3,
|
|
label: '48小时'
|
|
label: '48小时'
|
|
}]
|
|
}]
|
|
-const currentValue = ref(0);
|
|
|
|
-const mincurrentValue = ref(0)
|
|
|
|
|
|
+const currentValue = ref<any>(0);
|
|
|
|
+const mincurrentValue = ref<any>(0)
|
|
|
|
|
|
const gradientStyle = computed(() => {
|
|
const gradientStyle = computed(() => {
|
|
return {
|
|
return {
|
|
@@ -1378,8 +1371,8 @@ const arrowStyle = computed(() => {
|
|
const maxTop = '0px'; // 表示100的位置
|
|
const maxTop = '0px'; // 表示100的位置
|
|
const scaleFactor = 180 / 40; // 缩放因子
|
|
const scaleFactor = 180 / 40; // 缩放因子
|
|
// const top = `${(180 - (currentValue.value / 40) * 180)}px`; // 从底部开始计算
|
|
// const top = `${(180 - (currentValue.value / 40) * 180)}px`; // 从底部开始计算
|
|
- const calculatedTop = `${(180 - (Math.min(currentValue.value, 40) / 40) * 180)}px`;
|
|
|
|
- const top = currentValue.value > 40 ? maxTop : calculatedTop;
|
|
|
|
|
|
+ const calculatedTop = `${(180 - (Math.min(currentValue.value=='--'?0:currentValue.value, 40) / 40) * 180)}px`;
|
|
|
|
+ const top = (currentValue.value=='--'?0:currentValue.value) > 40 ? maxTop : calculatedTop;
|
|
return {
|
|
return {
|
|
top,
|
|
top,
|
|
position: 'absolute',
|
|
position: 'absolute',
|
|
@@ -1391,7 +1384,7 @@ const minarrowStyle = computed(() => {
|
|
// 计算箭头顶部位置,使其指向盒子内的相应位置
|
|
// 计算箭头顶部位置,使其指向盒子内的相应位置
|
|
// 由于盒子高度是150px,而值域是0-100,因此需要进行缩放
|
|
// 由于盒子高度是150px,而值域是0-100,因此需要进行缩放
|
|
const scaleFactor = 180 / 4; // 缩放因子
|
|
const scaleFactor = 180 / 4; // 缩放因子
|
|
- const top = `${(180 - (mincurrentValue.value / 4) * 180)}px`; // 从底部开始计算
|
|
|
|
|
|
+ const top = `${(180 - (mincurrentValue.value==='--'?0:mincurrentValue.value / 4) * 180)}px`; // 从底部开始计算
|
|
return {
|
|
return {
|
|
top,
|
|
top,
|
|
position: 'absolute',
|
|
position: 'absolute',
|
|
@@ -2061,7 +2054,7 @@ const showTemp = () => {
|
|
|
|
|
|
data: [
|
|
data: [
|
|
{
|
|
{
|
|
- value: dataItemInfo.value && dataItemInfo.value[101] ? dataItemInfo.value[101] : 0,
|
|
|
|
|
|
+ value: dataItemInfo.value[101],
|
|
}
|
|
}
|
|
]
|
|
]
|
|
}
|
|
}
|
|
@@ -2346,8 +2339,6 @@ onMounted(() => {
|
|
// weatherInfo()
|
|
// weatherInfo()
|
|
|
|
|
|
getAllRgDataList()
|
|
getAllRgDataList()
|
|
-
|
|
|
|
-
|
|
|
|
showTemp()
|
|
showTemp()
|
|
// showWind()
|
|
// showWind()
|
|
showWindSpeed()
|
|
showWindSpeed()
|