fix: implemented listview pagination in organization,contacts & call logs
This commit is contained in:
parent
bff51ea4c0
commit
49b9517df4
@ -62,6 +62,15 @@
|
|||||||
</ListRows>
|
</ListRows>
|
||||||
<ListSelectBanner />
|
<ListSelectBanner />
|
||||||
</ListView>
|
</ListView>
|
||||||
|
<ListFooter
|
||||||
|
class="border-t px-5 py-2"
|
||||||
|
v-model="pageLengthCount"
|
||||||
|
:options="{
|
||||||
|
rowCount: options.rowCount,
|
||||||
|
totalCount: options.totalCount,
|
||||||
|
}"
|
||||||
|
@loadMore="emit('loadMore')"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import {
|
||||||
@ -72,6 +81,7 @@ import {
|
|||||||
ListRow,
|
ListRow,
|
||||||
ListSelectBanner,
|
ListSelectBanner,
|
||||||
ListRowItem,
|
ListRowItem,
|
||||||
|
ListFooter,
|
||||||
} from 'frappe-ui'
|
} from 'frappe-ui'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -87,7 +97,13 @@ const props = defineProps({
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({
|
default: () => ({
|
||||||
selectable: true,
|
selectable: true,
|
||||||
|
totalCount: 0,
|
||||||
|
rowCount: 0,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits(['loadMore'])
|
||||||
|
|
||||||
|
const pageLengthCount = defineModel()
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -63,6 +63,15 @@
|
|||||||
</ListRows>
|
</ListRows>
|
||||||
<ListSelectBanner />
|
<ListSelectBanner />
|
||||||
</ListView>
|
</ListView>
|
||||||
|
<ListFooter
|
||||||
|
class="border-t px-5 py-2"
|
||||||
|
v-model="pageLengthCount"
|
||||||
|
:options="{
|
||||||
|
rowCount: options.rowCount,
|
||||||
|
totalCount: options.totalCount,
|
||||||
|
}"
|
||||||
|
@loadMore="emit('loadMore')"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
|
import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
|
||||||
@ -74,7 +83,7 @@ import {
|
|||||||
ListRow,
|
ListRow,
|
||||||
ListSelectBanner,
|
ListSelectBanner,
|
||||||
ListRowItem,
|
ListRowItem,
|
||||||
FormControl,
|
ListFooter,
|
||||||
} from 'frappe-ui'
|
} from 'frappe-ui'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -90,7 +99,13 @@ const props = defineProps({
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({
|
default: () => ({
|
||||||
selectable: true,
|
selectable: true,
|
||||||
|
totalCount: 0,
|
||||||
|
rowCount: 0,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits(['loadMore'])
|
||||||
|
|
||||||
|
const pageLengthCount = defineModel()
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -86,6 +86,15 @@
|
|||||||
</ListRows>
|
</ListRows>
|
||||||
<ListSelectBanner />
|
<ListSelectBanner />
|
||||||
</ListView>
|
</ListView>
|
||||||
|
<ListFooter
|
||||||
|
class="border-t px-5 py-2"
|
||||||
|
v-model="pageLengthCount"
|
||||||
|
:options="{
|
||||||
|
rowCount: options.rowCount,
|
||||||
|
totalCount: options.totalCount,
|
||||||
|
}"
|
||||||
|
@loadMore="emit('loadMore')"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@ -100,6 +109,7 @@ import {
|
|||||||
ListRow,
|
ListRow,
|
||||||
ListRowItem,
|
ListRowItem,
|
||||||
ListSelectBanner,
|
ListSelectBanner,
|
||||||
|
ListFooter,
|
||||||
} from 'frappe-ui'
|
} from 'frappe-ui'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -115,7 +125,13 @@ const props = defineProps({
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({
|
default: () => ({
|
||||||
selectable: true,
|
selectable: true,
|
||||||
|
totalCount: 0,
|
||||||
|
rowCount: 0,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits(['loadMore'])
|
||||||
|
|
||||||
|
const pageLengthCount = defineModel()
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -51,6 +51,15 @@
|
|||||||
</ListRows>
|
</ListRows>
|
||||||
<ListSelectBanner />
|
<ListSelectBanner />
|
||||||
</ListView>
|
</ListView>
|
||||||
|
<ListFooter
|
||||||
|
class="border-t px-5 py-2"
|
||||||
|
v-model="pageLengthCount"
|
||||||
|
:options="{
|
||||||
|
rowCount: options.rowCount,
|
||||||
|
totalCount: options.totalCount,
|
||||||
|
}"
|
||||||
|
@loadMore="emit('loadMore')"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import {
|
||||||
@ -61,6 +70,7 @@ import {
|
|||||||
ListRow,
|
ListRow,
|
||||||
ListSelectBanner,
|
ListSelectBanner,
|
||||||
ListRowItem,
|
ListRowItem,
|
||||||
|
ListFooter,
|
||||||
} from 'frappe-ui'
|
} from 'frappe-ui'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -76,7 +86,13 @@ const props = defineProps({
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({
|
default: () => ({
|
||||||
selectable: true,
|
selectable: true,
|
||||||
|
totalCount: 0,
|
||||||
|
rowCount: 0,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits(['loadMore'])
|
||||||
|
|
||||||
|
const pageLengthCount = defineModel()
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -4,11 +4,17 @@
|
|||||||
<Breadcrumbs :items="breadcrumbs" />
|
<Breadcrumbs :items="breadcrumbs" />
|
||||||
</template>
|
</template>
|
||||||
</LayoutHeader>
|
</LayoutHeader>
|
||||||
<ViewControls v-model="callLogs" doctype="CRM Call Log" />
|
<ViewControls v-model="callLogs" v-model:loadMore="loadMore" doctype="CRM Call Log" />
|
||||||
<CallLogsListView
|
<CallLogsListView
|
||||||
v-if="callLogs.data && rows.length"
|
v-if="callLogs.data && rows.length"
|
||||||
|
v-model="callLogs.data.page_length_count"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:columns="callLogs.data.columns"
|
:columns="callLogs.data.columns"
|
||||||
|
:options="{
|
||||||
|
rowCount: callLogs.data.row_count,
|
||||||
|
totalCount: callLogs.data.total_count,
|
||||||
|
}"
|
||||||
|
@loadMore="() => loadMore++"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
v-else-if="callLogs.data"
|
v-else-if="callLogs.data"
|
||||||
@ -44,7 +50,9 @@ const { getContact } = contactsStore()
|
|||||||
|
|
||||||
const breadcrumbs = [{ label: 'Call Logs', route: { name: 'Call Logs' } }]
|
const breadcrumbs = [{ label: 'Call Logs', route: { name: 'Call Logs' } }]
|
||||||
|
|
||||||
|
// callLogs data is loaded in the ViewControls component
|
||||||
const callLogs = ref({})
|
const callLogs = ref({})
|
||||||
|
const loadMore = ref(1)
|
||||||
|
|
||||||
const rows = computed(() => {
|
const rows = computed(() => {
|
||||||
if (!callLogs.value?.data?.data) return []
|
if (!callLogs.value?.data?.data) return []
|
||||||
|
|||||||
@ -9,11 +9,21 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</template>
|
</template>
|
||||||
</LayoutHeader>
|
</LayoutHeader>
|
||||||
<ViewControls v-model="contacts" doctype="Contact" />
|
<ViewControls
|
||||||
|
v-model="contacts"
|
||||||
|
v-model:loadMore="loadMore"
|
||||||
|
doctype="Contact"
|
||||||
|
/>
|
||||||
<ContactsListView
|
<ContactsListView
|
||||||
v-if="contacts.data && rows.length"
|
v-if="contacts.data && rows.length"
|
||||||
|
v-model="contacts.data.page_length_count"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:columns="contacts.data.columns"
|
:columns="contacts.data.columns"
|
||||||
|
:options="{
|
||||||
|
rowCount: contacts.data.row_count,
|
||||||
|
totalCount: contacts.data.total_count,
|
||||||
|
}"
|
||||||
|
@loadMore="() => loadMore++"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
v-else-if="contacts.data"
|
v-else-if="contacts.data"
|
||||||
@ -68,7 +78,9 @@ const breadcrumbs = computed(() => {
|
|||||||
return items
|
return items
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// contacts data is loaded in the ViewControls component
|
||||||
const contacts = ref({})
|
const contacts = ref({})
|
||||||
|
const loadMore = ref(1)
|
||||||
|
|
||||||
const rows = computed(() => {
|
const rows = computed(() => {
|
||||||
if (!contacts.value?.data?.data) return []
|
if (!contacts.value?.data?.data) return []
|
||||||
|
|||||||
@ -9,11 +9,21 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</template>
|
</template>
|
||||||
</LayoutHeader>
|
</LayoutHeader>
|
||||||
<ViewControls v-model="deals" doctype="CRM Deal" />
|
<ViewControls
|
||||||
|
v-model="deals"
|
||||||
|
v-model:loadMore="loadMore"
|
||||||
|
doctype="CRM Deal"
|
||||||
|
/>
|
||||||
<DealsListView
|
<DealsListView
|
||||||
v-if="deals.data && rows.length"
|
v-if="deals.data && rows.length"
|
||||||
|
v-model="deals.data.page_length_count"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:columns="deals.data.columns"
|
:columns="deals.data.columns"
|
||||||
|
:options="{
|
||||||
|
rowCount: deals.data.row_count,
|
||||||
|
totalCount: deals.data.total_count,
|
||||||
|
}"
|
||||||
|
@loadMore="() => loadMore++"
|
||||||
/>
|
/>
|
||||||
<div v-else-if="deals.data" class="flex h-full items-center justify-center">
|
<div v-else-if="deals.data" class="flex h-full items-center justify-center">
|
||||||
<div
|
<div
|
||||||
@ -75,6 +85,7 @@ const router = useRouter()
|
|||||||
|
|
||||||
// deals data is loaded in the ViewControls component
|
// deals data is loaded in the ViewControls component
|
||||||
const deals = ref({})
|
const deals = ref({})
|
||||||
|
const loadMore = ref(1)
|
||||||
|
|
||||||
// Rows
|
// Rows
|
||||||
const rows = computed(() => {
|
const rows = computed(() => {
|
||||||
|
|||||||
@ -13,11 +13,21 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</template>
|
</template>
|
||||||
</LayoutHeader>
|
</LayoutHeader>
|
||||||
<ViewControls v-model="organizations" doctype="CRM Organization" />
|
<ViewControls
|
||||||
|
v-model="organizations"
|
||||||
|
v-model:loadMore="loadMore"
|
||||||
|
doctype="CRM Organization"
|
||||||
|
/>
|
||||||
<OrganizationsListView
|
<OrganizationsListView
|
||||||
v-if="organizations.data && rows.length"
|
v-if="organizations.data && rows.length"
|
||||||
|
v-model="organizations.data.page_length_count"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:columns="organizations.data.columns"
|
:columns="organizations.data.columns"
|
||||||
|
:options="{
|
||||||
|
rowCount: organizations.data.row_count,
|
||||||
|
totalCount: organizations.data.total_count,
|
||||||
|
}"
|
||||||
|
@loadMore="() => loadMore++"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
v-else-if="organizations.data"
|
v-else-if="organizations.data"
|
||||||
@ -74,7 +84,9 @@ const breadcrumbs = computed(() => {
|
|||||||
return items
|
return items
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// organizations data is loaded in the ViewControls component
|
||||||
const organizations = ref({})
|
const organizations = ref({})
|
||||||
|
const loadMore = ref(1)
|
||||||
|
|
||||||
const rows = computed(() => {
|
const rows = computed(() => {
|
||||||
if (!organizations.value?.data?.data) return []
|
if (!organizations.value?.data?.data) return []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user