Commit 1038b9f1 by 胡悦

基本完成

1 parent 5614627c
...@@ -123,13 +123,22 @@ export default { ...@@ -123,13 +123,22 @@ export default {
column.label = rows[index].state < 1 ? '启动' : '禁用' column.label = rows[index].state < 1 ? '启动' : '禁用'
}, },
callback: (index, rows) => { callback: (index, rows) => {
console.log(rows[index].state) this.$confirm('确定要修改这条数据?', '', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (rows[index].state < 1) { if (rows[index].state < 1) {
this.$set(rows[index], 'state', '1') this.$set(rows[index], 'state', '1')
this.operatUser({ id: rows[index].id, state: 1 })
} else { } else {
this.$set(rows[index], 'state', '0') this.$set(rows[index], 'state', '0')
this.operatUser({ id: rows[index].id, state: 0 })
} }
console.log(rows[index].state) this.message('修改成功', 'success')
}).catch(() => {
this.message('修改失败', 'info')
})
} }
}, { }, {
label: '删除', label: '删除',
...@@ -228,9 +237,9 @@ export default { ...@@ -228,9 +237,9 @@ export default {
}, },
// 接受子组件传递的值 // 接受子组件传递的值
handleUserFormData(isEdit, params) { handleUserFormData(isEdit, params) {
console.log(isEdit) console.log(params)
this.userManageForm = {} this.userManageForm = {}
!params && this.message('取消操作', 'warning') !params && this.message('取消操作', 'info')
params && this.updateUser_Post(params) params && this.updateUser_Post(params)
this.dialogFormVisible = !this.dialogFormVisible this.dialogFormVisible = !this.dialogFormVisible
}, },
...@@ -242,6 +251,7 @@ export default { ...@@ -242,6 +251,7 @@ export default {
}, },
// 编辑按钮 // 编辑按钮
editUser(row) { editUser(row) {
console.log(row)
row.password = '' row.password = ''
row.roleList = this.$deep_clone(userForm.roleList) row.roleList = this.$deep_clone(userForm.roleList)
row.state = row.state + '' row.state = row.state + ''
...@@ -255,7 +265,8 @@ export default { ...@@ -255,7 +265,8 @@ export default {
if (row.roles && typeof (row.roles) === 'string') { if (row.roles && typeof (row.roles) === 'string') {
row.roles = (row.roles + '').split(',').map(role => +role) row.roles = (row.roles + '').split(',').map(role => +role)
} else { } else {
row.roles = [] (typeof (row.roles) === 'object') && row.roles
!(typeof (row.roles) === 'object') && []
} }
this.userManageForm = this.$deep_clone(row) this.userManageForm = this.$deep_clone(row)
}) })
...@@ -283,9 +294,10 @@ export default { ...@@ -283,9 +294,10 @@ export default {
}).catch(() => { }).catch(() => {
this.message('取消删除', 'info') this.message('取消删除', 'info')
}) })
} else {
this.message('', '操作失败')
} }
// else {
// this.message('', '操作失败')
// }
}, },
// 提示 // 提示
createOrEditSuccess() { createOrEditSuccess() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!