Browse Source

机柜优化

develop
wangsixiang 2 weeks ago
parent
commit
2b6ac9c33b
  1. 52
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/IntegratedCabinet/components/AirConditioning.vue
  2. 33
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/IntegratedCabinet/components/DeviceControlDialog.vue

52
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/IntegratedCabinet/components/AirConditioning.vue

@ -148,37 +148,38 @@
Message.error("请求失败,请稍后再试");
});
},
validateInput(value) {
const intValue = parseInt(value, 10);
const limits = this.rangeLimits[this.controlObject];
if (isNaN(intValue) || intValue < limits.min || intValue > limits.max) {
this.errorMessage = `请输入 ${limits.min}-${limits.max} 之间的数字`;
if(this.controlObject=='000D'&&this.OOODValue!=''){
this.errorMessage += ` 当前值为:`+this.OOODValue;
this.openingPoint = this.OOODValue;
}else if(this.controlObject=='000E'&&this.OOOEValue!=''){
this.errorMessage += ` 当前值为:`+this.OOOEValue;
this.openingPoint = this.OOOEValue;
}else if(this.controlObject=='000F'&&this.OOOFValue!=''){
this.errorMessage += ` 当前值为:`+this.OOOFValue;
this.openingPoint = this.OOOFValue;
}else if(this.controlObject=='0010'&&this.OO1OValue!=''){
this.errorMessage += ` 当前值为:`+this.OO1OValue;
this.openingPoint = this.OO1OValue;
}
} else {
this.errorMessage = '';
this.openingPoint = '';
}
},
// validateInput(value) {
// const intValue = parseInt(value, 10);
// const limits = this.rangeLimits[this.controlObject];
// if (isNaN(intValue) || intValue < limits.min || intValue > limits.max) {
// this.errorMessage = ` ${limits.min}-${limits.max} `;
// if(this.controlObject=='000D'&&this.OOODValue!=''){
// this.errorMessage += ` :`+this.OOODValue;
// this.openingPoint = this.OOODValue;
// }else if(this.controlObject=='000E'&&this.OOOEValue!=''){
// this.errorMessage += ` :`+this.OOOEValue;
// this.openingPoint = this.OOOEValue;
// }else if(this.controlObject=='000F'&&this.OOOFValue!=''){
// this.errorMessage += ` :`+this.OOOFValue;
// this.openingPoint = this.OOOFValue;
// }else if(this.controlObject=='0010'&&this.OO1OValue!=''){
// this.errorMessage += ` :`+this.OO1OValue;
// this.openingPoint = this.OO1OValue;
// }
// } else {
// this.errorMessage = '';
// this.openingPoint = '';
// }
// },
onControlObjectChange(value) {
console.log(value)
//
const inputValue = parseInt(this.openingPoint, 10);
const limits = this.rangeLimits[value];
if (isNaN(inputValue) || inputValue < limits.min || inputValue > limits.max) {
// if (isNaN(inputValue) || inputValue < limits.min || inputValue > limits.max) {
this.errorMessage = `请选择 ${limits.min}-${limits.max} 之间的数字`;
console.log(this.OOOEValue)
if(value=='000D'&&this.OOODValue!=''){
this.errorMessage += ` 当前值为:`
this.openingPoint = this.OOODValue;
@ -192,7 +193,8 @@
this.errorMessage += ` 当前值为:`
this.openingPoint = this.OO1OValue;
}
} else {
// }
else {
this.errorMessage = '';
this.openingPoint = '';
}

33
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/IntegratedCabinet/components/DeviceControlDialog.vue

@ -8,17 +8,20 @@
</div>
<div class="control-unit">
<span>雷电计数清零</span>
<el-switch active-color="#01AAFD" inactive-color="#bbbbbb" v-model="lightningReset" active-text="开启" inactive-text="关闭" @change="lightningResetZero"></el-switch>
<Button style="margin-left: 5px" @click.native="lightningResetZero"></Button>
<!-- <el-switch active-color="#01AAFD" inactive-color="#bbbbbb" v-model="lightningReset" active-text="开启" inactive-text="关闭" @change="lightningResetZero"></el-switch> -->
</div>
</div>
<div class="row">
<div class="control-unit">
<span>系统复位</span>
<el-switch active-color="#01AAFD" inactive-color="#bbbbbb" v-model="recloserReset" active-text="开启" inactive-text="关闭" @change="recloserResetSwitch"></el-switch>
<Button style="margin-left: 5px" @click.native="recloserResetSwitch"></Button>
<!-- <el-switch active-color="#01AAFD" inactive-color="#bbbbbb" v-model="recloserReset" active-text="开启" inactive-text="关闭" @change="recloserResetSwitch"></el-switch> -->
</div>
<div class="control-unit">
<span>令重合闸复位</span>
<el-switch active-color="#01AAFD" inactive-color="#bbbbbb" v-model="reclosing" active-text="开启" inactive-text="关闭" @change="reclosingSwitch"></el-switch>
<Button style="margin-left: 5px" @click.native="reclosingSwitch"></Button>
<!-- <el-switch active-color="#01AAFD" inactive-color="#bbbbbb" v-model="reclosing" active-text="开启" inactive-text="关闭" @change="reclosingSwitch"></el-switch> -->
</div>
</div>
</div>
@ -26,6 +29,7 @@
</template>
<script>
import Button from "@screen/components/Buttons/Button.vue";
import Switcher from '@screen/pages/service/PublishingChannelManagement/components/Switcher.vue';
import Dialog from "@screen/components/Dialog/index.vue";
import DeviceParams from "./DeviceParams.vue";
@ -36,6 +40,7 @@
Dialog,
DeviceParams,
Switcher,
Button,
},
model: {
prop: "visible",
@ -153,15 +158,15 @@
},
lightningResetZero(e){
if(e==false){
return this.lightningReset =e
}
// if(e==false){
// return this.lightningReset =e
// }
let text = e ==true? "开启一次" : "关闭";
console.log(e);
this.$modal.confirm('确认要"' + text + '"雷电计数清零?该操作会导致设备重启,请谨慎操作').then(() => {
if(e==false){
return this.lightningReset =e
}
// if(e==false){
// return this.lightningReset =e
// }
return request({
url: `/business/device/functions/${this.dialogData.iotDeviceId}/TL`,
method: "post",
@ -170,18 +175,18 @@
.then((result)=>{
if (result.code != 200) {
Message.error("操作失败");
this.lightningReset =!e
// this.lightningReset =!e
return;
}
this.$modal.msgSuccess(text + "成功,请重新打开设备弹窗");
this.lightningReset=e
// this.lightningReset=e
}).catch((error)=>{
console.error('请求失败:', error);
this.lightningReset = !e;
// this.lightningReset = !e;
});
}).catch((error) => {
console.log(e)
this.lightningReset =!e
// this.lightningReset =!e
});
},
@ -287,7 +292,7 @@
flex-shrink: 0; /* 防止名字在容器宽度不足时缩小 */
white-space: nowrap; /* 防止名字换行 */
/* 减少名称和开关之间的空白,可以调整这个值 */
margin-right: 5px; /* 之前是10px,现在改为5px */
margin-right: 0px; /* 之前是10px,现在改为5px */
}
.el-switch {

Loading…
Cancel
Save