From a3da5a57732c22c3d40f15ce387fb91abd23fe19 Mon Sep 17 00:00:00 2001 From: Metal Monkey Date: Tue, 24 Dec 2024 11:12:22 +0400 Subject: [PATCH] Render speed improvements modified: frontend/src/components/ListViews/LeadsListView.vue modified: frontend/src/components/ListViews/ListRows.vue modified: frontend/src/components/Modals/SidePanelModal.vue --- .../components/ListViews/LeadsListView.vue | 8 ++--- .../src/components/ListViews/ListRows.vue | 33 ++++++++++--------- .../src/components/Modals/SidePanelModal.vue | 23 ++++++++----- 3 files changed, 36 insertions(+), 28 deletions(-) diff --git a/frontend/src/components/ListViews/LeadsListView.vue b/frontend/src/components/ListViews/LeadsListView.vue index 7e26257d1..97ae4decb 100644 --- a/frontend/src/components/ListViews/LeadsListView.vue +++ b/frontend/src/components/ListViews/LeadsListView.vue @@ -17,7 +17,6 @@ > - +
- + diff --git a/frontend/src/components/Modals/SidePanelModal.vue b/frontend/src/components/Modals/SidePanelModal.vue index 09dcb7f4a..882a0f495 100644 --- a/frontend/src/components/Modals/SidePanelModal.vue +++ b/frontend/src/components/Modals/SidePanelModal.vue @@ -104,20 +104,27 @@ const dirty = ref(false) const preview = ref(false) const data = ref({}) -function getParams() { - return { doctype: _doctype.value, type: 'Side Panel' } -} - const tabs = createResource({ url: 'crm.fcrm.doctype.crm_fields_layout.crm_fields_layout.get_fields_layout', cache: ['SidePanel', _doctype.value], - params: getParams(), - auto: false, + params: { doctype: _doctype.value, type: 'Side Panel' }, + auto: true, onSuccess(data) { tabs.originalData = JSON.parse(JSON.stringify(data)) }, }) +watch( + () => _doctype.value, + () => { + if (_doctype.value) { + tabs.params = { doctype: _doctype.value, type: 'Side Panel' } + tabs.reload() + } + }, + { immediate: true } +) + watch( () => tabs?.data, () => { @@ -127,11 +134,9 @@ watch( { deep: true }, ) -onMounted(() => useDebounceFn(reload, 100)()) - function reload() { nextTick(() => { - tabs.params = getParams() + tabs.params = { doctype: _doctype.value, type: 'Side Panel' } tabs.reload() }) }