3
0

2 Commits 1823e1ad9b ... 9e8eb4eb62

Autor SHA1 Nachricht Datum
  daiht 9e8eb4eb62 Merge branch 'master' of http://git.techwx.com/framework/SMO vor 3 Wochen
  daiht 918d5c70b4 zzw vor 3 Wochen

+ 15 - 2
src/api/modules/allData.ts

@@ -63,9 +63,22 @@ export const getFTPList = () => {
   return http.post<ResPage<any>>(PORT1 + `/censusftpstate`);
 };
 
-
-
 //获取所有系统配置【queryallsysitem】
 export const getQueryAllSysItem = () => {
   return http.post<ResPage<any>>(PORT1 + `/queryallsysitem`);
 };
+
+//获取所有北斗通信机【queryallbeidouitem】
+export const getBeidouAllSysItem = () => {
+  return http.post<ResPage<any>>(PORT1 + `/queryallbeidouitem`);
+};
+
+//获取所有FTP连接【queryallftpitem】
+export const getFTPAllSysItem = () => {
+  return http.post<ResPage<any>>(PORT1 + `/queryallftpitem`);
+};
+
+// 获取站点维护记录查询结果
+export const getMaintainrecordList = (params:{}) => {
+  return http.post<ResPage<any>>(PORT1 + `/querymaintainrecord`,params);
+};

+ 1 - 1
src/enums/httpEnum.ts

@@ -5,7 +5,7 @@ export enum ResultEnum {
   SUCCESS = 200,
   ERROR = 500,
   OVERDUE = 401,
-  TIMEOUT = 30000,
+  TIMEOUT = 60000,
   TYPE = "success"
 }
 

+ 8 - 0
src/utils/dateTime.ts

@@ -160,3 +160,11 @@ export function groupByType(arr) {
   
     return result;  
 }  
+
+// 获取传入日期的第二天的0点
+export function getNextDayMidnight(date) {
+	const nextDay = new Date(date);
+	nextDay.setDate(nextDay.getDate() + 1);
+	nextDay.setHours(0, 0, 0, 0);
+	return nextDay;
+  }

+ 85 - 102
src/views/analysis/dataSynthesis/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-minutes="disabledMinutes" @focus="handleFocus" @calendar-change="handleChange"
-							@change="handleDateChange"
+							end-placeholder="结束时间" :disabled-date="disabledDate" @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>
@@ -31,7 +30,7 @@
 				<el-form-item>
 					<div>
 						<el-button type="primary" @click="getHistoryList">查询</el-button>
-						<el-button plain @click="resetForm(formRef)">重置</el-button>
+						<el-button plain @click="resetForm">重置</el-button>
 					</div>
 				</el-form-item>
 			</el-form>
@@ -58,40 +57,22 @@ import * as echarts from 'echarts';
 import { useRouter } from "vue-router";
 import { ElMessage } from "element-plus";
 import { useGlobalStore } from "@/stores/modules/global";
-import { ref, computed, onMounted, reactive, watch, onDeactivated, onActivated } from "vue";
+import { ref, computed, onMounted, reactive, watch, onDeactivated, onActivated, nextTick } from "vue";
 import { getDataItemList, getPlatformList, getRgDataList, getTacRecordList } from "@/api/modules/allData";
 import { Platform } from "@/api/interface";
 import { parseTime } from '@/utils/index';
 import { isToday, isWithinThirtyMinutes, getTimeStamp, getStamp, isDateFuture, isDateRangeWithinDays } from "@/utils/dateTime";
 import { ElLoading } from "element-plus";
