mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 15:36:49 +08:00
feat 添加历史记录搜索提示
This commit is contained in:
@@ -40,6 +40,9 @@ const dataList = ref<TransferHistory[]>([])
|
|||||||
// 搜索
|
// 搜索
|
||||||
const search = ref('')
|
const search = ref('')
|
||||||
|
|
||||||
|
// 搜索提示词列表
|
||||||
|
const searchHintList = ref<string[]>([])
|
||||||
|
|
||||||
// 加载状态
|
// 加载状态
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
@@ -89,6 +92,7 @@ async function fetchData({
|
|||||||
|
|
||||||
dataList.value = result.data.list
|
dataList.value = result.data.list
|
||||||
totalItems.value = result.data.total
|
totalItems.value = result.data.total
|
||||||
|
searchHintList.value = [...new Set(dataList.value.map(item => item.title || ''))].filter(title => title !== '')
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
@@ -262,9 +266,10 @@ const dropdownItems = ref([
|
|||||||
<VRow>
|
<VRow>
|
||||||
<VCol> 历史记录 </VCol>
|
<VCol> 历史记录 </VCol>
|
||||||
<VCol>
|
<VCol>
|
||||||
<VTextField
|
<VCombobox
|
||||||
key="search_navbar"
|
key="search_navbar"
|
||||||
v-model="search"
|
v-model="search"
|
||||||
|
:items="searchHintList"
|
||||||
class="text-disabled"
|
class="text-disabled"
|
||||||
density="compact"
|
density="compact"
|
||||||
label="搜索"
|
label="搜索"
|
||||||
@@ -274,6 +279,7 @@ const dropdownItems = ref([
|
|||||||
hide-details
|
hide-details
|
||||||
flat
|
flat
|
||||||
rounded
|
rounded
|
||||||
|
clearable
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
|
|||||||
Reference in New Issue
Block a user