zqq: 遥感影像数据下载检索条件

This commit is contained in:
qqGroup0 2023-04-18 22:28:07 +08:00
parent cd9cf8ec3f
commit ea9ed374c4
4 changed files with 597 additions and 285 deletions

View File

@ -9,22 +9,23 @@ export const getRemoteSensingSourceData = (param) => {
});
};
export const getSelectionCondition = (param) => {
export const getRemoteSensingSourceDataByCondition = (current, size, optionsJson) => {
return request({
url: '/api/' + moduleName + '/ui/disasterInfo/selectCondition',
url: '/api/' + moduleName + '/ui/remoteSensing/Condition',
method: 'get',
contentType: 'application/json',
params: {
optionsJson,
current,
size,
},
});
};
export const getPagesRemoteSensingSourceData = (param) => {
return request({
url: '/api/' + moduleName + '/ui/remoteSensing/PagesData',
method: 'get',
params: param,
});
};
export const getPagesRemoteSensingSourceData = (current, size, params) => {
return request({
url: '/api/' + moduleName + '/ui/remoteSensing/PagesData',
method: 'get',
params: {
current,
size,
...params,
},
});
};

View File

@ -1,44 +1,45 @@
<template>
<div class="system-role-container layout-padding">
<el-config-provider :locale="en">
<el-row :gutter="22">
<el-col :span="10">
<div class="system-role-padding layout-padding-auto layout-padding-view">
<el-table :data="state.disasterData.data"
v-loading="state.disasterData.loading"
style="width: 100%"
highlight-current-row
@row-click="tableClick">
<el-table-column type="index"
label="ID"
width="50" />
<el-table-column prop="disasterType"
label="Disaster type"
show-overflow-tooltip></el-table-column>
<el-table-column prop="disasterCountry"
label="disaster country"
show-overflow-tooltip></el-table-column>
<el-table-column prop="disasterTime"
label="disaster time"
show-overflow-tooltip></el-table-column>
</el-table>
<el-pagination @size-change="onHandleDisasterSizeChange"
@current-change="onHandleDisasterCurrentChange"
class="mt15"
:pager-count="5"
:page-sizes="[10, 20, 30]"
v-model:current-page="state.disasterData.param.pageNum"
background
v-model:page-size="state.disasterData.param.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="state.disasterData.total">
</el-pagination>
</div>
</el-col>
<el-col :span="14">
<div class="system-role-padding layout-padding-auto layout-padding-view">
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
<!-- <el-input size="default" placeholder="please enter username" style="max-width: 180px" v-model="state.searchName"
<el-row :gutter="22">
<el-col :span="10">
<div class="system-role-padding layout-padding-auto layout-padding-view">
<el-table :data="state.disasterData.data"
v-loading="state.disasterData.loading"
style="width: 100%"
highlight-current-row
@row-click="tableClick">
<el-table-column type="index"
label="ID"
width="50" />
<el-table-column prop="disasterType"
label="Disaster type"
show-overflow-tooltip></el-table-column>
<el-table-column prop="disasterCountry"
label="disaster country"
show-overflow-tooltip></el-table-column>
<el-table-column prop="disasterTime"
label="disaster time"
show-overflow-tooltip></el-table-column>
</el-table>
<el-pagination @size-change="onHandleDisasterSizeChange"
@current-change="onHandleDisasterCurrentChange"
class="mt15"
:pager-count="5"
:page-sizes="[10, 20, 30]"
v-model:current-page="state.disasterData.param.pageNum"
background
v-model:page-size="state.disasterData.param.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="state.disasterData.total">
</el-pagination>
</div>
</el-col>
<el-col :span="14">
<div class="system-role-padding layout-padding-auto layout-padding-view">
<div class="system-user-search mb15"
style="display: flex;margin-left: 10px;margin-top: 10px;">
<!-- <el-input size="default" placeholder="please enter username" style="max-width: 180px" v-model="state.searchName"
clearable></el-input>
<el-button size="default" type="primary" class="ml10" @click="getTableData">
<el-icon>
@ -46,25 +47,32 @@
</el-icon>
search
</el-button>-->
<el-button size="default" type="success" class="ml10" @click="uploadData">
<el-icon>
<ele-Upload/>
</el-icon>
upload
</el-button>
<el-button size="default" type="danger" class="ml10" @click="batchDel">
<el-icon>
<ele-Delete/>
</el-icon>
batch delete
</el-button>
</div>
<el-button size="default"
type="success"
class="ml10"
@click="uploadData">
<el-icon>
<ele-Upload />
</el-icon>
upload
</el-button>
<el-button size="default"
type="danger"
class="ml10"
@click="batchDel">
<el-icon>
<ele-Delete />
</el-icon>
batch delete
</el-button>
</div>
<el-table :data="state.tableData.data"
v-loading="state.tableData.loading"
@selection-change="handleSelectionChange"
style="width: 100%">
<el-table-column type="selection" width="55" />
<el-table-column type="selection"
width="55" />
<el-table-column type="index"
label="ID"
width="50" />
@ -79,17 +87,24 @@
label="image"
show-overflow-tooltip>
<template #default="scope">
<el-popover trigger="hover" placement="right" popper-class="max-h-300px overflow-auto" :width="330">
<el-popover trigger="hover"
placement="right"
popper-class="max-h-300px overflow-auto"
:width="330">
<!-- table中原本显示的图片 -->
<template #reference>
<img :src="scope.row.link" :alt="scope.row.link" style="max-height: 130px;max-width: 130px">
<img :src="scope.row.link"
:alt="scope.row.link"
style="max-height: 130px;max-width: 130px">
</template>
<!-- 鼠标移入时弹出的图片 -->
<img :src="scope.row.link" alt="" style="height: 150px;width: 300px">
<img :src="scope.row.link"
alt=""
style="height: 150px;width: 300px">
</el-popover>
</template>
</el-table-column>
<!-- <el-table-column prop="size"
<!-- <el-table-column prop="size"
label="size"
show-overflow-tooltip>
<template #default="scope">
@ -103,8 +118,14 @@
label="Operate"
show-overflow-tooltip>
<template #default="scope">
<el-button size="small" text type="primary" @click="editData(scope.row)">Edit</el-button>
<el-button size="small" text type="primary" @click="del(scope.row)">Delete</el-button>
<el-button size="small"
text
type="primary"
@click="editData(scope.row)">Edit</el-button>
<el-button size="small"
text
type="primary"
@click="del(scope.row)">Delete</el-button>
</template>
</el-table-column>
</el-table>
@ -119,14 +140,16 @@
layout="total, sizes, prev, pager, next, jumper"
:total="state.tableData.total">
</el-pagination>
</div>
</el-col>
</el-row>
</div>
</el-col>
</el-row>
</el-config-provider>
<RoleDialog ref="roleDialogRef"
@refresh="getTableData()" />
<Upload ref="uploadRef" @callback="getTableData"/>
<EditPicture ref="editUploadRef" @callback="getTableData"/>
<Upload ref="uploadRef"
@callback="getTableData" />
<EditPicture ref="editUploadRef"
@callback="getTableData" />
</div>
</template>
@ -134,8 +157,8 @@
import type { TabsPaneContext } from 'element-plus';
import Upload from './component/upload.vue';
import EditPicture from './component/editPicture.vue';
import {getPicturePage,getDisasterPage,delPicture} from '/@/api/data/pictureInfo.js';
import en from 'element-plus/dist/locale/en.mjs'
import { getPicturePage, getDisasterPage, delPicture } from '/@/api/data/pictureInfo.js';
import en from 'element-plus/dist/locale/en.mjs';
const activeName = ref('first');
//
@ -149,191 +172,198 @@ const editUploadRef = ref();
//
const roleDialogRef = ref();
const state = reactive({
multipleSelection:[],
tabVal:'first',
disasterId:null,
disasterData: {
data: [],
total: 0,
loading: false,
param: {
search: '',
pageNum: 1,
pageSize: 10,
},
},
tableData: {
data: [],
total: 0,
loading: false,
param: {
search: '',
pageNum: 1,
pageSize: 10,
},
},
multipleSelection: [],
tabVal: 'first',
disasterId: null,
disasterData: {
data: [],
total: 0,
loading: false,
param: {
search: '',
pageNum: 1,
pageSize: 10,
},
},
tableData: {
data: [],
total: 0,
loading: false,
param: {
search: '',
pageNum: 1,
pageSize: 10,
},
},
});
const handleSelectionChange = (val) => {
state.multipleSelection = val
}
state.multipleSelection = val;
};
//
const formatName = (name) => {
if(name){
return name.substr(0,name.indexOf("."));
}
return name;
}
if (name) {
return name.substr(0, name.indexOf('.'));
}
return name;
};
const auditData = (row) => {
let id = row.id
auditRef.value.openDialog([{"id":id}]);
}
let id = row.id;
auditRef.value.openDialog([{ id: id }]);
};
//
const formatSize = (size) => {
var data = "";
if (size < 0.1 * 1024) { //0.1KBB
data = size.toFixed(2) + "B";
} else if (size < 0.1 * 1024 * 1024) {//0.1MBKB
data = (size / 1024).toFixed(2) + "KB";
} else if (size < 0.1 * 1024 * 1024 * 1024) { //0.1GBMB
data = (size / (1024 * 1024)).toFixed(2) + "MB";
} else { //GB
data = (size / (1024 * 1024 * 1024)).toFixed(2) + "GB";
}
var sizestr = data + "";
var len = sizestr.indexOf("\.");
var dec = sizestr.substr(len + 1, 2);
if (dec == "00") {//00
return sizestr.substring(0, len) + sizestr.substr(len + 3, 2);
}
return sizestr;
}
var data = '';
if (size < 0.1 * 1024) {
//0.1KBB
data = size.toFixed(2) + 'B';
} else if (size < 0.1 * 1024 * 1024) {
//0.1MBKB
data = (size / 1024).toFixed(2) + 'KB';
} else if (size < 0.1 * 1024 * 1024 * 1024) {
//0.1GBMB
data = (size / (1024 * 1024)).toFixed(2) + 'MB';
} else {
//GB
data = (size / (1024 * 1024 * 1024)).toFixed(2) + 'GB';
}
var sizestr = data + '';
var len = sizestr.indexOf('.');
var dec = sizestr.substr(len + 1, 2);
if (dec == '00') {
//00
return sizestr.substring(0, len) + sizestr.substr(len + 3, 2);
}
return sizestr;
};
const formatSizeUnits = (size) => {
if (size === 0 || size === -1) return '0 B';
var k = 1000, // or 1024
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(size) / Math.log(k));
if (size === 0 || size === -1) return '0 B';
var k = 1000, // or 1024
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(size) / Math.log(k));
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
}
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
};
//
const tableClick = (row, column, event) => {
state.disasterId = row.disasterId;
getTableData();
}
state.disasterId = row.disasterId;
getTableData();
};
//
const getDisasterData = () => {
state.disasterData.loading = true;
getDisasterPage(state.disasterData.param.pageNum,state.disasterData.param.pageSize,{}).then(res=>{
state.disasterData.data = res.records;
state.disasterData.total = res.total;
state.disasterData.loading = false;
})
}
state.disasterData.loading = true;
getDisasterPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, {}).then((res) => {
state.disasterData.data = res.records;
state.disasterData.total = res.total;
state.disasterData.loading = false;
});
};
//
const getTableData = () => {
state.tableData.loading = true;
getPicturePage(state.tableData.param.pageNum,state.tableData.param.pageSize,{"disasterId_equal":state.disasterId,"isDeleted_equal":0}).then(res=>{
state.tableData.data = res.records;
state.tableData.total = res.total;
})
setTimeout(() => {
state.tableData.loading = false;
}, 500);
state.tableData.loading = true;
getPicturePage(state.tableData.param.pageNum, state.tableData.param.pageSize, { disasterId_equal: state.disasterId, isDeleted_equal: 0 }).then(
(res) => {
state.tableData.data = res.records;
state.tableData.total = res.total;
}
);
setTimeout(() => {
state.tableData.loading = false;
}, 500);
};
//
const uploadData = () => {
if(state.disasterId == null){
ElMessage.warning("Please select the disaster first")
return false;
}
uploadRef.value.openDialog(state.disasterId);
if (state.disasterId == null) {
ElMessage.warning('Please select the disaster first');
return false;
}
uploadRef.value.openDialog(state.disasterId);
};
//
const editData = (row) => {
editUploadRef.value.openDialog(row);
editUploadRef.value.openDialog(row);
};
//
const batchDel = () => {
if(state.multipleSelection.length == 0){
ElMessage.warning("Select the data to be operated first");
return false;
}
ElMessageBox.confirm(`This action batch deletes the picture dataWhether to continue?`, 'tip', {
confirmButtonText: 'confirm',
cancelButtonText: 'cancel',
type: 'warning',
})
.then(() => {
let id = state.multipleSelection.map(item=>item.id)
delPicture(id.join()).then(res=>{
getTableData();
ElMessage.success('delete successfully');
})
})
.catch(() => {});
}
if (state.multipleSelection.length == 0) {
ElMessage.warning('Select the data to be operated first');
return false;
}
ElMessageBox.confirm(`This action batch deletes the picture dataWhether to continue?`, 'tip', {
confirmButtonText: 'confirm',
cancelButtonText: 'cancel',
type: 'warning',
})
.then(() => {
let id = state.multipleSelection.map((item) => item.id);
delPicture(id.join()).then((res) => {
getTableData();
ElMessage.success('delete successfully');
});
})
.catch(() => {});
};
//
const del = (row) => {
ElMessageBox.confirm(`This action will delete the picture${row.name}Whether to continue?`, 'tip', {
confirmButtonText: 'confirm',
cancelButtonText: 'cancel',
type: 'warning',
})
.then(() => {
delPicture(row.id).then(res=>{
getTableData();
ElMessage.success('delete successfully');
})
})
.catch(() => {});
ElMessageBox.confirm(`This action will delete the picture${row.name}Whether to continue?`, 'tip', {
confirmButtonText: 'confirm',
cancelButtonText: 'cancel',
type: 'warning',
})
.then(() => {
delPicture(row.id).then((res) => {
getTableData();
ElMessage.success('delete successfully');
});
})
.catch(() => {});
};
//
const onHandleDisasterSizeChange = (val) => {
state.disasterData.param.pageSize = val;
getDisasterData();
state.disasterData.param.pageSize = val;
getDisasterData();
};
//
const onHandleDisasterCurrentChange = (val) => {
state.disasterData.param.pageNum = val;
getDisasterData();
state.disasterData.param.pageNum = val;
getDisasterData();
};
//
const onHandleSizeChange = (val) => {
state.tableData.param.pageSize = val;
getTableData();
state.tableData.param.pageSize = val;
getTableData();
};
//
const onHandleCurrentChange = (val) => {
state.tableData.param.pageNum = val;
getTableData();
state.tableData.param.pageNum = val;
getTableData();
};
//
onMounted(() => {
getDisasterData();
//getTableData();
getDisasterData();
//getTableData();
});
</script>
<style>
.demo-tabs > .el-tabs__content {
padding: 32px;
color: #6b778c;
font-size: 32px;
font-weight: 600;
padding: 32px;
color: #6b778c;
font-size: 32px;
font-weight: 600;
}
.system-role-container {
.system-role-padding {
padding: 15px;
.el-table {
flex: 1;
}
}
.system-role-padding {
padding: 15px;
.el-table {
flex: 1;
}
}
}
.demo-tabs > .el-tabs__content {
padding: 32px;
color: #6b778c;
font-size: 32px;
font-weight: 600;
padding: 32px;
color: #6b778c;
font-size: 32px;
font-weight: 600;
}
</style>

