fuchengshen
2022-07-09 3a25c05b5ab837714f30469cdcb1e2a77d8d7f6c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
<template>
  <!--查询条件面板-->
  <mars-pannel :visible="formState.viewContorUi === true" right="10" top="10" width="355">
    <div style="width: 330px">
      <a-form>
        <a-form-item label="名称">
          <mars-input v-model:value="formState.name" :allowClear="true" @change="selectSatellites" />
        </a-form-item>
        <a-form-item label="系列卫星">
          <mars-select v-model:value="formState.selXiLie" :options="selXiLieOptions" @change="selectSatellites"> </mars-select>
        </a-form-item>
        <a-form-item label="所属国家">
          <mars-select v-model:value="formState.selCountry" :options="selectCountryOptions" @change="selectSatellites"> </mars-select>
        </a-form-item>
        <a-form-item label="对象类型">
          <mars-select v-model:value="formState.selType" :options="selTypeOptions" @change="selectSatellites"> </mars-select>
        </a-form-item>
 
        <a-form-item label="雷达截面">
          <mars-slider
            range
            v-model:value="formState.sliRcs"
            :marks="{ 0: '0', 1000: '1000' }"
            :min="0"
            :max="1000"
            :step="1"
            @change="changeSlider"
          />
        </a-form-item>
        <a-form-item label="发射日期">
          <mars-slider
            range
            v-model:value="formState.sliLaunchdate"
            :marks="{ 1950: '50', 2022: '22' }"
            :min="1950"
            :max="2022"
            :step="1"
            @change="changeSlider"
          />
        </a-form-item>
        <a-form-item label="轨道周期">
          <mars-slider
            range
            v-model:value="formState.sliPeriod"
            :marks="{ 0: '0', 60000: '6w' }"
            :min="0"
            :max="60000"
            :step="1"
            @change="changeSlider"
          />
        </a-form-item>
 
        <a-form-item label="轨道类型">
          <mars-select v-model:value="formState.selGuidao" :options="selGuidaoOptions" @change="selectSatellites"> </mars-select>
        </a-form-item>
 
        <a-form-item label="倾斜角度">
          <mars-slider
            range
            v-model:value="formState.sliInclination"
            :marks="{ 0: '0°', 150: '150°' }"
            :min="0"
            :max="150"
            :step="1"
            @change="changeSlider"
          />
        </a-form-item>
        <a-form-item label="远地点高度">
          <mars-slider
            range
            v-model:value="formState.sliApogee"
            :marks="{ 0: '0', 600000: '600km' }"
            :min="0"
            :max="600000"
            :step="1"
            @change="changeSlider"
          />
        </a-form-item>
        <a-form-item label="近地点高度">
          <mars-slider
            range
            v-model:value="formState.sliPerigee"
            :marks="{ 0: '0', 500000: '500km' }"
            :min="0"
            :max="500000"
            :step="1000"
            @change="changeSlider"
          />
        </a-form-item>
 
        <a-form-item style="text-align: center">
          <mars-button @click="reset">重置</mars-button>
        </a-form-item>
      </a-form>
    </div>
  </mars-pannel>
 
  <!--卫星详情面板-->
  <mars-pannel :visible="formState.pointInfo === true" right="10" top="10" width="335">
    <mars-button @click="highlightSatellite"> 返回 </mars-button>
    <table class="mars-table tb-border">
      <tr v-for="(item, index) in weixinNameList" :key="item">
        <td class="nametd">{{ item }}</td>
        <td v-html="weixinValueList[index]"></td>
      </tr>
    </table>
  </mars-pannel>
</template>
 
<script setup lang="ts">
import { onMounted, reactive, ref } from "vue"
import * as mapWork from "./map.js"
 
interface FormState {
  name: string
  selXiLie: string
  selCountry: string
  selType: string
  selGuidao: string
  sliRcs: any[]
  sliLaunchdate: any[]
  sliPeriod: any[]
  sliInclination: any[]
  sliApogee: any[]
  sliPerigee: any[]
  pointInfo: boolean
  viewContorUi: boolean
}
const formState = reactive<FormState>({
  name: "",
  selXiLie: "",
  selCountry: "",
  selType: "",
  selGuidao: "",
  sliRcs: [0, 1000],
  sliLaunchdate: [1950, 2022],
  sliPeriod: [0, 60000],
  sliInclination: [0, 150],
  sliApogee: [0, 600000],
  sliPerigee: [0, 500000],
  pointInfo: false,
  viewContorUi: true
})
 
mapWork.eventTarget.on("clickWeixin", function (event: any) {
  formState.pointInfo = false
  formState.viewContorUi = true
  formState.pointInfo = true
  formState.viewContorUi = false
  weixinValueList.value = event.weixinList
})
 
// 单击地图空白处
mapWork.eventTarget.on("clickMap", function () {
  formState.pointInfo = false
  formState.viewContorUi = true
})
 
// 卫星详情面板
const weixinNameList = ref([
  "名称",
  "目录号",
  "国际代号",
  "对象类型",
  "操作状态",
  "所有者/国家",
  "发射日期",
  "发射地点",
  "轨道周期(分钟)",
  "倾角(度)",
  "远地点高度(公里)",
  "近地点高度(公里)",
  "雷达截面",
  "轨道中心",
  "轨道类型",
  "更多资料"
])
const weixinValueList: any = ref([])
 
