信号类型改成下拉

This commit is contained in:
jingna 2026-06-12 17:33:11 +08:00
parent 7275a66698
commit 125604daf1
3 changed files with 38 additions and 29 deletions

View File

@ -30,7 +30,7 @@ const channelList = ref<ChannelItem[]>([
{ channel_no: 11, singal_type: '4~20mA', output_node: '', limit_low: 0, limit_high: 8, delay: 8, enabled: false }, { channel_no: 11, singal_type: '4~20mA', output_node: '', limit_low: 0, limit_high: 8, delay: 8, enabled: false },
{ channel_no: 12, singal_type: '1~5V', output_node: '', limit_low: 0, limit_high: 8, delay: 8, enabled: false }, { channel_no: 12, singal_type: '1~5V', output_node: '', limit_low: 0, limit_high: 8, delay: 8, enabled: false },
]) ])
const signalTypeOptions = ref(['1~5V', '4~20mA'])
const nodeOptions = ref(['开出一', '开出二', '开出三', '开出四', '开出五', '开出六', '开出七', '开出八', '开出九', '开出十', '开出十一', '开出十二']) const nodeOptions = ref(['开出一', '开出二', '开出三', '开出四', '开出五', '开出六', '开出七', '开出八', '开出九', '开出十', '开出十一', '开出十二'])
const isswitch = ref(false) const isswitch = ref(false)
const dialogVisible = ref(false) const dialogVisible = ref(false)
@ -111,11 +111,14 @@ onMounted(() => {
<div class="row" v-for="(item, idx) in channelList" :key="idx"> <div class="row" v-for="(item, idx) in channelList" :key="idx">
<div class="cell cell-no">{{ item.channel_no }}</div> <div class="cell cell-no">{{ item.channel_no }}</div>
<div class="cell cell-type" style="background: #ffffff;"> <div class="cell cell-type" style="background: #ffffff;">
<el-input <!-- <el-input
v-model="item.singal_type" v-model="item.singal_type"
placeholder="" placeholder=""
disabled disabled
/> /> -->
<el-select v-model="item.singal_type">
<el-option v-for="line in signalTypeOptions" :key="line" :value="line" :label="line"></el-option>
</el-select>
</div> </div>
<div class="cell cell-line" style="background: #ffffff;"> <div class="cell cell-line" style="background: #ffffff;">
<el-input-number v-model="item.limit_low" <el-input-number v-model="item.limit_low"

View File

@ -36,6 +36,7 @@ interface ChannelItem {
limit_low: number limit_low: number
limit_high: number limit_high: number
} }
const signalTypeOptions = ref(['1~5V', '4~20mA'])
const currentInputType = ref('') const currentInputType = ref('')
const openKeyboard = (index: number, value: number, type: string) => { const openKeyboard = (index: number, value: number, type: string) => {
currentInputType.value = type currentInputType.value = type
@ -126,7 +127,9 @@ onMounted(() => {
<div class="row" v-for="(item, idx) in channelList" :key="idx"> <div class="row" v-for="(item, idx) in channelList" :key="idx">
<div class="cell cell-no">{{ item.ch }}</div> <div class="cell cell-no">{{ item.ch }}</div>
<div class="cell cell-type" style="background: #ffffff;"> <div class="cell cell-type" style="background: #ffffff;">
<el-input disabled v-model="item.singal_type" placeholder="" /> <el-select v-model="item.singal_type">
<el-option v-for="line in signalTypeOptions" :key="line" :value="line" :label="line"></el-option>
</el-select>
</div> </div>
<div class="cell cell-line" style="background: #ffffff;"> <div class="cell cell-line" style="background: #ffffff;">
<el-select v-model="item.line_no"> <el-select v-model="item.line_no">
@ -301,5 +304,6 @@ onMounted(() => {
color: #606266; color: #606266;
-webkit-text-fill-color: #606266; -webkit-text-fill-color: #606266;
} }
// + // +
</style> </style>

View File

@ -42,7 +42,7 @@ const openKeyboard = (index: number, value: number, type: string) => {
currentInputValue.value = value currentInputValue.value = value
keyboardVisible.value = true keyboardVisible.value = true
} }
const signalTypeOptions = ref(['1~5V', '4~20mA'])
const handleKeyboardConfirm = (value: string) => { const handleKeyboardConfirm = (value: string) => {
if (currentInputIndex.value >= 0) { if (currentInputIndex.value >= 0) {
const channel = channelList.value[currentInputIndex.value] const channel = channelList.value[currentInputIndex.value]
@ -124,7 +124,9 @@ onMounted(() => {
<div class="row" v-for="(item, idx) in channelList" :key="idx"> <div class="row" v-for="(item, idx) in channelList" :key="idx">
<div class="cell cell-no">{{ item.ch }}</div> <div class="cell cell-no">{{ item.ch }}</div>
<div class="cell cell-type" style="background: #ffffff;"> <div class="cell cell-type" style="background: #ffffff;">
<el-input v-model="item.singal_type" disabled placeholder="" /> <el-select v-model="item.singal_type">
<el-option v-for="line in signalTypeOptions" :key="line" :value="line" :label="line"></el-option>
</el-select>
</div> </div>
<div class="cell cell-line" style="background: #ffffff;"> <div class="cell cell-line" style="background: #ffffff;">
<el-select v-model="item.line_no"> <el-select v-model="item.line_no">