jiminglei 2 years ago
parent b901d673b8
commit e6967a949d
  1. 95
      psdc-ui/src/views/system/cl/index.vue

@ -65,6 +65,27 @@
<el-input v-model="timingForm.sceneRemark" placeholder="请输入策略描述" /> <el-input v-model="timingForm.sceneRemark" placeholder="请输入策略描述" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<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 :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-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;"> <el-checkbox v-for="item in data.sblb" :label="item.deviceId" :key="item.deviceId" style="margin-bottom: 10px;width: 560px;">
@ -74,7 +95,7 @@
<template v-if="control.label === '控制启停'"> <template v-if="control.label === '控制启停'">
<el-radio-group v-model="control.value"> <el-radio-group v-model="control.value">
<el-radio label="1">开启</el-radio> <el-radio label="1">开启</el-radio>
<el-radio label="0">关闭</el-radio> <el-radio label="2">关闭</el-radio>
</el-radio-group> </el-radio-group>
</template> </template>
<template v-else> <template v-else>
@ -137,6 +158,27 @@
<el-input v-model="timingForm1.sceneRemark" placeholder="请输入策略描述" /> <el-input v-model="timingForm1.sceneRemark" placeholder="请输入策略描述" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<span style="width: 120px;display: inline-block ;margin: 20px">是否有限制条件</span>
<el-radio-group v-model="timingForm1.isJudge">
<el-radio :label="1"></el-radio>
<el-radio :label="2"></el-radio>
</el-radio-group>
<el-collapse v-model="timingForm1.isJudge" style="width: 1000px">
<el-collapse-item title="限制条件" :name="1">
<span>限制设备</span>
<el-select v-model="timingForm1.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="timingForm1.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="timingForm1.judgeData" placeholder="请输入" style="width: 80px ; height: 25px" />
</el-collapse-item>
</el-collapse>
<el-checkbox :indeterminate="data.isIndeterminate1" v-model="data.checkAll1" @change="handleCheckAllChange1">全选</el-checkbox> <el-checkbox :indeterminate="data.isIndeterminate1" v-model="data.checkAll1" @change="handleCheckAllChange1">全选</el-checkbox>
<!-- <div class="taber"><span>进水温度</span><span>出水温度</span><span>温度</span></div>--> <!-- <div class="taber"><span>进水温度</span><span>出水温度</span><span>温度</span></div>-->
<el-checkbox-group v-model="data.checkedSblb1" @change="handleCheckedCitiesChange1"> <el-checkbox-group v-model="data.checkedSblb1" @change="handleCheckedCitiesChange1">
@ -147,7 +189,7 @@
<template v-if="control.label === '控制启停'"> <template v-if="control.label === '控制启停'">
<el-radio-group v-model="control.value"> <el-radio-group v-model="control.value">
<el-radio label="1">开启</el-radio> <el-radio label="1">开启</el-radio>
<el-radio label="0">关闭</el-radio> <el-radio label="2">关闭</el-radio>
</el-radio-group> </el-radio-group>
</template> </template>
<template v-else> <template v-else>
@ -195,9 +237,19 @@
import {ElMessage,ElMessageBox} from 'element-plus' import {ElMessage,ElMessageBox} from 'element-plus'
import {Delete} from '@element-plus/icons-vue' import {Delete} from '@element-plus/icons-vue'
import {ref,reactive,watch,onMounted} from "vue"; import {ref,reactive,watch,onMounted} from "vue";
import {getXl,getTb,postNew,getSb1,postXg,postDel} from '../../../api/emonitor/api' import {getXl,getTb,postNew,getSb1,postXg,postDel,getSb} from '../../../api/emonitor/api'
onMounted(()=>{ onMounted(()=>{
getSb().then((res)=>{
console.log('111',res)
var arr = []
for(var i in res.data){
arr=arr.concat(res.data[i].children)
}
console.log('Allsblb',arr)
data.allsblb=arr
})
getSb1().then((res)=>{ getSb1().then((res)=>{
console.log('222',res)
var arr = [] var arr = []
for(var i in res.data){ for(var i in res.data){
arr=arr.concat(res.data[i].children) arr=arr.concat(res.data[i].children)
@ -232,11 +284,13 @@ onMounted(()=>{
}) })
/** 筛选处理 */ /** 筛选处理 */
const data = reactive({ const data = reactive({
activeNames:0,
checkAll: false, checkAll: false,
checkedSblb: [], checkedSblb: [],
checkAll1: false, checkAll1: false,
checkedSblb1: [], checkedSblb1: [],
sblb: [], sblb: [],
allsblb:[],
AllName:[], AllName:[],
isIndeterminate: false, isIndeterminate: false,
isIndeterminate1: false, isIndeterminate1: false,
@ -353,13 +407,21 @@ const activeName = ref('1')
const timingForm = reactive({ const timingForm = reactive({
sceneName:'', sceneName:'',
sceneRemark:'', sceneRemark:'',
deviceVos:[] deviceVos:[],
isJudge:null,
judgeDevice:null,
judgeElement:null,
judgeData:null
}) })
const timingForm1 = reactive({ const timingForm1 = reactive({
sceneName:'', sceneName:'',
sceneRemark:'', sceneRemark:'',
sceneCode:'', sceneCode:'',
deviceVos:[] deviceVos:[],
isJudge:null,
judgeDevice:null,
judgeElement:null,
judgeData:null
// deviceId:'', // deviceId:'',
// temp:'', // temp:'',
// intemp:'', // intemp:'',
@ -414,7 +476,11 @@ function submitForm() {
}) })
timingForm.sceneName='', timingForm.sceneName='',
timingForm.sceneRemark='', timingForm.sceneRemark='',
timingForm.deviceVos=[] timingForm.deviceVos=[],
timingForm.isJudge=2,
timingForm.judgeDevice=null,
timingForm.judgeElement=null,
timingForm.judgeData=null,
data.checkedSblb=[]; data.checkedSblb=[];
data.isIndeterminate=false data.isIndeterminate=false
open.value = false; open.value = false;
@ -429,7 +495,10 @@ function cancel() {
timingForm.sceneName='', timingForm.sceneName='',
timingForm.sceneRemark='', timingForm.sceneRemark='',
timingForm.deviceVos=[]; timingForm.deviceVos=[];
timingForm.isJudge=2,
timingForm.judgeDevice=null,
timingForm.judgeElement=null,
timingForm.judgeData=null
data.checkedSblb=[]; data.checkedSblb=[];
data.isIndeterminate=false data.isIndeterminate=false
open.value = false; open.value = false;
@ -461,6 +530,10 @@ function handleXg(dat) {
timingForm1.sceneName=dat.sceneName timingForm1.sceneName=dat.sceneName
timingForm1.sceneRemark=dat.sceneRemark timingForm1.sceneRemark=dat.sceneRemark
timingForm1.sceneCode = dat.sceneCode timingForm1.sceneCode = dat.sceneCode
timingForm1.isJudge=dat.isJudge
timingForm1.judgeDevice=dat.judgeDevice
timingForm1.judgeElement=dat.judgeElement
timingForm1.judgeData=dat.judgeData
}; };
function submitForm1() { function submitForm1() {
let tempCheckedSblb = []; let tempCheckedSblb = [];
@ -497,6 +570,10 @@ function submitForm1() {
timingForm1.sceneRemark='' timingForm1.sceneRemark=''
timingForm1.sceneCode='' timingForm1.sceneCode=''
timingForm1.deviceVos=[] timingForm1.deviceVos=[]
timingForm1.isJudge=2,
timingForm1.judgeDevice=null,
timingForm1.judgeElement=null,
timingForm1.judgeData=null
}; };
function cancel1() { function cancel1() {
open1.value = false; open1.value = false;
@ -504,6 +581,10 @@ function cancel1() {
timingForm1.sceneRemark='' timingForm1.sceneRemark=''
timingForm1.sceneCode='' timingForm1.sceneCode=''
timingForm1.deviceVos=[] timingForm1.deviceVos=[]
timingForm1.isJudge=2,
timingForm1.judgeDevice=null,
timingForm1.judgeElement=null,
timingForm1.judgeData=null
handleQuery() handleQuery()
data.sblb.map(item => { data.sblb.map(item => {
item.controlKey.map(temp => { item.controlKey.map(temp => {

Loading…
Cancel
Save