学习机3.4.0版本
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
<n-space vertical justify="space-around" align="center" item-style="width: 50%;" class="gesture-recognition-config-view">
|
||||
<n-form-item size="large" label-placement="left" label="翻页动画时长:" path="animationDuration">
|
||||
<n-select
|
||||
:disabled="!serialPort.isOpen"
|
||||
placeholder="请选择翻页动画时长"
|
||||
v-model:value="model.animationDuration"
|
||||
:options="animationDurationOptions"
|
||||
@@ -16,7 +15,6 @@
|
||||
|
||||
<n-form-item size="large" label-placement="left" label="日期显示时长:" path="dateDisplayDuration">
|
||||
<n-select
|
||||
:disabled="!serialPort.isOpen"
|
||||
placeholder="请选择日期显示时长"
|
||||
v-model:value="model.dateDisplayDuration"
|
||||
:options="dateDisplayDurationOptions"
|
||||
@@ -36,43 +34,27 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { NSpace, NFormItem, NSelect, useMessage } from 'naive-ui'
|
||||
import { NSpace, NFormItem, NSelect } from 'naive-ui'
|
||||
import ResetButtonView from '../ResetButtonView.vue'
|
||||
import { animationDurationOptions, dateDisplayDurationOptions } from './data'
|
||||
import { useSerialPortStore } from '@/stores/serialPort'
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
const serialPort = useSerialPortStore()
|
||||
const model = ref({
|
||||
animationDuration : null,
|
||||
dateDisplayDuration: null,
|
||||
})
|
||||
|
||||
const onAnimationDurationUpdate = () => {
|
||||
if (!serialPort.isOpen) {
|
||||
message.error('请先连接无线通信模块并打开串口')
|
||||
return
|
||||
}
|
||||
|
||||
let cmd = `$SCANSP,${model.value.animationDuration}*`
|
||||
cmd += cmd.length
|
||||
cmd += '\r\n'
|
||||
|
||||
serialPort.write(cmd)
|
||||
window.ipcRenderer.send('COM_WRITE',cmd)
|
||||
}
|
||||
|
||||
const onDateDisplayDurationUpdate = () => {
|
||||
if (!serialPort.isOpen) {
|
||||
message.error('请先连接无线通信模块并打开串口')
|
||||
return
|
||||
}
|
||||
|
||||
let cmd = `$SETSDT,${model.value.dateDisplayDuration}*`
|
||||
cmd += cmd.length
|
||||
cmd += '\r\n'
|
||||
|
||||
serialPort.write(cmd)
|
||||
window.ipcRenderer.send('COM_WRITE',cmd)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user