chore: renamed page_length to page_length_count everywhere
This commit is contained in:
parent
44722e6d21
commit
f19c92f91c
@ -60,7 +60,7 @@ def get_list_data(
|
||||
doctype: str,
|
||||
filters: dict,
|
||||
order_by: str,
|
||||
page_length=20,
|
||||
page_length_count=20,
|
||||
columns=None,
|
||||
rows=None,
|
||||
custom_view_name=None,
|
||||
@ -111,7 +111,7 @@ def get_list_data(
|
||||
fields=rows,
|
||||
filters=filters,
|
||||
order_by=order_by,
|
||||
page_length=page_length,
|
||||
page_length=page_length_count,
|
||||
) or []
|
||||
|
||||
fields = frappe.get_meta(doctype).fields
|
||||
@ -155,7 +155,7 @@ def get_list_data(
|
||||
"columns": columns,
|
||||
"rows": rows,
|
||||
"fields": fields,
|
||||
"page_length": page_length,
|
||||
"page_length_count": page_length_count,
|
||||
"is_default": is_default,
|
||||
"views": get_views(doctype),
|
||||
"total_count": frappe.client.get_count(doctype, filters=filters),
|
||||
|
||||
@ -97,7 +97,7 @@
|
||||
</ListView>
|
||||
<ListFooter
|
||||
class="border-t px-5 py-2"
|
||||
v-model="pageLength"
|
||||
v-model="pageLengthCount"
|
||||
:options="{
|
||||
rowCount: options.rowCount,
|
||||
totalCount: options.totalCount,
|
||||
@ -139,5 +139,5 @@ const props = defineProps({
|
||||
},
|
||||
})
|
||||
|
||||
const pageLength = defineModel()
|
||||
const pageLengthCount = defineModel()
|
||||
</script>
|
||||
|
||||
@ -124,10 +124,10 @@ const view = ref({
|
||||
pinned: false,
|
||||
})
|
||||
|
||||
const pageLength = computed(() => list.value?.data?.page_length)
|
||||
const pageLengthCount = computed(() => list.value?.data?.page_length_count)
|
||||
|
||||
watch(
|
||||
() => list.value?.data?.page_length,
|
||||
() => list.value?.data?.page_length_count,
|
||||
(value) => {
|
||||
if (!value) return
|
||||
updatePageLength(value)
|
||||
@ -173,7 +173,7 @@ function getParams() {
|
||||
order_by: order_by,
|
||||
columns: columns,
|
||||
rows: rows,
|
||||
page_length: pageLength.value,
|
||||
page_length_count: pageLengthCount.value,
|
||||
custom_view_name: _view?.name || '',
|
||||
default_filters: props.filters,
|
||||
}
|
||||
@ -190,7 +190,7 @@ list.value = createResource({
|
||||
doctype: props.doctype,
|
||||
filters: list.value.params.filters,
|
||||
order_by: list.value.params.order_by,
|
||||
page_length: list.value.params.page_length,
|
||||
page_length_count: list.value.params.page_length_count,
|
||||
columns: data.columns,
|
||||
rows: data.rows,
|
||||
custom_view_name: cv?.name || '',
|
||||
@ -299,12 +299,12 @@ function updateColumns(obj) {
|
||||
viewUpdated.value = true
|
||||
}
|
||||
|
||||
function updatePageLength(page_length) {
|
||||
function updatePageLength(value) {
|
||||
if (!defaultParams.value) {
|
||||
defaultParams.value = getParams()
|
||||
}
|
||||
list.value.params = defaultParams.value
|
||||
list.value.params.page_length = page_length
|
||||
list.value.params.page_length_count = value
|
||||
list.value.reload()
|
||||
}
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
/>
|
||||
<LeadsListView
|
||||
v-if="leads.data && rows.length"
|
||||
v-model="leads.data.page_length"
|
||||
v-model="leads.data.page_length_count"
|
||||
:rows="rows"
|
||||
:columns="leads.data.columns"
|
||||
:options="{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user