daiht 3 nedēļas atpakaļ
vecāks
revīzija
88a6b38b27

BIN
dist.zip


+ 17 - 1
src/api/modules/allData.ts

@@ -37,7 +37,7 @@ export const getYallSensorList = () => {
 };
 
 
-//查询观测要素
+//查询工况数据
 export const getStaitemList = (params:{}) => {
   return http.post<ResPage<any>>(PORT1 + `/querystaitem`,params);
 };
@@ -47,3 +47,19 @@ export const getStaitemList = (params:{}) => {
 export const getQuerCertList = (params:{}) => {
   return http.post<ResPage<any>>(PORT1 + `/queryascalinfolist`,params);
 };
+
+// 统计到报率
+export const getArriveList = (params:{}) => {
+  return http.post<ResPage<any>>(PORT1 + `/censusdataarrive`,params);
+};
+
+// 统计自动站定检证书
+export const getCertificateList = () => {
+  return http.post<ResPage<any>>(PORT1 + `/censusascalinfomap`);
+};
+
+// 获取FTP链接状态
+export const getFTPList = () => {
+  return http.post<ResPage<any>>(PORT1 + `/censusftpstate`);
+};
+

+ 250 - 45
src/views/alarm/allDevice/index.vue

@@ -3,14 +3,13 @@
 		<div class="card table-search" style="overflow: hidden;">
 			<el-form ref="formRef" :model="pageable" :inline="true" label-width="auto">
 				<el-form-item label="所属基地:" prop="base">
-					<el-select v-model="pageable.base" placeholder="请选择" style="width: 200px">
-						<el-option v-for="item in baseList" :key="item.value" :label="item.label"
-							:value="item.value" />
+					<el-select v-model="pageable.base" placeholder="请选择" style="width: 200px" @change="changeBase">
+						<el-option v-for="item in baseList" :key="item.value" :label="item.label" :value="item.value" />
 					</el-select>
 				</el-form-item>
 				<el-form-item>
 					<div>
-						<el-button type="primary">查询</el-button>
+						<el-button type="primary" @click="handleSearch">查询</el-button>
 						<el-button plain @click="resetForm(formRef)">重置</el-button>
 					</div>
 				</el-form-item>
@@ -24,7 +23,10 @@
 							<span>设备工况(单位:台)</span>
 						</div>
 						<div class="mt5">
-							<div ref="device" class="ve-ring" style="height: 200px"></div>
+							<div ref="device" class="ve-ring" style="height: 200px" v-if="stateList"></div>
+							<div v-else
+								style="height: 200px; display: flex; justify-content: center; align-items: center; font-size: 20px;">
+								暂无数据</div>
 						</div>
 					</div>
 				</el-col>
@@ -47,11 +49,11 @@
 							<div class="FTP_box" style="height: 200px">
 								<div class="FTP_item">
 									<img src="@/assets/images/centerStation.png" alt="">
-									<div>中心站FTP</div>
+									<div>正常FTP({{ FTPList && FTPList.true ? FTPList?.true.length : 0 }})</div>
 								</div>
-								<div class="FTP_item">
+								<div class="FTP_item" @click="gotoFTP" >
 									<img src="@/assets/images/areaStation.png" alt="">
-									<div>中心站FTP</div>
+									<div>异常FTP({{ FTPList && FTPList.false ? FTPList?.false.length : 0 }})</div>
 								</div>
 							</div>
 						</div>
@@ -97,13 +99,23 @@
 
 <script setup lang="ts" name="allDevice">
 import * as echarts from 'echarts';
-import { isToday, isWithinThirtyMinutes, getTimeStamp, getStamp, isDateFuture, isDateRangeWithinDays,groupByType } from "@/utils/dateTime";
+import { isToday, isWithinThirtyMinutes, getTimeStamp, getStamp, isDateFuture, isDateRangeWithinDays, groupByType } from "@/utils/dateTime";
 import { ElMessage } from "element-plus";
 import { useGlobalStore } from "@/stores/modules/global";
-import { ref, computed, onMounted, reactive, watch, onDeactivated, onActivated } from "vue";
-import { getDataItemList, getPlatformList, getRgDataList, getTacRecordList } from "@/api/modules/allData";
+import { ref, computed, onMounted, reactive, watch, onDeactivated, onActivated, nextTick } from "vue";
+import { getDataItemList, getPlatformList, getRgDataList, getTacRecordList, getFTPList, getCertificateList, getStaitemList, getArriveList } from "@/api/modules/allData";
 import { Platform } from "@/api/interface";
 import { parseTime } from '@/utils/index';
+import {  useRouter } from "vue-router";
+const router = useRouter();
+const gotoFTP = () => {
+	router.push({
+        path: '/system/disposition',
+        query: {
+			status:'2',
+		}
+    })
+}
 // 查询自动站列表
 const queryas = ref<Platform>({
 	pageSize: 5000,
@@ -113,34 +125,57 @@ const queryas = ref<Platform>({
 const pageable = ref({
 	data_type: true,
 	time_order: 1,
+	time_space: 1,
 	base: undefined,
-	as_code: undefined,
-	data_items: [],
+	as_code_list: [],
 	pageNum: 1,
-	pageSize: 20,
-	total: 0
+	pageSize: 999,
 });
 
 const platformList = ref<any>([])
-const baseList=ref<any>([])
+const baseList = ref<any>([])
 const selectPlatform = ref()
 
 const getPlatforms = async () => {
 	const { data } = await getPlatformList(queryas.value);
 	platformList.value = data.list
-	baseList.value=groupByType(data.list)
+	baseList.value = groupByType(data.list)
 
-	
 
-	pageable.value.base = baseList.value[1].value
-	selectPlatform.value = baseList.value[1]
+
+
+
+	pageable.value.base = baseList.value[0].value
+	pageable.value.as_code_list = baseList.value[0].children
+	selectPlatform.value = baseList.value[0]
+	// getDeviceStatus()
+	// getArrive()
 	// getHistoryList()
 
 };
 
-const changeStation = () => {
+const changeBase = (e) => {
+
+
+	const item = baseList.value.find(item => item.value === e);
+	pageable.value.as_code_list = item.children
+
+	// getCertificate()
+	// getFTP()
+	// getDeviceStatus()
+	// getArrive()
 	// getHistoryList()
 }
+watch(() => pageable.value.as_code_list, (newValue, oldValue) => {
+	if (newValue) {
+		weatherInfo()
+		getCertificate();
+		getFTP();
+		getDeviceStatus();
+		getArrive();
+		// getHistoryList();
+	}
+});
 
 const formRef = ref()
 const device = ref()
@@ -155,8 +190,160 @@ const searchParam = reactive({
 
 })
 
+// 获取到报监控
+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}') + ' 00:00') })
+	arriveTime.value = Object.keys(data)
+
+	const arr = <any>{ aa: [], bb: [], cc: [] }
+	arriveTime.value?.forEach((item, index) => {
+		arr.aa.push(pageable.value.as_code_list.length)
+		arr.bb.push(data[item].length)
+		arr.cc.push(pageable.value.as_code_list.length - data[item].length)
+	});
+	arriveList.value = arr
+
+	nextTick(() => {
+		showControl()
+	})
+
+	// arriveList.value=data
+};
 
 
+// 查询危险天气
+const dataTypeList = [
+	{
+		value: 0,
+		label: '能见度',
+	},
+	{
+		value: 1,
+		label: '风速',
+	},
+	{
+		value: 2,
+		label: '大气电场',
+	}, {
+		value: 3,
+		label: '云量',
+	}, {
+		value: 4,
+		label: '云高',
+	}, {
+		value: 5,
+		label: '温度',
+	}, {
+		value: 6,
+		label: '湿度',
+	}, {
+		value: 7,
+		label: '小时雨量',
+	}
+]
+const wertherColumns = ref<any>({
+	tact_state_on: true,
+	tact_data_on: false,
+	tact_state: 0,
+	// tact_state: 0,
+	// tact_data: 0,
+	pageNum: 1,
+	pageSize: 999,
+
+});
+
+
+const weatherInfoArr = ref()
+const dangetWeatherNum = ref(0)
+const weatherNormal=ref()
+const weatherWarning=ref()
+const weatherInfo = async () => {
+	const { data } = await getTacRecordList({ ...wertherColumns.value, as_code_list: pageable.value.as_code_list });
+	dangetWeatherNum.value = [...new Set(data.list?.map(obj => obj.as_code))].length
+	weatherInfoArr.value = data.list
+	const arr1=<any>[]
+	const arr2=<any>[]
+	for(let i=0;i<8;i++){
+		arr1.push(pageable.value.as_code_list.length)	
+		arr2.push(0)
+	}
+
+	data.list?.forEach((item, index) => {
+		arr1[item.data_type]--
+		arr2[item.data_type]++
+	})
+	weatherNormal.value=arr1
+	weatherWarning.value=arr2
+	
+	nextTick(() => {
+		showWeather()
+		showElement()
+	})
+};
+
+// 获取自动站定检证书
+const certificateList = ref<any>({})
+const getCertificate = async () => {
+	const { data } = await getCertificateList()
+	certificateList.value.a = data[0]?.length || 0
+	certificateList.value.b = data[1]?.length || 0
+	certificateList.value.c = data[2]?.length || 0
+
+	nextTick(() => {
+		showPeriod()
+
+	})
+
+	// certificateList.value=data.list
+};
+
+// 获取FTP链路
+const FTPList = ref<any>({})
+const getFTP = async () => {
+	const { data } = await getFTPList()
+	FTPList.value = data
+
+
+};
+
+
+// 获取设备工况
+const stateList = ref<any>()
+const getDeviceStatus = async () => {
+	const { data } = await getStaitemList(pageable.value);
+	const state = { normal: 0, warning: 0, error: 0 }
+
+	data?.list?.forEach(item => {
+		const staList = item.sta_list;
+		staList.forEach(sta => {
+			if (sta.state === 0) {
+				state.normal++;
+			} else if (sta.state === 2) { // 注意:你的要求中提到了state为2的个数,但原始数据中并没有state为2的例子,这里我假设你需要统计它  
+				state.warning++;
+			} else if (sta.state === 3) {
+				state.error++;
+			}
+			// 对于其他state值,这里不做处理,如果需要可以添加额外的条件分支  
+		});
+
+
+	});
+
+	stateList.value = state
+	nextTick(() => {
+		showDevice()
+	})
+};
+
+const handleSearch = () => {
+	getArrive()
+	weatherInfo()
+	getCertificate()
+	getFTP()
+	getDeviceStatus()
+}
 // resetForm
 const resetForm = (formEl) => {
 	if (!formEl) return;
@@ -166,7 +353,7 @@ const globalStore = useGlobalStore();
 const isDark = computed(() => globalStore.isDark);
 
 const showDevice = () => {
-	// console.log(isDark.value,'颜色');
+
 
 	let mychart = echarts.init(device.value);
 	let option = {
@@ -175,7 +362,7 @@ const showDevice = () => {
 			formatter: "{a} <br/>{b}: {c}台"
 		},
 		legend: {
-			bottom: '1%',
+			bottom: '0%',
 			left: 'center',
 			textStyle: {//图例文字的样式
 				color: isDark.value ? '#fff' : "#000",
@@ -185,7 +372,7 @@ const showDevice = () => {
 			{
 				name: '设备工况',
 				type: 'pie',
-				radius: ['50%', '70%'],
+				radius: ['50%', '68%'],
 				center: ['50%', '45%'],
 				hoverAnimation: false,
 				itemStyle: {
@@ -213,7 +400,7 @@ const showDevice = () => {
 				labelLine: {
 					normal: {
 						show: true,//开启提示线展示
-						length: 15,//设置第一条提示线长度
+						length: 10,//设置第一条提示线长度
 						length2: 30,//设置第二条提示线长度
 
 					}
@@ -221,16 +408,22 @@ const showDevice = () => {
 
 				data: [
 					{
-						value: 4,
+						value: stateList.value ? stateList.value.normal : 0,
 						name: '正常',
 						itemStyle: { color: '#00C4B3' },
 						label: { color: '#00C4B3' }
 					},
 					{
-						value: 1,
+						value: stateList.value ? stateList.value.warning : 0,
 						name: '告警',
 						itemStyle: { color: '#EF6666' },
 						label: { color: '#EF6666' }
+					},
+					{
+						value: stateList.value ? stateList.value.error : 0,
+						name: '故障',
+						itemStyle: { color: '#FAC858' },
+						label: { color: '#FAC858' }
 					}
 				]
 			}
@@ -260,13 +453,21 @@ const showPeriod = () => {
 			{
 				name: '检定周期',
 				type: 'pie',
-				radius: '70%',
+				radius: '65%',
 				center: ['50%', '45%'],
+				label: {
+					normal: {
+						show: true,
+						position: 'outer',
+						formatter: '{b}:{c}',
+						fontSize: 14,
+					},
+				},
 
 				data: [
-					{ value: 3, name: '剩余31-60天', itemStyle: { color: '#5470C6' } },
-					{ value: 1, name: '剩余1-30天', itemStyle: { color: '#FAC858' } },
-					{ value: 1, name: '已过检', itemStyle: { color: '#EF6666' } }
+					{ value: certificateList.value.a ? certificateList.value.a : 0, name: '剩余31-60天', itemStyle: { color: '#5470C6' } },
+					{ value: certificateList.value.b ? certificateList.value.b : 0, name: '剩余1-30天', itemStyle: { color: '#FAC858' } },
+					{ value: certificateList.value.c ? certificateList.value.c : 0, name: '已过检', itemStyle: { color: '#EF6666' } }
 				],
 				emphasis: {
 					itemStyle: {
@@ -290,7 +491,7 @@ const showWeather = () => {
 	let mychart = echarts.init(weather.value);
 	let option = {
 		title: {
-			text: `${allSataion.value} \n 总站数 `,
+			text: `${pageable.value.as_code_list.length} \n 总站数 `,
 			left: "center",
 			top: "38%",
 			textStyle: {
@@ -349,13 +550,13 @@ const showWeather = () => {
 
 				data: [
 					{
-						value: 4,
+						value: pageable.value.as_code_list.length - dangetWeatherNum.value,
 						name: '正常',
 						itemStyle: { color: '#5470C6' },
 						label: { color: '#5470C6' }
 					},
 					{
-						value: 1,
+						value: dangetWeatherNum.value,
 						name: '告警',
 						itemStyle: { color: '#EF6666' },
 						label: { color: '#EF6666' }
@@ -418,7 +619,7 @@ const showElement = () => {
 				itemStyle: {
 					color: '#5470C6'
 				},
-				data: [5, 5, 5, 5, 4, 5, 5, 5]
+				data: weatherNormal.value
 			},
 			{
 				name: '告警',
@@ -431,7 +632,7 @@ const showElement = () => {
 				itemStyle: {
 					color: '#EF6666'
 				},
-				data: [0, 0, 0, 0, 1, 0, 0, 0]
+				data: weatherWarning.value
 			}
 		]
 	};
@@ -465,7 +666,7 @@ const showControl = () => {
 		xAxis: [
 			{
 				type: 'category',
-				data: ['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00']
+				data: arriveTime.value
 			}
 		],
 		yAxis: [
@@ -485,7 +686,7 @@ const showControl = () => {
 				itemStyle: {
 					color: '#3BA272' // 蓝色
 				},
-				data: [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6]
+				data: arriveList.value.aa.length ? arriveList.value.aa : [],
 			},
 			{
 				name: '实报情况',
@@ -497,7 +698,7 @@ const showControl = () => {
 				itemStyle: {
 					color: '#5470C6' // 绿色
 				},
-				data: [5, 4, 1, 2, 5, 5, 5, 5, 5, 5, 4, 5, 5, 5, 5, 5, 5, 4, 5, 5, 5, 5, 5, 5]
+				data: arriveList.value.bb.length ? arriveList.value.bb : [],
 			},
 			{
 				name: '未报情况',
@@ -509,7 +710,7 @@ const showControl = () => {
 				itemStyle: {
 					color: '#EF6666' // 红色
 				},
-				data: [1, 2, 5, 4, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1]
+				data: arriveList.value.cc.length ? arriveList.value.cc : [],
 			},
 
 		]
@@ -523,12 +724,16 @@ const showControl = () => {
 watch(isDark, () => { showDevice(), showPeriod(), showWeather(), showElement(), showControl() });
 
 onMounted(() => {
+
+
+	getFTP()
+	getCertificate()
 	getPlatforms()
-	showDevice()
-	showPeriod()
-	showWeather()
-	showElement()
-	showControl()
+	// showDevice()
+	// showPeriod()
+	// showWeather()
+	// showElement()
+	// showControl()
 
 })
 

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

@@ -1253,7 +1253,7 @@ const getHistoryList = async () => {
 		}
 		return acc;
 	}, []);
-	const { data } = await getDataItemList({ ...pageable.value, pageSize: 99, as_code_list: [pageable.value.as_code], data_items: historyColumns, data_type: false, begin_time: getTimeStamp(timeValue.value, dataItemInfo.value.data_time_i), end_time: getTimeStamp(timeValue.value == 1 ? 0 : 4, dataItemInfo.value.data_time_i), time_space: timeValue.value == 1 ? 1 : 60 });
+	const { data } = await getDataItemList({ ...pageable.value, pageSize: 999, as_code_list: [pageable.value.as_code], data_items: historyColumns, data_type: false, begin_time: getTimeStamp(timeValue.value, dataItemInfo.value.data_time_i), end_time: getTimeStamp(timeValue.value == 1 ? 0 : 4, dataItemInfo.value.data_time_i), time_space: timeValue.value == 1 ? 1 : 60 });
 	timeArr.value = data.list?.map(item => {
 		return formatDate(item.data_time_i, 1)
 	})
@@ -1842,105 +1842,7 @@ const showWindSpeed = () => {
 
 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: {

+ 2 - 16
src/views/analysis/dataSynthesis/index.vue

@@ -129,7 +129,7 @@ const handleDateChange = async (e) => {
 				await handleDateRangeChange(e)
 				getHistoryList()
 			} else {
-				ElMessage.error("模式下时间间隔不能大于7天");
+				ElMessage.error("正点模式下时间间隔不能大于7天");
 			}
 		}
 	}
@@ -138,24 +138,10 @@ const pickDay = ref()
 const handleFocus = () => {
 	pickDay.value = null
 }
-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 {
-		if (pickDay.value) {
-			return (
-				time.getTime() < pickDay.value.getTime() - limitTime ||
-				time.getTime() > pickDay.value.getTime() + limitTime ||
-				time.getTime() > Date.now() - 8.64e6
-			)
-		} else {
-			return time.getTime() > Date.now() - 8.64e6
-		}
-	}
 }
 const handleChange = (val: Date[]) => {
 	const [pointDay] = val

+ 326 - 103
src/views/analysis/featureCurves/index.vue

@@ -2,7 +2,7 @@
 	<div class="table-box">
 		<div class="card table-search" style="overflow: hidden;display: flex;justify-content: space-between;">
 			<el-form ref="formRef" :model="searchParam" :inline="true" label-width="auto">
-				<el-form-item label="自动站:" prop="base">
+				<el-form-item label="自动站:" prop="as_code">
 					<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"
@@ -21,16 +21,15 @@
 						<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>
 				</el-form-item>
 				<el-form-item>
 					<div>
-						<el-button type="primary">查询</el-button>
+						<el-button type="primary" @click="getHistoryList">查询</el-button>
 						<el-button plain @click="resetForm(formRef)">重置</el-button>
 					</div>
 				</el-form-item>
@@ -44,7 +43,8 @@
 		</div>
 		<div class="main_list">
 			<el-row :gutter="15">
-				<el-col :xs="24" :sm="12" :md="8" :lg="8">
+				<template v-if="array.length>0">
+					<el-col :xs="24" :sm="12" :md="8" :lg="8">
 					<div class="chart_item zhuti">
 						<div style="font-weight: bold;" class="item_title">
 							<span>2分钟平均风向 ( ° )/2分钟平均风速 ( m/s )</span>
@@ -54,43 +54,29 @@
 						</div>
 					</div>
 				</el-col>
-				<el-col :xs="24" :sm="12" :md="8" :lg="8">
+				<el-col :xs="24" :sm="12" :md="8" :lg="8" v-for="(item, index) in array" :key="item.data_id">
 					<div class="chart_item zhuti">
 						<div style="font-weight: bold;" class="item_title">
-							<span>总辐射曝辐量 ( MJ/㎡ )</span>
+							<span>{{ item.data_name }} ( {{ item.data_unit ? item.data_unit : '' }} )</span>
 						</div>
 						<div class="mt5">
-							<div ref="radio" class="ve-ring" style="height: 330px"></div>
+							<div :id="'Access' + index" class="ve-ring" style="height: 330px"></div>
 						</div>
 					</div>
 				</el-col>
-				<el-col :xs="24" :sm="12" :md="8" :lg="8">
-					<div class="chart_item zhuti">
-						<div style="font-weight: bold;" class="item_title">
-							<span>本站气压 ( hPa )</span>
-						</div>
-						<div class="mt5">
-							<div ref="pressureLine" class="ve-ring" style="height: 330px"></div>
-						</div>
-					</div>
-				</el-col>
-			</el-row>
-			<el-row :gutter="15">
-				<el-col :span="24">
+
+				</template>
+				<el-col :span="24" v-else>
 					<div class="chart_item zhuti">
-						<div style="font-weight: bold;" class="item_title">
-							<span>总辐射辐照度 ( W/㎡ )</span>
-						</div>
-						<div class="mt5">
-							<div ref="radio2" class="ve-ring" style="height: 340px"></div>
-						</div>
+						<el-empty description="暂无数据" />
 					</div>
 				</el-col>
+
 			</el-row>
 		</div>
 		<!-- 添加或修改岗位对话框 -->
-		<el-dialog :title="dialog.title" v-model="dialog.visible" width="940px" append-to-body>
-			<div style="height: 500px">
+		<el-dialog :title="dialog.title" v-model="dialog.visible" width="1200px" append-to-body>
+			<div style="height: 500px;display: flex">
 				<el-tabs tab-position="left" class="demo-tabs" style="height: 100%">
 					<el-tab-pane label="风">
 						<div class="container-tag">
@@ -228,6 +214,21 @@
 						</div>
 					</el-tab-pane>
 				</el-tabs>
+				<div class="selected-list-box">
+					<div class="disposition-title" style="margin-top: 0px">已选要素</div>
+					<div class="selected-list-c">
+						<template v-for="(item, index) in copiedCustomizeColumns" :key="item.id">
+							<div :class="selectedItemIndex === index ? 'selected-item-tag-active' : 'selected-item-tag'"
+								@click="changeSelected(index)">{{ item.data_name }}</div>
+						</template>
+					</div>
+					<div class="button-container">
+						<el-button type="primary" plain class="top-left" @click="changeMoveUp">上移</el-button>
+						<el-button type="primary" plain class="top-right" @click="changeMoveDown">下移</el-button>
+						<el-button type="primary" plain class="bottom-left" @click="changeRemove">移除</el-button>
+						<el-button type="primary" plain class="bottom-right" @click="changeCleared">清空</el-button>
+					</div>
+				</div>
 			</div>
 			<template #footer>
 				<div class="dialog-footer">
@@ -243,17 +244,19 @@
 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 } 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) => {
 	if (!e) {
 		dateRange.value = [parseTime(getTimeStamp(1), '{y}-{m}-{d} {h}:{i}'), parseTime(new Date(), '{y}-{m}-{d} {h}:{i}')]
 	}
+	getHistoryList()
 }
 const handleDateRangeChange = (newVal) => {
 	const [startDate, endDate] = newVal;
@@ -274,20 +277,25 @@ const handleDateRangeChange = (newVal) => {
 	}
 };
 const handleDateChange = async (e) => {
-
-	if (!value1.value) {
-		if (isWithinThirtyMinutes(e[0], e[1])) {
-			// 获取参数
-			getHistoryList()
-
+	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 {
-			ElMessage.error("分钟模式下时间间隔不能大于3小时");
+			if (isDateRangeWithinDays(e[0], e[1], 7)) {
+				await handleDateRangeChange(e)
+				getHistoryList()
+			} else {
+				ElMessage.error("正点模式下时间间隔不能大于7天");
+			}
 		}
-	} else {
-		await handleDateRangeChange(e)
-		getHistoryList()
-
-
 	}
 }
 const pickDay = ref()
@@ -297,19 +305,7 @@ const handleFocus = () => {
 const limitTime = 1000 * 60 * 60 * 24 * 6
 
 const disabledDate = (time: Date) => {
-	if (!value1.value) {
-		return time.getTime() > Date.now() - 8.64e6
-	} else {
-		if (pickDay.value) {
-			return (
-				time.getTime() < pickDay.value.getTime() - limitTime ||
-				time.getTime() > pickDay.value.getTime() + limitTime ||
-				time.getTime() > Date.now() - 8.64e6
-			)
-		} else {
-			return time.getTime() > Date.now() - 8.64e6
-		}
-	}
+	return time.getTime() > Date.now() - 8.64e6
 }
 const handleChange = (val: Date[]) => {
 	const [pointDay] = val
@@ -328,10 +324,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;
 };
 
@@ -476,11 +472,68 @@ let customizeColumns = ref<any>([
 		data_condition: 0
 	}
 ]);
-const copiedCustomizeColumns = ref<any>([...customizeColumns.value]);
+
 const getAllRgDataList = async () => {
 	const { data } = await getRgDataList();
 	elementList.value = data.list
 };
+const copiedCustomizeColumns = ref<any>([...customizeColumns.value]);
+const sensorList = ref<any>([])
+// 被选中当条数据下标
+const selectedItemIndex = ref(0)
+
+
+const changeMoveUp = () => {
+	//上移
+	if (selectedItemIndex.value > 0) {
+		const temp = copiedCustomizeColumns.value[selectedItemIndex.value - 1]
+		copiedCustomizeColumns.value[selectedItemIndex.value - 1] = copiedCustomizeColumns.value[selectedItemIndex.value]
+		copiedCustomizeColumns.value[selectedItemIndex.value] = temp
+		selectedItemIndex.value--
+	}
+}
+
+const changeMoveDown = () => {
+	//下移
+	if (selectedItemIndex.value < copiedCustomizeColumns.value.length - 1) {
+		const temp = copiedCustomizeColumns.value[selectedItemIndex.value + 1]
+		copiedCustomizeColumns.value[selectedItemIndex.value + 1] = copiedCustomizeColumns.value[selectedItemIndex.value]
+		copiedCustomizeColumns.value[selectedItemIndex.value] = temp
+		selectedItemIndex.value++
+	}
+}
+
+const changeRemove = () => {
+	//删除数据
+	if (copiedCustomizeColumns.value.length > 0) {
+		const custom = copiedCustomizeColumns.value[selectedItemIndex.value];
+		const se_type = custom.se_type
+		for (let i = 0; i < sensorList.value.length; i++) {
+			if (sensorList.value[i].se_type === se_type) {
+				sensorList.value[i].isSelected = false;
+			}
+		}
+		copiedCustomizeColumns.value.splice(selectedItemIndex.value, 1)
+		if (selectedItemIndex.value === copiedCustomizeColumns.value.length) {
+			selectedItemIndex.value--
+		}
+
+	}
+}
+
+const changeCleared = () => {
+	//清空所有数据
+	selectedItemIndex.value = 0
+	copiedCustomizeColumns.value = []
+	for (let i = 0; i < sensorList.value.length; i++) {
+		sensorList.value[i].isSelected = false;
+	}
+}
+
+const changeSelected = (index) => {
+	selectedItemIndex.value = index
+}
+
 // 要素的选中和取消
 const toggleSelection = (item) => {
 	item.isSelected = !item.isSelected
@@ -537,14 +590,7 @@ const searchParam = reactive({
 	switch: true
 
 })
-const baseOptions = ref([{
-	value: 0,
-	label: 'M1986',
-},
-{
-	value: 1,
-	label: 'M1987',
-}])
+
 const dialog = reactive<any>({
 	visible: false,
 	title: ''
@@ -553,8 +599,8 @@ const dialog = reactive<any>({
 
 
 const pageable = ref({
-	data_type: true,
-	time_order: 0,
+	data_type: false,
+	time_order: 1,
 	as_code: undefined,
 	data_items: [],
 	pageNum: 1,
@@ -576,34 +622,59 @@ let historyColumns = [
 	},
 	{
 		data_r_table: "SHI_SHI_LIU_YAO_SU_SHU_JU",
-		data_id: 101,
-		data_type: "温湿度",
-		data_item: "QI_WEN",
-		data_name: "气温",
-		data_unit: "",
+		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: 106,
-		data_type: "温湿度",
-		data_item: "XIANG_DUI_SHI_DU",
-		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_id: 1203,
+		data_r_table: "SHI_SHI_FU_SHE_SHU_JU",
+		data_type: "总辐射",
+		data_name: "总辐射曝辐量",
+		data_item: "ZONG_FU_SHE_BAO_FU_LIANG",
+		data_unit: "MJ/m²",
+		data_h_table: "LI_SHI_FU_SHE_SHU_JU",
+		data_value: "",
+		data_order: 0,
 		data_condition: 0,
 		isSelected: true
 	},
+	{
+		data_id: 1202,
+		data_r_table: "SHI_SHI_FU_SHE_SHU_JU",
+		data_type: "总辐射",
+		data_name: "总辐射辐照度",
+		data_item: "ZONG_FU_SHE_FU_ZHAO_DU",
+		data_unit: "W/m²",
+		data_h_table: "LI_SHI_FU_SHE_SHU_JU",
+		data_value: "",
+		data_order: 0,
+		data_condition: 0,
+		isSelected: true
+	}
 ]
 
 // 查询自动站列表
 const queryas = ref<Platform>({
-	pageSize: 50,
+	pageSize: 5000,
 	pageNum: 1,
 	currentpage: 1
 })
@@ -640,28 +711,169 @@ function formatDate(timestamp, type) {
 	}
 }
 
+const array = ref<any>([])
+const Access = () => {
+	console.log(array.value, 'access');
+
+	array.value?.forEach((item, i) => {
+		// 获取最大值方法
+		function calMax(arr) {
+			let max = Math.max.apply(null, arr); // 获取最大值方法
+			let maxint = Math.ceil(max / 5); // 向上以5的倍数取整
+			let maxval = maxint * 5; // 最终设置的最大值
+			return maxval; // 输出最大值
+		}
+		// 获取最小值方法
+		function calMin(arr) {
+			let min = Math.min.apply(null, arr); // 获取最小值方法
+			return min
+		}
+		// 调用方法,获取数据的最大值&最小值
+		let maxData1 = calMax(item.value);
+		let minData1 = calMin(item.value);
+
+		let chartDom = document.getElementById("Access" + i);
+
+		if (chartDom) {
+			let myChart = echarts.init(chartDom);
+			let option;
+			option = {
+
+				grid: {
+					left: '10',
+					right: '10',
+					bottom: '3%',
+					top: 20,
+					containLabel: true
+				},
+
+				// X轴
+				xAxis: {
+					type: 'category',
+					splitLine: {
+						show: false
+					},
+					// boundaryGap: false,
+					axisTick: {
+						alignWithLabel: true, // true:标签位于刻度线正下方;false:标签位于2个刻度线中间
+					},
+					data: timeArr.value,
+					axisLabel: {
+						formatter: function (value) {
+							return value.replace(/ /g, '\n');
+						},
+					},
+				},
+				yAxis: {
+					min: minData1,
+					max: maxData1,
+					type: 'value'
+				},
+				// 鼠标悬浮提示
+				tooltip: {
+					trigger: "axis",
+				},
+				// 数据
+				series: [
+					{
+						data: item.value,
+						name: item.data_name,
+						type: "line",
+						smooth: true,
+						lineStyle: {
+							color: '#157aea',
+							width: 1,
+						},
+						itemStyle: {
+							normal: {
+								color: '#157aea'
+
+							},
+
+						}
+					},
+
+				]
+			};
+			myChart.setOption(option)
+			window.addEventListener("resize", function () {
+				myChart.resize();
+			});
+		}
 
+		// option && myChart.setOption(option);
+
+
+	})
+};
 const timeArr = ref()
+const windLineArr = ref() // 2分钟风速风向
 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 arr = [...customizeColumns.value, ...historyColumns].reduce((acc, item) => {
+		if (!acc.some(existingItem => existingItem.data_id === item.data_id)) {
+			acc.push(item);
+		}
+		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]) });
 	timeArr.value = data.list?.map(item => {
 		return formatDate(item.data_time_i, 1)
 	})
-	tempLineArr.value = data.list?.map(item => {
-		return item[101]
-	})
-	humidityLineArr.value = data.list?.map(item => {
-		return item[106]
+
+
+	// 初始化一个空对象来存储归类后的数据  
+	const resultMap = {};
+
+	// 遍历原数组  
+	data.list?.forEach(obj => {
+		obj.data_list.forEach(item => {
+			// 将data_value转换为数字  
+			const value = parseFloat(item.data_value);
+
+			// 初始化或更新resultMap中的对应项  
+			if (!resultMap[item.data_id]) {
+				resultMap[item.data_id] = {
+					data_id: item.data_id,
+					data_name: item.data_name,
+					data_unit: item.data_unit,
+					value: [value]
+				};
+			} else {
+				resultMap[item.data_id].value.push(value);
+			}
+		});
+	});
+	array.value = Object.values(resultMap);
+	nextTick(() => {
+		if (array.value.length>0) Access();
+	});
+	// console.log(array.value, 'array');
+
+
+
+	windLineArr.value = data.list?.map(item => {
+		return {
+			value: item[1],
+			symbolRotate: adjustValue(item[2]),
+			symbolRotateStr: item[2] === 'C' ? 0 : item[2]
+		}
 	})
-	pressureLineArr.value = data.list?.map(item => {
-		return item[202]
+	nextTick(()=>{
+		if (array.value.length>0) showWind()
 	})
-	showWind()
 };
-
+function adjustValue(value) {
+	if (value === 'C') {
+		return 0
+	} else if (value <= 180) {
+		return '-' + value;
+	} else {
+		return 360 - value;
+	}
+}
 const globalStore = useGlobalStore();
 const isDark = computed(() => globalStore.isDark);
 
@@ -677,7 +889,6 @@ const showWind = () => {
 		value: 4.1, //风速--数值大小--变量名不可变
 		symbolRotate: -45, //风向---旋转角度--变量名不可变
 		symbolRotateStr: '西南风' //风向中文--变量名可变(tooltip 提示随之修改)
-
 	}, {
 		value: 4.5,
 		symbolRotate: 45,
@@ -775,6 +986,16 @@ const showWind = () => {
 	},]
 	let mychart = echarts.init(wind.value);
 	let option = {
+		title: {
+			text: '暂无数据',
+			show: !timeArr.value ? true : false,
+			x: 'center',
+			y: 'center',
+			textStyle: {
+				fontSize: 14,
+				fontWeight: 'normal',
+			}
+		},
 
 		grid: {
 			left: '10',
@@ -793,9 +1014,9 @@ const showWind = () => {
 			axisTick: {
 				alignWithLabel: true, // true:标签位于刻度线正下方;false:标签位于2个刻度线中间
 			},
-			data: ['06/12 08:00', '06/12 09:00', '06/12 10:00', '06/12 11:00', '06/12 12:00', '06/12 13:00', '06/12 14:00', '06/12 15:00', '06/12 16:00', '06/12 17:00', '06/12 18:00', '06/12 19:00', '06/12 20:00', '06/12 21:00', '06/12 22:00', '06/12 23:00', '06/13 00:00', '06/13 01:00', '06/13 02:00', '06/13 03:00', '06/13 04:00', '06/13 05:00', '06/13 06:00', '06/13 07:00',],
+			data: timeArr.value,
 			axisLabel: {
-				interval: 4,
+				// interval: 4,
 				formatter: function (value) {
 					// if (value.index % 4 === 0) {
 					// 	return value.replace(/ /g, '\n');
@@ -827,16 +1048,15 @@ const showWind = () => {
 					"<br/>风速:" +
 					(params[0].value ? params[0].value : "--") +
 					"m/s<br/>风向:" +
-					(params[0].data ? params[0].data.symbolRotateStr : "--")
+					(params[0].data ? params[0].data.symbolRotateStr + '°' : "--")
 				return tip;
 			},
 		},
 		// 数据
 		series: [{
-			data: winArr,
+			data: windLineArr.value,
 			type: 'line',
 			smooth: true, //这句就是让曲线变平滑的
-			// symbol: "image://" + require("../../../assets/img/weather/wind.png"),
 			symbol: 'path://M4.866,0,0,15.193l4.866-4.449L9.738,15.2Z',
 			symbolSize: 11,
 			//折线样式
@@ -1116,10 +1336,13 @@ onMounted(() => {
 	getAllRgDataList()
 
 	getPlatforms()
-	showWind()
-	showPressureLine()
-	showRadio()
-	showRadio2()
+	nextTick(() => {
+		Access();
+	});
+	// showWind()
+	// showPressureLine()
+	// showRadio()
+	// showRadio2()
 
 })
 onActivated(() => {

+ 2 - 2
src/views/analysis/lightningArea/index.vue

@@ -16,8 +16,8 @@
 				</el-form-item>
 				<el-form-item label="观测时间:" prop="base">
 					<div>
-						<el-switch v-model="value1" @change="changetype" class="ml-2" inline-prompt active-text="正点"
-							inactive-text="分钟" style="margin-right: 10px;" />
+						<el-switch v-model="value1" @change="changetype" class="ml-2" inline-prompt active-text=""
+							inactive-text="小时" style="margin-right: 10px;" />
 						<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="开始时间"

+ 11 - 6
src/views/system/disposition/index.vue

@@ -1,20 +1,20 @@
 <template>
   <div class="main-box">
     <div class="card table-main">
-      <el-tabs tab-position="left" class="demo-tabs" style="height: 100%">
-        <el-tab-pane label="基本配置">
+      <el-tabs v-model="type1" tab-position="left" class="demo-tabs" style="height: 100%">
+        <el-tab-pane label="基本配置" name="1" >
           <configuration-basic></configuration-basic>
         </el-tab-pane>
-        <el-tab-pane label="数据自动分发">
+        <el-tab-pane label="数据自动分发" name="2">
           <distribution-automatic></distribution-automatic>
         </el-tab-pane>
-        <el-tab-pane label="北斗服务配置">
+        <el-tab-pane label="北斗服务配置" name="3" >
           <service-beidou></service-beidou>
         </el-tab-pane>
-        <el-tab-pane label="授时服务配置">
+        <el-tab-pane label="授时服务配置" name='4' >
          <configuration-authorization></configuration-authorization>
         </el-tab-pane>
-        <el-tab-pane label="全局配置">
+        <el-tab-pane label="全局配置" name="5" >
           <configuration-global></configuration-global>
         </el-tab-pane>
       </el-tabs>
@@ -29,6 +29,11 @@ import ServiceBeidou from "./components/serviceBeidou.vue";
 import DistributionAutomatic from "./components/distributionAutomatic.vue";
 import ConfigurationGlobal from "./components/configurationGlobal.vue";
 import { onMounted, reactive, ref } from "vue";
+import {  useRouter,useRoute } from "vue-router";
+
+const route = useRoute();
+const router = useRouter();
+const type1=ref<any>( route.query?.status ? route.query?.status : '1',)
 onMounted(() => {
 
 });