Files
zgty-mas-m/pages/analysis/index/index.vue
2025-11-15 18:09:04 +08:00

121 lines
2.8 KiB
Vue

<template>
<view>
<navbar-back
title="实验室管理系统【分析管理】"
titleWidth="800"
:autoBack="false"
leftIcon=""
:leftText="`您好!${userInfo.nickname}`"
>
<u-icon @click="popupShow = true" size="28" color="#FFF" name="account-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="80" />
<view class="grid-text">{{ item.name }}</view>
</up-grid-item>
</up-grid>
<mePopup :show="popupShow" @update:show="val => (popupShow = val)" />
</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 popupShow = ref(false)
const isAllowAgainPrint = ref(false)
const menuItemList = ref([
{
url: '/pages/analysis/sample/sample-work-list',
otherConf: { icon: '/static/images/menus/sampleAnalysis.png' },
name: '样品分析'
},
{
url: '/pages/analysis/sample/sample-report-search',
otherConf: { icon: '/static/images/menus/records.png' },
name: '分析记录'
},
{
url: '/pages/analysis/auncel/auncel-status',
otherConf: { icon: '/static/images/menus/balance.png' },
name: '天平查看'
}
])
// 计算属性
const userInfo = computed(() => nx.$store('user').userInfo)
// 方法
const goTo = url => {
nx.$router.go(url)
}
const checkAllowAgainPrint = () => {
const param = {
userId: userInfo.value.id,
clientId: 'auncel'
}
nx.$api.user.getAppPermission(param).then(res => {
if (!res.success) return
const ret = res.result || []
if (ret.length === 0) return
for (let i = 0; i < ret.length; i++) {
if (ret[i].roleValue && ret[i].roleValue === 2) {
isAllowAgainPrint.value = true
}
}
})
}
const openLaboratoryWs = () => {
const regData = {
msgId: nx.$helper.uuid(),
cmd: 'register',
clientType: 'caaClient',
data: {
userId: userInfo.value.id,
tenantId: userInfo.value.loginTenantId,
userRealName: userInfo.value.realname
}
}
nx.$measure.setRegData(JSON.stringify(regData))
nx.$measure.open()
}
// 生命周期
onMounted(() => {
// checkAllowAgainPrint()
// openLaboratoryWs()
})
// 动态设置 grid 列数
const { gridCol } = useGridCol([400], [2, 3])
</script>
<style scoped lang="scss">
.title_content {
text-align: center;
padding-top: 75px;
letter-spacing: 10px;
width: 100%;
font-size: 36px;
color: #fff;
}
.banner {
overflow: hidden;
background-repeat: no-repeat;
background-size: 100%;
}
.grid-text {
font-size: 24px;
}
</style>