|
@ -37,7 +37,7 @@ |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<span slot="footer" class="dialog-footer"> |
|
|
<span slot="footer" class="dialog-footer"> |
|
|
<el-button type="primary" @click.native="handleConfirm">确 定</el-button> |
|
|
|
|
|
|
|
|
<el-button type="primary" @click.native="handleConfirm">确定验证</el-button> |
|
|
</span> |
|
|
</span> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
@ -80,46 +80,33 @@ export default { |
|
|
form: { |
|
|
form: { |
|
|
verifyCode: '' |
|
|
verifyCode: '' |
|
|
}, |
|
|
}, |
|
|
formLabelWidth: '110px' |
|
|
|
|
|
|
|
|
formLabelWidth: '110px', |
|
|
|
|
|
btn: '', |
|
|
|
|
|
showVerifyDialog: true |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
// 获取数据前设置好接口地址 |
|
|
|
|
|
// [CRUD.HOOK.beforeToCU]() { |
|
|
|
|
|
// const h = this.$createElement |
|
|
|
|
|
// return this.$prompt(h('p', null, [ |
|
|
|
|
|
// h('span', null, '这里为技术人员维护系统时使用,用户级无需设置。'), |
|
|
|
|
|
// h('br', null, ''), |
|
|
|
|
|
// h('span', { style: 'color: red' }, '警告:强行修改会导致系统数据异常或丢失!如因用户强行修改,本系统不负责因此导致的相关后果!') |
|
|
|
|
|
// ]), '关键提示', { |
|
|
|
|
|
// confirmButtonText: '确定验证', |
|
|
|
|
|
// showCancelButton: false, |
|
|
|
|
|
// customClass: 'validate', |
|
|
|
|
|
// beforeClose: (action, instance, done) => { |
|
|
|
|
|
// if (action === 'confirm') { |
|
|
|
|
|
// if (instance.inputValue === '123') { |
|
|
|
|
|
// done() |
|
|
|
|
|
// } else { |
|
|
|
|
|
// this.$message.error('验证码错误!') |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// done() |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// }).then(({ value }) => { |
|
|
|
|
|
// // call crud.status.add = CRUD.STATUS.PREPARED |
|
|
|
|
|
// }).catch(() => { |
|
|
|
|
|
// return false |
|
|
|
|
|
// }) |
|
|
|
|
|
// }, |
|
|
|
|
|
// 获取数据前设置好接口地址 |
|
|
|
|
|
[CRUD.HOOK.beforeToCU]() { |
|
|
|
|
|
this.verifyDialogVisible = true |
|
|
|
|
|
|
|
|
[CRUD.HOOK.beforeToCU](crud, form, btn) { |
|
|
|
|
|
console.log(btn) |
|
|
|
|
|
if (this.showVerifyDialog) { |
|
|
|
|
|
// 打开输入验证码对话框 |
|
|
|
|
|
this.verifyDialogVisible = true |
|
|
|
|
|
this.btn = btn |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
handleConfirm() { |
|
|
handleConfirm() { |
|
|
if (this.form.verifyCode === '123') { |
|
|
if (this.form.verifyCode === '123') { |
|
|
|
|
|
// 关闭输入验证码对话框 |
|
|
this.verifyDialogVisible = false |
|
|
this.verifyDialogVisible = false |
|
|
this.form.verifyCode = '' |
|
|
this.form.verifyCode = '' |
|
|
|
|
|
this.showVerifyDialog = false |
|
|
|
|
|
if (this.btn === 'add') { |
|
|
|
|
|
this.crud.toAdd() |
|
|
|
|
|
} else if (this.btn === 'edit') { |
|
|
|
|
|
this.crud.toEdit(this.crud.selections[0]) |
|
|
|
|
|
} |
|
|
|
|
|
this.showVerifyDialog = true |
|
|
} else { |
|
|
} else { |
|
|
this.$message.error('验证码错误!') |
|
|
this.$message.error('验证码错误!') |
|
|
} |
|
|
} |
|
@ -153,12 +140,7 @@ export default { |
|
|
::v-deep thead .el-table-column--selection .cell { |
|
|
::v-deep thead .el-table-column--selection .cell { |
|
|
display: none; |
|
|
display: none; |
|
|
} |
|
|
} |
|
|
.validate .el-message-box__btns { |
|
|
|
|
|
text-align: center; |
|
|
|
|
|
} |
|
|
|
|
|
</style> |
|
|
|
|
|
<style rel="stylesheet/scss" lang="scss"> |
|
|
|
|
|
.validate .el-message-box__btns { |
|
|
|
|
|
|
|
|
::v-deep div.el-dialog__footer { |
|
|
text-align: center; |
|
|
text-align: center; |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |