mirror of
				https://gitee.com/hhyykk/ipms-sjy-ui.git
				synced 2025-11-04 12:18:43 +08:00 
			
		
		
		
	【功能优化】MALL:商品分类界面,增加【查看商品】按钮
This commit is contained in:
		@@ -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' })
 | 
			
		||||
 
 | 
			
		||||
@@ -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()
 | 
			
		||||
 
 | 
			
		||||
@@ -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()
 | 
			
		||||
  // 获得分类树
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user