-import {useUserStore} from "@/stores/modules/user";
-
-/* 全局请求 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)"
-	});
-};
+import { useUserStore } from "@/stores/modules/user";
+
 
-/**
- * @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 dateRange = ref<[any, any]>([parseTime(getTimeStamp(5), '{y}-{m}-{d}') + ' 00:00', parseTime(new Date(), '{y}-{m}-{d} {h}') + ':00']);
 const changetype = (e) => {
 	if (!e) {
 		dateRange.value = [parseTime(getTimeStamp(1), '{y}-{m}-{d} {h}:{i}'), parseTime(new Date(), '{y}-{m}-{d} {h}:{i}')]
+	} else {
+		dateRange.value = [parseTime(getTimeStamp(5), '{y}-{m}-{d}') + ' 00:00', parseTime(new Date(), '{y}-{m}-{d} {h}') + ':00'];
 	}
 	getHistoryList()
 }
@@ -105,33 +86,33 @@ const handleDateRangeChange = (newVal) => {
 		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);
 		dateRange.value = [parseTime(new Date(noTodayStart)), parseTime(new Date(noTodayEnd))];
-		console.log(dateRange.value, '不是今天');
+
 	}
 };
 const handleDateChange = async (e) => {
-	if (isDateFuture(e[0]) ||isDateFuture(e[1])) {
+	if (isDateFuture(e[0]) || isDateFuture(e[1])) {
 		ElMessage.error("不得选择未来的时间");
 	} else {
 		if (!value1.value) {
-			if (isWithinThirtyMinutes(e[0], e[1])) {
+			// if (isWithinThirtyMinutes(e[0], e[1])) {
 			// 获取参数
 			getHistoryList()
 
+			// } else {
+			// 	ElMessage.error("分钟模式下时间间隔不能大于3小时");
+			// }
 		} else {
-			ElMessage.error("分钟模式下时间间隔不能大于3小时");
-		}
-		} else {
-			if (isDateRangeWithinDays(e[0], e[1], 7)) {
-				await handleDateRangeChange(e)
-				getHistoryList()
-			} else {
-				ElMessage.error("正点模式下时间间隔不能大于7天");
-			}
+			// if (isDateRangeWithinDays(e[0], e[1], 7)) {
+			await handleDateRangeChange(e)
+			getHistoryList()
+			// } else {
+			// 	ElMessage.error("正点模式下时间间隔不能大于7天");
+			// }
 		}
 	}
 }
@@ -150,25 +131,6 @@ const handleChange = (val: Date[]) => {
 }
 
 
-const disabledHours = () => {
-	const a: number[] = [];
-	for (let i = 0; i < 24; i++) {
-		if (new Date().getHours() >= i) continue;
-		a.push(i);
-	}
-	return a;
-};
-
-const disabledMinutes = () => {
-	const a: number[] = [];
-	// for (let i = 0; i < 60; i++) {
-	// 	if (new Date().getMinutes() >= i) continue;
-	// 	a.push(i);
-	// }
-	return a;
-};
-
-
 
 const pageable = ref({
 	data_type: true,
@@ -176,8 +138,7 @@ const pageable = ref({
 	as_code: undefined,
 	data_items: [],
 	pageNum: 1,
-	pageSize: 20,
-	total: 0
+
 });
 let historyColumns = [
 	{
@@ -228,7 +189,7 @@ const queryas = ref<Platform>({
 
 
 const userStore = useUserStore();
-const platformList =ref<any>(computed(() => userStore.stations))
+const platformList = ref<any>(computed(() => userStore.stations))
 const selectPlatform = ref()
 
 const getPlatforms = async () => {
@@ -262,13 +223,18 @@ const timeArr = ref()
 const tempLineArr = ref()
 const humidityLineArr = ref()
 const pressureLineArr = ref()
+const pressureInfo = ref<any>({
+	max: 1080,
+	min: 800
+})
 const getHistoryList = async () => {
 
-	if (isDateFuture(dateRange.value[0]) ||isDateFuture(dateRange.value[1])) {
+
+	if (isDateFuture(dateRange.value[0]) || isDateFuture(dateRange.value[1])) {
 		ElMessage.error("不得选择未来的时间");
 		return false;
 	}
-	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, 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)
 	})
@@ -281,10 +247,46 @@ const getHistoryList = async () => {
 	pressureLineArr.value = data.list?.map(item => {
 		return item[202]
 	})
-	console.log(pressureLineArr.value, 555555);
-	showData()
+	pressureInfo.value.max = getMaxAndAdd50(pressureLineArr.value)
+	pressureInfo.value.min = getMaxAndMinus50(pressureLineArr.value)
+
+
+
+	nextTick(() => {
+		showData()
+	})
 };
+function getMaxAndAdd50(arr) {
+
+
+	if (!arr || arr.length === 0) {
+		return
+	} else {
+		// 使用 filter 方法过滤掉不能转换为数值的字符串  
+		const numericArray = arr.filter(item => !isNaN(Number(item)));
+
+		// 使用 map 方法将过滤后的数组转换为数值数组  
+		const numberArray = numericArray.map(item => Number(item));
+		let max = Math.max.apply(null, numberArray); // 获取最大值方法
+		let maxint = Math.ceil(max / 5) * 5; // 向上以5的倍数取整
+		return maxint === 0 ? 5 : maxint + 50; // 输出最大值+5
+	}
+
+}
+function getMaxAndMinus50(arr) {
+	if (!arr || arr.length === 0) {
+		return
+	} else {
+		// 使用 filter 方法过滤掉不能转换为数值的字符串  
+		const numericArray = arr.filter(item => !isNaN(Number(item)));
+		// 使用 map 方法将过滤后的数组转换为数值数组  
+		const numberArray = numericArray.map(item => Number(item));
+		let min = Math.min.apply(null, numberArray); // 获取最小值方法
+		let minint = Math.floor(min / 5) * 5; // 向下以6的倍数取整
+		return minint <= 50 ? 0 : minint - 50; // 输出最小值+6
+	}
 
+}
 
 const formRef = ref()
 const data = ref()
@@ -293,40 +295,20 @@ const globalStore = useGlobalStore();
 const isDark = computed(() => globalStore.isDark);
 
 // resetForm
-const resetForm = (formEl) => {
-	if (!formEl) return;
-	formEl.resetFields();
+const resetForm = () => {
+	dateRange.value = [parseTime(getTimeStamp(5), '{y}-{m}-{d}') + ' 00:00', parseTime(new Date(), '{y}-{m}-{d} {h}') + ':00'];
+	value1.value = true
+	pageable.value.as_code = platformList.value[0].as_code
+	getHistoryList()
+
 };
 
 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'];
 	var dom = document.getElementById("data");
-    // var myChart = echarts.init(dom);
+	// var myChart = echarts.init(dom);
 	let mychart = echarts.init(dom);
 	let option = {
 		color: colors,
@@ -365,7 +347,10 @@ const showData = () => {
 					alignWithLabel: true
 				},
 				// prettier-ignore
-				data: timeArr.value
+				data: timeArr.value,
+				axisLine: {
+					onZero: false    //-----------重点
+				}
 			}
 		],
 		yAxis: [
@@ -404,8 +389,8 @@ const showData = () => {
 				type: 'value',
 				name: '本站气压',
 
-				min: getMaxAndMinus50(pressureLineArr.value),
-				max: getMaxAndAdd50(pressureLineArr.value),
+				min: pressureInfo.value.min,
+				max: pressureInfo.value.max,
 				position: 'left',
 				axisLine: {
 					show: true,
@@ -443,10 +428,8 @@ const showData = () => {
 			}
 		]
 	};
-	 //单击后执行操作
-	 mychart.on('click',(param) => {
-        console.log(param)
-    });
+
+
 	mychart.setOption(option)
 	window.addEventListener("resize", function () {
 		mychart.resize();

+ 32 - 150
src/views/analysis/featureCurves/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-minutes="disabledMinutes"
+							end-placeholder="结束时间" :disabled-date="disabledDate" 
 							@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>
@@ -30,7 +30,7 @@
 				<el-form-item>
 					<div>
 						<el-button type="primary" @click="getHistoryList">查询</el-button>
-						<el-button plain @click="resetForm(formRef)">重置</el-button>
+						<el-button plain @click="resetForm">重置</el-button>
 					</div>
 				</el-form-item>
 			</el-form>
@@ -251,10 +251,12 @@ import { parseTime } from '@/utils/index';
 import { isToday, isWithinThirtyMinutes, getTimeStamp, getStamp, isDateFuture, isDateRangeWithinDays } from "@/utils/dateTime";
 import {useUserStore} from "@/stores/modules/user";
 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 dateRange = ref<[any, any]>([parseTime(new Date(), '{y}-{m}-{d}') + ' 00:00',  parseTime(new Date(), '{y}-{m}-{d} {h}') + ':00']);
 const changetype = (e) => {
 	if (!e) {
 		dateRange.value = [parseTime(getTimeStamp(1), '{y}-{m}-{d} {h}:{i}'), parseTime(new Date(), '{y}-{m}-{d} {h}:{i}')]
+	}else {
+		dateRange.value = [parseTime(new Date(), '{y}-{m}-{d}') + ' 00:00', parseTime(new Date(), '{y}-{m}-{d} {h}') + ':00'];
 	}
 	getHistoryList()
 }
@@ -268,12 +270,11 @@ const handleDateRangeChange = (newVal) => {
 		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);
 		dateRange.value = [parseTime(new Date(noTodayStart)), parseTime(new Date(noTodayEnd))];
-		console.log(dateRange.value, '不是今天');
+
 	}
 };
 const handleDateChange = async (e) => {
@@ -281,20 +282,20 @@ const handleDateChange = async (e) => {
 		ElMessage.error("不得选择未来的时间");
 	} else {
 		if (!value1.value) {
-			if (isWithinThirtyMinutes(e[0], e[1])) {
+			// if (isWithinThirtyMinutes(e[0], e[1])) {
 				// 获取参数
 				getHistoryList()
 
-			} else {
-				ElMessage.error("分钟模式下时间间隔不能大于3小时");
-			}
+			// } else {
+			// 	ElMessage.error("分钟模式下时间间隔不能大于3小时");
+			// }
 		} else {
-			if (isDateRangeWithinDays(e[0], e[1], 7)) {
+			// if (isDateRangeWithinDays(e[0], e[1], 7)) {
 				await handleDateRangeChange(e)
 				getHistoryList()
-			} else {
-				ElMessage.error("正点模式下时间间隔不能大于7天");
-			}
+			// } else {
+			// 	ElMessage.error("正点模式下时间间隔不能大于7天");
+			// }
 		}
 	}
 }
@@ -313,26 +314,6 @@ const handleChange = (val: Date[]) => {
 }
 
 
-const disabledHours = () => {
-	const a: number[] = [];
-	for (let i = 0; i < 24; i++) {
-		if (new Date().getHours() >= i) continue;
-		a.push(i);
-	}
-	return a;
-};
-
-const disabledMinutes = () => {
-	const a: number[] = [];
-	// for (let i = 0; i < 60; i++) {
-	// 	if (new Date().getMinutes() >= i) continue;
-	// 	a.push(i);
-	// }
-	return a;
-};
-
-
-
 
 
 
@@ -604,8 +585,7 @@ const pageable = ref({
 	as_code: undefined,
 	data_items: [],
 	pageNum: 1,
-	pageSize: 20,
-	total: 0
+
 });
 let historyColumns = [
 	{
@@ -761,11 +741,15 @@ const Access = () => {
 							return value.replace(/ /g, '\n');
 						},
 					},
+					axisLine: {
+					onZero: false    //-----------重点
+				}
 				},
 				yAxis: {
-					min: minData1,
-					max: maxData1,
-					type: 'value'
+					// min: minData1,
+					// max: maxData1,
+					type: 'value',
+					// boundaryGap: [0, '10%']
 				},
 				// 鼠标悬浮提示
 				tooltip: {
@@ -820,7 +804,7 @@ const getHistoryList = async () => {
 		}
 		return acc;
 	}, []);
-	const { data } = await getDataItemList({ ...pageable.value, pageSize: 999, as_code_list: [pageable.value.as_code], data_items: arr, 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,  as_code_list: [pageable.value.as_code], data_items: arr, 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)
 	})
@@ -860,7 +844,7 @@ const getHistoryList = async () => {
 		return {
 			value: item[1],
 			symbolRotate: adjustValue(item[2]),
-			symbolRotateStr: item[2] === 'C' ? 0 : item[2]
+			symbolRotateStr: item[2] 
 		}
 	})
 	nextTick(()=>{
@@ -880,112 +864,16 @@ const globalStore = useGlobalStore();
 const isDark = computed(() => globalStore.isDark);
 
 // resetForm
-const resetForm = (formEl) => {
-	if (!formEl) return;
-	formEl.resetFields();
+const resetForm = () => {
+	dateRange.value = [parseTime(new Date(), '{y}-{m}-{d}') + ' 00:00', parseTime(new Date(), '{y}-{m}-{d} {h}') + ':00'];
+	value1.value = true
+	pageable.value.as_code = platformList.value[0].as_code
+	getHistoryList()
+
 };
 
 const showWind = () => {
-	// 数据格式
-	let winArr = [{
-		value: 4.1, //风速--数值大小--变量名不可变
-		symbolRotate: -45, //风向---旋转角度--变量名不可变
-		symbolRotateStr: '西南风' //风向中文--变量名可变(tooltip 提示随之修改)
-	}, {
-		value: 4.5,
-		symbolRotate: 45,
-		symbolRotateStr: '东南风'
-	}, {
-		value: 4.5,
-		symbolRotate: 90,
-		symbolRotateStr: '东风'
-	}, {
-		value: 5.0,
-		symbolRotate: -180,
-		symbolRotateStr: '南风'
-	}, {
-		value: 4.3,
-		symbolRotate: -45,
-		symbolRotateStr: '西南风'
-	}, {
-		value: 4.5,
-		symbolRotate: -90,
-		symbolRotateStr: '西风'
-	}, {
-		value: 4.5,
-		symbolRotate: -45,
-		symbolRotateStr: '西南风'
-	}, {
-		value: 4.5,
-		symbolRotate: -90,
-		symbolRotateStr: '西风'
-	}, {
-		value: 4.1, //风速--数值大小--变量名不可变
-		symbolRotate: -45, //风向---旋转角度--变量名不可变
-		symbolRotateStr: '西南风' //风向中文--变量名可变(tooltip 提示随之修改)
-
-	}, {
-		value: 4.5,
-		symbolRotate: 45,
-		symbolRotateStr: '东南风'
-	}, {
-		value: 4.5,
-		symbolRotate: 90,
-		symbolRotateStr: '东风'
-	}, {
-		value: 5.0,
-		symbolRotate: -180,
-		symbolRotateStr: '南风'
-	}, {
-		value: 4.3,
-		symbolRotate: -45,
-		symbolRotateStr: '西南风'
-	}, {
-		value: 4.5,
-		symbolRotate: -90,
-		symbolRotateStr: '西风'
-	}, {
-		value: 4.5,
-		symbolRotate: -45,
-		symbolRotateStr: '西南风'
-	}, {
-		value: 4.5,
-		symbolRotate: -90,
-		symbolRotateStr: '西风'
-	}, {
-		value: 4.1, //风速--数值大小--变量名不可变
-		symbolRotate: -45, //风向---旋转角度--变量名不可变
-		symbolRotateStr: '西南风' //风向中文--变量名可变(tooltip 提示随之修改)
 
-	}, {
-		value: 4.5,
-		symbolRotate: 45,
-		symbolRotateStr: '东南风'
-	}, {
-		value: 4.5,
-		symbolRotate: 90,
-		symbolRotateStr: '东风'
-	}, {
-		value: 5.0,
-		symbolRotate: -180,
-		symbolRotateStr: '南风'
-	}, {
-		value: 4.3,
-		symbolRotate: -45,
-		symbolRotateStr: '西南风'
-	}, {
-		value: 4.5,
-		symbolRotate: -90,
-		symbolRotateStr: '西风'
-	}, {
-		value: 4.5,
-		symbolRotate: -45,
-		symbolRotateStr: '西南风'
-	}, {
-		value: 4.5,
-		symbolRotate: -90,
-		symbolRotateStr: '西风'
-	},]
 	let mychart = echarts.init(wind.value);
 	let option = {
 		title: {
@@ -1330,7 +1218,7 @@ function loadCustomizeColumns() {
 		customizeColumns.value = JSON.parse(jsonString);
 	}
 }
-let intervalId;
+
 
 onMounted(() => {
 	loadCustomizeColumns()
@@ -1347,13 +1235,7 @@ onMounted(() => {
 	// showRadio2()
 
 })
-onActivated(() => {
-	intervalId = setInterval(() => {
-		// getList();
-		// weatherInfo()
-		getHistoryList()
-	}, 60 * 1000);
-});
+
 
 </script>
 <style scoped lang="scss">

+ 16 - 18
src/views/analysis/lightningArea/index.vue

@@ -29,8 +29,8 @@
 				</el-form-item>
 				<el-form-item>
 					<div>
-						<el-button type="primary" @click="getHistoryList">查询</el-button>
-						<el-button plain @click="resetForm(formRef)">重置</el-button>
+						<el-button type="primary" @click="handleDateChange">查询</el-button>
+						<el-button plain @click="resetForm">重置</el-button>
 					</div>
 				</el-form-item>
 			</el-form>
@@ -57,7 +57,7 @@ import * as echarts from 'echarts';
 
 import { ElMessage } from "element-plus";
 import { useGlobalStore } from "@/stores/modules/global";
-import { ref, computed, onMounted, reactive, watch, onDeactivated, onActivated } from "vue";
+import { ref, computed, onMounted, reactive, watch, onDeactivated, onActivated, nextTick } from "vue";
 import { getDataItemList, getPlatformList, getRgDataList, getTacRecordList } from "@/api/modules/allData";
 import { Platform } from "@/api/interface";
 import { parseTime } from '@/utils/index';
@@ -68,6 +68,8 @@ const dateRange = ref<[any, any]>([parseTime(new Date(), '{y}-{m}-{d}') + ' 00:0
 const changetype = (e) => {
 	if (!e) {
 		dateRange.value = [parseTime(getTimeStamp(1), '{y}-{m}-{d} {h}:{i}'), parseTime(new Date(), '{y}-{m}-{d} {h}:{i}')]
+	} else {
+		dateRange.value = [parseTime(new Date(), '{y}-{m}-{d}') + ' 00:00', parseTime(new Date(), '{y}-{m}-{d} {h}:{i}')]
 	}
 }
 const handleDateRangeChange = (newVal) => {
@@ -80,12 +82,10 @@ const handleDateRangeChange = (newVal) => {
 		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);
 		dateRange.value = [parseTime(new Date(noTodayStart)), parseTime(new Date(noTodayEnd))];
-		console.log(dateRange.value, '不是今天');
 	}
 };
 const handleDateChange = async (e) => {
@@ -137,7 +137,7 @@ const pageable = ref({
 	as_code: undefined,
 	data_items: [],
 	pageNum: 1,
-	pageSize: 20,
+
 });
 let historyColumns = [
 	{
@@ -219,13 +219,9 @@ function formatDate(timestamp, type) {
 
 const timeArr = ref()
 const series = ref<any>([])
-const tempLineArr = ref()
 
 const getHistoryList = async () => {
-	if (isDateFuture(dateRange.value[0]) || isDateFuture(dateRange.value[1])) {
-		ElMessage.error("不得选择未来的时间");
-		return false;
-	}
+	
 	const { data } = await getDataItemList({ ...pageable.value, pageSize: 9999, 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)
@@ -288,7 +284,9 @@ const getHistoryList = async () => {
 			]
 		})
 	})
-	showData()
+	nextTick(()=>{
+		showData()
+	})
 };
 
 
@@ -299,9 +297,11 @@ const globalStore = useGlobalStore();
 const isDark = computed(() => globalStore.isDark);
 
 // resetForm
-const resetForm = (formEl) => {
-	if (!formEl) return;
-	formEl.resetFields();
+const resetForm = () => {
+	dateRange.value =[parseTime(new Date(), '{y}-{m}-{d}') + ' 00:00', parseTime(new Date(), '{y}-{m}-{d} {h}:{i}')]
+	value1.value = true
+	pageable.value.as_code = platformList.value[0].as_code
+	getHistoryList()
 };
 
 const clickNum=ref(0)
@@ -319,6 +319,7 @@ const showData = () => {
 		let obj = {
 			name: (angle === 360 || angle % 45 === 0) ? angle.toFixed(1) + '°' : '',
 			max: 200,
+			// alignTicks: false,
 			color: isDark.value ? '#fff' : "#000",
 			axisLabel: angle === 360 ? {
 				show: angle === 360,
@@ -338,14 +339,11 @@ const showData = () => {
 			triggerOn: 'click',
 			formatter: function (params) {
 				return `一分钟最强闪电的强度:${params.data.info[1003]}V/m <br />时间:${formatDate(params.data.info.data_time_i, 2)}`
-			
 			}
 		},
 		radar: {
 			shape: 'circle',
 			// radius: 320, // 大小
-
-
 			name: { // (圆外的标签)雷达图每个指示器名称的配置项。
 				formatter: '{value}',
 				textStyle: {

+ 53 - 60
src/views/analysis/rainfall/index.vue

@@ -21,8 +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-minutes="disabledMinutes"
-							@focus="handleFocus" @calendar-change="handleChange" @change="handleDateChange"
+							end-placeholder="结束时间" :disabled-date="disabledDate" @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>
@@ -30,7 +30,7 @@
 				<el-form-item>
 					<div>
 						<el-button type="primary" @click="getHistoryList">查询</el-button>
-						<el-button plain @click="resetForm(formRef)">重置</el-button>
+						<el-button plain @click="resetForm">重置</el-button>
 					</div>
 				</el-form-item>
 			</el-form>
@@ -41,7 +41,7 @@
 					<div class="chart_item zhuti">
 						<div style="font-weight: bold;" class="item_title">
 							<span v-if="value1">日降水量(mm)</span>
-							<span v-else>小时累计降水量 (称重)(mm)</span>
+							<span v-else>小时累计降水量 ({{ isFANDOU ? '翻斗' : '称重'}})(mm)</span>
 						</div>
 						<div class="mt5">
 							<div ref="data" class="data_box"></div>
@@ -58,12 +58,12 @@ import * as echarts from 'echarts';
 
 import { ElMessage } from "element-plus";
 import { useGlobalStore } from "@/stores/modules/global";
-import { ref, computed, onMounted, reactive, watch, onDeactivated, onActivated } from "vue";
+import { ref, computed, onMounted, reactive, watch, onDeactivated, onActivated, nextTick } from "vue";
 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, isDateFuture, isDateRangeWithinDays } from "@/utils/dateTime";
-import {useUserStore} from "@/stores/modules/user";
+import { useUserStore } from "@/stores/modules/user";
 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}') + ' 00:00']);
 const changetype = (e) => {
@@ -72,6 +72,7 @@ const changetype = (e) => {
 	} else {
 		dateRange.value = [parseTime(new Date(getTimeStamp(5)), '{y}-{m}-{d}') + ' 00:00', parseTime(new Date(), '{y}-{m}-{d}') + ' 00:00']
 	}
+	getHistoryList()
 }
 const handleDateRangeChange = (newVal) => {
 	const [startDate, endDate] = newVal;
@@ -83,34 +84,32 @@ const handleDateRangeChange = (newVal) => {
 		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).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 (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()
+			// if (isWithin24Hours(e[0], e[1])) {
+			// 获取参数
+			getHistoryList()
 
-			} else {
-				ElMessage.error("小时模式下时间间隔不能大于24小时");
-			}
+			// } else {
+			// 	ElMessage.error("小时模式下时间间隔不能大于24小时");
+			// }
 		} else {
-			if (isDateRangeWithinDays(e[0], e[1], 30)) {
-				await handleDateRangeChange(e)
-				getHistoryList()
-			} else {
-				ElMessage.error("日模式下时间间隔不能大于30天");
-			}
+			// if (isDateRangeWithinDays(e[0], e[1], 30)) {
+			await handleDateRangeChange(e)
+			getHistoryList()
+			// } else {
+			// 	ElMessage.error("日模式下时间间隔不能大于30天");
+			// }
 		}
 	}
 }
@@ -130,28 +129,12 @@ const handleChange = (val: Date[]) => {
 }
 
 
-
-const disabledMinutes = () => {
-	const a: number[] = [];
-	for (let i = 0; i < 60; i++) {
-		if (new Date().getMinutes() >= 59) continue;
-		a.push(i);
-	}
-	return a;
-};
-
-
-
-
-
 const pageable = ref({
 	data_type: false,
 	time_order: 1,
 	as_code: undefined,
 	data_items: [],
 	pageNum: 1,
-	pageSize: 20,
-	total: 0
 });
 let historyColumns = [
 	{
@@ -202,7 +185,7 @@ const queryas = ref<Platform>({
 
 
 const userStore = useUserStore();
-const platformList =ref<any>(computed(() => userStore.stations))
+const platformList = ref<any>(computed(() => userStore.stations))
 const selectPlatform = ref()
 
 const getPlatforms = async () => {
@@ -235,15 +218,15 @@ function formatDate(timestamp, type) {
 const timeArr = ref()
 const dayArr = ref()
 const hourArr1 = ref()
-const hourArr2 = ref()
-const show = ref(false)
+const isFANDOU=ref(false)
+
 const getHistoryList = async () => {
-	if (isDateFuture(dateRange.value[0]) ||isDateFuture(dateRange.value[1])) {
+	if (isDateFuture(dateRange.value[0]) || isDateFuture(dateRange.value[1])) {
 		ElMessage.error("不得选择未来的时间");
 		return false;
 	}
 
-	const { data } = await getDataItemList({ ...pageable.value, pageSize: 9999, 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]) });
+	const { data } = await getDataItemList({ ...pageable.value, 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)
 	})
@@ -251,23 +234,29 @@ const getHistoryList = async () => {
 		return item[309]
 	})
 	hourArr1.value = data.list?.map(item => {
-		if (item[312]!=='0.0'&&item[312]!=='/') {
+		if (item[312] !== '0.0' && item[312] !== '--' && item[312] !== '/') {
 			return item[312]
-		} else if (item[302]!=='0.0'&&item[302]!=='/') {
+		} else if (item[302] !== '0.0' && item[302] !== '--' && item[312] !== '/') {
 			return item[302]
 		} else {
 			return '0.0'
 		}
 	})
-	hourArr2.value = data.list?.map(item => {
-		return item[302]
-	})
-	if (timeArr.value?.length > 0) {
-		show.value = true
+	isFANDOU.value = data.list.some(item => {
+		// 尝试将项转换为数字,如果转换失败(例如,对于 '--'),则返回 NaN  
+		const number = Number(item[302]);
+		// 检查是否是一个有效的数字且大于 10  
+		return !isNaN(number) && number > 0;
+	});
+
+
+
 
-	}
-	showData()
 
+	nextTick(() => {
+		showData()
+
+	})
 };
 
 
@@ -278,9 +267,11 @@ const globalStore = useGlobalStore();
 const isDark = computed(() => globalStore.isDark);
 
 // resetForm
-const resetForm = (formEl) => {
-	if (!formEl) return;
-	formEl.resetFields();
+const resetForm = () => {
+	dateRange.value = [parseTime(new Date(getTimeStamp(5)), '{y}-{m}-{d}') + ' 00:00', parseTime(new Date(), '{y}-{m}-{d}') + ' 00:00']
+	value1.value = true
+	pageable.value.as_code = platformList.value[0].as_code
+	getHistoryList()
 };
 
 const showData = () => {
@@ -303,10 +294,12 @@ const showData = () => {
 				type: 'shadow'
 			},
 			formatter: function (params) {
-            return [
-              "降水:" + [Number(params[0].value) ? Number(params[0].value) : "/"],
-            ].join("<br/>");
-          },
+
+				return [
+					"降水:" + [Number(params[0].value) ? Number(params[0].value) : "/"],
+					'时间:' + params[0].name
+				].join("<br/>");
+			},
 		},
 		grid: {
 			left: '20',
@@ -341,7 +334,7 @@ const showData = () => {
 				type: 'bar',
 				barWidth: '50%',
 				color: '#88c1ff',
-				data:value1.value? dayArr.value:hourArr1.value
+				data: value1.value ? dayArr.value : hourArr1.value
 			}
 		]
 	};

+ 33 - 8
src/views/analysis/windSpeed/index.vue

@@ -25,7 +25,7 @@
 				<el-form-item>
 					<div>
 						<el-button type="primary" @click="getHistoryList" >查询</el-button>
-						<el-button plain @click="resetForm(formRef)">重置</el-button>
+						<el-button plain @click="resetForm">重置</el-button>
 					</div>
 				</el-form-item>
 			</el-form>
@@ -60,7 +60,30 @@ import { getDataItemList, getPlatformList, getRgDataList, getTacRecordList } fro
 import { Platform } from "@/api/interface";
 import { parseTime } from '@/utils/index';
 import { isToday, isWithinThirtyMinutes, getTimeStamp, getStamp, isWithin24Hours, isDateFuture, isDateRangeWithinDays } from "@/utils/dateTime";
+import { ElLoading } from "element-plus";
 import {useUserStore} from "@/stores/modules/user";
+
+/* 全局请求 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 dateRange = ref<[any, any]>([parseTime(new Date(getTimeStamp(5)), '{y}-{m}-{d}') + ' 00:00', parseTime(new Date(), '{y}-{m}-{d} {h}') + ':00']);
 const handleDateRangeChange = (newVal) => {
 	const [startDate, endDate] = newVal;
@@ -79,11 +102,11 @@ const handleDateRangeChange = (newVal) => {
 	}
 };
 const handleDateChange = async (e) => {
-	if (isDateRangeWithinDays(e[0], e[1], 30)) {
+	if (isDateRangeWithinDays(e[0], e[1], 90)) {
 		await handleDateRangeChange(e)
 		getHistoryList()
 	} else {
-		ElMessage.error("时间间隔不能大于30天");
+		ElMessage.error("时间间隔不能大于90天");
 	}
 }
 const pickDay = ref()
@@ -185,8 +208,8 @@ const windInfo = ref<any>({
 	speedMax:6
 })
 const getHistoryList = async () => {
-	if (!isDateRangeWithinDays(dateRange.value[0], dateRange.value[1], 30)) {
-		ElMessage.error("时间间隔不能大于30天");
+	if (!isDateRangeWithinDays(dateRange.value[0], dateRange.value[1], 90)) {
+		ElMessage.error("时间间隔不能大于90天");
 		return false
 	}
 	const { data } = await getDataItemList({ ...pageable.value, pageSize: 999, as_code_list: [pageable.value.as_code], data_items: historyColumns, data_type: false, time_space: 60, end_time: getStamp(dateRange.value[1]), begin_time: getStamp(dateRange.value[0]) });
@@ -297,9 +320,11 @@ const globalStore = useGlobalStore();
 const isDark = computed(() => globalStore.isDark);
 
 // resetForm
-const resetForm = (formEl) => {
-	if (!formEl) return;
-	formEl.resetFields();
+const resetForm = () => {
+	dateRange.value = [parseTime(getTimeStamp(5), '{y}-{m}-{d}') + ' 00:00', parseTime(new Date(), '{y}-{m}-{d} {h}') + ':00'];
+	pageable.value.as_code = platformList.value[0].as_code
+	getHistoryList()
+
 };
 // 风向
 const showData = () => {

+ 159 - 92
src/views/maintenance/siteRecords/index.vue

@@ -4,71 +4,73 @@
       <!-- 表格头部 操作按钮 -->
       <div class="table-header">
         <div class="header-button-lf">
-          <el-form :model="queryParams" label-width="auto"  :inline="true">
-            <el-form-item label="自动站:">
-              <el-select v-model="queryParams.code" filterable placeholder="请选择" clearable style="width: 200px">
-                <el-option label="M1994" value="M1994" />
-                <el-option label="M1995" value="M1995" />
+          <el-form :model="pageable" label-width="auto" :inline="true">
+            <el-form-item label="自动站:" prop="base">
+              <el-select v-model="pageable.as_code" filterable placeholder="请搜索自动站" remote reserve-keyword clearable
+                style="width: 200px" @change="changeStation">
+                <el-option v-for="item in platformList" :key="item.as_code" :label="item.as_code + ' ' + item.as_name"
+                  :value="item.as_code" />
+                <template #prefix>
+                  <el-icon class="el-input__icon">
+                    <search />
+                  </el-icon>
+                </template>
               </el-select>
             </el-form-item>
             <el-form-item label="维护类型:">
-              <el-select v-model="queryParams.type" filterable placeholder="请选择" clearable style="width: 200px">
-                <el-option label="检查" value="1" />
+              <el-select v-model="pageable.record_type" filterable placeholder="请选择"  style="width: 200px">
+                <el-option v-for="item in type" :key="item.value" :label="item.label" :value="item.value" />
               </el-select>
             </el-form-item>
             <el-form-item label="维护时间:">
-              <el-date-picker
-                v-model="queryParams.time"
-                type="daterange"
-                range-separator="至"
-                start-placeholder="开始日期"
-                end-placeholder="结束日期"
-              />
+              <el-date-picker v-model="dateValue" type="date" placeholder="选择日期" :disabled-date="disabledDate"
+                :shortcuts="shortcuts" />
             </el-form-item>
             <el-form-item>
               <el-button type="primary" @click="handleQuery"> 查询 </el-button>
               <el-button style="margin-left: 10px" @click="resetQuery"> 重置 </el-button>
-              <el-button  style="margin-left: 10px" type="primary" plain  @click="handleAdd"> 新增 </el-button>
+              <!-- <el-button style="margin-left: 10px" type="primary" plain @click="handleAdd"> 新增 </el-button> -->
             </el-form-item>
           </el-form>
         </div>
       </div>
       <!-- 表格主体 -->
-      <el-table stripe ref="tableRef" :border="true" :data="processTableData"  size="small">
+      <el-table stripe ref="tableRef" :border="true" :data="processTableData" size="small">
         <el-table-column align="left" label="序号" width="80px" :show-overflow-tooltip="true">
           <template #default="scope">
-            {{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
+            {{ (pageable.pageNum - 1) * pageable.pageSize + scope.$index + 1 }}
           </template>
         </el-table-column>
         <template v-for="item in columns" :key="item">
-          <el-table-column v-bind="item" :align="item.align ?? 'left'" :reserve-selection="item.type == 'selection'" :show-overflow-tooltip="true">
+          <el-table-column v-bind="item" :align="item.align ?? 'left'" :reserve-selection="item.type == 'selection'"
+            :show-overflow-tooltip="true">
             <template #default="scope">
-              <template v-if="item.prop === 'operation'">
-                <el-tooltip
-                  class="box-item"
-                  effect="dark"
-                  content="编辑"
-                  placement="top"
-                >
+              <template v-if="item.prop === 'maintain_mode'">
+                <div>{{ scope.row.maintain_mode == 0 ? '检查' : scope.row.maintain_mode == 1 ? '更换' : '维修' }}</div>
+              </template>
+              <template v-if="item.prop === 'begin_time_i'">
+                <div>{{ parseTime(scope.row.begin_time_i, '{y}-{m}-{d} {h}:{i}') }}</div>
+              </template>
+              <template v-if="item.prop === 'end_time_i'">
+                <div>{{ parseTime(scope.row.end_time_i, '{y}-{m}-{d} {h}:{i}') }}</div>
+              </template>
+
+              <!-- <template v-if="item.prop === 'operation'">
+                <el-tooltip class="box-item" effect="dark" content="编辑" placement="top">
                   <el-button type="primary" link @click="handleUpdate">
-                    <el-icon >
+                    <el-icon>
                       <Edit />
                     </el-icon>
                   </el-button>
                 </el-tooltip>
-                <el-tooltip
-                  class="box-item"
-                  effect="dark"
-                  content="删除"
-                  placement="top"
-                >
-                  <el-button type="primary" link  @click="handleDelete(scope.row)">
-                    <el-icon >
+                <el-tooltip class="box-item" effect="dark" content="删除" placement="top">
+                  <el-button type="primary" link @click="handleDelete(scope.row)">
+                    <el-icon>
                       <Delete />
                     </el-icon>
                   </el-button>
                 </el-tooltip>
-              </template>
+              </template> -->
             </template>
           </el-table-column>
         </template>
@@ -84,7 +86,8 @@
         </template>
       </el-table>
       <!-- 分页组件 -->
-      <Pagination :pageable="pageable" :handle-size-change="handleSizeChange" :handle-current-change="handleCurrentChange" />
+      <Pagination :pageable="pageable" :handle-size-change="handleSizeChange"
+        :handle-current-change="handleCurrentChange" />
     </div>
 
     <!-- 添加或修改对话框 -->
@@ -105,22 +108,12 @@
           <el-input v-model="form.name" placeholder="请输入维护人" />
         </el-form-item>
         <el-form-item label="开始时间" prop="startTime">
-          <el-date-picker
-            style="width: 100%"
-            v-model="form.startTime"
-            type="datetime"
-            placeholder="请选择"
-            format="YYYY-MM-DD HH:mm"
-          />
+          <el-date-picker style="width: 100%" v-model="form.startTime" type="datetime" placeholder="请选择"
+            format="YYYY-MM-DD HH:mm" />
         </el-form-item>
         <el-form-item label="结束时间" prop="endTime">
-          <el-date-picker
-            style="width: 100%"
-            v-model="form.endTime"
-            type="datetime"
-            placeholder="请选择"
-            format="YYYY-MM-DD HH:mm"
-          />
+          <el-date-picker style="width: 100%" v-model="form.endTime" type="datetime" placeholder="请选择"
+            format="YYYY-MM-DD HH:mm" />
         </el-form-item>
         <el-form-item label="工作内容" prop="remark">
           <el-input v-model="form.remark" type="textarea" :rows="8" placeholder="请输入内容" />
@@ -138,32 +131,101 @@
 
 <script setup lang="ts" name="useProTable">
 import Pagination from "@/components/ProTable/components/Pagination.vue";
-import { ref, reactive } from "vue";
+import { ref, reactive, computed, onMounted } from "vue";
 import { ColumnProps } from "@/components/ProTable/interface";
 import { ElMessageBox } from 'element-plus'
+import { useUserStore } from "@/stores/modules/user";
+import { getMaintainrecordList } from "@/api/modules/allData";
+import { parseTime } from '@/utils/index';
+import { ElMessage } from "element-plus";
+import { getNextDayMidnight, isWithinThirtyMinutes, getTimeStamp, getStamp, isWithin24Hours, isDateFuture, isDateRangeWithinDays } from "@/utils/dateTime";
+
+const dateValue = ref<any>(parseTime(new Date(), '{y}-{m}-{d}'))
+
 const pageable = ref<any>({
+  as_code: '',
+  record_type: -1,
+  order: 0,
   pageNum: 1,
   pageSize: 20,
-  total: 1
+  total: 0
 });
+const shortcuts = [
+  {
+    text: '今天',
+    value: new Date(),
+  },
+  {
+    text: '昨天',
+    value: () => {
+      const date = new Date()
+      date.setTime(date.getTime() - 3600 * 1000 * 24)
+      return date
+    },
+  },
+  {
+    text: '一周前',
+    value: () => {
+      const date = new Date()
+      date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
+      return date
+    },
+  },
+]
 
-const queryParams = ref({
-  code: '',
-  type:'',
-  time:'',
-  pageNum: 1,
-  pageSize: 20,
-  total: 2
-});
+const disabledDate = (time: Date) => {
+  return time.getTime() > Date.now()
+}
+const type = [
+  {
+    value: -1,
+    label: '全部',
+  },
+  {
+    value: 0,
+    label: '检查',
+  },
+  {
+    value: 1,
+    label: '更换',
+  },
+  {
+    value: 2,
+    label: '维修',
+  }
+]
+
+const userStore = useUserStore();
+const platformList = ref<any>(computed(() => userStore.stations))
+const selectPlatform = ref()
+
+const getPlatforms = async () => {
+  pageable.value.as_code = platformList.value[0].as_code
+  selectPlatform.value = platformList.value[0]
+  getList()
+
+};
 
+const changeStation = () => {
+  // getHistoryList()
+}
 // 查询功能
 const handleQuery = () => {
-  queryParams.value.pageNum = 1;
+  pageable.value.pageNum = 1;
+  getList();
+
 };
 
-//搜索功能
+//重置功能
 const resetQuery = () => {
-  queryParams.value.pageNum = 1;
+  dateValue.value = parseTime(new Date(), '{y}-{m}-{d}')
+  pageable.value.as_code = platformList.value[0].as_code
+  pageable.value.pageNum = 1;
+  pageable.value.record_type = -1
+  pageable.value.order = 0
+  pageable.value.pageSize = 20
+  pageable.value.total = 0
+  getList();
 };
 
 /**
@@ -172,7 +234,8 @@ const resetQuery = () => {
  * @return void
  * */
 const handleSizeChange = (val: number) => {
-  console.log(val);
+  pageable.value.pageSize = val
+  getList();
 };
 
 /**
@@ -181,34 +244,36 @@ const handleSizeChange = (val: number) => {
  * @return void
  * */
 const handleCurrentChange = (val: number) => {
-  console.log(val);
+  pageable.value.pageNum = val
+  getList();
 };
