diff --git a/src/pages.json b/src/pages.json index 13048ac..bf40a50 100644 --- a/src/pages.json +++ b/src/pages.json @@ -221,6 +221,18 @@ } }, { + "path": "pages/index/router_manage", + "style" : { + "navigationBarTitleText": "路由管理" + } + }, + { + "path": "pages/index/lot_manage", + "style" : { + "navigationBarTitleText": "物联卡管理" + } + }, + { "path": "pages/timing/timing_list", "style" : { "navigationBarTitleText": "定时列表" diff --git a/src/subpackage/device/js/device_api.js b/src/subpackage/device/js/device_api.js index a0c3758..474bbce 100644 --- a/src/subpackage/device/js/device_api.js +++ b/src/subpackage/device/js/device_api.js @@ -48,7 +48,12 @@ export const DEVICE_API = { //2021/0713 acUpdate:`${ORIGIN}/ouxuanac/getDescribeDevice`, //中控在线状态查询 - // delInfoAC:`${ORIGIN}/ouxuanac/getDescribeDevice`, //删除状态 + + getRouterDetail:`${ORIGIN}/ouxuanac/router4G/get`, //查询路由详情 + getLotDetail:`${ORIGIN}/ouxuanac/iotSim/huawei/get`, //查询物联卡详情 + reboot4G:`${ORIGIN}/ouxuanac/router4G/reboot`, //重启4G 路由 + + } export default DEVICE_API; \ No newline at end of file diff --git a/src/subpackage/device/pages/index/index.vue b/src/subpackage/device/pages/index/index.vue index 33ce34a..2b675d4 100644 --- a/src/subpackage/device/pages/index/index.vue +++ b/src/subpackage/device/pages/index/index.vue @@ -37,6 +37,7 @@ import deviceApi from '../../js/device_api'; const rootPage = '/subpackage/device' const tabArr = [ + {id: 1, name: '照明', path: `/pages/switch_manage/switch_manage`}, {id: 2, name: '空调', path: `/pages/switch_manage/switch_manage`}, {id: 3, name: '风扇', path: `/pages/switch_manage/switch_manage`}, @@ -54,8 +55,9 @@ const tabArr = [ {id: 15, name: '机器人', path: ``}, {id: 16, name: '租球机', path: ``}, {id: 17, name: '窗帘', path: ``}, - {id: 18, name: '路由器', path: ``}, - {id: 19, name: '物联卡', path: ``}, + {id: 18, name: '路由器', path: `/pages/switch_manage/switch_manage`}, + {id: 19, name: '物联卡', path: `/pages/switch_manage/switch_manage`}, + ]; import { mapState } from 'vuex' export default { @@ -143,6 +145,8 @@ export default { e.id == 10 ||  // 咖啡机 e.id == 11 ||  // 水阀 e.id == 14 ||  // 音响 + e.id == 18 ||  // 路由 + e.id == 19 ||  // 物联卡 e.id == 7   // 售货柜 )return util.routeTo(`${rootPage}${e.path}?sid=${e.id}`, 'nT'); util.showNone(`开发中!`); diff --git a/src/subpackage/device/pages/index/lot_manage.vue b/src/subpackage/device/pages/index/lot_manage.vue new file mode 100644 index 0000000..840a30c --- /dev/null +++ b/src/subpackage/device/pages/index/lot_manage.vue @@ -0,0 +1,470 @@ + + + + + diff --git a/src/subpackage/device/pages/index/router_manage.vue b/src/subpackage/device/pages/index/router_manage.vue new file mode 100644 index 0000000..347fc75 --- /dev/null +++ b/src/subpackage/device/pages/index/router_manage.vue @@ -0,0 +1,445 @@ + + + + + diff --git a/src/subpackage/device/pages/switch_manage/switch_manage.vue b/src/subpackage/device/pages/switch_manage/switch_manage.vue index 347a4fa..84fb34d 100644 --- a/src/subpackage/device/pages/switch_manage/switch_manage.vue +++ b/src/subpackage/device/pages/switch_manage/switch_manage.vue @@ -4,14 +4,18 @@ {{pageInfo.name || '-'}} - - + + + {{e.hardware_name || '-'}} - + + sim状态: {{e.hardware_model}} + + {{ e.defineStatusCode == 1 ? '设备在线' : e.defineStatusCode == 0?'设备离线' : '-' }} @@ -19,7 +23,9 @@ - + + + {{pageInfo.openName || '-'}} @@ -36,6 +42,9 @@ {{pageInfo.timingName || '-'}} + + {{pageInfo.detailName || '-'}} + @@ -63,10 +72,11 @@ const showArr = { openName: '开', closeName: '关', hardware_type: 'Air',iconNum:2 }, 's3': { - id: 3, name: '风扇管理', isOpen: true, isClose: true, + id: 3, name: '风扇管理', isOpen: true, isClose: true, isLongOpen:true, isTiming:true, openIcon: '/subpackage/device/static/images/open.png', closeIcon: '/subpackage/device/static/images/close.png', - openName: '开', closeName: '关', hardware_type: 'Fan',iconNum:2 + longOpenIcon: '/subpackage/device/static/images/longOpen.png',timingIcon: '/subpackage/device/static/images/timing.png', + openName: '开', closeName: '关', hardware_type: 'Fan',longOpenName: '长按', timingName: '定时',iconNum:4, }, 's4': { id: 4, name: '门禁管理', isOpen: true, isClose: false, @@ -87,10 +97,11 @@ const showArr = { openName: '开', closeName: '关', hardware_type: '',iconNum:2 }, 's11': { - id: 11, name: '水阀管理', isOpen: true, isClose: true, + id: 11, name: '水阀管理', isOpen: true, isClose: true,isLongOpen:true, isTiming:true, openIcon: '/subpackage/device/static/images/open.png', closeIcon: '/subpackage/device/static/images/close.png', - openName: '开', closeName: '关', hardware_type: 'WaterValve',iconNum:2 + longOpenIcon: '/subpackage/device/static/images/longOpen.png',timingIcon: '/subpackage/device/static/images/timing.png', + openName: '开', closeName: '关', hardware_type: 'Fan',longOpenName: '长按', timingName: '定时',iconNum:4, }, 's12': { id: 12, name: '互动设备管理', isOpen: true, isClose: true, @@ -98,6 +109,18 @@ const showArr = { closeIcon: '/subpackage/device/static/images/close.png', openName: '开', closeName: '关', hardware_type: '',iconNum:2 }, + 's18': { + id: 18, name: '路由器管理', isOpen: false, isClose: false, isDetail:true, + openIcon: '/subpackage/device/static/images/open.png', + closeIcon: '/subpackage/device/static/images/close.png', + openName: '开', closeName: '关',detailName:"详情", hardware_type: 'Router4G',iconNum:2 + }, + 's19': { + id: 19, name: '物联卡管理', isOpen: false, isClose: false, isDetail:true, + openIcon: '/subpackage/device/static/images/open.png', + closeIcon: '/subpackage/device/static/images/close.png', + openName: '开', closeName: '关',detailName:"详情", hardware_type: 'IotSim',iconNum:2 + }, } import { mapState } from 'vuex'; @@ -115,6 +138,12 @@ export default { return ()=>{ return 100/this.pageInfo.iconNum+'%' } + }, + getViewWidth(){//计算按钮区域的宽度 + return ()=>{ + let widthViewArr = ["照明管理","水阀管理","风扇管理"] + return (widthViewArr.indexOf(this.pageInfo.name)>=0)?'710rpx':''; + } } }, watch: { @@ -170,14 +199,20 @@ export default { .catch(util.hideLoad) }, - // 按钮操作, status 0 -> 关(左), 1 -> 开(右) ,2 -> 长开 ,3 -> 定时 + // 按钮操作, status 0 -> 关(左), 1 -> 开(右) ,2 -> 长开 ,3 -> 定时, 4 ->详情(自定义) operateBtn: util.debounce(function({ switchInfo, status }){ console.log("icon tap status: ",status,switchInfo) if(status == 2) return util.showNone("未对接,前端等待接口中...") + + if(status == 4){ + if(this.pageInfo.hardware_type=='Router4G')return util.routeTo(`/subpackage/device/pages/index/router_manage?mac=${switchInfo.hardware_standard}`, 'nT'); + if(this.pageInfo.hardware_type=='IotSim')return util.routeTo(`/subpackage/device/pages/index/lot_manage?mac=${switchInfo.hardware_standard}`, 'nT'); + } if(status == 3) return (()=>{ - let timing_setting = `/subpackage/device/pages/timing/timing_setting?opts=1` + let timing_setting = `/subpackage/device/pages/timing/timing_setting?switchInfo=${encodeURIComponent(JSON.stringify(switchInfo))}` util.routeTo(`${timing_setting}`, 'nT'); })() + //todo 配置page.json ,写新的setting 页 let _data = this.getOperateReqData({ switchInfo, status }) @@ -460,6 +495,14 @@ export default { color: #333; @include textHide(1); } + .sr-bot-router{ + font-size: 20rpx; + color: #9C9C9F; + text{ + margin-left: 15rpx; + color: black; + } + } .sr-bot{ display: flex; align-items: center; @@ -504,6 +547,7 @@ export default { display: flex; justify-content: center; border-top: 2upx solid #F2F2F7; + >view{ flex-shrink: 0; flex-grow: 0; @@ -521,6 +565,19 @@ export default { color: #9a9a9d; } } + .btn-detail{ + width:auto; + > view{ + width: 204rpx; + height: 88rpx; + background: #009874; + border-radius: 10rpx; + text-align: center; + line-height: 88rpx; + color: white; + } + + } } } } diff --git a/src/subpackage/device/pages/timing/timing_setting.vue b/src/subpackage/device/pages/timing/timing_setting.vue index 101fa5f..beae7d6 100644 --- a/src/subpackage/device/pages/timing/timing_setting.vue +++ b/src/subpackage/device/pages/timing/timing_setting.vue @@ -1,20 +1,29 @@