|
@@ -7,19 +7,7 @@
|
|
<el-form :model="pageable" label-width="auto" :inline="true">
|
|
<el-form :model="pageable" label-width="auto" :inline="true">
|
|
<el-form-item label="自动站:">
|
|
<el-form-item label="自动站:">
|
|
<el-checkbox v-model="isStand" @change="changeStand" label="多站"/>
|
|
<el-checkbox v-model="isStand" @change="changeStand" label="多站"/>
|
|
-
|
|
|
|
- <!--多站选择-->
|
|
|
|
- <el-select v-if="isStand" v-model="pageable.as_code_list" multiple collapse-tags filterable placeholder="请搜索自动站" remote reserve-keyword clearable style="width: 200px;margin: 0 10px">
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in platformList"
|
|
|
|
- :key="item.as_code"
|
|
|
|
- :label="item.as_code +' '+item.as_name"
|
|
|
|
- :value="item.as_code"
|
|
|
|
- />
|
|
|
|
- <template #prefix>
|
|
|
|
- <el-icon class="el-input__icon"><search /></el-icon>
|
|
|
|
- </template>
|
|
|
|
- </el-select>
|
|
|
|
|
|
+ <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-form-item label="观测时间:" v-if="isStand">
|
|
<el-switch
|
|
<el-switch
|
|
v-model="hot"
|
|
v-model="hot"
|
|
@@ -53,18 +41,8 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
<!--单站选择-->
|
|
<!--单站选择-->
|
|
- <el-select v-if="!isStand" v-model="as_code_list" @change="changeAslist" collapse-tags filterable placeholder="请搜索自动站" remote reserve-keyword clearable style="width: 200px;padding: 0px 10px">
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in platformList"
|
|
|
|
- :key="item.as_code"
|
|
|
|
- :label="item.as_code +' '+item.as_name"
|
|
|
|
- :value="item.as_code"
|
|
|
|
- />
|
|
|
|
- <template #prefix>
|
|
|
|
- <el-icon class="el-input__icon"><search /></el-icon>
|
|
|
|
- </template>
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
|
|
|
+ <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-form-item label="观测时间:" v-if="!isStand">
|
|
<el-switch
|
|
<el-switch
|
|
v-model="hot"
|
|
v-model="hot"
|
|
@@ -284,12 +262,14 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts" name="useProTable">
|
|
<script setup lang="ts" name="useProTable">
|
|
|
|
+import SelectItem from "@/components/SelectItem/index.vue";
|
|
import Pagination from "@/components/ProTable/components/Pagination.vue";
|
|
import Pagination from "@/components/ProTable/components/Pagination.vue";
|
|
-import {ref, reactive, onMounted, onDeactivated, onActivated} from "vue";
|
|
|
|
|
|
+import {ref, reactive, onMounted, onDeactivated, onActivated, computed} from "vue";
|
|
import { ColumnProps } from "@/components/ProTable/interface";
|
|
import { ColumnProps } from "@/components/ProTable/interface";
|
|
import {ElNotification, ElTable} from "element-plus";
|
|
import {ElNotification, ElTable} from "element-plus";
|
|
import {getDataItemList, getPlatformList, getRgDataList} from "@/api/modules/allData";
|
|
import {getDataItemList, getPlatformList, getRgDataList} from "@/api/modules/allData";
|
|
import { Platform} from "@/api/interface";
|
|
import { Platform} from "@/api/interface";
|
|
|
|
+import {useUserStore} from "@/stores/modules/user";
|
|
const tableRef = ref<InstanceType<typeof ElTable>>();
|
|
const tableRef = ref<InstanceType<typeof ElTable>>();
|
|
const dialog = reactive<any>({
|
|
const dialog = reactive<any>({
|
|
visible: false,
|
|
visible: false,
|
|
@@ -538,8 +518,37 @@ const handleQuery = () => {
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+
|
|
|
|
+//搜索站号
|
|
|
|
+const selectedData= ref([])
|
|
|
|
+const selectedItems =(data)=>{
|
|
|
|
+ if(data.length>0){
|
|
|
|
+ pageable.value.as_code_list = data
|
|
|
|
+ }else {
|
|
|
|
+ const allCodes = platformList.value.map(item => item.as_code);
|
|
|
|
+ pageable.value.as_code_list = allCodes
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+//搜索站号
|
|
|
|
+const selectedItems2 =(data)=>{
|
|
|
|
+ if(data.length>0){
|
|
|
|
+ pageable.value.as_code_list = data
|
|
|
|
+ }else {
|
|
|
|
+ const allCodes = platformList.value.map(item => item.as_code);
|
|
|
|
+ pageable.value.as_code_list = allCodes
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+
|
|
//重置功能
|
|
//重置功能
|
|
const resetQuery = () => {
|
|
const resetQuery = () => {
|
|
|
|
+ const allCodes = platformList.value.map(item => item.as_code);
|
|
|
|
+ pageable.value.as_code_list = allCodes
|
|
|
|
+ selectedData.value = []
|
|
|
|
+
|
|
isStand.value = true
|
|
isStand.value = true
|
|
as_code_list.value = undefined;
|
|
as_code_list.value = undefined;
|
|
hot.value = true;
|
|
hot.value = true;
|
|
@@ -550,7 +559,6 @@ const resetQuery = () => {
|
|
pageable.value.time_space =60
|
|
pageable.value.time_space =60
|
|
pageable.value.begin_time =undefined
|
|
pageable.value.begin_time =undefined
|
|
pageable.value.end_time = undefined
|
|
pageable.value.end_time = undefined
|
|
- pageable.value.as_code_list =[]
|
|
|
|
pageable.value.pageNum = 1
|
|
pageable.value.pageNum = 1
|
|
pageable.value.pageSize =20
|
|
pageable.value.pageSize =20
|
|
pageable.value.total =0
|
|
pageable.value.total =0
|
|
@@ -747,18 +755,9 @@ const updateColumns = () => {
|
|
//操作 自定义部分表头
|
|
//操作 自定义部分表头
|
|
const copiedCustomizeColumns = ref<any>([...customizeColumns.value]);
|
|
const copiedCustomizeColumns = ref<any>([...customizeColumns.value]);
|
|
|
|
|
|
-// 查询自动站列表
|
|
|
|
-const queryas = ref<Platform>({
|
|
|
|
- pageSize: 10000,
|
|
|
|
- pageNum: 1
|
|
|
|
-})
|
|
|
|
|
|
|
|
-const platformList =ref<any>([])
|
|
|
|
-
|
|
|
|
-const getPlatforms = async () => {
|
|
|
|
- const { data } = await getPlatformList(queryas.value);
|
|
|
|
- platformList.value = data.list
|
|
|
|
-};
|
|
|
|
|
|
+const userStore = useUserStore();
|
|
|
|
+const platformList =ref<any>(computed(() => userStore.stations))
|
|
|
|
|
|
|
|
|
|
// 查询所有人工要素字典表
|
|
// 查询所有人工要素字典表
|
|
@@ -769,6 +768,12 @@ const getAllRgDataList = async () => {
|
|
};
|
|
};
|
|
|
|
|
|
const getList = async () => {
|
|
const getList = async () => {
|
|
|
|
+ if(pageable.value.as_code_list===undefined||pageable.value.as_code_list.length===0){
|
|
|
|
+ // 没有站不给数据
|
|
|
|
+ processTableData.value = []
|
|
|
|
+ pageable.value.total=0
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
const { data } = await getDataItemList(pageable.value);
|
|
const { data } = await getDataItemList(pageable.value);
|
|
processTableData.value = data.list
|
|
processTableData.value = data.list
|
|
pageable.value.total = data.total
|
|
pageable.value.total = data.total
|
|
@@ -826,9 +831,11 @@ function formatDate(timestamp) {
|
|
}
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
|
+ const allCodes = platformList.value.map(item => item.as_code);
|
|
|
|
+ pageable.value.as_code_list = allCodes
|
|
|
|
+
|
|
loadCustomizeColumns()
|
|
loadCustomizeColumns()
|
|
updateColumns()
|
|
updateColumns()
|
|
- getPlatforms()
|
|
|
|
getAllRgDataList()
|
|
getAllRgDataList()
|
|
})
|
|
})
|
|
|
|
|