3
0

2 Коміти 135267d41a ... 6460cc7a03

Автор SHA1 Опис Дата
  daiht 6460cc7a03 Merge branch 'master' of http://git.techwx.com/framework/SMO 1 місяць тому
  daiht 26a0d46f6b zzw 1 місяць тому

Різницю між файлами не показано, бо вона завелика
+ 614 - 75
src/views/alarm/singleStationData/index.vue


+ 133 - 7
src/views/analysis/dataSynthesis/index.vue

@@ -8,9 +8,12 @@
 							:value="item.value" />
 					</el-select>
 				</el-form-item>
-				<el-form-item label="观测时间:" prop="base" >
-					<el-date-picker v-model="searchParam.date" type="daterange" range-separator="至"
-						start-placeholder="开始时间" end-placeholder="结束时间"  style="width: 300px" />
+				<el-form-item label="观测时间:" prop="base">
+					<div><el-switch v-model="searchParam.switch" class="ml-2" inline-prompt active-text="正点"
+							inactive-text="分钟" style="margin-right: 10px;" />
+						<el-date-picker v-model="searchParam.date" type="daterange" range-separator="至"
+							start-placeholder="开始时间" end-placeholder="结束时间" style="width: 300px" />
+					</div>
 				</el-form-item>
 				<el-form-item>
 					<div>
@@ -39,11 +42,133 @@
 
 <script setup lang="ts" name="dataSynthesis">
 import * as echarts from 'echarts';
-
-import { ref, reactive, onMounted,computed,watch } from "vue";
 import { useRouter } from "vue-router";
-
 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 { Platform } from "@/api/interface";
+const pageable = ref({
+	data_type: true,
+	time_order: 0,
+	as_code: undefined,
+	data_items: [],
+	pageNum: 1,
+	pageSize: 20,
+	total: 0
+});
+let historyColumns = [
+	{
+		data_id: 202,
+		data_r_table: "SHI_SHI_LIU_YAO_SU_SHU_JU",
+		data_type: "气压",
+		data_name: "本站气压",
+		data_item: "BEN_ZHAN_QI_YA",
+		data_unit: "hPa",
+		data_h_table: "LI_SHI_LIU_YAO_SU_SHU_JU",
+		data_value: "",
+		data_order: 0,
+		data_condition: 0
+	},
+	{
+		data_r_table: "SHI_SHI_LIU_YAO_SU_SHU_JU",
+		data_id: 101,
+		data_type: "温湿度",
+		data_item: "QI_WEN",
+		data_name: "气温",
+		data_unit: "℃",
+		data_h_table: "LI_SHI_LIU_YAO_SU_SHU_JU",
+		data_value: "",
+		data_order: 0,
+		data_condition: 0
+	},
+	{
+		data_r_table: "SHI_SHI_LIU_YAO_SU_SHU_JU",
+		data_id: 106,
+		data_type: "温湿度",
+		data_item: "XIANG_DUI_SHI_DU",
+		data_name: "相对湿度",
+		data_unit: "%",
+		data_h_table: "LI_SHI_LIU_YAO_SU_SHU_JU",
+		data_value: "",
+		data_order: 0,
+		data_condition: 0,
+		isSelected: true
+	},
+]
+
+// 查询自动站列表
+const queryas = ref<Platform>({
+	pageSize: 50,
+	pageNum: 1,
+	currentpage: 1
+})
+
+
+const platformList = ref<any>([])
+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]
+	getHistoryList()
+
+};
+
+const changeStation = () => {
+	getHistoryList()
+}
+const changeTime = () => {
+	getHistoryList()
+}
+
+//时间戳转换为指定格式的日期字符串
+function formatDate(timestamp, type) {
+	const date = new Date(timestamp * 1000); // 将时间戳转换为毫秒
+	const year = date.getFullYear();
+	const month = String(date.getMonth() + 1).padStart(2, '0');
+	const day = String(date.getDate()).padStart(2, '0');
+	const hours = String(date.getHours()).padStart(2, '0');
+	const minutes = String(date.getMinutes()).padStart(2, '0');
+	if (type === 1) {
+		return `${month}/${day} ${hours}:${minutes}`;
+	} else {
+		return `${year}-${month}-${day} ${hours}:${minutes}`;
+	}
+}
+function adjustValue(value) {
+	if (value === 'C') {
+		return 0
+	} else if (value <= 180) {
+		return '-' + value;
+	} else {
+		return 360 - value;
+	}
+}
+
+const timeArr = ref()
+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: searchParam.switch  ? 1 : 60 });
+	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]
+	})
+	pressureLineArr.value = data.list?.map(item => {
+		return item[202]
+	})
+
+	showData()
+
+};
 const formRef = ref()
 const data = ref()
 
@@ -53,7 +178,8 @@ const isDark = computed(() => globalStore.isDark);
 const router = useRouter();
 const searchParam = reactive({
 	base: undefined,
-	date: ''
+	date: '',
+	switch: true
 
 })
 const baseOptions = ref([{

Деякі файли не було показано, через те що забагато файлів було змінено