forked from github/dataease
Merge pull request #3174 from dataease/pr@dev_dataset_source
Pr@dev dataset source
This commit is contained in:
commit
bbcd9635b5
@ -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>
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user