From db1c9f232ddefd257678abd27267f9c720d19bc5 Mon Sep 17 00:00:00 2001
From: jiminglei <836545853@qq.com>
Date: Tue, 20 Jun 2023 16:54:25 +0800
Subject: [PATCH] 11
---
psdc-ui/src/views/emonitor/wdcgq/index.vue | 40 +-
psdc-ui/src/views/system/cl/index.vue | 454 +++++++++++----------
2 files changed, 267 insertions(+), 227 deletions(-)
diff --git a/psdc-ui/src/views/emonitor/wdcgq/index.vue b/psdc-ui/src/views/emonitor/wdcgq/index.vue
index 665b856..1067035 100644
--- a/psdc-ui/src/views/emonitor/wdcgq/index.vue
+++ b/psdc-ui/src/views/emonitor/wdcgq/index.vue
@@ -97,29 +97,37 @@ export default {
getWdcgq("温度传感器").then((res)=>{
console.log(res)
if(res.data!=null) {
- let arr = []
- let brr = []
- let crr = []
- for (let i in res.data) {
- if(res.data[i].deviceTemp == null){
- res.data[i].deviceTemp = '-- '
+ var brr = []
+ data.wdcgqList=[
+ {
+ name:'室内温度',
+ temp:res.data[0].houseInTemp,
+ },
+ {
+ name:'室外温度',
+ temp:res.data[0].houseOutTemp,
}
- arr.push({name: res.data[i].deviceName, temp: res.data[i].deviceTemp})
- brr.push({
- name: res.data[i].deviceName,
+ ]
+ brr.push(
+ {
+ name: '室内温度',
+ type: "line",
+ data: res.data[0].listTempIn,
+ itemStyle: { //线条颜色
+ color: '#F5901A',
+ }
+ },
+ {
+ name: '室外温度',
type: "line",
- data: res.data[i].temps,
+ data: res.data[0].listTempOut,
itemStyle: { //线条颜色
color: '#F5901A',
}
- })
- crr.push(res.data[i].times)
+ }
+ )
}
- // console.log('arr',arr)
- data.info = arr
data.infos = brr
- data.xinfo = crr
- }
let myChart = echarts.getInstanceByDom(document.getElementById("myEcharts"));
if (myChart){
myChart.dispose()
diff --git a/psdc-ui/src/views/system/cl/index.vue b/psdc-ui/src/views/system/cl/index.vue
index bcfd94d..ca7d24d 100644
--- a/psdc-ui/src/views/system/cl/index.vue
+++ b/psdc-ui/src/views/system/cl/index.vue
@@ -30,7 +30,7 @@
修改
- 删除
+ 删除
@@ -69,7 +69,7 @@
-
+
步骤名称:
步骤描述:
@@ -96,11 +96,11 @@
- 全选
-
-
- {{item.deviceName}}
-
+
+
+
+ {{it.deviceName}}
+
{{control.label}}
@@ -132,46 +132,54 @@
-
+
-
+
-
+
- 是否有限制条件
-
- 是
- 否
-
-
-
- 限制设备:
-
-
-
- 限制属性:
-
- 温度
- 进水温度
- 出水温度
+
+
+
+
+ 步骤名称:
+
+ 步骤描述:
+
+ 是否有限制条件
+
+ 是
+ 否
- 温度数值:
-
-
-
- 全选
-
-
-
- {{item.deviceName}}
-
+
+
+ 限制设备:
+
+
+
+ 限制属性:
+
+ 温度
+ 进水温度
+ 出水温度
+
+ 限制值:
+
+
+
+
+
+
+
+ {{it.deviceName}}
+
{{control.label}}
@@ -183,31 +191,15 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ 删除
+
+
+ 添加步骤+
+
+
@@ -271,6 +263,21 @@ onMounted(()=>{
})
/** 筛选处理 */
const data = reactive({
+ items:[
+ { id: 1, title: '第1步', content: `步骤1的内容`,
+ sblb:[],
+ isIndeterminate:false,
+ checkedSblb: [],
+ checkAll:false,
+ sceneName:'',
+ sceneRemark:'',
+ deviceVos:[],
+ isJudge:null,
+ judgeDevice:null,
+ judgeElement:null,
+ judgeData:null }
+ ],
+ items1:[],
num:1,
activeNames:0,
checkAll: false,
@@ -397,6 +404,12 @@ const addForm = reactive({
strategyName:'',
scenesList:[]
})
+const addForm1 = reactive({
+ strategyCode:'',
+ strategyInfo:'',
+ strategyName:'',
+ scenesList:[]
+})
const timingForm = reactive({
sceneName:'',
sceneRemark:'',
@@ -433,26 +446,53 @@ const timingForm1 = reactive({
function handleAdd() {
- open.value = true;
- title.value = "新增策略";
+ getSb1().then((res)=>{
+ console.log('222',res)
+ var arr = []
+ for(var i in res.data){
+ arr=arr.concat(res.data[i].children)
+ }
+ console.log('sblb',arr)
+ data.sblb=arr
+ addForm.strategyName=''
+ addForm.strategyInfo=''
+ data.items=[{ id: 1, title: '第1步', content: `步骤1的内容`,
+ sblb:data.sblb,
+ isIndeterminate:false,
+ checkedSblb: [],
+ checkAll:false,
+ sceneName:'',
+ sceneRemark:'',
+ deviceVos:[],
+ isJudge:null,
+ judgeDevice:null,
+ judgeElement:null,
+ judgeData:null }]
+ open.value = true;
+ title.value = "新增策略";
+ })
};
function submitForm() {
- let tempCheckedSblb = [];
- data.checkedSblb.forEach(item => {
- let tempItem = {
- deviceId: item,
- tempList:[]
- };
- // 根据 item 从 data.sblb 中找到对应的设备信息
- let deviceInfo = data.sblb.find(sblbItem => sblbItem.deviceId === item);
- if (deviceInfo) {
- console.log('11111',deviceInfo)
- tempItem.tempList = deviceInfo.controlKey
- }
- tempCheckedSblb.push(tempItem);
- // items.scenesList.deviceVos=tempCheckedSblb
- });
- addForm.scenesList.push(items)
+
+ for(let i in data.items){
+ let tempCheckedSblb = [];
+ data.items[i].checkedSblb.forEach(item => {
+ let tempItem = {
+ deviceId: item,
+ tempList:[]
+ };
+ // 根据 item 从 data.sblb 中找到对应的设备信息
+ let deviceInfo = data.items[i].sblb.find(sblbItem => sblbItem.deviceId === item);
+ if (deviceInfo) {
+ console.log('11111',deviceInfo)
+ tempItem.tempList = deviceInfo.controlKey
+ }
+ tempCheckedSblb.push(tempItem);
+ data.items[i].deviceVos=tempCheckedSblb
+ });
+ }
+ console.log('??????????',data.items)
+ addForm.scenesList=data.items
console.log(addForm)
postNew(addForm).then((res)=>{
console.log(res)
@@ -462,88 +502,65 @@ function submitForm() {
console.log(res)
data.queryParams=res.data
})
- addForm.strategyInfo='',
- addForm.strategyName='',
- timingForm.sceneName='',
- timingForm.sceneRemark='',
- timingForm.deviceVos=[],
- timingForm.isJudge=2,
- timingForm.judgeDevice=null,
- timingForm.judgeElement=null,
- timingForm.judgeData=null,
- data.checkedSblb=[];
- data.isIndeterminate=false
+
open.value = false;
- data.sblb.map(item => {
- item.controlKey.map(temp => {
- temp.value = '';
- });
- });
})
};
function cancel() {
- addForm.strategyInfo='',
- addForm.strategyName='',
- timingForm.sceneName='',
- timingForm.sceneRemark='',
- timingForm.deviceVos=[];
- timingForm.isJudge=2,
- timingForm.judgeDevice=null,
- timingForm.judgeElement=null,
- timingForm.judgeData=null
- data.checkedSblb=[];
- data.isIndeterminate=false
open.value = false;
- data.sblb.map(item => {
- item.controlKey.map(temp => {
- temp.value = '';
- });
- });
-
};
function handleXg(dat) {
open1.value = true;
title1.value = "修改策略";
console.log('101111',dat)
- var arr = []
- for(let i in dat.deviceVos){
- arr.push(dat.deviceVos[i].deviceId)
- }
- data.checkedSblb1=arr
- for (let i = 0;i < data.sblb.length ;i++ ){
- var deviceId = data.sblb[i].deviceId
- for (let j = 0;j < dat.deviceVos.length ;j++ ) {
- if ( deviceId === dat.deviceVos[j].deviceId){
- console.log(dat.deviceVos[j].tempValue)
- data.sblb[i].controlKey = dat.deviceVos[j].tempValue;
- }
- }
- }
- timingForm1.sceneName=dat.sceneName
- timingForm1.sceneRemark=dat.sceneRemark
- timingForm1.sceneCode = dat.sceneCode
- timingForm1.isJudge=dat.isJudge
- timingForm1.judgeDevice=dat.judgeDevice
- timingForm1.judgeElement=dat.judgeElement
- timingForm1.judgeData=dat.judgeData
+ addForm1.strategyCode=dat.strategyCode
+ addForm1.strategyName=dat.strategyName
+ addForm1.strategyInfo=dat.strategyInfo
+ data.items1=dat.scenesList
+ console.log(data.items1)
+ // var arr = []
+ // for(let i in dat.deviceVos){
+ // arr.push(dat.deviceVos[i].deviceId)
+ // }
+ // data.checkedSblb1=arr
+ // for (let i = 0;i < data.sblb.length ;i++ ){
+ // var deviceId = data.sblb[i].deviceId
+ // for (let j = 0;j < dat.deviceVos.length ;j++ ) {
+ // if ( deviceId === dat.deviceVos[j].deviceId){
+ // console.log(dat.deviceVos[j].tempValue)
+ // data.sblb[i].controlKey = dat.deviceVos[j].tempValue;
+ // }
+ // }
+ // }
+ // timingForm1.sceneName=dat.sceneName
+ // timingForm1.sceneRemark=dat.sceneRemark
+ // timingForm1.sceneCode = dat.sceneCode
+ // timingForm1.isJudge=dat.isJudge
+ // timingForm1.judgeDevice=dat.judgeDevice
+ // timingForm1.judgeElement=dat.judgeElement
+ // timingForm1.judgeData=dat.judgeData
};
function submitForm1() {
- let tempCheckedSblb = [];
- data.checkedSblb1.forEach(item => {
- let tempItem = {
- deviceId: item,
- tempList:[]
- };
- // 根据 item 从 data.sblb 中找到对应的设备信息
- let deviceInfo = data.sblb.find(sblbItem => sblbItem.deviceId === item);
- if (deviceInfo) {
- tempItem.tempList = deviceInfo.controlKey;
- }
- tempCheckedSblb.push(tempItem);
- timingForm1.deviceVos=tempCheckedSblb
- });
- console.log(timingForm1)
- postXg(timingForm1).then((res)=>{
+ for(let i in data.items1){
+ let tempCheckedSblb = [];
+ data.items1[i].checkedSblb.forEach(item => {
+ let tempItem = {
+ deviceId: item,
+ tempList:[]
+ };
+ // 根据 item 从 data.sblb 中找到对应的设备信息
+ let deviceInfo = data.items1[i].sblb.find(sblbItem => sblbItem.deviceId === item);
+ if (deviceInfo) {
+ tempItem.tempList = deviceInfo.controlKey
+ }
+ tempCheckedSblb.push(tempItem);
+ data.items1[i].deviceVos=tempCheckedSblb
+ });
+ }
+ console.log('??????????',data.items1)
+ addForm1.scenesList=data.items1
+ console.log(addForm1)
+ postXg(addForm1).then((res)=>{
console.log(res)
ElMessage({type:"success",message:'修改成功!'})
getXl().then((res)=>{
@@ -551,48 +568,32 @@ function submitForm1() {
data.queryParams=res.data
})
handleQuery()
- data.sblb.map(item => {
- item.controlKey.map(temp => {
- temp.value = '';
- });
- });
+ open1.value = false;
+ // data.sblb.map(item => {
+ // item.controlKey.map(temp => {
+ // temp.value = '';
+ // });
+ // });
})
- open1.value = false;
- timingForm1.sceneName=''
- timingForm1.sceneRemark=''
- timingForm1.sceneCode=''
- timingForm1.deviceVos=[]
- timingForm1.isJudge=2,
- timingForm1.judgeDevice=null,
- timingForm1.judgeElement=null,
- timingForm1.judgeData=null
};
function cancel1() {
open1.value = false;
- timingForm1.sceneName=''
- timingForm1.sceneRemark=''
- timingForm1.sceneCode=''
- timingForm1.deviceVos=[]
- timingForm1.isJudge=2,
- timingForm1.judgeDevice=null,
- timingForm1.judgeElement=null,
- timingForm1.judgeData=null
- handleQuery()
- data.sblb.map(item => {
- item.controlKey.map(temp => {
- temp.value = '';
- });
- })
+ // handleQuery()
+ // data.sblb.map(item => {
+ // item.controlKey.map(temp => {
+ // temp.value = '';
+ // });
+ // })
};
-function handleDel(sceneCode) {
+function handleDel(strategyCode) {
ElMessageBox.confirm("是否确认删除此策略?", "提示",{
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
- console.log(sceneCode)
+ console.log(strategyCode)
postDel({
- "sceneCode":sceneCode
+ "strategyCode":strategyCode
}).then((res) => {
console.log(res)
ElMessage({type:"success",message:'删除成功!'})
@@ -607,48 +608,79 @@ function handleDel(sceneCode) {
//添加步骤
-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}的内容`,
- 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)
+ getSb1().then((res)=>{
+ console.log('222',res)
+ var arr = []
+ for(var i in res.data){
+ arr=arr.concat(res.data[i].children)
+ }
+ console.log('sblb',arr)
+ data.sblb=arr
+ const newId = data.items.length + 1
+ data.items.push({ id: newId, title: `第${newId}步`, content: `步骤${newId}的内容`,
+ sblb:data.sblb,
+ isIndeterminate:false,
+ checkedSblb: [],
+ checkAll:false,
+ sceneName:'',
+ sceneRemark:'',
+ deviceVos:[],
+ isJudge:null,
+ judgeDevice:null,
+ judgeElement:null,
+ judgeData:null})
+ activeNames.push(`${newId}`)
+ })
}
const removeStep = (id) => {
- const index = items.findIndex(item => item.id === id)
+ const index = data.items.findIndex(item => item.id === id)
if (index !== -1) {
- items.splice(index, 1)
+ data.items.splice(index, 1)
activeNames.splice(activeNames.indexOf(`${id}`), 1)
}
- console.log(items)
+ console.log(data.items)
console.log(activeNames)
}
-
-
+//修改步骤
+const activeNames1 =reactive([1])
+const addStep1 = () => {
+ getSb1().then((res)=>{
+ console.log('222',res)
+ var arr = []
+ for(var i in res.data){
+ arr=arr.concat(res.data[i].children)
+ }
+ console.log('sblb',arr)
+ data.sblb=arr
+ const newId1 = data.items1.length + 1
+ data.items1.push({ id: newId1, title: `第${newId1}步`, content: `步骤${newId1}的内容`,
+ sblb:data.sblb,
+ isIndeterminate:false,
+ checkedSblb: [],
+ checkAll:false,
+ sceneName:'',
+ sceneRemark:'',
+ deviceVos:[],
+ isJudge:null,
+ judgeDevice:null,
+ judgeElement:null,
+ judgeData:null})
+ activeNames1.push(`${newId1}`)
+ })
+}
+const removeStep1 = (id) => {
+ const index = data.items1.findIndex(item => item.id === id)
+ if (index !== -1) {
+ data.items1.splice(index, 1)
+ activeNames1.splice(activeNames1.indexOf(`${id}`), 1)
+ }
+ console.log(data.items1)
+ console.log(activeNames1)
+}
const { queryParams } = toRefs(data);