章志文 3 hari lalu
induk
melakukan
3603d07b0a

+ 2 - 2
.env.development

@@ -18,8 +18,8 @@ VITE_PWA = false
 VITE_API_URL = /api
 
 # 开发环境GIS地址
-VITE_API_GIS_URL = "http://192.168.43.77:8080"
+VITE_API_GIS_URL = "http://192.168.14.139:8080"
 
 # 开发环境跨域代理,支持配置多个
-VITE_PROXY = [["/api","http://192.168.43.77:18088"]]
+VITE_PROXY = [["/api","http://192.168.14.139:18088"]]
 # VITE_PROXY = [["/api","http://192.168.127.123:18088"]]

+ 18 - 5
src/views/alarm/allDevice/index.vue

@@ -99,11 +99,11 @@
 
 <script setup lang="ts" name="allDevice">
 import * as echarts from 'echarts';
-import {  getStamp, groupByType,getNextDayMidnight } from "@/utils/dateTime";
+import { getStamp, groupByType, getNextDayMidnight } from "@/utils/dateTime";
 import { ElMessage } from "element-plus";
 import { useGlobalStore } from "@/stores/modules/global";
 import { ref, computed, onMounted, reactive, watch, onDeactivated, onActivated, nextTick } from "vue";
-import {  getTacRecordList, getFTPList, getCertificateList, getStaitemList, getArriveList } from "@/api/modules/allData";
+import { getTacRecordList, getFTPList, getCertificateList, getStaitemList, getArriveList } from "@/api/modules/allData";
 import { Platform } from "@/api/interface";
 import { parseTime } from '@/utils/index';
 import { useRouter } from "vue-router";
@@ -181,7 +181,7 @@ const changeBase = (e) => {
 }
 watch(() => pageable.value.as_code_list, (newValue, oldValue) => {
 	if (newValue) {
-		weatherInfo()
+		weatherInfo();
 		getCertificate();
 		getFTP();
 		getDeviceStatus();
@@ -201,8 +201,21 @@ const control = ref()
 const arriveList = ref<any>({ aa: [], bb: [], cc: [] })
 const arriveTime = ref<any>()
 const getArrive = async () => {
-	const { data } = await getArriveList({ ...pageable.value, time_space: 60, data_type: false, end_time: getStamp(parseTime(new Date(), '{y}-{m}-{d} {h}') + ':00'), begin_time: getStamp(parseTime(new Date(), '{y}-{m}-{d}') + ' 01:00') })
-	arriveTime.value = Object.keys(data)
+	const { data } = await getArriveList({ ...pageable.value, time_space: 60, data_type: false, end_time: getStamp(parseTime(new Date(), '{y}-{m}-{d} {h}') + ':01'), begin_time: getStamp(parseTime(new Date(), '{y}-{m}-{d}') + ' 01:00') })
+	// 提取键并排序
+	const sortedKeys = Object.keys(data).sort((a, b) => {
+		const [timeA] = a.split(':').map(Number);
+		const [timeB] = b.split(':').map(Number);
+		return timeA - timeB;
+	});
+
+	// 根据排序后的键构建新对象
+	const sortedObj = {};
+	sortedKeys.forEach(key => {
+		sortedObj[key] = data[key];
+	});
+
+	arriveTime.value = Object.keys(sortedObj)
 
 	const arr = <any>{ aa: [], bb: [], cc: [] }
 	arriveTime.value?.forEach((item, index) => {

+ 1 - 8
src/views/alarm/singleStationData/index.vue

@@ -1218,26 +1218,19 @@ const getList = async () => {
 		return acc;
 	}, []);
 	const res = await getDataItemList({ ...pageable.value, as_code_list: [pageable.value.as_code], data_items: arr });
-
-
-
 	dataItemInfo.value = res.data.list ? (res.data.list.length === 0 ? {} : res.data.list[0]) : {};
-	// console.log(dataItemInfo.value, 555);
 
 	showTemp()
 	showHumidity()
 	showPressure()
 	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] : '--'
-	// 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
+	currentValue.value = dataItemInfo.value[312]  && dataItemInfo.value[312] != '--' ? dataItemInfo.value[302] : dataItemInfo.value[302]? dataItemInfo.value[302] : '--'
 	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)) : [];
 	const ids = [601, 602, 603, 604, 605]
 	dangerWeather.value = res.data.list ? dataItemInfo.value.data_list
 		.filter(item => ids.includes(item.data_id) && item.data_value !== '--' && item.data_value !== ''&& item.data_value !== '0'&&getYenSymbolLaterCharacters(item.remark)!=='无明显天气现象')
 		.map(item => item) : []
-
-	// .filter(item => ids.includes(item.data_id) && getYenSymbolLaterCharacters(item.remark) !== '无明显天气现象')
 	getHistoryList()
 };