feat:菜单可配置

This commit is contained in:
houjunxiang
2025-11-27 16:12:25 +08:00
parent f3c15b3692
commit 6c86dc0760
46 changed files with 79 additions and 162 deletions

View File

@@ -1,18 +1,12 @@
<template>
<view>
<navbar-back
title="样品库管理"
titleWidth="800"
:autoBack="false"
leftIcon=""
:leftText="`您好!${userInfo.nickname}`"
>
<navbar-back title="实验室管理系统【样品库管理】" titleWidth="800" :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.url" @click="goTo(item.url)">
<u-icon :name="item.otherConf.icon" color="#0055A2" size="60" />
<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="60" />
<view class="grid-text">{{ item.name }}</view>
</up-grid-item>
</up-grid>
@@ -31,46 +25,15 @@ import mePopup from '@/pages/index/me-popup.vue'
// 响应式数据
const popupShow = ref(false)
const menuItemList = ref([
{
url: '/pages/sampleWarehouse/sampleSearch/index',
otherConf: { icon: '/static/images/menus/records.png' },
name: '样品查询'
},
{
url: '/pages/sampleWarehouse/returnToStock/index',
otherConf: { icon: '/static/images/menus/ypgk.png' },
name: '样品归库'
},
{
url: '/pages/sampleWarehouse/execChangeLocation/index',
otherConf: { icon: '/static/images/menus/kwbg.png' },
name: '库位变更'
},
{
url: '/pages/sampleWarehouse/sampleDispatchInternal/index',
otherConf: { icon: '/static/images/menus/nbdb.png' },
name: '内部调拨'
},
{
url: '/pages/sampleWarehouse/sampleDispatchExternal/index',
otherConf: { icon: '/static/images/menus/wbdb.png' },
name: '外部调拨'
},
{
url: '/pages/sampleWarehouse/dispatchGiveBack/index',
otherConf: { icon: '/static/images/menus/dbgh.png' },
name: '调拨归还'
},
{
url: '/pages/sampleWarehouse/sampleTakeOff/index',
otherConf: { icon: '/static/images/menus/ypxj.png' },
name: '样品下架'
const menuItemList = computed(() => {
let roleMenus = nx.$store('user').roleMenus
const result = roleMenus.find(item => item.path === 'ypkgl')
if (result) {
return result.children
} else {
return []
}
])
// 计算属性
const userInfo = computed(() => nx.$store('user').userInfo)
})
// 方法
const goTo = url => {

View File

@@ -17,7 +17,7 @@
<up-input
class="mt10"
v-model="targetCode"
placeholder="请扫描需要调拨的样品编号"
placeholder="请扫描需要下架的样品编号"
prefixIcon="scan"
fontSize="16"
prefixIconStyle="font-size: 30px;"
@@ -25,7 +25,7 @@
>
</up-input>
<uni-section v-if="sampleList.length > 0" type="line" title="调拨样品明细" titleFontSize="15px">
<uni-section v-if="sampleList.length > 0" type="line" title="下架样品明细" titleFontSize="15px">
<template #right> <up-text type="error" size="18" bold :text="sampleList.length"></up-text></template>
<scroll-view style="height: 49vh" scroll-y scroll-with-animation>
<uni-card margin="5px" v-for="item in sampleList" class="sample-item">