|
@@ -6,80 +6,40 @@
|
|
|
<div class="header-button-lf">
|
|
|
<el-form :model="pageable" label-width="auto" :inline="true">
|
|
|
<el-form-item label="自动站:">
|
|
|
- <el-checkbox v-model="isStand" @change="changeStand" label="多站"/>
|
|
|
- <SelectItem v-show="isStand" :select-data="selectedData" :select-list="platformList" :is-checkbox="false" @update:selectedItems="selectedItems" style="width: 200px;margin:0 10px"> </SelectItem>
|
|
|
+ <el-checkbox v-model="isStand" @change="changeStand" label="多站" />
|
|
|
+ <SelectItem v-show="isStand" :select-data="selectedData" :select-list="platformList" :is-checkbox="false"
|
|
|
+ @update:selectedItems="selectedItems" style="width: 200px;margin:0 10px"> </SelectItem>
|
|
|
<el-form-item label="观测时间:" v-if="isStand">
|
|
|
- <el-switch
|
|
|
- v-model="hot"
|
|
|
- inline-prompt
|
|
|
- active-text="正点"
|
|
|
- size="default"
|
|
|
- inactive-text="分钟"
|
|
|
- @change="changeHot"
|
|
|
- />
|
|
|
- <el-date-picker
|
|
|
- v-if="hot"
|
|
|
- v-model="multiTime"
|
|
|
- style="margin-left: 10px"
|
|
|
- type="datetime"
|
|
|
- popper-class="tpc"
|
|
|
- format="YYYY-MM-DD HH"
|
|
|
- placeholder="选择日期时间"
|
|
|
- @change="changeMultiTime"
|
|
|
- >
|
|
|
+ <el-switch v-model="hot" inline-prompt active-text="正点" size="default" inactive-text="分钟"
|
|
|
+ @change="changeHot" />
|
|
|
+ <el-date-picker v-if="hot" v-model="multiTime" style="margin-left: 10px" type="datetime"
|
|
|
+ popper-class="tpc" format="YYYY-MM-DD HH" placeholder="选择日期时间" @change="changeMultiTime">
|
|
|
</el-date-picker>
|
|
|
|
|
|
- <el-date-picker
|
|
|
- v-if="!hot"
|
|
|
- v-model="multiTime"
|
|
|
- style="margin-left: 10px"
|
|
|
- type="datetime"
|
|
|
- @change="changeMultiTime"
|
|
|
- format="YYYY-MM-DD HH:mm"
|
|
|
- placeholder="选择日期时间">
|
|
|
+ <el-date-picker v-if="!hot" v-model="multiTime" style="margin-left: 10px" type="datetime"
|
|
|
+ @change="changeMultiTime" format="YYYY-MM-DD HH:mm" placeholder="选择日期时间">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
|
|
|
<!--单站选择-->
|
|
|
|
|
|
- <SelectItem v-show="!isStand" :select-data="selectedData" :select-list="platformList" :is-checkbox="true" @update:selectedItems="selectedItems2" style="width: 200px;margin:0 10px"> </SelectItem>
|
|
|
+ <SelectItem v-show="!isStand" :select-data="selectedData" :select-list="platformList" :is-checkbox="true"
|
|
|
+ @update:selectedItems="selectedItems2" style="width: 200px;margin:0 10px"> </SelectItem>
|
|
|
<el-form-item label="观测时间:" v-if="!isStand">
|
|
|
- <el-switch
|
|
|
- v-model="hot"
|
|
|
- inline-prompt
|
|
|
- active-text="正点"
|
|
|
- size="default"
|
|
|
- inactive-text="分钟"
|
|
|
- @change="changeHot"
|
|
|
- />
|
|
|
+ <el-switch v-model="hot" inline-prompt active-text="正点" size="default" inactive-text="分钟"
|
|
|
+ @change="changeHot" />
|
|
|
|
|
|
<span class="form-item__label">日界:</span>
|
|
|
- <el-switch
|
|
|
- v-model="points"
|
|
|
- inline-prompt
|
|
|
- active-text="0点"
|
|
|
- size="default"
|
|
|
- inactive-text="18点"
|
|
|
- @change="changePoints"
|
|
|
- />
|
|
|
-
|
|
|
- <el-date-picker
|
|
|
- style="margin-left: 10px"
|
|
|
- v-model="singleTime"
|
|
|
- type="date"
|
|
|
- placeholder="请选择"
|
|
|
- @change="changeTime"
|
|
|
- />
|
|
|
+ <el-switch v-model="points" inline-prompt active-text="0点" size="default" inactive-text="18点"
|
|
|
+ @change="changePoints" />
|
|
|
+
|
|
|
+ <el-date-picker style="margin-left: 10px" v-model="singleTime" type="date" placeholder="请选择"
|
|
|
+ @change="changeTime" />
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item v-if="!hot" label="数据密度:">
|
|
|
- <el-select v-model="pageable.time_space" style="width: 240px" filterable placeholder="请选择" clearable>
|
|
|
- <el-option
|
|
|
- v-for="item in timeSpaceList"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- />
|
|
|
+ <el-select v-model="pageable.time_space" style="width: 240px" filterable placeholder="请选择" clearable>
|
|
|
+ <el-option v-for="item in timeSpaceList" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
@@ -97,17 +57,19 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 表格主体 -->
|
|
|
- <el-table stripe ref="tableRef" :border="true" :data="processTableData" size="small" @sort-change="handleSortChange">
|
|
|
- <el-table-column align="left" label="序号" width="45px" :show-overflow-tooltip="true">
|
|
|
+ <el-table stripe ref="tableRef" :border="true" :data="processTableData" size="small"
|
|
|
+ @sort-change="handleSortChange">
|
|
|
+ <el-table-column align="left" label="序号" width="45px" :show-overflow-tooltip="true" fixed >
|
|
|
<template #default="scope">
|
|
|
{{ (pageable.pageNum - 1) * pageable.pageSize + scope.$index + 1 }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<template v-for="item in columns" :key="item">
|
|
|
- <el-table-column v-bind="item" :align="item.align ?? 'left'" :reserve-selection="item.type == 'selection'" :sortable="item.sortable" :show-overflow-tooltip="true">
|
|
|
+ <el-table-column :fixed="item.fixed" v-bind="item" :align="item.align ?? 'left'" :reserve-selection="item.type == 'selection'"
|
|
|
+ :sortable="item.sortable" :show-overflow-tooltip="true">
|
|
|
<template #default="scope">
|
|
|
<template v-if="item.prop === 'data_time_i'">
|
|
|
- {{formatDate(scope.row.data_time_i)}}
|
|
|
+ {{ formatDate(scope.row.data_time_i) }}
|
|
|
</template>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -123,7 +85,8 @@
|
|
|
</template>
|
|
|
</el-table>
|
|
|
<!-- 分页组件 -->
|
|
|
- <Pagination :pageable="pageable" :handle-size-change="handleSizeChange" :handle-current-change="handleCurrentChange" />
|
|
|
+ <Pagination :pageable="pageable" :handle-size-change="handleSizeChange"
|
|
|
+ :handle-current-change="handleCurrentChange" />
|
|
|
</div>
|
|
|
|
|
|
<!-- 添加或修改岗位对话框 -->
|
|
@@ -132,106 +95,121 @@
|
|
|
<el-tabs tab-position="left" class="demo-tabs" style="height: 100%;flex-grow: 1">
|
|
|
<el-tab-pane label="风">
|
|
|
<div class="container-tag">
|
|
|
- <template v-for="item in elementList" :key="item.id" >
|
|
|
- <div v-if="item.data_type==='风'" :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
|
|
|
+ <template v-for="item in elementList" :key="item.id">
|
|
|
+ <div v-if="item.data_type === '风'" :class="item.isSelected ? 'item-tag-active' : 'item-tag'"
|
|
|
+ @click="toggleSelection(item)">{{ item.data_name }}</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="温湿度">
|
|
|
<div class="container-tag">
|
|
|
- <template v-for="item in elementList" :key="item.id" >
|
|
|
- <div v-if="item.data_type==='温湿度'" :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
|
|
|
+ <template v-for="item in elementList" :key="item.id">
|
|
|
+ <div v-if="item.data_type === '温湿度'" :class="item.isSelected ? 'item-tag-active' : 'item-tag'"
|
|
|
+ @click="toggleSelection(item)">{{ item.data_name }}</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="气压">
|
|
|
<div class="container-tag">
|
|
|
- <template v-for="item in elementList" :key="item.id" >
|
|
|
- <div v-if="item.data_type==='气压'" :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
|
|
|
+ <template v-for="item in elementList" :key="item.id">
|
|
|
+ <div v-if="item.data_type === '气压'" :class="item.isSelected ? 'item-tag-active' : 'item-tag'"
|
|
|
+ @click="toggleSelection(item)">{{ item.data_name }}</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="降水">
|
|
|
<div class="container-tag">
|
|
|
- <template v-for="item in elementList" :key="item.id" >
|
|
|
- <div v-if="item.data_type==='降水'" :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
|
|
|
+ <template v-for="item in elementList" :key="item.id">
|
|
|
+ <div v-if="item.data_type === '降水'" :class="item.isSelected ? 'item-tag-active' : 'item-tag'"
|
|
|
+ @click="toggleSelection(item)">{{ item.data_name }}</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="云">
|
|
|
<div class="container-tag">
|
|
|
- <template v-for="item in elementList" :key="item.id" >
|
|
|
- <div v-if="item.data_type==='云'" :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
|
|
|
+ <template v-for="item in elementList" :key="item.id">
|
|
|
+ <div v-if="item.data_type === '云'" :class="item.isSelected ? 'item-tag-active' : 'item-tag'"
|
|
|
+ @click="toggleSelection(item)">{{ item.data_name }}</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="能见度">
|
|
|
<div class="container-tag">
|
|
|
- <template v-for="item in elementList" :key="item.id" >
|
|
|
- <div v-if="item.data_type==='能见度'" :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
|
|
|
+ <template v-for="item in elementList" :key="item.id">
|
|
|
+ <div v-if="item.data_type === '能见度'" :class="item.isSelected ? 'item-tag-active' : 'item-tag'"
|
|
|
+ @click="toggleSelection(item)">{{ item.data_name }}</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="天气现象">
|
|
|
<div class="container-tag">
|
|
|
- <template v-for="item in elementList" :key="item.id" >
|
|
|
- <div v-if="item.data_type==='天气现象'" :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
|
|
|
+ <template v-for="item in elementList" :key="item.id">
|
|
|
+ <div v-if="item.data_type === '天气现象'" :class="item.isSelected ? 'item-tag-active' : 'item-tag'"
|
|
|
+ @click="toggleSelection(item)">{{ item.data_name }}</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="积雪">
|
|
|
<div class="container-tag">
|
|
|
- <template v-for="item in elementList" :key="item.id" >
|
|
|
- <div v-if="item.data_type==='积雪'" :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
|
|
|
+ <template v-for="item in elementList" :key="item.id">
|
|
|
+ <div v-if="item.data_type === '积雪'" :class="item.isSelected ? 'item-tag-active' : 'item-tag'"
|
|
|
+ @click="toggleSelection(item)">{{ item.data_name }}</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="地面温度">
|
|
|
<div class="container-tag">
|
|
|
- <template v-for="item in elementList" :key="item.id" >
|
|
|
- <div v-if="item.data_type==='地面温度'" :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
|
|
|
+ <template v-for="item in elementList" :key="item.id">
|
|
|
+ <div v-if="item.data_type === '地面温度'" :class="item.isSelected ? 'item-tag-active' : 'item-tag'"
|
|
|
+ @click="toggleSelection(item)">{{ item.data_name }}</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="大气电场">
|
|
|
<div class="container-tag">
|
|
|
- <template v-for="item in elementList" :key="item.id" >
|
|
|
- <div v-if="item.data_type==='大气电场'" :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
|
|
|
+ <template v-for="item in elementList" :key="item.id">
|
|
|
+ <div v-if="item.data_type === '大气电场'" :class="item.isSelected ? 'item-tag-active' : 'item-tag'"
|
|
|
+ @click="toggleSelection(item)">{{ item.data_name }}</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="闪电">
|
|
|
<div class="container-tag">
|
|
|
- <template v-for="item in elementList" :key="item.id" >
|
|
|
- <div v-if="item.data_type==='闪电'" :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
|
|
|
+ <template v-for="item in elementList" :key="item.id">
|
|
|
+ <div v-if="item.data_type === '闪电'" :class="item.isSelected ? 'item-tag-active' : 'item-tag'"
|
|
|
+ @click="toggleSelection(item)">{{ item.data_name }}</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="日照">
|
|
|
<div class="container-tag">
|
|
|
- <template v-for="item in elementList" :key="item.id" >
|
|
|
- <div v-if="item.data_type==='日照'" :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
|
|
|
+ <template v-for="item in elementList" :key="item.id">
|
|
|
+ <div v-if="item.data_type === '日照'" :class="item.isSelected ? 'item-tag-active' : 'item-tag'"
|
|
|
+ @click="toggleSelection(item)">{{ item.data_name }}</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="总辐射">
|
|
|
<div class="container-tag">
|
|
|
- <template v-for="item in elementList" :key="item.id" >
|
|
|
- <div v-if="item.data_type==='总辐射'" :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
|
|
|
+ <template v-for="item in elementList" :key="item.id">
|
|
|
+ <div v-if="item.data_type === '总辐射'" :class="item.isSelected ? 'item-tag-active' : 'item-tag'"
|
|
|
+ @click="toggleSelection(item)">{{ item.data_name }}</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="光照度">
|
|
|
<div class="container-tag">
|
|
|
- <template v-for="item in elementList" :key="item.id" >
|
|
|
- <div v-if="item.data_type==='光照度'" :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
|
|
|
+ <template v-for="item in elementList" :key="item.id">
|
|
|
+ <div v-if="item.data_type === '光照度'" :class="item.isSelected ? 'item-tag-active' : 'item-tag'"
|
|
|
+ @click="toggleSelection(item)">{{ item.data_name }}</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="水文">
|
|
|
<div class="container-tag">
|
|
|
- <template v-for="item in elementList" :key="item.id" >
|
|
|
- <div v-if="item.data_type==='水文'" :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
|
|
|
+ <template v-for="item in elementList" :key="item.id">
|
|
|
+ <div v-if="item.data_type === '水文'" :class="item.isSelected ? 'item-tag-active' : 'item-tag'"
|
|
|
+ @click="toggleSelection(item)">{{ item.data_name }}</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
@@ -239,13 +217,10 @@
|
|
|
<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)"
|
|
|
- draggable="true"
|
|
|
- @dragstart="dragStart($event, index)"
|
|
|
- @dragover.prevent
|
|
|
- @drop="drop($event, index)"
|
|
|
- >{{item.data_name}}</div>
|
|
|
+ <template v-for="(item, index) in copiedCustomizeColumns" :key="item.id">
|
|
|
+ <div :class="selectedItemIndex === index ? 'selected-item-tag-active' : 'selected-item-tag'"
|
|
|
+ @click="changeSelected(index)" draggable="true" @dragstart="dragStart($event, index)" @dragover.prevent
|
|
|
+ @drop="drop($event, index)">{{ item.data_name }}</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
<div class="button-container">
|
|
@@ -269,29 +244,29 @@
|
|
|
<script setup lang="ts" name="useProTable">
|
|
|
import SelectItem from "@/components/SelectItem/index.vue";
|
|
|
import Pagination from "@/components/ProTable/components/Pagination.vue";
|
|
|
-import {ref, reactive, onMounted, onDeactivated, onActivated, computed} from "vue";
|
|
|
+import { ref, reactive, onMounted, onDeactivated, onActivated, computed } from "vue";
|
|
|
import { ColumnProps } from "@/components/ProTable/interface";
|
|
|
-import {ElNotification, ElTable} from "element-plus";
|
|
|
-import {getDataItemList, getPlatformList, getRgDataList} from "@/api/modules/allData";
|
|
|
-import { Platform} from "@/api/interface";
|
|
|
-import {useUserStore} from "@/stores/modules/user";
|
|
|
+import { ElNotification, ElTable } from "element-plus";
|
|
|
+import { getDataItemList, getPlatformList, getRgDataList } from "@/api/modules/allData";
|
|
|
+import { Platform } from "@/api/interface";
|
|
|
+import { useUserStore } from "@/stores/modules/user";
|
|
|
const userStore = useUserStore();
|
|
|
-const userForm = computed(() => userStore.userInfo);
|
|
|
+const userForm = computed(() => userStore.userInfo);
|
|
|
const tableRef = ref<InstanceType<typeof ElTable>>();
|
|
|
const dialog = reactive<any>({
|
|
|
visible: false,
|
|
|
title: ''
|
|
|
});
|
|
|
|
|
|
-const changeStand=()=>{
|
|
|
+const changeStand = () => {
|
|
|
pageable.value = {
|
|
|
data_type: false,
|
|
|
time_order: 0,
|
|
|
- time_space:60,
|
|
|
- begin_time:undefined,
|
|
|
+ time_space: 60,
|
|
|
+ begin_time: undefined,
|
|
|
end_time: undefined,
|
|
|
- as_code_list:[],
|
|
|
- data_items:[],
|
|
|
+ as_code_list: [],
|
|
|
+ data_items: [],
|
|
|
pageNum: 1,
|
|
|
pageSize: 20,
|
|
|
total: 0
|
|
@@ -349,7 +324,7 @@ const handleSortChange = ({ column, prop, order }) => {
|
|
|
};
|
|
|
|
|
|
|
|
|
-const timeSpaceList= [
|
|
|
+const timeSpaceList = [
|
|
|
{
|
|
|
value: 1,
|
|
|
label: '1分钟',
|
|
@@ -364,13 +339,13 @@ const timeSpaceList= [
|
|
|
}
|
|
|
]
|
|
|
|
|
|
-const sensorList =ref<any>([])
|
|
|
+const sensorList = ref<any>([])
|
|
|
// 被选中当条数据下标
|
|
|
const selectedItemIndex = ref(0)
|
|
|
|
|
|
|
|
|
-const changeMoveUp = () =>{
|
|
|
-//上移
|
|
|
+const changeMoveUp = () => {
|
|
|
+ //上移
|
|
|
if (selectedItemIndex.value > 0) {
|
|
|
const temp = copiedCustomizeColumns.value[selectedItemIndex.value - 1]
|
|
|
copiedCustomizeColumns.value[selectedItemIndex.value - 1] = copiedCustomizeColumns.value[selectedItemIndex.value]
|
|
@@ -379,8 +354,8 @@ const changeMoveUp = () =>{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const changeMoveDown = ()=>{
|
|
|
-//下移
|
|
|
+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]
|
|
@@ -389,10 +364,10 @@ const changeMoveDown = ()=>{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const changeRemove= ()=>{
|
|
|
+const changeRemove = () => {
|
|
|
//删除数据
|
|
|
if (copiedCustomizeColumns.value.length > 0) {
|
|
|
- const custom= copiedCustomizeColumns.value[selectedItemIndex.value];
|
|
|
+ const custom = copiedCustomizeColumns.value[selectedItemIndex.value];
|
|
|
const data_id = custom.data_id
|
|
|
for (let i = 0; i < elementList.value.length; i++) {
|
|
|
if (elementList.value[i].data_id === data_id) {
|
|
@@ -407,7 +382,7 @@ const changeRemove= ()=>{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const changeCleared=()=>{
|
|
|
+const changeCleared = () => {
|
|
|
//清空所有数据
|
|
|
selectedItemIndex.value = 0
|
|
|
copiedCustomizeColumns.value = []
|
|
@@ -416,7 +391,7 @@ const changeCleared=()=>{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const changeSelected = (index) =>{
|
|
|
+const changeSelected = (index) => {
|
|
|
selectedItemIndex.value = index
|
|
|
}
|
|
|
|
|
@@ -424,39 +399,39 @@ const changeSelected = (index) =>{
|
|
|
const pageable = ref<any>({
|
|
|
data_type: false,
|
|
|
time_order: 0,
|
|
|
- time_space:60,
|
|
|
- begin_time:undefined,
|
|
|
+ time_space: 60,
|
|
|
+ begin_time: undefined,
|
|
|
end_time: undefined,
|
|
|
- as_code_list:[],
|
|
|
- data_items:[],
|
|
|
+ as_code_list: [],
|
|
|
+ data_items: [],
|
|
|
pageNum: 1,
|
|
|
pageSize: 20,
|
|
|
total: 0
|
|
|
});
|
|
|
|
|
|
-const isStand =ref(true)
|
|
|
+const isStand = ref(true)
|
|
|
const as_code_list = ref(undefined);
|
|
|
const hot = ref(true);
|
|
|
-const points =ref(userForm.value.role_id==='预报员' ? false : true);
|
|
|
-const singleTime =ref(undefined)
|
|
|
-const multiTime =ref(undefined)
|
|
|
+const points = ref(userForm.value.role_id === '预报员' ? false : true);
|
|
|
+const singleTime = ref(undefined)
|
|
|
+const multiTime = ref(undefined)
|
|
|
|
|
|
|
|
|
-const changeHot =(row)=>{
|
|
|
+const changeHot = (row) => {
|
|
|
console.log(row)
|
|
|
- if(row){
|
|
|
+ if (row) {
|
|
|
pageable.value.time_space = 60
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
pageable.value.time_space = 1
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const changeMultiTime =(time)=>{
|
|
|
- if(time){
|
|
|
+const changeMultiTime = (time) => {
|
|
|
+ if (time) {
|
|
|
const timeStamp = new Date(time).getTime();
|
|
|
- pageable.value.begin_time = timeStamp/1000
|
|
|
- pageable.value.end_time = timeStamp/1000
|
|
|
- }else {
|
|
|
+ pageable.value.begin_time = timeStamp / 1000
|
|
|
+ pageable.value.end_time = timeStamp / 1000
|
|
|
+ } else {
|
|
|
pageable.value.begin_time = undefined
|
|
|
pageable.value.end_time = undefined
|
|
|
}
|
|
@@ -464,21 +439,21 @@ const changeMultiTime =(time)=>{
|
|
|
}
|
|
|
|
|
|
|
|
|
-const changePoints=(row)=>{
|
|
|
- singleTime.value =undefined
|
|
|
+const changePoints = (row) => {
|
|
|
+ singleTime.value = undefined
|
|
|
pageable.value.begin_time = undefined
|
|
|
pageable.value.end_time = undefined
|
|
|
|
|
|
}
|
|
|
-const changeTime =(time)=>{
|
|
|
+const changeTime = (time) => {
|
|
|
const timeStamp = new Date(time).getTime();
|
|
|
- if(points.value){
|
|
|
+ if (points.value) {
|
|
|
//0点
|
|
|
const startTime = timeStamp + 60 * 1000; // 添加1分钟(60秒)
|
|
|
const endTime = timeStamp + 24 * 60 * 60 * 1000; // 添加一天(24小时)
|
|
|
- pageable.value.begin_time = startTime/1000
|
|
|
- pageable.value.end_time = endTime/1000
|
|
|
- }else {
|
|
|
+ pageable.value.begin_time = startTime / 1000
|
|
|
+ pageable.value.end_time = endTime / 1000
|
|
|
+ } else {
|
|
|
//18点
|
|
|
// 前一天的18:01:00
|
|
|
const previousDay = new Date(time);
|
|
@@ -500,10 +475,10 @@ const changeTime =(time)=>{
|
|
|
|
|
|
}
|
|
|
|
|
|
-const changeAslist =(row)=>{
|
|
|
- if(row){
|
|
|
+const changeAslist = (row) => {
|
|
|
+ if (row) {
|
|
|
pageable.value.as_code_list = [row]
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
pageable.value.as_code_list = []
|
|
|
}
|
|
|
|
|
@@ -512,21 +487,21 @@ const changeAslist =(row)=>{
|
|
|
|
|
|
// 查询功能
|
|
|
const handleQuery = () => {
|
|
|
- if(isStand.value){
|
|
|
+ if (isStand.value) {
|
|
|
//多站
|
|
|
pageable.value.pageNum = 1;
|
|
|
getList();
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
//单站
|
|
|
- if(!pageable.value.as_code_list){
|
|
|
- ElNotification({
|
|
|
- title: "错误",
|
|
|
- message: "请选择台站",
|
|
|
- type: "error",
|
|
|
- duration: 3000
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
+ if (!pageable.value.as_code_list) {
|
|
|
+ ElNotification({
|
|
|
+ title: "错误",
|
|
|
+ message: "请选择台站",
|
|
|
+ type: "error",
|
|
|
+ duration: 3000
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
pageable.value.pageNum = 1;
|
|
|
getList();
|
|
|
}
|
|
@@ -536,11 +511,11 @@ const handleQuery = () => {
|
|
|
|
|
|
|
|
|
//搜索站号
|
|
|
-const selectedData= ref([])
|
|
|
-const selectedItems =(data)=>{
|
|
|
- if(data.length>0){
|
|
|
+const selectedData = ref([])
|
|
|
+const selectedItems = (data) => {
|
|
|
+ if (data.length > 0) {
|
|
|
pageable.value.as_code_list = data
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
const allCodes = platformList.value.map(item => item.as_code);
|
|
|
pageable.value.as_code_list = allCodes
|
|
|
}
|
|
@@ -549,10 +524,10 @@ const selectedItems =(data)=>{
|
|
|
|
|
|
|
|
|
//搜索站号
|
|
|
-const selectedItems2 =(data)=>{
|
|
|
- if(data.length>0){
|
|
|
+const selectedItems2 = (data) => {
|
|
|
+ if (data.length > 0) {
|
|
|
pageable.value.as_code_list = data
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
const allCodes = platformList.value.map(item => item.as_code);
|
|
|
pageable.value.as_code_list = allCodes
|
|
|
}
|
|
@@ -568,16 +543,16 @@ const resetQuery = () => {
|
|
|
isStand.value = true
|
|
|
as_code_list.value = undefined;
|
|
|
hot.value = true;
|
|
|
- points.value = userForm.value.role_id==='预报员' ? false : true;
|
|
|
- singleTime.value=undefined;
|
|
|
+ points.value = userForm.value.role_id === '预报员' ? false : true;
|
|
|
+ singleTime.value = undefined;
|
|
|
multiTime.value = undefined;
|
|
|
pageable.value.time_order = 0
|
|
|
- pageable.value.time_space =60
|
|
|
- pageable.value.begin_time =undefined
|
|
|
+ pageable.value.time_space = 60
|
|
|
+ pageable.value.begin_time = undefined
|
|
|
pageable.value.end_time = undefined
|
|
|
pageable.value.pageNum = 1
|
|
|
- pageable.value.pageSize =20
|
|
|
- pageable.value.total =0
|
|
|
+ pageable.value.pageSize = 20
|
|
|
+ pageable.value.total = 0
|
|
|
pageable.value.data_items = [...customizeColumns.value];
|
|
|
processTableData.value = []
|
|
|
getList();
|
|
@@ -612,7 +587,7 @@ const processTableData = ref([]);
|
|
|
let columns = reactive<ColumnProps[]>([]);
|
|
|
|
|
|
//自定义部分表头
|
|
|
-let customizeColumns= ref<any>([
|
|
|
+let customizeColumns = ref<any>([
|
|
|
{
|
|
|
data_r_table: "SHI_SHI_LIU_YAO_SU_SHU_JU",
|
|
|
data_id: 2,
|
|
@@ -720,7 +695,7 @@ let customizeColumns= ref<any>([
|
|
|
data_value: "",
|
|
|
data_order: 0,
|
|
|
data_condition: 0
|
|
|
- },{
|
|
|
+ }, {
|
|
|
data_id: 207,
|
|
|
data_r_table: "SHI_SHI_LIU_YAO_SU_SHU_JU",
|
|
|
data_type: "气压",
|
|
@@ -749,14 +724,14 @@ let customizeColumns= ref<any>([
|
|
|
|
|
|
const updateColumns = () => {
|
|
|
const column = [
|
|
|
- { prop: "as_name", label: "站名", width: 100 },
|
|
|
- { prop: "as_code", label: "站号", width: 100 },
|
|
|
- { prop: "data_time_i", label: "观测时间", width: 120,sortable: true }
|
|
|
+ { prop: "as_name", label: "站名", width: 100,fixed:true },
|
|
|
+ { prop: "as_code", label: "站号", width: 100,fixed:true },
|
|
|
+ { prop: "data_time_i", label: "观测时间", width: 140, sortable: true,fixed:true }
|
|
|
];
|
|
|
|
|
|
const newColumns = customizeColumns.value.map(item => ({
|
|
|
prop: item.data_id,
|
|
|
- label: item.data_name +'('+item.data_unit+')',
|
|
|
+ label: item.data_name + '(' + item.data_unit + ')',
|
|
|
sortable: true,
|
|
|
// width: calculateTextLengthInPixels(item.data_name)
|
|
|
}));
|
|
@@ -774,21 +749,21 @@ const copiedCustomizeColumns = ref<any>([...customizeColumns.value]);
|
|
|
|
|
|
|
|
|
|
|
|
-const platformList =ref<any>(computed(() => userStore.stations))
|
|
|
+const platformList = ref<any>(computed(() => userStore.stations))
|
|
|
|
|
|
|
|
|
// 查询所有人工要素字典表
|
|
|
-const elementList =ref<any>([])
|
|
|
+const elementList = ref<any>([])
|
|
|
const getAllRgDataList = async () => {
|
|
|
const { data } = await getRgDataList();
|
|
|
elementList.value = data.list
|
|
|
};
|
|
|
|
|
|
const getList = async () => {
|
|
|
- if(pageable.value.as_code_list===undefined||pageable.value.as_code_list.length===0){
|
|
|
+ if (pageable.value.as_code_list === undefined || pageable.value.as_code_list.length === 0) {
|
|
|
// 没有站不给数据
|
|
|
processTableData.value = []
|
|
|
- pageable.value.total=0
|
|
|
+ pageable.value.total = 0
|
|
|
return;
|
|
|
}
|
|
|
const { data } = await getDataItemList(pageable.value);
|
|
@@ -797,14 +772,14 @@ const getList = async () => {
|
|
|
};
|
|
|
|
|
|
// 要素的选中和取消
|
|
|
-const toggleSelection=(item)=> {
|
|
|
- item.isSelected=!item.isSelected
|
|
|
- if(item.isSelected){
|
|
|
+const toggleSelection = (item) => {
|
|
|
+ item.isSelected = !item.isSelected
|
|
|
+ if (item.isSelected) {
|
|
|
//添加
|
|
|
copiedCustomizeColumns.value.push(item)
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
//删除
|
|
|
- copiedCustomizeColumns.value= copiedCustomizeColumns.value.filter(column => column.data_id !== item.data_id);
|
|
|
+ copiedCustomizeColumns.value = copiedCustomizeColumns.value.filter(column => column.data_id !== item.data_id);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -833,7 +808,7 @@ const submitForm = () => {
|
|
|
|
|
|
// 大概计算字符串长度
|
|
|
function calculateTextLengthInPixels(text) {
|
|
|
- return (text.length * 12)+100;
|
|
|
+ return (text.length * 12) + 100;
|
|
|
}
|
|
|
|
|
|
//时间戳转换为指定格式的日期字符串
|
|
@@ -878,9 +853,11 @@ const renderHeader = ({ column }: { column: any }) => {
|
|
|
};
|
|
|
|
|
|
</script>
|
|
|
-<style>
|
|
|
+<style lang="scss" scoped >
|
|
|
.tpc .el-time-spinner__wrapper {
|
|
|
- width:100% !important;
|
|
|
+ width: 100% !important;
|
|
|
+}
|
|
|
+::v-deep .el-table-fixed-column--left {
|
|
|
+ border-right: 1px solid #80bdff !important;
|
|
|
}
|
|
|
</style>
|
|
|
-
|