init commit

master
叶志超 2023-10-13 16:46:31 +08:00
parent c68fbcbe79
commit 6423cf7a27
51 changed files with 3079 additions and 0 deletions

View File

@ -0,0 +1,10 @@
import { categories, classes } from './data'
export const allIncludeClass = () => {
categories.map((category) => {
const classArray = classes.filter( clazz => clazz.category_id == category.id )
category.classes = classArray
})
return categories
}

View File

@ -0,0 +1,11 @@
import { classes, courses } from './data'
export const findByPkIncludeCourse = (class_id) => {
if (!class_id) return
const clazz = classes.find( clazz => clazz.id === class_id )
if (!clazz) return
clazz.courses = courses.filter( course => course.class_id === class_id )
return clazz
}

View File

@ -0,0 +1,7 @@
import { courses } from './data'
export const findByPk = (course_id) => {
if (!course_id) return
return courses.find( course => course.id === course_id )
}

File diff suppressed because it is too large Load Diff

39
src/render/api/course/type.d.ts vendored Normal file
View File

@ -0,0 +1,39 @@
export class Category {
id : Number
key : String
thumbnail : String
name : String
classes : Class[]
}
export class Class {
id : Number
category_id : Number
thumbnail : String
name : String
courses : Course[]
}
export class Course {
id : Number
class_id : Number
dir : String
thumbnail : String
name : String
description : String
programs : Program[]
softwares : Software[]
images : String[]
imageCount : Number
}
export class Software {
name : String
command : String
params : Object
}
export class Program {
name : String
filePath : String
}

View File

@ -0,0 +1,154 @@
import { Program } from './type'
export const programs: Program[] = [
{
id: 1,
name: '智能风扇',
filePath: 'autofan_mix_core.ino.esp32.bin',
common: true
},
{
id: 2,
name: '智能浇花器',
filePath: 'autowater_mix_core.ino.esp32.bin',
common: true
},
{
id: 3,
name: '北斗抵近报警',
filePath: 'bdapproach_mix_core.ino.esp32.bin',
common: true
},
{
id: 4,
name: '北斗面积测量',
filePath: 'bdarea_mix_core.ino.esp32.bin',
common: true
},
{
id: 5,
name: '北斗灾难预警',
filePath: 'bddisaster_mix_core.ino.esp32.bin',
common: true
},
{
id: 6,
name: '北斗测距',
filePath: 'bddistance_mix_core.ino.esp32.bin',
common: true
},
{
id: 7,
name: '北斗实时测距',
filePath: 'bddistance_rt_mix_core.ino.esp32.bin',
common: true
},
{
id: 8,
name: '北斗观察哨',
filePath: 'bdgsv_mix_core.ino.esp32.bin',
common: true
},
{
id: 9,
name: '北斗定位仪',
filePath: 'bdlocation_mix_core.ino.esp32.bin',
common: true
},
{
id: 10,
name: '北斗小时钟',
filePath: 'bdtime_mix_core.ino.esp32.bin',
common: true
},
{
id: 11,
name: '北斗测速',
filePath: 'bdvelocity_mix_core.ino.esp32.bin',
common: true
},
{
id: 12,
name: '北斗气象站',
filePath: 'bdweather_mix_core.ino.esp32.bin',
common: true
},
{
id: 13,
name: '北斗模块波特率设置工具9600',
filePath: 'beidou_setband_9600.ino.esp32.bin',
common: true
},
{
id: 14,
name: '北斗模块波特率设置工具115200',
filePath: 'beidou_setband_115200.ino.esp32.bin',
common: true
},
{
id: 15,
name: '炫彩北斗时钟',
filePath: 'clock_core.ino.esp32.bin',
common: false
},
{
id: 16,
name: '时钟教学',
filePath: 'clock_study_core.ino.esp32.bin',
common: false
},
{
id: 17,
name: '神奇的开关',
filePath: 'magicbutton_mix_core.ino.esp32.bin',
common: true
},
{
id: 18,
name: '摩尔斯电报机',
filePath: 'morse_mix_core.ino.esp32.bin',
common: true
},
{
id: 19,
name: '电子小钢琴',
filePath: 'piano_mix_core.ino.esp32.bin',
common: true
},
{
id: 20,
name: '北斗小卫星',
filePath: 'sat_core.ino.esp32.bin',
common: false
},
{
id: 21,
name: '时间探秘',
filePath: 'time_mix_core.ino.esp32.bin',
common: true
},
{
id: 22,
name: '气象站显示端',
filePath: 'weather_c_core.ino.esp32.bin',
common: false
},
{
id: 23,
name: '气象站采集端',
filePath: 'weather_s_core.ino.esp32.bin',
common: false
},
{
id: 24,
name: '北斗轨迹回放',
filePath: 'bdlocation_mix_core.ino.esp32.bin',
common: true
},
{
id: 25,
name: '北斗气象站(探秘版)',
filePath: 'bdweather_tm_mix_core.ino.esp32.bin',
common: true
},
]

