fix bug grid not load when change menu tab
This commit is contained in:

parent
6583d68ea7
commit
c40352e37c
@ -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 =
|
||||
|
@ -2,10 +2,10 @@
|
||||
<div class="d-flex justify-center align-center"
|
||||
:class="directionBtn === 'vertically'?'flex-row':'flex-column'"
|
||||
style="gap: 12px">
|
||||
<a-button @click="btnActionsFnc('removeRightToLeft')" type="primary" ghost :icon="icons.remove" class="custom-action-btn">
|
||||
</a-button>
|
||||
<a-button @click="btnActionsFnc('addLeftToRight')" type="primary" ghost :icon="icons.add" class="custom-action-btn">
|
||||
</a-button>
|
||||
<a-button @click="btnActionsFnc('removeRightToLeft')" type="primary" ghost :icon="icons.remove" class="custom-action-btn">
|
||||
</a-button>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -49,7 +49,7 @@
|
||||
<v-col :cols="12" class="mt-5 pb-4">
|
||||
<v-card-title class="custom-title-6 pa-0">{{ viewActionData.title }}</v-card-title>
|
||||
</v-col>
|
||||
<v-col :cols="12" style="min-height: 30vh;" class="pa-0 custom-view">
|
||||
<v-col :cols="12" style="min-height: 50vh;" class="pa-0 custom-view">
|
||||
<v-card class="pa-3" style="overflow-y:auto;">
|
||||
<viewer v-if="viewActionData.viewerFlag" ref="tuiViewer" height="inherit"
|
||||
:initialValue="viewActionData.content" theme="white"
|
||||
|
Reference in New Issue
Block a user