fix: type
parent
379e8e755f
commit
4cffb9e674
|
@ -1,5 +1,5 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { SystemDeptApi } from '#/api/system/dept';
|
import type { SystemMenuApi } from '#/api/system/menu';
|
||||||
import type { SystemTenantPackageApi } from '#/api/system/tenant-package';
|
import type { SystemTenantPackageApi } from '#/api/system/tenant-package';
|
||||||
|
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
|
@ -27,7 +27,7 @@ const getTitle = computed(() => {
|
||||||
? $t('ui.actionTitle.edit', ['套餐'])
|
? $t('ui.actionTitle.edit', ['套餐'])
|
||||||
: $t('ui.actionTitle.create', ['套餐']);
|
: $t('ui.actionTitle.create', ['套餐']);
|
||||||
});
|
});
|
||||||
const menuTree = ref<SystemDeptApi.Dept[]>([]); // 菜单树
|
const menuTree = ref<SystemMenuApi.Menu[]>([]); // 菜单树
|
||||||
const menuLoading = ref(false); // 加载菜单列表
|
const menuLoading = ref(false); // 加载菜单列表
|
||||||
const isAllSelected = ref(false); // 全选状态
|
const isAllSelected = ref(false); // 全选状态
|
||||||
const isExpanded = ref(false); // 展开状态
|
const isExpanded = ref(false); // 展开状态
|
||||||
|
@ -95,7 +95,7 @@ async function loadMenuTree() {
|
||||||
menuLoading.value = true;
|
menuLoading.value = true;
|
||||||
try {
|
try {
|
||||||
const data = await getMenuList();
|
const data = await getMenuList();
|
||||||
menuTree.value = handleTree(data) as SystemDeptApi.Dept[];
|
menuTree.value = handleTree(data) as SystemMenuApi.Menu[];
|
||||||
} finally {
|
} finally {
|
||||||
menuLoading.value = false;
|
menuLoading.value = false;
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,6 @@ function getAllNodeIds(nodes: any[], ids: number[] = []): number[] {
|
||||||
<Modal :title="getTitle" class="w-2/5">
|
<Modal :title="getTitle" class="w-2/5">
|
||||||
<Form class="mx-6">
|
<Form class="mx-6">
|
||||||
<template #menuIds="slotProps">
|
<template #menuIds="slotProps">
|
||||||
<!-- TODO @芋艿:可优化,使用 antd 的 tree?原因是,更原生 -->
|
|
||||||
<VbenTree
|
<VbenTree
|
||||||
class="max-h-96 overflow-y-auto"
|
class="max-h-96 overflow-y-auto"
|
||||||
:loading="menuLoading"
|
:loading="menuLoading"
|
||||||
|
|
Loading…
Reference in New Issue