|
@@ -149,7 +149,6 @@
|
|
import { ref, computed } from 'vue'
|
|
import { ref, computed } from 'vue'
|
|
import useAppStore from '@/stores/app.js'
|
|
import useAppStore from '@/stores/app.js'
|
|
import { getFillNums } from '@/utils'
|
|
import { getFillNums } from '@/utils'
|
|
-// import { hotToolsList } from './mock'
|
|
|
|
import { listTools, setCommonTool, getCommonTool } from '@/api/index.js'
|
|
import { listTools, setCommonTool, getCommonTool } from '@/api/index.js'
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
|
|
|
@@ -165,7 +164,7 @@ const device = computed(() => {
|
|
// 搜索内容
|
|
// 搜索内容
|
|
const searchValueRef = ref('')
|
|
const searchValueRef = ref('')
|
|
const pageNum = ref(1)
|
|
const pageNum = ref(1)
|
|
-const pageSize = ref(20)
|
|
|
|
|
|
+const pageSize = ref(2)
|
|
// 热门工具列表
|
|
// 热门工具列表
|
|
const hotToolsRef = ref([])
|
|
const hotToolsRef = ref([])
|
|
|
|
|
|
@@ -230,14 +229,11 @@ const init = () => {
|
|
}
|
|
}
|
|
init()
|
|
init()
|
|
|
|
|
|
-const resetList = () => {
|
|
|
|
- toolsListRef.value = []
|
|
|
|
- noneCardNum.value = 0
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
// 搜索
|
|
// 搜索
|
|
-const handleSearch = () => {
|
|
|
|
- onLoad()
|
|
|
|
|
|
+const handleSearch = (pId) => {
|
|
|
|
+ toolsListRef.value = []
|
|
|
|
+ pageNum.value = 1
|
|
|
|
+ onLoad(pId)
|
|
// 每次搜索时存一下搜索内容的次数,方便后台统计常用工具
|
|
// 每次搜索时存一下搜索内容的次数,方便后台统计常用工具
|
|
searchValueRef.value && setCommonTool({ toolName: searchValueRef.value })
|
|
searchValueRef.value && setCommonTool({ toolName: searchValueRef.value })
|
|
}
|
|
}
|
|
@@ -249,7 +245,7 @@ const handleKeySearch = (toolName) => {
|
|
|
|
|
|
// 点击一级菜单
|
|
// 点击一级菜单
|
|
const handleChangeDropdownOfType1 = (value) => {
|
|
const handleChangeDropdownOfType1 = (value) => {
|
|
- resetList()
|
|
|
|
|
|
+ // resetList()
|
|
type1ValueRef.value = value
|
|
type1ValueRef.value = value
|
|
listTools({
|
|
listTools({
|
|
level: '2',
|
|
level: '2',
|
|
@@ -258,13 +254,14 @@ const handleChangeDropdownOfType1 = (value) => {
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
typeOptions2Ref.value = res.rows
|
|
typeOptions2Ref.value = res.rows
|
|
})
|
|
})
|
|
- onLoad(value)
|
|
|
|
|
|
+
|
|
|
|
+ handleSearch(value)
|
|
type2ValueRef.value = ''
|
|
type2ValueRef.value = ''
|
|
}
|
|
}
|
|
// 点击二级菜单
|
|
// 点击二级菜单
|
|
const handleChangeDropdownOfType2 = (value) => {
|
|
const handleChangeDropdownOfType2 = (value) => {
|
|
- resetList()
|
|
|
|
- onLoad(value)
|
|
|
|
|
|
+ // resetList()
|
|
|
|
+ handleSearch(value)
|
|
type2ValueRef.value = value
|
|
type2ValueRef.value = value
|
|
}
|
|
}
|
|
|
|
|