|
|
|
@ -27,7 +27,7 @@ const emit = defineEmits<{
|
|
|
|
|
|
|
|
|
|
const data = ref<FilterEntity[]>([]);
|
|
|
|
|
const unData = ref<FilterEntity[]>([]);
|
|
|
|
|
let loading = false;
|
|
|
|
|
const loading = ref(false);
|
|
|
|
|
const canloadMore = true;
|
|
|
|
|
const el = ref<HTMLDivElement | null>(null);
|
|
|
|
|
const popover = ref<ComponentRef | null>(null);
|
|
|
|
@ -74,12 +74,12 @@ useInfiniteScroll(
|
|
|
|
|
},
|
|
|
|
|
{ distance: 10, interval: 300, canLoadMore: () => false }
|
|
|
|
|
);
|
|
|
|
|
const showClick = () => {
|
|
|
|
|
inputHandler("");
|
|
|
|
|
const showClick =async () => {
|
|
|
|
|
getSearchedList('')
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
async function loadMore() {
|
|
|
|
|
if (loading || el.value == null) return;
|
|
|
|
|
if (loading.value || el.value == null) return;
|
|
|
|
|
|
|
|
|
|
const more = await featchList();
|
|
|
|
|
|
|
|
|
@ -89,7 +89,7 @@ async function loadMore() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function featchList() {
|
|
|
|
|
loading = true;
|
|
|
|
|
loading.value = true;
|
|
|
|
|
try {
|
|
|
|
|
const searchParam: FilterSearchParam = {
|
|
|
|
|
search_searchname: { value: keyword.value, op: "like", type: "string" },
|
|
|
|
@ -103,7 +103,7 @@ async function featchList() {
|
|
|
|
|
} catch (error) {
|
|
|
|
|
return [];
|
|
|
|
|
} finally {
|
|
|
|
|
loading = false;
|
|
|
|
|
loading.value = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -148,6 +148,10 @@ function selectHandler(item: FilterEntity) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const inputHandler = debounce((word) => {
|
|
|
|
|
getSearchedList(word)
|
|
|
|
|
}, 300);
|
|
|
|
|
|
|
|
|
|
function getSearchedList(word) {
|
|
|
|
|
if (word) {
|
|
|
|
|
pagination.pageSize = 300;
|
|
|
|
|
} else {
|
|
|
|
@ -172,7 +176,7 @@ const inputHandler = debounce((word) => {
|
|
|
|
|
(a, b) => Number((a as any).reorder) - Number((b as any).reorder)
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}, 300);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function favoriteHandler(event: MouseEvent, item: any) {
|
|
|
|
|
event.stopImmediatePropagation();
|
|
|
|
|