通信载荷
- {communicationPayload.value.length === 0 && (
+ {communicationPayload.value.length === 0 ? (
- 添加
+ 添加载荷
+
+ ) : (
+
+ 删除载荷
)}
@@ -115,6 +137,18 @@ function updateSatelliteLoad({ sat: sateData, detection, communication }) {
if (!detection[0] && !communication[0]) {
return
}
+
+ if (
+ detection[0] &&
+ Object.values(detection[0]).some(item => isNull(item) || isUndefined(item))
+ ) {
+ window.$message.error('探测载荷信息不完整')
+ return
+ }
+ if (communication[0] && communication[0].target.length > 0) {
+ window.$message.error('通信载荷信息不完整')
+ return
+ }
const { getSatelliteList } = useSatellite()
const payloadData = {
id: sateData.id,
diff --git a/src/views/Satellite/hooks/satellite.ts b/src/views/Satellite/hooks/satellite.ts
index d9f0e6dc4..84aed587e 100644
--- a/src/views/Satellite/hooks/satellite.ts
+++ b/src/views/Satellite/hooks/satellite.ts
@@ -66,6 +66,8 @@ export function useSatellite() {
// satellite.sensorType = Math.random() > 0.5 ? 'conic' : 'rectangle'
const satPayload = satellitePayloadShowMap.get(id)
if (satPayload && satPayload.detectingPayload) {
+ satPayload.detectingPayload.radius &&
+ (satellite.sensorRadius = satPayload.detectingPayload.radius)
satPayload.detectingPayload.angle &&
(satellite.sensorAngle = satPayload.detectingPayload.angle)
satPayload.detectingPayload.show && (satellite.sensor = true)