Files
bdqh-course-platform-master/src/render/views/ClockConfig/SoundDetectionModuleConfigView/index.vue

36 lines
858 B
Vue
Raw Normal View History

2023-10-13 16:43:53 +08:00
<template>
<n-space vertical justify="center" class="sound-detect-module-config-view">
<div>
<n-select
placeholder="请设置声音检测模块事件"
v-model:value="value"
:options="options"
@update:value="onSelectUpdate"
class="mx-auto"
style="width: 50%; "/>
</div>
<ResetButtonView />
</n-space>
</template>
<script setup lang="ts">
import { ref } from 'vue'
2023-11-29 16:08:12 +08:00
import { NSpace, NSelect } from 'naive-ui'
2023-10-13 16:43:53 +08:00
import ResetButtonView from '../ResetButtonView.vue'
import { options } from './data'
const value = ref(null)
const onSelectUpdate = () => {
let cmd = `$SDEVENT,${value.value}*`
cmd += cmd.length
cmd += '\r\n'
2023-11-29 16:08:12 +08:00
window.ipcRenderer.send('COM_WRITE',cmd)
2023-10-13 16:43:53 +08:00
}
</script>
<style scoped lang="less">
.sound-detect-module-config-view {
row-gap: 48px !important;
}
</style>