修改定值

This commit is contained in:
jingna 2026-05-28 18:13:33 +08:00
parent adc57779a4
commit 166b94ec71

View File

@ -26,17 +26,17 @@ const lineTabs = ref([
])
const activeTab = ref('1')
const infoList = ref({
line_no:1,
fault_alarm:[
{category:'PT断线',delay:0,enabled:false,output_node:'',limit:0},
{category:'CT断线',delay:0,enabled:false,output_node:'',limit:0},
line_no: 1,
fault_alarm: [
{ category: 'PT断线', delay: 0, enabled: false, output_node: '', limit: 0 },
{ category: 'CT断线', delay: 0, enabled: false, output_node: '', limit: 0 },
],
over_limit_alarm:[
{category:'电压',delay:0,enabled:false,output_node:'',limit:0},
{category:'电流',delay:0,enabled:false,output_node:'',limit:0},
{category:'差流',delay:0,enabled:false,output_node:'',limit:0},
{category:'功率',delay:0,enabled:false,output_node:'',limit:0},
{category:'频率',delay:0,enabled:false,output_node:'',limit:0},
over_limit_alarm: [
{ category: '电压', delay: 0, enabled: false, output_node: '', limit: 0 },
{ category: '电流', delay: 0, enabled: false, output_node: '', limit: 0 },
{ category: '差流', delay: 0, enabled: false, output_node: '', limit: 0 },
{ category: '功率', delay: 0, enabled: false, output_node: '', limit: 0 },
{ category: '频率', delay: 0, enabled: false, output_node: '', limit: 0 },
],
})
const options = ref([
@ -104,7 +104,7 @@ const cleardata = () => {
})
}
const currentLine = ref(1)
const handleTabClick = (tab:string) => {
const handleTabClick = (tab: string) => {
activeTab.value = tab
infoList.value.line_no = Number(tab)
currentLine.value = Number(tab)
@ -118,26 +118,26 @@ const init = () => {
fetchLineAlarmSetting(currentLine.value).then(res => {
infoList.value.line_no = res.line_no
cleardata()
res.fault_alarm.forEach(item => {
infoList.value.fault_alarm.forEach((faultItem, idx) => {
if (faultItem.category === item.category) {
faultItem.delay = item.delay
faultItem.enabled = item.enabled
faultItem.output_node = item.output_node
faultItem.limit = item.limit || 0
}
res.fault_alarm.forEach(item => {
infoList.value.fault_alarm.forEach((faultItem, idx) => {
if (faultItem.category === item.category) {
faultItem.delay = item.delay
faultItem.enabled = item.enabled
faultItem.output_node = item.output_node
faultItem.limit = item.limit || 0
}
})
})
})
res.over_limit_alarm.forEach(item => {
infoList.value.over_limit_alarm.forEach((overLimitItem, idx) => {
if (overLimitItem.category === item.category) {
overLimitItem.delay = item.delay
overLimitItem.enabled = item.enabled
overLimitItem.output_node = item.output_node
overLimitItem.limit = item.limit || 0
}
res.over_limit_alarm.forEach(item => {
infoList.value.over_limit_alarm.forEach((overLimitItem, idx) => {
if (overLimitItem.category === item.category) {
overLimitItem.delay = item.delay
overLimitItem.enabled = item.enabled
overLimitItem.output_node = item.output_node
overLimitItem.limit = item.limit || 0
}
})
})
})
})
}
const isswitch = ref(false)
@ -165,7 +165,7 @@ const handleSave = () => {
ElMessage.error('保存失败')
}
})
}else{
} else {
isswitch.value = false
dialogVisible.value = true
}
@ -201,90 +201,119 @@ const handleSave = () => {
<div class="tab-content-item">
<div class="tab-content-item-box box-height">限制</div>
<div class="tab-content-item-box box-color box-height">
<el-input-number v-model="infoList.over_limit_alarm[0].limit" style="width: 100%;" :controls="false" />
<el-input-number v-model="infoList.over_limit_alarm[0].limit" style="width: 100%;"
:controls="false" />
</div>
<div class="tab-content-item-box box-color box-height">
<el-input-number v-model="infoList.over_limit_alarm[1].limit" style="width: 100%;" :controls="false" />
<el-input-number v-model="infoList.over_limit_alarm[1].limit" style="width: 100%;"
:controls="false" />
</div>
<div class="tab-content-item-box box-color box-height">
<el-input-number v-model="infoList.over_limit_alarm[2].limit" style="width: 100%;" :controls="false" />
<el-input-number v-model="infoList.over_limit_alarm[2].limit" style="width: 100%;"
:controls="false" />
</div>
<div class="tab-content-item-box box-color box-height">
<el-input-number v-model="infoList.fault_alarm[0].delay" style="width: 100%;" :controls="false" />
<el-input-number v-model="infoList.fault_alarm[0].delay" style="width: 100%;"
:controls="false" />
</div>
<div class="tab-content-item-box box-color box-height">
<el-input-number v-model="infoList.fault_alarm[1].limit" style="width: 100%;" :controls="false" />
<el-input-number v-model="infoList.fault_alarm[1].limit" style="width: 100%;"
:controls="false" />
</div>
<div class="tab-content-item-box box-color box-height" style="border: none;">
<img src="@/assets/images/menuicon/noitem.png" style="width: 100%; height: 100%;" alt="">
<div class="tab-content-item-box box-color box-height"
style="display: flex;align-items: center;flex-direction: row;border: none;">
<div style="width: 60px;min-width: 60px;">PT变比</div>
<div class="tab-content-item-box box-color box-height">
<el-input-number v-model="infoList.fault_alarm[0].limit" style="width: 100%;"
:controls="false" />
</div>
</div>
<div class="tab-content-item-box box-color box-height" style="border: none;">
<img src="@/assets/images/menuicon/noitem.png" style="width: 100%; height: 100%;" alt="">
<div class="tab-content-item-box box-color box-height" style="display: flex;align-items: center;border: none;flex-direction: row;">
<div style="width: 60px;min-width: 60px;">CT变比</div>
<div class="tab-content-item-box box-color box-height">
<el-input-number v-model="infoList.fault_alarm[1].limit" style="width: 100%;"
:controls="false" />
</div>
</div>
</div>
<div class="tab-content-item">
<div class="tab-content-item-box box-height">延时s</div>
<div class="tab-content-item-box box-color box-height">
<el-input-number v-model="infoList.over_limit_alarm[0].delay" style="width: 100%;" :controls="false" />
<el-input-number v-model="infoList.over_limit_alarm[0].delay" style="width: 100%;"
:controls="false" />
</div>
<div class="tab-content-item-box box-color box-height">
<el-input-number v-model="infoList.over_limit_alarm[1].delay" style="width: 100%;" :controls="false" />
<el-input-number v-model="infoList.over_limit_alarm[1].delay" style="width: 100%;"
:controls="false" />
</div>
<div class="tab-content-item-box box-color box-height">
<el-input-number v-model="infoList.over_limit_alarm[2].delay" style="width: 100%;" :controls="false" />
<el-input-number v-model="infoList.over_limit_alarm[2].delay" style="width: 100%;"
:controls="false" />
</div>
<div class="tab-content-item-box box-color box-height">
<el-input-number v-model="infoList.over_limit_alarm[3].delay" style="width: 100%;" :controls="false" />
<el-input-number v-model="infoList.over_limit_alarm[3].delay" style="width: 100%;"
:controls="false" />
</div>
<div class="tab-content-item-box box-color box-height">
<el-input-number v-model="infoList.over_limit_alarm[4].delay" style="width: 100%;" :controls="false" />
<el-input-number v-model="infoList.over_limit_alarm[4].delay" style="width: 100%;"
:controls="false" />
</div>
<div class="tab-content-item-box box-color box-height">
<el-input-number v-model="infoList.fault_alarm[0].delay" style="width: 100%;" :controls="false" />
<el-input-number v-model="infoList.fault_alarm[0].delay" style="width: 100%;"
:controls="false" />
</div>
<div class="tab-content-item-box box-color box-height">
<el-input-number v-model="infoList.fault_alarm[1].delay" style="width: 100%;" :controls="false" />
<el-input-number v-model="infoList.fault_alarm[1].delay" style="width: 100%;"
:controls="false" />
</div>
</div>
<div class="tab-content-item">
<div class="tab-content-item-box box-height">输出节点</div>
<div class="tab-content-item-box box-height">输出节点</div>
<div class="tab-content-item-box box-color box-height">
<el-select v-model="infoList.over_limit_alarm[0].output_node">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-option v-for="item in options" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</div>
<div class="tab-content-item-box box-color box-height">
<el-select v-model="infoList.over_limit_alarm[1].output_node">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-option v-for="item in options" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</div>
<div class="tab-content-item-box box-color box-height">
<el-select v-model="infoList.over_limit_alarm[2].output_node">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-option v-for="item in options" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</div>
<div class="tab-content-item-box box-color box-height">
<el-select v-model="infoList.over_limit_alarm[3].output_node">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-option v-for="item in options" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</div>
<div class="tab-content-item-box box-color box-height">
<el-select v-model="infoList.over_limit_alarm[4].output_node">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-option v-for="item in options" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</div>
<div class="tab-content-item-box box-color box-height">
<el-select v-model="infoList.fault_alarm[0].output_node">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-option v-for="item in options" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</div>
<div class="tab-content-item-box box-color box-height">
<el-select v-model="infoList.fault_alarm[1].output_node">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-option v-for="item in options" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</div>
</div>
<div class="tab-content-item">
<div class="tab-content-item">
<div class="tab-content-item-box box-height">是否投入</div>
<div class="tab-content-item-box box-color box-height">
<el-switch v-model="infoList.over_limit_alarm[0].enabled"></el-switch>
@ -296,7 +325,7 @@ const handleSave = () => {
<el-switch v-model="infoList.over_limit_alarm[2].enabled"></el-switch>
</div>
<div class="tab-content-item-box box-color box-height">
<el-switch v-model="infoList.over_limit_alarm[3].enabled" ></el-switch>
<el-switch v-model="infoList.over_limit_alarm[3].enabled"></el-switch>
</div>
<div class="tab-content-item-box box-color box-height">
<el-switch v-model="infoList.over_limit_alarm[4].enabled"></el-switch>
@ -368,6 +397,7 @@ const handleSave = () => {
padding: 20px 20px;
min-height: max-content;
gap: 5px;
.tab-content-item {
width: calc(100% / 6);
display: flex;
@ -394,7 +424,8 @@ const handleSave = () => {
.box-color {
background-color: #ffffff;
}
.box-height{
.box-height {
height: 40px;
}
}
@ -410,21 +441,24 @@ const handleSave = () => {
}
}
}
:deep(.el-select__wrapper),
:deep(.el-input__wrapper) {
:deep(.el-input__wrapper) {
border: none !important;
box-shadow: none !important;
background: transparent !important;
text-align: center !important;
}
:deep(.el-select__wrapper.is-hover),
:deep(.el-input__wrapper.is-hover),
:deep(.el-select__wrapper.is-focused),
:deep(.el-input__wrapper.is-focused) {
}
:deep(.el-select__wrapper.is-hover),
:deep(.el-input__wrapper.is-hover),
:deep(.el-select__wrapper.is-focused),
:deep(.el-input__wrapper.is-focused) {
box-shadow: none !important;
border: none !important;
}
:deep(.el-input__inner){
}
:deep(.el-input__inner) {
text-align: center !important;
}
}
</style>