From ec189d295f98ddaee41d8af41df2e128dffcbdb4 Mon Sep 17 00:00:00 2001
From: jiminglei <836545853@qq.com>
Date: Tue, 13 Jun 2023 16:43:02 +0800
Subject: [PATCH] 11
---
psdc-ui/src/api/emonitor/api.js | 4 ++
psdc-ui/src/views/system/cl/index.vue | 68 ++++++++++++++-------------
2 files changed, 39 insertions(+), 33 deletions(-)
diff --git a/psdc-ui/src/api/emonitor/api.js b/psdc-ui/src/api/emonitor/api.js
index 7915806..cd271d1 100644
--- a/psdc-ui/src/api/emonitor/api.js
+++ b/psdc-ui/src/api/emonitor/api.js
@@ -62,6 +62,10 @@ export function postDel(data) {
export function getSb() {
return request.get('/monitor/db/index/selMydevices')
}
+//获取用户可控设备列表
+export function getSb1() {
+ return request.get('/monitor/db/index/selMyControldevices')
+}
//设备管理
export function getYh() {
return request.get('system/device/index/selusers')
diff --git a/psdc-ui/src/views/system/cl/index.vue b/psdc-ui/src/views/system/cl/index.vue
index c2006ad..3a5f7aa 100644
--- a/psdc-ui/src/views/system/cl/index.vue
+++ b/psdc-ui/src/views/system/cl/index.vue
@@ -23,7 +23,7 @@
-
+
@@ -52,7 +52,7 @@
-
+
@@ -68,10 +68,18 @@
全选
- {{item.deviceName}}
-
- {{control.label}}
-
+ {{item.deviceName}}
+
+ {{control.label}}
+
+
+ 开启
+ 关闭
+
+
+
+
+
@@ -116,7 +124,7 @@
-
+
@@ -133,10 +141,18 @@
- {{item.deviceName}}
-
- {{control.label}}
-
+ {{item.deviceName}}
+
+ {{control.label}}
+
+
+ 开启
+ 关闭
+
+
+
+
+
@@ -179,32 +195,18 @@
import {ElMessage,ElMessageBox} from 'element-plus'
import {Delete} from '@element-plus/icons-vue'
import {ref,reactive,watch,onMounted} from "vue";
-import {getXl,getTb,postNew,getSb,postXg,postDel} from '../../../api/emonitor/api'
+import {getXl,getTb,postNew,getSb1,postXg,postDel} from '../../../api/emonitor/api'
onMounted(()=>{
- getSb().then((res)=>{
- var crr = []
- for(let x in res.data){
- if(res.data[x].isControl==2) {
- crr.push(res.data[x])
- }
- }
-
+ getSb1().then((res)=>{
var arr = []
- for(var i in crr){
- arr=arr.concat(crr[i].children)
- }
- console.log(arr)
- var drr = []
- for(let j in arr){
- if(arr[j].controlKey.length!=0){
- drr.push(arr[j])
- }
+ for(var i in res.data){
+ arr=arr.concat(res.data[i].children)
}
- console.log('sblb',drr)
- data.sblb=drr
+ console.log('sblb',arr)
+ data.sblb=arr
var brr = []
- for(let a in drr){
- brr.push(drr[a].deviceId)
+ for(let a in arr){
+ brr.push(arr[a].deviceId)
}
data.AllName=brr
console.log(brr)