|
|
@ -3,8 +3,9 @@ |
|
|
|
<div v-if="userFormVisible" class="add_user_form"> |
|
|
|
<p class="title">添加新用户</p> |
|
|
|
<div class="form_wrap"> |
|
|
|
<input type="text" class="username_form" /> |
|
|
|
<input v-model="newUserUserName" type="text" class="username_form" /> |
|
|
|
<input |
|
|
|
v-model="newUserPassword" |
|
|
|
:type="showAddPassword ? 'text' : 'password'" |
|
|
|
class="password_form" |
|
|
|
/> |
|
|
@ -13,12 +14,12 @@ |
|
|
|
class="eye" |
|
|
|
@click="handleAddPasswordShow" |
|
|
|
/> |
|
|
|
<p class="username_tips">*用户名限制信息</p> |
|
|
|
<p class="password_tips">*用户名限制信息</p> |
|
|
|
<!-- <p class="username_tips">*用户名限制信息</p> |
|
|
|
<p class="password_tips">*用户名限制信息</p> --> |
|
|
|
</div> |
|
|
|
<div class="btns"> |
|
|
|
<div class="btn style-btn" @click="returnList">返回</div> |
|
|
|
<div class="btn style-btn">添加</div> |
|
|
|
<div class="btn style-btn" @click="addNewUserFunc">添加</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-else-if="changePasswordVisible" class="change_password_form"> |
|
|
@ -136,6 +137,7 @@ import { |
|
|
|
updateUserPermissionLevelJSON, |
|
|
|
delUserJSON, |
|
|
|
addUserJson, |
|
|
|
getAllUserJSON, |
|
|
|
} from '@/mock/command' |
|
|
|
|
|
|
|
const showkeyboard = ref(false) |
|
|
@ -150,6 +152,9 @@ const onChange = a => { |
|
|
|
updateUserNewPassword.value = a |
|
|
|
} |
|
|
|
|
|
|
|
const newUserUserName = ref('') |
|
|
|
const newUserPassword = ref('') |
|
|
|
|
|
|
|
const userStore = useUserStore() |
|
|
|
const webSocketStore = useWebSocketStore() |
|
|
|
const userFormVisible = ref(false) |
|
|
@ -230,12 +235,29 @@ const hideUserModal = () => { |
|
|
|
userModalVisible.value = false |
|
|
|
} |
|
|
|
|
|
|
|
const getAllUser = () => { |
|
|
|
webSocketStore.sendCommandMsg(getAllUserJSON) |
|
|
|
} |
|
|
|
|
|
|
|
const handleOk = () => { |
|
|
|
if (userModalFlag.value == 1) { |
|
|
|
// 删除 |
|
|
|
webSocketStore.sendCommandMsg(delUserJSON(currDelUserId.value)) |
|
|
|
} else { |
|
|
|
// 修改 |
|
|
|
webSocketStore.sendCommandMsg( |
|
|
|
updateUserPermissionLevelJSON(currDelUserId.value), |
|
|
|
) |
|
|
|
} |
|
|
|
getAllUser() |
|
|
|
} |
|
|
|
|
|
|
|
const addNewUserFunc = () => { |
|
|
|
webSocketStore.sendCommandMsg( |
|
|
|
addUserJson(newUserUserName.value, newUserPassword.value), |
|
|
|
) |
|
|
|
getAllUser() |
|
|
|
returnList() |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|