From c40352e37cfccac54e63b4054076d754aec8b0f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pham=20Hoang=20Manh/=28Pham=20Hoang=20Manh=29/=ED=98=84?= =?UTF-8?q?=EC=9E=A5=EB=8C=80=EB=A6=AC=EC=9D=B8/SK?= <20074606@skcc.com> Date: Mon, 11 Aug 2025 15:12:01 +0900 Subject: [PATCH 1/2] fix bug grid not load when change menu tab --- components/common/Grid.vue | 74 +++++++++++----------- components/common/button/ActionButtons.vue | 4 +- pages/comm/base/NoticeMngPage.vue | 2 +- 3 files changed, 41 insertions(+), 39 deletions(-) diff --git a/components/common/Grid.vue b/components/common/Grid.vue index b0765a0..7e42752 100644 --- a/components/common/Grid.vue +++ b/components/common/Grid.vue @@ -158,7 +158,7 @@ export default { }, 500); }, }, - created() {}, + created() { }, async mounted() { // console.log(this.dataPath); if (this.gridName) { @@ -166,9 +166,9 @@ export default { this.scrollBody = document .getElementsByClassName('tui-grid-rside-area') - [ - document.getElementsByClassName('tui-grid-rside-area').length - 1 - ].getElementsByClassName('tui-grid-body-area')[0]; + [ + document.getElementsByClassName('tui-grid-rside-area').length - 1 + ].getElementsByClassName('tui-grid-body-area')[0]; this.scrollBody.addEventListener('scroll', e => { this.gridScrollTop = e.target.scrollTop; @@ -344,14 +344,14 @@ export default { 'row-removed', ); } - + await this.gridInstance.invoke( e.rowEditingFg != undefined ? 'setValue' : this.editorGrid ? 'finishEditing' : 'setValue', rowIdxKey, columnName, value, ); - + if (isBaseRow) { const isSameData = await this.compareData(editingData); @@ -606,18 +606,20 @@ export default { list.map(item => this.gridInstance.invoke('check', item)); }, refreshLayout() { - // console.log("---------DEBUG---refreshLayout: "); - this.gridInstance.invoke('refreshLayout'); + setTimeout(() => { + this.gridInstance.invoke('refreshLayout'); + }, 150); + // this.gridInstance.invoke('refreshLayout'); }, - refreshGrid(){ + refreshGrid() { // console.log("refreshLayout",this.$refs['tuigrid' + this.gridName]) - var store = this.$refs['tuigrid' + this.gridName].gridInstance.store; - var containerEl = this.$refs['tuigrid' + this.gridName].$el; - // var containerEl = document.querySelector('.tui-grid-container') - var parentEl = containerEl.parentElement; + var store = this.$refs['tuigrid' + this.gridName].gridInstance.store; + var containerEl = this.$refs['tuigrid' + this.gridName].$el; + // var containerEl = document.querySelector('.tui-grid-container') + var parentEl = containerEl.parentElement; // console.log("---------DEBUG---containerEl: ",containerEl); - // console.log('---------DEBUG---parentEl: ', parentEl) + // console.log('---------DEBUG---parentEl: ', parentEl) // function refreshLayout(store, containerEl, parentEl) { var dimension = store.dimension; var autoWidth = dimension.autoWidth, fitToParentHeight = dimension.fitToParentHeight; @@ -636,35 +638,35 @@ export default { // console.log("parentEl.clientHeight" , parentEl.clientHeight) // console.log("clientHeight : ",clientHeight); if (parentEl && parentEl.clientHeight !== clientHeight) { - var _b = getComputedStyle(parentEl), paddingTop = _b.paddingTop, paddingBottom = _b.paddingBottom; - this.setHeight(store, parentEl.clientHeight - (parseFloat(paddingTop) + parseFloat(paddingBottom))); + var _b = getComputedStyle(parentEl), paddingTop = _b.paddingTop, paddingBottom = _b.paddingBottom; + this.setHeight(store, parentEl.clientHeight - (parseFloat(paddingTop) + parseFloat(paddingBottom))); } - // } + // } }, - setOffsetTop(store, offsetTop) { + setOffsetTop(store, offsetTop) { // console.log("---------DEBUG---setOffsetTop: "); - store.dimension.offsetTop = offsetTop; - }, - setWidth(_a, width, autoWidth) { + store.dimension.offsetTop = offsetTop; + }, + setWidth(_a, width, autoWidth) { // console.log("---------DEBUG---setWidth: "); - var dimension = _a.dimension; - dimension.autoWidth = autoWidth; - dimension.width = width; - }, - setHeaderHeight(store, height) { + var dimension = _a.dimension; + dimension.autoWidth = autoWidth; + dimension.width = width; + }, + setHeaderHeight(store, height) { // console.log("---------DEBUG---setHeaderHeight: "); - store.dimension.headerHeight = height; - }, - setOffsetLeft(store, offsetLeft) { + store.dimension.headerHeight = height; + }, + setOffsetLeft(store, offsetLeft) { // console.log("---------DEBUG---setOffsetLeft: "); - store.dimension.offsetLeft = offsetLeft; - }, - setHeight(_a,height){ + store.dimension.offsetLeft = offsetLeft; + }, + setHeight(_a, height) { // console.log("---------DEBUG---setHeight: "); - var dimension = _a.dimension; - var headerHeight = dimension.headerHeight, summaryHeight = dimension.summaryHeight, tableBorderWidth = dimension.tableBorderWidth; - dimension.bodyHeight = height - headerHeight - summaryHeight - tableBorderWidth; - }, + var dimension = _a.dimension; + var headerHeight = dimension.headerHeight, summaryHeight = dimension.summaryHeight, tableBorderWidth = dimension.tableBorderWidth; + dimension.bodyHeight = height - headerHeight - summaryHeight - tableBorderWidth; + }, sendSelectedRowData(eventRowKey) { if (this.selectedRowDataWatchFlag) { var rowKey = diff --git a/components/common/button/ActionButtons.vue b/components/common/button/ActionButtons.vue index ecf39ce..e8848a0 100644 --- a/components/common/button/ActionButtons.vue +++ b/components/common/button/ActionButtons.vue @@ -2,10 +2,10 @@
- - + +