Merge branch 'master' of http://yun.pashanhoo.com:9090/bdc/bdcjg-web
Showing
10 changed files
with
82 additions
and
85 deletions
1 | import request from "@/utils/request"; | 1 | |
2 | import SERVER from "./config"; | ||
3 | import { getParams } from './util' | 2 | import { getParams } from './util' |
4 | import { | 3 | import { |
5 | api, | 4 | api, |
6 | getAction, | 5 | getAction, |
7 | postAction, | ||
8 | deleteAction, | 6 | deleteAction, |
9 | putAction | 7 | putAction |
10 | } from './manageApi' | 8 | } from './manageApi' |
11 | |||
12 | /** 角色管理开始 */ | 9 | /** 角色管理开始 */ |
13 | // 获取角色列表 categoryId | 10 | // 获取角色列表 by categoryId |
14 | export const getRolesById = categoryId => { | 11 | export const getRolesById = categoryId => { |
15 | const conditionGroup = { | 12 | const conditionGroup = { |
16 | conditions: [ | 13 | conditions: [ |
... | @@ -22,65 +19,11 @@ export const getRolesById = categoryId => { | ... | @@ -22,65 +19,11 @@ export const getRolesById = categoryId => { |
22 | ], | 19 | ], |
23 | queryRelation: 'AND' | 20 | queryRelation: 'AND' |
24 | } | 21 | } |
25 | const params = getParams(conditionGroup); | ||
26 | return getAction(api.roles, params) | ||
27 | } | ||
28 | // 人员列表 | ||
29 | export const getUserRoles = (id) => { | ||
30 | return getAction(`${api.userRoles}/${id}/users`) | ||
31 | } | ||
32 | // 更新人员 | ||
33 | export const updateUser = (id, data) => { | ||
34 | return putAction(`${api.userRoles}/${id}/users`, data) | ||
35 | } | ||
36 | // 根据条件获取用户 | ||
37 | export const getUserList = (params) => { | ||
38 | return getAction(api.users, params) | ||
39 | } | ||
40 | // 导出用户列表 | ||
41 | export const exportUserList = (params) => { | ||
42 | return getAction(api.users + '/export', params) | ||
43 | } | ||
44 | // 更新用户状态 | ||
45 | export const updateStatus = (id, status) => { | ||
46 | return putAction(`${api.users}/${id}/${status}/status`) | ||
47 | } | ||
48 | // 更新用户解锁状态 | ||
49 | export const updateLock = (id) => { | ||
50 | return putAction(`${api.users}/${id}/lock`) | ||
51 | } | ||
52 | // 重置用户密码 | ||
53 | // export const resetPassword = id => { | ||
54 | // return putAction(`${api.users}/${id}/reset-password`) | ||
55 | // } | ||
56 | |||
57 | // 重置用户密码 | ||
58 | export const resetPassword = (ids) => { | ||
59 | return putAction(`${api.users}/reset-passwords?ids=${ids}`) | ||
60 | } | ||
61 | |||
62 | // 删除人员 | ||
63 | export const delUser = (id, data) => { | ||
64 | return deleteAction(`${api.userRoles}/${id}/users`, data) | ||
65 | } | ||
66 | // 获取父级菜单 | ||
67 | export const getParentMenuListAction = (id) => { | ||
68 | let conditionGroup = {} | ||
69 | if (id && id !== '') { | ||
70 | conditionGroup = { | ||
71 | conditions: [ | ||
72 | { | ||
73 | property: 'productId', | ||
74 | value: id, | ||
75 | operator: 'EQ' | ||
76 | } | ||
77 | ], | ||
78 | queryRelation: 'AND' | ||
79 | } | ||
80 | } | ||
81 | const params = getParams(conditionGroup) | 22 | const params = getParams(conditionGroup) |
82 | return getAction(api.menus, params) | 23 | return getAction(api.roles, params) |
83 | } | 24 | } |
25 | /** 角色管理结束 */ | ||
26 | /** 授权管理开始 */ | ||
84 | // 获取权限列表 | 27 | // 获取权限列表 |
85 | export const getAuthorityListAction = (productId, subsystemCode) => { | 28 | export const getAuthorityListAction = (productId, subsystemCode) => { |
86 | const conditionGroup = { | 29 | const conditionGroup = { |
... | @@ -101,6 +44,7 @@ export const getAuthorityListAction = (productId, subsystemCode) => { | ... | @@ -101,6 +44,7 @@ export const getAuthorityListAction = (productId, subsystemCode) => { |
101 | const params = getParams(conditionGroup) | 44 | const params = getParams(conditionGroup) |
102 | return getAction(api.resourceCategory, params) | 45 | return getAction(api.resourceCategory, params) |
103 | } | 46 | } |
47 | |||
104 | /** | 48 | /** |
105 | * 获取角色的权限 id operationCodes resourceCategoryCode | 49 | * 获取角色的权限 id operationCodes resourceCategoryCode |
106 | * id 授权id | 50 | * id 授权id |
... | @@ -121,6 +65,25 @@ export const getRoleAuthorityList = ( | ... | @@ -121,6 +65,25 @@ export const getRoleAuthorityList = ( |
121 | export const roleAuthority = (id, permissionDtos) => { | 65 | export const roleAuthority = (id, permissionDtos) => { |
122 | return putAction(`${api.rolePermissions}/${id}`, permissionDtos) | 66 | return putAction(`${api.rolePermissions}/${id}`, permissionDtos) |
123 | } | 67 | } |
124 | export const updateUserPassword = (data) => { | 68 | |
125 | return putAction(`${api.users}/update-password`, data) | 69 | |
70 | |||
71 | // 获取父级菜单 | ||
72 | export const getParentMenuListAction = (id) => { | ||
73 | let conditionGroup = {} | ||
74 | if (id && id !== '') { | ||
75 | conditionGroup = { | ||
76 | conditions: [ | ||
77 | { | ||
78 | property: 'productId', | ||
79 | value: id, | ||
80 | operator: 'EQ' | ||
81 | } | ||
82 | ], | ||
83 | queryRelation: 'AND' | ||
84 | } | ||
85 | } | ||
86 | const params = getParams(conditionGroup) | ||
87 | return getAction(api.menus, params) | ||
126 | } | 88 | } |
89 | ... | ... |
src/api/personnelManage.js
0 → 100644
1 | |||
2 | import { | ||
3 | api, | ||
4 | getAction, | ||
5 | deleteAction, | ||
6 | putAction | ||
7 | } from './manageApi' | ||
8 | |||
9 | |||
10 | export const updateUserPassword = (data) => { | ||
11 | return putAction(`${api.users}/update-password`, data) | ||
12 | } | ||
13 | |||
14 | // 根据条件获取用户 | ||
15 | export const getUserList = (params) => { | ||
16 | return getAction(api.users, params) | ||
17 | } | ||
18 | |||
19 | |||
20 | |||
21 | // 重置用户密码 | ||
22 | // export const resetPassword = id => { | ||
23 | // return putAction(`${api.users}/${id}/reset-password`) | ||
24 | // } | ||
25 | |||
26 | // 重置用户密码 | ||
27 | export const resetPassword = (ids) => { | ||
28 | return putAction(`${api.users}/reset-passwords?ids=${ids}`) | ||
29 | } | ||
30 | |||
31 | // 人员列表 | ||
32 | export const getUserRoles = (id) => { | ||
33 | return getAction(`${api.userRoles}/${id}/users`) | ||
34 | } | ||
35 | // 更新人员 | ||
36 | export const updateUser = (id, data) => { | ||
37 | return putAction(`${api.userRoles}/${id}/users`, data) | ||
38 | } | ||
39 |
... | @@ -15,14 +15,14 @@ const mutations = { | ... | @@ -15,14 +15,14 @@ const mutations = { |
15 | }; | 15 | }; |
16 | 16 | ||
17 | const actions = { | 17 | const actions = { |
18 | getUserInfo({ commit }) { | 18 | getUserInfo ({ commit }) { |
19 | return new Promise(async (resolve) => { | 19 | return new Promise(async (resolve) => { |
20 | let { result: res } = await getUserInfo(); | 20 | let { result: res } = await getUserInfo(); |
21 | commit("SET_USERINFO", res); | 21 | commit("SET_USERINFO", res); |
22 | resolve(true); | 22 | resolve(true); |
23 | }); | 23 | }); |
24 | }, | 24 | }, |
25 | resetState({ commit }) { | 25 | resetState ({ commit }) { |
26 | commit("RESET_USER"); | 26 | commit("RESET_USER"); |
27 | }, | 27 | }, |
28 | }; | 28 | }; | ... | ... |
... | @@ -15,8 +15,8 @@ | ... | @@ -15,8 +15,8 @@ |
15 | </div> | 15 | </div> |
16 | <div class="from-clues-content"> | 16 | <div class="from-clues-content"> |
17 | <div class="contentbox"> | 17 | <div class="contentbox"> |
18 | <base-set v-show="isshow" :user-info="userData" /> | 18 | <base-set v-show="isshow" :userInfo="userData" /> |
19 | <password-edit v-show="!isshow" :user-info="userData" /> | 19 | <password-edit v-show="!isshow" :userInfo="userData" /> |
20 | </div> | 20 | </div> |
21 | </div> | 21 | </div> |
22 | </div> | 22 | </div> |
... | @@ -33,20 +33,17 @@ | ... | @@ -33,20 +33,17 @@ |
33 | data () { | 33 | data () { |
34 | return { | 34 | return { |
35 | isshow: true, | 35 | isshow: true, |
36 | userData: null | ||
37 | }; | 36 | }; |
38 | }, | 37 | }, |
39 | computed: { | 38 | computed: { |
40 | departmentid () { | 39 | userData () { |
41 | return this.$store.state.user.userInfo; | 40 | return this.$store.state.user.userInfo; |
42 | }, | 41 | }, |
43 | }, | 42 | }, |
44 | watch: {}, | 43 | watch: {}, |
45 | created () { }, | 44 | created () { }, |
46 | mounted () { | 45 | mounted () { |
47 | if (this.departmentid) { | 46 | |
48 | this.userData = this.departmentid | ||
49 | } | ||
50 | 47 | ||
51 | }, | 48 | }, |
52 | methods: { | 49 | methods: { | ... | ... |
... | @@ -37,7 +37,7 @@ | ... | @@ -37,7 +37,7 @@ |
37 | </template> | 37 | </template> |
38 | 38 | ||
39 | <script> | 39 | <script> |
40 | import { updateUserPassword } from "@/api/quanxianmanagement"; | 40 | import { updateUserPassword } from "@/api/personnelManage"; |
41 | export default { | 41 | export default { |
42 | props: { | 42 | props: { |
43 | userInfo: { | 43 | userInfo: { | ... | ... |
... | @@ -91,7 +91,7 @@ | ... | @@ -91,7 +91,7 @@ |
91 | 91 | ||
92 | <script> | 92 | <script> |
93 | import Dialog from "@/components/Dialog/"; | 93 | import Dialog from "@/components/Dialog/"; |
94 | import { getParentMenuListAction } from '@/api/quanxianmanagement' | 94 | import { getParentMenuListAction } from '@/api/authorityManage' |
95 | import JsonEditor from '@/components/JsonEditors' | 95 | import JsonEditor from '@/components/JsonEditors' |
96 | import IconList from '@/components/IconList' | 96 | import IconList from '@/components/IconList' |
97 | import { validateCode } from '@/utils/validate'; | 97 | import { validateCode } from '@/utils/validate'; | ... | ... |
... | @@ -37,15 +37,9 @@ | ... | @@ -37,15 +37,9 @@ |
37 | findParents, | 37 | findParents, |
38 | removeTreeListItem, | 38 | removeTreeListItem, |
39 | } from "@/utils/operation"; | 39 | } from "@/utils/operation"; |
40 | import { getRolesById, getUserRoles, getAuthorityListAction } from "@/api/quanxianmanagement"; | 40 | import { getRolesById, getAuthorityListAction } from "@/api/authorityManage"; |
41 | import { getUserRoles } from "@/api/personnelManage"; | ||
41 | import data from "./data"; | 42 | import data from "./data"; |
42 | // import { | ||
43 | // getOrganizationAuthorityList, | ||
44 | // getDepartmentAuthorityList, | ||
45 | // getRoleAuthorityList, | ||
46 | // getUserAuthorityList, | ||
47 | // getAuthorityListAction | ||
48 | // } from '@/api/authorityManage' | ||
49 | import sjsbTask from "@/api/sjsbTask.js"; | 43 | import sjsbTask from "@/api/sjsbTask.js"; |
50 | import { api, getAction, deleteAction } from "@/api/manageApi"; | 44 | import { api, getAction, deleteAction } from "@/api/manageApi"; |
51 | import tableMixin from "@/mixins/tableMixin.js"; | 45 | import tableMixin from "@/mixins/tableMixin.js"; | ... | ... |
... | @@ -45,7 +45,8 @@ | ... | @@ -45,7 +45,8 @@ |
45 | 45 | ||
46 | <script> | 46 | <script> |
47 | import { api } from "@/api/manageApi"; | 47 | import { api } from "@/api/manageApi"; |
48 | import { updateUser, getRoleAuthorityList, roleAuthority } from "@/api/quanxianmanagement"; | 48 | import { getRoleAuthorityList, roleAuthority } from "@/api/authorityManage"; |
49 | import { updateUser } from "@/api/personnelManage"; | ||
49 | export default { | 50 | export default { |
50 | name: "", | 51 | name: "", |
51 | data () { | 52 | data () { | ... | ... |
... | @@ -42,7 +42,7 @@ | ... | @@ -42,7 +42,7 @@ |
42 | import { | 42 | import { |
43 | resetPassword, | 43 | resetPassword, |
44 | getUserList, | 44 | getUserList, |
45 | } from "@/api/quanxianmanagement"; | 45 | } from "@/api/personnelManage"; |
46 | import { api, deleteAction } from '@/api/manageApi' | 46 | import { api, deleteAction } from '@/api/manageApi' |
47 | import data from "./data"; | 47 | import data from "./data"; |
48 | import { deleteDomStr } from '@/utils/proDomStr' | 48 | import { deleteDomStr } from '@/utils/proDomStr' | ... | ... |
-
Please register or sign in to post a comment