From 3acc5e4a99c7c69d25d7782e3c71152c5d0e0845 Mon Sep 17 00:00:00 2001 From: YOS-DRVOGPU6U78\Administrator <chenky0613@qq.com> Date: 星期三, 19 七月 2023 10:42:56 +0800 Subject: [PATCH] 首检巡检 --- pages/index/index.vue | 124 +++++++++++++++++------------------------ 1 files changed, 52 insertions(+), 72 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 279764d..eb5066d 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,93 +1,73 @@ <template> - <u-grid :col="3" @click="gotoPage" border> - <u-grid-item v-for="item in grid" :index="item[0]"> - <u-icon name="photo" :size="46"></u-icon> - <view class="grid-text">{{item[0]}}</view> - </u-grid-item> - </u-grid> + <view> + <u-grid :col="3" @click="gotoPage" border> + <u-grid-item v-for="item in grid" :index="item[0]"> + <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: [ - [ - "宸℃棣栨", "touliao" - ], - [ - "閲囪喘鍏ュ簱", "touliao" - ], - [ - "鐢熶骇閫�鏂�", "touliao" - ], - [ - "鍏跺畠鍏ュ簱", "touliao" - ], - [ - "鐢熶骇鍏ュ簱", "touliao" - ], - [ - "閲囪喘閫�璐�", "touliao" - ], - [ - "鍏跺畠鍑哄簱", "touliao" - ], - [ - "璋冩嫈鍑哄簱", "touliao" - ], - [ - "璋冩嫈鍏ュ簱", "touliao" - ], - [ - "鐢熶骇鎶ュ伐", "touliao" - ], - [ - "鎵撳嵃璁剧疆", "touliao" - ], - [ - "鐢熶骇澶囨枡", "touliao" - ] - - ], - title: 'Hello' + grid: [], + filter: [{ + name: '宸℃妫�楠�', + src: '/pages/inspection/inspectionList', + icon:'' + }] } }, onLoad() { + queryPurview().then(res => { + if (!res.result) { + this.$refs.uToast.show({ + message: res.msg, + type: 'error' + }) + return + } + // 鏄剧ず闇�瑕佽浠g悊鐨� + for (let item of this.filter) { + if (res.data.find(t => t[0] == item.name)) { + this.grid.push(item) + } + } + }) }, methods: { gotoPage(e) { - console.log(this.grid[e]) + // console.log(this.grid[e]) + // let name = this.grid[e][0] + // // 鍒ゆ柇璇ラ〉闈㈡槸鍚﹀簲璇ヨ浠g悊 + // 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> - .content { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - } - - .logo { - height: 200rpx; - width: 200rpx; - margin-top: 200rpx; - margin-left: auto; - margin-right: auto; - margin-bottom: 50rpx; - } - - .text-area { - display: flex; - justify-content: center; - } - - .title { - font-size: 36rpx; - color: #8f8f94; - } </style> \ No newline at end of file -- Gitblit v1.9.3