Merge pull request #7962 from dataease/pr@dev_one_dot_x

Pr@dev one dot x
This commit is contained in:
dataeaseShu 2024-02-01 13:37:52 +08:00 committed by GitHub
commit db2af20827
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 3 deletions

View File

@ -966,8 +966,8 @@ export default {
table.info.replace(/\n/g, '\\n').replace(/\r/g, '\\r')
).sql
}
if(JSON.parse(table.info).hasOwnProperty("setKey")){
this.param.setKey = JSON.parse(table.info).setKey
if (JSON.parse(table.info).hasOwnProperty("setKey")) {
this.$set(this.param, 'setKey', JSON.parse(table.info).setKey)
this.param.keys = JSON.parse(table.info).keys
}
this.variables = JSON.parse(table.sqlVariableDetails)

View File

@ -694,6 +694,14 @@ export default {
})
},
methods: {
async cancelEdit() {
const params = this.configFromTabs?.id ? this.configFromTabs : this.$route.query
let { id, showModel } = params
await this.getDatasourceDetail(id, showModel)
this.edit(this.params)
this.changeType(true)
this.editDatasource(false)
},
editDatasource(type) {
this.$emit('update:canEdit', type)
this.disabled = !type

View File

@ -24,7 +24,7 @@
v-if="privileges && canEdit"
key="cancel"
secondary
@click="editDatasource(false)"
@click="cancelEdit"
>{{ $t('commons.cancel') }}
</deBtn>
<deBtn
@ -109,6 +109,10 @@ export default {
this.$refs.DsFormContent.editDatasource(type)
this.canEdit = type
},
cancelEdit() {
this.$refs.DsFormContent.cancelEdit()
this.canEdit = false
},
validaDatasource() {
this.$refs.DsFormContent.validaDatasource()
},