jiminglei 2 years ago
parent 983f039b12
commit 13b9069aa1
  1. 112
      psdc-ui/src/views/system/cl/index.vue

@ -66,13 +66,13 @@
</el-form-item>
</el-col>
<el-checkbox :indeterminate="data.isIndeterminate" v-model="data.checkAll" @change="handleCheckAllChange">全选</el-checkbox>
<div class="taber"><span>进水温度</span><span>出水温度</span><span>温度</span></div>
<el-checkbox-group v-model="data.checkedSblb" @change="handleCheckedCitiesChange">
<el-checkbox v-for="item in data.sblb" :label="item.deviceId" :key="item.deviceId" label-width="120" style="margin-bottom: 10px">
<span style="width: 70px;display: inline-block">{{item.deviceName}}</span>
<el-input :disabled="item.inTemp" type="number" v-model="item.intemp" placeholder="进水温度" style="width: 120px ;margin: 10px"/>
<el-input :disabled="item.outTemp" type="number" v-model="item.outtemp" placeholder="出水温度" style="width: 120px ;margin: 10px"/>
<el-input :disabled="item.Temp" type="number" v-model="item.temp" placeholder="温度" style="width: 120px ;margin: 10px"/>
<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: 100px;display: inline-block">{{item.deviceName}}</span>
<span v-for="control in item.controlKey">
<span style="width: 85px;display: inline-block">{{control.label}}</span>
<el-input type="number" v-model="control.value" style="width: 120px ;margin: 10px;height: 25px"/>
</span>
</el-checkbox>
</el-checkbox-group>
<!-- <el-col :span="12">-->
@ -130,13 +130,14 @@
</el-form-item>
</el-col>
<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 v-for="item in data.sblb" :label="item.deviceId" :key="item.deviceId" style="margin-bottom: 10px">
<span style="width: 70px;display: inline-block">{{item.deviceName}}</span>
<el-input type="number" v-model="item.intemp" placeholder="进水温度" style="width: 120px ;margin: 10px"/>
<el-input type="number" v-model="item.outtemp" placeholder="出水温度" style="width: 120px ;margin: 10px"/>
<el-input type="number" v-model="item.temp" placeholder="温度" style="width: 120px ;margin: 10px"/>
<el-checkbox v-for="item in data.sblb" :label="item.deviceId" :key="item.deviceId" style="margin-bottom: 10px;width: 560px;">
<span style="width: 100px;display: inline-block">{{item.deviceName}}</span>
<span v-for="control in item.controlKey">
<span style="width: 85px;display: inline-block">{{control.label}}</span>
<el-input type="number" v-model="control.value" style="width: 120px ;margin: 10px;height: 25px"/>
</span>
</el-checkbox>
</el-checkbox-group>
<!-- <el-col :span="24">-->
@ -187,22 +188,23 @@ onMounted(()=>{
crr.push(res.data[x])
}
}
console.log(crr)
var arr = []
for(var i in crr){
arr=arr.concat(crr[i].children)
}
console.log(arr)
var drr = []
for(let j in arr){
arr[j].Temp=!arr[j].Temp
arr[j].inTemp=!arr[j].inTemp
arr[j].outTemp=!arr[j].outTemp
if(arr[j].controlKey.length!=0){
drr.push(arr[j])
}
}
console.log('sblb',arr)
data.sblb=arr
console.log('sblb',drr)
data.sblb=drr
var brr = []
for(let a in arr){
brr.push(arr[a].deviceId)
for(let a in drr){
brr.push(drr[a].deviceId)
}
data.AllName=brr
console.log(brr)
@ -382,23 +384,19 @@ function submitForm() {
data.checkedSblb.forEach(item => {
let tempItem = {
deviceId: item,
intemp: '',
outtemp: '',
temp: ''
tempList:[]
};
// item data.sblb
let deviceInfo = data.sblb.find(sblbItem => sblbItem.deviceId === item);
if (deviceInfo) {
tempItem.intemp = deviceInfo.intemp;
tempItem.outtemp = deviceInfo.outtemp;
tempItem.temp = deviceInfo.temp;
console.log(deviceInfo)
tempItem.tempList = deviceInfo.controlKey
}
tempCheckedSblb.push(tempItem);
timingForm.deviceVos=tempCheckedSblb
deviceInfo.intemp=''
deviceInfo.outtemp=''
deviceInfo.temp=''
for(let i in deviceInfo.controlKey){
deviceInfo.controlKey[i].value=''
}
});
console.log(timingForm)
postNew(timingForm).then((res)=>{
@ -422,21 +420,17 @@ function cancel() {
data.checkedSblb.forEach(item => {
let tempItem = {
deviceId: item,
intemp: '',
outtemp: '',
temp: ''
tempList:[]
};
// item data.sblb
let deviceInfo = data.sblb.find(sblbItem => sblbItem.deviceId === item);
if (deviceInfo) {
tempItem.intemp = deviceInfo.intemp;
tempItem.outtemp = deviceInfo.outtemp;
tempItem.temp = deviceInfo.temp;
tempItem.tempList = deviceInfo.controlKey;
}
tempCheckedSblb.push(tempItem);
deviceInfo.intemp=''
deviceInfo.outtemp=''
deviceInfo.temp=''
// deviceInfo.intemp=''
// deviceInfo.outtemp=''
// deviceInfo.temp=''
});
timingForm.sceneName='',
timingForm.sceneRemark='',
@ -460,38 +454,29 @@ function handleXg(dat) {
var deviceId = data.sblb[i].deviceId
for (let j = 0;j < dat.deviceVos.length ;j++ ) {
if ( deviceId === dat.deviceVos[j].deviceId){
data.sblb[i].intemp = dat.deviceVos[j].intemp;
data.sblb[i].outtemp = dat.deviceVos[j].outtemp;
data.sblb[i].temp = dat.deviceVos[j].temp;
data.sblb[i].controlKey = dat.deviceVos[j].tempValue;
}
}
}
timingForm1.sceneName=dat.sceneName
timingForm1.sceneRemark=dat.sceneRemark
timingForm1.sceneCode = dat.sceneCode
};
function submitForm1() {
let tempCheckedSblb = [];
data.checkedSblb1.forEach(item => {
let tempItem = {
deviceId: item,
intemp: '',
outtemp: '',
temp: ''
tempList:[]
};
// item data.sblb
let deviceInfo = data.sblb.find(sblbItem => sblbItem.deviceId === item);
if (deviceInfo) {
tempItem.intemp = deviceInfo.intemp;
tempItem.outtemp = deviceInfo.outtemp;
tempItem.temp = deviceInfo.temp;
tempItem.tempList = deviceInfo.controlKey;
}
tempCheckedSblb.push(tempItem);
timingForm1.deviceVos=tempCheckedSblb
});
console.log(timingForm1)
postXg(timingForm1).then((res)=>{
console.log(res)
@ -507,11 +492,11 @@ function submitForm1() {
timingForm1.sceneRemark=''
timingForm1.sceneCode=''
timingForm1.deviceVos=[]
for(let i in data.sblb) {
data.sblb[i].temp = ''
data.sblb[i].intemp = ''
data.sblb[i].outtemp = ''
}
// for(let i in data.sblb) {
// data.sblb[i].temp = ''
// data.sblb[i].intemp = ''
// data.sblb[i].outtemp = ''
// }
};
function cancel1() {
open1.value = false;
@ -519,10 +504,10 @@ function cancel1() {
timingForm1.sceneRemark=''
timingForm1.sceneCode=''
timingForm1.deviceVos=[]
for(let i in data.sblb){
data.sblb[i].temp=''
data.sblb[i].intemp=''
data.sblb[i].outtemp=''
for(let i=0 ;i<data.sblb.length;i++){
for(let j=0; j<data.sblb[i].controlKey.length;j++){
data.sblb[i].controlKey[j].value=''
}
}
@ -599,5 +584,8 @@ const { queryParams } = toRefs(data);
::v-deep .el-form-item__content{
//display: flex;
}
::v-deep .el-checkbox {
width: 560px;
}
</style>

Loading…
Cancel
Save