// 下拉菜单
const selXiLieOptions = ref([
  {
    value: "",
    label: "无"
  },
  {
    value: "gps",
    label: "美国GPS系统"
  },
  {
    value: "bd",
    label: "中国 北斗卫星系统"
  },
  {
    value: "glonass",
    label: "俄罗斯 格洛纳斯系统"
  },
  {
    value: "inmarsat",
    label: "国际海事卫星(Inmarsat)"
  },
  {
    value: "landsat",
    label: "地球资源卫星(Landsat)"
  },
  {
    value: "digitalglobe",
    label: "数位全球(DigitalGlobe)"
  }
])
const selectCountryOptions = ref([
  {
    value: "",
    label: "全部"
  },
  {
    value: "US",
    label: "美国"
  },
  {
    value: "CIS",
    label: "俄罗斯"
  },
  {
    value: "PRC",
    label: "中国"
  },
  {
    value: "UK",
    label: "英国"
  },
  {
    value: "FR",
    label: "法国"
  },
  {
    value: "CA",
    label: "加拿大"
  },
  {
    value: "AUS",
    label: "澳大利亚"
  },
  {
    value: "JPN",
    label: "小日本"
  },
  {
    value: "IND",
    label: "印度"
  }
])
const selTypeOptions = ref([
  {
    value: "",
    label: "全部"
  },
  {
    value: "satellite",
    label: "普通卫星"
  },
  {
    value: "junk",
    label: "垃圾(卫星碎片、火箭和助推器)"
  }
])
const selGuidaoOptions = ref([
  {
    value: "",
    label: "全部"
  },
  {
    value: "low",
    label: "低地球轨道"
  },
  {
    value: "medium",
    label: "中地球轨道"
  },
  {
    value: "geosynchronous",
    label: "地球同步轨道"
  },
  {
    value: "geostationary",
    label: "地球静止轨道"
  },
  {
    value: "high",
    label: "高地球轨道"
  }
])
 
let num: any
// 滑动条改变事件
const changeSlider = () => {
  clearTimeout(num)
  num = setTimeout(() => {
    mapWork.selectSatellites(formState)
  }, 500)
}
 
const LOW_ORBIT = 2000
const GEOSYNCHRONOUS_ORBIT = 35786
 
const selectSatellites = () => {
  switch (formState.selGuidao) {
    case "low":
      formState.sliApogee = [0, LOW_ORBIT]
      formState.sliPerigee = [0, LOW_ORBIT]
      break
    case "medium":
      formState.sliApogee = [LOW_ORBIT, GEOSYNCHRONOUS_ORBIT]
      formState.sliPerigee = [LOW_ORBIT, GEOSYNCHRONOUS_ORBIT]
      break
    case "geosynchronous":
      formState.sliApogee = [GEOSYNCHRONOUS_ORBIT * 0.98, GEOSYNCHRONOUS_ORBIT * 1.02]
      formState.sliPerigee = [GEOSYNCHRONOUS_ORBIT * 0.98, GEOSYNCHRONOUS_ORBIT * 1.02]
      break
    case "geostationary":
      formState.sliApogee = [GEOSYNCHRONOUS_ORBIT * 0.98, GEOSYNCHRONOUS_ORBIT * 1.02]
      formState.sliPerigee = [GEOSYNCHRONOUS_ORBIT * 0.98, GEOSYNCHRONOUS_ORBIT * 1.02]
      formState.sliInclination = [0, 1]
      break
    case "high":
      formState.sliApogee = [GEOSYNCHRONOUS_ORBIT * 1.02, 600000]
      formState.sliPerigee = [GEOSYNCHRONOUS_ORBIT * 1.02, 500000]
      break
    default:
      break
  }
  mapWork.selectSatellites(formState)
}
 
// 重置参数
const reset = () => {
  formState.name = ""
  formState.selXiLie = ""
  formState.selCountry = ""
  formState.selType = ""
  formState.selGuidao = ""
  formState.sliRcs = [0, 1000]
  formState.sliLaunchdate = [1950, 2022]
  formState.sliPeriod = [0, 60000]
  formState.sliInclination = [0, 150]
  formState.sliApogee = [0, 600000]
  formState.sliPerigee = [0, 500000]
 
  mapWork.resetGraphic()
}
 
const highlightSatellite = () => {
  formState.pointInfo = false
  formState.viewContorUi = true
  // 重置上次选中的轨道样式
  mapWork.highlightSatellite()
}
</script>
<style scoped lang="less">
:deep(.ant-form-item-label) {
  width: 75px;
}
:deep(.ant-form) {
  margin-right: 12px;
}
.mars-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}
.mars-table tr td {
  padding: 5px 10px;
  text-align: left;
}
.mars-table tr td:first-child {
  border-left: none;
}
.mars-table .nametd {
  padding: 5px 20px 5px 10px;
}
.tb-border {
  border: 1px solid #4db3ff70;
}
.tb-border tr td {
  border: 1px solid #4db3ff70;
}
</style>