+const processTableData = ref<any>([]);
+
+const getList = async () => {
+  console.log(parseTime(new Date(getNextDayMidnight(dateValue.value)), '{y}-{m}-{d}') + ' 00:00',parseTime(new Date(dateValue.value), '{y}-{m}-{d}') + ' 00:01');
+  
+  if (!dateValue.value) return ElMessage.error("请选择日期");
+
+  const { data } = await getMaintainrecordList({ ...pageable.value, as_code_list: [pageable.value.as_code], end_time: getStamp(parseTime(new Date(getNextDayMidnight(dateValue.value)), '{y}-{m}-{d}') + ' 00:00'), begin_time: getStamp(parseTime(new Date(dateValue.value), '{y}-{m}-{d}') + ' 00:01') })
+  pageable.value.total = data.total
+  processTableData.value = data.list
+
+  console.log(data);
+
+
+}
 
-const processTableData = ref([
-  {
-    id: "681913747276782417",
-    a: "便携式",
-    b: "B2023",
-    c: "江苏省无锡市滨湖区",
-    d: "检查",
-    e: "2024-09-14 12:56",
-    f: "2024-09-15 12:56",
-    g: "风向传感器检査 风速传感器检查",
-    h: "维护员2"
-  }
-]);
 
 // 表格配置项
 const columns = reactive<ColumnProps[]>([
-  { prop: "a", label: "站名" },
-  { prop: "b", label: "站号" },
-  { prop: "c", label: "站址" },
-  { prop: "d", label: "维护类型" },
-  { prop: "e", label: "维护开始日期" },
-  { prop: "f", label: "结束日期" },
-  { prop: "g", label: "工作内容",width:250 },
-  { prop: "h", label: "维护人", width:100},
-  { prop: "operation", label: "操作", width:150,align: 'center' }
+  { prop: "as_name", label: "站名" },
+  { prop: "as_code", label: "站号" },
+  { prop: "maintain_mode", label: "维护类型" },
+  { prop: "begin_time_i", label: "维护开始日期" },
+  { prop: "end_time_i", label: "结束日期" },
+  { prop: "maintain_remarks", label: "工作内容", width: 250 },
+  { prop: "maintain_people", label: "维护人", width: 100 },
+  { prop: "operation", label: "操作", width: 150, align: 'center' }
 ]);
 
 const dialog = reactive<any>({
@@ -233,14 +298,14 @@ const initFormData = ref<any>(
     code: "",
     type: "",
     name: "",
-    startTime:"",
-    endTime:"",
+    startTime: "",
+    endTime: "",
     remark: ""
   }
 );
 
 
-const form = ref<any>({...initFormData});
+const form = ref<any>({ ...initFormData });
 
 /** 新增按钮操作 */
 const handleAdd = () => {
@@ -282,7 +347,7 @@ const handleDelete = async (row?: any) => {
     confirmButtonText: '删除',
     cancelButtonText: '取消',
     type: 'warning',
-    title:'删除数据',
+    title: '删除数据',
     draggable: true
   })
     .then(() => {
@@ -292,5 +357,7 @@ const handleDelete = async (row?: any) => {
 
     })
 }
-
+onMounted(() => {
+  getPlatforms()
+})
 </script>

+ 26 - 23
src/views/system/disposition/components/distributionAutomatic.vue

@@ -6,7 +6,7 @@
         <div class="header-button-lf">
           <el-form :model="queryParams" label-width="auto"  :inline="true">
             <el-form-item>
-              <el-button  style="margin-left: 10px" type="primary" plain  @click="handleAdd"> 新增 </el-button>
+              <!-- <el-button  style="margin-left: 10px" type="primary" plain  @click="handleAdd"> 新增 </el-button> -->
             </el-form-item>
           </el-form>
         </div>
@@ -21,7 +21,14 @@
         <template v-for="item in columns" :key="item">
           <el-table-column v-bind="item" :align="item.align ?? 'left'" :reserve-selection="item.type == 'selection'" :show-overflow-tooltip="true">
             <template #default="scope">
-              <template v-if="item.prop === 'operation'">
+              <template v-if="item.prop === 'ftp_type'">
+                <div>{{ scope.row.ftp_type == 1 ? '自动下载' : '自动上传' }}</div>
+              </template>
+              <template v-if="item.prop === 'use_able'">
+                <div>{{ scope.row.use_able == 1 ? '启用' : '停用' }}</div>
+              </template>
+
+              <!-- <template v-if="item.prop === 'operation'">
                 <el-tooltip
                   class="box-item"
                   effect="dark"
@@ -46,7 +53,7 @@
                     </el-icon>
                   </el-button>
                 </el-tooltip>
-              </template>
+              </template> -->
             </template>
           </el-table-column>
         </template>
@@ -109,12 +116,11 @@
 import { ref, reactive,onMounted } from "vue";
 import { ColumnProps } from "@/components/ProTable/interface";
 import { ElMessageBox } from 'element-plus'
-onMounted(() => {
-
-});
+import { getFTPAllSysItem } from "@/api/modules/allData";
 
 
 const queryParams = ref({
+  pageNum: 1,
 });
 
 // 查询功能
@@ -128,26 +134,20 @@ const resetQuery = () => {
 };
 
 
-const processTableData = ref([
-  // {
-  //   id: "681913747276782417",
-  //   a: "MySecureFTPServer",
-  //   b: "192.168.1.100",
-  //   c: "2121",
-  //   d: "ftpuser",
-  //   e: "15200,N,8,1",
-  //   f: "是"
-  // }
-]);
+const processTableData = ref<any>([]);
+const getList=async ()=>{
+  const {data}=await getFTPAllSysItem()
+  processTableData.value=data.list
 
+}
 // 表格配置项
 const columns = reactive<ColumnProps[]>([
-  { prop: "a", label: "FTP名称" },
-  { prop: "b", label: "FTP地址" },
-  { prop: "c", label: "FTP端口" },
-  { prop: "d", label: "FTP账号" },
-  { prop: "e", label: "FTP事务" },
-  { prop: "f", label: "是否启用" },
+  { prop: "ftp_name", label: "FTP名称" },
+  { prop: "ftp_ip", label: "FTP地址" },
+  { prop: "ftp_port", label: "FTP端口" },
+  { prop: "ftp_account", label: "FTP账号" },
+  { prop: "ftp_type", label: "FTP事务" },
+  { prop: "use_able", label: "是否启用" },
   { prop: "operation", label: "操作", width:150,align: 'center' }
 ]);
 
@@ -234,6 +234,9 @@ const handleDelete = async (row?: any) => {
 
     })
 }
