|
<template>
|
<view>
|
<u-grid :col="3" @click="gotoPage" border>
|
<u-grid-item v-for="item in grid" :index="item[0]" class="grid-box">
|
<u-icon name="play-right-fill" :size="46" color="#FF8000"></u-icon>
|
<view class="grid-text">{{item.name}}</view>
|
</u-grid-item>
|
</u-grid>
|
<u-toast ref="uToast" />
|
</view>
|
|
</template>
|
|
<script>
|
import {
|
queryPurview
|
} from '../../api'
|
import grid from '../../uni_modules/uview-ui/libs/config/props/grid'
|
export default {
|
data() {
|
return {
|
grid: [],
|
filter: [
|
{
|
name: '巡检检验',
|
src: '/pages/inspection/inspectionList',
|
icon:''
|
},
|
{
|
name: '首检检验',
|
src: '/pages/inspection/firstInspectionList',
|
icon:''
|
},
|
{
|
name :'机台报工',
|
src:'/pages/work_reporting/work_reporting',
|
icon:''
|
},
|
{
|
name :'设备点检计划',
|
src:'/pages/eqSpotCheck/eqSpotCheckList',
|
icon:''
|
},
|
]
|
}
|
},
|
onLoad() {
|
queryPurview().then(res => {
|
if (!res.result) {
|
this.$refs.uToast.show({
|
message: res.msg,
|
type: 'error'
|
})
|
return
|
}
|
// 显示需要被代理的
|
for (let item of this.filter) {
|
if (res.data.find(t => t[0] == item.name)) {
|
this.grid.push(item)
|
}
|
}
|
console.log(this.grid);
|
})
|
},
|
methods: {
|
gotoPage(e) {
|
// console.log(this.grid[e])
|
// let name = this.grid[e][0]
|
// // 判断该页面是否应该被代理
|
// let item = this.filter.find(t => {
|
// if (t.name == name) {
|
// return t;
|
// }
|
// })
|
// if (typeof(item) == 'undefined') {
|
// uni.navigateTo({
|
// url: '/pages/main/main?name=' + name
|
// })
|
// return
|
// }
|
uni.navigateTo({
|
url: this.grid[e].src
|
})
|
}
|
}
|
}
|
</script>
|
|
<style>
|
.grid-box{
|
border-bottom: 1upx solid #dadbde;
|
border-right: 1upx solid #dadbde;
|
background-color: #f1f2f4;
|
height: 100upx;
|
}
|
</style>
|