|
|
|
@ -4,6 +4,7 @@ import ListItem from './ListItem.vue'
|
|
|
|
|
import { useWorkOrder } from '@/store/modules/workOrder'
|
|
|
|
|
import { reactive, ref, watch } from 'vue'
|
|
|
|
|
import { useInfiniteScroll } from '@vueuse/core'
|
|
|
|
|
import { isEmpty } from '@/utils'
|
|
|
|
|
|
|
|
|
|
const workStore = useWorkOrder()
|
|
|
|
|
const data = ref<PackageListItem[]>([])
|
|
|
|
@ -56,6 +57,9 @@ async function fetchList() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
watch(() => workStore.activeId, (newVal) => {
|
|
|
|
|
if (isEmpty(newVal))
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
activeId.value = newVal
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
@ -64,6 +68,8 @@ function reset() {
|
|
|
|
|
pagination.pageSize = 10
|
|
|
|
|
canloadMore.value = true
|
|
|
|
|
data.value.length = 0
|
|
|
|
|
|
|
|
|
|
workStore.reset()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function search(word: string) {
|
|
|
|
@ -84,17 +90,29 @@ defineExpose({
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<n-scrollbar>
|
|
|
|
|
<n-spin :show="isLoading">
|
|
|
|
|
<div ref="el">
|
|
|
|
|
<ListItem
|
|
|
|
|
v-for="(item, index) in data" :key="item.id" :selected="activeId === item.id" :list-item="item"
|
|
|
|
|
@click="selectHandler(item.id, index)"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</n-spin>
|
|
|
|
|
</n-scrollbar>
|
|
|
|
|
<n-spin :show="isLoading">
|
|
|
|
|
<div ref="el" class="list">
|
|
|
|
|
<ListItem
|
|
|
|
|
v-for="(item, index) in data" :key="item.id" :selected="activeId === item.id" :list-item="item"
|
|
|
|
|
@click="selectHandler(item.id, index)"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</n-spin>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
.list {
|
|
|
|
|
height: calc(100vh - 146px);
|
|
|
|
|
overflow-y: scroll;
|
|
|
|
|
overflow-x: hidden;
|
|
|
|
|
|
|
|
|
|
scrollbar-width: none;
|
|
|
|
|
/* firefox */
|
|
|
|
|
-ms-overflow-style: none;
|
|
|
|
|
/* IE 10+ */
|
|
|
|
|
|
|
|
|
|
&::-webkit-scrollbar {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|