Browse Source

update

voice
zmt 4 years ago
parent
commit
a6169c5a70
  1. 12
      src/pages.json
  2. 7
      src/subpackage/device/js/device_api.js
  3. 8
      src/subpackage/device/pages/index/index.vue
  4. 470
      src/subpackage/device/pages/index/lot_manage.vue
  5. 445
      src/subpackage/device/pages/index/router_manage.vue
  6. 77
      src/subpackage/device/pages/switch_manage/switch_manage.vue
  7. 164
      src/subpackage/device/pages/timing/timing_setting.vue
  8. BIN
      src/subpackage/device/static/images/devices/16.png
  9. BIN
      src/subpackage/device/static/images/devices/17.png
  10. BIN
      src/subpackage/device/static/images/devices/18.png
  11. BIN
      src/subpackage/device/static/images/devices/19.png

12
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": "定时列表"

7
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;

8
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(`开发中!`);

470
src/subpackage/device/pages/index/lot_manage.vue

@ -0,0 +1,470 @@
<template>
<view class="t-router-page">
<!-- <store-name></store-name> -->
<view class="t-title">物联卡管理
<view class="t-reset" @click="updateList">更新
<image src="../../static/images/refresh.png" mode=""></image>
</view>
</view>
<view class="t-update">
更新时间: {{update_time}}
</view>
<!-- <view class="t-map" v-if="covers.length>0">
<map style="width: 100%; height: 250px;" :latitude="latitude" :longitude="longitude" :markers="covers">
</map>
</view> -->
<view class="t-box">
<view class="info-list">
<view class="i-item" v-for="(item,index) in infoObj">
<view class="i-box">{{item.name}}</view>
<rich-text class="i-box" :nodes="item.value"></rich-text>
</view>
</view>
</view>
</view>
</template>
<script>
import util from '../../../../utils/util';
import store_name from '../../components/store_name/store_name';
import deviceServer from '../../js/device_server';
import deviceApi from '../../js/device_api';
const rootPage = '/subpackage/device'
// : https://support.huaweicloud.com/api-ocgsl/gsl_07_0008.html
const infoObj = [
{
key:"act_date",
value:"",
name:"在线时间",
key2:""
},
{
key:"order_id",
value:"",
name:"批次号",
key2:""
},
{
key:"flow_left",
value:"",
name:"剩余流量(单位M)",
key2:""
},
{
key:"flow_used",
value:"",
name:"已用流量(单位M)",
key2:""
},{
key:"sim_type",
value:"",
name:"sim卡类型",
key2:"", //key2,,valuedata[key][key2]
typeArr:[,"vSIM","eSIM","实体卡"], //typeArr,value , valuetypeArr[value]
},{
key:"sim_status",
value:"",
name:"sim卡状态",
key2:"", //key2,,valuedata[key][key2]
typeArr:{
"11":"未激活",
"13":"可激活",
"14":"已停用",
"20":"在用"
}, //typeArr,value , valuetypeArr[value]
},{
key:"signal_level",
value:"",
name:"信号等级",
key2:"",
typeArr:["未知","差","良","良","优"]
},{
key:"price_plan_name",
value:"",
name:"在用套餐名",
key2:"",
},{
key:"real_named",
value:"",
name:"是否已实名认证",
key2:"",
},{
key:"sim_price_plan_id",
value:"",
name:"套餐订购实例ID",
key2:"",
},{
key:"tag_names",
value:"",
name:"标签名",
key2:"",
},{
key:"sim_card_id",
value:"",
name:"sim卡id",
key2:""
},{
key:"cid",
value:"",
name:"cid",
key2:""
},{
key:"imei",
value:"",
name:"imei",
key2:""
},{
key:"imsi",
value:"",
name:"imsi",
key2:""
},{
key:"iccid",
value:"",
name:"iccid",
key2:""
},{
key:"msisdn",
value:"",
name:"msisdn",
key2:""
},{
key:"network_type",
value:"",
name:"网络类型",
key2:""
},{
key:"node_id",
value:"",
name:"设备标识",
key2:""
},{
key:"operator_status",
value:"",
name:"运营商状态",
key2:"",
typeArr:["非停机","停机(超流量停机)" ,"停机(超流量阈值停机)" ,"停机(流量池停机)" ,"停机(套餐到期停机)","停机(主动停机)","停机(违规停机)"]
},{
key:"device_status",
value:"",
name:"iccid",
key2:"",
typeArr:["未知", "注册", "重启", "在线", "离线"]
},{
key:"cut_net_flag",
value:"",
name:"是否单独断网",
key2:""
},{
key:"exceed_cut_net_flag",
value:"",
name:"是否达量断网",
key2:""
},{
key:"exceed_cut_net_quota",
value:"",
name:"达量断网阈值(单位MB)",
key2:""
},{
key:"imei_bind_remain_times",
value:"",
name:"本月机卡绑定剩余次数",
key2:""
},{
key:"speed_value",
value:"",
name:"网络限制速率(单位Kbps)",
key2:""
},{
key:"exceed_cut_net_quota",
value:"",
name:"达量断网阈值(单位MB)",
key2:""
},{
key:"expire_time",
value:"",
name:"过期时间",
key2:""
},{
key:"dbm",
value:"",
name:"信号强度",
key2:""
},{
key:"device_model",
value:"",
name:"设备模组",
key2:""
}
];
import {
mapState
} from 'vuex'
export default {
components: {
'store-name': store_name
},
computed: {
...mapState({
storeList: state => state.device.storeList,
curStoreInfo: state => state.device.curStoreInfo,
}),
isDel() {
return (item) => {
return item[2] == "删除" ? "true" : ""
}
},
},
data() {
return {
infoObj,
latitude: 23.2174411,
longitude: 113.3048267,
update_time:new Date(),
covers: [
],
}
},
async onLoad(opts) {
console.log("opts:",opts);
this.mac = opts.mac;
this.updateList()
// try {
// util.showLoad();
// let _brandInfo = await this.$store.dispatch('getBrandInfo');
// await this.$store.dispatch('getStoreList');
// util.hideLoad();
// } catch (err) {
// util.hideLoad();
// }
},
onShow() {
// this.updateList() //
},
watch: {
// curStoreInfo(newVal, oldVal){
// this.infoArr.length = 1
// this.updateList()
// }
},
methods: {
clickReboot(){
let that = this
uni.showModal({
content: `更新信息 ?`,
success(res) {
console.log("确认", res.confirm)
if(res.confirm){
that.reboot4G()
}
},
})
},
reboot4G(){
util.showLoad();
deviceServer.post({
url: deviceApi.reboot4G,
data: {
mac:this.mac
},
isDefaultGet: false,
})
.then(res => {
util.hideLoad();
if (res.data.code == 0) {
util.showNone(res.data.message || '操作成功!');
} else {
util.showNone(res.data.message || '操作失败!');
}
})
.catch(err => {
util.hideLoad()
})
},
async updateList() {
let that = this
if(!this.mac)return
util.showLoad();
deviceServer.post({
url: deviceApi.getLotDetail,
data: {
iccid:this.mac,
is_sync:0
},
isDefaultGet: false,
})
.then(res => {
util.hideLoad();
if (res.data.code == 0) {
that.filterRouterData(res.data.data)
} else {
util.showNone(res.data.message || '操作失败!');
}
})
.catch(err => {
util.hideLoad()
})
},
//
filterRouterData(data){
console.log("filterRouterData:",data);
let obj = this.infoObj
for(var i in obj){
let e = obj[i]
let res = data[e.key]
if(res==="undefined")res = "未知状态1"
if(res==="")res = "未知状态2" //({})
console.log(888888,res);
// if(res==="undefined"||res==="") continue
e.value = (typeof(res)=="object")?data[e.key][e.key2]:res;
e.value = e.value.toString();
if(e.typeArr&&e.value)e.value = e.typeArr[e.value];
if(e.value=== "false")e.value = "否";
if(e.value=== "true")e.value = "是";
// if(e.value===0)e.value = "0";
console.log(e.value);
}
this.update_time = obj[0].value;
},
goBack() {
uni.navigateBack({
delta: 1
})
},
}
}
</script>
<style lang="scss">
@import '~style/public.scss';
.t-router-page {
.t-title {
font-size: 44rpx;
color: #1A1A1A;
font-weight: 900;
@include centerFlex(space-between);
margin: 60rpx auto 0rpx 40rpx;
.t-reset{
padding-right: 48rpx;
@include centerFlex(center);
font-size: 32rpx;
color: #009874;
image{
margin-top: 5rpx;
margin-left: 15rpx;
width: 32rpx;
height: 32rpx;
}
}
}
.t-update{
font-size: 28rpx;
color: #9C9C9F;
margin-top: 38rpx;
margin-left: 40rpx;
}
.t-map{
@include centerFlex(center);
width:700rpx;
// background-color: lightgray;
// height: 450rpx;
margin: 25rpx;
}
.t-box {
height: 500rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
width: 100%;
.tab-list {
width: 100%;
padding-left: 30rpx;
@include centerFlex(flex-start);
flex-wrap: nowrap;
position: relative;
.t-item {
margin-right: 50rpx;
padding: 10rpx;
font-size: 32rpx;
font-weight: 900;
color: #9C9C9F;
line-height: 40rpx;
}
.active {
color: #009874;
@include centerFlex(center);
flex-direction: column;
}
.active:after {
position: absolute;
content: "";
background-color: #009874;
color: #009874;
width: auto;
display: block;
width: 30rpx;
text-align: center;
height: 6rpx;
border-radius: 3rpx;
top: 60rpx;
}
}
.info-list {
margin-top: 30rpx;
margin-bottom: 50rpx;
width: 700rpx;
height: auto;
background: #FFFFFF;
border-radius: 10rpx;
font-size: 28rpx;
.i-item {
@include centerFlex(flex-start);
.i-box {
@include centerFlex(flex-start);
flex-direction: row;
padding: 26rpx 20rpx;
height: 100%;
}
.i-box:first-child {
@include centerFlex(center);
width: 300rpx;
text-align: center;
border-right: 1rpx solid #F2F2F7;
}
.i-box:nth-child(2) {
width: 100%;
}
}
.i-item:not(:last-child) {
border-bottom: 1rpx solid #F2F2F7;
}
}
}
}
</style>

