mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-26 09:20:18 +08:00
feat: 更新搜索逻辑
现在更换app类别时将默认清空搜索。
This commit is contained in:
21
README.md
21
README.md
@@ -16,25 +16,6 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## TODO
|
|
||||||
|
|
||||||
- [ ] 完善项目文档
|
|
||||||
- [x] 可以展示应用列表及其详细信息
|
|
||||||
- [ ] 实现应用下载&下载列表管理
|
|
||||||
- [x] 实现应用安装&重试安装
|
|
||||||
- [x] 实现应用卸载
|
|
||||||
- [x] 实现应用更新
|
|
||||||
- [x] 显示本地已安装app
|
|
||||||
- [x] 支持显示本地是否已经安装
|
|
||||||
- [x] 本地应用列表区分依赖和用户安装的包(或者干脆不显示依赖包)
|
|
||||||
- [x] 安装/卸载时UI提示(重要)
|
|
||||||
- [x] 实现应用搜索
|
|
||||||
- [ ] 切换分类时默认不应用搜索,需按下回车键才应用搜索
|
|
||||||
- [x] 修改UI,使其更美观(考虑换成如tailwindcss等库)
|
|
||||||
- [x] 实现URL Shceme协议支持
|
|
||||||
- [ ] 动画性能问题
|
|
||||||
|
|
||||||
|
|
||||||
## 📦 关于 APM
|
## 📦 关于 APM
|
||||||
|
|
||||||
**APM (AmberPM)** 是基于 `fuse-overlayfs` + `dpkg` + `AmberCE` 的容器化兼容层,为多发行版提供轻量级的应用运行方案。
|
**APM (AmberPM)** 是基于 `fuse-overlayfs` + `dpkg` + `AmberCE` 的容器化兼容层,为多发行版提供轻量级的应用运行方案。
|
||||||
@@ -190,7 +171,7 @@ apm-app-store/
|
|||||||
|
|
||||||
## 📄 开源协议
|
## 📄 开源协议
|
||||||
|
|
||||||
本项目采用 [MulanPSL-2.0](LICENSE) 协议开源。
|
本项目采用 [MulanPSL-2.0](LICENSE.md) 协议开源。
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
<main class="flex-1 px-4 py-6 lg:px-10">
|
<main class="flex-1 px-4 py-6 lg:px-10">
|
||||||
<AppHeader
|
<AppHeader
|
||||||
:search-query="searchQuery"
|
:search-query="searchQuery"
|
||||||
|
:active-category="activeCategory"
|
||||||
:apps-count="filteredApps.length"
|
:apps-count="filteredApps.length"
|
||||||
@update-search="handleSearchInput"
|
@update-search="handleSearchInput"
|
||||||
@update="handleUpdate"
|
@update="handleUpdate"
|
||||||
@@ -233,6 +234,7 @@ const toggleTheme = () => {
|
|||||||
|
|
||||||
const selectCategory = (category: string) => {
|
const selectCategory = (category: string) => {
|
||||||
activeCategory.value = category;
|
activeCategory.value = category;
|
||||||
|
searchQuery.value = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
const openDetail = (app: App) => {
|
const openDetail = (app: App) => {
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
id="searchBox"
|
id="searchBox"
|
||||||
v-model="localSearchQuery"
|
v-model="localSearchQuery"
|
||||||
class="w-full rounded-2xl border border-slate-200/70 bg-white/80 py-3 pl-12 pr-4 text-sm text-slate-700 shadow-sm outline-none transition placeholder:text-slate-400 focus:border-brand/50 focus:ring-4 focus:ring-brand/10 dark:border-slate-800/70 dark:bg-slate-900/60 dark:text-slate-200"
|
class="w-full rounded-2xl border border-slate-200/70 bg-white/80 py-3 pl-12 pr-4 text-sm text-slate-700 shadow-sm outline-none transition placeholder:text-slate-400 focus:border-brand/50 focus:ring-4 focus:ring-brand/10 dark:border-slate-800/70 dark:bg-slate-900/60 dark:text-slate-200"
|
||||||
placeholder="搜索应用名 / 包名 / 标签"
|
placeholder="搜索应用名 / 包名 / 标签,按回车键搜索"
|
||||||
@input="debounceSearch"
|
@keydown.enter="handleSearch"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -30,6 +30,7 @@ import TopActions from "./TopActions.vue";
|
|||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
searchQuery: string;
|
searchQuery: string;
|
||||||
|
activeCategory: string;
|
||||||
appsCount: number;
|
appsCount: number;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
@@ -40,13 +41,9 @@ const emit = defineEmits<{
|
|||||||
}>();
|
}>();
|
||||||
|
|
||||||
const localSearchQuery = ref(props.searchQuery || "");
|
const localSearchQuery = ref(props.searchQuery || "");
|
||||||
const timeoutId = ref<ReturnType<typeof setTimeout> | null>(null);
|
|
||||||
|
|
||||||
const debounceSearch = () => {
|
const handleSearch = () => {
|
||||||
if (timeoutId.value) clearTimeout(timeoutId.value);
|
emit("update-search", localSearchQuery.value);
|
||||||
timeoutId.value = setTimeout(() => {
|
|
||||||
emit("update-search", localSearchQuery.value);
|
|
||||||
}, 220);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
@@ -55,4 +52,11 @@ watch(
|
|||||||
localSearchQuery.value = newVal || "";
|
localSearchQuery.value = newVal || "";
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.activeCategory,
|
||||||
|
() => {
|
||||||
|
localSearchQuery.value = "";
|
||||||
|
},
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -159,10 +159,9 @@ const onProgress = (_event: any, chunk: string) => {
|
|||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
};
|
};
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
const onComplete = (
|
const onComplete = (
|
||||||
_event: any,
|
_event: unknown,
|
||||||
result: { success: boolean; message: any },
|
result: { success: boolean; message: unknown },
|
||||||
) => {
|
) => {
|
||||||
if (!uninstalling.value) return; // Ignore if not current session
|
if (!uninstalling.value) return; // Ignore if not current session
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user