【功能优化】MALL:商品分类界面,增加【查看商品】按钮

pull/487/MERGE
YunaiV 2024-07-28 14:54:52 +08:00
parent 8bbe9ad424
commit 36b5db16dd
3 changed files with 26 additions and 3 deletions

View File

@ -27,7 +27,7 @@
<el-button size="small" class="btn">
<Icon icon="ep:download" color="#787878" />
</el-button>
<el-button size="small" class="btn" @click="handleGoTopMessage" >
<el-button size="small" class="btn" @click="handleGoTopMessage">
<Icon icon="ep:top" color="#787878" />
</el-button>
</div>
@ -119,7 +119,6 @@ import MessageList from './components/message/MessageList.vue'
import MessageListEmpty from './components/message/MessageListEmpty.vue'
import MessageLoading from './components/message/MessageLoading.vue'
import MessageNewConversation from './components/message/MessageNewConversation.vue'
import { Download, Top } from '@element-plus/icons-vue'
/** AI 聊天对话 列表 */
defineOptions({ name: 'AiChat' })

View File

@ -56,7 +56,7 @@
width="180"
:formatter="dateFormatter"
/>
<el-table-column label="操作" align="center">
<el-table-column label="操作" align="center" min-width="180">
<template #default="scope">
<el-button
link
@ -66,6 +66,15 @@
>
编辑
</el-button>
<el-button
link
type="primary"
v-if="scope.row.parentId > 0"
@click="handleViewSpu(scope.row.id)"
v-hasPermi="['product:spu:query']"
>
查看商品
</el-button>
<el-button
link
type="danger"
@ -142,6 +151,15 @@ const handleDelete = async (id: number) => {
} catch {}
}
/** 查看商品操作 */
const router = useRouter() //
const handleViewSpu = (id: number) => {
router.push({
name: 'ProductSpu',
query: { categoryId: id }
})
}
/** 初始化 **/
onMounted(() => {
getList()

View File

@ -244,6 +244,7 @@ import * as ProductCategoryApi from '@/api/mall/product/category'
defineOptions({ name: 'ProductSpu' })
const message = useMessage() //
const route = useRoute() //
const { t } = useI18n() //
const { push } = useRouter() //
@ -431,6 +432,11 @@ onActivated(() => {
/** 初始化 **/
onMounted(async () => {
// categoryId
if (route.query.categoryId) {
queryParams.value.categoryId = Number(route.query.categoryId)
}
//
await getTabsCount()
await getList()
//