feat: 添加子菜单

This commit is contained in:
dap
2024-10-07 20:07:33 +08:00
parent 93912efc67
commit 3551292619
3 changed files with 43 additions and 6 deletions

View File

@@ -100,6 +100,12 @@ function handleAdd() {
drawerApi.open();
}
function handleSubAdd(row: Recordable<any>) {
const { menuId } = row;
drawerApi.setData({ id: menuId, update: false });
drawerApi.open();
}
async function handleEdit(record: Recordable<any>) {
drawerApi.setData({ id: record.menuId });
drawerApi.open();
@@ -165,6 +171,15 @@ const isAdmin = computed(() => {
>
{{ $t('pages.common.edit') }}
</ghost-button>
<!-- '按钮类型'无法再添加子菜单 -->
<ghost-button
v-if="row.menuType !== 'F'"
class="btn-add"
v-access:code="['system:menu:add']"
@click="handleSubAdd(row)"
>
{{ $t('pages.common.add') }}
</ghost-button>
<Popconfirm
:get-popup-container="getPopupContainer"
placement="left"
@@ -186,3 +201,15 @@ const isAdmin = computed(() => {
</Page>
<Fallback v-else description="您没有菜单管理的访问权限" status="403" />
</template>
<style lang="scss" scoped>
.btn-add {
color: hsl(var(--success)) !important;
border-color: hsl(var(--success)) !important;
&:hover {
color: hsl(var(--success) / 50%) !important;
border-color: hsl(var(--success) / 50%) !important;
}
}
</style>