2 Commits 1d5500a1b2 ... b8e637579d

Autore SHA1 Messaggio Data
  daiht b8e637579d Merge branch 'master' of http://git.techwx.com/framework/SMO 3 settimane fa
  daiht d268b2ac5b zzw 3 settimane fa

+ 1 - 1
.env.development

@@ -18,4 +18,4 @@ VITE_PWA = false
 VITE_API_URL = /api
 
 # 开发环境跨域代理,支持配置多个
-VITE_PROXY = [["/api","http://192.168.187.133:18088"]]
+VITE_PROXY = [["/api","http://192.168.43.77:18088"]]

+ 31 - 1
src/utils/dateTime.ts

@@ -96,5 +96,35 @@ export function getStamp(time) {
 	const date = new Date(time);
 	return Math.floor(date.getTime() / 1000);
 }
+// 判断传入时间是否超过当前时间
+export function isDateFuture(inputDate) {  
+    // 将输入的日期字符串转换为 Date 对象  
+    const dateToCheck = new Date(inputDate);  
+  
+    // 获取当前时间  
+    const now = new Date();  
+  
+    // 比较两个日期对象  
+    return dateToCheck > now;  
+}  
 
-
+// 判断两个日期是否在给定天数内  
+export function isDateRangeWithinDays(startDate, endDate, maxDays) {  
+    // 将输入的日期字符串转换为 Date 对象  
+    const start = new Date(startDate);  
+    const end = new Date(endDate);  
+  
+    // 检查日期是否有效  
+    if (isNaN(start.getTime()) || isNaN(end.getTime())) {  
+        throw new Error("无效的日期格式");  
+    }  
+  
+    // 计算两个日期之间的时间差(毫秒)  
+    const timeDifference = end - start;  
+  
+    // 将时间差转换为天数  
+    const dayDifference = timeDifference / (1000 * 60 * 60 * 24);  
+  
+    // 判断天数差是否大于给定的天数限制  
+    return dayDifference <= maxDays;  
+}  

+ 4 - 3
src/views/alarm/singleStationData/index.vue

@@ -1136,8 +1136,8 @@ const getAllRgDataList = async () => {
 	elementList.value = data.list
 };
 const dataItemInfo = ref<any>({})
