From 7fd5da85d14248deb7d26e63d153cb68037d5f2e Mon Sep 17 00:00:00 2001 From: zhugongping Date: Wed, 23 Sep 2026 17:59:30 +0800 Subject: [PATCH] =?UTF-8?q?FrontendRefactoring=EF=BC=9A=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=8B=96=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/fastbee-report.sql | 2 +- .../layout/components/TagsView/ScrollPane.vue | 6 +- .../src/layout/components/TagsView/index.vue | 218 +++++++++++++++++- yack-web/src/store/modules/tagsView.js | 17 ++ 4 files changed, 237 insertions(+), 6 deletions(-) diff --git a/sql/fastbee-report.sql b/sql/fastbee-report.sql index fd3c45bd..7b1cf251 100644 --- a/sql/fastbee-report.sql +++ b/sql/fastbee-report.sql @@ -158,7 +158,7 @@ INSERT INTO `oss_config` (tenant_id, tenant_name, config_key, access_key, secret_key, bucket_name, prefix, endpoint, domain, is_https, region, access_policy, status, del_flag, create_by, create_time, update_by, update_time, remark) VALUES -(1, 'admin', 'minio', 'yack-superme', 'yack-minio20260816', 'fastbee', 'report', +(1, 'admin', 'minio', 'supermeminio', 'minio20260909', 'fastbee', 'report', 'http://47.121.180.229:9000', '', 'N', '', '0', '0', '0', 'admin', NOW(), 'admin', NOW(), 'MinIO默认存储'); -- ------------------------------------------------------------ diff --git a/yack-web/src/layout/components/TagsView/ScrollPane.vue b/yack-web/src/layout/components/TagsView/ScrollPane.vue index 72324a79..211a172b 100644 --- a/yack-web/src/layout/components/TagsView/ScrollPane.vue +++ b/yack-web/src/layout/components/TagsView/ScrollPane.vue @@ -38,7 +38,11 @@ export default { const $container = this.$refs.scrollContainer.$el const $containerWidth = $container.offsetWidth const $scrollWrapper = this.scrollWrapper - const tagList = this.$parent.$refs.tag + // $refs.tag 的下标是「首次注册顺序」,ref 只在 create/destroy 时增删; + // 标签拖拽排序只移动 DOM,不会更新这个数组,所以直接按数组顺序取首/尾和 + // 相邻标签会取错。改为按标签在栏上的实际横坐标重排后再取。 + // [].concat 同时兼容 refs 为单个元素(v-for 只剩 1 个时不一定是数组)的情况 + const tagList = [].concat(this.$parent.$refs.tag || []).sort((a, b) => a.$el.offsetLeft - b.$el.offsetLeft) let firstTag = null let lastTag = null diff --git a/yack-web/src/layout/components/TagsView/index.vue b/yack-web/src/layout/components/TagsView/index.vue index 8ea0f23e..4b33af48 100644 --- a/yack-web/src/layout/components/TagsView/index.vue +++ b/yack-web/src/layout/components/TagsView/index.vue @@ -1,5 +1,10 @@