Files
zgty-mas-m/pages/device/index/index.vue
2026-02-05 11:10:44 +08:00

44 lines
1.2 KiB
Vue

<template>
<view>
<navbar-back title="实验室管理系统【设备管理】" :autoBack="false" leftIcon="" leftText="">
<u-icon @click="popupShow = true" size="28" color="#FFF" name="setting-fill" />
</navbar-back>
<up-grid :col="gridCol" :border="false">
<up-grid-item class="mb20 mt20" v-for="item in menuItemList" :key="item.id" @click="goTo(item.component)">
<u-icon :name="`/static/images/menus/${item.path}.png`" color="#0055A2" size="80" />
<view class="grid-text">{{ item.name }}</view>
</up-grid-item>
</up-grid>
<mePopup v-model:show="popupShow" />
</view>
</template>
<script setup>
import { ref, computed, onMounted } from 'vue'
import nx from '@/nx'
import { useGridCol } from '@/nx/hooks/useGridCol'
import mePopup from '@/pages/index/me-popup.vue'
const { gridCol } = useGridCol([400, 600], [2, 3, 4])
let popupShow = ref(false)
const menuItemList = computed(() => {
let roleMenus = nx.$store('user').roleMenus
const result = roleMenus.find(item => item.path === 'device')
if (result) {
return result.children
} else {
return []
}
})
// 方法
const goTo = url => {
nx.$router.go(url)
}
</script>
<style lang="scss" scoped>
.grid-text {
font-size: 24px;
}
</style>