Browse Source

风机版本

master
maochaoying 2 years ago
parent
commit
993e659704
  1. 8
      .env
  2. 26
      src/components/Setting/components/User.vue
  3. 2
      src/components/Test.vue
  4. 9
      src/components/dialogs/UserModal.vue
  5. 26
      src/mock/command.js

8
.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/
VITE_BASE_WS1_URL=ws://127.0.0.1:19001/
VITE_BASE_WS2_URL=ws://127.0.0.1:19002/

26
src/components/Setting/components/User.vue

@ -86,7 +86,7 @@
<div class="operator_wrap"> <div class="operator_wrap">
<div <div
class="common_btn style-btn" class="common_btn style-btn"
@click="showUserModal(`${item.uid} 用户删除`)"
@click="showUserModal(`${item.uid} 用户删除`, item.uid, 1)"
v-if="item.permission_level == 3" v-if="item.permission_level == 3"
> >
删除用户 删除用户
@ -94,7 +94,7 @@
<div <div
class="common_btn mb style-btn" class="common_btn mb style-btn"
v-if="item.permission_level == 3" v-if="item.permission_level == 3"
@click="showUserModal(`${item.uid} 设置为管理员`)"
@click="showUserModal(`${item.uid} 设置为管理员`, item.uid, 2)"
> >
设为管理员 设为管理员
</div> </div>
@ -110,6 +110,7 @@
</div> </div>
<UserModal <UserModal
v-if="userModalVisible" v-if="userModalVisible"
:handleOk="handleOk"
:hideUserModal="hideUserModal" :hideUserModal="hideUserModal"
:userWarnInfo="userWarnInfo" :userWarnInfo="userWarnInfo"
/> />
@ -130,7 +131,12 @@ import SimpleKeyboard from 'cpns/SimpleKeyboard'
import Eye from '@/assets/img/login/eye.png' import Eye from '@/assets/img/login/eye.png'
import Open from '@/assets/img/login/open.png' import Open from '@/assets/img/login/open.png'
import { useUserStore, useWebSocketStore } from '@/store' import { useUserStore, useWebSocketStore } from '@/store'
import { chpasswdJSON } from '@/mock/command'
import {
chpasswdJSON,
updateUserPermissionLevelJSON,
delUserJSON,
addUserJson,
} from '@/mock/command'
const showkeyboard = ref(false) const showkeyboard = ref(false)
const hideKeyBoard = () => { const hideKeyBoard = () => {
@ -212,13 +218,25 @@ const addUserFormShow = () => {
} }
const userWarnInfo = ref('') const userWarnInfo = ref('')
const showUserModal = info => {
const currDelUserId = ref('')
const userModalFlag = ref(1)
const showUserModal = (info, uid, f) => {
userModalFlag.value = f
userWarnInfo.value = info userWarnInfo.value = info
currDelUserId.value = uid
userModalVisible.value = true userModalVisible.value = true
} }
const hideUserModal = () => { const hideUserModal = () => {
userModalVisible.value = false userModalVisible.value = false
} }
const handleOk = () => {
if (userModalFlag.value == 1) {
//
} else {
//
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

2
src/components/Test.vue

@ -119,7 +119,7 @@
</div> </div>
<div class="common_set switch_wrap"> <div class="common_set switch_wrap">
<p class="title">风机</p> <p class="title">风机</p>
<p class="num">{{ testStore?.airBlowerObj?.currentVal }} r/min</p>
<p class="num">{{ testStore?.airBlowerObj?.currentVal }} A</p>
<div class="btn_wrap"> <div class="btn_wrap">
<div <div
:class="testStore.draughtFan ? 'close style-btn' : 'open style-btn'" :class="testStore.draughtFan ? 'close style-btn' : 'open style-btn'"

9
src/components/dialogs/UserModal.vue

@ -22,7 +22,7 @@
请确认是否将 <span class="red">{{ userWarnInfo }}</span> 请确认是否将 <span class="red">{{ userWarnInfo }}</span>
</p> </p>
<div class="btns"> <div class="btns">
<div class="ok style-btn">确定</div>
<div class="ok style-btn" @click="ok">确定</div>
<div class="cancel style-btn" @click="handleCancel">取消</div> <div class="cancel style-btn" @click="handleCancel">取消</div>
</div> </div>
</div> </div>
@ -37,8 +37,15 @@ const props = defineProps({
hideUserModal: { hideUserModal: {
type: Function, type: Function,
}, },
handleOk: {
type: Function,
},
}) })
const ok = () => {
props.handleOk()
}
const handleCancel = () => { const handleCancel = () => {
props.hideUserModal() props.hideUserModal()
} }

26
src/mock/command.js

@ -185,3 +185,29 @@ export const changeDisinfectionParameterJSON = data => {
...data, ...data,
} }
} }
export const addUserJson = (uid, passwd) => {
return {
command: 'addUser',
messageId: 'addUser',
uid,
passwd,
}
}
export const delUserJSON = id => {
return {
command: 'delUser',
messageId: 'delUser',
id,
}
}
export const updateUserPermissionLevelJSON = id => {
return {
command: 'updateUserPermissionLevel',
messageId: 'updateUserPermissionLevel',
id,
permission_level: 0,
}
}
Loading…
Cancel
Save