View File

@ -0,0 +1,5 @@
import { programs } from './data'
export const findAllCommon = () => {
return programs.filter((program) => program.common)
}

6
src/render/api/program/type.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
export class Program {
id : Number
name : String
common : Boolean
filePath: String
}

7
src/render/api/satellite/type.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
export class Satellite {
svid : Number
cn0 : Number
ele : Number
az : Number
active: Boolean = true
}

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,39 @@
<template>
<Application>
<Layout>
<!-- TODO: 优化Tabs, TabPane组件tab添加图标 -->
<Tabs default-value="BD_timing" class="h-full">
<n-tab-pane display-directive="show:lazy" tab="授时" name="BD_timing">
<TimingView class="w-full" />
</n-tab-pane>
<n-tab-pane display-directive="show:lazy" tab="信息" name="message">
<SerialPortReceivingMessageView class="h-full" />
</n-tab-pane>
<n-tab-pane display-directive="show:lazy" tab="转换" name="time_format_conversion">
<ConversionView />
</n-tab-pane>
</Tabs>
</Layout>
<SerialPortManagementDrawer />
</Application>
</template>
<script setup lang="ts">
import { NTabPane } from 'naive-ui'
import { Application } from '@/components/Application'
import { Layout } from '@/layout/default'
import { Tabs } from '@/components/Tabs'
import { SerialPortManagementDrawer } from '@/components/SerialPortManagementDrawer'
import { TimingView } from '@/views/BD&time/TimingView'
import { ConversionView } from '@/views/BD&time/ConversionView'
import { SerialPortReceivingMessageView } from '@/components/SerialPort'
</script>
<style scoped lang="less">
// pane
.n-tab-pane {
display: flex;
place-items: center;
}
</style>

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,53 @@
<template>
<Application>
<Layout>
<n-space vertical :item-style="itemStyle" class="BD-communication-assistant-view h-full">
<SerialPortSendingMessageView ref="serialPortSendingMessageViewRef">
<template #extra>
<n-button type="info"
size="large"
@click="sendNMEABtnClick">
NMEA
</n-button>
</template>
</SerialPortSendingMessageView>
<SerialPortReceivingMessageView />
</n-space>
</Layout>
<SerialPortManagementDrawer />
</Application>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { NSpace, NButton } from 'naive-ui'
import { Application } from '@/components/Application'
import { default as Layout } from '@/layout/absolute/Default.vue'
import { SerialPortManagementDrawer } from '@/components/SerialPortManagementDrawer'
import { SerialPortSendingMessageView, SerialPortReceivingMessageView } from '@/components/SerialPort'
const itemStyle = { flex: '1 1 50%'}
const NMEA = '$GNGGA,055528.000,4002.7282,N,11616.7795,E,1,12,1.0,101.2,M,0.0,M,,*79\r\n' +
'$GNGLL,4002.7282,N,11616.7795,E,055528.000,A,A*4C\r\n' +
'$GPGSA,A,3,23,08,30,07,11,09,27,16,,,,,1.7,1.0,1.4*36\r\n' +
'$BDGSA,A,3,03,08,09,10,,,,,,,,,1.7,1.0,1.4*22\r\n' +
'$GPGSV,3,1,10,07,40,311,39,08,69,222,50,09,33,254,52,11,18,192,37*7A\r\n' +
'$GPGSV,3,2,10,16,38,068,23,21,09,037,24,23,22,212,45,26,14,085,*7F\r\n' +
'$GPGSV,3,3,10,27,66,049,24,30,13,313,38*7D\r\n' +
'$BDGSV,1,1,04,03,44,189,35,08,39,170,35,09,15,214,31,10,67,318,15*6D\r\n' +
'$GNRMC,055528.000,A,4002.7282,N,11616.7795,E,0.00,263.91,270418,,,A*7C\r\n' +
'$GNVTG,263.91,T,,M,0.00,N,0.00,K,A*2C\r\n' +
'$GNZDA,055528.000,27,04,2018,00,00*4D\r\n' +
'$GPTXT,01,01,01,ANTENNA OPEN*25\r\n'
const serialPortSendingMessageViewRef = ref()
const sendNMEABtnClick = () => serialPortSendingMessageViewRef.value.update(NMEA)
</script>
<style scoped lang="less">
.BD-communication-assistant-view {
padding: 8px 12px;
}
</style>

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,27 @@
<template>
<Application>
<Layout>
<!-- TODO: 优化Tabs, TabPane组件tab添加图标 -->
<Tabs default-value="map" class="h-full">
<n-tab-pane display-directive="show:lazy" tab="地图" name="map">
<MapView />
</n-tab-pane>
<n-tab-pane display-directive="show:lazy" tab="信息" name="message">
<SerialPortReceivingMessageView class="h-full" />
</n-tab-pane>
</Tabs>
</Layout>
<SerialPortManagementDrawer />
</Application>
</template>
<script setup lang="ts">
import { NTabPane } from 'naive-ui'
import { Application } from '@/components/Application'
import { Layout } from '@/layout/default'
import { Tabs } from '@/components/Tabs'
import { SerialPortManagementDrawer } from '@/components/SerialPortManagementDrawer'
import { MapView } from '@/views/BDComprehensiveExperimentalPlatform/MapView'
import { SerialPortReceivingMessageView } from '@/components/SerialPort'
</script>

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,74 @@
<template>
<Application>
<Layout>
<!-- TODO: 优化Tabs, TabPane组件tab添加图标 -->
<Tabs default-value="data" class="h-full">
<n-tab-pane display-directive="show:lazy" tab="数据" name="data">
<BasicInfoView class="mx-auto"/>
</n-tab-pane>
<n-tab-pane display-directive="show:lazy" tab="星座图" name="planisphere">
<PlanisphereView class="w-h-full" />
</n-tab-pane>
<n-tab-pane display-directive="show:lazy" tab="载噪比" name="snr">
<SNRView class="w-h-full" />
</n-tab-pane>
<n-tab-pane display-directive="show:lazy" tab="信息" name="message">
<SerialPortReceivingMessageView class="h-full" />
</n-tab-pane>
<n-tab-pane display-directive="show:lazy" tab="地图" name="map">
<MapView />
</n-tab-pane>
</Tabs>
</Layout>
<SerialPortManagementDrawer />
</Application>
</template>
<script setup lang="ts">
import { watch } from 'vue'
import { NTabPane } from 'naive-ui'
import { Application } from '@/components/Application'
import { default as Layout } from '@/layout/absolute/Default.vue'
import { Tabs } from '@/components/Tabs'
import { SerialPortManagementDrawer } from '@/components/SerialPortManagementDrawer'
import { SerialPortReceivingMessageView } from '@/components/SerialPort'
import { BasicInfoView } from '@/views/BDDataAnalysisPlatform/BasicInfoView'
import { PlanisphereView } from '@/views/BDDataAnalysisPlatform/PlanisphereView'
import { SNRView } from '@/views/BDDataAnalysisPlatform/SNRView'
import MapView from '@/views/BDDataAnalysisPlatform/MapView.vue'
import { useSerialPortStore, SerialPortEventType } from '@/stores/serialPort'
import { useNMEAStore, NMEADataSource } from '@/stores/nmea'
import { LineBreakParser } from '@/utils/parser'
const nmea = useNMEAStore()
const dataSource = new NMEADataSource()
nmea.bindDataSource(dataSource)
const decoder = new TextDecoder()
const parser = new LineBreakParser()
const onSerialPortData = (data: Uint8Array) => {
const lineArr = parser.parse(decoder.decode(data))
lineArr.forEach(line => dataSource.emit('data', line))
}
const onSerialPortOpen = isOpen => {
if (!isOpen) return
dataSource.emit('open')
}
const serialPort = useSerialPortStore()
watch(() => serialPort.isOpen, onSerialPortOpen)
serialPort.addEventListener(SerialPortEventType.data, onSerialPortData)
</script>
<style scoped lang="less">
// pane
.n-tab-pane {
display: flex;
place-items: center;
}
</style>

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,27 @@
<template>
<Application>
<Layout>
<!-- TODO: 优化Tabs, TabPane组件tab添加图标 -->
<Tabs default-value="map" class="h-full">
<n-tab-pane display-directive="show:lazy" tab="地图" name="map">
<MapView />
</n-tab-pane>
<n-tab-pane display-directive="show:lazy" tab="信息" name="message">
<SerialPortReceivingMessageView class="h-full" />
</n-tab-pane>
</Tabs>
</Layout>
<SerialPortManagementDrawer />
</Application>
</template>
<script setup lang="ts">
import { NTabPane } from 'naive-ui'
import { Application } from '@/components/Application'
import { Layout } from '@/layout/default'
import { Tabs } from '@/components/Tabs'
import { SerialPortManagementDrawer } from '@/components/SerialPortManagementDrawer'
import { MapView } from '@/views/BDMeteorologicalDataDisplayPlatform/MapView'
import { SerialPortReceivingMessageView } from '@/components/SerialPort'
</script>

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,44 @@
<template>
<Application>
<Layout>
<n-space vertical>
<DataProtocolView ref="dataProtocolViewRef" @refresh="onRefresh" />
<DataFormView ref="dataFormViewRef" @submit="onSubmit" />
<CorrectAnswerView ref="correctAnswerViewRef" />
</n-space>
</Layout>
</Application>
</template>
<script setup lang="ts">
import { ref, toRaw } from 'vue'
import { NSpace } from 'naive-ui'
import { Application } from '@/components/Application'
import { Layout } from '@/layout/default'
import { DataFormView } from '@/views/BDMeteorologicalDataProtocol/DataFormView'
import DataProtocolView from '@/views/BDMeteorologicalDataProtocol/DataProtocolView.vue'
import CorrectAnswerView from '@/views/BDMeteorologicalDataProtocol/CorrectAnswerView.vue'
const dataProtocolViewRef = ref()
const dataFormViewRef = ref()
const correctAnswerViewRef = ref()
let originalData
const onRefresh = data => {
if (!data) return
originalData = toRaw(data)
dataFormViewRef.value.setOriginalData(originalData)
correctAnswerViewRef.value.clearAnswer()
}
const onSubmit = () => correctAnswerViewRef.value.showAnswer(originalData)
</script>
<style lang="less" scoped>
.n-layout {
:deep(.n-layout-scroll-container) {
padding: 8px 24px;
}
}
</style>

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,101 @@
<template>
<Application>
<Layout class="layout">
<template #header>
<InteractionView @read="onRead" @play="onPlay" @clear="onClear" @delete="onDelete" />
</template>
<MapView ref="mapViewRef" :path="path" />
</Layout>
</Application>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { Application } from '@/components/Application'
import { default as Layout } from '@/layout/absolute/FixHeader.vue'
import MapView from '@/views/BDPositionTrackRetracing/MapView.vue'
import InteractionView from '@/views/BDPositionTrackRetracing/InteractionView.vue'
import { lonlat2Position } from '@/components/Map'
import { hasIpcRenderer } from '@/utils'
const mapViewRef = ref()
const path = ref()
const onRead = () => {
const positions = readDataFromTFCard()
if (!positions || positions.length < 2) {
alert('读取数据出错')
return
}
path.value = positions
}
const onPlay = () => mapViewRef.value.play()
const onClear = () => path.value.length = 0
const onDelete = (count: number) => {
if (count <= 0 || !path.value || path.value.length < 2) return
path.value.splice(0, count)
}
const readDataFromTFCard = () => {
if (!hasIpcRenderer()) {
alert('当前浏览器环境不支持轨迹数据读取')
return
}
const { err, data } = window.ipcRenderer.sendSync('GET_DATA')
if (err) {
alert(err.message)
return
}
const positions = handleData(data)
return positions
}
const handleData = (data: string) => {
if (!data) return
const protocols = data.split('\r\n')
const positions = []
for (let i = 0; i < protocols.length; i++) {
const protocol = protocols[i];
if(isMeetFormat(protocol)) {
const items = protocol.split(',')
const lon = parseFloat((items[8] === 'E' ? '' : '-') + items[7])
const lat = parseFloat((items[6] === 'N' ? '' : '-') + items[5])
positions.push(lonlat2Position(lon, lat))
}
}
return positions
}
const regexp = /@(V|W),\w{4,6},(\d|-){10},(\d|:){8},A,\d{1,2}\.\d{6},(N|S),\d{1,3}\.\d{6},(E|W),[^*]*\*$/
const isMeetFormat = (protocol: string) => {
if (regexp.test(protocol)) {
return true
} else {
return false
}
}
</script>
<style scoped lang="less">
.layout {
--hwa-header-height: 60px;
:deep(.n-layout-header) {
z-index: 10;
height: var(--hwa-header-height);
}
:deep(.n-layout-content) {
padding-top: var(--hwa-header-height);
}
}
</style>

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,27 @@
<template>
<Application>
<Layout>
<!-- TODO: 优化Tabs, TabPane组件tab添加图标 -->
<Tabs default-value="satellite" class="h-full">
<n-tab-pane display-directive="show:lazy" tab="卫星" name="satellite">
<SatelliteModelView class="w-h-full" />
</n-tab-pane>
<n-tab-pane display-directive="show:lazy" tab="信息" name="message">
<SerialPortReceivingMessageView class="h-full" />
</n-tab-pane>
</Tabs>
</Layout>
<SerialPortManagementDrawer />
</Application>
</template>
<script setup lang="ts">
import { NTabPane } from 'naive-ui'
import { Application } from '@/components/Application'
import { Layout } from '@/layout/default'
import { Tabs } from '@/components/Tabs'
import { SerialPortManagementDrawer } from '@/components/SerialPortManagementDrawer'
import { SatelliteModelView } from '@/views/BDSatellite3DPostureControl/SatelliteModelView'
import { SerialPortReceivingMessageView } from '@/components/SerialPort'
</script>

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,16 @@
<template>
<Application>
<Layout>
<RemoteControlView class="h-full" />
</Layout>
<SerialPortManagementDrawer />
</Application>
</template>
<script setup lang="ts">
import { Application } from '@/components/Application'
import { Layout } from '@/layout/default'
import { SerialPortManagementDrawer } from '@/components/SerialPortManagementDrawer'
import { RemoteControlView } from '@/views/BDSatelliteAttitudeControl/RemoteControlView'
</script>

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,42 @@
<template>
<Application>
<Layout>
<!-- TODO: 优化Tabs, TabPane组件tab添加图标 -->
<Tabs default-value="monitor" class="h-full">
<n-tab-pane display-directive="show:lazy" tab="监测" name="monitor">
<ParameterMonitoringView class="w-h-full" />
</n-tab-pane>
<n-tab-pane display-directive="show:lazy" tab="信息" name="message">
<SerialPortReceivingMessageView class="h-full" />
</n-tab-pane>
</Tabs>
</Layout>
<SerialPortManagementDrawer />
</Application>
</template>
<script setup lang="ts">
import { NTabPane } from 'naive-ui'
import { Application } from '@/components/Application'
import { Layout } from '@/layout/default'
import { Tabs } from '@/components/Tabs'
import { SerialPortManagementDrawer } from '@/components/SerialPortManagementDrawer'
import { SerialPortReceivingMessageView } from '@/components/SerialPort'
import { ParameterMonitoringView } from '@/views/BDSatelliteParameterMonitoringPlatform/ParameterMonitoringView'
</script>
<style scoped lang="less">
// pane
.n-tab-pane {
display: flex;
place-items: center;
}
.drawer-control-button {
position: fixed;
right: 80px;
bottom: 100px;
box-shadow: rgb(0 0 0 / 12%) 0px 2px 8px 0px;
}
</style>

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,26 @@
<template>
<Application>
<Layout>
<n-space class="h-full" :item-style="itemStyle">
<SystemTimingView class="h-full" />
<CustomTimingView class="h-full" />
</n-space>
</Layout>
<SerialPortManagementDrawer />
</Application>
</template>
<script setup lang="ts">
import { NSpace } from 'naive-ui'
import { Application } from '@/components/Application'
import { default as Layout } from '@/layout/absolute/Default.vue'
import { SerialPortManagementDrawer } from '@/components/SerialPortManagementDrawer'
import { SystemTimingView } from '@/views/BDSatelliteTimeConfiguration/SystemTimingView'
import { CustomTimingView } from '@/views/BDSatelliteTimeConfiguration/CustomTimingView'
const itemStyle = {
flex: '1 1 0%',
}
</script>

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,35 @@
<template>
<Application>
<Layout>
<!-- TODO: 优化Tabs, TabPane组件tab添加图标 -->
<Tabs default-value="screen_config" class="h-full">
<n-tab-pane display-directive="show:lazy" tab="屏幕" name="screen_config">
<ScreenConfigView class="h-full" />
</n-tab-pane>
<n-tab-pane display-directive="show:lazy" tab="声音检测模块" name="sound_detection_module_config">
<SoundDetectionModuleConfigView class="h-full" />
</n-tab-pane>
<n-tab-pane display-directive="show:lazy" tab="手势识别" name="gesture_recognition_config">
<GestureRecognitionConfigView class="h-full" />
</n-tab-pane>
<n-tab-pane display-directive="show:lazy" tab="动画" name="animation_config">
<AnimationConfigView class="h-full" />
</n-tab-pane>
</Tabs>
</Layout>
<SerialPortManagementDrawer />
</Application>
</template>
<script setup lang="ts">
import { NTabPane } from 'naive-ui'
import { Application } from '@/components/Application'
import { Layout } from '@/layout/default'
import { Tabs } from '@/components/Tabs'
import { ScreenConfigView } from '@/views/ClockConfig/ScreenConfigView'
import { AnimationConfigView } from '@/views/ClockConfig/AnimationConfigView'
import { GestureRecognitionConfigView } from '@/views/ClockConfig/GestureRecognitionConfigView'
import { SoundDetectionModuleConfigView } from '@/views/ClockConfig/SoundDetectionModuleConfigView'
import { SerialPortManagementDrawer } from '@/components/SerialPortManagementDrawer'
</script>

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,45 @@
<template>
<Application>
<Layout>
<div class="w-h-full flex result-view-container">
<ResultView :start_point="start_point" :end_point="end_point" />
</div>
<PointInfoInputFormView class="point-info-input-form-view" @submit="onSubmit" @reset="onReset" />
</Layout>
</Application>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { Application } from '@/components/Application'
import { default as Layout } from '@/layout/absolute/Default.vue'
import ResultView from '@/views/DistanceCalculationTool/ResultView.vue'
import { PointInfoInputFormView } from '@/views/DistanceCalculationTool/PointInfoInputFormView'
const start_point = ref(null)
const end_point = ref(null)
const onSubmit = (value) => {
if (!value) return
start_point.value = [value.start_point.lng, value.start_point.lat]
end_point.value = [value.end_point.lng , value.end_point.lat]
}
const onReset = () => {
start_point.value = null
end_point.value = null
}
</script>
<style scoped lang="less">
.result-view-container {
align-items: center;
justify-content: center;
}
.point-info-input-form-view {
position: absolute;
top: 10px;
left: 15px;
}
</style>

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,56 @@
<template>
<Application>
<Layout>
<n-space vertical justify="space-between" :item-style="itemStyle" class="electronic-screen-design h-full">
<n-space align="center" :item-style="itemStyle" class="top-container">
<ColorPickerView class="color-picker-view" ref="colorPickerViewRef" @change="changeLEDPanelColor" />
<ClearButtonView class="clear-button-view" @clear="onClear" />
</n-space>
<LEDPanelView ref="ledPanelViewRef" />
</n-space>
</Layout>
<SerialPortManagementDrawer />
</Application>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { NSpace } from 'naive-ui'
import { Application } from '@/components/Application'
import { default as Layout } from '@/layout/absolute/Default.vue'
import { SerialPortManagementDrawer } from '@/components/SerialPortManagementDrawer'
import { LEDPanelView } from '@/views/ElectronicScreenDesign/LEDPanelView'
import ColorPickerView from '@/views/ElectronicScreenDesign/ColorPickerView.vue'
import ClearButtonView from '@/views/ElectronicScreenDesign/ClearButtonView.vue'
const itemStyle = {
flex: '1 1 50%',
textAlign: 'center',
}
const ledPanelViewRef = ref()
const onClear = () => ledPanelViewRef.value.clear()
const colorPickerViewRef = ref()
const changeLEDPanelColor = () => ledPanelViewRef.value.changeColor(colorPickerViewRef.value.$el.value)
onMounted(changeLEDPanelColor)
</script>
<style scoped lang="less">
.electronic-screen-design {
.top-container {
width: 100vw;
height: 100%;
gap: 0 !important;
.color-picker-view, .clear-button-view {
transform: scale(2)
}
}
}
</style>

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,23 @@
<template>
<Application>
<Layout>
<Tabs default-value="dot_matrix_screen_display" class="h-full">
<n-tab-pane display-directive="show:lazy" tab="点阵显示" name="dot_matrix_screen_display">
<DotMatrixScreenDisplayView class="h-full" />
</n-tab-pane>
<n-tab-pane display-directive="show:lazy" tab="编辑字库" name="edit_font">
<EditFontView class="h-full" />
</n-tab-pane>
</Tabs>
</Layout>
</Application>
</template>
<script setup lang="ts">
import { NTabPane } from 'naive-ui'
import { Application } from '@/components/Application'
import { Layout } from '@/layout/default'
import { Tabs } from '@/components/Tabs'
import { EditFontView } from '@/views/FontDesign/EditFontView'
import { DotMatrixScreenDisplayView } from '@/views/FontDesign/DotMatrixScreenDisplayView'
</script>

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,46 @@
<template>
<Application>
<Layout :siderAttrs="siderAttrs" class="layout">
<template #sider>
<SatelliteDataFormView @submit="onSubmit" @clear="onClear" />
</template>
<template #default>
<ConstellationChartView ref="constellationChartViewRef" />
</template>
</Layout>
</Application>
</template>
<script setup lang="ts">
import { ref, toRaw, provide } from 'vue'
import { Application } from '@/components/Application'
import { default as Layout } from '@/layout/absolute/RightSider.vue'
import { SatelliteDataFormView } from '@/views/GeneratingConstellationChart/SatelliteDataFormView'
import ConstellationChartView from '@/views/GeneratingConstellationChart/ConstellationChartView.vue'
import { Satellite } from '@/api/satellite/type.d'
const satellites = ref([new Satellite()])
provide('satellites', satellites)
const constellationChartViewRef = ref()
const onSubmit = () => constellationChartViewRef.value.update(toRaw(satellites))
const onClear = () => constellationChartViewRef.value.clear()
const siderAttrs = { bordered: true }
</script>
<style scoped lang="less">
.layout {
--hwa-sider-width: 500px;
:deep(.n-layout-sider) {
width: var(--hwa-sider-width) !important;
max-width: var(--hwa-sider-width) !important;
}
:deep(.n-layout-content) {
margin-right: var(--hwa-sider-width);
}
}
</style>

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,40 @@
<template>
<Application>
<Layout>
<!-- TODO: 优化Tabs, TabPane组件tab添加图标 -->
<Tabs default-value="param_config" class="h-full">
<n-tab-pane display-directive="show:lazy" tab="参数配置" name="param_config">
<ParamConfigView class="h-full" />
</n-tab-pane>
<n-tab-pane display-directive="show:lazy" tab="手势识别" name="gesture_animation">
<GestureAnimationView class="mx-auto" />
</n-tab-pane>
<n-tab-pane display-directive="show:lazy" tab="信息" name="message">
<SerialPortReceivingMessageView class="h-full" />
</n-tab-pane>
</Tabs>
</Layout>
<SerialPortManagementDrawer />
</Application>
</template>
<script setup lang="ts">
import { NTabPane } from 'naive-ui'
import { Application } from '@/components/Application'
import { Layout } from '@/layout/default'
import { Tabs } from '@/components/Tabs'
import { ParamConfigView } from '@/views/GestureRecognition/ParamConfigView'
import GestureAnimationView from '@/views/GestureRecognition/GestureAnimationView.vue'
import { SerialPortManagementDrawer } from '@/components/SerialPortManagementDrawer'
import { SerialPortReceivingMessageView } from '@/components/SerialPort'
</script>
<style scoped lang="less">
.n-tabs {
.n-tab-pane:nth-child(3) {
display: flex;
place-items: center;
}
}
</style>

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,51 @@
<template>
<Application>
<Layout>
<n-space justify="space-between" align="center" vertical class="nixie-tube-configuration-view h-full">
<NixieTubeSelectView />
<NixieTubeControlView />
<SendCMDButtonView />
</n-space>
</Layout>
<SerialPortManagementDrawer />
</Application>
</template>
<script setup lang="ts">
import { ref, provide } from 'vue'
import { NSpace } from 'naive-ui'
import { Application } from '@/components/Application'
import { default as Layout } from '@/layout/absolute/Default.vue'
import { SerialPortManagementDrawer } from '@/components/SerialPortManagementDrawer'
import { NixieTubeSelectView } from '@/views/NixieTubeConfiguration/NixieTubeSelectView'
import { NixieTubeControlView } from '@/views/NixieTubeConfiguration/NixieTubeControlView'
import SendCMDButtonView from '@/views/NixieTubeConfiguration/SendCMDButtonView.vue'
const FOUR_DIGIT_TUBE_NUM = 5
const DIGIT_TUBE_NUM_OF_FOUR_DIGIT_TUBE = 4
const LED_NUM_OF_DIGIT_TUBE = 8
const dataArr = ref(new Array(FOUR_DIGIT_TUBE_NUM))
for (let i = 0; i < FOUR_DIGIT_TUBE_NUM; i++) {
dataArr.value[i] = new Array(DIGIT_TUBE_NUM_OF_FOUR_DIGIT_TUBE)
for (let j = 0; j < DIGIT_TUBE_NUM_OF_FOUR_DIGIT_TUBE; j++) {
dataArr.value[i][j] = new Array(LED_NUM_OF_DIGIT_TUBE).fill(0)
}
}
provide('dataArr', dataArr)
const current = ref(0)
provide('current', current)
</script>
<style lang="less" scoped>
.nixie-tube-configuration-view {
padding: 5vh;
:deep(>div:nth-child(2)) {
width: 100%;
}
}
</style>

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,46 @@
<template>
<Application>
<Layout>
<!-- TODO: 优化Tabs, TabPane组件tab添加图标 -->
<Tabs default-value="monitor" class="h-full">
<n-tab-pane display-directive="show:lazy" tab="监测" name="monitor">
<MonitorView class="h-full" />
</n-tab-pane>
<n-tab-pane display-directive="show:lazy" tab="设备" name="select_device">
<SelectDeviceView />
</n-tab-pane>
<n-tab-pane display-directive="show:lazy" tab="信息" name="message">
<SerialPortReceivingMessageView class="h-full" />
</n-tab-pane>
</Tabs>
</Layout>
<SerialPortManagementDrawer />
</Application>
</template>
<script setup lang="ts">
import { NTabPane } from 'naive-ui'
import { Application } from '@/components/Application'
import { Layout } from '@/layout/default'
import { Tabs } from '@/components/Tabs'
import { SerialPortManagementDrawer } from '@/components/SerialPortManagementDrawer'
import { SerialPortReceivingMessageView } from '@/components/SerialPort'
import { SelectDeviceView } from '@/views/VoltageMonitoring/SelectDeviceView'
import { MonitorView } from '@/views/VoltageMonitoring/MonitorView'
</script>
<style scoped lang="less">
// pane
.n-tab-pane {
display: flex;
place-items: center;
}
.drawer-control-button {
position: fixed;
right: 80px;
bottom: 100px;
box-shadow: rgb(0 0 0 / 12%) 0px 2px 8px 0px;
}
</style>

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,37 @@
<template>
<Application>
<Layout>
<n-space align="center" :item-style="itemStyle" class="h-full">
<SketchMapView />
<ConfigurationParameterFormView class="config-param-form-view" />
</n-space>
</Layout>
<SerialPortManagementDrawer />
</Application>
</template>
<script setup lang="ts">
import { NSpace } from 'naive-ui'
import { Application } from '@/components/Application'
import { default as Layout } from '@/layout/absolute/Default.vue'
import { SerialPortManagementDrawer } from '@/components/SerialPortManagementDrawer'
import SketchMapView from '@/views/WirelessCommunicationModuleConfiguration/SketchMapView.vue'
import { ConfigurationParameterFormView } from '@/views/WirelessCommunicationModuleConfiguration/ConfigurationParameterFormView'
const itemStyle = {
flex: '1 1 50%',
textAlign: 'center',
}
</script>
<style scoped lang="less">
.n-space {
gap: 0 !important;
.config-param-form-view {
margin: 0 80px;
}
}
</style>

