<el-form-item prop="MVIEW" label="数据库表名称">
<el-input v-model="formObj.MVIEW" size="small" placeholder="请输入数据库表名称" disabled>
</el-input>
</el-form-item>
data() {
const checkTableInDB = (rule, value, callback) => {
if (value && this.dialogInfo.type === 'add') {
verifyExistTable({
TABLENAME: value
}).then(res => {
if (res && res.code === 200) {
if (res.data) {
callback(new Error('当前表名已存在'))
} else {
callback()
}
}
})
} else {
callback()
}
}
return {
rules: {
MVIEW: [
{ required: true, message: '数据库表名称不能为空', trigger: 'blur' },
{ validator: checkTableInDB, trigger: 'blur' }
]
}
}
}