|
@@ -2,7 +2,7 @@
|
|
<div class="table-box">
|
|
<div class="table-box">
|
|
<div class="card table-search" style="overflow: hidden;display: flex;justify-content: space-between;">
|
|
<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 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
|
|
<el-select v-model="pageable.as_code" filterable placeholder="请搜索自动站" remote reserve-keyword
|
|
clearable style="width: 200px" @change="changeStation">
|
|
clearable style="width: 200px" @change="changeStation">
|
|
<el-option v-for="item in platformList" :key="item.as_code"
|
|
<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"
|
|
<el-date-picker v-model="dateRange" value-format="YYYY-MM-DD HH:mm"
|
|
:format="value1 ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm'"
|
|
:format="value1 ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm'"
|
|
:type="value1 ? 'daterange' : 'datetimerange'" range-separator="-" start-placeholder="开始时间"
|
|
: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)]"
|
|
:default-time="[new Date(2000, 1, 1, 0, 0), new Date(2000, 1, 1, new Date().getHours(), 0)]"
|
|
style="width: 300px;"></el-date-picker>
|
|
style="width: 300px;"></el-date-picker>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
<div>
|
|
<div>
|
|
- <el-button type="primary">查询</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="getHistoryList">查询</el-button>
|
|
<el-button plain @click="resetForm(formRef)">重置</el-button>
|
|
<el-button plain @click="resetForm(formRef)">重置</el-button>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -44,7 +43,8 @@
|
|
</div>
|
|
</div>
|
|
<div class="main_list">
|
|
<div class="main_list">
|
|
<el-row :gutter="15">
|
|
<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 class="chart_item zhuti">
|
|
<div style="font-weight: bold;" class="item_title">
|
|
<div style="font-weight: bold;" class="item_title">
|
|
<span>2分钟平均风向 ( ° )/2分钟平均风速 ( m/s )</span>
|
|
<span>2分钟平均风向 ( ° )/2分钟平均风速 ( m/s )</span>
|
|
@@ -54,43 +54,29 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</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 class="chart_item zhuti">
|
|
<div style="font-weight: bold;" class="item_title">
|
|
<div style="font-weight: bold;" class="item_title">
|
|
- <span>总辐射曝辐量 ( MJ/㎡ )</span>
|
|
|
|
|
|
+ <span>{{ item.data_name }} ( {{ item.data_unit ? item.data_unit : '' }} )</span>
|
|
</div>
|
|
</div>
|
|
<div class="mt5">
|
|
<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>
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</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 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>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+
|
|
</el-row>
|
|
</el-row>
|
|
</div>
|
|
</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-tabs tab-position="left" class="demo-tabs" style="height: 100%">
|
|
<el-tab-pane label="风">
|
|
<el-tab-pane label="风">
|
|
<div class="container-tag">
|
|
<div class="container-tag">
|
|
@@ -228,6 +214,21 @@
|
|
</div>
|
|
</div>
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
</el-tabs>
|
|
</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>
|
|
</div>
|
|
<template #footer>
|
|
<template #footer>
|
|
<div class="dialog-footer">
|
|
<div class="dialog-footer">
|
|
@@ -243,17 +244,19 @@
|
|
import * as echarts from 'echarts';
|
|
import * as echarts from 'echarts';
|
|
import { ElMessage } from "element-plus";
|
|
import { ElMessage } from "element-plus";
|
|
import { useGlobalStore } from "@/stores/modules/global";
|
|
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 { getDataItemList, getPlatformList, getRgDataList, getTacRecordList } from "@/api/modules/allData";
|
|
import { Platform } from "@/api/interface";
|
|
import { Platform } from "@/api/interface";
|
|
import { parseTime } from '@/utils/index';
|
|
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 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}:{i}')]);
|
|
const changetype = (e) => {
|
|
const changetype = (e) => {
|
|
if (!e) {
|
|
if (!e) {
|
|
dateRange.value = [parseTime(getTimeStamp(1), '{y}-{m}-{d} {h}:{i}'), parseTime(new Date(), '{y}-{m}-{d} {h}:{i}')]
|
|
dateRange.value = [parseTime(getTimeStamp(1), '{y}-{m}-{d} {h}:{i}'), parseTime(new Date(), '{y}-{m}-{d} {h}:{i}')]
|
|
}
|
|
}
|
|
|
|
+ getHistoryList()
|
|
}
|
|
}
|
|
const handleDateRangeChange = (newVal) => {
|
|
const handleDateRangeChange = (newVal) => {
|
|
const [startDate, endDate] = newVal;
|
|
const [startDate, endDate] = newVal;
|
|
@@ -274,20 +277,25 @@ const handleDateRangeChange = (newVal) => {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const handleDateChange = async (e) => {
|
|
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 {
|
|
} 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()
|
|
const pickDay = ref()
|
|
@@ -297,19 +305,7 @@ const handleFocus = () => {
|
|
const limitTime = 1000 * 60 * 60 * 24 * 6
|
|
const limitTime = 1000 * 60 * 60 * 24 * 6
|
|
|
|
|
|
const disabledDate = (time: Date) => {
|
|
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 handleChange = (val: Date[]) => {
|
|
const [pointDay] = val
|
|
const [pointDay] = val
|
|
@@ -328,10 +324,10 @@ const disabledHours = () => {
|
|
|
|
|
|
const disabledMinutes = () => {
|
|
const disabledMinutes = () => {
|
|
const a: number[] = [];
|
|
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;
|
|
return a;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -476,11 +472,68 @@ let customizeColumns = ref<any>([
|
|
data_condition: 0
|
|
data_condition: 0
|
|
}
|
|
}
|
|
]);
|
|
]);
|
|
-const copiedCustomizeColumns = ref<any>([...customizeColumns.value]);
|
|
|
|
|
|
+
|
|
const getAllRgDataList = async () => {
|
|
const getAllRgDataList = async () => {
|
|
const { data } = await getRgDataList();
|
|
const { data } = await getRgDataList();
|
|
elementList.value = data.list
|
|
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) => {
|
|
const toggleSelection = (item) => {
|
|
item.isSelected = !item.isSelected
|
|
item.isSelected = !item.isSelected
|
|
@@ -537,14 +590,7 @@ const searchParam = reactive({
|
|
switch: true
|
|
switch: true
|
|
|
|
|
|
})
|
|
})
|
|
-const baseOptions = ref([{
|
|
|
|
- value: 0,
|
|
|
|
- label: 'M1986',
|
|
|
|
-},
|
|
|
|
-{
|
|
|
|
- value: 1,
|
|
|
|
- label: 'M1987',
|
|
|
|
-}])
|
|
|
|
|
|
+
|
|
const dialog = reactive<any>({
|
|
const dialog = reactive<any>({
|
|
visible: false,
|
|
visible: false,
|
|
title: ''
|
|
title: ''
|
|
@@ -553,8 +599,8 @@ const dialog = reactive<any>({
|
|
|
|
|
|
|
|
|
|
const pageable = ref({
|
|
const pageable = ref({
|
|
- data_type: true,
|
|
|
|
- time_order: 0,
|
|
|
|
|
|
+ data_type: false,
|
|
|
|
+ time_order: 1,
|
|
as_code: undefined,
|
|
as_code: undefined,
|
|
data_items: [],
|
|
data_items: [],
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
@@ -576,34 +622,59 @@ let historyColumns = [
|
|
},
|
|
},
|
|
{
|
|
{
|
|
data_r_table: "SHI_SHI_LIU_YAO_SU_SHU_JU",
|
|
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_h_table: "LI_SHI_LIU_YAO_SU_SHU_JU",
|
|
data_value: "",
|
|
data_value: "",
|
|
data_order: 0,
|
|
data_order: 0,
|
|
data_condition: 0
|
|
data_condition: 0
|
|
},
|
|
},
|
|
{
|
|
{
|
|
|
|
+ data_id: 1,
|
|
data_r_table: "SHI_SHI_LIU_YAO_SU_SHU_JU",
|
|
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_h_table: "LI_SHI_LIU_YAO_SU_SHU_JU",
|
|
data_value: "",
|
|
data_value: "",
|
|
data_order: 0,
|
|
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,
|
|
data_condition: 0,
|
|
isSelected: true
|
|
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>({
|
|
const queryas = ref<Platform>({
|
|
- pageSize: 50,
|
|
|
|
|
|
+ pageSize: 5000,
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
currentpage: 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 timeArr = ref()
|
|
|
|
+const windLineArr = ref() // 2分钟风速风向
|
|
const tempLineArr = ref()
|
|
const tempLineArr = ref()
|
|
const humidityLineArr = ref()
|
|
const humidityLineArr = ref()
|
|
const pressureLineArr = ref()
|
|
const pressureLineArr = ref()
|
|
const getHistoryList = async () => {
|
|
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 => {
|
|
timeArr.value = data.list?.map(item => {
|
|
return formatDate(item.data_time_i, 1)
|
|
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 globalStore = useGlobalStore();
|
|
const isDark = computed(() => globalStore.isDark);
|
|
const isDark = computed(() => globalStore.isDark);
|
|
|
|
|
|
@@ -677,7 +889,6 @@ const showWind = () => {
|
|
value: 4.1, //风速--数值大小--变量名不可变
|
|
value: 4.1, //风速--数值大小--变量名不可变
|
|
symbolRotate: -45, //风向---旋转角度--变量名不可变
|
|
symbolRotate: -45, //风向---旋转角度--变量名不可变
|
|
symbolRotateStr: '西南风' //风向中文--变量名可变(tooltip 提示随之修改)
|
|
symbolRotateStr: '西南风' //风向中文--变量名可变(tooltip 提示随之修改)
|
|
-
|
|
|
|
}, {
|
|
}, {
|
|
value: 4.5,
|
|
value: 4.5,
|
|
symbolRotate: 45,
|
|
symbolRotate: 45,
|
|
@@ -775,6 +986,16 @@ const showWind = () => {
|
|
},]
|
|
},]
|
|
let mychart = echarts.init(wind.value);
|
|
let mychart = echarts.init(wind.value);
|
|
let option = {
|
|
let option = {
|
|
|
|
+ title: {
|
|
|
|
+ text: '暂无数据',
|
|
|
|
+ show: !timeArr.value ? true : false,
|
|
|
|
+ x: 'center',
|
|
|
|
+ y: 'center',
|
|
|
|
+ textStyle: {
|
|
|
|
+ fontSize: 14,
|
|
|
|
+ fontWeight: 'normal',
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
|
|
grid: {
|
|
grid: {
|
|
left: '10',
|
|
left: '10',
|
|
@@ -793,9 +1014,9 @@ const showWind = () => {
|
|
axisTick: {
|
|
axisTick: {
|
|
alignWithLabel: true, // true:标签位于刻度线正下方;false:标签位于2个刻度线中间
|
|
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: {
|
|
axisLabel: {
|
|
- interval: 4,
|
|
|
|
|
|
+ // interval: 4,
|
|
formatter: function (value) {
|
|
formatter: function (value) {
|
|
// if (value.index % 4 === 0) {
|
|
// if (value.index % 4 === 0) {
|
|
// return value.replace(/ /g, '\n');
|
|
// return value.replace(/ /g, '\n');
|
|
@@ -827,16 +1048,15 @@ const showWind = () => {
|
|
"<br/>风速:" +
|
|
"<br/>风速:" +
|
|
(params[0].value ? params[0].value : "--") +
|
|
(params[0].value ? params[0].value : "--") +
|
|
"m/s<br/>风向:" +
|
|
"m/s<br/>风向:" +
|
|
- (params[0].data ? params[0].data.symbolRotateStr : "--")
|
|
|
|
|
|
+ (params[0].data ? params[0].data.symbolRotateStr + '°' : "--")
|
|
return tip;
|
|
return tip;
|
|
},
|
|
},
|
|
},
|
|
},
|
|
// 数据
|
|
// 数据
|
|
series: [{
|
|
series: [{
|
|
- data: winArr,
|
|
|
|
|
|
+ data: windLineArr.value,
|
|
type: 'line',
|
|
type: 'line',
|
|
smooth: true, //这句就是让曲线变平滑的
|
|
smooth: true, //这句就是让曲线变平滑的
|
|
- // symbol: "image://" + require("../../../assets/img/weather/wind.png"),
|
|
|
|
symbol: 'path://M4.866,0,0,15.193l4.866-4.449L9.738,15.2Z',
|
|
symbol: 'path://M4.866,0,0,15.193l4.866-4.449L9.738,15.2Z',
|
|
symbolSize: 11,
|
|
symbolSize: 11,
|
|
//折线样式
|
|
//折线样式
|
|
@@ -1116,10 +1336,13 @@ onMounted(() => {
|
|
getAllRgDataList()
|
|
getAllRgDataList()
|
|
|
|
|
|
getPlatforms()
|
|
getPlatforms()
|
|
- showWind()
|
|
|
|
- showPressureLine()
|
|
|
|
- showRadio()
|
|
|
|
- showRadio2()
|
|
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ Access();
|
|
|
|
+ });
|
|
|
|
+ // showWind()
|
|
|
|
+ // showPressureLine()
|
|
|
|
+ // showRadio()
|
|
|
|
+ // showRadio2()
|
|
|
|
|
|
})
|
|
})
|
|
onActivated(() => {
|
|
onActivated(() => {
|