diff --git a/network/api/index.js b/network/api/index.js
index 7f64d45..a376bf4 100644
--- a/network/api/index.js
+++ b/network/api/index.js
@@ -87,7 +87,7 @@ export default {
getUserMenu(data){
return new Promise((resolve, reject) => {
request.TokenRequest({
- url: '/user/admin/menu/list',
+ url: '/user/admin/role/header',
method: 'GET',
},data)
.then((res) =>{
diff --git a/pages/iots/device/device-detail.vue b/pages/iots/device/device-detail.vue
index 11bf90e..f88e4de 100644
--- a/pages/iots/device/device-detail.vue
+++ b/pages/iots/device/device-detail.vue
@@ -34,6 +34,18 @@
{{wsStatus?'刷新':'已断连'}}
-->
+
+
+ 属性分组:
+
+
+
@@ -158,7 +170,7 @@
:disabled="true"
:name="item.name"
v-model="item.value"
- :unit="item.ioObj.unit"
+ :unit="item.ioObj?item.ioObj.unit?item.ioObj.unit:'':''"
@change="downData($event,index)"
@clickLog="clickLog(index)"
>
@@ -320,6 +332,7 @@
import IotsInput from '@/components/iot-components/input/iots-input.vue'
import IotsSelectTime from '@/components/iot-components/select-time/iots-select-time.vue'
import IotsImg from '@/components/iot-components/img/iots-img.vue'
+ import uniDataSelect from "@/components/iot-components/uni-data-select/uni-data-select.vue"
export default{
data(){
@@ -347,7 +360,18 @@
},
scrollTop:0,
- // 设备属性
+ selectGroup:0,
+ // 属性分组
+ groupList:[{
+ value:0,
+ label:'全部',
+ groupKey:'all',
+ groupName:'全部',
+ ioRelKey:[]
+ }],
+ // 全部设备属性用于属性分组(不变)
+ dataAllData:[],
+ // 设备属性用于属性分组后数据(会变)
dataList:[],
dataIndex: 0,
// 设备功能
@@ -418,7 +442,8 @@
IotsPie,
IotsGauge,
IotsInput,
- IotsImg
+ IotsImg,
+ uniDataSelect
},
onLoad(option) {
console.log("option",option)
@@ -453,6 +478,10 @@
url:'./device-control?dataList=' + dataList + '&devId=' + this.deviceInfo.devId + '&pk=' + this.deviceInfo.pk + '&devName=' + this.deviceInfo.devName
})
},
+ // 选择分组
+ changeGroup(e){
+ console.log("选择分组",e)
+ },
getChartData(type,data){
if(type == 'charts_dashboard'){
let min = 0;
@@ -530,8 +559,43 @@
item.time = 0;
return item;
})
+ this.dataAllData = this.dataList;
}else{
this.dataList = [];
+ this.dataAllData = [];
+ }
+ if(thingModel.contents.groups.length){
+ let groupList = [{
+ value:0,
+ label:'全部',
+ groupKey:'all',
+ groupName:'全部',
+ ioRelKey:[]
+ }];
+ thingModel.contents.groups.forEach((item,index)=>{
+ groupList.push({
+ value:index+1,
+ label:item.groupName,
+ ...item
+ })
+ })
+ this.groupList = groupList;
+ // this.$nextTick(()=>{
+ // this.$set(this,'groupList',groupList)
+ // })
+ }else{
+ this.groupList = [{
+ value:0,
+ label:'全部',
+ groupKey:'all',
+ groupName:'全部',
+ ioRelKey:[]
+ }];
+ }
+ if(thingModel.contents.server.length){
+ this.abilityList = thingModel.contents.server;
+ }else{
+ this.abilityList = [];
}
if(thingModel.contents.server.length){
this.abilityList = thingModel.contents.server;
@@ -893,6 +957,20 @@
}
}
}
+ .group-list{
+ display: flex;
+ // justify-content: space-between;
+ align-items: center;
+ margin: 0 20rpx;
+ margin-top: 20rpx;
+ padding: 20rpx;
+ background-color: #fff;
+ border-radius: 20rpx;
+ .group-list-label{
+ margin-right: 10rpx;
+ font-weight: bold;
+ }
+ }
// 设备详情弹窗
.detail-model{
padding: 30rpx;
diff --git a/pages/tabbar/workbench.vue b/pages/tabbar/workbench.vue
index 8f21a05..f2e293b 100644
--- a/pages/tabbar/workbench.vue
+++ b/pages/tabbar/workbench.vue
@@ -42,9 +42,9 @@
- {{item.label[0]}}
+ {{item.title[0]}}
- {{item.label}}
+ {{item.title}}
{
+ this.$api.getUserMenu({clientType:2}).then(res => {
console.log("获取用户菜单",res)
if(res.code == 0){
this.commonList = res.data.list?res.data.list:[];