<script setup>
|
|
import {ref} from "vue";
|
// 连接模式
|
const mode = ref(2);
|
// 设备编号
|
const deviceId = ref(1);
|
const com = ref();
|
const data = ref( [
|
]);
|
</script>
|
|
<template>
|
<div class="app-container">
|
<a-card >
|
<div class="card-box">
|
<div class="flex-1 " style="margin-right: 10px">
|
<Section title="连接模式">
|
<a-radio-group v-model:value="mode">
|
<a-radio :value="1">USB</a-radio>
|
<a-radio :value="2">Serial Port</a-radio>
|
</a-radio-group>
|
</Section>
|
|
<Section title="设备编号">
|
<a-input v-model:value="deviceId" placeholder="请输入" />
|
</Section>
|
|
<Section title="串口号">
|
<a-select
|
ref="select"
|
v-model:value="com"
|
style="width: 100%;"
|
@change="handleChange"
|
>
|
<a-select-option value="jack">COM1</a-select-option>
|
<a-select-option value="lucy">COM2</a-select-option>
|
</a-select>
|
</Section>
|
|
<Section title="波特率">
|
<a-select
|
ref="select"
|
v-model:value="com"
|
style="width: 100%;"
|
@change="handleChange"
|
>
|
<a-select-option value="jack">COM1</a-select-option>
|
<a-select-option value="lucy">COM2</a-select-option>
|
</a-select>
|
</Section>
|
<div style="margin-top: 20px;text-align: right;">
|
<a-button style="margin-right: 20px;width: 150px">连接设备</a-button>
|
<a-button style="width: 150px">断开连接</a-button>
|
</div>
|
</div>
|
<div class="flex-1 box-right">
|
<div class="box-right-body">
|
<a-list bordered :data-source="data" :locale="{emptyText: ' '}" class="aList">
|
<template #renderItem="{ item }">
|
<a-list-item>{{ item }}</a-list-item>
|
</template>
|
</a-list>
|
</div>
|
</div>
|
</div>
|
|
|
</a-card>
|
</div>
|
</template>
|
|
<style scoped lang="less">
|
.card-box{
|
display: flex;
|
justify-content: space-between;
|
}
|
.flex-1{
|
flex:1
|
}
|
.box-right{
|
border-left: 1px dashed #e9e9e9;
|
|
.box-right-body{
|
margin-left: 10px;
|
border-radius: 10px;
|
background: #fafafa;
|
width: 100%;
|
height: 100%;
|
box-sizing: border-box;
|
padding: 10px;
|
font-size: 14px;
|
.aList{
|
overflow: auto;
|
height: 330px;
|
}
|
}
|
}
|
</style>
|