445
src/subpackage/device/pages/index/router_manage.vue

@ -0,0 +1,445 @@
<template>
<view class="t-router-page">
<!-- <store-name></store-name> -->
<view class="t-title">路由器管理
<view class="t-reset" @click="clickReboot">重启
<image src="../../static/images/refresh.png" mode=""></image>
</view>
</view>
<view class="t-update">
更新时间: {{update_time}}
</view>
<view class="t-map" v-if="covers.length>0">
<map style="width: 100%; height: 250px;" :latitude="latitude" :longitude="longitude" :markers="covers">
</map>
</view>
<view class="t-box">
<view class="info-list">
<view class="i-item" v-for="(item,index) in infoObj">
<view class="i-box">{{item.name}}</view>
<rich-text class="i-box" :nodes="item.value"></rich-text>
</view>
</view>
</view>
</view>
</template>
<script>
import util from '../../../../utils/util';
import store_name from '../../components/store_name/store_name';
import deviceServer from '../../js/device_server';
import deviceApi from '../../js/device_api';
const rootPage = '/subpackage/device'
const infoObj = [
{
key:"update_time",
value:"",
name:"在线时间",
key2:""
},{
key:"model",
value:"00-00-00",
name:"路由型号",
key2:""
},{
key:"mac",
value:"",
name:"MAC地址",
key2:""
},{
key:"firmware",
value:"",
name:"固件版本",
key2:""
},{
key:"imei",
value:"",
name:"imei",
key2:""
},{
key:"imsi",
value:"",
name:"imsi",
key2:""
},{
key:"iccid",
value:"",
name:"iccid",
key2:""
},{
key:"mncmcc",
value:"",
name:"国家代码",
key2:""
},{
key:"lac",
value:"",
name:"lac",
key2:""
},{
key:"cellid",
value:"",
name:"cellid",
key2:""
},{
key:"csq",
value:"",
name:"信号强度",
key2:""
},{
key:"lanip",
value:"",
name:"路由IP",
key2:"ipaddr"
},{
key:"lanip",
value:"",
name:"掩码",
key2:"netmask"
},{
key:"lanip",
value:"",
name:"网关",
key2:"gateway"
},{
key:"lanip",
value:"",
name:"dns1",
key2:""
},{
key:"lanip",
value:"",
name:"dns2",
key2:""
}
];
import {
mapState
} from 'vuex'
export default {
components: {
'store-name': store_name
},
computed: {
...mapState({
storeList: state => state.device.storeList,
curStoreInfo: state => state.device.curStoreInfo,
}),
isDel() {
return (item) => {
return item[2] == "删除" ? "true" : ""
}
},
},
data() {
return {
infoObj,
latitude: 23.2174411,
longitude: 113.3048267,
update_time:new Date(),
covers: [
],
}
},
async onLoad(opts) {
console.log("opts:",opts);
this.mac = opts.mac;
this.updateList()
// try {
// util.showLoad();
// let _brandInfo = await this.$store.dispatch('getBrandInfo');
// await this.$store.dispatch('getStoreList');
// util.hideLoad();
// } catch (err) {
// util.hideLoad();
// }
},
onShow() {
// this.updateList() //
console.log("123",infoObj);
},
watch: {
// curStoreInfo(newVal, oldVal){
// this.infoArr.length = 1
// this.updateList()
// }
},
methods: {
clickReboot(){
let that = this
uni.showModal({
content: `确认要重启路由 ?`,
success(res) {
console.log("确认", res.confirm)
if(res.confirm){
that.reboot4G()
}
},
})
},
reboot4G(){
util.showLoad();
deviceServer.post({
url: deviceApi.reboot4G,
data: {
mac:this.mac
},
isDefaultGet: false,
})
.then(res => {
util.hideLoad();
if (res.data.code == 0) {
util.showNone(res.data.message || '操作成功!');
} else {
util.showNone(res.data.message || '操作失败!');
}
})
.catch(err => {
util.hideLoad()
})
},
async updateList() {
let that = this
if(!this.mac)return
util.showLoad();
deviceServer.post({
url: deviceApi.getRouterDetail,
data: {
mac:this.mac,
is_sync:0
},
isDefaultGet: false,
})
.then(res => {
util.hideLoad();
if (res.data.code == 0) {
that.filterRouterData(res.data.data)
} else {
util.showNone(res.data.message || '操作失败!');
}
})
.catch(err => {
util.hideLoad()
})
// this.operateReq({
// data: timingData,
// succFun: (list) => {
// that.infoArr.length = 1;
// list.forEach(async (item,i)=> {
// if(item.day_of_week)item.day_of_week = item.day_of_week.sort((a,b)=>a-b);//
// let timetxt = await that.getTimeTxt(item);
// that.infoArr.push([item.expand_value.main.title||"-",timetxt||"-","",item.time_arrow_id])
// })
// }
// })
},
//
filterRouterData(data){
console.log("filterRouterData:",data);
let obj = this.infoObj
for(var i in obj){
let e = obj[i]
let res = data[e.key]
if(!res) continue
e.value = (typeof(res)=="object")?data[e.key][e.key2]:res;
}
if(data.clientiplist.length>0){
data.clientiplist.forEach((e,i)=>{
console.log(i,e);
obj.push({
value:e[0],
name:`终端${i+1} IP`
})
obj.push({
value:e[1],
name:`终端${i+1} MAC`
})
})
}
this.update_time = obj[0].value;
//
let location_arr = data.position.location.split(",")
this.latitude = location_arr[1];
this.longitude = location_arr[0];
this.covers.push({
latitude: location_arr[1],
longitude: location_arr[0],
width:40,
height:40,
iconPath: '../../static/images/devices/18.png'
})
},
//,
getTimeTxt(row) {
return new Promise((rs,rj)=>{
})
},
goBack() {
uni.navigateBack({
delta: 1
})
},
//
operateReq({
data,
succFun,
isTip = false,
isLoad = true,
}) {
let that = this
if (isLoad) util.showLoad();
deviceServer.post({
url: deviceApi.ouxuanac,
data: data,
isDefaultGet: false,
})
.then(res => {
if (isLoad) util.hideLoad();
if (res.data.code == 0) {
if (isTip) util.showNone(res.data.message || '操作成功!');
succFun(res.data.data)
} else {
if (isTip) util.showNone(res.data.message || '操作失败!');
}
})
.catch(err => {
if (isLoad) util.hideLoad()
})
},
}
}
</script>
<style lang="scss">
@import '~style/public.scss';
.t-router-page {
.t-title {
font-size: 44rpx;
color: #1A1A1A;
font-weight: 900;
@include centerFlex(space-between);
margin: 60rpx auto 0rpx 40rpx;
.t-reset{
padding-right: 48rpx;
@include centerFlex(center);
font-size: 32rpx;
color: #009874;
image{
margin-top: 5rpx;
margin-left: 15rpx;
width: 32rpx;
height: 32rpx;
}
}
}
.t-update{
font-size: 28rpx;
color: #9C9C9F;
margin-top: 38rpx;
margin-left: 40rpx;
}
.t-map{
@include centerFlex(center);
width:700rpx;
// background-color: lightgray;
// height: 450rpx;
margin: 25rpx;
}
.t-box {
height: 500rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
width: 100%;
.tab-list {
width: 100%;
padding-left: 30rpx;
@include centerFlex(flex-start);
flex-wrap: nowrap;
position: relative;
.t-item {
margin-right: 50rpx;
padding: 10rpx;
font-size: 32rpx;
font-weight: 900;
color: #9C9C9F;
line-height: 40rpx;
}
.active {
color: #009874;
@include centerFlex(center);
flex-direction: column;
}
.active:after {
position: absolute;
content: "";
background-color: #009874;
color: #009874;
width: auto;
display: block;
width: 30rpx;
text-align: center;
height: 6rpx;
border-radius: 3rpx;
top: 60rpx;
}
}
.info-list {
margin-top: 30rpx;
margin-bottom: 50rpx;
width: 700rpx;
height: auto;
background: #FFFFFF;
border-radius: 10rpx;
font-size: 28rpx;
.i-item {
@include centerFlex(flex-start);
.i-box {
@include centerFlex(flex-start);
flex-direction: row;
padding: 26rpx 20rpx;
height: 100%;
}
.i-box:first-child {
width: 250rpx;
text-align: center;
border-right: 1rpx solid #F2F2F7;
}
.i-box:nth-child(2) {
width: 100%;
}
}
.i-item:not(:last-child) {
border-bottom: 1rpx solid #F2F2F7;
}
}
}
}
</style>

