|
@@ -16,13 +16,13 @@
|
|
|
</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="开始时间"
|
|
|
- end-placeholder="结束时间" :disabled-date="disabledDate"
|
|
|
- @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>
|
|
@@ -62,7 +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";
|
|
|
+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) => {
|
|
@@ -100,11 +100,11 @@ const handleDateChange = async (e) => {
|
|
|
ElMessage.error("分钟模式下时间间隔不能大于3小时");
|
|
|
}
|
|
|
} else {
|
|
|
- if (isDateRangeWithinDays(e[0], e[1], 7)) {
|
|
|
+ if (isDateRangeWithinDays(e[0], e[1], 90)) {
|
|
|
await handleDateRangeChange(e)
|
|
|
getHistoryList()
|
|
|
} else {
|
|
|
- ElMessage.error("日模式下时间间隔不能大于7天");
|
|
|
+ ElMessage.error("正点模式下时间间隔不能大于90天");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -118,19 +118,13 @@ const limitTime = 1000 * 60 * 60 * 24 * 6
|
|
|
const disabledDate = (time: Date) => {
|
|
|
return time.getTime() > Date.now() - 8.64e6
|
|
|
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
const handleChange = (val: Date[]) => {
|
|
|
const [pointDay] = val
|
|
|
pickDay.value = pointDay
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
const pageable = ref({
|
|
|
data_type: true,
|
|
|
time_order: 1,
|
|
@@ -180,14 +174,13 @@ let historyColumns = [
|
|
|
|
|
|
// 查询自动站列表
|
|
|
const queryas = ref<Platform>({
|
|
|
- pageSize: 50,
|
|
|
pageNum: 1,
|
|
|
currentpage: 1
|
|
|
})
|
|
|
|
|
|
|
|
|
const userStore = useUserStore();
|
|
|
-const platformList =ref<any>(computed(() => userStore.stations))
|
|
|
+const platformList = ref<any>(computed(() => userStore.stations))
|
|
|
const selectPlatform = ref()
|
|
|
|
|
|
const getPlatforms = async () => {
|
|
@@ -217,74 +210,78 @@ function formatDate(timestamp, type) {
|
|
|
}
|
|
|
|
|
|
|
|
|
-const timeArr = ref()
|
|
|
+const timeArr = ref<any>()
|
|
|
const series = ref<any>([])
|
|
|
|
|
|
const getHistoryList = async () => {
|
|
|
-
|
|
|
- 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 = []
|
|
|
+ series.value = []
|
|
|
+
|
|
|
+ const { data } = await getDataItemList({ pageNum: 1, 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)
|
|
|
})
|
|
|
|
|
|
- data.list?.forEach((item, index) => {
|
|
|
+ for (let i = 0; i < data?.list?.length; i++) {
|
|
|
+
|
|
|
+ const item = data.list[i];
|
|
|
+
|
|
|
// 初始化一个空数组来存储生成的对象
|
|
|
let resultArray = <any>[];
|
|
|
-
|
|
|
// 初始化起始角度和结束角度
|
|
|
let startAngle = 359.50;
|
|
|
let endAngle = 0.00; // 注意,这个值实际上是开区间 (0, 360] 的起点前一个值,所以设置为0 - 0.5的极限情况
|
|
|
let step = -0.50;
|
|
|
+ if (item[1003] != '--') {
|
|
|
|
|
|
- // 循环生成对象
|
|
|
- for (let angle = startAngle; angle >= endAngle; angle += step) {
|
|
|
- if (item[1001] != '--') {
|
|
|
+ // 循环生成对象
|
|
|
+ // if (item[1003] != '--') {
|
|
|
+ for (let angle = startAngle; angle >= endAngle; angle += step) {
|
|
|
+ // if (item[1001] != '--') {
|
|
|
if (angle == 0 && (Number(item[1011]) >= 359.75 || Number(item[1011]) < 0.25)) {
|
|
|
resultArray.push(Number(item[1010]))
|
|
|
} else if (Number(item[1011]) >= angle - 0.25 && Number(item[1011]) < angle + 0.25) {
|
|
|
resultArray.push(Number(item[1010]))
|
|
|
} else {
|
|
|
- resultArray.push(null)
|
|
|
+ resultArray.push(0)
|
|
|
}
|
|
|
-
|
|
|
+ // }
|
|
|
}
|
|
|
- // if (item[1011] != '--' && Number(item[1011]) == angle) {
|
|
|
- // resultArray.push(Number(item[1010]))
|
|
|
- // console.log(resultArray, 'resultArray');
|
|
|
-
|
|
|
- // } else {
|
|
|
- // resultArray.push(0)
|
|
|
- // }
|
|
|
- // resultArray.push(obj);
|
|
|
- }
|
|
|
- series.value.push({
|
|
|
- name: 'No.' + index,
|
|
|
- type: 'radar',
|
|
|
- itemStyle: {
|
|
|
- borderWidth: 10,
|
|
|
- borderColor: 'transparent'
|
|
|
- },
|
|
|
- data: [
|
|
|
- {
|
|
|
- value: resultArray,
|
|
|
- name: item.data_time,
|
|
|
- info: item,
|
|
|
- lineStyle: {
|
|
|
- normal: {
|
|
|
- color: 'transparent'
|
|
|
- }
|
|
|
- },
|
|
|
- itemStyle: { // 单个拐点标志的样式设置。
|
|
|
- normal: {
|
|
|
- color: '#5470c6'
|
|
|
- }
|
|
|
- },
|
|
|
+
|
|
|
+
|
|
|
+ series.value.push({
|
|
|
+ name: 'No.' + i,
|
|
|
+ type: 'radar',
|
|
|
+ itemStyle: {
|
|
|
+ borderWidth: 10,
|
|
|
+ borderColor: 'transparent'
|
|
|
},
|
|
|
+ data: [
|
|
|
+ {
|
|
|
+ value: resultArray,
|
|
|
+ name: item.data_time,
|
|
|
+ info: item,
|
|
|
+ lineStyle: {
|
|
|
+ normal: {
|
|
|
+ color: 'transparent'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ itemStyle: { // 单个拐点标志的样式设置。
|
|
|
+ normal: {
|
|
|
+ color: '#5470c6'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ })
|
|
|
|
|
|
- ]
|
|
|
- })
|
|
|
- })
|
|
|
- nextTick(()=>{
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ nextTick(() => {
|
|
|
showData()
|
|
|
})
|
|
|
};
|
|
@@ -298,14 +295,15 @@ const isDark = computed(() => globalStore.isDark);
|
|
|
|
|
|
// resetForm
|
|
|
const resetForm = () => {
|
|
|
- dateRange.value =[parseTime(new Date(), '{y}-{m}-{d}') + ' 00:00', parseTime(new Date(), '{y}-{m}-{d} {h}:{i}')]
|
|
|
+ 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)
|
|
|
+const clickNum = ref(0)
|
|
|
const showData = () => {
|
|
|
+
|
|
|
// 初始化一个空数组来存储生成的对象
|
|
|
let resultArray = <any>[];
|
|
|
|
|
@@ -378,8 +376,10 @@ const showData = () => {
|
|
|
window.addEventListener("resize", function () {
|
|
|
mychart.resize();
|
|
|
});
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+
|
|
|
watch(isDark, () => {
|
|
|
showData()
|
|
|
});
|
|
@@ -456,4 +456,4 @@ onMounted(() => {
|
|
|
height: calc(100vh - 215px);
|
|
|
// height: 100%;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|