|
|
@ -2,11 +2,12 @@ |
|
|
|
<div class="app-container home"> |
|
|
|
<div class="app-container home"> |
|
|
|
<el-button type="primary" :icon="Download" @click="drawerIshow = true">策略导入</el-button> |
|
|
|
<el-button type="primary" :icon="Download" @click="drawerIshow = true">策略导入</el-button> |
|
|
|
<div class="dev_control_wrapper"> |
|
|
|
<div class="dev_control_wrapper"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="dev_control_item" v-for="item in deviceArr" :key="item.deviceId"> |
|
|
|
<div class="dev_control_item" v-for="item in deviceArr" :key="item.deviceId"> |
|
|
|
<div class="item_header"> |
|
|
|
<div class="item_header"> |
|
|
|
<span>{{ item.deviceName}}</span> |
|
|
|
<span>{{ item.deviceName}}</span> |
|
|
|
<!-- <el-switch v-model="item.deviceId" class="switch" @change="handleChange(item)" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #dddddd"/>--> |
|
|
|
<el-switch v-model="item.deviceRunstatus" @change="handleDevChangeFun(item.deviceId,item.deviceRunstatus)" class="switch" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #dddddd"/> |
|
|
|
<el-switch v-model="item.deviceId" class="switch" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #dddddd"/> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="item_bottom"> |
|
|
|
<div class="item_bottom"> |
|
|
|
<div class="item_bottom_img"> |
|
|
|
<div class="item_bottom_img"> |
|
|
@ -14,15 +15,23 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="item_bottom_form"> |
|
|
|
<div class="item_bottom_form"> |
|
|
|
<el-form :model="form1"> |
|
|
|
<el-form :model="form1"> |
|
|
|
<el-form-item label="当前状态:"><span :class="{'green':item.deviceRunstatus === '开启','red':item.deviceRunstatus === '关闭'}">{{ item.deviceRunstatus }}</span></el-form-item> |
|
|
|
<el-form-item label="当前状态:"> |
|
|
|
<el-form-item v-show="isShow1" label="进水温度:"><el-input v-model="form1.intemp" /></el-form-item> |
|
|
|
<span :class="{'green':item.deviceRunstatus === true,'red':item.deviceRunstatus === false}"> |
|
|
|
<el-form-item v-show="isShow1" label="出水温度:"><el-input v-model="form1.outtemp" /></el-form-item> |
|
|
|
{{ item.deviceRunstatus === true ? '开启' : '关闭'}} |
|
|
|
<!-- <el-form-item label="当前温度:"><el-input v-model="form1.now" /></el-form-item>--> |
|
|
|
</span> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="进水温度:"><el-input v-model="form1.intemp" /></el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="出水温度:"><el-input v-model="form1.outtemp" /></el-form-item> |
|
|
|
|
|
|
|
<!-- <el-form-item label="温度:" ><el-input v-model="form1.temp" /></el-form-item>--> |
|
|
|
<div class="submit" @click="getSetTemperatureFun(item)">确定</div> |
|
|
|
<div class="submit" @click="getSetTemperatureFun(item)">确定</div> |
|
|
|
|
|
|
|
|
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="dev_control_table"> |
|
|
|
<div class="dev_control_table"> |
|
|
|
<div class="control_header"><span>调控日志</span></div> |
|
|
|
<div class="control_header"><span>调控日志</span></div> |
|
|
@ -77,7 +86,7 @@ |
|
|
|
<script setup name="Index"> |
|
|
|
<script setup name="Index"> |
|
|
|
import { Download } from '@element-plus/icons-vue' //element字体图标 |
|
|
|
import { Download } from '@element-plus/icons-vue' //element字体图标 |
|
|
|
import { ref,reactive,onMounted } from 'vue' |
|
|
|
import { ref,reactive,onMounted } from 'vue' |
|
|
|
import { ElMessageBox } from 'element-plus' |
|
|
|
import { ElMessageBox,ElMessage } from 'element-plus' |
|
|
|
import { getDevice,getControlLogList,getStrategyList,getStartAndStop,getSetTemperature } from '@/api/control/manual' |
|
|
|
import { getDevice,getControlLogList,getStrategyList,getStartAndStop,getSetTemperature } from '@/api/control/manual' |
|
|
|
|
|
|
|
|
|
|
|
onMounted(()=>{ |
|
|
|
onMounted(()=>{ |
|
|
@ -88,20 +97,16 @@ onMounted(()=>{ |
|
|
|
|
|
|
|
|
|
|
|
/** 获取所有设备*/ |
|
|
|
/** 获取所有设备*/ |
|
|
|
const deviceArr = ref([]) |
|
|
|
const deviceArr = ref([]) |
|
|
|
const isShow1 = ref(true) |
|
|
|
// const isShow1 = ref(true) |
|
|
|
|
|
|
|
// const isShow2 = ref(true) |
|
|
|
function getDeviceFun(){ |
|
|
|
function getDeviceFun(){ |
|
|
|
getDevice().then((res)=>{ |
|
|
|
getDevice().then((res)=>{ |
|
|
|
console.log(res.data) |
|
|
|
console.log(res.data) |
|
|
|
deviceArr.value = res.data |
|
|
|
deviceArr.value = res.data |
|
|
|
for(let i = 0;i < res.data.length;i++){ |
|
|
|
for(let i = 0;i < res.data.length;i++){ |
|
|
|
if(res.data[i].deviceRunstatus == 1){ |
|
|
|
|
|
|
|
res.data[i].deviceRunstatus = '开启' |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
res.data[i].deviceRunstatus = '关闭' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if(res.data[i].deviceModel == '发热电缆'){ |
|
|
|
// if(res.data[i].deviceModel == '发热电缆'){ |
|
|
|
// isShow1.value = false |
|
|
|
// isShow1.value = false |
|
|
|
|
|
|
|
// isShow2.value = true |
|
|
|
// } |
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
@ -174,15 +179,23 @@ function confirmClick() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 控制设备启停*/ |
|
|
|
/** 控制设备启停*/ |
|
|
|
// function handleChange(item){ |
|
|
|
function handleDevChangeFun(id,sta){ |
|
|
|
// console.log(item) |
|
|
|
console.log(id,sta) |
|
|
|
// // getStartAndStop({ |
|
|
|
//1开启,2关闭 |
|
|
|
// // "deviceId": 100, |
|
|
|
sta = sta === true ? 1 : 2 |
|
|
|
// // "runStatus": 2 |
|
|
|
getStartAndStop({ |
|
|
|
// // }).then((res)=>{ |
|
|
|
"deviceId": id, |
|
|
|
// // console.log(res.data) |
|
|
|
"runStatus": sta |
|
|
|
// // }) |
|
|
|
}).then((res)=>{ |
|
|
|
// } |
|
|
|
console.log(res.data) |
|
|
|
|
|
|
|
if(res.code == 200){ |
|
|
|
|
|
|
|
ElMessage({ |
|
|
|
|
|
|
|
type:'success', |
|
|
|
|
|
|
|
message:'控制成功!' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 设置温度*/ |
|
|
|
/** 设置温度*/ |
|
|
|
function getSetTemperatureFun(item){ |
|
|
|
function getSetTemperatureFun(item){ |
|
|
|