feat: 新增装机绑定功能与权限、BOM工序配置
1. 新增装机绑定实体与相关CRUD逻辑,支持工件工序物料绑定/解绑 2. 为BOM物料新增装配工序字段,支持按工序校验绑定 3. 扩展权限表,新增父权限码字段支持菜单按钮关联 4. 统一各页面帮助弹窗参数,新增角色管理帮助文档 5. 新增公共格式化工具函数,优化侧边栏菜单展开逻辑 6. 新增工位终端绑定代理接口与MES内部绑定API 7. 修复主入口数据库连接与schema初始化逻辑,新增一键迁移工具
This commit is contained in:
@@ -196,6 +196,22 @@ export const helpDashboard = {
|
||||
overview: '只读看板:库存总量、物料种类、出入库动态等。\n数据实时读取统计接口,本页不可编辑。',
|
||||
fields: []
|
||||
}
|
||||
export const helpRole = {
|
||||
title: '角色管理',
|
||||
overview:
|
||||
'角色决定账号能看哪些菜单(勾选菜单)与能用哪些功能(勾选其下按钮),勾选互不影响。\n内置角色:管理员(全部权限)、库房保管员、质检员——不可删除;管理员权限不可编辑。',
|
||||
sections: [
|
||||
{
|
||||
title: '新增 / 编辑权限',
|
||||
fields: [
|
||||
{ name: '角色名称', source: '手工填写。', purpose: '角色中文名', fill: '如 库房管理员' },
|
||||
{ name: '角色编码', source: '手工填写。', purpose: '角色唯一编码,创建后不可改', fill: '如 intro-manager' },
|
||||
{ name: '权限树', source: '勾选。来自系统预置的权限菜单与按钮。', purpose: '决定该角色可见菜单与可用按钮', fill: '勾选菜单=可见;勾选按钮=可用(两者独立)' }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
export const helpEventLog = {
|
||||
title: '操作日志',
|
||||
overview:
|
||||
|
||||
@@ -5,12 +5,21 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import request from '../utils/request'
|
||||
import { fmtTime } from '../utils/format'
|
||||
import { can } from '../utils/perm'
|
||||
import PageHelp from '../components/PageHelp.vue'
|
||||
import { helpRole } from '../help'
|
||||
|
||||
const loading = ref(false)
|
||||
const list = ref([])
|
||||
const perms = ref([]) // 全部权限(MENU + BUTTON)
|
||||
const treeRef = ref()
|
||||
|
||||
// 权限码 → 中文名:列表「权限明细」统一显示中文(与 MES 一致)
|
||||
const codeName = computed(() => {
|
||||
const m = {}
|
||||
for (const p of perms.value) m[p.code] = p.name
|
||||
return m
|
||||
})
|
||||
|
||||
// 权限树:一级=菜单,二级=该菜单下的按钮;全局按钮(parentCode空)归入「通用」分组
|
||||
const permTree = computed(() => {
|
||||
const menus = perms.value.filter((p) => p.type === 'MENU')
|
||||
@@ -136,10 +145,13 @@ async function removeRole(row) {
|
||||
} catch { /* 拦截器已提示 */ }
|
||||
}
|
||||
|
||||
// 权限码展示(列表内),过长缩略
|
||||
// 权限码展示(列表内):统一中文名,最多 8 项,完整内容放 tooltip
|
||||
function permSummary(arr) {
|
||||
if (!arr || !arr.length) return '-'
|
||||
return arr.join(', ')
|
||||
const codes = arr || []
|
||||
if (!codes.length) return '-'
|
||||
if (codes.includes('*')) return '全部权限'
|
||||
const names = codes.map((c) => codeName.value[c] || c)
|
||||
return names.length > 8 ? `${names.slice(0, 8).join('、')} 等 ${names.length} 项` : names.join('、')
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -166,7 +178,9 @@ function permSummary(arr) {
|
||||
<template #default="{ row }">{{ row.remark || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="权限数" width="90" align="center">
|
||||
<template #default="{ row }">{{ (row.permissionCodes || []).length }} 项</template>
|
||||
<template #default="{ row }">
|
||||
{{ (row.permissionCodes || []).includes('*') ? '全部' : (row.permissionCodes || []).length }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="权限明细" min-width="220">
|
||||
<template #default="{ row }">
|
||||
@@ -218,6 +232,7 @@ function permSummary(arr) {
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<PageHelp :data="helpRole" page="RoleManage" />
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user