修改工单: 右键 给角色分配权限
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m45s

This commit is contained in:
sexygoat
2026-02-26 10:06:11 +08:00
parent dccad819cf
commit 3570b062a1
7 changed files with 302 additions and 80 deletions

View File

@@ -37,6 +37,7 @@
@selection-change="handleSelectionChange"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
@row-contextmenu="handleRowContextMenu"
>
<template #default>
<ElTableColumn v-for="col in columns" :key="col.prop || col.type" v-bind="col" />
@@ -942,11 +943,13 @@
const shopOperationMenuItems = computed((): MenuItemType[] => {
const items: MenuItemType[] = []
// 默认角色
items.push({
key: 'defaultRoles',
label: '默认角色'
})
// 编辑
if (hasAuth('shop:edit')) {
items.push({
key: 'edit',
@@ -954,6 +957,7 @@
})
}
// 删除
if (hasAuth('shop:delete')) {
items.push({
key: 'delete',
@@ -972,6 +976,14 @@
shopOperationMenuRef.value?.show(e)
}
// 处理表格行右键菜单
const handleRowContextMenu = (row: ShopResponse, column: any, event: MouseEvent) => {
// 如果用户有编辑或删除权限,显示右键菜单
if (hasAuth('shop:edit') || hasAuth('shop:delete')) {
showShopOperationMenu(event, row)
}
}
// 处理店铺操作菜单选择
const handleShopOperationMenuSelect = (item: MenuItemType) => {
if (!currentOperatingShop.value) return