77
src/subpackage/device/pages/switch_manage/switch_manage.vue

@ -4,14 +4,18 @@
<view class="sm-tit">{{pageInfo.name || '-'}}</view>
<view class="sm-list">
<view class="sl-item" v-for="(e, i) in deviceList" :key="i" :style="{width:pageInfo.name=='照明管理'?'710rpx':''}">
<view class="si-top">
<view class="sl-item" v-for="(e, i) in deviceList" :key="i" :style="{width:getViewWidth()}">
<view class="si-top" >
<image mode="aspectFit" :src="getIcon()"></image>
<view class="st-right">
<view class="sr-name">{{e.hardware_name || '-'}}</view>
<!-- 门闸没有状态查询 -->
<!-- 请求接口自定义字段设备状态 1->在线0->离线 -->
<view class="sr-bot" v-if="pageInfo.id !=5">
<view class="sr-bot-router" v-if="pageInfo.name =='物联卡管理'">
sim状态: <text>{{e.hardware_model}}</text>
</view>
<view class="sr-bot" v-else-if="pageInfo.id !=5">
<view :class="[e.defineStatusCode == 1?'active':'']">
<text>{{ e.defineStatusCode == 1 ? '设备在线' : e.defineStatusCode == 0?'设备离线' : '-' }}</text>
</view>
@ -19,7 +23,9 @@
</view>
</view>
</view>
<view class="si-bottom" v-if="pageInfo.isOpen || pageInfo.isClose">
<!-- 不同设备的可操作按钮区分,目前无明显规律,so 按需求单独 if 判断 -->
<view class="si-bottom" v-if="pageInfo.isOpen || pageInfo.isClose || pageInfo.isDetail">
<view v-if="pageInfo.isOpen" @click="operateBtn({ switchInfo: e, status: 1 })" :style="{width:getIconWidth()}">
<image mode="aspectFit" :src="pageInfo.openIcon || ''"></image>
<view>{{pageInfo.openName || '-'}}</view>
@ -36,6 +42,9 @@
<image mode="aspectFit" :src="pageInfo.timingIcon || ''"></image>
<view>{{pageInfo.timingName || '-'}}</view>
</view>
<view v-if="pageInfo.isDetail" @click="operateBtn({ switchInfo: e, status: 4 })" class="btn-detail">
<view >{{pageInfo.detailName || '-'}}</view>
</view>
</view>
</view>
</view>
@ -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;
}
}
}
}
}

