Kaynağa Gözat

fix:常用工具最多显示10个

mnisting 5 ay önce
ebeveyn
işleme
692760397f
1 değiştirilmiş dosya ile 5 ekleme ve 4 silme
  1. 5 4
      src/views/HomeView.vue

+ 5 - 4
src/views/HomeView.vue

@@ -224,15 +224,16 @@ const init = () => {
   onLoad(route.query.id)
   // 常用工具列表
   getCommonTool().then((res) => {
-    hotToolsRef.value = res.data.data
+    hotToolsRef.value = res.data.data.length > 10 ? res.data.data.slice(0, 10) : res.data.data
   })
 }
 init()
 
 // 搜索
-const handleSearch = (pId) => {
+const handleSearch = (val, pId = '') => {
   toolsListRef.value = []
   pageNum.value = 1
+  console.log(pId)
   onLoad(pId)
   // 每次搜索时存一下搜索内容的次数,方便后台统计常用工具
   searchValueRef.value && setCommonTool({ toolName: searchValueRef.value })
@@ -255,13 +256,13 @@ const handleChangeDropdownOfType1 = (value) => {
     typeOptions2Ref.value = res.rows
   })
 
-  handleSearch(value)
+  handleSearch('', value)
   type2ValueRef.value = ''
 }
 // 点击二级菜单
 const handleChangeDropdownOfType2 = (value) => {
   // resetList()
-  handleSearch(value)
+  handleSearch('', value)
   type2ValueRef.value = value
 }