Datasource 切换之后 table 也要清空
db monitor 模块 overview add 弹窗 Name 是必填项,只是 Test 按钮不需要校验
This commit is contained in:
parent
cca6fc22a8
commit
e47b78d23c
|
@ -174,6 +174,7 @@ export default {
|
||||||
onDbChange(val) {
|
onDbChange(val) {
|
||||||
this.name = val
|
this.name = val
|
||||||
this.dbName = undefined
|
this.dbName = undefined
|
||||||
|
this.dataSource = []
|
||||||
this.getDbNameList()
|
this.getDbNameList()
|
||||||
},
|
},
|
||||||
ondbNameChange(val) {
|
ondbNameChange(val) {
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
v-decorator="[
|
v-decorator="[
|
||||||
'name',
|
'name',
|
||||||
{
|
{
|
||||||
rules: [{ required: nameRequired, message: 'Please input name!' }],
|
rules: [{ required: true, message: 'Please input name!' }],
|
||||||
initialVale: this.formVal.name,
|
initialVale: this.formVal.name,
|
||||||
},
|
},
|
||||||
]"
|
]"
|
||||||
|
@ -237,7 +237,6 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
nameRequired: false,
|
|
||||||
loading: false,
|
loading: false,
|
||||||
isAdd: true,
|
isAdd: true,
|
||||||
visible: false,
|
visible: false,
|
||||||
|
@ -444,8 +443,7 @@ export default {
|
||||||
this.currentId = ''
|
this.currentId = ''
|
||||||
},
|
},
|
||||||
onTest() {
|
onTest() {
|
||||||
this.nameRequired = false
|
this.form.validateFields(['dbType', 'dbDriver', 'dbUrl', 'dbUsername', 'dbPassword'], (err, values) => {
|
||||||
this.form.validateFields((err, values) => {
|
|
||||||
if (!err) {
|
if (!err) {
|
||||||
let loading = this.$message.loading('连接中……', 0)
|
let loading = this.$message.loading('连接中……', 0)
|
||||||
postAction('/online/cgreport/api/testConnection', values)
|
postAction('/online/cgreport/api/testConnection', values)
|
||||||
|
@ -462,10 +460,6 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onSave() {
|
onSave() {
|
||||||
this.nameRequired = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.form.validateFields(['name'], { force: true })
|
|
||||||
})
|
|
||||||
this.form.validateFields((err, values) => {
|
this.form.validateFields((err, values) => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
if (this.isAdd) {
|
if (this.isAdd) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user