<template>
|
<el-form
|
:inline="true"
|
:model="formObj"
|
:rules="rules"
|
ref="formRef"
|
label-position="right"
|
label-width="80px"
|
>
|
<!-- <div>选择初级产品</div> -->
|
<SatelliteSearchBar
|
v-show="false"
|
ref="searchBarRef"
|
label-width="80px"
|
:loading="loading"
|
@search="onSearchAOD"
|
></SatelliteSearchBar>
|
<!-- <OptionPrimaryProduct
|
ref="optionAODRef"
|
v-model="aodData"
|
></OptionPrimaryProduct> -->
|
<div>选择走航任务</div>
|
<OptionMission v-model="mission"></OptionMission>
|
<div>选择网格</div>
|
<OptionGridGroup ref="gridGroupRef" v-model="gridGroup"></OptionGridGroup>
|
<el-form-item label="产品记录">
|
<el-text :type="fusionData ? 'warning' : 'success'">{{
|
fusionData ? '已生成' : '未生成'
|
}}</el-text>
|
</el-form-item>
|
<div></div>
|
<el-form-item>
|
<el-button
|
type="primary"
|
class="el-button-custom"
|
size="small"
|
@click="handleShowHistoryClick"
|
>
|
{{ '显示历史融合记录' }}
|
</el-button>
|
<el-button
|
type="primary"
|
class="el-button-custom"
|
size="small"
|
@click="handlePreviewClick"
|
>
|
{{ '拟合数据' }}
|
</el-button>
|
<!-- <el-button
|
type="primary"
|
class="el-button-custom"
|
size="small"
|
@click="handleSaveClick"
|
>
|
{{ '保存拟合结果' }}
|
</el-button> -->
|
</el-form-item>
|
</el-form>
|
</template>
|
<script setup>
|
import { ref, watch, onUnmounted } from 'vue';
|
import moment from 'moment';
|
import gridApi from '@/api/gridApi';
|
import { SatelliteProxy } from '@/views/satellitetelemetry/SatelliteProxy';
|
import SatelliteSearchBar from '@/views/satellitetelemetry/component/SatelliteSearchBar.vue';
|
|
const satelliteProxy = new SatelliteProxy();
|
|
const searchBarRef = ref(null);
|
const optionAODRef = ref(null);
|
const gridGroupRef = ref(null);
|
|
const gridGroup = ref(null);
|
|
const mission = ref(undefined);
|
const fusionData = ref(undefined);
|
|
const gridDataDetailMap = new Map();
|
|
function onSearchAOD(options) {
|
// gridGroup.value = options;
|
// gridApi.fetchGridCell(options.id).then((res) => {
|
// satelliteProxy.gridPrepare(res.data);
|
// });
|
// optionAODRef.value.fetchAOD(options.id);
|
|
gridGroupRef.value.fetchGridGroup(searchBarRef.value.area, 'sub');
|
}
|
|
// 检查走航数据是否和100米网格已融合
|
function checkUnderwayFusionResult() {
|
const time = moment(mission.value.startTime).format('YYYY-MM-DD HH:mm:ss');
|
gridApi.fetchGridData(gridGroup.value.id, time, 3).then((res) => {
|
if (res.data.length > 0) {
|
fusionData.value = res.data[0];
|
} else {
|
fusionData.value = undefined;
|
}
|
});
|
}
|
|
watch(mission, (nV, oV) => {
|
if (nV != oV && gridGroup.value) {
|
checkUnderwayFusionResult();
|
// search(nV);
|
}
|
});
|
|
watch(gridGroup, (nV, oV) => {
|
if (nV != oV) {
|
gridApi.fetchGridCell(gridGroup.value.id).then((res) => {
|
// gridCellList.value = res.data;
|
// prepareGrid(gridCellList.value);
|
satelliteProxy.gridPrepare(res.data);
|
});
|
checkUnderwayFusionResult();
|
}
|
});
|
|
let selectedGridDataDetail;
|
function handleShowHistoryClick() {
|
// resetButton();
|
const d = fusionData.value;
|
if (gridDataDetailMap.has(d.id)) {
|
selectedGridDataDetail = gridDataDetailMap.get(d.id);
|
// selectedGridData = gridData;
|
satelliteProxy.changeVisibility({ tag: d.id, showGridViews: true });
|
} else {
|
gridApi.fetchGridDataDetail(d.id, d.groupId).then((res) => {
|
gridDataDetailMap.set(d.id, res.data);
|
selectedGridDataDetail = res.data;
|
// selectedGridData = gridData;
|
satelliteProxy.drawTagGrid({
|
tag: d.id,
|
gridDataDetail: selectedGridDataDetail,
|
opacity: 1,
|
zIndex: 11
|
});
|
});
|
}
|
}
|
|
function handlePreviewClick() {}
|
</script>
|