fix: 修复左侧tree重命名右侧更新不及时的问题

This commit is contained in:
junjie 2022-01-12 11:26:29 +08:00
parent 95186bd330
commit ee917eeab3
4 changed files with 19 additions and 14 deletions

View File

@ -16,6 +16,7 @@ const getters = {
errorLogs: state => state.errorLog.logs,
sceneData: state => state.dataset.sceneData,
table: state => state.dataset.table,
chartTable: state => state.chart.table,
hideCustomDs: state => state.dataset.hideCustomDs,
loadingMap: state => state.request.loadingMap,
currentPath: state => state.permission.currentPath,

View File

@ -558,7 +558,7 @@ export default {
showClose: true
})
this.treeNode()
this.$store.dispatch('chart/setTable', null)
this.$store.dispatch('chart/setTable', new Date().getTime())
})
} else {
// this.$message({

View File

@ -1,6 +1,7 @@
<template>
<el-row v-loading="loading" style="height: 100%;overflow-y: hidden;width: 100%;">
<el-row style="height: 40px;" class="padding-lr">
<span v-show="false">{{ refreshPage }}</span>
<span class="title-text" style="line-height: 40px;">{{ view.name }}</span>
<el-popover
placement="right-start"
@ -1105,11 +1106,10 @@ export default {
}
},
computed: {
// vId() {
// // console.log(this.$store.state.chart.viewId);
// this.getData(this.$store.state.chart.viewId)
// return this.$store.state.chart.viewId
// }
refreshPage: function() {
this.getChart(this.param.id)
return this.$store.getters.chartTable
},
chartType() {
return this.chart.type
}

View File

@ -1,6 +1,6 @@
<template>
<el-row style="height: 100%;overflow-y: hidden;width: 100%;">
<!-- <span v-show="false">{{ tableRefresh }}</span>-->
<span v-show="false">{{ refreshPage }}</span>
<el-row style="height: 26px;">
<span class="title-text" style="line-height: 26px;">
{{ table.name }}
@ -57,7 +57,7 @@
<update-info v-if="tabActive=='updateInfo'" :param="param" :table="table" />
</el-tab-pane>
<el-tab-pane v-if="isPluginLoaded && hasDataPermission('manage',param.privileges)" :lazy="true" :label="$t('dataset.row_permissions')" name="rowPermissions">
<plugin-com v-if="isPluginLoaded && tabActive=='rowPermissions'" ref="RowPermissions" component-name="RowPermissions" :obj="table"/>
<plugin-com v-if="isPluginLoaded && tabActive=='rowPermissions'" ref="RowPermissions" component-name="RowPermissions" :obj="table" />
</el-tab-pane>
</el-tabs>
</el-row>
@ -75,7 +75,7 @@ import PluginCom from '@/views/system/plugin/PluginCom'
export default {
name: 'ViewTable',
components: {FieldEdit, UnionView, DatasetChartDetail, UpdateInfo, TabDataPreview, PluginCom },
components: { FieldEdit, UnionView, DatasetChartDetail, UpdateInfo, TabDataPreview, PluginCom },
props: {
param: {
type: Object,
@ -102,14 +102,13 @@ export default {
isPluginLoaded: false
}
},
beforeCreate() {
pluginLoaded().then(res => {
this.isPluginLoaded = res.success && res.data
})
},
computed: {
hideCustomDs: function() {
return this.$store.getters.hideCustomDs
},
refreshPage: function() {
this.initTable(this.param.id)
return this.$store.getters.table
}
},
watch: {
@ -118,6 +117,11 @@ export default {
this.initTable(this.param.id)
}
},
beforeCreate() {
pluginLoaded().then(res => {
this.isPluginLoaded = res.success && res.data
})
},
created() {
},