mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 03:09:19 +08:00
完善菜单管理
This commit is contained in:
+5
-5
@@ -103,17 +103,17 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, MenuPO> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 更新菜单
|
// 更新菜单
|
||||||
MenuPO menu = new MenuPO();
|
BeanUtils.copyProperties(updateMenuDTO, existingMenu);
|
||||||
BeanUtils.copyProperties(updateMenuDTO, menu);
|
existingMenu.setId(id); // 确保ID正确设置
|
||||||
|
|
||||||
// 设置更新人ID
|
// 设置更新人ID
|
||||||
menu.setUpdateBy(currentUserContext.getCurrentUserId());
|
existingMenu.setUpdateBy(currentUserContext.getCurrentUserId());
|
||||||
|
|
||||||
// 保存菜单
|
// 保存菜单
|
||||||
this.updateById(menu);
|
this.updateById(existingMenu);
|
||||||
|
|
||||||
// 转换为VO并返回
|
// 转换为VO并返回
|
||||||
return convertToVO(menu);
|
return convertToVO(existingMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+1
-1
@@ -38,7 +38,7 @@
|
|||||||
},
|
},
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
"[html]": {
|
"[html]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "vscode.html-language-features"
|
||||||
},
|
},
|
||||||
"[css]": {
|
"[css]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# 应用标题
|
# 应用标题
|
||||||
VITE_APP_TITLE=Vben Admin Antd
|
VITE_APP_TITLE=CD ECOMDMB
|
||||||
|
|
||||||
# 应用命名空间,用于缓存、store等功能的前缀,确保隔离
|
# 应用命名空间,用于缓存、store等功能的前缀,确保隔离
|
||||||
VITE_APP_NAMESPACE=vben-web-antd
|
VITE_APP_NAMESPACE=ce-ecom-dmb
|
||||||
|
|
||||||
# 对store进行加密的密钥,在将store持久化到localStorage时会使用该密钥进行加密
|
# 对store进行加密的密钥,在将store持久化到localStorage时会使用该密钥进行加密
|
||||||
VITE_APP_STORE_SECURE_KEY=please-replace-me-with-your-own-key
|
VITE_APP_STORE_SECURE_KEY=please-replace-me-with-your-own-key
|
||||||
|
|||||||
+440
@@ -0,0 +1,440 @@
|
|||||||
|
<template>
|
||||||
|
<div class="icon-selector">
|
||||||
|
<!-- 搜索框 -->
|
||||||
|
<div class="mb-2 flex w-full">
|
||||||
|
<Input
|
||||||
|
v-model:value="searchKeyword"
|
||||||
|
placeholder="搜索图标..."
|
||||||
|
class="mx-2"
|
||||||
|
@input="handleSearch"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 图标网格 -->
|
||||||
|
<div class="grid max-h-[360px] w-full grid-cols-6 justify-items-center overflow-y-auto">
|
||||||
|
<button
|
||||||
|
v-for="icon in filteredIcons"
|
||||||
|
:key="icon.name"
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
:class="{ 'bg-primary text-primary-foreground': selectedIcon === icon.name }"
|
||||||
|
@click="selectIcon(icon.name)"
|
||||||
|
:title="icon.name"
|
||||||
|
>
|
||||||
|
<component :is="icon.component" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 分页 -->
|
||||||
|
<div class="flex-center flex justify-end overflow-hidden border-t py-2 pr-3">
|
||||||
|
<nav size="small">
|
||||||
|
<div class="flex w-full items-center gap-1">
|
||||||
|
<button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground p-0 size-5"
|
||||||
|
:disabled="currentPage === 1"
|
||||||
|
@click="goToPage(1)"
|
||||||
|
>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevrons-left size-4">
|
||||||
|
<path d="m11 17-5-5 5-5"></path>
|
||||||
|
<path d="m18 17-5-5 5-5"></path>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground p-0 size-5"
|
||||||
|
:disabled="currentPage === 1"
|
||||||
|
@click="goToPage(currentPage - 1)"
|
||||||
|
>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-left size-4">
|
||||||
|
<path d="m15 18-6-6 6-6"></path>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
v-for="page in visiblePages"
|
||||||
|
:key="page"
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground size-5 p-0 text-sm"
|
||||||
|
:class="{ 'bg-primary text-primary-foreground shadow': page === currentPage }"
|
||||||
|
@click="goToPage(page)"
|
||||||
|
>
|
||||||
|
{{ page }}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div v-if="showEllipsis" class="flex items-center justify-center size-5">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-ellipsis size-4">
|
||||||
|
<circle cx="12" cy="12" r="1"></circle>
|
||||||
|
<circle cx="19" cy="12" r="1"></circle>
|
||||||
|
<circle cx="5" cy="12" r="1"></circle>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground p-0 size-5"
|
||||||
|
:disabled="currentPage === totalPages"
|
||||||
|
@click="goToPage(currentPage + 1)"
|
||||||
|
>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right size-4">
|
||||||
|
<path d="m9 18 6-6-6-6"></path>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground p-0 size-5"
|
||||||
|
:disabled="currentPage === totalPages"
|
||||||
|
@click="goToPage(totalPages)"
|
||||||
|
>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevrons-right size-4">
|
||||||
|
<path d="m6 17 5-5-5-5"></path>
|
||||||
|
<path d="m13 17 5-5-5-5"></path>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, computed, watch } from 'vue'
|
||||||
|
import { Input } from 'ant-design-vue'
|
||||||
|
import { createIconifyIcon } from '@vben/icons'
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
modelValue?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Emits {
|
||||||
|
(e: 'update:modelValue', value: string): void
|
||||||
|
}
|
||||||
|
|
||||||
|
const props = defineProps<Props>()
|
||||||
|
const emit = defineEmits<Emits>()
|
||||||
|
|
||||||
|
const searchKeyword = ref('')
|
||||||
|
const selectedIcon = ref(props.modelValue || '')
|
||||||
|
const currentPage = ref(1)
|
||||||
|
const pageSize = 36 // 6列 x 6行
|
||||||
|
|
||||||
|
// 常用图标列表
|
||||||
|
const iconList = [
|
||||||
|
{ name: 'lucide:plus', component: createIconifyIcon('lucide:plus') },
|
||||||
|
{ name: 'lucide:home', component: createIconifyIcon('lucide:home') },
|
||||||
|
{ name: 'lucide:user', component: createIconifyIcon('lucide:user') },
|
||||||
|
{ name: 'lucide:settings', component: createIconifyIcon('lucide:settings') },
|
||||||
|
{ name: 'lucide:menu', component: createIconifyIcon('lucide:menu') },
|
||||||
|
{ name: 'lucide:search', component: createIconifyIcon('lucide:search') },
|
||||||
|
{ name: 'lucide:edit', component: createIconifyIcon('lucide:edit') },
|
||||||
|
{ name: 'lucide:trash-2', component: createIconifyIcon('lucide:trash-2') },
|
||||||
|
{ name: 'lucide:save', component: createIconifyIcon('lucide:save') },
|
||||||
|
{ name: 'lucide:download', component: createIconifyIcon('lucide:download') },
|
||||||
|
{ name: 'lucide:upload', component: createIconifyIcon('lucide:upload') },
|
||||||
|
{ name: 'lucide:folder', component: createIconifyIcon('lucide:folder') },
|
||||||
|
{ name: 'lucide:file', component: createIconifyIcon('lucide:file') },
|
||||||
|
{ name: 'lucide:image', component: createIconifyIcon('lucide:image') },
|
||||||
|
{ name: 'lucide:video', component: createIconifyIcon('lucide:video') },
|
||||||
|
{ name: 'lucide:music', component: createIconifyIcon('lucide:music') },
|
||||||
|
{ name: 'lucide:mail', component: createIconifyIcon('lucide:mail') },
|
||||||
|
{ name: 'lucide:phone', component: createIconifyIcon('lucide:phone') },
|
||||||
|
{ name: 'lucide:calendar', component: createIconifyIcon('lucide:calendar') },
|
||||||
|
{ name: 'lucide:clock', component: createIconifyIcon('lucide:clock') },
|
||||||
|
{ name: 'lucide:star', component: createIconifyIcon('lucide:star') },
|
||||||
|
{ name: 'lucide:heart', component: createIconifyIcon('lucide:heart') },
|
||||||
|
{ name: 'lucide:thumbs-up', component: createIconifyIcon('lucide:thumbs-up') },
|
||||||
|
{ name: 'lucide:thumbs-down', component: createIconifyIcon('lucide:thumbs-down') },
|
||||||
|
{ name: 'lucide:eye', component: createIconifyIcon('lucide:eye') },
|
||||||
|
{ name: 'lucide:eye-off', component: createIconifyIcon('lucide:eye-off') },
|
||||||
|
{ name: 'lucide:lock', component: createIconifyIcon('lucide:lock') },
|
||||||
|
{ name: 'lucide:unlock', component: createIconifyIcon('lucide:unlock') },
|
||||||
|
{ name: 'lucide:shield', component: createIconifyIcon('lucide:shield') },
|
||||||
|
{ name: 'lucide:key', component: createIconifyIcon('lucide:key') },
|
||||||
|
{ name: 'lucide:bell', component: createIconifyIcon('lucide:bell') },
|
||||||
|
{ name: 'lucide:message-circle', component: createIconifyIcon('lucide:message-circle') },
|
||||||
|
{ name: 'lucide:users', component: createIconifyIcon('lucide:users') },
|
||||||
|
{ name: 'lucide:user-plus', component: createIconifyIcon('lucide:user-plus') },
|
||||||
|
{ name: 'lucide:user-minus', component: createIconifyIcon('lucide:user-minus') },
|
||||||
|
{ name: 'lucide:user-check', component: createIconifyIcon('lucide:user-check') },
|
||||||
|
{ name: 'lucide:user-x', component: createIconifyIcon('lucide:user-x') },
|
||||||
|
{ name: 'lucide:grid', component: createIconifyIcon('lucide:grid') },
|
||||||
|
{ name: 'lucide:list', component: createIconifyIcon('lucide:list') },
|
||||||
|
{ name: 'lucide:layout', component: createIconifyIcon('lucide:layout') },
|
||||||
|
{ name: 'lucide:sidebar', component: createIconifyIcon('lucide:sidebar') },
|
||||||
|
{ name: 'lucide:panel-left', component: createIconifyIcon('lucide:panel-left') },
|
||||||
|
{ name: 'lucide:panel-right', component: createIconifyIcon('lucide:panel-right') },
|
||||||
|
{ name: 'lucide:panel-top', component: createIconifyIcon('lucide:panel-top') },
|
||||||
|
{ name: 'lucide:panel-bottom', component: createIconifyIcon('lucide:panel-bottom') },
|
||||||
|
{ name: 'lucide:chevron-up', component: createIconifyIcon('lucide:chevron-up') },
|
||||||
|
{ name: 'lucide:chevron-down', component: createIconifyIcon('lucide:chevron-down') },
|
||||||
|
{ name: 'lucide:chevron-left', component: createIconifyIcon('lucide:chevron-left') },
|
||||||
|
{ name: 'lucide:chevron-right', component: createIconifyIcon('lucide:chevron-right') },
|
||||||
|
{ name: 'lucide:arrow-up', component: createIconifyIcon('lucide:arrow-up') },
|
||||||
|
{ name: 'lucide:arrow-down', component: createIconifyIcon('lucide:arrow-down') },
|
||||||
|
{ name: 'lucide:arrow-left', component: createIconifyIcon('lucide:arrow-left') },
|
||||||
|
{ name: 'lucide:arrow-right', component: createIconifyIcon('lucide:arrow-right') },
|
||||||
|
{ name: 'lucide:external-link', component: createIconifyIcon('lucide:external-link') },
|
||||||
|
{ name: 'lucide:link', component: createIconifyIcon('lucide:link') },
|
||||||
|
{ name: 'lucide:unlink', component: createIconifyIcon('lucide:unlink') },
|
||||||
|
{ name: 'lucide:copy', component: createIconifyIcon('lucide:copy') },
|
||||||
|
{ name: 'lucide:cut', component: createIconifyIcon('lucide:cut') },
|
||||||
|
{ name: 'lucide:paste', component: createIconifyIcon('lucide:paste') },
|
||||||
|
{ name: 'lucide:undo', component: createIconifyIcon('lucide:undo') },
|
||||||
|
{ name: 'lucide:redo', component: createIconifyIcon('lucide:redo') },
|
||||||
|
{ name: 'lucide:refresh-cw', component: createIconifyIcon('lucide:refresh-cw') },
|
||||||
|
{ name: 'lucide:rotate-cw', component: createIconifyIcon('lucide:rotate-cw') },
|
||||||
|
{ name: 'lucide:rotate-ccw', component: createIconifyIcon('lucide:rotate-ccw') },
|
||||||
|
{ name: 'lucide:zoom-in', component: createIconifyIcon('lucide:zoom-in') },
|
||||||
|
{ name: 'lucide:zoom-out', component: createIconifyIcon('lucide:zoom-out') },
|
||||||
|
{ name: 'lucide:maximize', component: createIconifyIcon('lucide:maximize') },
|
||||||
|
{ name: 'lucide:minimize', component: createIconifyIcon('lucide:minimize') },
|
||||||
|
{ name: 'lucide:monitor', component: createIconifyIcon('lucide:monitor') },
|
||||||
|
{ name: 'lucide:smartphone', component: createIconifyIcon('lucide:smartphone') },
|
||||||
|
{ name: 'lucide:tablet', component: createIconifyIcon('lucide:tablet') },
|
||||||
|
{ name: 'lucide:laptop', component: createIconifyIcon('lucide:laptop') },
|
||||||
|
{ name: 'lucide:desktop', component: createIconifyIcon('lucide:desktop') },
|
||||||
|
{ name: 'lucide:server', component: createIconifyIcon('lucide:server') },
|
||||||
|
{ name: 'lucide:database', component: createIconifyIcon('lucide:database') },
|
||||||
|
{ name: 'lucide:hard-drive', component: createIconifyIcon('lucide:hard-drive') },
|
||||||
|
{ name: 'lucide:wifi', component: createIconifyIcon('lucide:wifi') },
|
||||||
|
{ name: 'lucide:bluetooth', component: createIconifyIcon('lucide:bluetooth') },
|
||||||
|
{ name: 'lucide:usb', component: createIconifyIcon('lucide:usb') },
|
||||||
|
{ name: 'lucide:plug', component: createIconifyIcon('lucide:plug') },
|
||||||
|
{ name: 'lucide:battery', component: createIconifyIcon('lucide:battery') },
|
||||||
|
{ name: 'lucide:battery-charging', component: createIconifyIcon('lucide:battery-charging') },
|
||||||
|
{ name: 'lucide:power', component: createIconifyIcon('lucide:power') },
|
||||||
|
{ name: 'lucide:volume-2', component: createIconifyIcon('lucide:volume-2') },
|
||||||
|
{ name: 'lucide:volume-x', component: createIconifyIcon('lucide:volume-x') },
|
||||||
|
{ name: 'lucide:play', component: createIconifyIcon('lucide:play') },
|
||||||
|
{ name: 'lucide:pause', component: createIconifyIcon('lucide:pause') },
|
||||||
|
{ name: 'lucide:stop', component: createIconifyIcon('lucide:stop') },
|
||||||
|
{ name: 'lucide:skip-back', component: createIconifyIcon('lucide:skip-back') },
|
||||||
|
{ name: 'lucide:skip-forward', component: createIconifyIcon('lucide:skip-forward') },
|
||||||
|
{ name: 'lucide:repeat', component: createIconifyIcon('lucide:repeat') },
|
||||||
|
{ name: 'lucide:shuffle', component: createIconifyIcon('lucide:shuffle') },
|
||||||
|
{ name: 'lucide:mic', component: createIconifyIcon('lucide:mic') },
|
||||||
|
{ name: 'lucide:mic-off', component: createIconifyIcon('lucide:mic-off') },
|
||||||
|
{ name: 'lucide:camera', component: createIconifyIcon('lucide:camera') },
|
||||||
|
{ name: 'lucide:camera-off', component: createIconifyIcon('lucide:camera-off') },
|
||||||
|
{ name: 'lucide:video-off', component: createIconifyIcon('lucide:video-off') },
|
||||||
|
{ name: 'lucide:cast', component: createIconifyIcon('lucide:cast') },
|
||||||
|
{ name: 'lucide:airplay', component: createIconifyIcon('lucide:airplay') },
|
||||||
|
{ name: 'lucide:headphones', component: createIconifyIcon('lucide:headphones') },
|
||||||
|
{ name: 'lucide:speaker', component: createIconifyIcon('lucide:speaker') },
|
||||||
|
{ name: 'lucide:radio', component: createIconifyIcon('lucide:radio') },
|
||||||
|
{ name: 'lucide:tv', component: createIconifyIcon('lucide:tv') },
|
||||||
|
{ name: 'lucide:gamepad-2', component: createIconifyIcon('lucide:gamepad-2') },
|
||||||
|
{ name: 'lucide:joystick', component: createIconifyIcon('lucide:joystick') },
|
||||||
|
{ name: 'lucide:controller', component: createIconifyIcon('lucide:controller') },
|
||||||
|
{ name: 'lucide:mouse', component: createIconifyIcon('lucide:mouse') },
|
||||||
|
{ name: 'lucide:keyboard', component: createIconifyIcon('lucide:keyboard') },
|
||||||
|
{ name: 'lucide:printer', component: createIconifyIcon('lucide:printer') },
|
||||||
|
{ name: 'lucide:scanner', component: createIconifyIcon('lucide:scanner') },
|
||||||
|
{ name: 'lucide:fax', component: createIconifyIcon('lucide:fax') },
|
||||||
|
{ name: 'lucide:calculator', component: createIconifyIcon('lucide:calculator') },
|
||||||
|
{ name: 'lucide:watch', component: createIconifyIcon('lucide:watch') },
|
||||||
|
{ name: 'lucide:alarm-clock', component: createIconifyIcon('lucide:alarm-clock') },
|
||||||
|
{ name: 'lucide:timer', component: createIconifyIcon('lucide:timer') },
|
||||||
|
{ name: 'lucide:stopwatch', component: createIconifyIcon('lucide:stopwatch') },
|
||||||
|
{ name: 'lucide:hourglass', component: createIconifyIcon('lucide:hourglass') },
|
||||||
|
{ name: 'lucide:thermometer', component: createIconifyIcon('lucide:thermometer') },
|
||||||
|
{ name: 'lucide:gauge', component: createIconifyIcon('lucide:gauge') },
|
||||||
|
{ name: 'lucide:activity', component: createIconifyIcon('lucide:activity') },
|
||||||
|
{ name: 'lucide:trending-up', component: createIconifyIcon('lucide:trending-up') },
|
||||||
|
{ name: 'lucide:trending-down', component: createIconifyIcon('lucide:trending-down') },
|
||||||
|
{ name: 'lucide:bar-chart', component: createIconifyIcon('lucide:bar-chart') },
|
||||||
|
{ name: 'lucide:line-chart', component: createIconifyIcon('lucide:line-chart') },
|
||||||
|
{ name: 'lucide:pie-chart', component: createIconifyIcon('lucide:pie-chart') },
|
||||||
|
{ name: 'lucide:credit-card', component: createIconifyIcon('lucide:credit-card') },
|
||||||
|
{ name: 'lucide:wallet', component: createIconifyIcon('lucide:wallet') },
|
||||||
|
{ name: 'lucide:banknote', component: createIconifyIcon('lucide:banknote') },
|
||||||
|
{ name: 'lucide:coins', component: createIconifyIcon('lucide:coins') },
|
||||||
|
{ name: 'lucide:receipt', component: createIconifyIcon('lucide:receipt') },
|
||||||
|
{ name: 'lucide:shopping-cart', component: createIconifyIcon('lucide:shopping-cart') },
|
||||||
|
{ name: 'lucide:shopping-bag', component: createIconifyIcon('lucide:shopping-bag') },
|
||||||
|
{ name: 'lucide:store', component: createIconifyIcon('lucide:store') },
|
||||||
|
{ name: 'lucide:building', component: createIconifyIcon('lucide:building') },
|
||||||
|
{ name: 'lucide:building-2', component: createIconifyIcon('lucide:building-2') },
|
||||||
|
{ name: 'lucide:map', component: createIconifyIcon('lucide:map') },
|
||||||
|
{ name: 'lucide:map-pin', component: createIconifyIcon('lucide:map-pin') },
|
||||||
|
{ name: 'lucide:navigation', component: createIconifyIcon('lucide:navigation') },
|
||||||
|
{ name: 'lucide:compass', component: createIconifyIcon('lucide:compass') },
|
||||||
|
{ name: 'lucide:globe', component: createIconifyIcon('lucide:globe') },
|
||||||
|
{ name: 'lucide:earth', component: createIconifyIcon('lucide:earth') },
|
||||||
|
{ name: 'lucide:flag', component: createIconifyIcon('lucide:flag') },
|
||||||
|
{ name: 'lucide:bookmark', component: createIconifyIcon('lucide:bookmark') },
|
||||||
|
{ name: 'lucide:tag', component: createIconifyIcon('lucide:tag') },
|
||||||
|
{ name: 'lucide:tags', component: createIconifyIcon('lucide:tags') },
|
||||||
|
{ name: 'lucide:archive', component: createIconifyIcon('lucide:archive') },
|
||||||
|
{ name: 'lucide:inbox', component: createIconifyIcon('lucide:inbox') },
|
||||||
|
{ name: 'lucide:outbox', component: createIconifyIcon('lucide:outbox') },
|
||||||
|
{ name: 'lucide:send', component: createIconifyIcon('lucide:send') },
|
||||||
|
{ name: 'lucide:reply', component: createIconifyIcon('lucide:reply') },
|
||||||
|
{ name: 'lucide:forward', component: createIconifyIcon('lucide:forward') },
|
||||||
|
{ name: 'lucide:share', component: createIconifyIcon('lucide:share') },
|
||||||
|
{ name: 'lucide:share-2', component: createIconifyIcon('lucide:share-2') },
|
||||||
|
{ name: 'lucide:git-branch', component: createIconifyIcon('lucide:git-branch') },
|
||||||
|
{ name: 'lucide:git-commit', component: createIconifyIcon('lucide:git-commit') },
|
||||||
|
{ name: 'lucide:git-merge', component: createIconifyIcon('lucide:git-merge') },
|
||||||
|
{ name: 'lucide:git-pull-request', component: createIconifyIcon('lucide:git-pull-request') },
|
||||||
|
{ name: 'lucide:github', component: createIconifyIcon('lucide:github') },
|
||||||
|
{ name: 'lucide:gitlab', component: createIconifyIcon('lucide:gitlab') },
|
||||||
|
{ name: 'lucide:bitbucket', component: createIconifyIcon('lucide:bitbucket') },
|
||||||
|
{ name: 'lucide:code', component: createIconifyIcon('lucide:code') },
|
||||||
|
{ name: 'lucide:code-2', component: createIconifyIcon('lucide:code-2') },
|
||||||
|
{ name: 'lucide:terminal', component: createIconifyIcon('lucide:terminal') },
|
||||||
|
{ name: 'lucide:command', component: createIconifyIcon('lucide:command') },
|
||||||
|
{ name: 'lucide:hash', component: createIconifyIcon('lucide:hash') },
|
||||||
|
{ name: 'lucide:brackets', component: createIconifyIcon('lucide:brackets') },
|
||||||
|
{ name: 'lucide:braces', component: createIconifyIcon('lucide:braces') },
|
||||||
|
{ name: 'lucide:parentheses', component: createIconifyIcon('lucide:parentheses') },
|
||||||
|
{ name: 'lucide:slash', component: createIconifyIcon('lucide:slash') },
|
||||||
|
{ name: 'lucide:backslash', component: createIconifyIcon('lucide:backslash') },
|
||||||
|
{ name: 'lucide:at-sign', component: createIconifyIcon('lucide:at-sign') },
|
||||||
|
{ name: 'lucide:percent', component: createIconifyIcon('lucide:percent') },
|
||||||
|
{ name: 'lucide:asterisk', component: createIconifyIcon('lucide:asterisk') },
|
||||||
|
{ name: 'lucide:ampersand', component: createIconifyIcon('lucide:ampersand') },
|
||||||
|
{ name: 'lucide:equal', component: createIconifyIcon('lucide:equal') },
|
||||||
|
{ name: 'lucide:not-equal', component: createIconifyIcon('lucide:not-equal') },
|
||||||
|
{ name: 'lucide:greater-than', component: createIconifyIcon('lucide:greater-than') },
|
||||||
|
{ name: 'lucide:less-than', component: createIconifyIcon('lucide:less-than') },
|
||||||
|
{ name: 'lucide:greater-than-equal', component: createIconifyIcon('lucide:greater-than-equal') },
|
||||||
|
{ name: 'lucide:less-than-equal', component: createIconifyIcon('lucide:less-than-equal') },
|
||||||
|
{ name: 'lucide:minus', component: createIconifyIcon('lucide:minus') },
|
||||||
|
{ name: 'lucide:divide', component: createIconifyIcon('lucide:divide') },
|
||||||
|
{ name: 'lucide:multiply', component: createIconifyIcon('lucide:multiply') },
|
||||||
|
{ name: 'lucide:infinity', component: createIconifyIcon('lucide:infinity') },
|
||||||
|
{ name: 'lucide:pi', component: createIconifyIcon('lucide:pi') },
|
||||||
|
{ name: 'lucide:sigma', component: createIconifyIcon('lucide:sigma') },
|
||||||
|
{ name: 'lucide:alpha', component: createIconifyIcon('lucide:alpha') },
|
||||||
|
{ name: 'lucide:beta', component: createIconifyIcon('lucide:beta') },
|
||||||
|
{ name: 'lucide:gamma', component: createIconifyIcon('lucide:gamma') },
|
||||||
|
{ name: 'lucide:delta', component: createIconifyIcon('lucide:delta') },
|
||||||
|
{ name: 'lucide:epsilon', component: createIconifyIcon('lucide:epsilon') },
|
||||||
|
{ name: 'lucide:zeta', component: createIconifyIcon('lucide:zeta') },
|
||||||
|
{ name: 'lucide:eta', component: createIconifyIcon('lucide:eta') },
|
||||||
|
{ name: 'lucide:theta', component: createIconifyIcon('lucide:theta') },
|
||||||
|
{ name: 'lucide:iota', component: createIconifyIcon('lucide:iota') },
|
||||||
|
{ name: 'lucide:kappa', component: createIconifyIcon('lucide:kappa') },
|
||||||
|
{ name: 'lucide:lambda', component: createIconifyIcon('lucide:lambda') },
|
||||||
|
{ name: 'lucide:mu', component: createIconifyIcon('lucide:mu') },
|
||||||
|
{ name: 'lucide:nu', component: createIconifyIcon('lucide:nu') },
|
||||||
|
{ name: 'lucide:xi', component: createIconifyIcon('lucide:xi') },
|
||||||
|
{ name: 'lucide:omicron', component: createIconifyIcon('lucide:omicron') },
|
||||||
|
{ name: 'lucide:rho', component: createIconifyIcon('lucide:rho') },
|
||||||
|
{ name: 'lucide:tau', component: createIconifyIcon('lucide:tau') },
|
||||||
|
{ name: 'lucide:upsilon', component: createIconifyIcon('lucide:upsilon') },
|
||||||
|
{ name: 'lucide:phi', component: createIconifyIcon('lucide:phi') },
|
||||||
|
{ name: 'lucide:chi', component: createIconifyIcon('lucide:chi') },
|
||||||
|
{ name: 'lucide:psi', component: createIconifyIcon('lucide:psi') },
|
||||||
|
{ name: 'lucide:omega', component: createIconifyIcon('lucide:omega') },
|
||||||
|
]
|
||||||
|
|
||||||
|
// 过滤后的图标
|
||||||
|
const filteredIcons = computed(() => {
|
||||||
|
let icons = iconList
|
||||||
|
|
||||||
|
if (searchKeyword.value) {
|
||||||
|
icons = icons.filter(icon =>
|
||||||
|
icon.name.toLowerCase().includes(searchKeyword.value.toLowerCase())
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const start = (currentPage.value - 1) * pageSize
|
||||||
|
const end = start + pageSize
|
||||||
|
|
||||||
|
return icons.slice(start, end)
|
||||||
|
})
|
||||||
|
|
||||||
|
// 总页数
|
||||||
|
const totalPages = computed(() => {
|
||||||
|
let total = iconList.length
|
||||||
|
|
||||||
|
if (searchKeyword.value) {
|
||||||
|
total = iconList.filter(icon =>
|
||||||
|
icon.name.toLowerCase().includes(searchKeyword.value.toLowerCase())
|
||||||
|
).length
|
||||||
|
}
|
||||||
|
|
||||||
|
return Math.ceil(total / pageSize)
|
||||||
|
})
|
||||||
|
|
||||||
|
// 可见页码
|
||||||
|
const visiblePages = computed(() => {
|
||||||
|
const pages = []
|
||||||
|
const total = totalPages.value
|
||||||
|
const current = currentPage.value
|
||||||
|
|
||||||
|
if (total <= 7) {
|
||||||
|
for (let i = 1; i <= total; i++) {
|
||||||
|
pages.push(i)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (current <= 4) {
|
||||||
|
for (let i = 1; i <= 5; i++) {
|
||||||
|
pages.push(i)
|
||||||
|
}
|
||||||
|
} else if (current >= total - 3) {
|
||||||
|
for (let i = total - 4; i <= total; i++) {
|
||||||
|
pages.push(i)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (let i = current - 2; i <= current + 2; i++) {
|
||||||
|
pages.push(i)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return pages
|
||||||
|
})
|
||||||
|
|
||||||
|
// 是否显示省略号
|
||||||
|
const showEllipsis = computed(() => {
|
||||||
|
return totalPages.value > 7 && currentPage.value > 4 && currentPage.value < totalPages.value - 3
|
||||||
|
})
|
||||||
|
|
||||||
|
// 选择图标
|
||||||
|
const selectIcon = (iconName: string) => {
|
||||||
|
selectedIcon.value = iconName
|
||||||
|
emit('update:modelValue', iconName)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 搜索处理
|
||||||
|
const handleSearch = () => {
|
||||||
|
currentPage.value = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
// 跳转页面
|
||||||
|
const goToPage = (page: number) => {
|
||||||
|
if (page >= 1 && page <= totalPages.value) {
|
||||||
|
currentPage.value = page
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 监听props变化
|
||||||
|
watch(() => props.modelValue, (newVal) => {
|
||||||
|
selectedIcon.value = newVal || ''
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.icon-selector {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(6, 1fr);
|
||||||
|
gap: 4px;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover {
|
||||||
|
transform: scale(1.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
button:active {
|
||||||
|
transform: scale(0.95);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+319
@@ -0,0 +1,319 @@
|
|||||||
|
<template>
|
||||||
|
<Modal
|
||||||
|
v-model:open="visible"
|
||||||
|
:title="isEdit ? '编辑菜单' : '添加菜单'"
|
||||||
|
:confirm-loading="loading"
|
||||||
|
width="600px"
|
||||||
|
@ok="handleSubmit"
|
||||||
|
@cancel="close"
|
||||||
|
>
|
||||||
|
<Form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:label-col="{ span: 6 }"
|
||||||
|
:wrapper-col="{ span: 18 }"
|
||||||
|
>
|
||||||
|
<Form.Item label="菜单类型" name="type" :rules="[{ required: true, message: '请选择菜单类型' }]">
|
||||||
|
<Radio.Group v-model:value="formData.type" button-style="solid">
|
||||||
|
<Radio.Button value="catalog">目录</Radio.Button>
|
||||||
|
<Radio.Button value="menu">菜单</Radio.Button>
|
||||||
|
<Radio.Button value="button">按钮</Radio.Button>
|
||||||
|
<Radio.Button value="embedded">内联</Radio.Button>
|
||||||
|
<Radio.Button value="link">外链</Radio.Button>
|
||||||
|
</Radio.Group>
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item label="父菜单" name="parentId">
|
||||||
|
<Select
|
||||||
|
v-model:value="formData.parentId"
|
||||||
|
placeholder="请选择父菜单"
|
||||||
|
:options="parentMenuOptions"
|
||||||
|
allow-clear
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item label="菜单名称" name="name" :rules="[{ required: true, message: '请输入菜单名称' }]">
|
||||||
|
<Input v-model:value="formData.name" placeholder="请输入菜单名称" />
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item label="菜单标题" name="title">
|
||||||
|
<Input v-model:value="formData.title" placeholder="请输入菜单标题" />
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item label="路由路径" name="path">
|
||||||
|
<Input v-model:value="formData.path" placeholder="请输入路由路径" />
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item label="页面组件" name="component">
|
||||||
|
<Input v-model:value="formData.component" placeholder="请输入页面组件" />
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item label="重定向地址" name="redirect">
|
||||||
|
<Input v-model:value="formData.redirect" placeholder="请输入重定向地址" />
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item label="路由图标" name="icon">
|
||||||
|
<Popover
|
||||||
|
placement="bottomRight"
|
||||||
|
trigger="click"
|
||||||
|
:content="iconSelectorContent"
|
||||||
|
overlay-class-name="icon-selector-popover"
|
||||||
|
>
|
||||||
|
<Input
|
||||||
|
v-model:value="formData.icon"
|
||||||
|
placeholder="请输入路由图标"
|
||||||
|
readonly
|
||||||
|
style="cursor: pointer;"
|
||||||
|
>
|
||||||
|
<template #suffix>
|
||||||
|
<GridIcon
|
||||||
|
class="w-4 h-4 cursor-pointer"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</Input>
|
||||||
|
</Popover>
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item label="排序" name="order">
|
||||||
|
<InputNumber v-model:value="formData.order" placeholder="请输入排序" :min="0" />
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item label="是否显示" name="visible">
|
||||||
|
<Select
|
||||||
|
v-model:value="formData.visible"
|
||||||
|
placeholder="请选择是否显示"
|
||||||
|
:options="visibleOptions"
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item label="状态" name="status">
|
||||||
|
<Select
|
||||||
|
v-model:value="formData.status"
|
||||||
|
placeholder="请选择状态"
|
||||||
|
:options="statusOptions"
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item label="是否缓存" name="keepAlive">
|
||||||
|
<Select
|
||||||
|
v-model:value="formData.keepAlive"
|
||||||
|
placeholder="请选择是否缓存"
|
||||||
|
:options="keepAliveOptions"
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
</Form>
|
||||||
|
</Modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, watch, h } from 'vue'
|
||||||
|
import { Modal, Form, Input, InputNumber, Select, Popover, message, Radio } from 'ant-design-vue'
|
||||||
|
import { createIconifyIcon } from '@vben/icons'
|
||||||
|
import IconSelector from './IconSelector.vue'
|
||||||
|
import {
|
||||||
|
createMenuApi,
|
||||||
|
updateMenuApi,
|
||||||
|
getAllMenusApi,
|
||||||
|
type MenuApi as MenuApiType
|
||||||
|
} from '#/api/core/menu'
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
visible?: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
success: [];
|
||||||
|
cancel: [];
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 响应式数据
|
||||||
|
const visible = ref(false);
|
||||||
|
const loading = ref(false);
|
||||||
|
const isEdit = ref(false);
|
||||||
|
const currentRecord = ref<MenuApiType.MenuInfo | null>(null);
|
||||||
|
const formRef = ref();
|
||||||
|
|
||||||
|
// 表单数据
|
||||||
|
const formData = ref<MenuApiType.CreateMenuParams>({
|
||||||
|
parentId: 0,
|
||||||
|
name: '',
|
||||||
|
title: '',
|
||||||
|
path: '',
|
||||||
|
component: '',
|
||||||
|
redirect: '',
|
||||||
|
icon: '',
|
||||||
|
order: 0,
|
||||||
|
type: 'menu',
|
||||||
|
visible: 1,
|
||||||
|
status: 1,
|
||||||
|
keepAlive: 0,
|
||||||
|
})
|
||||||
|
|
||||||
|
// 模态框标题(已移到模板中)
|
||||||
|
|
||||||
|
// 状态选项
|
||||||
|
const statusOptions = [
|
||||||
|
{ label: '禁用', value: 0 },
|
||||||
|
{ label: '启用', value: 1 },
|
||||||
|
]
|
||||||
|
|
||||||
|
// 可见性选项
|
||||||
|
const visibleOptions = [
|
||||||
|
{ label: '隐藏', value: 0 },
|
||||||
|
{ label: '显示', value: 1 },
|
||||||
|
]
|
||||||
|
|
||||||
|
// 缓存选项
|
||||||
|
const keepAliveOptions = [
|
||||||
|
{ label: '不缓存', value: 0 },
|
||||||
|
{ label: '缓存', value: 1 },
|
||||||
|
]
|
||||||
|
|
||||||
|
// 下拉选项数据
|
||||||
|
const parentMenuOptions = ref<{ label: string; value: number }[]>([]);
|
||||||
|
|
||||||
|
// 创建图标组件
|
||||||
|
const GridIcon = createIconifyIcon('lucide:grid-3x3');
|
||||||
|
|
||||||
|
// 图标选择器内容
|
||||||
|
const iconSelectorContent = h(IconSelector, {
|
||||||
|
modelValue: formData.value.icon,
|
||||||
|
'onUpdate:modelValue': (value: string) => {
|
||||||
|
formData.value.icon = value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 获取父菜单选项
|
||||||
|
async function fetchParentMenuOptions() {
|
||||||
|
try {
|
||||||
|
const data = await getAllMenusApi();
|
||||||
|
const options: Array<{ label: string; value: number }> = [{ label: '根菜单', value: 0 }];
|
||||||
|
|
||||||
|
const addMenuOptions = (menus: MenuApiType.MenuInfo[], level = 0) => {
|
||||||
|
menus.forEach(menu => {
|
||||||
|
const prefix = ' '.repeat(level);
|
||||||
|
options.push({
|
||||||
|
label: `${prefix}${menu.title || menu.name}`,
|
||||||
|
value: menu.id,
|
||||||
|
});
|
||||||
|
if (menu.children && menu.children.length > 0) {
|
||||||
|
addMenuOptions(menu.children, level + 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
addMenuOptions(data);
|
||||||
|
parentMenuOptions.value = options;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取菜单列表失败:', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开模态框
|
||||||
|
function open(edit: boolean, record?: MenuApiType.MenuInfo) {
|
||||||
|
isEdit.value = edit;
|
||||||
|
currentRecord.value = record || null;
|
||||||
|
visible.value = true;
|
||||||
|
|
||||||
|
if (edit && record) {
|
||||||
|
// 编辑模式,填充表单数据
|
||||||
|
formData.value = {
|
||||||
|
parentId: record.parentId || 0,
|
||||||
|
name: record.name,
|
||||||
|
title: record.title || '',
|
||||||
|
path: record.path || '',
|
||||||
|
component: record.component || '',
|
||||||
|
redirect: record.redirect || '',
|
||||||
|
icon: record.icon || '',
|
||||||
|
order: record.order || 0,
|
||||||
|
type: record.type,
|
||||||
|
visible: record.visible || 1,
|
||||||
|
status: record.status || 1,
|
||||||
|
keepAlive: record.keepAlive || 0,
|
||||||
|
};
|
||||||
|
} else if (!edit && record) {
|
||||||
|
// 添加下级菜单模式,自动选中父菜单
|
||||||
|
formData.value = {
|
||||||
|
parentId: record.id, // 自动设置为当前菜单的ID作为父菜单
|
||||||
|
name: '',
|
||||||
|
title: '',
|
||||||
|
path: '',
|
||||||
|
component: '',
|
||||||
|
redirect: '',
|
||||||
|
icon: '',
|
||||||
|
order: 0,
|
||||||
|
type: 'menu',
|
||||||
|
visible: 1,
|
||||||
|
status: 1,
|
||||||
|
keepAlive: 0,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
// 新增根菜单模式,重置表单
|
||||||
|
formData.value = {
|
||||||
|
parentId: 0,
|
||||||
|
name: '',
|
||||||
|
title: '',
|
||||||
|
path: '',
|
||||||
|
component: '',
|
||||||
|
redirect: '',
|
||||||
|
icon: '',
|
||||||
|
order: 0,
|
||||||
|
type: 'menu',
|
||||||
|
visible: 1,
|
||||||
|
status: 1,
|
||||||
|
keepAlive: 0,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭模态框
|
||||||
|
function close() {
|
||||||
|
visible.value = false;
|
||||||
|
formRef.value?.resetFields();
|
||||||
|
emit('cancel');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
async function handleSubmit() {
|
||||||
|
try {
|
||||||
|
await formRef.value?.validate();
|
||||||
|
loading.value = true;
|
||||||
|
|
||||||
|
if (isEdit.value && currentRecord.value) {
|
||||||
|
// 更新菜单
|
||||||
|
await updateMenuApi(currentRecord.value.id, formData.value);
|
||||||
|
message.success('更新菜单成功');
|
||||||
|
} else {
|
||||||
|
// 创建菜单
|
||||||
|
await createMenuApi(formData.value);
|
||||||
|
message.success('创建菜单成功');
|
||||||
|
}
|
||||||
|
|
||||||
|
close();
|
||||||
|
emit('success');
|
||||||
|
} catch (error) {
|
||||||
|
console.error('提交菜单失败:', error);
|
||||||
|
message.error('提交菜单失败');
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 监听visible变化
|
||||||
|
watch(visible, (newVal) => {
|
||||||
|
if (newVal) {
|
||||||
|
fetchParentMenuOptions();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 暴露方法
|
||||||
|
defineExpose({
|
||||||
|
open,
|
||||||
|
close,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
/* 自定义样式 */
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,334 @@
|
|||||||
|
<div data-radix-popper-content-wrapper=""
|
||||||
|
style="position: fixed; left: 0px; top: 0px; transform: translate(2066px, 310px); min-width: max-content; --radix-popper-transform-origin: 100% 0px; z-index: 2000; --radix-popper-available-width: 2737px; --radix-popper-available-height: 974px; --radix-popper-anchor-width: 253.5px; --radix-popper-anchor-height: 32px;">
|
||||||
|
<div trapfocus="false" disableoutsidepointerevents="false" id="radix-vue-popover-content-v-132" data-state="open"
|
||||||
|
role="dialog" data-dismissable-layer="" tabindex="-1"
|
||||||
|
class="bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 border-border rounded-md border shadow-md outline-none p-0 pt-3 w-full side-content z-popup"
|
||||||
|
data-side="bottom" data-align="end"
|
||||||
|
style="--radix-popover-content-transform-origin: var(--radix-popper-transform-origin); --radix-popover-content-available-width: var(--radix-popper-available-width); --radix-popover-content-available-height: var(--radix-popper-available-height); --radix-popover-trigger-width: var(--radix-popper-anchor-width); --radix-popover-trigger-height: var(--radix-popper-anchor-height);">
|
||||||
|
<div class="mb-2 flex w-full"><input type="text" class="ant-input css-oddqdp mx-2" placeholder="搜索图标..." value="">
|
||||||
|
</div>
|
||||||
|
<div class="grid max-h-[360px] w-full grid-cols-6 justify-items-center"><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor" d="M17 15V8h-2v7H8v2h7v7h2v-7h7v-2z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M16 4c6.6 0 12 5.4 12 12s-5.4 12-12 12S4 22.6 4 16S9.4 4 16 4m0-2C8.3 2 2 8.3 2 16s6.3 14 14 14s14-6.3 14-14S23.7 2 16 2">
|
||||||
|
</path>
|
||||||
|
<path fill="currentColor" d="M24 15h-7V8h-2v7H8v2h7v7h2v-7h7z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M17.74 30L16 29l4-7h6a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h9v2H6a4 4 0 0 1-4-4V8a4 4 0 0 1 4-4h20a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4h-4.84Z">
|
||||||
|
</path>
|
||||||
|
<path fill="currentColor" d="M17 9h-2v4h-4v2h4v4h2v-4h4v-2h-4z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M16 2A14.173 14.173 0 0 0 2 16a14.173 14.173 0 0 0 14 14a14.173 14.173 0 0 0 14-14A14.173 14.173 0 0 0 16 2m8 15h-7v7h-2v-7H8v-2h7V8h2v7h7Z">
|
||||||
|
</path>
|
||||||
|
<path fill="none" d="M24 17h-7v7h-2v-7H8v-2h7V8h2v7h7z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor" d="M17 15V5h-2v10H5v2h10v10h2V17h10v-2z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M26 30H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h20a2 2 0 0 1 2 2v24a2 2 0 0 1-2 2M6 4v24h20V4Z"></path>
|
||||||
|
<path fill="currentColor" d="M22 20H10v-2h12zm-2 5h-8v-2h8z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M26 30H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h20a2 2 0 0 1 2 2v24a2 2 0 0 1-2 2M6 4v24h20V4Z"></path>
|
||||||
|
<path fill="currentColor" d="M9 18h11v2H9zm0 5h7v2H9z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M26 30H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h20a2 2 0 0 1 2 2v24a2 2 0 0 1-2 2M6 4v24h20V4Z"></path>
|
||||||
|
<path fill="currentColor" d="M23 20H12v-2h11zm0 5h-7v-2h7z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M26 30H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h20a2 2 0 0 1 2 2v24a2 2 0 0 1-2 2M6 4v24h20V4Z"></path>
|
||||||
|
<path fill="currentColor" d="M22 15H10v-2h12zm-2 5h-8v-2h8z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M26 30H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h20a2 2 0 0 1 2 2v24a2 2 0 0 1-2 2M6 4v24h20V4Z"></path>
|
||||||
|
<path fill="currentColor" d="M9 13h11v2H9zm0 5h7v2H9z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M26 30H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h20a2 2 0 0 1 2 2v24a2 2 0 0 1-2 2M6 4v24h20V4Z"></path>
|
||||||
|
<path fill="currentColor" d="M23 15H12v-2h11zm0 5h-7v-2h7z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M26 30H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h20a2 2 0 0 1 2 2v24a2 2 0 0 1-2 2M6 4v24h20V4Z"></path>
|
||||||
|
<path fill="currentColor" d="M22 9H10V7h12zm-2 5h-8v-2h8z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M26 30H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h20a2 2 0 0 1 2 2v24a2 2 0 0 1-2 2M6 4v24h20V4Z"></path>
|
||||||
|
<path fill="currentColor" d="M9 7h11v2H9zm0 5h7v2H9z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M26 30H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h20a2 2 0 0 1 2 2v24a2 2 0 0 1-2 2M6 4v24h20V4Z"></path>
|
||||||
|
<path fill="currentColor" d="M23 9H12V7h11zm0 5h-7v-2h7z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M24 18h-7v-4h3a2.003 2.003 0 0 0 2-2V8a2.003 2.003 0 0 0-2-2h-3V2h-2v4h-3a2.003 2.003 0 0 0-2 2v4a2.003 2.003 0 0 0 2 2h3v4H8a2.003 2.003 0 0 0-2 2v4a2.003 2.003 0 0 0 2 2h7v4h2v-4h7a2.003 2.003 0 0 0 2-2v-4a2.003 2.003 0 0 0-2-2M12 8h8v4h-8Zm12 16H8v-4h16Z">
|
||||||
|
</path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M26 26H11a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h15a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2m0-6.001L11 20v4h15zM18 14h-7a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2m0-6.001L11 8v4h7zM4 2h2v28H4z">
|
||||||
|
</path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M4 24v-4a2 2 0 0 1 2-2h15a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2m2 0h15v-4l-15-.001zm6-12V8a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2m2 0h7V8l-7-.001zm14 18h-2V2h2z">
|
||||||
|
</path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M2 26h28v2H2zm22-3h-4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2m-4-9v7h4.001L24 14zm-8 9H8a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v15a2 2 0 0 1-2 2M8 6v15h4.001L12 6z">
|
||||||
|
</path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M30 15h-4v-3a2.003 2.003 0 0 0-2-2h-4a2.003 2.003 0 0 0-2 2v3h-4V8a2.003 2.003 0 0 0-2-2H8a2.003 2.003 0 0 0-2 2v7H2v2h4v7a2.003 2.003 0 0 0 2 2h4a2.003 2.003 0 0 0 2-2v-7h4v3a2.003 2.003 0 0 0 2 2h4a2.003 2.003 0 0 0 2-2v-3h4ZM8 24V8h4l.001 16Zm12-4v-8h4l.001 8Z">
|
||||||
|
</path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M24 20h-4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2m-4-9v7h4.001L24 11zm-8 17H8a2 2 0 0 1-2-2V11a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v15a2 2 0 0 1-2 2M8 11v15h4.001L12 11zM2 4h28v2H2z">
|
||||||
|
</path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M8 4v4H4V4Zm2-2H2v8h8Zm8 2v4h-4V4Zm2-2h-8v8h8Zm8 2v4h-4V4Zm2-2h-8v8h8ZM8 14v4H4v-4Zm2-2H2v8h8Zm8 2v4h-4v-4Zm2-2h-8v8h8Zm8 2v4h-4v-4Zm2-2h-8v8h8ZM8 24v4H4v-4Zm2-2H2v8h8Zm8 2v4h-4v-4Zm2-2h-8v8h8Zm8 2v4h-4v-4Zm2-2h-8v8h8Z">
|
||||||
|
</path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M27 22.142V9.858A3.992 3.992 0 1 0 22.142 5H9.858A3.992 3.992 0 1 0 5 9.858v12.284A3.992 3.992 0 1 0 9.858 27h12.284A3.992 3.992 0 1 0 27 22.142M26 4a2 2 0 1 1-2 2a2 2 0 0 1 2-2M4 6a2 2 0 1 1 2 2a2 2 0 0 1-2-2m2 22a2 2 0 1 1 2-2a2 2 0 0 1-2 2m16.142-3H9.858A4 4 0 0 0 7 22.142V9.858A4 4 0 0 0 9.858 7h12.284A4 4 0 0 0 25 9.858v12.284A3.99 3.99 0 0 0 22.142 25M26 28a2 2 0 1 1 2-2a2.003 2.003 0 0 1-2 2">
|
||||||
|
</path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M30 6a3.992 3.992 0 0 0-7.977-.224L9.586 8.263A3.99 3.99 0 1 0 5 13.858v8.284A3.992 3.992 0 1 0 9.858 27h8.284a3.991 3.991 0 1 0 5.595-4.586l2.487-12.437A3.995 3.995 0 0 0 30 6m-4-2a2 2 0 1 1-2 2a2 2 0 0 1 2-2M4 10a2 2 0 1 1 2 2a2 2 0 0 1-2-2m2 18a2 2 0 1 1 2-2a2 2 0 0 1-2 2m12.142-3H9.858A4 4 0 0 0 7 22.142v-8.284a3.99 3.99 0 0 0 2.977-3.634l12.437-2.487a4 4 0 0 0 1.849 1.85l-2.487 12.436A3.99 3.99 0 0 0 18.142 25M22 28a2 2 0 1 1 2-2a2 2 0 0 1-2 2">
|
||||||
|
</path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor" d="M24 9h-2l-6 8.571L10 9H8l7 10l-7 10h2l6-8.571L22 29h2l-7-10zM8 3h16v2H8z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M24 9h-2l-6 8.571L10 9H8l7 10l-7 10h2l6-8.571L22 29h2l-7-10zm-4-2c-1.777 0-3.231-.873-4.514-1.642C14.322 4.659 13.223 4 12 4c-1.398 0-2.449.863-3.293 1.707L7.293 4.293C8.36 3.225 9.86 2 12 2c1.777 0 3.231.872 4.514 1.642C17.678 4.34 18.777 5 20 5c1.398 0 2.449-.863 3.293-1.707l1.414 1.414C23.64 5.774 22.14 7 20 7">
|
||||||
|
</path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor" d="M30 29H2v-2h28zm-3-10H5v2h22zm-3-8H8v2h16zm-3-8H11v2h10z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M2 3h28v2H2zm11 18H5c-1.103 0-2-.897-2-2v-6c0-1.103.897-2 2-2h8c1.103 0 2 .897 2 2v6c0 1.103-.897 2-2 2m-8-8v6h8v-6zm22 8h-8c-1.103 0-2-.897-2-2v-6c0-1.103.897-2 2-2h8c1.103 0 2 .897 2 2v6c0 1.103-.897 2-2 2m-8-8v6h8v-6zM2 27h28v2H2z">
|
||||||
|
</path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M27 2h2v28h-2zm-7 13h-8c-1.103 0-2-.897-2-2V7c0-1.103.897-2 2-2h8c1.103 0 2 .897 2 2v6c0 1.103-.897 2-2 2m-8-8v6h8V7zm0 10h8c1.103 0 2 .897 2 2v6c0 1.103-.897 2-2 2h-8c-1.103 0-2-.897-2-2v-6c0-1.103.897-2 2-2m8 8v-6h-8v6zM3 2h2v28H3z">
|
||||||
|
</path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor" d="M24.59 16.59L17 24.17V4h-2v20.17l-7.59-7.58L6 18l10 10l10-10z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor" d="M22 26v-2H9.41L26 7.41L24.59 6L8 22.59V10H6v16z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor" d="M10 26v-2h12.59L6 7.41L7.41 6L24 22.59V10h2v16z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor" d="m14 26l1.41-1.41L7.83 17H28v-2H7.83l7.58-7.59L14 6L4 16z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor" d="m18 6l-1.43 1.393L24.15 15H4v2h20.15l-7.58 7.573L18 26l10-10z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M23 6v10h5a1 1 0 0 1 .707 1.707l-12 12a1 1 0 0 1-1.414 0l-12-12A1 1 0 0 1 4 16h5V6a2 2 0 0 1 2-2h10a2.003 2.003 0 0 1 2 2m-7 21.586L25.586 18H21V6H11v12H6.414Z">
|
||||||
|
</path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor" d="M16 4L6 14l1.41 1.41L15 7.83V28h2V7.83l7.59 7.58L26 14z"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 h-8 w-8 px-1 text-lg hover:bg-accent hover:text-accent-foreground text-foreground/80 rounded-full"
|
||||||
|
data-state="closed" data-grace-area-trigger="" tabindex="-1"><!----><svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em"
|
||||||
|
viewBox="0 0 32 32" class="iconify iconify--carbon">
|
||||||
|
<path fill="currentColor" d="M22 6v2H9.41L26 24.59L24.59 26L8 9.41V22H6V6z"></path>
|
||||||
|
</svg></button></div>
|
||||||
|
<div class="flex-center flex justify-end overflow-hidden border-t py-2 pr-3">
|
||||||
|
<nav size="small">
|
||||||
|
<div class="flex w-full items-center gap-1"><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground p-0 size-5"
|
||||||
|
aria-label="First Page" type="button" disabled=""><svg xmlns="http://www.w3.org/2000/svg" width="24"
|
||||||
|
height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||||||
|
stroke-linejoin="round" class="lucide lucide-chevrons-left-icon lucide-chevrons-left size-4">
|
||||||
|
<path d="m11 17-5-5 5-5"></path>
|
||||||
|
<path d="m18 17-5-5 5-5"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground p-0 size-5"
|
||||||
|
aria-label="Previous Page" type="button" disabled=""><svg xmlns="http://www.w3.org/2000/svg" width="24"
|
||||||
|
height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||||||
|
stroke-linejoin="round" class="lucide lucide-chevron-left-icon lucide-chevron-left size-4">
|
||||||
|
<path d="m15 18-6-6 6-6"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 bg-primary text-primary-foreground shadow hover:bg-primary/90 size-5 p-0 text-sm"
|
||||||
|
data-type="page" aria-label="Page 1" aria-current="page" data-selected="true" type="button"
|
||||||
|
value="1">1</button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground size-5 p-0 text-sm"
|
||||||
|
data-type="page" aria-label="Page 2" type="button" value="2">2</button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground size-5 p-0 text-sm"
|
||||||
|
data-type="page" aria-label="Page 3" type="button" value="3">3</button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground size-5 p-0 text-sm"
|
||||||
|
data-type="page" aria-label="Page 4" type="button" value="4">4</button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground size-5 p-0 text-sm"
|
||||||
|
data-type="page" aria-label="Page 5" type="button" value="5">5</button>
|
||||||
|
<div data-type="ellipsis" class="flex items-center justify-center size-5" index="5"><svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||||
|
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
||||||
|
class="lucide lucide-ellipsis-icon lucide-ellipsis size-4">
|
||||||
|
<circle cx="12" cy="12" r="1"></circle>
|
||||||
|
<circle cx="19" cy="12" r="1"></circle>
|
||||||
|
<circle cx="5" cy="12" r="1"></circle>
|
||||||
|
</svg></div><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground size-5 p-0 text-sm"
|
||||||
|
data-type="page" aria-label="Page 66" type="button" value="66">66</button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground p-0 size-5"
|
||||||
|
aria-label="Next Page" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
|
||||||
|
viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||||||
|
stroke-linejoin="round" class="lucide lucide-chevron-right-icon lucide-chevron-right size-4">
|
||||||
|
<path d="m9 18 6-6-6-6"></path>
|
||||||
|
</svg></button><button
|
||||||
|
class="inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground p-0 size-5"
|
||||||
|
aria-label="Last Page" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
|
||||||
|
viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||||||
|
stroke-linejoin="round" class="lucide lucide-chevrons-right-icon lucide-chevrons-right size-4">
|
||||||
|
<path d="m6 17 5-5-5-5"></path>
|
||||||
|
<path d="m13 17 5-5-5-5"></path>
|
||||||
|
</svg></button>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -1,243 +1,166 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, h, ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { Page } from '@vben/common-ui';
|
import { Page } from '@vben/common-ui';
|
||||||
import { Button, Form, Input, InputNumber, Modal, Select, Table, message } from 'ant-design-vue';
|
import { Button, message, Space, Tag } from 'ant-design-vue';
|
||||||
|
import { createIconifyIcon } from '@vben/icons';
|
||||||
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
createMenuApi,
|
|
||||||
deleteMenuApi,
|
deleteMenuApi,
|
||||||
getAllMenusApi,
|
getAllMenusApi,
|
||||||
getMenuDetailApi,
|
|
||||||
updateMenuApi,
|
|
||||||
type MenuApi as MenuApiType
|
type MenuApi as MenuApiType
|
||||||
} from '#/api/core/menu';
|
} from '#/api/core/menu';
|
||||||
|
|
||||||
|
import MenuFormModal from './components/MenuFormModal.vue';
|
||||||
|
|
||||||
|
// 创建图标组件
|
||||||
|
const PlusIcon = createIconifyIcon('lucide:plus');
|
||||||
|
const EditIcon = createIconifyIcon('lucide:edit');
|
||||||
|
const TrashIcon = createIconifyIcon('lucide:trash-2');
|
||||||
|
const FolderIcon = createIconifyIcon('lucide:folder');
|
||||||
|
const FileIcon = createIconifyIcon('lucide:file');
|
||||||
|
const PlusCircleIcon = createIconifyIcon('lucide:plus-circle');
|
||||||
|
|
||||||
defineOptions({ name: 'MenuManagement' });
|
defineOptions({ name: 'MenuManagement' });
|
||||||
|
|
||||||
// 响应式数据
|
// 响应式数据
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const menuList = ref<MenuApiType.MenuInfo[]>([]);
|
const menuFormModalRef = ref();
|
||||||
const modalVisible = ref(false);
|
|
||||||
const modalTitle = ref('');
|
|
||||||
const isEdit = ref(false);
|
|
||||||
const currentMenuId = ref<number | null>(null);
|
|
||||||
const formRef = ref();
|
|
||||||
|
|
||||||
// 表单数据
|
// VbenVxeGrid 表格配置
|
||||||
const formData = ref<MenuApiType.CreateMenuParams>({
|
const gridOptions: VxeGridProps<any> = {
|
||||||
parentId: 0,
|
columns: [
|
||||||
name: '',
|
{
|
||||||
title: '',
|
type: 'seq' as const,
|
||||||
path: '',
|
minWidth: 60,
|
||||||
component: '',
|
title: '序号',
|
||||||
redirect: '',
|
},
|
||||||
icon: '',
|
{
|
||||||
order: 0,
|
field: 'name',
|
||||||
type: 'menu',
|
title: '菜单名称',
|
||||||
visible: 1,
|
minWidth: 200,
|
||||||
status: 1,
|
showOverflow: 'tooltip' as const,
|
||||||
keepAlive: 0,
|
treeNode: true, // 启用树节点显示
|
||||||
});
|
slots: { default: 'menuName' },
|
||||||
|
},
|
||||||
// 菜单类型选项
|
{
|
||||||
const menuTypeOptions = [
|
field: 'title',
|
||||||
{ label: '目录', value: 'catalog' },
|
title: '菜单标题',
|
||||||
{ label: '菜单', value: 'menu' },
|
minWidth: 150,
|
||||||
{ label: '按钮', value: 'button' },
|
showOverflow: 'tooltip' as const,
|
||||||
{ label: '内联', value: 'embedded' },
|
},
|
||||||
{ label: '外链', value: 'link' },
|
{
|
||||||
];
|
field: 'path',
|
||||||
|
title: '路由路径',
|
||||||
// 状态选项
|
minWidth: 200,
|
||||||
const statusOptions = [
|
showOverflow: 'tooltip' as const,
|
||||||
{ label: '禁用', value: 0 },
|
},
|
||||||
{ label: '启用', value: 1 },
|
{
|
||||||
];
|
field: 'component',
|
||||||
|
title: '页面组件',
|
||||||
// 可见性选项
|
minWidth: 180,
|
||||||
const visibleOptions = [
|
showOverflow: 'tooltip' as const,
|
||||||
{ label: '隐藏', value: 0 },
|
},
|
||||||
{ label: '显示', value: 1 },
|
{
|
||||||
];
|
title: '类型',
|
||||||
|
minWidth: 100,
|
||||||
// 缓存选项
|
slots: { default: 'menuType' },
|
||||||
const keepAliveOptions = [
|
},
|
||||||
{ label: '不缓存', value: 0 },
|
{
|
||||||
{ label: '缓存', value: 1 },
|
field: 'order',
|
||||||
];
|
title: '排序',
|
||||||
|
minWidth: 80,
|
||||||
// 父菜单选项
|
},
|
||||||
const parentMenuOptions = computed(() => {
|
{
|
||||||
const options: Array<{ label: string; value: number }> = [{ label: '根菜单', value: 0 }];
|
title: '状态',
|
||||||
|
minWidth: 100,
|
||||||
const addMenuOptions = (menus: MenuApiType.MenuInfo[], level = 0) => {
|
slots: { default: 'menuStatus' },
|
||||||
menus.forEach(menu => {
|
},
|
||||||
const prefix = ' '.repeat(level);
|
{
|
||||||
options.push({
|
field: 'createTime',
|
||||||
label: `${prefix}${menu.title || menu.name}`,
|
title: '创建时间',
|
||||||
value: menu.id,
|
minWidth: 160,
|
||||||
});
|
},
|
||||||
if (menu.children && menu.children.length > 0) {
|
{
|
||||||
addMenuOptions(menu.children, level + 1);
|
title: '操作',
|
||||||
}
|
minWidth: 150,
|
||||||
});
|
fixed: 'right' as const,
|
||||||
};
|
slots: { default: 'action' },
|
||||||
|
},
|
||||||
addMenuOptions(menuList.value);
|
],
|
||||||
return options;
|
height: 'auto',
|
||||||
});
|
border: true,
|
||||||
|
stripe: true,
|
||||||
// 表格列配置
|
showOverflow: true,
|
||||||
const columns = [
|
size: 'small',
|
||||||
{
|
resizable: true, // 启用列宽调整
|
||||||
title: '菜单名称',
|
toolbarConfig: {
|
||||||
dataIndex: 'name',
|
custom: true,
|
||||||
key: 'name',
|
refresh: true,
|
||||||
width: 200,
|
zoom: true,
|
||||||
|
export: true, // 启用导出功能
|
||||||
},
|
},
|
||||||
{
|
data: [],
|
||||||
title: '菜单标题',
|
treeConfig: {
|
||||||
dataIndex: 'title',
|
children: 'children',
|
||||||
key: 'title',
|
hasChild: 'hasChildren',
|
||||||
width: 150,
|
expandAll: false, // 默认不展开所有节点
|
||||||
|
indent: 20, // 树节点缩进距离
|
||||||
|
showIcon: true, // 显示展开/收起图标
|
||||||
|
iconOpen: 'vxe-icon-arrow-down', // 展开图标
|
||||||
|
iconClose: 'vxe-icon-arrow-right', // 收起图标
|
||||||
},
|
},
|
||||||
{
|
// 配置远程加载
|
||||||
title: '路由路径',
|
proxyConfig: {
|
||||||
dataIndex: 'path',
|
ajax: {
|
||||||
key: 'path',
|
query: async () => {
|
||||||
width: 200,
|
try {
|
||||||
},
|
loading.value = true;
|
||||||
{
|
const data = await getAllMenusApi();
|
||||||
title: '页面组件',
|
// 构建树形结构数据
|
||||||
dataIndex: 'component',
|
const treeData = buildTreeData(data);
|
||||||
key: 'component',
|
return {
|
||||||
width: 200,
|
items: treeData,
|
||||||
},
|
total: treeData.length,
|
||||||
{
|
};
|
||||||
title: '图标',
|
} catch (error) {
|
||||||
dataIndex: 'icon',
|
console.error('获取菜单列表失败:', error);
|
||||||
key: 'icon',
|
message.error('获取菜单列表失败');
|
||||||
width: 100,
|
return {
|
||||||
},
|
items: [],
|
||||||
{
|
total: 0,
|
||||||
title: '类型',
|
};
|
||||||
dataIndex: 'type',
|
} finally {
|
||||||
key: 'type',
|
loading.value = false;
|
||||||
width: 100,
|
}
|
||||||
customRender: ({ record }: { record: MenuApiType.MenuInfo }) => {
|
},
|
||||||
const typeMap: Record<string, string> = {
|
|
||||||
catalog: '目录',
|
|
||||||
menu: '菜单',
|
|
||||||
button: '按钮',
|
|
||||||
embedded: '内联',
|
|
||||||
link: '外链',
|
|
||||||
};
|
|
||||||
return typeMap[record.type] || record.type;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
};
|
||||||
title: '排序',
|
|
||||||
dataIndex: 'order',
|
|
||||||
key: 'order',
|
|
||||||
width: 80,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '状态',
|
|
||||||
dataIndex: 'status',
|
|
||||||
key: 'status',
|
|
||||||
width: 80,
|
|
||||||
customRender: ({ record }: { record: MenuApiType.MenuInfo }) => {
|
|
||||||
return h('span', {
|
|
||||||
style: { color: record.status === 1 ? '#52c41a' : '#ff4d4f' },
|
|
||||||
}, record.status === 1 ? '启用' : '禁用');
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '操作',
|
|
||||||
key: 'action',
|
|
||||||
width: 200,
|
|
||||||
customRender: ({ record }: { record: MenuApiType.MenuInfo }) => {
|
|
||||||
return h('div', { style: 'display: flex; gap: 8px;' }, [
|
|
||||||
h(Button, {
|
|
||||||
size: 'small',
|
|
||||||
onClick: () => handleEdit(record),
|
|
||||||
}, '编辑'),
|
|
||||||
h(Button, {
|
|
||||||
size: 'small',
|
|
||||||
danger: true,
|
|
||||||
onClick: () => handleDelete(record),
|
|
||||||
}, '删除'),
|
|
||||||
]);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
// 获取菜单列表
|
|
||||||
async function fetchMenuList() {
|
// 刷新表格数据
|
||||||
try {
|
function refreshTable() {
|
||||||
loading.value = true;
|
if (gridApi) {
|
||||||
const data = await getAllMenusApi();
|
gridApi.reload();
|
||||||
menuList.value = data;
|
|
||||||
} catch (error) {
|
|
||||||
console.error('获取菜单列表失败:', error);
|
|
||||||
message.error('获取菜单列表失败');
|
|
||||||
} finally {
|
|
||||||
loading.value = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理添加菜单
|
// 处理添加菜单
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
modalTitle.value = '添加菜单';
|
menuFormModalRef.value?.open(false);
|
||||||
isEdit.value = false;
|
}
|
||||||
currentMenuId.value = null;
|
|
||||||
formData.value = {
|
// 处理添加下级菜单
|
||||||
parentId: 0,
|
function handleAddChild(record: MenuApiType.MenuInfo) {
|
||||||
name: '',
|
menuFormModalRef.value?.open(false, record);
|
||||||
title: '',
|
|
||||||
path: '',
|
|
||||||
component: '',
|
|
||||||
redirect: '',
|
|
||||||
icon: '',
|
|
||||||
order: 0,
|
|
||||||
type: 'menu',
|
|
||||||
visible: 1,
|
|
||||||
status: 1,
|
|
||||||
keepAlive: 0,
|
|
||||||
};
|
|
||||||
modalVisible.value = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理编辑菜单
|
// 处理编辑菜单
|
||||||
async function handleEdit(record: MenuApiType.MenuInfo) {
|
function handleEdit(record: MenuApiType.MenuInfo) {
|
||||||
try {
|
menuFormModalRef.value?.open(true, record);
|
||||||
modalTitle.value = '编辑菜单';
|
|
||||||
isEdit.value = true;
|
|
||||||
currentMenuId.value = record.id;
|
|
||||||
|
|
||||||
// 获取菜单详情
|
|
||||||
const detail = await getMenuDetailApi(record.id);
|
|
||||||
formData.value = {
|
|
||||||
parentId: detail.parentId || 0,
|
|
||||||
name: detail.name,
|
|
||||||
title: detail.title || '',
|
|
||||||
path: detail.path || '',
|
|
||||||
component: detail.component || '',
|
|
||||||
redirect: detail.redirect || '',
|
|
||||||
icon: detail.icon || '',
|
|
||||||
order: detail.order || 0,
|
|
||||||
type: detail.type,
|
|
||||||
visible: detail.visible || 1,
|
|
||||||
status: detail.status || 1,
|
|
||||||
keepAlive: detail.keepAlive || 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
modalVisible.value = true;
|
|
||||||
} catch (error) {
|
|
||||||
console.error('获取菜单详情失败:', error);
|
|
||||||
message.error('获取菜单详情失败');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理删除菜单
|
// 处理删除菜单
|
||||||
@@ -245,143 +168,163 @@ async function handleDelete(record: MenuApiType.MenuInfo) {
|
|||||||
try {
|
try {
|
||||||
await deleteMenuApi(record.id);
|
await deleteMenuApi(record.id);
|
||||||
message.success('删除成功');
|
message.success('删除成功');
|
||||||
await fetchMenuList();
|
refreshTable();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('删除菜单失败:', error);
|
console.error('删除菜单失败:', error);
|
||||||
message.error('删除菜单失败');
|
message.error('删除菜单失败');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理表单提交
|
// 处理模态框成功
|
||||||
async function handleSubmit() {
|
function handleModalSuccess() {
|
||||||
try {
|
refreshTable();
|
||||||
await formRef.value?.validate();
|
}
|
||||||
|
|
||||||
if (isEdit.value && currentMenuId.value) {
|
// 获取菜单类型标签
|
||||||
await updateMenuApi(currentMenuId.value, formData.value);
|
function getMenuTypeLabel(type: string) {
|
||||||
message.success('更新成功');
|
const typeMap: Record<string, string> = {
|
||||||
|
catalog: '目录',
|
||||||
|
menu: '菜单',
|
||||||
|
button: '按钮',
|
||||||
|
embedded: '内联',
|
||||||
|
link: '外链',
|
||||||
|
};
|
||||||
|
return typeMap[type] || type;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取菜单类型颜色
|
||||||
|
function getMenuTypeColor(type: string) {
|
||||||
|
const colorMap: Record<string, string> = {
|
||||||
|
catalog: 'blue',
|
||||||
|
menu: 'green',
|
||||||
|
button: 'orange',
|
||||||
|
embedded: 'purple',
|
||||||
|
link: 'cyan',
|
||||||
|
};
|
||||||
|
return colorMap[type] || 'default';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 构建树形结构数据
|
||||||
|
function buildTreeData(menuList: MenuApiType.MenuInfo[]): MenuApiType.MenuInfo[] {
|
||||||
|
const menuMap = new Map<number, MenuApiType.MenuInfo>();
|
||||||
|
const rootMenus: MenuApiType.MenuInfo[] = [];
|
||||||
|
|
||||||
|
// 创建菜单映射
|
||||||
|
menuList.forEach(menu => {
|
||||||
|
menuMap.set(menu.id, { ...menu, children: [] });
|
||||||
|
});
|
||||||
|
|
||||||
|
// 构建树形结构
|
||||||
|
menuList.forEach(menu => {
|
||||||
|
const menuItem = menuMap.get(menu.id)!;
|
||||||
|
if (menu.parentId && menu.parentId !== 0) {
|
||||||
|
const parent = menuMap.get(menu.parentId);
|
||||||
|
if (parent) {
|
||||||
|
parent.children = parent.children || [];
|
||||||
|
parent.children.push(menuItem);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
await createMenuApi(formData.value);
|
rootMenus.push(menuItem);
|
||||||
message.success('创建成功');
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
modalVisible.value = false;
|
return rootMenus;
|
||||||
await fetchMenuList();
|
}
|
||||||
} catch (error) {
|
|
||||||
console.error('保存菜单失败:', error);
|
// 获取菜单图标
|
||||||
message.error('保存菜单失败');
|
function getMenuIcon(menu: MenuApiType.MenuInfo) {
|
||||||
|
if (menu.icon) {
|
||||||
|
return createIconifyIcon(menu.icon);
|
||||||
|
}
|
||||||
|
// 根据菜单类型返回默认图标
|
||||||
|
switch (menu.type) {
|
||||||
|
case 'catalog':
|
||||||
|
return FolderIcon;
|
||||||
|
case 'menu':
|
||||||
|
case 'embedded':
|
||||||
|
return FileIcon;
|
||||||
|
default:
|
||||||
|
return FileIcon;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化
|
// 创建 VbenVxeGrid 实例
|
||||||
fetchMenuList();
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
|
gridOptions,
|
||||||
|
showSearchForm: false,
|
||||||
|
tableTitle: '菜单管理',
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Page title="菜单管理">
|
<Page title="菜单管理" auto-content-height>
|
||||||
<template #description>
|
<!-- VbenVxeGrid 表格 -->
|
||||||
<div class="text-foreground/80 mt-2">
|
<Grid
|
||||||
管理系统菜单,包括目录、菜单、按钮等类型的增删改查操作
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #extra>
|
|
||||||
<Button type="primary" @click="handleAdd">
|
|
||||||
添加菜单
|
|
||||||
</Button>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<Table
|
|
||||||
:columns="columns"
|
|
||||||
:data-source="menuList"
|
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:pagination="false"
|
|
||||||
row-key="id"
|
|
||||||
:default-expand-all-rows="true"
|
|
||||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Modal
|
|
||||||
v-model:open="modalVisible"
|
|
||||||
:title="modalTitle"
|
|
||||||
width="600px"
|
|
||||||
@ok="handleSubmit"
|
|
||||||
>
|
>
|
||||||
<Form
|
<!-- 工具栏工具 -->
|
||||||
ref="formRef"
|
<template #toolbar-tools>
|
||||||
:model="formData"
|
<Space>
|
||||||
:label-col="{ span: 6 }"
|
<Button type="primary" @click="handleAdd">
|
||||||
:wrapper-col="{ span: 18 }"
|
<PlusIcon />
|
||||||
>
|
添加菜单
|
||||||
<Form.Item label="父菜单" name="parentId">
|
</Button>
|
||||||
<Select
|
</Space>
|
||||||
v-model:value="formData.parentId"
|
</template>
|
||||||
placeholder="请选择父菜单"
|
|
||||||
:options="parentMenuOptions"
|
|
||||||
allow-clear
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item label="菜单名称" name="name" :rules="[{ required: true, message: '请输入菜单名称' }]">
|
<!-- 菜单名称列 -->
|
||||||
<Input v-model:value="formData.name" placeholder="请输入菜单名称" />
|
<template #menuName="{ row }: { row: any }">
|
||||||
</Form.Item>
|
<div class="flex items-center space-x-2">
|
||||||
|
<component :is="getMenuIcon(row)" class="w-4 h-4 text-gray-600" />
|
||||||
|
<span>{{ row.name }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
<Form.Item label="菜单标题" name="title">
|
<!-- 图标列 -->
|
||||||
<Input v-model:value="formData.title" placeholder="请输入菜单标题" />
|
<template #icon="{ row }: { row: any }">
|
||||||
</Form.Item>
|
<div v-if="row.icon" class="flex items-center justify-center">
|
||||||
|
<component :is="getMenuIcon(row)" class="w-4 h-4 text-blue-600" />
|
||||||
|
</div>
|
||||||
|
<span v-else class="text-gray-400">-</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
<Form.Item label="路由路径" name="path">
|
<!-- 菜单类型列 -->
|
||||||
<Input v-model:value="formData.path" placeholder="请输入路由路径" />
|
<template #menuType="{ row }: { row: any }">
|
||||||
</Form.Item>
|
<Tag :color="getMenuTypeColor(row.type)">
|
||||||
|
{{ getMenuTypeLabel(row.type) }}
|
||||||
|
</Tag>
|
||||||
|
</template>
|
||||||
|
|
||||||
<Form.Item label="页面组件" name="component">
|
<!-- 菜单状态列 -->
|
||||||
<Input v-model:value="formData.component" placeholder="请输入页面组件" />
|
<template #menuStatus="{ row }: { row: any }">
|
||||||
</Form.Item>
|
<Tag :color="row.status === 1 ? 'green' : 'red'">
|
||||||
|
{{ row.status === 1 ? '启用' : '禁用' }}
|
||||||
|
</Tag>
|
||||||
|
</template>
|
||||||
|
|
||||||
<Form.Item label="重定向地址" name="redirect">
|
<!-- 操作列 -->
|
||||||
<Input v-model:value="formData.redirect" placeholder="请输入重定向地址" />
|
<template #action="{ row }: { row: any }">
|
||||||
</Form.Item>
|
<Space>
|
||||||
|
<Button size="small" @click="handleAddChild(row)">
|
||||||
|
<PlusCircleIcon class="w-3 h-3" />
|
||||||
|
增加下级
|
||||||
|
</Button>
|
||||||
|
<Button size="small" @click="handleEdit(row)">
|
||||||
|
<EditIcon class="w-3 h-3" />
|
||||||
|
编辑
|
||||||
|
</Button>
|
||||||
|
<Button size="small" danger @click="handleDelete(row)">
|
||||||
|
<TrashIcon class="w-3 h-3" />
|
||||||
|
删除
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
</template>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Form.Item label="路由图标" name="icon">
|
<!-- 菜单表单模态框 -->
|
||||||
<Input v-model:value="formData.icon" placeholder="请输入路由图标" />
|
<MenuFormModal
|
||||||
</Form.Item>
|
ref="menuFormModalRef"
|
||||||
|
@success="handleModalSuccess"
|
||||||
<Form.Item label="排序" name="order">
|
/>
|
||||||
<InputNumber v-model:value="formData.order" placeholder="请输入排序" :min="0" />
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item label="菜单类型" name="type" :rules="[{ required: true, message: '请选择菜单类型' }]">
|
|
||||||
<Select
|
|
||||||
v-model:value="formData.type"
|
|
||||||
placeholder="请选择菜单类型"
|
|
||||||
:options="menuTypeOptions"
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item label="是否显示" name="visible">
|
|
||||||
<Select
|
|
||||||
v-model:value="formData.visible"
|
|
||||||
placeholder="请选择是否显示"
|
|
||||||
:options="visibleOptions"
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item label="状态" name="status">
|
|
||||||
<Select
|
|
||||||
v-model:value="formData.status"
|
|
||||||
placeholder="请选择状态"
|
|
||||||
:options="statusOptions"
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item label="是否缓存" name="keepAlive">
|
|
||||||
<Select
|
|
||||||
v-model:value="formData.keepAlive"
|
|
||||||
placeholder="请选择是否缓存"
|
|
||||||
:options="keepAliveOptions"
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
</Form>
|
|
||||||
</Modal>
|
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user