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