|
@@ -57,7 +57,10 @@ const hasInstance = () => !isUnmounted && !!instance && !!instance.lf;
|
|
|
let oldValue: FlowRequestData;
|
|
let oldValue: FlowRequestData;
|
|
|
const maxPanelHeight = ref(0);
|
|
const maxPanelHeight = ref(0);
|
|
|
const init = (lf: LogicFlowInstance): void => {
|
|
const init = (lf: LogicFlowInstance): void => {
|
|
|
- setTimeout(() => { maxPanelHeight.value = lf.container.getBoundingClientRect().height - 80; }, 100);
|
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ maxPanelHeight.value = lf.container.getBoundingClientRect().height - 80;
|
|
|
|
|
+ openPanel.value = maxPanelHeight.value > 0;
|
|
|
|
|
+ }, 100);
|
|
|
instance = VLogicFlowInit(lf, {
|
|
instance = VLogicFlowInit(lf, {
|
|
|
register: [{ category: 'node', type: 'FlowNode', view: FlowNodeView, model: FlowNodeViewModel }],
|
|
register: [{ category: 'node', type: 'FlowNode', view: FlowNodeView, model: FlowNodeViewModel }],
|
|
|
});
|
|
});
|
|
@@ -189,8 +192,13 @@ const updateLayout = (dir?: 'LR' | 'TB' | 'center') => {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const openPanel = ref(true);
|
|
|
|
|
|
|
+const openPanel = ref(false);
|
|
|
const dragPanelNodeId = ref('');
|
|
const dragPanelNodeId = ref('');
|
|
|
|
|
+const togglePanel = (open?: boolean) => {
|
|
|
|
|
+ open ??= !openPanel.value;
|
|
|
|
|
+ if (open && !(maxPanelHeight.value > 0)) maxPanelHeight.value = instance.lf.container.getBoundingClientRect().height - 80;
|
|
|
|
|
+ openPanel.value = open;
|
|
|
|
|
+};
|
|
|
const startDragPanelNode = (node: any, event: MouseEvent) => {
|
|
const startDragPanelNode = (node: any, event: MouseEvent) => {
|
|
|
let el = event.target as HTMLElement;
|
|
let el = event.target as HTMLElement;
|
|
|
do {
|
|
do {
|
|
@@ -353,6 +361,7 @@ const validate = (tips = true) => {
|
|
|
tryOnUnmounted(() => {
|
|
tryOnUnmounted(() => {
|
|
|
// 新加的
|
|
// 新加的
|
|
|
isUnmounted = true;
|
|
isUnmounted = true;
|
|
|
|
|
+ openPanel.value = false;
|
|
|
notification.destroy();
|
|
notification.destroy();
|
|
|
try { scope.stop(); } catch {}
|
|
try { scope.stop(); } catch {}
|
|
|
});
|
|
});
|
|
@@ -370,7 +379,7 @@ defineExpose({
|
|
|
</template>
|
|
</template>
|
|
|
<template #panel>
|
|
<template #panel>
|
|
|
<a-dropdown class="panel-wrapper" :trigger="['click']" :open="openPanel">
|
|
<a-dropdown class="panel-wrapper" :trigger="['click']" :open="openPanel">
|
|
|
- <a-button type="primary" size="large" shape="circle" @click.prevent="openPanel = !openPanel">
|
|
|
|
|
|
|
+ <a-button type="primary" size="large" shape="circle" @click.prevent="togglePanel()">
|
|
|
<template #icon>
|
|
<template #icon>
|
|
|
<CloseOutlined v-if="openPanel"></CloseOutlined>
|
|
<CloseOutlined v-if="openPanel"></CloseOutlined>
|
|
|
<MenuOutlined v-else />
|
|
<MenuOutlined v-else />
|