diff --git a/src/views/manage/deviceSet.vue b/src/views/manage/deviceSet.vue index 2358f451..eb2c2bc1 100644 --- a/src/views/manage/deviceSet.vue +++ b/src/views/manage/deviceSet.vue @@ -135,6 +135,7 @@ export default { this.topList.push(el) } }) + this.topList.sort(this.compare('equipmentStatu')) setTimeout(() => { if(this.topList.length) this.getData(this.topList[0]) @@ -142,6 +143,14 @@ export default { } }) }, + //排序 + compare(property) { + return function (a, b) { + let value1 = a[property]; + let value2 = b[property]; + return value1 - value2; + }; + }, getData(item) { // var data={deviceId:item.deviceId} this.api.getcontrol_cpermission(item.deviceId).then(res => { diff --git a/src/views/manage/deviceStatusSet.vue b/src/views/manage/deviceStatusSet.vue index 3080b063..14c4b76c 100644 --- a/src/views/manage/deviceStatusSet.vue +++ b/src/views/manage/deviceStatusSet.vue @@ -118,6 +118,7 @@ export default { this.topList.push(el) } }) + this.topList.sort(this.compare('equipmentStatu')) setTimeout(() => { if(this.topList.length) this.getData(this.topList[0]) @@ -125,6 +126,14 @@ export default { } }) }, + //排序 + compare(property) { + return function (a, b) { + let value1 = a[property]; + let value2 = b[property]; + return value1 - value2; + }; + }, getData(item){ var data={deviceId:item.deviceId} this.api.selControlPermissions(data).then(res=>{ diff --git a/src/views/manage/mobileControl.vue b/src/views/manage/mobileControl.vue index 935478cd..75283853 100644 --- a/src/views/manage/mobileControl.vue +++ b/src/views/manage/mobileControl.vue @@ -110,6 +110,7 @@ export default { this.topList.push(el) } }) + this.topList.sort(this.compare('equipmentStatu')) setTimeout(() => { if(this.topList.length) this.getData(this.topList[0]) @@ -117,6 +118,14 @@ export default { } }) }, + //排序 + compare(property) { + return function (a, b) { + let value1 = a[property]; + let value2 = b[property]; + return value1 - value2; + }; + }, getData(item) { var data = { deviceId: item.deviceId } this.api.wxgetpermission(data).then(res => {