{
ElMessage.success(text + '成功')
}).catch( ()=>{
- row.status = row.status === '1' ? 1 : 0
+ row.status = row.status === 1 ? 0 : 1
})
}
@@ -666,11 +666,7 @@ function handleSelectionChange(selection: any) {
/** 新增按钮操作 */
function handleAdd() {
- console.log(dataMap.formVal)
dataMap.addformFlag = true
- resetForm()
- dataMap.originOptions = []
- // loadDeptOptions()
dataMap.open = true
dataMap.title = '添加用户'
dataMap.formVal.password = "123456"
@@ -696,15 +692,12 @@ function resetForm() {
/** 修改按钮操作 */
async function handleUpdate(row: { [key: string]: any }) {
- resetForm()
const userId = row.id || dataMap.ids
const response = await getUser(userId);
dataMap.formVal = response.data
- console.log(response.data)
dataMap.title = '修改用户'
dataMap.formVal.password = ''
- dataMap.formVal.deptId = 1
- // dataMap.formVal.deptId = parseInt(response.data.deptId)
+ dataMap.formVal.deptId =response.data.deptId
dataMap.open = true
}
@@ -754,9 +747,6 @@ function cancel() {
resetForm()
}
-function getParentValue(event: any) {
- console.log(event)
-}
function getDeptId(e: any) {
dataMap.formVal.deptId = e
@@ -787,6 +777,7 @@ onMounted(() => {
function showDialog() {
loadDeptOptions()
+ loadRoleOptions()
}