View File

@ -0,0 +1 @@
export { default as App } from './index.vue'

View File

@ -0,0 +1,65 @@
<template>
<Application>
<Layout class="layout">
<template #header>
<HeaderView />
</template>
<template #default>
<router-view />
<ToolbarView @systemSettings="onSystemSettings" @quickBurning="onQuickBurning" @connectUs="onConnectUs" />
</template>
</Layout>
<SystemSettingsModalView ref="systemSettingsModalRef" />
<QuickBurningModalView ref="quickBurningModalRef" />
<ConnectUsModalView ref="connectUsModalRef" />
</Application>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { Application } from '@/components/Application'
import { default as Layout } from '@/layout/absolute/FixHeader.vue'
import { HeaderView } from '@/views/index/HeaderView'
import { ToolbarView } from '@/views/index/ToolbarView'
import { ConnectUsModalView } from '@/views/index/ConnectUsModalView'
import { QuickBurningModalView } from '@/views/index/QuickBurningModalView'
import { SystemSettingsModalView } from '@/views/index/SystemSettingsModalView'
const systemSettingsModalRef = ref(null)
const onSystemSettings = () => systemSettingsModalRef.value.openModel()
const quickBurningModalRef = ref(null)
const onQuickBurning = () => quickBurningModalRef.value.show()
const connectUsModalRef = ref(null)
const onConnectUs = () => connectUsModalRef.value.show()
</script>
<style scoped lang="less">
.layout {
--hwa-header-height: 56px;
--hwa-text-color: rgb(250, 250, 252);
:deep(> .n-layout-scroll-container) {
>.n-layout-header {
z-index: 10;
background-color: transparent;
height: var(--hwa-header-height);
padding-top: 8px;
}
>.n-layout-content {
.toolbar {
position: fixed;
top: 50px;
right: 24px;
z-index: 100;
}
}
}
}
</style>