Merge branch 'master' of https://github.com/yudaocode/yudao-ui-admin-vue3
commit
da566f87d9
|
|
@ -255,6 +255,15 @@ const canShowIcon = (item: RouteLocationNormalizedLoaded) => {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const closeTabOnMouseMidClick = (e: MouseEvent, item) => {
|
||||||
|
// 中键:button === 1
|
||||||
|
if (e.button === 1) {
|
||||||
|
e.preventDefault()
|
||||||
|
e.stopPropagation()
|
||||||
|
closeSelectedTag(item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
initTags()
|
initTags()
|
||||||
addTags()
|
addTags()
|
||||||
|
|
@ -293,6 +302,7 @@ watch(
|
||||||
v-for="item in visitedViews"
|
v-for="item in visitedViews"
|
||||||
:key="item.fullPath"
|
:key="item.fullPath"
|
||||||
:ref="itemRefs.set"
|
:ref="itemRefs.set"
|
||||||
|
@auxclick="closeTabOnMouseMidClick($event, item)"
|
||||||
:class="[
|
:class="[
|
||||||
`${prefixCls}__item`,
|
`${prefixCls}__item`,
|
||||||
tagsViewImmerse ? `${prefixCls}__item--immerse` : '',
|
tagsViewImmerse ? `${prefixCls}__item--immerse` : '',
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择商品分类"
|
placeholder="请选择商品分类"
|
||||||
/>
|
/>
|
||||||
|
<el-button :icon="RefreshRight" @click="refreshCategoryList" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品品牌" prop="brandId">
|
<el-form-item label="商品品牌" prop="brandId">
|
||||||
<el-select v-model="formData.brandId" class="w-80!" placeholder="请选择商品品牌">
|
<el-select v-model="formData.brandId" class="w-80!" placeholder="请选择商品品牌">
|
||||||
|
|
@ -33,6 +34,7 @@
|
||||||
:value="item.id as number"
|
:value="item.id as number"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
<el-button :icon="RefreshRight" @click="refreshBrandList" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品关键字" prop="keyword">
|
<el-form-item label="商品关键字" prop="keyword">
|
||||||
<el-input v-model="formData.keyword" class="w-80!" placeholder="请输入商品关键字" />
|
<el-input v-model="formData.keyword" class="w-80!" placeholder="请输入商品关键字" />
|
||||||
|
|
@ -67,6 +69,7 @@ import * as ProductCategoryApi from '@/api/mall/product/category'
|
||||||
import { CategoryVO } from '@/api/mall/product/category'
|
import { CategoryVO } from '@/api/mall/product/category'
|
||||||
import * as ProductBrandApi from '@/api/mall/product/brand'
|
import * as ProductBrandApi from '@/api/mall/product/brand'
|
||||||
import { BrandVO } from '@/api/mall/product/brand'
|
import { BrandVO } from '@/api/mall/product/brand'
|
||||||
|
import { RefreshRight } from '@element-plus/icons-vue'
|
||||||
|
|
||||||
defineOptions({ name: 'ProductSpuInfoForm' })
|
defineOptions({ name: 'ProductSpuInfoForm' })
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -132,11 +135,19 @@ defineExpose({ validate })
|
||||||
/** 初始化 */
|
/** 初始化 */
|
||||||
const brandList = ref<BrandVO[]>([]) // 商品品牌列表
|
const brandList = ref<BrandVO[]>([]) // 商品品牌列表
|
||||||
const categoryList = ref<CategoryVO[]>([]) // 商品分类树
|
const categoryList = ref<CategoryVO[]>([]) // 商品分类树
|
||||||
onMounted(async () => {
|
async function refreshCategoryList() {
|
||||||
// 获得分类树
|
// 获得分类树
|
||||||
const data = await ProductCategoryApi.getCategoryList({})
|
const data = await ProductCategoryApi.getCategoryList({})
|
||||||
categoryList.value = handleTree(data, 'id')
|
categoryList.value = handleTree(data, 'id')
|
||||||
// 获取商品品牌列表
|
}
|
||||||
|
|
||||||
|
async function refreshBrandList() {
|
||||||
brandList.value = await ProductBrandApi.getSimpleBrandList()
|
brandList.value = await ProductBrandApi.getSimpleBrandList()
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await refreshCategoryList()
|
||||||
|
// 获取商品品牌列表
|
||||||
|
await refreshBrandList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue