|
|
|
@ -23,8 +23,8 @@ |
|
|
|
|
<div class="dev_control_table"> |
|
|
|
|
<el-table :data="data.timingList" height="500px"> |
|
|
|
|
<el-table-column label="序号" align="center" width="50" type="index"/> |
|
|
|
|
<el-table-column label="策略名称" align="center" prop="sceneName" width="300"/> |
|
|
|
|
<el-table-column label="策略描述" align="center" prop="sceneRemark"/> |
|
|
|
|
<el-table-column label="策略名称" align="center" prop="strategyName" width="300"/> |
|
|
|
|
<el-table-column label="策略描述" align="center" prop="strategyInfo"/> |
|
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime"/> |
|
|
|
|
<!-- <el-table-column label="温度" align="center" prop="sceneValue"/>--> |
|
|
|
|
<el-table-column label="操作" align="center" prop="handle"> |
|
|
|
@ -57,136 +57,47 @@ |
|
|
|
|
<el-row> |
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<el-form-item label="策略名称:" prop="sceneName" > |
|
|
|
|
<el-input v-model="timingForm.sceneName" placeholder="请输入策略名称" /> |
|
|
|
|
<el-input v-model="addForm.strategyName" placeholder="请输入策略名称" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<el-form-item label="策略描述:" prop="sceneRemark" > |
|
|
|
|
<el-input v-model="timingForm.sceneRemark" placeholder="请输入策略描述" /> |
|
|
|
|
<el-input v-model="addForm.strategyInfo" placeholder="请输入策略描述" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <span style="width: 60px;display: inline-block ;margin: 20px">第一步</span>--> |
|
|
|
|
<!-- <el-radio-group v-model="timingForm.isJudge">--> |
|
|
|
|
<!-- <el-radio :label="1">展开</el-radio>--> |
|
|
|
|
<!-- <el-radio :label="2">关闭</el-radio>--> |
|
|
|
|
<!-- </el-radio-group>--> |
|
|
|
|
<el-collapse v-model="timingForm.num" style="margin-left: 20px" accordion> |
|
|
|
|
<el-collapse-item title="第一步" :name="1"> |
|
|
|
|
<span style="width: 50px; margin-left: 20px ">步骤描述:</span> |
|
|
|
|
<el-input placeholder="请输入步骤描述" style="width: 900px"/> |
|
|
|
|
<span style="width: 120px;display: inline-block ;margin: 20px">是否有限制条件</span> |
|
|
|
|
<el-radio-group v-model="timingForm.isJudge"> |
|
|
|
|
<el-radio :label="1">是</el-radio> |
|
|
|
|
<el-radio :label="2">否</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
<el-collapse v-model="timingForm.isJudge" style="width: 1000px"> |
|
|
|
|
<el-collapse-item title="限制条件" :name="1"> |
|
|
|
|
<span>限制设备:</span> |
|
|
|
|
<el-select v-model="timingForm.judgeDevice" placeholder="请选择" style="width: 240px"> |
|
|
|
|
<el-option :label='item.deviceName' :value='item.deviceId' :key="item.deviceId" v-for="item in data.allsblb"/> |
|
|
|
|
</el-select> |
|
|
|
|
<span style="width: 70px;display: inline-block ;margin: 20px">限制属性:</span> |
|
|
|
|
<el-radio-group v-model="timingForm.judgeElement"> |
|
|
|
|
<el-radio label="thermometer_value">温度</el-radio> |
|
|
|
|
<el-radio label="thermometer_value_in">进水温度</el-radio> |
|
|
|
|
<el-radio label="thermometer_value_out">出水温度</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
<span style="width: 70px;display: inline-block ;margin-left: 50px">温度数值:</span> |
|
|
|
|
<el-input type="number" v-model="timingForm.judgeData" placeholder="请输入" style="width: 80px ; height: 25px" /> |
|
|
|
|
</el-collapse-item> |
|
|
|
|
</el-collapse> |
|
|
|
|
<el-checkbox :indeterminate="data.isIndeterminate" v-model="data.checkAll" @change="handleCheckAllChange">全选</el-checkbox> |
|
|
|
|
<el-checkbox-group v-model="data.checkedSblb" @change="handleCheckedCitiesChange" style="white-space: normal;display: inline-block"> |
|
|
|
|
<el-checkbox v-for="item in data.sblb" :label="item.deviceId" :key="item.deviceId" style="margin-bottom: 10px;width: 560px;"> |
|
|
|
|
<span style="width: 160px;display: inline-block">{{item.deviceName}}</span> |
|
|
|
|
<span v-for="control in item.controlKey" style="margin-left: 20px"> |
|
|
|
|
<span style="width: 80px;display: inline-block">{{control.label}}</span> |
|
|
|
|
<template v-if="control.label === '控制启停'"> |
|
|
|
|
<el-radio-group v-model="control.value"> |
|
|
|
|
<el-radio label="1">开启</el-radio> |
|
|
|
|
<el-radio label="2">关闭</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
|
<el-input type="number" v-model="control.value" style="width: 120px ;margin: 10px;height: 25px"/> |
|
|
|
|
</template> |
|
|
|
|
</span> |
|
|
|
|
</el-checkbox> |
|
|
|
|
</el-checkbox-group> |
|
|
|
|
|
|
|
|
|
</el-collapse-item> |
|
|
|
|
<el-collapse-item title="第二步" :name="2"> |
|
|
|
|
<el-collapse v-model="activeNames" accordion> |
|
|
|
|
<el-collapse-item v-for="item in items" :key="item.id" :title="item.title" :name="item.id"> |
|
|
|
|
<span style="width: 50px; margin-left: 20px;margin-bottom: 50px ">步骤名称:</span> |
|
|
|
|
<el-input v-model="item.sceneName" placeholder="请输入步骤名称" style="width: 950px;margin-bottom: 10px "/> |
|
|
|
|
<span style="width: 50px; margin-left: 20px ">步骤描述:</span> |
|
|
|
|
<el-input placeholder="请输入步骤描述" style="width: 900px"/> |
|
|
|
|
<el-input v-model="item.sceneRemark" placeholder="请输入步骤描述" style="width: 950px"/> |
|
|
|
|
<span style="width: 120px;display: inline-block ;margin: 20px">是否有限制条件</span> |
|
|
|
|
<el-radio-group v-model="timingForm.isJudge"> |
|
|
|
|
<el-radio-group v-model="item.isJudge"> |
|
|
|
|
<el-radio :label="1">是</el-radio> |
|
|
|
|
<el-radio :label="2">否</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
<el-collapse v-model="timingForm.isJudge" style="width: 1000px"> |
|
|
|
|
<el-collapse v-model="item.isJudge" style="width: 1000px"> |
|
|
|
|
<el-collapse-item title="限制条件" :name="1"> |
|
|
|
|
<span>限制设备:</span> |
|
|
|
|
<el-select v-model="timingForm.judgeDevice" placeholder="请选择" style="width: 240px"> |
|
|
|
|
<el-select v-model="item.judgeDevice" placeholder="请选择" style="width: 240px"> |
|
|
|
|
<el-option :label='item.deviceName' :value='item.deviceId' :key="item.deviceId" v-for="item in data.allsblb"/> |
|
|
|
|
</el-select> |
|
|
|
|
<span style="width: 70px;display: inline-block ;margin: 20px">限制属性:</span> |
|
|
|
|
<el-radio-group v-model="timingForm.judgeElement"> |
|
|
|
|
<el-radio-group v-model="item.judgeElement"> |
|
|
|
|
<el-radio label="thermometer_value">温度</el-radio> |
|
|
|
|
<el-radio label="thermometer_value_in">进水温度</el-radio> |
|
|
|
|
<el-radio label="thermometer_value_out">出水温度</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
<span style="width: 70px;display: inline-block ;margin-left: 50px">温度数值:</span> |
|
|
|
|
<el-input type="number" v-model="timingForm.judgeData" placeholder="请输入" style="width: 80px ; height: 25px" /> |
|
|
|
|
<span style="width: 70px;display: inline-block ;margin-left: 50px">限制值:</span> |
|
|
|
|
<el-input type="number" v-model="item.judgeData" placeholder="请输入" style="width: 80px ; height: 25px" /> |
|
|
|
|
</el-collapse-item> |
|
|
|
|
</el-collapse> |
|
|
|
|
<el-checkbox :indeterminate="data.isIndeterminate" v-model="data.checkAll" @change="handleCheckAllChange">全选</el-checkbox> |
|
|
|
|
<el-checkbox-group v-model="data.checkedSblb" @change="handleCheckedCitiesChange" style="white-space: normal;display: inline-block"> |
|
|
|
|
<el-checkbox v-for="item in data.sblb" :label="item.deviceId" :key="item.deviceId" style="margin-bottom: 10px;width: 560px;"> |
|
|
|
|
<span style="width: 160px;display: inline-block">{{item.deviceName}}</span> |
|
|
|
|
<span v-for="control in item.controlKey" style="margin-left: 20px"> |
|
|
|
|
<span style="width: 80px;display: inline-block">{{control.label}}</span> |
|
|
|
|
<template v-if="control.label === '控制启停'"> |
|
|
|
|
<el-radio-group v-model="control.value"> |
|
|
|
|
<el-radio label="1">开启</el-radio> |
|
|
|
|
<el-radio label="2">关闭</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
|
<el-input type="number" v-model="control.value" style="width: 120px ;margin: 10px;height: 25px"/> |
|
|
|
|
</template> |
|
|
|
|
</span> |
|
|
|
|
</el-checkbox> |
|
|
|
|
</el-checkbox-group> |
|
|
|
|
|
|
|
|
|
</el-collapse-item> |
|
|
|
|
<el-collapse-item title="第三步" :name="3"> |
|
|
|
|
<span style="width: 50px; margin-left: 20px ">步骤描述:</span> |
|
|
|
|
<el-input placeholder="请输入步骤描述" style="width: 900px"/> |
|
|
|
|
<span style="width: 120px;display: inline-block ;margin: 20px">是否有限制条件</span> |
|
|
|
|
<el-radio-group v-model="timingForm.isJudge"> |
|
|
|
|
<el-radio :label="1">是</el-radio> |
|
|
|
|
<el-radio :label="2">否</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
<el-collapse v-model="timingForm.isJudge" style="width: 1000px"> |
|
|
|
|
<el-collapse-item title="限制条件" :name="1"> |
|
|
|
|
<span>限制设备:</span> |
|
|
|
|
<el-select v-model="timingForm.judgeDevice" placeholder="请选择" style="width: 240px"> |
|
|
|
|
<el-option :label='item.deviceName' :value='item.deviceId' :key="item.deviceId" v-for="item in data.allsblb"/> |
|
|
|
|
</el-select> |
|
|
|
|
<span style="width: 70px;display: inline-block ;margin: 20px">限制属性:</span> |
|
|
|
|
<el-radio-group v-model="timingForm.judgeElement"> |
|
|
|
|
<el-radio label="thermometer_value">温度</el-radio> |
|
|
|
|
<el-radio label="thermometer_value_in">进水温度</el-radio> |
|
|
|
|
<el-radio label="thermometer_value_out">出水温度</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
<span style="width: 70px;display: inline-block ;margin-left: 50px">温度数值:</span> |
|
|
|
|
<el-input type="number" v-model="timingForm.judgeData" placeholder="请输入" style="width: 80px ; height: 25px" /> |
|
|
|
|
</el-collapse-item> |
|
|
|
|
</el-collapse> |
|
|
|
|
<el-checkbox :indeterminate="data.isIndeterminate" v-model="data.checkAll" @change="handleCheckAllChange">全选</el-checkbox> |
|
|
|
|
<el-checkbox-group v-model="data.checkedSblb" @change="handleCheckedCitiesChange" style="white-space: normal;display: inline-block"> |
|
|
|
|
<el-checkbox :indeterminate="item.isIndeterminate" v-model="item.checkAll" @change="handleCheckAllChange">全选</el-checkbox> |
|
|
|
|
<el-checkbox-group v-model="item.checkedSblb" @change="handleCheckedCitiesChange" style="white-space: normal;display: inline-block"> |
|
|
|
|
<el-checkbox v-for="item in data.sblb" :label="item.deviceId" :key="item.deviceId" style="margin-bottom: 10px;width: 560px;"> |
|
|
|
|
<span style="width: 160px;display: inline-block">{{item.deviceName}}</span> |
|
|
|
|
<span v-for="control in item.controlKey" style="margin-left: 20px"> |
|
|
|
@ -204,50 +115,13 @@ |
|
|
|
|
</el-checkbox> |
|
|
|
|
</el-checkbox-group> |
|
|
|
|
|
|
|
|
|
<el-button type="danger" @click="removeStep(item.id)">删除</el-button> |
|
|
|
|
</el-collapse-item> |
|
|
|
|
</el-collapse> |
|
|
|
|
|
|
|
|
|
<el-collapse v-model="activeNames"> |
|
|
|
|
<el-collapse-item v-for="item in items" :key="item.id" :title="item.title" :name="item.id"> |
|
|
|
|
{{ item.content }} |
|
|
|
|
</el-collapse-item> |
|
|
|
|
</el-collapse> |
|
|
|
|
<el-button @click="addStep">添加步骤</el-button> |
|
|
|
|
|
|
|
|
|
<el-button type="primary" @click="addStep">添加步骤+</el-button> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <el-col :span="12">--> |
|
|
|
|
<!-- <el-form-item label="策略列表:" >--> |
|
|
|
|
<!-- <el-select v-model="timingForm.sceneCode" placeholder="策略列表">--> |
|
|
|
|
<!-- <el-option v-for="item in data.queryParams" :key="item.sceneCode" :label="item.label" :value="item.sceneCode">--> |
|
|
|
|
<!-- </el-option>--> |
|
|
|
|
<!-- </el-select>--> |
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
<!-- </el-col>--> |
|
|
|
|
<!-- <el-col :span="12">--> |
|
|
|
|
<!-- <el-form-item label="设备列表:" >--> |
|
|
|
|
<!-- <el-select v-model="timingForm.deviceId" placeholder="设备列表">--> |
|
|
|
|
<!-- <el-option v-for="item in data.sblb" :key="item.deviceId" :label="item.deviceName" :value="item.deviceId">--> |
|
|
|
|
<!-- </el-option>--> |
|
|
|
|
<!-- </el-select>--> |
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
<!-- </el-col>--> |
|
|
|
|
<!-- <el-col :span="12">--> |
|
|
|
|
<!-- <el-form-item label="进水温度:" prop="intemp" >--> |
|
|
|
|
<!-- <el-input v-model="timingForm.intemp" placeholder="进水温度" />--> |
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
<!-- </el-col>--> |
|
|
|
|
<!-- <el-col :span="12">--> |
|
|
|
|
<!-- <el-form-item label="出水温度:" prop="outtemp" >--> |
|
|
|
|
<!-- <el-input v-model="timingForm.outtemp" placeholder="出水温度" />--> |
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
<!-- </el-col>--> |
|
|
|
|
<!-- <el-col :span="24">--> |
|
|
|
|
<!-- <el-form-item label="温度:" prop="temp">--> |
|
|
|
|
<!-- <el-input v-model="timingForm.temp" placeholder="温度" maxlength="11" />--> |
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
<!-- </el-col>--> |
|
|
|
|
</el-row> |
|
|
|
|
</el-form> |
|
|
|
|
<template #footer> |
|
|
|
@ -518,8 +392,12 @@ const title = ref(); |
|
|
|
|
const open1 = ref(false); |
|
|
|
|
const title1= ref(); |
|
|
|
|
const activeName = ref('1') |
|
|
|
|
const addForm = reactive({ |
|
|
|
|
strategyInfo:'', |
|
|
|
|
strategyName:'', |
|
|
|
|
scenesList:[] |
|
|
|
|
}) |
|
|
|
|
const timingForm = reactive({ |
|
|
|
|
num:1, |
|
|
|
|
sceneName:'', |
|
|
|
|
sceneRemark:'', |
|
|
|
|
deviceVos:[], |
|
|
|
@ -568,20 +446,15 @@ function submitForm() { |
|
|
|
|
// 根据 item 从 data.sblb 中找到对应的设备信息 |
|
|
|
|
let deviceInfo = data.sblb.find(sblbItem => sblbItem.deviceId === item); |
|
|
|
|
if (deviceInfo) { |
|
|
|
|
console.log(deviceInfo) |
|
|
|
|
console.log('11111',deviceInfo) |
|
|
|
|
tempItem.tempList = deviceInfo.controlKey |
|
|
|
|
} |
|
|
|
|
tempCheckedSblb.push(tempItem); |
|
|
|
|
timingForm.deviceVos=tempCheckedSblb |
|
|
|
|
// for(let i in deviceInfo.controlKey){ |
|
|
|
|
// deviceInfo.controlKey[i].value='' |
|
|
|
|
// } |
|
|
|
|
// deviceInfo.controlKey.map(item => { |
|
|
|
|
// item.value = ''; |
|
|
|
|
// }); |
|
|
|
|
// items.scenesList.deviceVos=tempCheckedSblb |
|
|
|
|
}); |
|
|
|
|
console.log(timingForm) |
|
|
|
|
postNew(timingForm).then((res)=>{ |
|
|
|
|
addForm.scenesList.push(items) |
|
|
|
|
console.log(addForm) |
|
|
|
|
postNew(addForm).then((res)=>{ |
|
|
|
|
console.log(res) |
|
|
|
|
ElMessage({type:"success",message:'新增成功!'}) |
|
|
|
|
handleQuery() |
|
|
|
@ -589,6 +462,8 @@ function submitForm() { |
|
|
|
|
console.log(res) |
|
|
|
|
data.queryParams=res.data |
|
|
|
|
}) |
|
|
|
|
addForm.strategyInfo='', |
|
|
|
|
addForm.strategyName='', |
|
|
|
|
timingForm.sceneName='', |
|
|
|
|
timingForm.sceneRemark='', |
|
|
|
|
timingForm.deviceVos=[], |
|
|
|
@ -607,6 +482,8 @@ function submitForm() { |
|
|
|
|
}) |
|
|
|
|
}; |
|
|
|
|
function cancel() { |
|
|
|
|
addForm.strategyInfo='', |
|
|
|
|
addForm.strategyName='', |
|
|
|
|
timingForm.sceneName='', |
|
|
|
|
timingForm.sceneRemark='', |
|
|
|
|
timingForm.deviceVos=[]; |
|
|
|
@ -730,13 +607,45 @@ function handleDel(sceneCode) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//添加步骤 |
|
|
|
|
const items = reactive([{ id: 1, title: '第一步', content: '步骤一的内容' }]) |
|
|
|
|
const activeNames = ref(['1']) |
|
|
|
|
const items = reactive([{ id: 1, title: '第1步', content: `步骤1的内容`, |
|
|
|
|
isIndeterminate:false, |
|
|
|
|
checkedSblb: [], |
|
|
|
|
checkAll:false, |
|
|
|
|
sceneName:'', |
|
|
|
|
sceneRemark:'', |
|
|
|
|
deviceVos:[], |
|
|
|
|
isJudge:null, |
|
|
|
|
judgeDevice:null, |
|
|
|
|
judgeElement:null, |
|
|
|
|
judgeData:null }]) |
|
|
|
|
const activeNames =reactive([1]) |
|
|
|
|
const addStep = () => { |
|
|
|
|
const newId = items.length + 1 |
|
|
|
|
items.push({ id: newId, title: `第${newId}步`, content: `步骤${newId}的内容` }) |
|
|
|
|
activeNames.value.push(`${newId}`) |
|
|
|
|
items.push({ id: newId, title: `第${newId}步`, content: `步骤${newId}的内容`, |
|
|
|
|
isIndeterminate:false, |
|
|
|
|
checkedSblb: [], |
|
|
|
|
checkAll:false, |
|
|
|
|
sceneName:'', |
|
|
|
|
sceneRemark:'', |
|
|
|
|
deviceVos:[], |
|
|
|
|
isJudge:null, |
|
|
|
|
judgeDevice:null, |
|
|
|
|
judgeElement:null, |
|
|
|
|
judgeData:null}) |
|
|
|
|
activeNames.push(`${newId}`) |
|
|
|
|
console.log(items) |
|
|
|
|
console.log(activeNames) |
|
|
|
|
} |
|
|
|
|
const removeStep = (id) => { |
|
|
|
|
const index = items.findIndex(item => item.id === id) |
|
|
|
|
if (index !== -1) { |
|
|
|
|
items.splice(index, 1) |
|
|
|
|
activeNames.splice(activeNames.indexOf(`${id}`), 1) |
|
|
|
|
} |
|
|
|
|
console.log(items) |
|
|
|
|
console.log(activeNames) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|