提交 2adbd392 authored 作者: junjie's avatar junjie

feat(数据集):关联视图 优化

上级 aec257ef
...@@ -85,12 +85,13 @@ ...@@ -85,12 +85,13 @@
<el-col :span="6"> <el-col :span="6">
<el-popover <el-popover
ref="targetTable"
placement="bottom" placement="bottom"
width="400" width="500"
trigger="hover" trigger="click"
> >
<dataset-group-selector @getTable="getTable" /> <dataset-group-selector @getTable="getTable" />
<el-button slot="reference" size="mini">{{ $t('dataset.pls_slc_union_table') }}</el-button> <el-button slot="reference" size="mini">{{ targetTable.name || $t('dataset.pls_slc_union_table') }}</el-button>
</el-popover> </el-popover>
<el-select v-model="union.targetTableFieldId" :placeholder="$t('dataset.pls_slc_union_field')" filterable clearable size="mini"> <el-select v-model="union.targetTableFieldId" :placeholder="$t('dataset.pls_slc_union_field')" filterable clearable size="mini">
...@@ -154,7 +155,8 @@ export default { ...@@ -154,7 +155,8 @@ export default {
unionData: [], unionData: [],
editUnion: false, editUnion: false,
sourceFieldOption: [], sourceFieldOption: [],
targetFieldOption: [] targetFieldOption: [],
targetTable: {}
} }
}, },
watch: { watch: {
...@@ -174,6 +176,7 @@ export default { ...@@ -174,6 +176,7 @@ export default {
}, },
showUnionEdit() { showUnionEdit() {
this.union.sourceTableId = this.table.id
fieldList(this.table.id).then(response => { fieldList(this.table.id).then(response => {
this.sourceFieldOption = response.data this.sourceFieldOption = response.data
}) })
...@@ -218,6 +221,7 @@ export default { ...@@ -218,6 +221,7 @@ export default {
edit(item) { edit(item) {
this.union = JSON.parse(JSON.stringify(item)) this.union = JSON.parse(JSON.stringify(item))
this.targetTable.name = this.union.targetTableName
fieldList(this.union.targetTableId).then(response => { fieldList(this.union.targetTableId).then(response => {
this.targetFieldOption = response.data this.targetFieldOption = response.data
this.showUnionEdit() this.showUnionEdit()
...@@ -241,11 +245,13 @@ export default { ...@@ -241,11 +245,13 @@ export default {
}, },
getTable(param) { getTable(param) {
// console.log(param) // console.log(param)
this.targetTable = param
this.union.targetTableId = param.id this.union.targetTableId = param.id
this.union.targetTableFieldId = '' this.union.targetTableFieldId = ''
fieldList(param.id).then(response => { fieldList(param.id).then(response => {
this.targetFieldOption = response.data this.targetFieldOption = response.data
}) })
this.$refs['targetTable'].doClose()
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论