<!-- 设备信息首页 --> <script lang="ts" setup name="qualityFile"> import infoList from './components/list.vue' import { getDictByCode } from '@/api/system/dict' export interface menuType { name: string comp: any } // const menu = ref<menuType[]>([ // { name: '全部' }, // ]) const current = ref('') const currentApprovalStatus = ref('0') const approvalStatusMap = ref({}) as any const approvalStatusReserveMap = ref({}) as any // 获取菜单状态 const getMenuStatus = () => { getDictByCode('approvalStatus').then((res) => { // 审批状态字典 {1:草稿箱} res.data.forEach((item: any) => { approvalStatusMap.value[`${item.value}`] = item.name }) // 审批状态字典 {草稿箱: 1} res.data.forEach((item: any) => { approvalStatusReserveMap.value[item.name] = `${item.value}` }) // console.log(approvalStatusReserveMap.value) }) } watch(current, (newValue) => { window.sessionStorage.setItem('deviceBaseInfoMenu', newValue) }) onMounted(async () => { await getMenuStatus() current.value = window.sessionStorage.getItem('deviceBaseInfoMenu') || '全部' }) </script> <template> <div class="container"> <div class="btns"> <!-- 三级菜单 --> <el-radio-group v-model="current"> <el-radio-button v-for="item in menu" :key="item.name" :label="item.name"> {{ item.name }} </el-radio-button> </el-radio-group> </div> <!-- 展示区域 --> <info-list /> </div> </template> <style lang="scss" scoped> .container { position: relative; .btns { position: fixed; top: 67px; right: 15px; z-index: 999; } } </style>