From 2b9506845c43813d3b5cc2885bec223fa1d96e04 Mon Sep 17 00:00:00 2001 From: beta Date: Sun, 11 Dec 2022 16:06:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E6=97=A0=E6=B3=95=E6=B7=BB=E5=8A=A0=E6=96=B0=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 修复 工作流无法添加新节点问题 2. 修复 左侧导航无法隐藏问题 --- src/types/views.d.ts | 2 -- src/views/pages/workflow/index.vue | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/types/views.d.ts b/src/types/views.d.ts index 5c08ea3..5082d51 100644 --- a/src/types/views.d.ts +++ b/src/types/views.d.ts @@ -243,8 +243,6 @@ declare type XyState = { }; declare type WorkflowState = { - workflowRightRef: HTMLDivElement | null; - leftNavRefs: HTMLElement[]; leftNavList: T[]; dropdownNode: XyState; dropdownLine: XyState; diff --git a/src/views/pages/workflow/index.vue b/src/views/pages/workflow/index.vue index f93a193..b217141 100644 --- a/src/views/pages/workflow/index.vue +++ b/src/views/pages/workflow/index.vue @@ -12,7 +12,7 @@
import('./component/drawer/index.vue') const Help = defineAsyncComponent(() => import('./component/tool/help.vue')); // 定义变量内容 +const leftNavRefs = ref([]); +const workflowRightRef = ref(); const contextmenuNodeRef = ref(); const contextmenuLineRef = ref(); const drawerRef = ref(); @@ -95,8 +97,6 @@ const storesThemeConfig = useThemeConfig(); const { themeConfig } = storeToRefs(storesThemeConfig); const { copyText } = commonFunction(); const state = reactive({ - workflowRightRef: null, - leftNavRefs: [], leftNavList: [], dropdownNode: { x: '', y: '' }, dropdownLine: { x: '', y: '' }, @@ -151,7 +151,7 @@ const initLeftNavList = () => { }; // 左侧导航-初始化拖动 const initSortable = () => { - state.leftNavRefs.forEach((v) => { + leftNavRefs.forEach((v) => { Sortable.create(v as HTMLDivElement, { group: { name: 'vue-next-admin-1', @@ -165,7 +165,7 @@ const initSortable = () => { onEnd: function (evt: any) { const { name, icon, id } = evt.clone.dataset; const { layerX, layerY, clientX, clientY } = evt.originalEvent; - const el = state.workflowRightRef!; + const el = workflowRightRef.value!; const { x, y, width, height } = el.getBoundingClientRect(); if (clientX < x || clientX > width + x || clientY < y || y > y + height) { ElMessage.warning('请把节点拖入到画布中');