12 changed files with 161 additions and 38 deletions
-
4src/components/Operator.vue
-
6src/components/Progress.vue
-
29src/components/Setting/components/User.vue
-
7src/components/Setting/index.vue
-
14src/mock/command.js
-
40src/pages/Home.vue
-
1src/socket/index.js
-
2src/store/index.js
-
5src/store/modules/setting.js
-
26src/store/modules/user.js
-
61src/store/modules/websocket.js
-
4vite.config.js
@ -0,0 +1,26 @@ |
|||||
|
import { defineStore } from 'pinia' |
||||
|
export const useUserStore = defineStore({ |
||||
|
id: 'user', // id必填,且需要唯一
|
||||
|
// state
|
||||
|
state: () => { |
||||
|
return { |
||||
|
allUserList: [], |
||||
|
operUser: '', |
||||
|
} |
||||
|
}, |
||||
|
// actions
|
||||
|
actions: { |
||||
|
updateOperUser(operUser) { |
||||
|
this.operUser = operUser |
||||
|
}, |
||||
|
updateUserList(userList) { |
||||
|
this.allUserList = userList |
||||
|
}, |
||||
|
}, |
||||
|
getters: { |
||||
|
userList: state => { |
||||
|
const arr = state.allUserList.filter(item => item.permission_level == 3) |
||||
|
return arr |
||||
|
}, |
||||
|
}, |
||||
|
}) |
Write
Preview
Loading…
Cancel
Save
Reference in new issue