+onMounted(() => {
+  getList()
+});
 
 </script>
 

+ 28 - 20
src/views/system/disposition/components/serviceBeidou.vue

@@ -6,7 +6,7 @@
         <div class="header-button-lf">
           <el-form :model="queryParams" label-width="auto"  :inline="true">
             <el-form-item>
-              <el-button  style="margin-left: 10px" type="primary" plain  @click="handleAdd"> 新增 </el-button>
+              <!-- <el-button  style="margin-left: 10px" type="primary" plain  @click="handleAdd"> 新增 </el-button> -->
             </el-form-item>
           </el-form>
         </div>
@@ -21,7 +21,10 @@
         <template v-for="item in columns" :key="item">
           <el-table-column v-bind="item" :align="item.align ?? 'left'" :reserve-selection="item.type == 'selection'" :show-overflow-tooltip="true">
             <template #default="scope">
-              <template v-if="item.prop === 'operation'">
+              <template v-if="item.prop === 'bd_type'">
+                <div>{{ scope.row.bd_type == 0 ? '北斗普通机' : scope.row.bd_type == 1 ? '北斗指挥机' : scope.row.bd_type == 2 ? '北斗授时模块' :  '其他'}}</div>
+              </template>
+              <!-- <template v-if="item.prop === 'operation'">
                 <el-tooltip
                   class="box-item"
                   effect="dark"
