|
|
|
|
@ -372,7 +372,7 @@
|
|
|
|
|
size="mini" |
|
|
|
|
v-model="item.offsetValue" |
|
|
|
|
@keyup.enter.native=" |
|
|
|
|
handleSwitchEnter(item, 'offset', $event) |
|
|
|
|
handleOffsetValueEnter(item, 'offset', $event) |
|
|
|
|
" |
|
|
|
|
@input="handleSwitchInput(item, 'offsetValue', 'offset')" |
|
|
|
|
></el-input></el-form-item |
|
|
|
|
@ -652,11 +652,9 @@ export default {
|
|
|
|
|
this.offsetValuerControlObj.curValue !== undefined && |
|
|
|
|
!isNaN(parseFloat(this.offsetValuerControlObj.curValue)) |
|
|
|
|
) { |
|
|
|
|
// 将 curValue 转换为整数 |
|
|
|
|
this.offsetValuerControlObj.curValue = parseInt( |
|
|
|
|
this.offsetValuerControlObj.curValue, |
|
|
|
|
10 |
|
|
|
|
); |
|
|
|
|
// 将 curValue 转换为整数并除以 10 |
|
|
|
|
this.offsetValuerControlObj.curValue = |
|
|
|
|
parseInt(this.offsetValuerControlObj.curValue, 10) / 10; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
@ -867,7 +865,9 @@ export default {
|
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
.then(() => { |
|
|
|
|
this.hadleOperationConrol(item.id, item.curValue); |
|
|
|
|
// 将 item.curValue 乘以 10 后再传入函数 |
|
|
|
|
const multipliedValue = parseFloat(item.curValue) * 10; |
|
|
|
|
this.hadleOperationConrol(item.id, multipliedValue); |
|
|
|
|
}) |
|
|
|
|
.catch(() => { |
|
|
|
|
// 用户取消操作,需要更新原来的频率 |
|
|
|
|
@ -936,28 +936,38 @@ export default {
|
|
|
|
|
// console.log("child.pointName", child.pointName); |
|
|
|
|
if (child.pointName) { |
|
|
|
|
// 时间设置1-小时 |
|
|
|
|
if (child.pointName.includes(`偏移值设置时间${index + 1}-开时1`)) { |
|
|
|
|
if ( |
|
|
|
|
child.pointName.includes( |
|
|
|
|
`偏移值设置时间${index + 1}-开时1` |
|
|
|
|
) |
|
|
|
|
) { |
|
|
|
|
// console.log("定时开机-时·························"); |
|
|
|
|
delayItem.delayOpenHour = child.curValue; |
|
|
|
|
delayItem.delayOpenHourId = child.id; |
|
|
|
|
} |
|
|
|
|
// 时间设置1-分钟 |
|
|
|
|
else if ( |
|
|
|
|
child.pointName.includes(`偏移值设置时间${index + 1}-开分1`) |
|
|
|
|
child.pointName.includes( |
|
|
|
|
`偏移值设置时间${index + 1}-开分1` |
|
|
|
|
) |
|
|
|
|
) { |
|
|
|
|
delayItem.delayOpenMinute = child.curValue; |
|
|
|
|
delayItem.delayOpenMinuteId = child.id; |
|
|
|
|
} |
|
|
|
|
// 时间设置2-小时 |
|
|
|
|
else if ( |
|
|
|
|
child.pointName.includes(`偏移值设置时间${index + 1}-关时2`) |
|
|
|
|
child.pointName.includes( |
|
|
|
|
`偏移值设置时间${index + 1}-关时2` |
|
|
|
|
) |
|
|
|
|
) { |
|
|
|
|
delayItem.delayCloseHour = child.curValue; |
|
|
|
|
delayItem.delayCloseHourId = child.id; |
|
|
|
|
} |
|
|
|
|
// 时间设置2-分钟 |
|
|
|
|
else if ( |
|
|
|
|
child.pointName.includes(`偏移值设置时间${index + 1}-关分2`) |
|
|
|
|
child.pointName.includes( |
|
|
|
|
`偏移值设置时间${index + 1}-关分2` |
|
|
|
|
) |
|
|
|
|
) { |
|
|
|
|
delayItem.delayCloseMinute = child.curValue; |
|
|
|
|
delayItem.delayCloseMinuteId = child.id; |
|
|
|
|
@ -965,6 +975,8 @@ export default {
|
|
|
|
|
// 偏移值 |
|
|
|
|
else if (child.pointName.includes(`偏移值${index + 1}`)) { |
|
|
|
|
delayItem.offsetValue = child.curValue; |
|
|
|
|
delayItem.offsetValue = |
|
|
|
|
parseInt(delayItem.offsetValue, 10) / 10; |
|
|
|
|
delayItem.offsetValueId = child.id; |
|
|
|
|
} |
|
|
|
|
// 当前出水温度设置 |
|
|
|
|
@ -1088,7 +1100,45 @@ export default {
|
|
|
|
|
value = item.delayCloseMinute; |
|
|
|
|
title = "设置时间2-分钟"; |
|
|
|
|
unit = "分"; |
|
|
|
|
} else if (name === "offset") { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (value === "") { |
|
|
|
|
this.$message.warning("请输入当前设置值!"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
console.log("请求后端", item); |
|
|
|
|
this.$confirm( |
|
|
|
|
`确定要把"${item.name}"的${title}设置为:${value} ${unit}吗?`, |
|
|
|
|
"提示", |
|
|
|
|
{ |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning", |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
.then(() => { |
|
|
|
|
// console.log("打印id",id) |
|
|
|
|
this.handleSwitchOperationConrol(id, value); |
|
|
|
|
}) |
|
|
|
|
.catch(() => { |
|
|
|
|
// 用户取消操作,需要更新原来的值 |
|
|
|
|
this.getPolicyList(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleOffsetValueEnter(item, name, event) { |
|
|
|
|
console.log("item", item); |
|
|
|
|
console.log("接收到的事件对象:", event); |
|
|
|
|
// 阻止事件的默认行为 |
|
|
|
|
if (event && event.preventDefault) { |
|
|
|
|
event.preventDefault(); |
|
|
|
|
} |
|
|
|
|
// 失去焦点 |
|
|
|
|
event.target.blur(); |
|
|
|
|
let id = ""; |
|
|
|
|
let value = ""; |
|
|
|
|
let title = ""; |
|
|
|
|
let unit = ""; |
|
|
|
|
if (name === "offset") { |
|
|
|
|
id = item.offsetValueId; |
|
|
|
|
value = item.offsetValue; |
|
|
|
|
title = "偏移值"; |
|
|
|
|
@ -1111,7 +1161,9 @@ export default {
|
|
|
|
|
) |
|
|
|
|
.then(() => { |
|
|
|
|
// console.log("打印id",id) |
|
|
|
|
this.handleSwitchOperationConrol(id, value); |
|
|
|
|
// 将 item.curValue 乘以 10 后再传入函数 |
|
|
|
|
const multipliedValue = parseFloat(item.offsetValue) * 10; |
|
|
|
|
this.handleSwitchOperationConrol(id, multipliedValue); |
|
|
|
|
}) |
|
|
|
|
.catch(() => { |
|
|
|
|
// 用户取消操作,需要更新原来的值 |
|
|
|
|
@ -1123,7 +1175,7 @@ export default {
|
|
|
|
|
policyId: id, |
|
|
|
|
timeValue: param, |
|
|
|
|
}; |
|
|
|
|
// console.log("操作参数", data); |
|
|
|
|
// console.log("操作参数", data); |
|
|
|
|
// 开启 loading 效果 |
|
|
|
|
this.loading = true; |
|
|
|
|
undateTime(data) |
|
|
|
|
|