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 @@
+
+
+
+ 物联卡管理
+ 更新
+
+
+
+
+ 更新时间: {{update_time}}
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+
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 @@
+
+
+
+ 路由器管理
+ 重启
+
+
+
+
+ 更新时间: {{update_time}}
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+
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 @@
- 照明定时
+ {{switchInfo.hardware_name}}定时
时间动作
- 开
- 关
+ 开
+
+
+
+ 关
+
+
+
+
时间类型
-
- 星期
+
+
+ {{singleArr[sIndex]}}
+
@@ -22,11 +31,36 @@
- 时间类型
-
- 15:30
+ 时间点
+
+
+ {{time}}
-
+
+
+
+
+ 具体日期
+
+
+ {{dayArr[dIndex]}} 号
+
+
+
+
+
+ 具体时间段
+
+
+ 开始时间 {{time}}
+
+ 至
+
+ 结束时间 {{time}}
+
+
+
+
保存
@@ -68,19 +102,46 @@
return (item) => {
return item[2] == "删除" ? "true" : ""
}
+ },
+ startDate() {
+ return this.getDate('start');
+ },
+ endDate() {
+ return this.getDate('end');
}
},
- data() {
+ data() {
+ const currentDate = this.getDate({
+ format: true
+ })
+ const dayArr = (()=>{
+ let day = []
+ for(var i=1;i<=31;i++){
+ day.push(i)
+ }
+ return day
+ })()
return {
// tabArr,
// infoArr,
+ switchInfo:"",
+ on:false,
+ singleArr:["星期","具体日期","具体时间段"],
+ sIndex:0,
+ dayArr:dayArr,
+ dIndex:0,
weekArrCN,
- weekArr:[0,1,2,3,4,5,6],
- weekArrSelect:[false,false,false,false,false,false,false]
+ weekArrSelect:[false,false,false,false,false,false,false],
+ date: currentDate,
+ time: '00:00',
+
}
},
- async onLoad(opts) {
-
+ async onLoad(option) {
+ let switchInfo = JSON.parse(decodeURIComponent(option.switchInfo));
+ this.switchInfo = switchInfo;
+ console.log("switchInfo:",switchInfo);
+
try {
util.showLoad();
let _brandInfo = await this.$store.dispatch('getBrandInfo');
@@ -100,14 +161,16 @@
this.updateList()
}
},
- methods: {
+ methods: {
+ tapSwitch(){ //开关切换
+ this.on = !this.on
+ },
clickWeekTab(index) {
if(this.weekArrSelect[index]) {
this.$set(this.weekArrSelect,index,false)
}else{
this.$set(this.weekArrSelect,index,true)
}
-
},
//删除计划任务
delItem(e,i) {
@@ -138,6 +201,33 @@
},
})
},
+ bindPickerChangeSingle(e){
+ console.log('bindPickerChangeSingle,携带值为', e.target.value)
+ this.sIndex = e.target.value
+ },
+ bindTimeChange(e){
+ console.log('bindTimeChange,携带值为', e.target.value)
+ this.time = e.target.value
+ },
+ bindPickerChangeDay(e){
+ console.log('bindPickerChangeDay,携带值为', e.target.value)
+ this.dIndex = e.target.value
+ },
+ getDate(type) {
+ const date = new Date();
+ let year = date.getFullYear();
+ let month = date.getMonth() + 1;
+ let day = date.getDate();
+
+ if (type === 'start') {
+ year = year - 60;
+ } else if (type === 'end') {
+ year = year + 2;
+ }
+ month = month > 9 ? month : '0' + month;;
+ day = day > 9 ? day : '0' + day;
+ return `${year}-${month}-${day}`;
+ },
async updateList() {
let that = this
let timingData = {
@@ -251,15 +341,12 @@
width: 100%;
.info-list {
- // margin-top: 30rpx;
margin-bottom: 50rpx;
padding: 50rpx 30rpx;
width: 700rpx;
height: auto;
background: #FFFFFF;
border-radius: 10rpx;
- // font-size: 28rpx;
- // height: 600rpx;
@include centerFlex(flex-start);
flex-direction: column;
align-items: flex-start;
@@ -273,16 +360,21 @@
margin-left: 20rpx;
width: 40rpx;height: 40rpx;
}
+ .un-select{
+ margin-left: 20rpx;
+ background-color: white;
+ width: 40rpx;height: 40rpx;
+ border-radius: 50%;
+ border: 2rpx solid lightgray;
+ }
}
}
.il-select{
margin-top: 50rpx;
- @include centerFlex(flex-start);
- text{
-
- }
- > view{
+ width: 100%;
+ @include centerFlex(space-between);
+ .il-input {
@include centerFlex(space-between);
padding: 20rpx;
margin-left: 20rpx;
@@ -301,6 +393,30 @@
}
}
}
+ .il-select-double{
+ margin-top: 50rpx;
+ width: 100%;
+ @include centerFlex(flex-start);
+ align-items: flex-start;
+ flex-direction: column;
+ .il-input {
+ @include centerFlex(space-between);
+ padding: 20rpx;
+ margin-top: 20rpx;
+ width: 648rpx;
+ height: 96rpx;
+ background: #FFFFFF;
+ border: 2rpx solid #D8D8D8;
+ border-radius: 10rpx;
+ text{
+ color: #9C9C9F;
+ }
+ > view{
+ padding: 0 10rpx;
+ }
+
+ }
+ }
.il-select-week{
width: 100%;
height: auto;
diff --git a/src/subpackage/device/static/images/devices/16.png b/src/subpackage/device/static/images/devices/16.png
new file mode 100644
index 0000000..843cd0a
Binary files /dev/null and b/src/subpackage/device/static/images/devices/16.png differ
diff --git a/src/subpackage/device/static/images/devices/17.png b/src/subpackage/device/static/images/devices/17.png
new file mode 100644
index 0000000..173ca72
Binary files /dev/null and b/src/subpackage/device/static/images/devices/17.png differ
diff --git a/src/subpackage/device/static/images/devices/18.png b/src/subpackage/device/static/images/devices/18.png
new file mode 100644
index 0000000..f20ef53
Binary files /dev/null and b/src/subpackage/device/static/images/devices/18.png differ
diff --git a/src/subpackage/device/static/images/devices/19.png b/src/subpackage/device/static/images/devices/19.png
new file mode 100644
index 0000000..2434ab6
Binary files /dev/null and b/src/subpackage/device/static/images/devices/19.png differ