Merge pull request #3174 from dataease/pr@dev_dataset_source

Pr@dev dataset source
This commit is contained in:
xuwei-fit2cloud 2022-09-26 10:24:30 +08:00 committed by GitHub
commit bbcd9635b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 39 deletions

View File

@ -1,26 +1,6 @@
<template>
<el-col>
<div class="table-count">
<span v-if="['excel', 'custom', 'union'].includes(table.type)">
<span v-if="page.total <= currentPage.show">
{{ $t('dataset.preview_total') }}
<span class="span-number">{{ page.total }}</span>
{{ $t('dataset.preview_item') }}
</span>
<span v-if="page.total > currentPage.show">
{{ $t('dataset.preview_show') }}
<span class="span-number">{{ currentPage.show }}</span>
{{ $t('dataset.preview_item') }}
{{ $t('dataset.preview_total') }}
<span class="span-number">{{ page.total }}</span>
{{ $t('dataset.preview_item') }}
</span>
</span>
<span v-if="['db', 'sql'].includes(table.type)">
{{ $t('dataset.preview_show') }}
<span class="span-number">{{ page.total }}</span>
{{ $t('dataset.preview_item') }}
</span>
<span class="title-text" style="width: 100px"
>{{ $t('deDataset.display') }} {{ form.row }}
{{ $t('deDataset.row') }}</span
@ -197,7 +177,7 @@ export default {
line-height: 22px;
margin: 4px 0;
.title-text {
margin: 0 5px 0 16px;
margin: 0 5px 0 0;
}
}
</style>

View File

@ -69,7 +69,7 @@
</el-row>
<el-col class="custom-tree-container de-tree">
<div class="block">
<div v-if="!tData.length" class="no-tdata">
<div v-if="!tData.length && !treeLoading" class="no-tdata">
{{ $t('deDataset.no_dataset_click') }}
<span @click="() => clickAdd()" class="no-tdata-new">{{
$t('deDataset.create')
@ -424,6 +424,7 @@ export default {
data() {
return {
sceneMode: false,
treeLoading: false,
dialogTitle: '',
search: '',
editGroup: false,
@ -537,16 +538,21 @@ export default {
},
mounted() {
const { id, name } = this.$route.params
queryAuthModel({ modelType: 'dataset' }, true).then((res) => {
localStorage.setItem('dataset-tree', JSON.stringify(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)
}
this.treeLoading = true
queryAuthModel({ modelType: 'dataset' }, true)
.then((res) => {
localStorage.setItem('dataset-tree', JSON.stringify(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)
}
})
})
.finally(() => {
this.treeLoading = false
})
})
this.refresh()
},
methods: {
@ -765,15 +771,20 @@ export default {
if (userCache) {
this.tData = JSON.parse(modelInfo)
}
queryAuthModel({ modelType: 'dataset' }, !userCache).then((res) => {
localStorage.setItem('dataset-tree', JSON.stringify(res.data))
if (!userCache) {
this.tData = res.data
}
this.$nextTick(() => {
this.$refs.datasetTreeRef?.filter(this.filterText)
this.treeLoading = true
queryAuthModel({ modelType: 'dataset' }, !userCache)
.then((res) => {
localStorage.setItem('dataset-tree', JSON.stringify(res.data))
if (!userCache) {
this.tData = res.data
}
this.$nextTick(() => {
this.$refs.datasetTreeRef?.filter(this.filterText)
})
})
.finally(() => {
this.treeLoading = false
})
})
},
tableTree() {