From b87a1dc6f0f24a03058ed25b1f3442798e971852 Mon Sep 17 00:00:00 2001
From: kerwincui <164770707@qq.com>
Date: Wed, 15 Jun 2022 15:27:24 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=88=86=E7=BB=84=E7=AD=9B?=
=?UTF-8?q?=E9=80=89=E5=92=8C=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
vue/src/views/index.vue | 4 +--
vue/src/views/iot/device/index.vue | 36 +++++++++++++++----
vue/src/views/iot/group/index.vue | 19 +++++++++-
vue/src/views/iot/product/index.vue | 2 +-
.../views/iot/product/product-authorize.vue | 1 -
5 files changed, 50 insertions(+), 12 deletions(-)
diff --git a/vue/src/views/index.vue b/vue/src/views/index.vue
index 7d512361..39ae3227 100644
--- a/vue/src/views/index.vue
+++ b/vue/src/views/index.vue
@@ -24,7 +24,7 @@
官方网站
- www.wumei.live
+ www.wumei.live
@@ -557,7 +557,7 @@ export default {
};
option = {
title: {
- text: '设备分布和状态(数量 ' + this.deviceCount + ')',
+ text: '设备分布和状态',
subtext: 'wumei-smart open source living iot platform',
sublink: 'https://iot.wumei.live',
target: "_blank",
diff --git a/vue/src/views/iot/device/index.vue b/vue/src/views/iot/device/index.vue
index 333b59b4..d989441d 100644
--- a/vue/src/views/iot/device/index.vue
+++ b/vue/src/views/iot/device/index.vue
@@ -3,19 +3,24 @@
-
+
-
+
-
+
-
-
+
+
+
+
+
搜索
重置
@@ -144,7 +149,7 @@
-
+
@@ -195,6 +200,9 @@ import {
import {
cacheJsonThingsModel
} from "@/api/iot/model";
+import {
+ listGroup
+} from "@/api/iot/group";
export default {
name: "Device",
@@ -230,6 +238,8 @@ export default {
total: 0,
// 设备列表数据
deviceList: [],
+ // 我的分组列表数据
+ myGroupList:[],
// 弹出层标题
title: "",
// 是否显示弹出层
@@ -272,7 +282,7 @@ export default {
this.queryParams.productId = null;
}
this.getList();
-
+ this.getGroupList();
},
activated() {
const time = this.$route.query.t;
@@ -296,6 +306,18 @@ export default {
}
},
methods: {
+ /** 查询设备分组列表 */
+ getGroupList() {
+ this.loading = true;
+ let queryParams ={
+ pageSize:30,
+ pageNum:1,
+ userId:this.$store.state.user.userId
+ }
+ listGroup(queryParams).then(response => {
+ this.myGroupList = response.rows;
+ });
+ },
/** 发布物模型 类型(1=属性,2=功能) */
publishThingsModel(device, model) {
// 获取缓存的Json物模型
diff --git a/vue/src/views/iot/group/index.vue b/vue/src/views/iot/group/index.vue
index db577261..471ff337 100644
--- a/vue/src/views/iot/group/index.vue
+++ b/vue/src/views/iot/group/index.vue
@@ -5,6 +5,9 @@
+
+
+
搜索
重置
@@ -85,6 +88,10 @@ export default {
},
data() {
return {
+ // 是否管理员
+ isAdmin:false,
+ // 我的分组
+ myGroup:false,
// 遮罩层
loading: true,
// 选中数组
@@ -110,7 +117,7 @@ export default {
pageNum: 1,
pageSize: 10,
groupName: null,
- userName: null,
+ userId: null,
},
// 设备分组
group: {},
@@ -134,8 +141,18 @@ export default {
},
created() {
this.getList();
+ this.init();
},
methods: {
+ init() {
+ if (this.$store.state.user.roles.indexOf("tenant") === -1 && this.$store.state.user.roles.indexOf("general") === -1) {
+ this.isAdmin = true
+ }
+ },
+ // 我的分组改变事件
+ myGroupChange(){
+ this.queryParams.userId=this.myGroup?this.$store.state.user.userId:null;
+ },
/** 查看设备按钮操作 */
handleViewDevice(groupId) {
this.$router.push({
diff --git a/vue/src/views/iot/product/index.vue b/vue/src/views/iot/product/index.vue
index e7a5ac17..07deed44 100644
--- a/vue/src/views/iot/product/index.vue
+++ b/vue/src/views/iot/product/index.vue
@@ -78,7 +78,7 @@
-
+
diff --git a/vue/src/views/iot/product/product-authorize.vue b/vue/src/views/iot/product/product-authorize.vue
index 3c31edfc..814f4ee5 100644
--- a/vue/src/views/iot/product/product-authorize.vue
+++ b/vue/src/views/iot/product/product-authorize.vue
@@ -47,7 +47,6 @@
-