Commit d82ce0d8 authored by 张耀's avatar 张耀

feat:

优化逻辑和样式
parent 28134d58
...@@ -24,14 +24,32 @@ ...@@ -24,14 +24,32 @@
</el-form-item> </el-form-item>
<div class="duration"> <div class="duration">
<el-form-item label="持续时间" prop="time"> <el-form-item label="持续时间" prop="time">
<span>当预警持续</span> <el-input v-model="state.form.time" placeholder="请输入持续时间" @input="inputNum">
<el-input v-model="state.form.time" placeholder="请输入持续时间" @input="inputNum"></el-input> <template #prepend>
</el-form-item> <span>当预警持续</span>
<el-form-item label="" class="no-el-label"> </template>
<el-select v-model="state.form.unit" placeholder="请选择"> <template #append>
<el-option v-for="(value, key) in unitOptions" :key="key" :label="value.label" :value="key"> </el-option> <el-select v-model="state.form.unit" placeholder="请选择">
</el-select> <el-option v-for="(value, key) in unitOptions" :key="key" :label="value.label" :value="key">
<span>时产生报警</span> </el-option>
</el-select>
</template>
</el-input>
<span class="duration-append">
<span> 时产生报警 </span>
<el-popover
:width="300"
title=""
content="大于等于0的正整数,等于0时代表直接报警"
trigger="hover"
placement="top-start">
<template #reference>
<bg-icon
style="font-size: 12px; color: #a9b1c7; margin-left: 8px; vertical-align: middle"
icon="#bg-ic-s-circle-tips"></bg-icon>
</template>
</el-popover>
</span>
</el-form-item> </el-form-item>
</div> </div>
<el-form-item label="检查周期" prop="inspection_cycle"> <el-form-item label="检查周期" prop="inspection_cycle">
...@@ -108,6 +126,8 @@ const inputNum = () => { ...@@ -108,6 +126,8 @@ const inputNum = () => {
let { max } = unitOptions[state.form.unit]; let { max } = unitOptions[state.form.unit];
if (time > +max) { if (time > +max) {
state.form.time = max; state.form.time = max;
ElMessage.closeAll();
ElMessage.error(`最大值:${max}`);
} }
}; };
// 检查周期下拉数据 // 检查周期下拉数据
...@@ -169,27 +189,44 @@ defineExpose({ ...@@ -169,27 +189,44 @@ defineExpose({
margin-top: 0; margin-top: 0;
} }
} }
.duration { .duration {
flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; :deep(.el-form-item) {
:deep(.el-form-item__content) { flex: 1;
display: flex; .el-input {
align-items: center; margin-right: 8px;
gap: 8px;
> .el-input {
flex: 1; flex: 1;
width: 80px;
} }
} .el-input-group__prepend {
.no-el-label { width: 102px;
:deep(.el-form-item__content) { border-radius: 4px;
margin-left: 0 !important; border-top-right-radius: 0;
.el-select { border-bottom-right-radius: 0;
width: 80px; }
} .el-input-group__append {
width: 80px;
border-radius: 4px;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
} }
} }
// :deep(.el-form-item__content) {
// display: flex;
// align-items: center;
// gap: 8px;
// > .el-input {
// flex: 1;
// width: 80px;
// }
// }
}
.duration-append {
display: flex;
align-items: center;
color: #404a62;
} }
:deep(.el-switch__inner) { :deep(.el-switch__inner) {
.is-hide { .is-hide {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment