|
|
|
@ -25,6 +25,7 @@ |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<el-form-item v-for="inputs in item.control_elements" :label="inputs.controlRemark"><input class="tempInput" v-model="inputs.tempValue"/></el-form-item> |
|
|
|
|
<!-- <el-form-item v-for="inputs in item.control_elements" :label="inputs.controlRemark"><input class="tempInput"/></el-form-item>--> |
|
|
|
|
|
|
|
|
|
<div class="submit" v-show="item.control_elements.length > 0 ? true : false" @click="getSetTemperatureFun(item)">确定</div> |
|
|
|
|
|
|
|
|
@ -89,7 +90,7 @@ |
|
|
|
|
import { Download } from '@element-plus/icons-vue' //element字体图标 |
|
|
|
|
import { ref,reactive,onMounted } from 'vue' |
|
|
|
|
import { ElMessageBox,ElMessage } from 'element-plus' |
|
|
|
|
import { getDevice,getControlLogList,getStrategyList,getStartAndStop,getSetTemperature } from '@/api/control/manual' |
|
|
|
|
import { getDevice,getControlLogList,getStrategyList,getStartAndStop,getSetTemperature,getSenceControl,getControlDeviceList } from '@/api/control/manual' |
|
|
|
|
|
|
|
|
|
onMounted(()=>{ |
|
|
|
|
getDeviceFun(); |
|
|
|
@ -100,15 +101,15 @@ onMounted(()=>{ |
|
|
|
|
/** 获取所有设备*/ |
|
|
|
|
const deviceArr = ref([]) |
|
|
|
|
function getDeviceFun(){ |
|
|
|
|
getDevice().then((res)=>{ |
|
|
|
|
getControlDeviceList().then((res)=>{ |
|
|
|
|
deviceArr.value = res.data; |
|
|
|
|
//拼接温度单位 |
|
|
|
|
for(let i = 0;i < res.data.length;i++){ |
|
|
|
|
for(let j = 0;j < res.data[i].control_elements.length;j++){ |
|
|
|
|
console.log(res.data[i].control_elements[j].tempValue) |
|
|
|
|
res.data[i].control_elements[j].tempValue = res.data[i].control_elements[j].tempValue + '℃' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// for(let i = 0;i < res.data.length;i++){ |
|
|
|
|
// for(let j = 0;j < res.data[i].control_elements.length;j++){ |
|
|
|
|
// console.log(res.data[i].control_elements[j].tempValue) |
|
|
|
|
// res.data[i].control_elements[j].tempValue = res.data[i].control_elements[j].tempValue + '℃' |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
/** 设备控制处理*/ |
|
|
|
@ -174,6 +175,7 @@ function getStrategyListFun(){ |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
//选择策略 |
|
|
|
|
const SenceControlArr = ref([]) |
|
|
|
|
function selectCeLue(item){ |
|
|
|
|
//拼数组对象 |
|
|
|
|
//1、 |
|
|
|
@ -202,12 +204,15 @@ function selectCeLue(item){ |
|
|
|
|
|
|
|
|
|
//最终要传参的格式 |
|
|
|
|
console.log(JSON.stringify(dataArr, null, 4)); |
|
|
|
|
SenceControlArr.value = JSON.stringify(dataArr, null, 4) |
|
|
|
|
} |
|
|
|
|
//执行 |
|
|
|
|
function confirmClick() { |
|
|
|
|
ElMessageBox.confirm(`确定执行 ${radio.value} ?`).then(() => { |
|
|
|
|
drawerIshow.value = false; |
|
|
|
|
|
|
|
|
|
getSenceControl(SenceControlArr.value).then((res)=>{ |
|
|
|
|
console.log(res) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|