fix: 数据源布局,编辑驱动bug 修复

This commit is contained in:
dataeaseShu 2022-09-29 14:14:40 +08:00
parent eeb775b706
commit 8349fccf43
4 changed files with 24 additions and 6 deletions

View File

@ -259,6 +259,7 @@ export default {
} }
updateDriver(this.driverForm).then((res) => { updateDriver(this.driverForm).then((res) => {
this.$success(i18n.t('commons.success')) this.$success(i18n.t('commons.success'))
this.$emit('DataUpdate', res.data)
this.canEdit = false this.canEdit = false
}) })
}) })

View File

@ -1100,9 +1100,9 @@ export default {
if (this.disabled) { if (this.disabled) {
return return
} }
this.api_table_title = this.$t('datasource.data_table')
if (item) { if (item) {
this.add_api_item = false this.add_api_item = false
this.api_table_title = this.$t('datasource.edit_api_table')
this.apiItem = JSON.parse(JSON.stringify(item)) this.apiItem = JSON.parse(JSON.stringify(item))
} else { } else {
this.add_api_item = true this.add_api_item = true
@ -1112,7 +1112,6 @@ export default {
? this.form.apiConfiguration[this.form.apiConfiguration.length - 1] ? this.form.apiConfiguration[this.form.apiConfiguration.length - 1]
.serialNumber + 1 .serialNumber + 1
: 0 : 0
this.api_table_title = this.$t('datasource.add_api_table')
} }
this.active = 1 this.active = 1
this.edit_api_item = true this.edit_api_item = true

View File

@ -32,6 +32,7 @@
:is="component" :is="component"
v-if="!!component" v-if="!!component"
:params="param" :params="param"
@DataUpdate="dataUpdate"
:t-data="tData" :t-data="tData"
:ds-types="dsTypes" :ds-types="dsTypes"
@refresh-type="refreshType" @refresh-type="refreshType"
@ -69,6 +70,9 @@ export default {
} }
}, },
methods: { methods: {
dataUpdate(row) {
this.$refs.dsTree.dataUpdate(row)
},
jump() { jump() {
this.$refs.dsTree.dsMgm() this.$refs.dsTree.dsMgm()
this.switchMgm('dsMgm') this.switchMgm('dsMgm')
@ -126,7 +130,7 @@ export default {
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: nowrap;
box-sizing: border-box; box-sizing: border-box;
.el-empty { .el-empty {
height: 100%; height: 100%;
@ -149,6 +153,7 @@ export default {
height: calc(100vh - 56px); height: calc(100vh - 56px);
background-color: var(--MainBG, #f5f6f7); background-color: var(--MainBG, #f5f6f7);
padding: 24px; padding: 24px;
flex-wrap: wrap;
.ms-aside-container, .ms-aside-container,
.ms-main-container { .ms-main-container {
height: calc(100vh - 170px); height: calc(100vh - 170px);

View File

@ -160,7 +160,6 @@
</el-col> </el-col>
<el-dialog <el-dialog
v-dialogDrag
:title="dialogTitle" :title="dialogTitle"
class="de-dialog-form" class="de-dialog-form"
:visible.sync="editDriver" :visible.sync="editDriver"
@ -361,6 +360,20 @@ export default {
this.datasourceTypes() this.datasourceTypes()
}, },
methods: { methods: {
dataUpdate(row) {
this.dfsTdata(this.tData, row)
},
dfsTdata(arr = [], row) {
arr.some(ele => {
if (ele.id === row.id) {
ele.driverClass = row.driverClass
return true
} else if (ele.children?.length) {
this.dfsTdata(ele.children, row)
}
return false
})
},
filterNode(value, data) { filterNode(value, data) {
if (!value) return true if (!value) return true
return data.name.indexOf(value) !== -1 return data.name.indexOf(value) !== -1
@ -552,7 +565,7 @@ export default {
} }
this.editDriver = true this.editDriver = true
this.dialogTitle = this.$t('datasource.edit_driver') this.dialogTitle = this.$t('datasource.edit_driver')
this.driverForm = row this.driverForm = {...row}
}, },
_handleDelete(datasource) { _handleDelete(datasource) {
const params = { const params = {
@ -707,7 +720,7 @@ export default {
<style lang="scss"> <style lang="scss">
.db-container { .db-container {
width: 100%; width: 100%;
max-height: 674px; max-height: 60vh;
overflow-y: auto; overflow-y: auto;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;