View File

@ -3,6 +3,7 @@
<el-row :gutter="22">
<el-col :span="10">
<div class="system-role-padding layout-padding-auto layout-padding-view">
<span style="margin:2%;font-weight: 600;font-size: 18px;">Disaster Info</span>
<el-table :data="state.disasterData.data"
v-loading="state.disasterData.loading"
style="width: 100%"
@ -39,7 +40,7 @@
<div class="system-user-search mb15"
style="display: flex;margin-left: 10px;margin-top: 10px;">
<!-- 选择灾害类型 -->
<el-select v-model="state.value_disasterType"
<!-- <el-select v-model="state.value_disasterType"
size="default"
clearable
placeholder="Select disaster type"
@ -48,18 +49,18 @@
:key="item.value"
:label="item.label"
:value="item.value" />
</el-select>
</el-select> -->
<!-- 选择灾害时间 -->
<el-date-picker v-model="state.value_disasterDate"
<!-- <el-date-picker v-model="state.value_disasterDate"
type="date"
placeholder="Select disaster time"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
class="ml10"
size="default"
@focus="searchDisasterDate" />
@focus="searchDisasterDate" /> -->
<!-- 选择受灾地 -->
<el-select v-model="state.value_disasterCountry"
<!-- <el-select v-model="state.value_disasterCountry"
size="default"
clearable
placeholder="Select disaster country"
@ -69,17 +70,44 @@
:key="item.value"
:label="item.label"
:value="item.value" />
</el-select>
</el-select> -->
<el-button size="default"
type="primary"
class="ml10"
@click="searchRemoteSensingSourceData">
<el-icon>
<ele-Search />
</el-icon>
Search
</el-button>
<el-row>
<el-col :span="8">
<el-tree-select v-model="state.value_satelliteType"
:data="state.options_satelliteType"
multiple
collapse-tags
collapse-tags-tooltip
:render-after-expand="false"
show-checkbox
clearable
placeholder="Select satellite type" />
</el-col>
<el-col :span="8"
style="padding-left:1%;">
<el-tree-select v-model="state.value_resolution"
:data="state.options_resolution"
multiple
collapse-tags
collapse-tags-tooltip
:render-after-expand="false"
show-checkbox
clearable
placeholder="Select resolution" />
</el-col>
<el-col :span="5">
<el-button size="default"
type="primary"
class="ml10"
@click="searchRemoteSensingSourceData">
<el-icon>
<ele-Search />
</el-icon>
Search
</el-button>
</el-col>
</el-row>
</div>
<!-- id卫星类型生产日期产品谱段产品分辨率云覆盖量景中心经纬度元数据下载链接缩略图 支撑单位 -->
@ -176,7 +204,7 @@
<script setup>
import { ref, reactive, onMounted } from 'vue';
import { getRemoteSensingSourceData, getSelectionCondition, getPagesRemoteSensingSourceData } from "/@/api/remoteSensingSourceData/remoteSensingSourceData.js";
import { getRemoteSensingSourceData, getRemoteSensingSourceDataByCondition, getPagesRemoteSensingSourceData } from "/@/api/remoteSensingSourceData/remoteSensingSourceData.js";
import { getDisasterPage } from '/@/api/data/otherData.js'
@ -193,7 +221,7 @@ const state = reactive({
},
tableData: {
data: [],
total: 0,
total: null,
loading: false,
param: {
search: '',
@ -202,13 +230,51 @@ const state = reactive({
},
},
disasterId: null,
listData: [],
satelliteCodeList: [],
//
options_disasterType: [],
value_disasterType: '',
value_disasterDate: '',
options_disasterCountry: [],
value_disasterCountry: [],
// options_disasterType: [],
// value_disasterType: '',
// value_disasterDate: '',
// options_disasterCountry: [],
// value_disasterCountry: [],
options_resolution: [{
label: '<0.8m',
value: '<0.8m'
}, {
label: '0.8m-1m',
value: '0.8m-1m'
}, {
label: '1m-10m',
value: '1m-10m'
}, {
label: '10m-30m',
value: '10m-30m'
}, {
label: '30m-50m',
value: '30m-50m'
}, {
label: '>50m',
value: '>50m'
}],
options_satelliteType: [{
label: 'Optical satellite',
value: 'Optical satellite'
}, {
label: 'Hyperspectral satellite',
value: 'Hyperspectral satellite'
}, {
label: 'Radar satellite',
value: 'Radar satellite'
}, {
label: 'Night light satellite',
value: 'Night light satellite'
}],
value_satelliteType: '',
value_resolution: [],
requestData: [],
requestResolution: [],
requestSatellite: []
})
//
@ -222,44 +288,282 @@ const getDisasterData = () => {
}
//
const tableClick = (row, column, event) => {
const tableClick = (row) => {
state.disasterId = row.disasterId;
getTableData()
getData()
}
//
const getData = () => {
let data = {
disasterId: state.disasterId,
}
getPagesRemoteSensingSourceData(data).then(
(res) => {
console.log(res.records);
state.requestData = res.records;
state.tableData.total = res.total;
})
// getRemoteSensingSourceDataByCondition(1, 1000, JSON.stringify(data)).then(
// (res) => {
// state.requestData = res.records;
// for (let index = 0; index < res.records.length; index++) {
// state.requestResolution[index] = state.requestData[index].productResolution
// state.requestSatellite[index] = state.requestData[index].satelliteCode
// }
// state.requestResolution = new Set(state.requestResolution)
// state.requestSatellite = new Set(state.requestSatellite)
// })
}
//
const searchRemoteSensingSourceData = () => {
const select = {
"disasterType": state.value_disasterType,
"disasterDate": state.value_disasterDate,
"disasterCountry": state.value_disasterCountry,
"size": state.tableData.param.pageSize,
"current": state.tableData.param.pageNum
//
for (var i = 0; i < state.value_satelliteType.length; i++) {
if (state.value_satelliteType[i] == state.options_satelliteType[0].value) {
state.satelliteCodeList.push('Landset8_OLI_TIRS');
}
else if (state.value_satelliteType[i] == state.options_satelliteType[1].value) {
let arrData = ['Sentinel -2_Sentinel - 2A', 'Sentinel -2_Sentinel - 2B', 'GF1', 'GF1B', 'GF1C', 'GF1D', 'GF2', 'GF4', 'GF6'];
arrData.forEach(item => {
state.satelliteCodeList.push(item);
})
}
}
//
getRemoteSensingSourceData(select).then(
//
var productResolutionMin = 0
var productResolutionMax = null
for (let index = 0; index < state.value_resolution.length; index++) {
if (state.value_resolution[index] == state.options_resolution[0].value) {
let data = {
productResolutionMin: 0,
productResolutionMax: 0.8
}
state.listData.push(data);
}
if (state.value_resolution[index] == state.options_resolution[1].value) {
let data = {
productResolutionMin: 0.8,
productResolutionMax: 1
}
state.listData.push(data);
}
if (state.value_resolution[index] == state.options_resolution[2].value) {
let data = {
productResolutionMin: 1,
productResolutionMax: 10
}
state.listData.push(data);
}
if (state.value_resolution[index] == state.options_resolution[3].value) {
let data = {
productResolutionMin: 10,
productResolutionMax: 30
}
state.listData.push(data);
}
if (state.value_resolution[index] == state.options_resolution[4].value) {
let data = {
productResolutionMin: 30,
productResolutionMax: 50
}
state.listData.push(data);
}
if (state.value_resolution[index] == state.options_resolution[5].value) {
let data = {
productResolutionMin: 50,
productResolutionMax: 1000
}
state.listData.push(data);
}
}
let dataNew = {};
if (state.satelliteCodeList.length != 0) {
dataNew = {
disasterId: state.disasterId,
satelliteCodeList: state.satelliteCodeList.join(","),
productResolutionVos: state.listData
}
} else {
dataNew = {
disasterId: state.disasterId,
productResolutionVos: state.listData
}
}
getDataByCondition(state.tableData.param.pageNum, state.tableData.param.pageSize, dataNew)
}
//
const getDataByCondition = (current, size, dataNew) => {
console.log('传过来的数据:', state.tableData.param.pageNum);
getRemoteSensingSourceDataByCondition(current, size, JSON.stringify(dataNew)).then(
(res) => {
state.requestData = res.records;
state.tableData.total = res.total;
state.tableData.param.pageNum = res.current;
state.tableData.param.pageSize = res.size;
console.log(state.requestData)
})
}
//
const getTableData = () => {
const getTableData = (condition) => {
state.tableData.loading = true;
getPagesRemoteSensingSourceData(state.tableData.param.pageNum, state.tableData.param.pageSize, { "disasterId": state.disasterId }).then(
getPagesRemoteSensingSourceData(condition).then(
(res) => {
state.requestData = res.records;
state.tableData.total = res.total;
var requestSatellite = []
var requestResolution = []
for (let index = 0; index < state.requestData.length; index++) {
requestSatellite[index] = state.requestData[index].satelliteCode
requestResolution[index] = state.requestData[index].productResolution
}
//
var uniSatellite = unique(requestSatellite);
var lenSatellite = uniSatellite.length
for (let index = 0; index < lenSatellite; index++) {
let A = {}
A['label'] = uniSatellite[index]
A['value'] = uniSatellite[index]
state.options_satelliteType[index] = A
}
//
var uniResolution = unique(requestResolution);
var lenResolution = uniResolution.length
for (let index = 0; index < lenResolution; index++) {
let A = {}
A['label'] = uniResolution[index]
A['value'] = uniResolution[index]
state.options_resolution[index] = A
}
})
setTimeout(() => {
state.tableData.loading = false;
}, 500);
// setTimeout(() => {
// state.tableData.loading = false;
// }, 500);
}
//
const getSatelliteAndResolution = () => {
var requestSatellite = []
var requestResolution = []
for (let index = 0; index < state.requestData.length; index++) {
requestSatellite[index] = state.requestData[index].satelliteCode
requestResolution[index] = state.requestData[index].productResolution
}
//
var uniSatellite = unique(requestSatellite);
var lenSatellite = uniSatellite.length
for (let index = 0; index < lenSatellite; index++) {
let A = {}
A['label'] = uniSatellite[index]
A['value'] = uniSatellite[index]
state.options_satelliteType[index] = A
}
//
var uniResolution = unique(requestResolution);
var lenResolution = uniResolution.length
for (let index = 0; index < lenResolution; index++) {
let A = {}
A['label'] = uniResolution[index]
A['value'] = uniResolution[index]
state.options_resolution[index] = A
}
}
//
const unique = (arr) => {
return arr.filter(function (item, index, arr) {
return arr.indexOf(item, 0) === index;
});
}
// size
const onHandleDisasterSizeChange = (val) => {
state.disasterData.param.pageSize = val;
getDisasterData();
};
// current
const onHandleDisasterCurrentChange = (val) => {
state.disasterData.param.pageNum = val;
getDisasterData();
};
// size
const onHandleSizeChange = (val) => {
state.tableData.param.pageSize = val;
state.tableData.param.pageNum = state.tableData.param.pageNum;
let dataNew = {};
if (state.satelliteCodeList.length != 0) {
dataNew = {
disasterId: state.disasterId,
satelliteCodeList: state.satelliteCodeList.join(","),
productResolutionVos: state.listData
}
} else {
dataNew = {
disasterId: state.disasterId,
productResolutionVos: state.listData
}
}
getDataByCondition(state.tableData.param.pageNum, state.tableData.param.pageSize, dataNew)
// var condition = {
// current: state.tableData.param.pageNum,
// size: 10,
// disasterId: state.disasterId,
// satelliteCode: state.satelliteSelected,
// productResolution: state.resolutionSelected
// }
// // searchRemoteSensingSourceData()
// getTableData(condition)
};
// current
const onHandleCurrentChange = (val) => {
state.tableData.param.pageSize = state.tableData.param.pageSize;
state.tableData.param.pageNum = val;
console.log('当前页:', state.tableData.param.pageNum);
let dataNew = {};
if (state.satelliteCodeList.length != 0) {
dataNew = {
disasterId: state.disasterId,
satelliteCodeList: state.satelliteCodeList.join(","),
productResolutionVos: state.listData
}
} else {
dataNew = {
disasterId: state.disasterId,
productResolutionVos: state.listData
}
}
getDataByCondition(state.tableData.param.pageNum, state.tableData.param.pageSize, dataNew)
// var condition = {
// current: state.tableData.param.pageNum,
// size: 10,
// disasterId: state.disasterId,
// satelliteCode: state.satelliteSelected,
// productResolution: state.resolutionSelected
// }
// searchRemoteSensingSourceData()
// getTableData(condition)
};
onMounted(() => {
getDisasterData();
})
//
const searchDisasterCountry = () => {
const selectCountry = {
@ -327,38 +631,13 @@ const searchDisasterDate = () => {
})
}
}
//
const onHandleDisasterSizeChange = (val) => {
state.disasterData.param.pageSize = val;
getDisasterData();
};
//
const onHandleDisasterCurrentChange = (val) => {
state.disasterData.param.pageNum = val;
getDisasterData();
};
//
const onHandleSizeChange = (val) => {
state.tableData.param.pageSize = val;
state.tableData.param.pageNum = state.tableData.param.pageNum;
// searchRemoteSensingSourceData()
getTableData()
};
//
const onHandleCurrentChange = (val) => {
state.tableData.param.pageSize = state.tableData.param.pageSize;
state.tableData.param.pageNum = val;
// searchRemoteSensingSourceData()
getTableData()
};
onMounted(() => {
getDisasterData();
})
</script>
<style scoped lang="scss">
.system-role-padding {
padding-bottom: 2%;
}
.el-pagination {
padding-left: 1%;
}
</style>

View File

@ -84,6 +84,8 @@
v-model="state.satelliteSelected"
:data="sensor"
multiple
collapse-tags
collapse-tags-tooltip
:render-after-expand="false"
show-checkbox
placeholder="Select satellite type" />