Commit 160a92a7 by 周田

Merge branch 'liucan' into 'main'

fix:修复创建任务间隔时间校验,分页错误

See merge request !19
parents 8e5091ba 5a19fcdd
......@@ -213,20 +213,20 @@ const pageObj = ref({
// 查看数据详情的方法
const handleDetails = (row: any) => {
targetName.value = row.targets[0].name;
windSpeed.value = row.windSpeed === "" ? "-" : row.windSpeed;
windSpeed.value = row.windSpeed === "" ? "--" : row.windSpeed;
antennaName.value = row.name;
antennaStatus.value = row.activity;
targetAzimuth.value = row.azimuthAngle;
targetDistance.value = row.targets[0].uplegRange;
targetElevation.value = row.elevationAngle;
upSignalStatus.value = row.signals.length < 1 ? "-" : row.signals[0].active;
upSignalSource.value = row.signals.length < 1 ? "-" : row.targets[0].name;
upSignalFrequencyBand.value = row.signals.length < 1 ? "-" : row.signals[0].band;
upSignalLaunchPower.value = row.signals.length < 1 ? "-" : row.signals[0].power;
downSignalStatus.value = row.signals.length < 2 ? "-" : row.signals[1].active;
downSignalSource.value = row.signals.length < 2 ? "-" : row.targets[0].name;
downSignalFrequencyBand.value = row.signals.length < 2 ? "-" : row.signals[1].band;
downSignalReceptionPower.value = row.signals.length < 2 ? "-" : row.signals[1].power;
upSignalStatus.value = row.signals.length < 1 ? "--" : row.signals[0].active;
upSignalSource.value = row.signals.length < 1 ? "--" : row.targets[0].name;
upSignalFrequencyBand.value = row.signals.length < 1 ? "--" : row.signals[0].band;
upSignalLaunchPower.value = row.signals.length < 1 ? "--" : row.signals[0].power;
downSignalStatus.value = row.signals.length < 2 ? "--" : row.signals[1].active;
downSignalSource.value = row.signals.length < 2 ? "--" : row.targets[0].name;
downSignalFrequencyBand.value = row.signals.length < 2 ? "--" : row.signals[1].band;
downSignalReceptionPower.value = row.signals.length < 2 ? "--" : row.signals[1].power;
roundTripTime.value = row.targets[0].rtlt;
detailVisibleValue.value = true;
};
......
......@@ -30,7 +30,7 @@
</div>
<div class="btns">
<el-button plain type="primary" @click="handleSearch">查询</el-button>
<el-button plain type="primary" @click="getData">查询</el-button>
<el-button plain @click="resetForm">重置</el-button>
</div>
</div>
......@@ -137,11 +137,11 @@
</div>
<div class="info-item">
<span class="item-title">目标尺寸:</span>
<span class="item">{{ targetDimension ?? "-" }}</span>
<span class="item">{{ targetDimension ?? "--" }}</span>
</div>
<div class="info-item">
<span class="item-title">发射质量:</span>
<span class="item">{{ targetLaunchMass ?? "-" }}</span>
<span class="item">{{ targetLaunchMass ?? "--" }}</span>
</div>
<div class="info-item">
<span class="item-title">干质量:</span>
......@@ -167,7 +167,7 @@
</div>
<div class="info-item">
<span class="item-title">发射站点:</span>
<span class="item">{{ targetLaunchLocation ?? "-" }}</span>
<span class="item">{{ targetLaunchLocation ?? "--" }}</span>
</div>
<div class="info-item">
<span class="item-title">轨道周期:</span>
......@@ -175,23 +175,23 @@
</div>
<div class="info-item">
<span class="item-title">相关仪器:</span>
<span class="item">{{ targetInstruments ?? "-" }}</span>
<span class="item">{{ targetInstruments ?? "--" }}</span>
</div>
<div class="info-item">
<span class="item-title">服役日期:</span>
<span class="item">{{ targetServiceDate ?? "-" }}</span>
<span class="item">{{ targetServiceDate ?? "--" }}</span>
</div>
<div class="info-item">
<span class="item-title">是否为核心任务:</span>
<span class="item">{{ targetIsCoreMission ?? "-" }}</span>
<span class="item">{{ targetIsCoreMission ?? "--" }}</span>
</div>
<div class="info-item">
<span class="item-title">太阳风速:</span>
<span class="item">{{ targetSolarWindSpeed ?? "-" }}</span>
<span class="item">{{ targetSolarWindSpeed ?? "--" }}</span>
</div>
<div class="info-item">
<span class="item-title">太阳通量密度:</span>
<span class="item">{{ targetSolarFluxDensity ?? "-" }}</span>
<span class="item">{{ targetSolarFluxDensity ?? "--" }}</span>
</div>
<div class="info-item">
<span class="item-title">轨道倾角:</span>
......@@ -270,7 +270,7 @@
</div>
<div class="info-item">
<span class="item-title">站点气压:</span>
<span class="item">{{ stationPressure === "" ? "-" : stationPressure }}</span>
<span class="item">{{ stationPressure === "" ? "--" : stationPressure }}</span>
</div>
<div class="info-item">
<span class="item-title">站点天气情况:</span>
......@@ -328,11 +328,11 @@
</div>
<div class="info-item">
<span class="item-title">站点温度:</span>
<span class="item">{{ stationTemperature === "" ? "-" : stationTemperature }}</span>
<span class="item">{{ stationTemperature === "" ? "--" : stationTemperature }}</span>
</div>
<div class="info-item">
<span class="item-title">站点湿度:</span>
<span class="item">{{ stationHumidity === "" ? "-" : stationHumidity }}</span>
<span class="item">{{ stationHumidity === "" ? "--" : stationHumidity }}</span>
</div>
</el-col>
</el-row>
......@@ -529,25 +529,25 @@ const handleStationDetails = async (id: any) => {
stationBand.value = stationData.band || "";
stationTMTC.value = stationData.tmtcStandards || "";
stationFrequencyAndTiming.value = stationData.frequencyAndTiming || "";
stationWeather.value = stationData.weather === null ? "-" : stationData.weather || "-";
stationWeather.value = stationData.weather === null ? "--" : stationData.weather || "--";
stationUplinkSPolarization.value =
stationData.uplinkSBandPolarization === null ? "-" : stationData.uplinkSBandPolarization || "-";
stationUplinkSEirp.value = stationData.uplinkSBandEirp === null ? "-" : stationData.uplinkSBandEirp || "-";
stationData.uplinkSBandPolarization === null ? "--" : stationData.uplinkSBandPolarization || "--";
stationUplinkSEirp.value = stationData.uplinkSBandEirp === null ? "--" : stationData.uplinkSBandEirp || "--";
stationUplinkXPolarization.value =
stationData.uplinkXBandPolarization === null ? "-" : stationData.uplinkXBandPolarization || "-";
stationUplinkXEirp.value = stationData.uplinkXBandEirp === null ? "-" : stationData.uplinkXBandEirp || "-";
stationData.uplinkXBandPolarization === null ? "--" : stationData.uplinkXBandPolarization || "--";
stationUplinkXEirp.value = stationData.uplinkXBandEirp === null ? "--" : stationData.uplinkXBandEirp || "--";
stationUplinkKaPolarization.value =
stationData.uplinkKaBandPolarization === null ? "-" : stationData.uplinkKaBandPolarization || "-";
stationUplinkKaEirp.value = stationData.uplinkKaBandEirp === null ? "-" : stationData.uplinkKaBandEirp || "-";
stationData.uplinkKaBandPolarization === null ? "--" : stationData.uplinkKaBandPolarization || "--";
stationUplinkKaEirp.value = stationData.uplinkKaBandEirp === null ? "--" : stationData.uplinkKaBandEirp || "--";
stationDownlinkSPolarization.value =
stationData.downlinkSBandPolarization === null ? "-" : stationData.downlinkSBandPolarization || "-";
stationDownlinkSGt.value = stationData.downlinkSBandGT === null ? "-" : stationData.downlinkSBandGT || "-";
stationData.downlinkSBandPolarization === null ? "--" : stationData.downlinkSBandPolarization || "--";
stationDownlinkSGt.value = stationData.downlinkSBandGT === null ? "--" : stationData.downlinkSBandGT || "--";
stationDownlinkXPolarization.value =
stationData.downlinkXBandPolarization === null ? "-" : stationData.downlinkXBandPolarization || "-";
stationDownlinkXGt.value = stationData.downlinkXBandGT === null ? "-" : stationData.downlinkXBandGT || "-";
stationData.downlinkXBandPolarization === null ? "--" : stationData.downlinkXBandPolarization || "--";
stationDownlinkXGt.value = stationData.downlinkXBandGT === null ? "--" : stationData.downlinkXBandGT || "--";
stationDownlinkKaPolarization.value =
stationData.downlinkKaBandPolarization === null ? "-" : stationData.downlinkKaBandPolarization || "-";
stationDownlinkKaGt.value = stationData.downlinkKaBandGT === null ? "-" : stationData.downlinkKaBandGT || "-";
stationData.downlinkKaBandPolarization === null ? "--" : stationData.downlinkKaBandPolarization || "--";
stationDownlinkKaGt.value = stationData.downlinkKaBandGT === null ? "--" : stationData.downlinkKaBandGT || "--";
stationTemperature.value = stationData.temperature || "";
stationPressure.value = stationData.airPressure || "";
stationHumidity.value = stationData.humidity || "";
......@@ -557,7 +557,7 @@ const handleStationDetails = async (id: any) => {
if (Array.isArray(stationData.description)) {
stationDescription.value = stationData.description.join("");
} else {
stationDescription.value = stationData.description || "-";
stationDescription.value = stationData.description || "--";
}
stationVisibleValue.value = true;
......@@ -575,12 +575,12 @@ const pageObj = ref({
});
const formatTimestamp = (timestamp: any) => {
if (!timestamp || typeof timestamp !== "number" || timestamp <= 0) {
return "-";
return "--";
}
const msTimestamp = String(timestamp).length === 10 ? timestamp * 1000 : timestamp;
const date = new Date(msTimestamp);
if (isNaN(date.getTime())) {
return "-";
return "--";
}
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0");
......@@ -631,21 +631,6 @@ const resetForm = () => {
// 获取esa数据列表的方法
const getData = async () => {
tableLoading.value = true;
const res = await getESAList({ page: pageObj.value.pageNo, size: pageObj.value.pageSize });
pageObj.value.total = res.data.total;
tableData.value = res.data.list;
console.log(tableData.value);
tableLoading.value = false;
};
const handleClose = () => {
detailVisibleValue.value = false;
};
const handleSearch = async () => {
if (searchTargetName.value === "" && searchStation.value === "" && searchTimeValue.value === "") {
ElMessage.warning("请输入搜索内容");
return;
}
const res = await getESAList({
spacecraft: searchTargetName.value,
station: searchStation.value,
......@@ -655,7 +640,12 @@ const handleSearch = async () => {
});
pageObj.value.total = res.data.total;
tableData.value = res.data.list;
tableLoading.value = false;
};
const handleClose = () => {
detailVisibleValue.value = false;
};
onMounted(() => {
getData();
});
......
......@@ -29,7 +29,7 @@
</div>
</div>
<div class="btns">
<el-button plain type="primary" @click="handleSearch">查询</el-button>
<el-button plain type="primary" @click="getData">查询</el-button>
<el-button plain="" @click="resetForm">重置</el-button>
</div>
</div>
......@@ -87,7 +87,12 @@
label="是否确认使用"
show-overflow-tooltip
/>
<el-table-column property="regulatory_status.resumption_list" width="140" label="是否暂停使用" show-overflow-tooltip />
<el-table-column
property="regulatory_status.resumption_list"
width="140"
label="是否暂停使用"
show-overflow-tooltip
/>
<el-table-column width="180" property="crawl_time" label="采集时间" show-overflow-tooltip />
<el-table-column label="操作" width="60">
<template #default="scope">
......@@ -125,7 +130,7 @@
</div>
<div class="info-item">
<span class="item-title">网络组织:</span>
<span class="item">{{ ntwkOrg ?? "-" }}</span>
<span class="item">{{ ntwkOrg ?? "--" }}</span>
</div>
<div class="info-item">
<span class="item-title">计划/非计划类型:</span>
......@@ -315,17 +320,17 @@ const handleDetails = async (id: any) => {
planType.value = res.data.identity.plan_type;
syncType.value = res.data.identity.ntc_type;
isNtcType.value = res.data.item.ntc_type;
syncPosition.value = res.data.identity.long_nom === null ? "-" : res.data.identity.long_nom;
perigee.value = res.data.item.minPerigee === null ? "-" : res.data.item.minPerigee;
apogee.value = res.data.item.maxApog === null ? "-" : res.data.item.maxApog;
lowestAltitude.value = res.data.item.minAltitude === null ? "-" : res.data.item.minAltitude;
referenceSubject.value = res.data.item.ref_body === null ? "-" : res.data.item.ref_body;
lowestFrequency.value = res.data.item.freq_min === null ? "-" : res.data.item.freq_min;
highestFrequency.value = res.data.item.freq_max === null ? "-" : res.data.item.freq_max;
syncPosition.value = res.data.identity.long_nom === null ? "--" : res.data.identity.long_nom;
perigee.value = res.data.item.minPerigee === null ? "--" : res.data.item.minPerigee;
apogee.value = res.data.item.maxApog === null ? "--" : res.data.item.maxApog;
lowestAltitude.value = res.data.item.minAltitude === null ? "--" : res.data.item.minAltitude;
referenceSubject.value = res.data.item.ref_body === null ? "--" : res.data.item.ref_body;
lowestFrequency.value = res.data.item.freq_min === null ? "--" : res.data.item.freq_min;
highestFrequency.value = res.data.item.freq_max === null ? "--" : res.data.item.freq_max;
status.value = res.data.regulatory_status.active_status;
validityPeriod.value = res.data.regulatory_status.prd_valid;
earliestUsageDate.value =
res.data.regulatory_status.d_reg_limit === null ? "-" : res.data.regulatory_status.d_reg_limit;
res.data.regulatory_status.d_reg_limit === null ? "--" : res.data.regulatory_status.d_reg_limit;
isUsed.value = res.data.regulatory_status.f_biu_grps;
isPauseUsed.value = res.data.regulatory_status.resumption_list;
recordTime.value = res.data.crawl_time;
......@@ -333,7 +338,7 @@ const handleDetails = async (id: any) => {
earliestRegulatoryDate.value = res.data.regulatory_status.d_inuse_list;
isRestoreUsed.value = res.data.regulatory_status.resumption_list;
validityPeriodSatelliteNetworkOldName.value = res.data.regulatory_status.old_satellite_network_name;
BFIFICdate.value = res.data.regulatory_status.d_wic === null ? "-" : res.data.regulatory_status.d_wic;
BFIFICdate.value = res.data.regulatory_status.d_wic === null ? "--" : res.data.regulatory_status.d_wic;
detailVisibleValue.value = true;
};
......@@ -349,23 +354,7 @@ const resetForm = () => {
};
const getData = async () => {
tableLoading.value = true;
const res = await getItuList({ page: pageObj.value.pageNo, size: pageObj.value.pageSize });
pageObj.value.total = res.data.total;
tableData.value = res.data.list;
console.log(tableData.value);
tableLoading.value = false;
};
const handleClose = () => {
detailVisibleValue.value = false;
};
const handleSearch = async () => {
if (searchTargetName.value === "" && searchTargetId.value === "" && searchTimeValue.value === "") {
ElMessage.warning("请输入搜索内容");
return;
}
tableLoading.value = true;
const res = await getItuList({
const res = await await getItuList({
sat_name: searchTargetName.value,
ntc_id: searchTargetId.value,
times: searchTimeValue.value,
......@@ -376,6 +365,9 @@ const handleSearch = async () => {
tableData.value = res.data.list;
tableLoading.value = false;
};
const handleClose = () => {
detailVisibleValue.value = false;
};
onMounted(() => {
getData();
......
......@@ -29,7 +29,7 @@
</div>
</div>
<div class="btns">
<el-button plain type="primary" @click="handleSearch">查询</el-button>
<el-button plain type="primary" @click="getData">查询</el-button>
<el-button plain @click="resetForm">重置</el-button>
</div>
</div>
......@@ -310,21 +310,6 @@ const resetForm = () => {
// 获取st数据列表的方法
const getData = async () => {
tableLoading.value = true;
const res = await getStList({ page: pageObj.value.pageNo, size: pageObj.value.pageSize });
pageObj.value.total = res.data.total;
tableData.value = res.data.list;
console.log(tableData.value);
tableLoading.value = false;
};
const handleClose = () => {
detailVisibleValue.value = false;
};
const handleSearch = async () => {
if (searchTargetName.value === "" && noradCatId.value === "" && timeValue.value === "") {
ElMessage.warning("请输入搜索内容");
return;
}
const res = await getStList({
norad_cat_id: noradCatId.value,
object_name: searchTargetName.value,
......@@ -332,9 +317,14 @@ const handleSearch = async () => {
page: pageObj.value.pageNo,
size: pageObj.value.pageSize,
});
tableData.value = res.data.list;
pageObj.value.total = res.data.total;
tableData.value = res.data.list;
tableLoading.value = false;
};
const handleClose = () => {
detailVisibleValue.value = false;
};
onMounted(() => {
getData();
});
......
......@@ -80,7 +80,6 @@
<script lang="ts" setup>
import { onMounted, reactive, ref } from "vue";
import { defineProps } from "vue";
import { watch } from "vue";
import { addSpiderTask } from "@/api/spiderTask";
import { AddMode } from "./enum";
......@@ -154,6 +153,7 @@ const handleConfirm = async () => {
//验证表单内容是否通过,通过继续执行
if (valid) {
if (currentMode.value === AddMode.ADD_TASK) {
if (!checkExGap(exGaps)) return;
await addSpiderTask({
scrapyd_server_id: taskParams.value.scrapyd_server_id,
schedule_type: taskParams.value.schedule_type,
......@@ -167,6 +167,7 @@ const handleConfirm = async () => {
emit("getTaskList");
ElMessage.success("添加成功");
} else if (currentMode.value === AddMode.UPDATE_TASK) {
if (!checkExGap(exGaps)) return;
await addSpiderTask({
scrapyd_server_id: taskParams.value.scrapyd_server_id,
schedule_type: taskParams.value.schedule_type,
......@@ -189,6 +190,17 @@ const handleConfirm = async () => {
exGaps.day = 0;
});
};
//校验设置的间隔是否合法
const checkExGap = (exGaps: any) => {
if (exGaps.second < 5 && exGaps.minute <= 0 && exGaps.hour <= 0 && exGaps.day <= 0) {
ElMessage.warning("间隔时间不能小于5秒");
return false;
} else {
return true;
}
};
const getData = async () => {
const res = await getSpiderList({ scrapydServerId: "1", project: "spiders" });
spiderTypeOptions.value = res.data;
......
......@@ -81,7 +81,7 @@
:total="pageObj.total"
v-model:page="pageObj.pageNo"
v-model:limit="pageObj.pageSize"
@pagination="getData"
@pagination="searchData"
v-model:pagerCount="pageObj.pagerCount"
/>
</div>
......@@ -178,7 +178,6 @@ const getData = async () => {
});
pageObj.value.total = res.data.total;
tableData.value = res.data.list;
console.log(tableData.value);
tableLoading.value = false;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment