Merge branch 'main' of https://github.com/vbenjs/vue-vben-admin into dev
commit
703d88d799
|
@ -152,10 +152,10 @@ const handleCategorySortSubmit = async () => {
|
|||
<Page auto-content-height>
|
||||
<Card
|
||||
:body-style="{ padding: '10px' }"
|
||||
class="mb-4"
|
||||
class="mb-4 h-[89vh]"
|
||||
v-spinning="modelListSpinning"
|
||||
>
|
||||
<div class="flex items-center justify-between pl-5">
|
||||
<div class="flex h-full items-center justify-between pl-5">
|
||||
<span class="-mb-4 text-lg font-extrabold">流程模型</span>
|
||||
<!-- 搜索工作栏 -->
|
||||
<Form
|
||||
|
|
|
@ -9,6 +9,7 @@ import {
|
|||
h,
|
||||
inject,
|
||||
nextTick,
|
||||
onDeactivated,
|
||||
provide,
|
||||
reactive,
|
||||
ref,
|
||||
|
@ -70,6 +71,14 @@ export function useVbenDrawer<
|
|||
inheritAttrs: false,
|
||||
},
|
||||
);
|
||||
|
||||
/**
|
||||
* 在开启keepAlive情况下 直接通过浏览器按钮/手势等返回 不会关闭弹窗
|
||||
*/
|
||||
onDeactivated(() => {
|
||||
(extendedApi as ExtendedDrawerApi)?.close?.();
|
||||
});
|
||||
|
||||
return [Drawer, extendedApi as ExtendedDrawerApi] as const;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
import type { ExtendedModalApi, ModalApiOptions, ModalProps } from './modal';
|
||||
|
||||
import { defineComponent, h, inject, nextTick, provide, reactive } from 'vue';
|
||||
import {
|
||||
defineComponent,
|
||||
h,
|
||||
inject,
|
||||
nextTick,
|
||||
onDeactivated,
|
||||
provide,
|
||||
reactive,
|
||||
ref,
|
||||
} from 'vue';
|
||||
|
||||
import { useStore } from '@vben-core/shared/store';
|
||||
|
||||
|
@ -24,6 +33,7 @@ export function useVbenModal<TParentModalProps extends ModalProps = ModalProps>(
|
|||
const { connectedComponent } = options;
|
||||
if (connectedComponent) {
|
||||
const extendedApi = reactive({});
|
||||
const isModalReady = ref(true);
|
||||
const Modal = defineComponent(
|
||||
(props: TParentModalProps, { attrs, slots }) => {
|
||||
provide(USER_MODAL_INJECT_KEY, {
|
||||
|
@ -33,6 +43,11 @@ export function useVbenModal<TParentModalProps extends ModalProps = ModalProps>(
|
|||
Object.setPrototypeOf(extendedApi, api);
|
||||
},
|
||||
options,
|
||||
async reCreateModal() {
|
||||
isModalReady.value = false;
|
||||
await nextTick();
|
||||
isModalReady.value = true;
|
||||
},
|
||||
});
|
||||
checkProps(extendedApi as ExtendedModalApi, {
|
||||
...props,
|
||||
|
@ -41,7 +56,7 @@ export function useVbenModal<TParentModalProps extends ModalProps = ModalProps>(
|
|||
});
|
||||
return () =>
|
||||
h(
|
||||
connectedComponent,
|
||||
isModalReady.value ? connectedComponent : 'div',
|
||||
{
|
||||
...props,
|
||||
...attrs,
|
||||
|
@ -55,6 +70,14 @@ export function useVbenModal<TParentModalProps extends ModalProps = ModalProps>(
|
|||
inheritAttrs: false,
|
||||
},
|
||||
);
|
||||
|
||||
/**
|
||||
* 在开启keepAlive情况下 直接通过浏览器按钮/手势等返回 不会关闭弹窗
|
||||
*/
|
||||
onDeactivated(() => {
|
||||
(extendedApi as ExtendedModalApi)?.close?.();
|
||||
});
|
||||
|
||||
return [Modal, extendedApi as ExtendedModalApi] as const;
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ function generateMenus(
|
|||
// 处理子菜单
|
||||
const resultChildren = hideChildrenInMenu
|
||||
? []
|
||||
: (children as MenuRecordRaw[]);
|
||||
: ((children as MenuRecordRaw[]) ?? []);
|
||||
|
||||
// 设置子菜单的父子关系
|
||||
if (resultChildren.length > 0) {
|
||||
|
|
Loading…
Reference in New Issue