fix: 编辑关联数据集删除全部数据表保存提示异常

This commit is contained in:
dataeaseShu 2023-06-06 15:59:46 +08:00
parent 3820a14229
commit f12ef0ce16
2 changed files with 4 additions and 1 deletions

View File

@ -41,7 +41,7 @@
>{{ $t('deDataset.selected') }} {{ tableNum }}
{{ ['excel'].includes(datasetType) ? $t('deDataset.table') : $t('deDataset.item') }}</span>
<deBtn
:disabled="['db', 'excel', 'api'].includes(datasetType) && !tableNum"
:disabled="['db', 'excel', 'api', 'union'].includes(datasetType) && !tableNum"
type="primary"
@click="datasetSave"
>{{

View File

@ -305,12 +305,14 @@ export default {
const ds = JSON.parse(JSON.stringify(this.unionItem))
ds.currentDs = this.tempDs
this.dataset.push(ds)
this.$emit('setTableNum', this.dataset.length)
this.closeSelectDs()
this.calc('union')
},
deleteNode(index) {
this.dataset.splice(index, 1)
this.calc('delete')
this.$emit('setTableNum', this.dataset.length)
},
calc(param) {
if (param.type === 'union') {
@ -385,6 +387,7 @@ export default {
(response) => {
const table = JSON.parse(JSON.stringify(response.data))
this.dataset = JSON.parse(table.info).union
this.$emit('setTableNum', this.dataset.length)
this.previewData()
}
)