From 212d7987889571125133c954f3e94958385ed4be Mon Sep 17 00:00:00 2001 From: Lemon <1599456917@qq.com> Date: Sat, 22 Feb 2025 11:53:27 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=20?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E8=A1=A8=E5=8D=95=E8=AF=A6=E6=83=85=20?= =?UTF-8?q?=E5=BD=93=E6=B5=81=E7=A8=8B=E8=A1=A8=E5=8D=95=E8=BF=87=E9=95=BF?= =?UTF-8?q?=E6=97=B6=E5=80=99=E5=A2=9E=E5=8A=A0=E5=AF=B9=E5=BA=94=E5=BE=80?= =?UTF-8?q?=E4=B8=8A=E5=BE=80=E4=B8=8B=E8=B7=B3=E8=BD=AC=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=B9=B6=E5=86=85=E5=AE=B9=E5=9C=A8=E5=BC=B9=E6=A1=86=E5=86=85?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bpm/model/CategoryDraggableModel.vue | 152 +++++++++++++++++- 1 file changed, 150 insertions(+), 2 deletions(-) diff --git a/src/views/bpm/model/CategoryDraggableModel.vue b/src/views/bpm/model/CategoryDraggableModel.vue index 71b79b781..5f195b46a 100644 --- a/src/views/bpm/model/CategoryDraggableModel.vue +++ b/src/views/bpm/model/CategoryDraggableModel.vue @@ -254,8 +254,32 @@ - - + +
+ +
+ + +
+
+ + + +
+
+ + + +
+
@@ -274,6 +298,8 @@ import { cloneDeep, isEqual } from 'lodash-es' import { useTagsView } from '@/hooks/web/useTagsView' import { useDebounceFn } from '@vueuse/core' import { subString } from '@/utils/index' +import { ArrowUpBold, ArrowDownBold } from '@element-plus/icons-vue' +import { ElBacktop } from 'element-plus' defineOptions({ name: 'BpmModel' }) @@ -609,9 +635,109 @@ watchEffect(() => { isExpand.value = false } }) + +// 添加顶部按钮显示控制 +const showTopBtn = ref(false) + +// 控制底部按钮显示 +const showBottomBtn = ref(false) + +// 修改滚动事件处理 +const handleScroll = () => { + const container = document.querySelector('.form-detail-container') + if (container) { + const { scrollTop, scrollHeight, clientHeight } = container + // 当滚动到一定距离时显示顶部按钮 + showTopBtn.value = scrollTop > 100 + // 当未滚动到底部时显示底部按钮 + showBottomBtn.value = scrollTop + clientHeight < scrollHeight - 10 + } +} + +// 添加滚动到顶部方法 +const scrollToTop = () => { + const container = document.querySelector('.form-detail-container') + if (container) { + container.scrollTo({ + top: 0, + behavior: 'smooth' + }) + } +} + +// 添加滚动到底部方法 +const scrollToBottom = () => { + const container = document.querySelector('.form-detail-container') + if (container) { + container.scrollTo({ + top: container.scrollHeight, + behavior: 'smooth' + }) + } +} + +// 在组件挂载后添加滚动监听 +onMounted(() => { + const container = document.querySelector('.form-detail-container') + if (container) { + container.addEventListener('scroll', handleScroll) + } +}) + +// 在组件卸载前移除滚动监听 +onUnmounted(() => { + const container = document.querySelector('.form-detail-container') + if (container) { + container.removeEventListener('scroll', handleScroll) + } +}) -- Gitee From 009b17c91d34ca833276f11e5e27304d693cd43a Mon Sep 17 00:00:00 2001 From: Lemon <1599456917@qq.com> Date: Sat, 22 Feb 2025 19:56:04 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=8A=BD=E7=A6=BB=E4=B8=8A=E4=B8=8B?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=8C=89=E9=92=AE=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.local | 2 +- src/components/ScrollButtons/index.vue | 119 ++++++++++++++++++ .../bpm/model/CategoryDraggableModel.vue | 115 +---------------- 3 files changed, 124 insertions(+), 112 deletions(-) create mode 100644 src/components/ScrollButtons/index.vue diff --git a/.env.local b/.env.local index 35765584d..cfecf563f 100644 --- a/.env.local +++ b/.env.local @@ -4,7 +4,7 @@ NODE_ENV=development VITE_DEV=true # 请求路径 -VITE_BASE_URL='http://localhost:48080' +VITE_BASE_URL='http://192.168.3.9:48080' # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务 VITE_UPLOAD_TYPE=server diff --git a/src/components/ScrollButtons/index.vue b/src/components/ScrollButtons/index.vue new file mode 100644 index 000000000..58afca3d4 --- /dev/null +++ b/src/components/ScrollButtons/index.vue @@ -0,0 +1,119 @@ + + + + + \ No newline at end of file diff --git a/src/views/bpm/model/CategoryDraggableModel.vue b/src/views/bpm/model/CategoryDraggableModel.vue index 5f195b46a..d2f294c6f 100644 --- a/src/views/bpm/model/CategoryDraggableModel.vue +++ b/src/views/bpm/model/CategoryDraggableModel.vue @@ -259,27 +259,8 @@ - -
-
- - - -
-
- - - -
-
+ +
@@ -300,6 +281,7 @@ import { useDebounceFn } from '@vueuse/core' import { subString } from '@/utils/index' import { ArrowUpBold, ArrowDownBold } from '@element-plus/icons-vue' import { ElBacktop } from 'element-plus' +import ScrollButtons from '@/components/ScrollButtons/index.vue' defineOptions({ name: 'BpmModel' }) @@ -635,62 +617,6 @@ watchEffect(() => { isExpand.value = false } }) - -// 添加顶部按钮显示控制 -const showTopBtn = ref(false) - -// 控制底部按钮显示 -const showBottomBtn = ref(false) - -// 修改滚动事件处理 -const handleScroll = () => { - const container = document.querySelector('.form-detail-container') - if (container) { - const { scrollTop, scrollHeight, clientHeight } = container - // 当滚动到一定距离时显示顶部按钮 - showTopBtn.value = scrollTop > 100 - // 当未滚动到底部时显示底部按钮 - showBottomBtn.value = scrollTop + clientHeight < scrollHeight - 10 - } -} - -// 添加滚动到顶部方法 -const scrollToTop = () => { - const container = document.querySelector('.form-detail-container') - if (container) { - container.scrollTo({ - top: 0, - behavior: 'smooth' - }) - } -} - -// 添加滚动到底部方法 -const scrollToBottom = () => { - const container = document.querySelector('.form-detail-container') - if (container) { - container.scrollTo({ - top: container.scrollHeight, - behavior: 'smooth' - }) - } -} - -// 在组件挂载后添加滚动监听 -onMounted(() => { - const container = document.querySelector('.form-detail-container') - if (container) { - container.addEventListener('scroll', handleScroll) - } -}) - -// 在组件卸载前移除滚动监听 -onUnmounted(() => { - const container = document.querySelector('.form-detail-container') - if (container) { - container.removeEventListener('scroll', handleScroll) - } -}) + + \ No newline at end of file diff --git a/src/components/ScrollButtons/index.vue b/src/components/ScrollButtons/index.vue deleted file mode 100644 index 58afca3d4..000000000 --- a/src/components/ScrollButtons/index.vue +++ /dev/null @@ -1,119 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/bpm/model/CategoryDraggableModel.vue b/src/views/bpm/model/CategoryDraggableModel.vue index d2f294c6f..74434f0e6 100644 --- a/src/views/bpm/model/CategoryDraggableModel.vue +++ b/src/views/bpm/model/CategoryDraggableModel.vue @@ -254,14 +254,11 @@ - -
- -
- - - -
+