feat: 添加设备列表排序功能,支持房号、配置版本和固件版本排序

This commit is contained in:
2026-04-08 15:42:04 +08:00
parent c03f7b47d0
commit 2580cd86e9
4 changed files with 150 additions and 14 deletions

View File

@@ -144,6 +144,7 @@ if (Nres.Status==200) {
break
}
}
console.log("roomtypeInfoNodeinfo")
console.log(this.data.roomtypeInfoNodeinfo)
this.LoopDebugging(null)
@@ -394,7 +395,7 @@ if (Nres.Status==200) {
if ( element2[0] == addrtype[0][0]) {
li= myMap[index2][1]
li.push([element.ModalAddress,element.Name,addrtype[0][1]])
li.push([element.ModalAddress,element.Name,addrtype[0][1],element.addrindex])
myMap[index2][1]=li
addrtypelist=false
break
@@ -403,7 +404,7 @@ if (Nres.Status==200) {
if (addrtypelist) {
li=[]
li.push([element.ModalAddress,element.Name,addrtype[0][1]])
li.push([element.ModalAddress,element.Name,addrtype[0][1],element.addrindex])
myMap.push([addrtype[0][0],li])
}
@@ -412,6 +413,7 @@ if (Nres.Status==200) {
roomtypeInfoNodeinfo=myMap.sort((a, b) => a[0] - b[0])
//获取房间在线状态 roomstart
console.log(roomtypeInfoNodeinfo)
@@ -421,6 +423,7 @@ if (Nres.Status==200) {
this.setData({
roomtypeInfoNodeinfo:roomtypeInfoNodeinfo
})
console.log(this.data.roomtypeInfoNode)
},
GetloopType(loopaddr){
@@ -503,6 +506,7 @@ if (Nres.Status==200) {
let iset = await this.ControlStatusMainCircuit(id, narry, devarr)
if (iset) {
roomtypeInfoNodeinfo[index][1][nindex][2] = narry
this.setData({
roomtypeInfoNodeinfo: roomtypeInfoNodeinfo
})

View File

@@ -75,7 +75,7 @@
<view class="bg-white ">
<!-- <view style="text-align: left;font-weight: bold">播放测试:</view> -->
<!-- <view style="text-align: left;font-weight: bold">播放测试:</view> -->
<view style="text-align: left;font-weight: bold; color: blue;">播放测试:</view>
<view class="Ncu-bar bg-white flex">
<button bindtap="GetshowinfoClick" class="cu-btn round1 ulg margin-5" style="font-weight: bold;">播放欢迎词</button>
<!-- <view style="text-align: left;font-weight: bold" class=" margin-xs radius ">音量:</view> -->
@@ -91,7 +91,7 @@
<view class="bg-white " wx:for="{{roomtypeInfoNodeinfo}}" wx:for-item="row" wx:for-index="rowIndex">
<view class=" bg-white " wx:if="{{row[0]===1}}" >
<!-- <view style="text-align: left;font-weight: bold">设置设备开关状态:</view> -->
<view style="text-align: left;font-weight: bold; color: blue;">设置设备开关状态:</view>
<view class="Ncu-bar bg-white flex-sub" wx:for="{{row[1].length/4 }}" wx:for-index="colIndex" >
<view class="Ncu-bar bg-white" wx:if="{{colIndex*4<row[1].length}}">
<button id="1" class="cu-btn round1 margin-3 vlg" data-value="1" data-index="{{row[1][colIndex*4][0]}}" bindtap="SetDeviceSwitchStatus" wx:if="{{colIndex*4<row[1].length}}" style="background-color: {{row[1][colIndex*4][2][0][2]===0 ? '#E6E6E6 ':'#39b54a'}};" >{{row[1][colIndex*4][3]}}_{{row[1][colIndex*4][1]}}</button>
@@ -106,7 +106,7 @@
</view>
<view class="bg-white" wx:if="{{row[0]===23}}">
<!-- <view style="text-align: left;font-weight: bold">设置调光亮度:</view> -->
<view style="text-align: left;font-weight: bold; color: blue">设置调光亮度:</view>
<view class="bg-white" wx:for="{{row[1].length}}" wx:for-index="DimIndex" >
<view class="Ncu-bar bg-white">
<view class="flex-twice">{{row[1][DimIndex][3]}}_{{row[1][DimIndex][1]}}</view>
@@ -117,7 +117,7 @@
<view class="ControlLine"></view>
</view>
<view class="bg-white" wx:if="{{row[0]===52}}">
<!-- <view style="text-align: left;font-weight: bold">色温控制:</view> -->
<view style="text-align: left;font-weight: bold; color: blue">色温控制:</view>
<view class="Ncu-bar bg-white">
<view class="action margin-0 flex-twice text-green " >开关</view>
<view class="action margin-0 flex-xis text-green solid-left" >色温</view>
@@ -165,7 +165,7 @@
<view class="ControlLine"></view>
</view>
<view class="bg-white" wx:if="{{row[0]===5}}">
<!-- <view style="text-align: left;font-weight: bold">设置设备开停关状态:</view> -->
<view style="text-align: left;font-weight: bold; color: blue">设置设备开停关状态:</view>
<view class="bg-white" wx:for="{{row[1].length}}" wx:for-index="coloIndex">
<view class="Ncu-bar bg-white">
@@ -184,7 +184,7 @@
<view class="ControlLine"></view>
</view>
<view class="bg-white" wx:if="{{row[0]===7}}">
<!-- <view style="text-align: left;font-weight: bold">设置温控设备状态:</view> -->
<view style="text-align: left;font-weight: bold; color: blue">设置温控设备状态:</view>
<view class=" bg-white" wx:for="{{row[1].length}}" wx:for-index="coloIndex">
<view class="Ncu-bar bg-white">