💥 feat(设备详情): 添加设备分组功能

This commit is contained in:
风花一世月 2024-07-03 22:06:06 +08:00
parent 21e898e98d
commit a33d755034
1 changed files with 13 additions and 4 deletions

View File

@ -34,7 +34,7 @@
<view class="iconfont icon-reload"></view>{{wsStatus?'刷新':'已断连'}} <view class="iconfont icon-reload"></view>{{wsStatus?'刷新':'已断连'}}
</view> --> </view> -->
</view> </view>
<!-- <view class="group-list"> <view class="group-list">
<view class="group-list-label"> <view class="group-list-label">
属性分组: 属性分组:
</view> </view>
@ -45,7 +45,7 @@
:clear="false" :clear="false"
@change="changeGroup" @change="changeGroup"
></uni-data-select> ></uni-data-select>
</view> --> </view>
<view class="attr-list"> <view class="attr-list">
<view class="attr-list-item" v-for="(item,index) in dataList" :key="index"> <view class="attr-list-item" v-for="(item,index) in dataList" :key="index">
<!-- 选择器 --> <!-- 选择器 -->
@ -367,7 +367,7 @@
label:'全部', label:'全部',
groupKey:'all', groupKey:'all',
groupName:'全部', groupName:'全部',
ioRelKey:[] groupRel:[]
}], }],
// //
dataAllData:[], dataAllData:[],
@ -480,7 +480,16 @@
}, },
// //
changeGroup(e){ changeGroup(e){
console.log("选择分组",e) if(e != 0){
const identifierMap = new Map();
this.dataAllData.forEach(val => {
identifierMap.set(val.identifier, val);
});
const attrArr = this.groupList[e].groupRel.map(item => identifierMap.get(item.ioRelKey));
this.dataList = attrArr;
}else{
this.dataList = this.dataAllData;
}
}, },
getChartData(type,data){ getChartData(type,data){
if(type == 'charts_dashboard'){ if(type == 'charts_dashboard'){