代码优化

This commit is contained in:
dqjdda
2019-11-23 21:53:02 +08:00
parent 559adfd786
commit f7d78f4b98
17 changed files with 155 additions and 467 deletions

View File

@@ -160,17 +160,21 @@ export default {
})
},
methods: {
// 获取数据前设置好接口地址
beforeInit() {
this.url = 'api/job'
return true
},
// 打开新增弹窗前做的操作
beforeShowAddForm() {
this.getDepts()
},
// 打开编辑弹窗前做的操作
beforeShowEditForm(data) {
this.getDepts()
this.form.enabled = data.enabled.toString()
},
// 提交前的验证
beforeSubmitMethod() {
if (!this.form.dept.id) {
this.notify('所属部门不能为空', 'warning')