|
@ -1,5 +1,5 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class="u-wrap"> |
|
|
<view class="u-wrap" @touchstart="touchScreen" @touchcancel="touchMove"> |
|
|
<!-- <view class="serch txt-16"> |
|
|
<!-- <view class="serch txt-16"> |
|
|
<uni-search-bar class="flex1" placeholder="请输入菜单名称" @confirm="search" @input="input" cancelButton="none" |
|
|
<uni-search-bar class="flex1" placeholder="请输入菜单名称" @confirm="search" @input="input" cancelButton="none" |
|
|
@clear="clearfilterlist"> |
|
|
@clear="clearfilterlist"> |
|
@ -29,7 +29,6 @@ |
|
|
<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop" |
|
|
<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop" |
|
|
:scroll-into-view="itemId"> |
|
|
:scroll-into-view="itemId"> |
|
|
<view v-for="(item,index) in tabbar" :key="index" class="u-tab-item" |
|
|
<view v-for="(item,index) in tabbar" :key="index" class="u-tab-item" |
|
|
|
|
|
|
|
|
:class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)"> |
|
|
:class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)"> |
|
|
<text class="u-line-1">{{item.name}}</text> |
|
|
<text class="u-line-1">{{item.name}}</text> |
|
|
</view> |
|
|
</view> |
|
@ -70,7 +69,7 @@ |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import classifyData from '@/common/classify.data.js'; |
|
|
import classifyData from '@/common/classify.data.js'; |
|
|
|
|
|
import config from '../../static/config.js' |
|
|
export default { |
|
|
export default { |
|
|
components: {}, |
|
|
components: {}, |
|
|
data() { |
|
|
data() { |
|
@ -93,14 +92,17 @@ |
|
|
menusCount: {}, |
|
|
menusCount: {}, |
|
|
filterList: [], |
|
|
filterList: [], |
|
|
serchval: "", |
|
|
serchval: "", |
|
|
backButtonPress: 0 |
|
|
backButtonPress: 0, |
|
|
|
|
|
pageTimeOut: config.pageTimeOut, |
|
|
|
|
|
timeCount: null |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onLoad() { |
|
|
onLoad() { |
|
|
var test ="" |
|
|
|
|
|
|
|
|
var test = "" |
|
|
if (uni.getStorageSync("hasLogin")) { |
|
|
if (uni.getStorageSync("hasLogin")) { |
|
|
|
|
|
|
|
|
this.tabbar = this.getPowersByRoles(); |
|
|
this.tabbar = this.getPowersByRoles(); |
|
|
|
|
|
this.startTimer(); |
|
|
} else { |
|
|
} else { |
|
|
this.tabbar = [] |
|
|
this.tabbar = [] |
|
|
} |
|
|
} |
|
@ -110,6 +112,13 @@ |
|
|
this.getMenuItemTop() |
|
|
this.getMenuItemTop() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
beforeDestroy() { |
|
|
|
|
|
if (this.timeCount) { |
|
|
|
|
|
clearInterval(this.timeCount); |
|
|
|
|
|
this.timeCount = null; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
onHide() {}, |
|
|
onHide() {}, |
|
|
onShow() { |
|
|
onShow() { |
|
@ -151,38 +160,69 @@ |
|
|
// }, |
|
|
// }, |
|
|
mounted() {}, |
|
|
mounted() {}, |
|
|
methods: { |
|
|
methods: { |
|
|
getPowersByRoles(){ |
|
|
startTimer(){ |
|
|
|
|
|
var that = this; |
|
|
|
|
|
this.timeCount = setInterval(()=> { |
|
|
|
|
|
console.log("记时", that.pageTimeOut) |
|
|
|
|
|
if(that.pageTimeOut>0&&that.pageTimeOut<=config.pageTimeOut){ |
|
|
|
|
|
that.pageTimeOut--; |
|
|
|
|
|
}else { |
|
|
|
|
|
console.log("停止", that.pageTimeOut) |
|
|
|
|
|
clearInterval(this.timeCount); |
|
|
|
|
|
this.timeCount = null; |
|
|
|
|
|
uni.reLaunch({ |
|
|
|
|
|
url: "../login/index" |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}, 1000) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
touchScreen() { |
|
|
|
|
|
this.pageTimeOut = config.pageTimeOut |
|
|
|
|
|
if (this.timeCount) { |
|
|
|
|
|
clearInterval(this.timeCount); |
|
|
|
|
|
this.timeCount = null; |
|
|
|
|
|
} |
|
|
|
|
|
this.startTimer(); |
|
|
|
|
|
console.log("页面点击touchScreen", this.pageTimeOut) |
|
|
|
|
|
}, |
|
|
|
|
|
touchMove(){ |
|
|
|
|
|
this.pageTimeOut = config.pageTimeOut |
|
|
|
|
|
console.log("页面点击touchMove", this.pageTimeOut) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getPowersByRoles() { |
|
|
var permissionList = this.$store.state.user.powers |
|
|
var permissionList = this.$store.state.user.powers |
|
|
var tempList=[]; |
|
|
var tempList = []; |
|
|
classifyData.forEach(menuItem=>{ |
|
|
classifyData.forEach(menuItem => { |
|
|
var temp = { |
|
|
var temp = { |
|
|
name :menuItem.name, |
|
|
name: menuItem.name, |
|
|
isShow:menuItem.isShow, |
|
|
isShow: menuItem.isShow, |
|
|
children:[] |
|
|
children: [] |
|
|
} |
|
|
} |
|
|
menuItem.children.forEach(rightItem=>{ |
|
|
menuItem.children.forEach(rightItem => { |
|
|
permissionList.forEach(permission=>{ |
|
|
permissionList.forEach(permission => { |
|
|
if(rightItem.code==permission){ |
|
|
if (rightItem.code == permission) { |
|
|
rightItem.isShow=true |
|
|
rightItem.isShow = true |
|
|
temp.children.push(rightItem) |
|
|
temp.children.push(rightItem) |
|
|
}else { |
|
|
} else { |
|
|
rightItem.isShow=false |
|
|
rightItem.isShow = false |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
tempList.push(temp) |
|
|
tempList.push(temp) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
var showList =[]; |
|
|
var showList = []; |
|
|
tempList.forEach(res=>{ |
|
|
tempList.forEach(res => { |
|
|
if(res.children.length>0){ |
|
|
if (res.children.length > 0) { |
|
|
showList.push(res) |
|
|
showList.push(res) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
return showList; |
|
|
return showList; |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
findList(tab) { |
|
|
findList(tab) { |
|
|
let res = null |
|
|
let res = null |
|
|
for (let i = 0; i < tab.length; i++) { |
|
|
for (let i = 0; i < tab.length; i++) { |
|
@ -305,10 +345,10 @@ |
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
|
url: url |
|
|
url: url |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showMessage(message) { |
|
|
showMessage(message) { |
|
|
this.$refs.comMessage.showMessage(message, res => { |
|
|
this.$refs.comMessage.showMessage(message, res => { |
|
|
if (res) { |
|
|
if (res) { |
|
|