optimize marketplace search to manual trigger and title-only query
This commit is contained in:
parent
a2d3094495
commit
026b2a5f50
@ -388,8 +388,8 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// 监听搜索和排序变化
|
// 监听排序变化(搜索改为手动触发)
|
||||||
watch([searchQuery, sortBy], () => {
|
watch([sortBy], () => {
|
||||||
page.value = 1 // 重置到第一页
|
page.value = 1 // 重置到第一页
|
||||||
loadAgents()
|
loadAgents()
|
||||||
}, { deep: true })
|
}, { deep: true })
|
||||||
|
|||||||
@ -417,8 +417,8 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// 监听搜索和排序变化
|
// 监听排序变化(搜索改为手动触发)
|
||||||
watch([searchQuery, sortBy], () => {
|
watch([sortBy], () => {
|
||||||
page.value = 1 // 重置到第一页
|
page.value = 1 // 重置到第一页
|
||||||
loadApps()
|
loadApps()
|
||||||
}, { deep: true })
|
}, { deep: true })
|
||||||
|
|||||||
@ -400,8 +400,8 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// 监听搜索和排序变化
|
// 监听排序变化(搜索改为手动触发)
|
||||||
watch([searchQuery, sortBy], () => {
|
watch([sortBy], () => {
|
||||||
page.value = 1 // 重置到第一页
|
page.value = 1 // 重置到第一页
|
||||||
loadNodes()
|
loadNodes()
|
||||||
}, { deep: true })
|
}, { deep: true })
|
||||||
|
|||||||
@ -155,7 +155,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, computed, watch } from 'vue'
|
import { ref, onMounted, computed, watch } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { NInput, NButton, NIcon, NSpin, NEmpty, NSelect, NPagination, useMessage, useDialog } from 'naive-ui'
|
import { NInput, NButton, NIcon, NSpin, NEmpty, NSelect, NPagination, useMessage } from 'naive-ui'
|
||||||
import { Icon } from '@iconify/vue'
|
import { Icon } from '@iconify/vue'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { t } from '@/shared/i18n'
|
import { t } from '@/shared/i18n'
|
||||||
@ -164,7 +164,6 @@ import { useToolsStore } from '@/shared/stores/tools'
|
|||||||
import InstallProgressModal from './InstallProgressModal.vue'
|
import InstallProgressModal from './InstallProgressModal.vue'
|
||||||
|
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
const dialog = useDialog()
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const toolsStore = useToolsStore()
|
const toolsStore = useToolsStore()
|
||||||
|
|
||||||
@ -419,8 +418,8 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// 监听搜索和排序变化
|
// 监听排序变化(搜索改为手动触发)
|
||||||
watch([searchQuery, sortBy], () => {
|
watch([sortBy], () => {
|
||||||
page.value = 1 // 重置到第一页
|
page.value = 1 // 重置到第一页
|
||||||
loadTools()
|
loadTools()
|
||||||
}, { deep: true })
|
}, { deep: true })
|
||||||
|
|||||||
@ -254,7 +254,6 @@ async def get_node_marketplace(
|
|||||||
filters = {"public": 1}
|
filters = {"public": 1}
|
||||||
if search:
|
if search:
|
||||||
filters["title"] = ["like", f"%{search}%"]
|
filters["title"] = ["like", f"%{search}%"]
|
||||||
filters["node_type"] = ["like", f"%{search}%"]
|
|
||||||
|
|
||||||
# 1. 先获取总数(不分页)
|
# 1. 先获取总数(不分页)
|
||||||
total_params = {
|
total_params = {
|
||||||
@ -797,7 +796,6 @@ async def get_agent_marketplace(
|
|||||||
# 构建过滤条件
|
# 构建过滤条件
|
||||||
filters = {"public": 1}
|
filters = {"public": 1}
|
||||||
if search:
|
if search:
|
||||||
filters["agent_name"] = ["like", f"%{search}%"]
|
|
||||||
filters["title"] = ["like", f"%{search}%"]
|
filters["title"] = ["like", f"%{search}%"]
|
||||||
|
|
||||||
# 1. 先获取总数(不分页)
|
# 1. 先获取总数(不分页)
|
||||||
|
|||||||
@ -55,9 +55,7 @@ async def get_tool_marketplace(
|
|||||||
# 构建过滤条件
|
# 构建过滤条件
|
||||||
filters = {"public": 1}
|
filters = {"public": 1}
|
||||||
if search:
|
if search:
|
||||||
filters["name"] = ["like", f"%{search}%"]
|
|
||||||
filters["title"] = ["like", f"%{search}%"]
|
filters["title"] = ["like", f"%{search}%"]
|
||||||
filters["description"] = ["like", f"%{search}%"]
|
|
||||||
|
|
||||||
# 1. 先获取总数(不分页)
|
# 1. 先获取总数(不分页)
|
||||||
total_params = {
|
total_params = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user