1. 更新多个项目的index.html引入的资源hash文件名 2. 替换BOM页面标题为物料清单,同步路由菜单文案 3. 为多个select组件添加placeholder提示文案 4. 重构MES布局,移除侧边抽屉菜单,添加页面标题 5. 新增/替换部分静态资源文件,删除旧的冗余资源文件
82 lines
2.9 KiB
Vue
82 lines
2.9 KiB
Vue
<template>
|
|
<el-container class="layout" style="min-height:100vh">
|
|
<el-aside width="210px" class="aside">
|
|
<div class="logo">MES 产线控制</div>
|
|
<el-menu :default-active="$route.path" router background-color="#001529"
|
|
text-color="#a6adb4" active-text-color="#409eff" style="border-right:none">
|
|
<el-menu-item v-for="m in menus" :key="m.path" :index="m.path">
|
|
<span>{{ m.name }}</span>
|
|
</el-menu-item>
|
|
</el-menu>
|
|
</el-aside>
|
|
<el-container>
|
|
<el-header class="header">
|
|
<span class="page-title">{{ $route.meta.title || '' }}</span>
|
|
<div class="spacer"></div>
|
|
<div>
|
|
<span style="margin-right:16px">{{ userName }}</span>
|
|
<el-button size="small" @click="router.push('/change-password')">修改密码</el-button>
|
|
<el-button size="small" @click="doLogout">退出</el-button>
|
|
</div>
|
|
</el-header>
|
|
<el-main style="padding:14px">
|
|
<router-view />
|
|
</el-main>
|
|
</el-container>
|
|
</el-container>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref, computed, onMounted } from 'vue'
|
|
import { useRouter } from 'vue-router'
|
|
import { getUser, logout } from '../utils/auth'
|
|
import request from '../utils/request'
|
|
|
|
const router = useRouter()
|
|
|
|
const menus = computed(() => {
|
|
const me = getUser()
|
|
if (!me) return defaultMenus
|
|
const owned = me.permissionCodes || []
|
|
const ok = (c) => me.roleCode === 'SUPER_ADMIN' || owned.includes('*') || owned.includes(c)
|
|
return defaultMenus.filter((m) => ok(m.code))
|
|
})
|
|
|
|
const defaultMenus = [
|
|
{ code: 'produce.workorder', name: '工单管理', path: '/work-order' },
|
|
{ code: 'produce.bom', name: '物料清单', path: '/bom' },
|
|
{ code: 'produce.material', name: '备料单', path: '/material-request' },
|
|
{ code: 'produce.plc', name: 'PLC工序下发', path: '/plc-send' },
|
|
{ code: 'produce.torque', name: '拧紧查询', path: '/torque' },
|
|
{ code: 'produce.scan', name: '扫码报工', path: '/scan' },
|
|
{ code: 'produce.trace', name: '工件追溯', path: '/trace' },
|
|
{ code: 'produce.product', name: '产品类型', path: '/product-type' },
|
|
{ code: 'sys.eventlog', name: '操作日志', path: '/event-log' },
|
|
{ code: 'sys.rbac', name: '角色权限管理', path: '/rbac' }
|
|
]
|
|
|
|
const userName = computed(() => {
|
|
const me = getUser()
|
|
return me ? (me.name || me.username) : '未登录'
|
|
})
|
|
|
|
onMounted(async () => {
|
|
try {
|
|
const u = await request.get('/userinfo')
|
|
localStorage.setItem('user', JSON.stringify(u))
|
|
} catch { /* ignore */ }
|
|
})
|
|
|
|
function doLogout() {
|
|
logout()
|
|
router.replace('/login')
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.aside { background: #001529; }
|
|
.logo { color: #fff; font-size: 17px; font-weight: 600; text-align: center; line-height: 60px; height: 60px; }
|
|
.header { display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid #eee; }
|
|
.page-title { font-size: 16px; font-weight: 600; color: #303133; }
|
|
.spacer { flex: 1; }
|
|
</style> |