From 14d508d63005fc7e6b9bc275f15c151775cee66e Mon Sep 17 00:00:00 2001
From: DevDengChao <2325690622@qq.com>
Date: Wed, 19 Nov 2025 16:12:46 +0800
Subject: [PATCH 1/2] feat: close tab on mouse mid-button click
---
src/layout/components/TagsView/src/TagsView.vue | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/layout/components/TagsView/src/TagsView.vue b/src/layout/components/TagsView/src/TagsView.vue
index af492ba20..69f94bfb7 100644
--- a/src/layout/components/TagsView/src/TagsView.vue
+++ b/src/layout/components/TagsView/src/TagsView.vue
@@ -255,6 +255,15 @@ const canShowIcon = (item: RouteLocationNormalizedLoaded) => {
return false
}
+const closeTabOnMouseMidClick = (e: MouseEvent, item) => {
+ // 中键:button === 1
+ if (e.button === 1) {
+ e.preventDefault()
+ e.stopPropagation()
+ closeSelectedTag(item)
+ }
+}
+
onBeforeMount(() => {
initTags()
addTags()
@@ -293,6 +302,7 @@ watch(
v-for="item in visitedViews"
:key="item.fullPath"
:ref="itemRefs.set"
+ @auxclick="closeTabOnMouseMidClick($event, item)"
:class="[
`${prefixCls}__item`,
tagsViewImmerse ? `${prefixCls}__item--immerse` : '',
From 3ffefc99c008d7267fe870ab244717e10ce6a29a Mon Sep 17 00:00:00 2001
From: DevDengChao <2325690622@qq.com>
Date: Thu, 20 Nov 2025 17:42:29 +0800
Subject: [PATCH 2/2] fix: unable to refresh spu category or brand
---
src/views/mall/product/spu/form/InfoForm.vue | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/views/mall/product/spu/form/InfoForm.vue b/src/views/mall/product/spu/form/InfoForm.vue
index 28bd309b0..0eb70e3ad 100644
--- a/src/views/mall/product/spu/form/InfoForm.vue
+++ b/src/views/mall/product/spu/form/InfoForm.vue
@@ -23,6 +23,7 @@
filterable
placeholder="请选择商品分类"
/>
+
@@ -33,6 +34,7 @@
:value="item.id as number"
/>
+
@@ -67,6 +69,7 @@ import * as ProductCategoryApi from '@/api/mall/product/category'
import { CategoryVO } from '@/api/mall/product/category'
import * as ProductBrandApi from '@/api/mall/product/brand'
import { BrandVO } from '@/api/mall/product/brand'
+import { RefreshRight } from '@element-plus/icons-vue'
defineOptions({ name: 'ProductSpuInfoForm' })
const props = defineProps({
@@ -132,11 +135,19 @@ defineExpose({ validate })
/** 初始化 */
const brandList = ref([]) // 商品品牌列表
const categoryList = ref([]) // 商品分类树
-onMounted(async () => {
+async function refreshCategoryList() {
// 获得分类树
const data = await ProductCategoryApi.getCategoryList({})
categoryList.value = handleTree(data, 'id')
- // 获取商品品牌列表
+}
+
+async function refreshBrandList() {
brandList.value = await ProductBrandApi.getSimpleBrandList()
+}
+
+onMounted(async () => {
+ await refreshCategoryList()
+ // 获取商品品牌列表
+ await refreshBrandList()
})