From 4cb7e984aa01984039717bbb8495780321ef6fd9 Mon Sep 17 00:00:00 2001 From: samunohito <46447427+samunohito@users.noreply.github.com> Date: Sun, 4 Feb 2024 09:24:10 +0900 Subject: [PATCH] fix performance --- packages/backend/src/postgres.ts | 2 +- .../src/components/grid/MkDataCell.vue | 7 +- .../src/components/grid/MkDataRow.vue | 2 +- .../frontend/src/components/grid/MkGrid.vue | 89 ++++++++++--------- .../src/components/grid/grid-event.ts | 2 +- .../pages/admin/custom-emojis-grid.list.vue | 17 +++- .../src/pages/admin/custom-emojis-grid.vue | 10 ++- 7 files changed, 73 insertions(+), 56 deletions(-) diff --git a/packages/backend/src/postgres.ts b/packages/backend/src/postgres.ts index 543cedc867..6f3676ccb3 100644 --- a/packages/backend/src/postgres.ts +++ b/packages/backend/src/postgres.ts @@ -97,7 +97,7 @@ class MyCustomLogger implements Logger { @bindThis public logQuery(query: string, parameters?: any[]) { - sqlLogger.info(this.highlight(query).substring(0, 100)); + sqlLogger.info(this.highlight(query)); } @bindThis diff --git a/packages/frontend/src/components/grid/MkDataCell.vue b/packages/frontend/src/components/grid/MkDataCell.vue index 47c40b3582..40fa2b4812 100644 --- a/packages/frontend/src/components/grid/MkDataCell.vue +++ b/packages/frontend/src/components/grid/MkDataCell.vue @@ -53,7 +53,6 @@ import { computed, defineAsyncComponent, - getCurrentInstance, nextTick, onMounted, onUnmounted, @@ -101,7 +100,7 @@ const needsContentCentering = computed(() => { } }); -watch(() => [cell, cell.value.value], () => { +watch(() => [cell.value.value], () => { // 中身がセットされた直後はサイズが分からないので、次のタイミングで更新する nextTick(emitContentSizeChanged); }, { immediate: true }); @@ -112,10 +111,6 @@ watch(() => cell.value.selected, () => { } }); -watch(() => cell.value.value, (newValue) => { - emitValueChange(newValue); -}); - function onCellDoubleClick(ev: MouseEvent) { switch (ev.type) { case 'dblclick': { diff --git a/packages/frontend/src/components/grid/MkDataRow.vue b/packages/frontend/src/components/grid/MkDataRow.vue index 295427a67a..d470fa9965 100644 --- a/packages/frontend/src/components/grid/MkDataRow.vue +++ b/packages/frontend/src/components/grid/MkDataRow.vue @@ -20,7 +20,7 @@