diff --git a/.env b/.env index c4ae906..fe3f0dd 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ -# VITE_BASE_WS1_URL=ws://192.168.8.10:19001/ -# VITE_BASE_WS2_URL=ws://192.168.8.10:19002/ +VITE_BASE_WS1_URL=ws://192.168.8.10:19001/ +VITE_BASE_WS2_URL=ws://192.168.8.10:19002/ -VITE_BASE_WS1_URL=ws://127.0.0.1:19001/ -VITE_BASE_WS2_URL=ws://127.0.0.1:19002/ \ No newline at end of file +# VITE_BASE_WS1_URL=ws://127.0.0.1:19001/ +# VITE_BASE_WS2_URL=ws://127.0.0.1:19002/ \ No newline at end of file diff --git a/src/components/Setting/components/User.vue b/src/components/Setting/components/User.vue index f4ed8d7..dcf7dd6 100644 --- a/src/components/Setting/components/User.vue +++ b/src/components/Setting/components/User.vue @@ -102,11 +102,11 @@ 删除用户
- 设为管理员 + 修改权限
修改密码 @@ -147,6 +147,12 @@ :input="newUserPassword" />
+ @@ -155,6 +161,7 @@ import { ref, onMounted } from 'vue' import UserModal from 'cpns/dialogs/UserModal' import SimpleKeyboard from 'cpns/SimpleKeyboard' import Eye from '@/assets/img/login/eye.png' +import PermissionModal from 'cpns/dialogs/PermissionModal' import Open from '@/assets/img/login/open.png' import { useUserStore, useWebSocketStore } from '@/store' import { @@ -176,6 +183,14 @@ const hideKeyBoard = () => { showkeyboard.value = false } +const logVisible = ref(false) +const logVal = ref('3') +const updatePer = (uid, permission_level) => { + logVal.value = permission_level + '' + currDelUserId.value = uid + logVisible.value = true +} + const hideKeyBoard2 = () => { showkeyboard2.value = false } @@ -183,6 +198,20 @@ const hideKeyBoard3 = () => { showkeyboard3.value = false } +const changeLogVal = val => { + logVal.value = val + logVisible.value = false + // 修改用户权限 + webSocketStore.sendCommandMsg( + updateUserPermissionLevelJSON(currDelUserId.value, val), + ) + webSocketStore.sendCommandMsg(getAllUserJSON) +} + +const hiddenLogVisible = () => { + logVisible.value = false +} + const showAddPasswordKey = () => { showkeyboard3.value = false showkeyboard2.value = true @@ -236,6 +265,7 @@ const updateUserPassword = () => { arr[0]?.passwd, ), ) + changePasswordVisible.value = false } } @@ -299,10 +329,6 @@ const handleOk = () => { // 删除 webSocketStore.sendCommandMsg(delUserJSON(currDelUserId.value)) } else { - // 修改 - webSocketStore.sendCommandMsg( - updateUserPermissionLevelJSON(currDelUserId.value), - ) } getAllUser() } diff --git a/src/components/dialogs/PermissionModal.vue b/src/components/dialogs/PermissionModal.vue new file mode 100644 index 0000000..b15369e --- /dev/null +++ b/src/components/dialogs/PermissionModal.vue @@ -0,0 +1,131 @@ + + + + + diff --git a/src/mock/command.js b/src/mock/command.js index eb7b9e4..7b87a0f 100644 --- a/src/mock/command.js +++ b/src/mock/command.js @@ -204,12 +204,12 @@ export const delUserJSON = id => { } } -export const updateUserPermissionLevelJSON = id => { +export const updateUserPermissionLevelJSON = (id, permission_level) => { return { command: 'updateUserPermissionLevel', messageId: 'updateUserPermissionLevel', id, - permission_level: 0, + permission_level, } }