36 lines
858 B
Vue
36 lines
858 B
Vue
<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'
|
|
import { NSpace, NSelect } from 'naive-ui'
|
|
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'
|
|
window.ipcRenderer.send('COM_WRITE',cmd)
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
.sound-detect-module-config-view {
|
|
row-gap: 48px !important;
|
|
}
|
|
</style> |