@@ -46,7 +49,7 @@
                     </el-icon>
                   </el-button>
                 </el-tooltip>
-              </template>
+              </template> -->
             </template>
           </el-table-column>
         </template>
@@ -104,13 +107,25 @@
 </template>
 
 <script setup lang="ts">
-import { ref, reactive } from "vue";
+import { ref, reactive,onMounted } from "vue";
 import { ColumnProps } from "@/components/ProTable/interface";
 import { ElMessageBox } from 'element-plus'
+import { getBeidouAllSysItem } from "@/api/modules/allData";
+
 
 const queryParams = ref({
+  pageNum: 1,
+  pageSize: 20
 });
 
+const processTableData=ref<any>([])
+const getList=async ()=>{
+  const {data}=await getBeidouAllSysItem()
+  processTableData.value=data.list
+
+ 
+}
+
 // 查询功能
 const handleQuery = () => {
   queryParams.value.pageNum = 1;
@@ -122,24 +137,15 @@ const resetQuery = () => {
 };
 
 
-const processTableData = ref([
-  // {
-  //   id: "681913747276782417",
-  //   a: "458789",
-  //   b: "北斗指挥机",
-  //   c: "2.5协议",
-  //   d: "/dev/ttyAMAO",
-  //   e: "15200,N,8,1"
-  // }
-]);
+
 
 // 表格配置项
 const columns = reactive<ColumnProps[]>([
-  { prop: "a", label: "北斗号" },
-  { prop: "b", label: "型号" },
-  { prop: "c", label: "协议" },
-  { prop: "d", label: "串口号" },
-  { prop: "e", label: "连接参数" },
+  { prop: "bd_code", label: "北斗号" },
+  { prop: "bd_type", label: "型号" },
+  { prop: "bd_serial", label: "协议" },
+  { prop: "bd_codec", label: "串口号" },
+  { prop: "bd_params", label: "连接参数" },
   { prop: "operation", label: "操作", width:150,align: 'center' }
 ]);
 
@@ -222,7 +228,9 @@ const handleDelete = async (row?: any) => {
 
     })
 }
-
+onMounted(()=>{
+  getList()
+})
 </script>
 
 <style scoped>