fix: 更新sql数据集数据参考中统计表和字段为0 数据集进入更新页面后回退定位 修复

This commit is contained in:
dataeaseShu 2022-09-26 16:36:06 +08:00
parent e40aba37a2
commit 25a113b69b
3 changed files with 25 additions and 14 deletions

View File

@ -122,7 +122,7 @@
<span class="no-select-datasource" v-if="!dataSource">{{
$t('deDataset.to_start_using')
}}</span>
<div v-else-if="dataSource && !dataTable" class="item-list">
<div v-loading="tableLoading" v-else-if="dataSource && !dataTable" class="item-list">
<div
@click="typeSwitch(ele)"
:key="ele.name"
@ -414,6 +414,7 @@ export default {
sqlHeight: 248,
fields: [],
mode: '0',
tableLoading: false,
syncType: 'sync_now',
height: 500,
kettleRunning: false,
@ -485,27 +486,21 @@ export default {
dataSourceDetail() {}
},
watch: {
'param.tableId': {
handler: function () {
this.initTableInfo()
}
},
sqlHeight: {
handler: function () {
this.calHeight()
}
}
},
mounted() {
async mounted() {
window.onresize = () => {
this.calHeight()
}
this.calHeight()
this.initDataSource()
await this.initDataSource()
this.$refs.myCm.codemirror.on('keypress', () => {
this.$refs.myCm.codemirror.showHint()
})
this.initTableInfo()
},
created() {
@ -562,8 +557,11 @@ export default {
}
}
}
this.tableLoading = true
post('/datasource/getTables/' + this.dataSource, {}).then((response) => {
this.tableData = response.data
}).finally(() => {
this.tableLoading = false
})
},
calHeight: _.debounce(function() {
@ -572,7 +570,7 @@ export default {
this.height = currentHeight - sqlHeight - 56 - 54 - 36 - 64
}, 200),
initDataSource() {
listDatasource().then((response) => {
return listDatasource().then((response) => {
this.options = response.data.filter((item) => item.type !== 'api')
})
},
@ -582,6 +580,7 @@ export default {
getTable(this.param.tableId).then((response) => {
const table = response.data
this.dataSource = table.dataSourceId
this.changeDatasource()
this.mode = table.mode + ''
if (JSON.parse(table.info).isBase64Encryption) {

View File

@ -419,7 +419,11 @@ export default {
type: Object,
required: false,
default: null
}
},
currentNodeId: {
type: String,
default: ''
},
},
data() {
return {
@ -542,11 +546,16 @@ export default {
queryAuthModel({ modelType: 'dataset' }, true)
.then((res) => {
localStorage.setItem('dataset-tree', JSON.stringify(res.data))
this.tData = res.data
this.tData = res.data || []
this.$nextTick(() => {
this.$refs.datasetTreeRef?.filter(this.filterText)
if (id && name.includes(this.filterText)) {
this.dfsTableData(this.tData, id)
} else {
const currentNodeId = sessionStorage.getItem('dataset-current-node')
if (currentNodeId) {
this.dfsTableData(this.tData, currentNodeId)
}
}
})
})
@ -555,6 +564,9 @@ export default {
})
this.refresh()
},
beforeDestroy() {
sessionStorage.setItem('dataset-current-node', this.currentNodeId)
},
methods: {
dfsTableData(arr, id) {
arr.some((ele) => {
@ -776,7 +788,7 @@ export default {
.then((res) => {
localStorage.setItem('dataset-tree', JSON.stringify(res.data))
if (!userCache) {
this.tData = res.data
this.tData = res.data || []
}
this.$nextTick(() => {
this.$refs.datasetTreeRef?.filter(this.filterText)

View File

@ -3,7 +3,7 @@
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
>
<de-aside-container type="dataset">
<group :save-status="saveStatus" @switchComponent="switchComponent" />
<group :currentNodeId="param.id" :save-status="saveStatus" @switchComponent="switchComponent" />
</de-aside-container>
<de-main-container>
<component