feat(数据集):编辑自助数据集

This commit is contained in:
junjie 2021-05-12 15:53:53 +08:00
parent 5c26b5986d
commit ef36e73948
3 changed files with 19 additions and 6 deletions

View File

@ -102,7 +102,7 @@ public class DataSetTableService {
int update = datasetTableMapper.updateByPrimaryKeySelective(datasetTable); int update = datasetTableMapper.updateByPrimaryKeySelective(datasetTable);
// sql 更新 // sql 更新
if (update == 1) { if (update == 1) {
if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "sql")) { if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "sql") || StringUtils.equalsIgnoreCase(datasetTable.getType(), "custom")) {
// 删除所有字段重新抽象 // 删除所有字段重新抽象
dataSetTableFieldsService.deleteByTableId(datasetTable.getId()); dataSetTableFieldsService.deleteByTableId(datasetTable.getId());
saveTableField(datasetTable); saveTableField(datasetTable);

View File

@ -23,7 +23,7 @@
</el-row> </el-row>
<el-col style="display: flex;flex-direction: row"> <el-col style="display: flex;flex-direction: row">
<el-col class="panel-height" style="width: 220px;border-right:solid 1px #dcdfe6;border-top:solid 1px #dcdfe6;padding-right: 15px;overflow-y: auto;"> <el-col class="panel-height" style="width: 220px;border-right:solid 1px #dcdfe6;border-top:solid 1px #dcdfe6;padding-right: 15px;overflow-y: auto;">
<dataset-group-selector :mode="1" :checked-list="checkedList" :union-data="unionData" @getTable="getTable" /> <dataset-group-selector :table="table" :mode="1" :checked-list="checkedList" :union-data="unionData" @getTable="getTable" />
</el-col> </el-col>
<el-col class="panel-height" style="width: 235px;border-top:solid 1px #dcdfe6;padding: 0 15px;overflow-y: auto;"> <el-col class="panel-height" style="width: 235px;border-top:solid 1px #dcdfe6;padding: 0 15px;overflow-y: auto;">
<dataset-custom-field :table="table" :checked-list="checkedList" @getChecked="getChecked" /> <dataset-custom-field :table="table" :checked-list="checkedList" @getChecked="getChecked" />

View File

@ -122,6 +122,11 @@ export default {
type: Array, type: Array,
required: false, required: false,
default: null default: null
},
table: {
type: Object,
required: false,
default: null
} }
}, },
data() { data() {
@ -153,6 +158,18 @@ export default {
'unionData': function() { 'unionData': function() {
this.unionDataChange() this.unionDataChange()
}, },
'table': function() {
if (this.table && this.table.sceneId) {
post('dataset/group/getScene/' + this.table.sceneId, {}).then(response => {
this.currGroup = response.data
this.$nextTick(function() {
this.sceneMode = true
this.tableTree()
})
})
}
},
search(val) { search(val) {
if (val && val !== '') { if (val && val !== '') {
this.tableData = JSON.parse(JSON.stringify(this.tables.filter(ele => { return ele.name.includes(val) }))) this.tableData = JSON.parse(JSON.stringify(this.tables.filter(ele => { return ele.name.includes(val) })))
@ -165,10 +182,6 @@ export default {
this.tree(this.groupForm) this.tree(this.groupForm)
this.tableTree() this.tableTree()
}, },
activated() {
this.tree(this.groupForm)
this.tableTree()
},
created() { created() {
this.kettleState() this.kettleState()
}, },