164
src/subpackage/device/pages/timing/timing_setting.vue

@ -1,20 +1,29 @@
<template>
<view class="timing-page">
<store-name></store-name>
<view class="t-title">照明定时</view>
<view class="t-title">{{switchInfo.hardware_name}}定时</view>
<view class="t-box">
<view class="info-list">
<view class="il-switch">
<text class="">时间动作</text>
<view class=""><image src="../../../../static/images/icon/retail/choose.png" mode=""></image></view>
<view class=""><image src="../../../../static/images/icon/retail/choose.png" mode=""></image></view>
<view class="" @click="tapSwitch">
<view class="un-select" v-if="!on"></view>
<image v-else class="" src="../../../../static/images/icon/retail/choose.png" mode=""></image>
</view>
<view class="" @click="tapSwitch">
<view class="un-select" v-if="on"></view>
<image v-else src="../../../../static/images/icon/retail/choose.png" mode=""></image>
</view>
</view>
<view class="il-select">
<text class="">时间类型</text>
<view class="">
<text>星期</text><image src="../../../../static/images/icon/arrow_b2.png" mode=""></image>
<picker @change="bindPickerChangeSingle" :value="sIndex" :range="singleArr">
<view class="il-input">
<text>{{singleArr[sIndex]}}</text><image src="../../../../static/images/icon/arrow_b2.png" mode=""></image>
</view>
</picker>
</view>
<view class="il-select-week">
<block v-for="(e,i) in weekArrSelect" :key="i">
@ -22,11 +31,36 @@
</block>
</view>
<view class="il-select">
<text class="">时间类型</text>
<view class="">
<text>15:30</text><image src="../../../../static/images/icon/arrow_b2.png" mode=""></image>
<text class="">时间点</text>
<picker mode="time" :value="time" start="09:01" end="21:01" @change="bindTimeChange">
<view class="il-input">
<text>{{time}}</text><image src="../../../../static/images/icon/arrow_b2.png" mode=""></image>
</view>
</view>
</picker>
</view>
<view class="il-select">
<text class="">具体日期</text>
<picker @change="bindPickerChangeDay" :value="dIndex" :range="dayArr">
<view class="il-input">
<text>{{dayArr[dIndex]}} </text><image src="../../../../static/images/icon/arrow_b2.png" mode=""></image>
</view>
</picker>
</view>
<view class="il-select-double">
<text class="">具体时间段</text>
<view class="il-input">
<picker mode="time" :value="time" start="00:01" end="23:59" @change="bindTimeChange">
<text>开始时间 {{time}} </text>
</picker>
<view class=""></view>
<picker mode="time" :value="time" start="00:01" end="23:59" @change="bindTimeChange">
<text>结束时间 {{time}} </text>
</picker>
</view>
</view>
</view>
<view class="save-btn">保存</view>
@ -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;

BIN
src/subpackage/device/static/images/devices/16.png

After

Width: 80  |  Height: 80  |  Size: 3.0 KiB

BIN
src/subpackage/device/static/images/devices/17.png

After

Width: 80  |  Height: 80  |  Size: 1.7 KiB

BIN
src/subpackage/device/static/images/devices/18.png

After

Width: 80  |  Height: 80  |  Size: 4.8 KiB

BIN
src/subpackage/device/static/images/devices/19.png

After

Width: 80  |  Height: 80  |  Size: 1.3 KiB

Loading…
Cancel
Save