daiht 3 тижнів тому
батько
коміт
91937cd886

+ 21 - 59
src/views/alarm/allDevice/index.vue

@@ -10,7 +10,7 @@
 				<el-form-item>
 					<div>
 						<el-button type="primary" @click="handleSearch">查询</el-button>
-						<el-button plain @click="resetForm(formRef)">重置</el-button>
+						<el-button plain @click="resetQuery">重置</el-button>
 					</div>
 				</el-form-item>
 			</el-form>
@@ -107,6 +107,7 @@ import { getDataItemList, getPlatformList, getRgDataList, getTacRecordList, getF
 import { Platform } from "@/api/interface";
 import { parseTime } from '@/utils/index';
 import { useRouter } from "vue-router";
+import { useUserStore } from "@/stores/modules/user";
 const router = useRouter();
 const gotoFTP = () => {
 	router.push({
@@ -144,18 +145,13 @@ const pageable = ref({
 	],
 });
 
-const platformList = ref<any>([])
+const userStore = useUserStore();
+const platformList = ref<any>(computed(() => userStore.stations))
 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(platformList.value)
 
 	pageable.value.base = baseList.value[0].value
 	pageable.value.as_code_list = baseList.value[0].children
@@ -165,10 +161,15 @@ const getPlatforms = async () => {
 	// getHistoryList()
 
 };
+const resetQuery = () => {
 
-const changeBase = (e) => {
+	pageable.value.base = baseList.value[0].value
+	pageable.value.as_code_list = baseList.value[0].children
+	handleSearch()
 
+};
 
+const changeBase = (e) => {
 	const item = baseList.value.find(item => item.value === e);
 	pageable.value.as_code_list = item.children
 
@@ -196,12 +197,6 @@ const weather = ref()
 const element = ref()
 const control = ref()
 
-
-const searchParam = reactive({
-	base: undefined,
-
-})
-
 // 获取到报监控
 const arriveList = ref<any>({ aa: [], bb: [], cc: [] })
 const arriveTime = ref<any>()
@@ -220,41 +215,10 @@ const getArrive = async () => {
 	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,
@@ -295,17 +259,17 @@ const weatherInfo = async () => {
 // 获取自动站定检证书
 // 返回两个数组中相同的个数
 function findCommonCount(arr1, arr2) {
-  const common = arr1.filter(item => arr2.includes(item));
-  return common.length;
+	const common = arr1.filter(item => arr2.includes(item));
+	return common.length;
 }
 const certificateList = ref<any>({})
 const getCertificate = async () => {
 
 	const { data } = await getCertificateList()
 	// certificateList.value.a = data[0]?.length || 0
-	certificateList.value.a = findCommonCount(pageable.value.as_code_list, data[0]?.length?data[0]:[])
-	certificateList.value.b =  findCommonCount(pageable.value.as_code_list, data[1]?.length?data[1]:[])
-	certificateList.value.c =  findCommonCount(pageable.value.as_code_list, data[2]?.length?data[2]:[])
+	certificateList.value.a = findCommonCount(pageable.value.as_code_list, data[0]?.length ? data[0] : [])
+	certificateList.value.b = findCommonCount(pageable.value.as_code_list, data[1]?.length ? data[1] : [])
+	certificateList.value.c = findCommonCount(pageable.value.as_code_list, data[2]?.length ? data[2] : [])
 
 	nextTick(() => {
 		showPeriod()
@@ -356,11 +320,9 @@ const handleSearch = () => {
 	getFTP()
 	getDeviceStatus()
 }
-// resetForm
-const resetForm = (formEl) => {
-	if (!formEl) return;
-	formEl.resetFields();
-};
+
+
+
 const globalStore = useGlobalStore();
 const isDark = computed(() => globalStore.isDark);
 
@@ -738,7 +700,7 @@ watch(isDark, () => { showDevice(), showPeriod(), showWeather(), showElement(),
 onMounted(() => {
 
 
-	getFTP()
+	// getFTP()
 	// getCertificate()
 	getPlatforms()
 	// showDevice()

+ 15 - 24
src/views/alarm/singleStationData/index.vue

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

+ 5 - 8
src/views/analysis/dataSynthesis/index.vue

@@ -64,6 +64,7 @@ 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()
@@ -226,18 +227,14 @@ const queryas = ref<Platform>({
 })
 
 
-const platformList = ref<any>([])
+const userStore = useUserStore();
+const platformList =ref<any>(computed(() => userStore.stations))
 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]
+	pageable.value.as_code = platformList.value[0].as_code
+	selectPlatform.value = platformList.value[0]
 	getHistoryList()
-	endFullLoading()
 
 };
 

+ 5 - 6
src/views/analysis/featureCurves/index.vue

@@ -249,7 +249,7 @@ import { getDataItemList, getPlatformList, getRgDataList, getTacRecordList } fro
 import { Platform } from "@/api/interface";
 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 changetype = (e) => {
@@ -680,14 +680,13 @@ const queryas = ref<Platform>({
 })
 
 
-const platformList = ref<any>([])
+const userStore = useUserStore();
+const platformList =ref<any>(computed(() => userStore.stations))
 const selectPlatform = ref()
 
 const getPlatforms = async () => {
-	const { data } = await getPlatformList(queryas.value);
-	platformList.value = data.list
-	pageable.value.as_code = data.list[0].as_code
-	selectPlatform.value = data.list[0]
+	pageable.value.as_code = platformList.value[0].as_code
+	selectPlatform.value = platformList.value[0]
 	getHistoryList()
 
 };

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

@@ -62,6 +62,7 @@ import { getDataItemList, getPlatformList, getRgDataList, getTacRecordList } fro
 import { Platform } from "@/api/interface";
 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 changetype = (e) => {
@@ -185,14 +186,13 @@ const queryas = ref<Platform>({
 })
 
 
-const platformList = ref<any>([])
+const userStore = useUserStore();
+const platformList =ref<any>(computed(() => userStore.stations))
 const selectPlatform = ref()
 
 const getPlatforms = async () => {
-	const { data } = await getPlatformList(queryas.value);
-	platformList.value = data.list
-	pageable.value.as_code = data.list[0].as_code
-	selectPlatform.value = data.list[0]
+	pageable.value.as_code = platformList.value[0].as_code
+	selectPlatform.value = platformList.value[0]
 	getHistoryList()
 
 };

+ 5 - 5
src/views/analysis/rainfall/index.vue

@@ -63,6 +63,7 @@ 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 {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) => {
@@ -200,14 +201,13 @@ const queryas = ref<Platform>({
 })
 
 
-const platformList = ref<any>([])
+const userStore = useUserStore();
+const platformList =ref<any>(computed(() => userStore.stations))
 const selectPlatform = ref()
 
 const getPlatforms = async () => {
-	const { data } = await getPlatformList(queryas.value);
-	platformList.value = data.list
-	pageable.value.as_code = data.list[0].as_code
-	selectPlatform.value = data.list[0]
+	pageable.value.as_code = platformList.value[0].as_code
+	selectPlatform.value = platformList.value[0]
 	getHistoryList()
 
 };

+ 5 - 6
src/views/analysis/windSpeed/index.vue

@@ -60,7 +60,7 @@ 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 {useUserStore} from "@/stores/modules/user";
 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;
@@ -146,14 +146,13 @@ const queryas = ref<Platform>({
 })
 
 
-const platformList = ref<any>([])
+const userStore = useUserStore();
+const platformList =ref<any>(computed(() => userStore.stations))
 const selectPlatform = ref()
 
 const getPlatforms = async () => {
-	const { data } = await getPlatformList(queryas.value);
-	platformList.value = data.list
-	pageable.value.as_code = data.list[0].as_code
-	selectPlatform.value = data.list[0]
+	pageable.value.as_code = platformList.value[0].as_code
+	selectPlatform.value = platformList.value[0]
 	getHistoryList()
 
 };