-const selectElement = ref()
-const dangerWeather = ref()
+const selectElement = ref<any>([])
+const dangerWeather = ref<any>([])
 const getList = async () => {
 	const arr = [...customizeColumns.value, ...defaultColumns].reduce((acc, item) => {
 		if (!acc.some(existingItem => existingItem.data_id === item.data_id)) {
@@ -1161,8 +1161,9 @@ const getList = async () => {
 	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 !== '--')
+		.filter(item => ids.includes(item.data_id) && item.data_value !== '--'&&item.data_value !== '')
 		.map(item => item):[]
+console.log(dangerWeather.value, 666);
 
 		// .filter(item => ids.includes(item.data_id) && getYenSymbolLaterCharacters(item.remark) !== '无明显天气现象')
 	getHistoryList()

+ 79 - 20
src/views/analysis/dataSynthesis/index.vue

@@ -21,7 +21,7 @@
 						<el-date-picker v-model="dateRange" value-format="YYYY-MM-DD HH:mm"
 							:format="value1 ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm'"
 							:type="value1 ? 'daterange' : 'datetimerange'" range-separator="-" start-placeholder="开始时间"
-							end-placeholder="结束时间" :disabled-date="disabledDate" :disabled-hours="disabledHours"
+							end-placeholder="结束时间" :disabled-date="disabledDate" 
 							:disabled-minutes="disabledMinutes" @focus="handleFocus" @calendar-change="handleChange"
 							@change="handleDateChange"
 							:default-time="[new Date(2000, 1, 1, 0, 0), new Date(2000, 1, 1, new Date().getHours(), 0)]"
@@ -62,7 +62,30 @@ import { ref, computed, onMounted, reactive, watch, onDeactivated, onActivated }
 import { getDataItemList, getPlatformList, getRgDataList, getTacRecordList } from "@/api/modules/allData";
 import { Platform } from "@/api/interface";
 import { parseTime } from '@/utils/index';
-import { isToday, isWithinThirtyMinutes, getTimeStamp, getStamp } from "@/utils/dateTime";
+import { isToday, isWithinThirtyMinutes, getTimeStamp, getStamp, isDateFuture, isDateRangeWithinDays } from "@/utils/dateTime";
+import { ElLoading } from "element-plus";
+
+/* 全局请求 loading */
+const loading = ref()
+
+/**
+ * @description 开启 Loading
+ * */
+const startFullLoading = () => {
+	loading.value = ElLoading.service({
+		fullscreen: true,
+		lock: true,
+		text: "Loading",
+		background: "rgba(0, 0, 0, 0.7)"
+	});
+};
+
+/**
+ * @description 结束 Loading
+ * */
+const endFullLoading = () => {
+	loading.value.close();
+};
 const value1 = ref(true)
 const dateRange = ref<[any, any]>([parseTime(new Date(), '{y}-{m}-{d}') + ' 00:00', parseTime(new Date(), '{y}-{m}-{d} {h}:{i}')]);
 const changetype = (e) => {
@@ -89,21 +112,26 @@ const handleDateRangeChange = (newVal) => {
 		console.log(dateRange.value, '不是今天');
 	}
 };
-const handleDateChange =async (e) => {
-
-	if (!value1.value) {
-		if (isWithinThirtyMinutes(e[0], e[1])) {
+const handleDateChange = async (e) => {
+	if (isDateFuture(e[0]) ||isDateFuture(e[1])) {
+		ElMessage.error("不得选择未来的时间");
+	} else {
+		if (!value1.value) {
+			if (isWithinThirtyMinutes(e[0], e[1])) {
 			// 获取参数
 			getHistoryList()
 
 		} else {
 			ElMessage.error("分钟模式下时间间隔不能大于3小时");
 		}
-	} else {
-		await handleDateRangeChange(e)
-		getHistoryList()
-
-
+		} else {
+			if (isDateRangeWithinDays(e[0], e[1], 7)) {
+				await handleDateRangeChange(e)
+				getHistoryList()
+			} else {
+				ElMessage.error("日模式下时间间隔不能大于7天");
+			}
+		}
 	}
 }
 const pickDay = ref()
@@ -113,6 +141,8 @@ const handleFocus = () => {
 const limitTime = 1000 * 60 * 60 * 24 * 6
 
 const disabledDate = (time: Date) => {
+	return time.getTime() > Date.now() - 8.64e6
+
 	if (!value1.value) {
 		return time.getTime() > Date.now() - 8.64e6
 	} else {
@@ -144,10 +174,10 @@ const disabledHours = () => {
 
 const disabledMinutes = () => {
 	const a: number[] = [];
-	for (let i = 0; i < 60; i++) {
-		if (new Date().getMinutes() >= i) continue;
-		a.push(i);
-	}
+	// for (let i = 0; i < 60; i++) {
+	// 	if (new Date().getMinutes() >= i) continue;
+	// 	a.push(i);
+	// }
 	return a;
 };
 
@@ -214,11 +244,14 @@ const platformList = ref<any>([])
 const selectPlatform = ref()
 
 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]
 	getHistoryList()
+	endFullLoading()
 
 };
 
@@ -247,9 +280,9 @@ const tempLineArr = ref()
 const humidityLineArr = ref()
 const pressureLineArr = ref()
 const getHistoryList = async () => {
-	console.log( getStamp(dateRange.value[1]),555555);
-	
-	const { data } = await getDataItemList({ ...pageable.value, pageSize: 99, as_code_list: [pageable.value.as_code], data_items: historyColumns, data_type: false, time_space: value1.value ? 60 : 1, end_time:  getStamp(dateRange.value[1]), begin_time: getStamp(dateRange.value[0]) });
+
+
+	const { data } = await getDataItemList({ ...pageable.value, pageSize: 99, as_code_list: [pageable.value.as_code], data_items: historyColumns, data_type: false, time_space: value1.value ? 60 : 1, end_time: getStamp(dateRange.value[1]), begin_time: getStamp(dateRange.value[0]) });
 	timeArr.value = data.list?.map(item => {
 		return formatDate(item.data_time_i, 1)
 	})
@@ -262,6 +295,7 @@ const getHistoryList = async () => {
 	pressureLineArr.value = data.list?.map(item => {
 		return item[202]
 	})
+	console.log(pressureLineArr.value, 555555);
 	showData()
 };
 
@@ -279,6 +313,31 @@ const resetForm = (formEl) => {
 };
 
 const showData = () => {
+	function getMaxAndAdd50(arr) {
+		console.log(arr);
+		
+		if (!arr||arr.length === 0) {
+			return
+		} else {
+			const maxValue = Math.max(...arr);
+		// 将最大值加 50  
+		const result = maxValue + 50;
+		return result;
+		}
+		
+	}
+	function getMaxAndMinus50(arr) {
+		if (!arr||arr.length === 0) {
+			return
+		} else {
+			const maxValue = Math.min(...arr);
+		// 将最大值加 50  
+		const result = maxValue - 50;
+		return result>=0 ? result : 0;
+		}
+		
+	}
+
 	const colors = ['#5470C6', '#59A073', '#FFB652'];
 	let mychart = echarts.init(data.value);
 	let option = {
@@ -347,8 +406,8 @@ const showData = () => {
 				type: 'value',
 				name: '本站气压',
 
-				min: 600,
-				max: 1080,
+				min: getMaxAndMinus50(pressureLineArr.value),
+				max: getMaxAndAdd50(pressureLineArr.value),
 				position: 'left',
 				axisLine: {
 					show: true,

+ 59 - 52
src/views/analysis/lightningArea/index.vue

@@ -21,7 +21,7 @@
 						<el-date-picker v-model="dateRange" value-format="YYYY-MM-DD HH:mm"
 							:format="value1 ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm'"
 							:type="value1 ? 'daterange' : 'datetimerange'" range-separator="-" start-placeholder="开始时间"
-							end-placeholder="结束时间" :disabled-date="disabledDate" :disabled-hours="disabledHours"
+							end-placeholder="结束时间" :disabled-date="disabledDate" 
 							:disabled-minutes="disabledMinutes" @focus="handleFocus" @calendar-change="handleChange"
 							@change="handleDateChange"
 							:default-time="[new Date(2000, 1, 1, 0, 0), new Date(2000, 1, 1, new Date().getHours(), 0)]"
@@ -62,7 +62,7 @@ import { ref, computed, onMounted, reactive, watch, onDeactivated, onActivated }
 import { getDataItemList, getPlatformList, getRgDataList, getTacRecordList } from "@/api/modules/allData";
 import { Platform } from "@/api/interface";
 import { parseTime } from '@/utils/index';
-import { isToday, isWithinThirtyMinutes, getTimeStamp, getStamp } from "@/utils/dateTime";
+import { isToday, isWithinThirtyMinutes, getTimeStamp, getStamp, isDateFuture, isDateRangeWithinDays } from "@/utils/dateTime";
 const value1 = ref(true)
 const dateRange = ref<[any, any]>([parseTime(new Date(), '{y}-{m}-{d}') + ' 00:00', parseTime(new Date(), '{y}-{m}-{d} {h}:{i}')]);
 const changetype = (e) => {
@@ -89,20 +89,25 @@ const handleDateRangeChange = (newVal) => {
 	}
 };
 const handleDateChange = async (e) => {
-
-	if (!value1.value) {
-		if (isWithinThirtyMinutes(e[0], e[1])) {
+	if (isDateFuture(e[0]) ||isDateFuture(e[1])) {
+		ElMessage.error("不得选择未来的时间");
+	} else {
+		if (!value1.value) {
+			if (isWithinThirtyMinutes(e[0], e[1])) {
 			// 获取参数
 			getHistoryList()
 
 		} else {
 			ElMessage.error("分钟模式下时间间隔不能大于3小时");
 		}
-	} else {
-		await handleDateRangeChange(e)
-		getHistoryList()
-
-
+		} else {
+			if (isDateRangeWithinDays(e[0], e[1], 7)) {
+				await handleDateRangeChange(e)
+				getHistoryList()
+			} else {
+				ElMessage.error("日模式下时间间隔不能大于7天");
+			}
+		}
 	}
 }
 const pickDay = ref()
@@ -112,6 +117,8 @@ const handleFocus = () => {
 const limitTime = 1000 * 60 * 60 * 24 * 6
 
 const disabledDate = (time: Date) => {
+	return time.getTime() > Date.now() - 8.64e6
+
 	if (!value1.value) {
 		return time.getTime() > Date.now() - 8.64e6
 	} else {
@@ -143,10 +150,10 @@ const disabledHours = () => {
 
 const disabledMinutes = () => {
 	const a: number[] = [];
-	for (let i = 0; i < 60; i++) {
-		if (new Date().getMinutes() >= i) continue;
-		a.push(i);
-	}
+	// for (let i = 0; i < 60; i++) {
+	// 	if (new Date().getMinutes() >= i) continue;
+	// 	a.push(i);
+	// }
 	return a;
 };
 
@@ -164,43 +171,42 @@ const pageable = ref({
 	total: 0
 });
 let historyColumns = [
-	{
-		data_id: 202,
-		data_r_table: "SHI_SHI_LIU_YAO_SU_SHU_JU",
-		data_type: "气压",
-		data_name: "本站气压",
-		data_item: "BEN_ZHAN_QI_YA",
-		data_unit: "hPa",
-		data_h_table: "LI_SHI_LIU_YAO_SU_SHU_JU",
-		data_value: "",
-		data_order: 0,
-		data_condition: 0
-	},
-	{
-		data_r_table: "SHI_SHI_LIU_YAO_SU_SHU_JU",
-		data_id: 101,
-		data_type: "温湿度",
-		data_item: "QI_WEN",
-		data_name: "气温",
-		data_unit: "℃",
-		data_h_table: "LI_SHI_LIU_YAO_SU_SHU_JU",
-		data_value: "",
-		data_order: 0,
-		data_condition: 0
-	},
-	{
-		data_r_table: "SHI_SHI_LIU_YAO_SU_SHU_JU",
-		data_id: 106,
-		data_type: "温湿度",
-		data_item: "XIANG_DUI_SHI_DU",
-		data_name: "相对湿度",
-		data_unit: "%",
-		data_h_table: "LI_SHI_LIU_YAO_SU_SHU_JU",
-		data_value: "",
-		data_order: 0,
-		data_condition: 0,
-		isSelected: true
-	},
+{
+    data_id: 1003,
+    data_r_table: "SHI_SHI_DA_QI_DIAN_CHANG_SHAN_DIAN_SHU_JU",
+    data_type: "闪电",
+    data_name: "1分钟最强闪电的强度",
+    data_item: "YI_FEN_ZHONG_ZUI_QIANG_SHAN_DIAN_DE_QIANG_DU",
+    data_unit: "V/m",
+    data_h_table: "LI_SHI_DA_QI_DIAN_CHANG_SHAN_DIAN_SHU_JU",
+    data_value: "",
+    data_order: 0,
+    data_condition: 0
+},
+{
+    data_id: 1010,
+    data_r_table: "SHI_SHI_DA_QI_DIAN_CHANG_SHAN_DIAN_SHU_JU",
+    data_type: "闪电",
+    data_name: "1分钟最强闪电的距离",
+    data_item: "YI_FEN_ZHONG_ZUI_QIANG_SHAN_DIAN_DE_JU_LI",
+    data_unit: "km",
+    data_h_table: "LI_SHI_DA_QI_DIAN_CHANG_SHAN_DIAN_SHU_JU",
+    data_value: "",
+    data_order: 0,
+    data_condition: 0
+},
+{
+    data_id: 1011,
+    data_r_table: "SHI_SHI_DA_QI_DIAN_CHANG_SHAN_DIAN_SHU_JU",
+    data_type: "闪电",
+    data_name: "1分钟最强闪电的方位角",
+    data_item: "YI_FEN_ZHONG_ZUI_QIANG_SHAN_DIAN_DE_FANG_WEI_JIAO",
+    data_unit: "°",
+    data_h_table: "LI_SHI_DA_QI_DIAN_CHANG_SHAN_DIAN_SHU_JU",
+    data_value: "",
+    data_order: 0,
+    data_condition: 0
+},
 ]
 
 // 查询自动站列表
@@ -248,7 +254,7 @@ const tempLineArr = ref()
 const humidityLineArr = ref()
 const pressureLineArr = ref()
 const getHistoryList = async () => {
-	const { data } = await getDataItemList({ ...pageable.value, pageSize: 99, as_code_list: [pageable.value.as_code], data_items: historyColumns, data_type: false, time_space: value1.value ? 60 : 1, end_time: getStamp(dateRange[1]), begin_time: getStamp(dateRange[0]) });
+	const { data } = await getDataItemList({ ...pageable.value, pageSize: 99, as_code_list: [pageable.value.as_code], data_items: historyColumns, data_type: false, time_space: value1.value ? 60 : 1, end_time: getStamp(dateRange.value[1]), begin_time: getStamp(dateRange.value[0]) });
 	timeArr.value = data.list?.map(item => {
 		return formatDate(item.data_time_i, 1)
 	})
@@ -291,6 +297,7 @@ const showData = () => {
 		let obj = {
 			name: (angle === 360 || angle % 45 === 0) ? angle.toFixed(1) + '°' : '',
 			max: 200,
+			color:isDark.value ? '#fff' : "#000",
 			axisLabel: angle === 360 ? {
 				show: angle === 360,
 				formatter: '{value}km', color: "#000", showMinLabel: false

+ 83 - 67
src/views/analysis/rainfall/index.vue

@@ -21,9 +21,8 @@
 						<el-date-picker v-model="dateRange" value-format="YYYY-MM-DD HH:mm"
 							:format="value1 ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm'"
 							:type="value1 ? 'daterange' : 'datetimerange'" range-separator="-" start-placeholder="开始时间"
-							end-placeholder="结束时间" :disabled-date="disabledDate" :disabled-hours="disabledHours"
-							:disabled-minutes="disabledMinutes" @focus="handleFocus" @calendar-change="handleChange"
-							@change="handleDateChange"
+							end-placeholder="结束时间" :disabled-date="disabledDate" :disabled-minutes="disabledMinutes"
+							@focus="handleFocus" @calendar-change="handleChange" @change="handleDateChange"
 							:default-time="[new Date(2000, 1, 1, 0, 0), new Date(2000, 1, 1, new Date().getHours(), 0)]"
 							style="width: 300px;"></el-date-picker>
 					</div>
@@ -63,12 +62,14 @@ import { ref, computed, onMounted, reactive, watch, onDeactivated, onActivated }
 import { getDataItemList, getPlatformList, getRgDataList, getTacRecordList } from "@/api/modules/allData";
 import { Platform } from "@/api/interface";
 import { parseTime } from '@/utils/index';
-import { isToday, isWithinThirtyMinutes, getTimeStamp, getStamp,isWithin24Hours } from "@/utils/dateTime";
+import { isToday, isWithinThirtyMinutes, getTimeStamp, getStamp, isWithin24Hours, isDateFuture, isDateRangeWithinDays } from "@/utils/dateTime";
 const value1 = ref(true)
-const dateRange = ref<[any, any]>([parseTime(new Date(getTimeStamp(5)), '{y}-{m}-{d}') + ' 00:00', parseTime(new Date(), '{y}-{m}-{d} {h}:{i}')]);
+const dateRange = ref<[any, any]>([parseTime(new Date(getTimeStamp(5)), '{y}-{m}-{d}') + ' 00:00', parseTime(new Date(), '{y}-{m}-{d}') + ' 00:00']);
 const changetype = (e) => {
 	if (!e) {
-		dateRange.value = [parseTime(getTimeStamp(2), '{y}-{m}-{d} {h}:{i}'), parseTime(new Date(), '{y}-{m}-{d} {h}:{i}')]
+		dateRange.value = [parseTime(getTimeStamp(2), '{y}-{m}-{d} {h}:{i}'), parseTime(new Date(), '{y}-{m}-{d} {h}') + ':00']
+	} else {
+		dateRange.value = [parseTime(new Date(getTimeStamp(5)), '{y}-{m}-{d}') + ' 00:00', parseTime(new Date(), '{y}-{m}-{d}') + ' 00:00']
 	}
 }
 const handleDateRangeChange = (newVal) => {
@@ -77,42 +78,50 @@ const handleDateRangeChange = (newVal) => {
 		// 获取当前时间的整点  
 		const currentHour = new Date().getHours();
 		const roundedEndDate = new Date(endDate);
-		roundedEndDate.setMinutes(0, 0, 0); // 设置分钟、秒、毫秒为0  
+		roundedEndDate.setHours(0, 0, 0, 0); // 设置分钟、秒、毫秒为0  
 		const startZeroed = new Date(startDate);
 		startZeroed.setHours(0, 0, 0, 0);
 		dateRange.value = [parseTime(new Date(startZeroed)), parseTime(new Date(roundedEndDate))];
 		console.log(dateRange.value, '今天');
 	} else {
-		const noTodayStart = new Date(startDate).setMinutes(0, 0, 0);
-		const noTodayEnd = new Date(endDate).setHours(23, 0, 0, 0);
+		const noTodayStart = new Date(startDate).setHours(0, 0, 0, 0);
+		const noTodayEnd = new Date(endDate).setHours(0, 0, 0, 0);
 		dateRange.value = [parseTime(new Date(noTodayStart)), parseTime(new Date(noTodayEnd))];
 		console.log(dateRange.value, '不是今天');
 	}
 };
-const handleDateChange =async (e) => {
-
-	if (!value1.value) {
-		if (isWithin24Hours(e[0], e[1])) {
-			// 获取参数
-			getHistoryList()
+const handleDateChange = async (e) => {
+	console.log(isDateFuture(e[0]), isDateFuture(e[1]));
+	
+	if (isDateFuture(e[0]) ||isDateFuture(e[1])) {
+		ElMessage.error("不得选择未来的时间");
+	} else {
+		if (!value1.value) {
+			if (isWithin24Hours(e[0], e[1])) {
+				// 获取参数
+				getHistoryList()
 
+			} else {
+				ElMessage.error("小时模式下时间间隔不能大于24小时");
+			}
 		} else {
-			ElMessage.error("小时模式下时间间隔不能大于24小时");
+			if (isDateRangeWithinDays(e[0], e[1], 30)) {
+				await handleDateRangeChange(e)
+				getHistoryList()
+			} else {
+				ElMessage.error("日模式下时间间隔不能大于30天");
+			}
 		}
-	} else {
-		await handleDateRangeChange(e)
-		getHistoryList()
-
-
 	}
 }
 const pickDay = ref()
 const handleFocus = () => {
 	pickDay.value = null
 }
-const limitTime = 1000 * 60 * 60 * 24 * 6
+const limitTime = 1000 * 60 * 60 * 24 * 30
 
 const disabledDate = (time: Date) => {
+	return time.getTime() > Date.now() - 8.64e6
 	if (!value1.value) {
 		return time.getTime() > Date.now() - 8.64e6
 	} else {
@@ -145,7 +154,7 @@ const disabledHours = () => {
 const disabledMinutes = () => {
 	const a: number[] = [];
 	for (let i = 0; i < 60; i++) {
-		if (new Date().getMinutes() >= i) continue;
+		if (new Date().getMinutes() >= 59) continue;
 		a.push(i);
 	}
 	return a;
@@ -156,7 +165,7 @@ const disabledMinutes = () => {
 
 
 const pageable = ref({
-	data_type: true,
+	data_type: false,
 	time_order: 0,
 	as_code: undefined,
 	data_items: [],
@@ -166,36 +175,12 @@ const pageable = ref({
 });
 let historyColumns = [
 	{
-		data_id: 202,
 		data_r_table: "SHI_SHI_LIU_YAO_SU_SHU_JU",
-		data_type: "气压",
-		data_name: "本站气压",
-		data_item: "BEN_ZHAN_QI_YA",
-		data_unit: "hPa",
-		data_h_table: "LI_SHI_LIU_YAO_SU_SHU_JU",
-		data_value: "",
-		data_order: 0,
-		data_condition: 0
-	},
-	{
-		data_r_table: "SHI_SHI_LIU_YAO_SU_SHU_JU",
-		data_id: 101,
-		data_type: "温湿度",
-		data_item: "QI_WEN",
-		data_name: "气温",
-		data_unit: "℃",
-		data_h_table: "LI_SHI_LIU_YAO_SU_SHU_JU",
-		data_value: "",
-		data_order: 0,
-		data_condition: 0
-	},
-	{
-		data_r_table: "SHI_SHI_LIU_YAO_SU_SHU_JU",
-		data_id: 106,
-		data_type: "温湿度",
-		data_item: "XIANG_DUI_SHI_DU",
-		data_name: "相对湿度",
-		data_unit: "%",
+		data_id: 309,
+		data_type: "降水",
+		data_item: "RI_JIANG_SHUI_LIANG",
+		data_name: "日降水量",
+		data_unit: "mm",
 		data_h_table: "LI_SHI_LIU_YAO_SU_SHU_JU",
 		data_value: "",
 		data_order: 0,
@@ -213,7 +198,19 @@ let historyColumns = [
 		data_value: "",
 		data_order: 0,
 		data_condition: 0
-	}
+	}, {
+		data_id: 302,
+		data_r_table: "SHI_SHI_LIU_YAO_SU_SHU_JU",
+		data_type: "降水",
+		data_name: "小时累计降水量(翻斗)",
+		data_item: "XIAO_SHI_LEI_JI_JIANG_SHUI_LIANG_FAN_DOU",
+		data_unit: "mm",
+		data_h_table: "LI_SHI_LIU_YAO_SU_SHU_JU",
+		data_value: "",
+		data_order: 0,
+		data_condition: 0,
+		isSelected: true
+	},
 ]
 
 // 查询自动站列表
@@ -257,24 +254,32 @@ function formatDate(timestamp, type) {
 
 
 const timeArr = ref()
-const tempLineArr = ref()
-const humidityLineArr = ref()
-const pressureLineArr = ref()
+const dayArr = ref()
+const hourArr1 = ref()
+const hourArr2 = ref()
+const show = ref(false)
 const getHistoryList = async () => {
-	const { data } = await getDataItemList({ ...pageable.value, pageSize: 99, as_code_list: [pageable.value.as_code], data_items: historyColumns, data_type: false, time_space: value1.value ? 60 : 1, end_time:  getStamp(dateRange[1]), begin_time: getStamp(dateRange[0]) });
+	console.log(dateRange.value, 111);
+
+	const { data } = await getDataItemList({ ...pageable.value, pageSize: 99, as_code_list: [pageable.value.as_code], data_items: historyColumns, time_space: value1.value ? 1440 : 60, end_time: getStamp(dateRange.value[1]), begin_time: getStamp(dateRange.value[0]) });
 	timeArr.value = data.list?.map(item => {
 		return formatDate(item.data_time_i, 1)
 	})
-	tempLineArr.value = data.list?.map(item => {
-		return item[101]
+	dayArr.value = data.list?.map(item => {
+		return item[309]
 	})
-	humidityLineArr.value = data.list?.map(item => {
-		return item[106]
+	hourArr1.value = data.list?.map(item => {
+		return item[312]
 	})
-	pressureLineArr.value = data.list?.map(item => {
-		return item[202]
+	hourArr2.value = data.list?.map(item => {
+		return item[302]
 	})
+	if (timeArr.value?.length > 0) {
+		show.value = true
+
+	}
 	showData()
+
 };
 
 
@@ -291,8 +296,19 @@ const resetForm = (formEl) => {
 };
 
 const showData = () => {
+
 	let mychart = echarts.init(data.value);
 	let option = {
+		title: {
+			text: '暂无数据',
+			show: !timeArr.value ? true : false,
+			x: 'center',
+			y: 'center',
+			textStyle: {
+				fontSize: 14,
+				fontWeight: 'normal',
+			}
+		},
 		tooltip: {
 			trigger: 'axis',
 			axisPointer: {
@@ -310,7 +326,7 @@ const showData = () => {
 		xAxis: [
 			{
 				type: 'category',
-				data: ['06/11 16:00', '06/11 20:00', '06/12 00:00', '06/12 04:00', '06/12 08:00', '06/12 12:00', '06/12 16:00', '06/12 20:00', '06/13 00:00', '06/13 04:00', '06/13 08:00', '06/13 12:00'],
+				data: timeArr.value,
 				axisTick: {
 					alignWithLabel: true
 				},
@@ -332,7 +348,7 @@ const showData = () => {
 				type: 'bar',
 				barWidth: '50%',
 				color: '#88c1ff',
-				data: [2, 3, 5, 3, 1, 0, 5, 2, 3, 4.5, 3.6, 2.8]
+				data: dayArr.value
 			}
 		]
 	};
@@ -344,7 +360,7 @@ const showData = () => {
 
 // watch(isDark, () => {
 // 	showData()
-	
+
 
 // });
 onMounted(() => {

+ 11 - 24
src/views/analysis/windSpeed/index.vue

@@ -68,43 +68,30 @@ const pageable = ref({
 	total: 0
 });
 let historyColumns = [
-	{
-		data_id: 202,
+{
 		data_r_table: "SHI_SHI_LIU_YAO_SU_SHU_JU",
-		data_type: "气压",
-		data_name: "本站气压",
-		data_item: "BEN_ZHAN_QI_YA",
-		data_unit: "hPa",
+		data_id: 2,
+		data_type: "风",
+		data_item: "ER_FEN_ZHONG_PING_JUN_FENG_XIANG",
+		data_name: "2分钟风向",
+		data_unit: "°",
 		data_h_table: "LI_SHI_LIU_YAO_SU_SHU_JU",
 		data_value: "",
 		data_order: 0,
 		data_condition: 0
 	},
 	{
+		data_id: 1,
 		data_r_table: "SHI_SHI_LIU_YAO_SU_SHU_JU",
-		data_id: 101,
-		data_type: "温湿度",
-		data_item: "QI_WEN",
-		data_name: "气温",
-		data_unit: "℃",
+		data_type: "风",
+		data_name: "2分钟风速",
+		data_item: "ER_FEN_ZHONG_PING_JUN_FENG_SU",
+		data_unit: "m/s",
 		data_h_table: "LI_SHI_LIU_YAO_SU_SHU_JU",
 		data_value: "",
 		data_order: 0,
 		data_condition: 0
 	},
-	{
-		data_r_table: "SHI_SHI_LIU_YAO_SU_SHU_JU",
-		data_id: 106,
-		data_type: "温湿度",
-		data_item: "XIANG_DUI_SHI_DU",
-		data_name: "相对湿度",
-		data_unit: "%",
-		data_h_table: "LI_SHI_LIU_YAO_SU_SHU_JU",
-		data_value: "",
-		data_order: 0,
-		data_condition: 0,
-		isSelected: true
-	},
 ]
 
 // 查询自动站列表