From e40ac658176217b9e7636da78ae72be8d07f617f Mon Sep 17 00:00:00 2001 From: "aoli.qu" <408346101@qq.com> Date: Sat, 11 Sep 2021 17:15:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=AE=A1=E7=90=86=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=BC=80=E5=8F=91=E5=8F=8A=E6=96=B0=E5=A2=9E=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E9=A1=B5=E9=9D=A2=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/person/person.js | 69 ++++ src/utils/permissions.js | 3 +- src/views/org/OrgForm.vue | 21 +- src/views/org/OrgTree.vue | 124 +++++++ src/views/person/PersonDetail.vue | 8 + src/views/person/PersonForm.vue | 332 +++++++++++++++++ src/views/person/PersonList.vue | 347 ++++++++++++++++++ src/views/security/menu/MenuForm.vue | 2 - src/views/security/user/UserList.vue | 4 +- src/views/sys/dictionary/DictionaryList.vue | 62 ++-- .../sys/dictionaryItem/DictionaryItemList.vue | 90 +++-- 11 files changed, 967 insertions(+), 95 deletions(-) create mode 100644 src/api/person/person.js create mode 100644 src/views/org/OrgTree.vue create mode 100644 src/views/person/PersonDetail.vue create mode 100644 src/views/person/PersonForm.vue create mode 100644 src/views/person/PersonList.vue diff --git a/src/api/person/person.js b/src/api/person/person.js new file mode 100644 index 0000000..452a3e5 --- /dev/null +++ b/src/api/person/person.js @@ -0,0 +1,69 @@ +import request from '@/utils/request' + +const personApi = { + addOrUpdate: 'person/addOrUpdate', + del: 'person/del', + get: 'person/get', + page: 'person/pageList', + transferOrg: 'person/transferOrg', + quit: 'person/quit', + resetPwd: 'person/resetPwd', + setAdmin: 'person/setAdmin', +} + +export function personAddOrUpdate (params) { + return request({ + url: personApi.addOrUpdate, + method: 'post', + data: params + }) +} +export function personGet (params) { + return request({ + url: personApi.get, + method: 'get', + params: params + }) +} +export function personDel (params) { + return request({ + url: personApi.del, + method: 'post', + params: params + }) +} +export function personPage (params) { + return request({ + url: personApi.page, + method: 'get', + params: params + }) +} +export function personTransferOrg (params) { + return request({ + url: personApi.transferOrg, + method: 'get', + params: params + }) +} +export function personQuit (params) { + return request({ + url: personApi.quit, + method: 'get', + params: params + }) +} +export function personResetPwd (params) { + return request({ + url: personApi.resetPwd, + method: 'get', + params: params + }) +} +export function personSetAdmin (params) { + return request({ + url: personApi.setAdmin, + method: 'get', + params: params + }) +} diff --git a/src/utils/permissions.js b/src/utils/permissions.js index 83b0bb1..c139fe1 100644 --- a/src/utils/permissions.js +++ b/src/utils/permissions.js @@ -14,8 +14,7 @@ export function actionToObject (json) { */ export function hasBtnPermission (permission) { const myBtns = store.getters.buttons - const name = store.getters.name - if (name == 'admin') { + if (myBtns.indexOf('*:*:*') > -1) { return true } return myBtns.indexOf(permission) > -1 diff --git a/src/views/org/OrgForm.vue b/src/views/org/OrgForm.vue index de7fc6a..1e65505 100644 --- a/src/views/org/OrgForm.vue +++ b/src/views/org/OrgForm.vue @@ -9,7 +9,7 @@ > - + - + { this.formLoading = false - if (!res.code === 200) { + if (!res.code === 200 || !res.data.length) { this.orgTree = [] return } @@ -189,8 +189,7 @@ }).finally((res) => { this.confirmLoading = false }) - } - + } } else { this.confirmLoading = false } diff --git a/src/views/org/OrgTree.vue b/src/views/org/OrgTree.vue new file mode 100644 index 0000000..f5d0f90 --- /dev/null +++ b/src/views/org/OrgTree.vue @@ -0,0 +1,124 @@ + + + diff --git a/src/views/person/PersonDetail.vue b/src/views/person/PersonDetail.vue new file mode 100644 index 0000000..48d48ea --- /dev/null +++ b/src/views/person/PersonDetail.vue @@ -0,0 +1,8 @@ + + + + + diff --git a/src/views/person/PersonForm.vue b/src/views/person/PersonForm.vue new file mode 100644 index 0000000..80aa59f --- /dev/null +++ b/src/views/person/PersonForm.vue @@ -0,0 +1,332 @@ + + + diff --git a/src/views/person/PersonList.vue b/src/views/person/PersonList.vue new file mode 100644 index 0000000..26aedeb --- /dev/null +++ b/src/views/person/PersonList.vue @@ -0,0 +1,347 @@ + + + diff --git a/src/views/security/menu/MenuForm.vue b/src/views/security/menu/MenuForm.vue index 013e5ad..1c81733 100644 --- a/src/views/security/menu/MenuForm.vue +++ b/src/views/security/menu/MenuForm.vue @@ -229,9 +229,7 @@ this.meneTypeFunc(record.type.toString()) // 默认选中的单选框 - // eslint-disable-next-line no-unused-vars const visibleDef = false - // eslint-disable-next-line eqeqeq if (record.visible == 1) { this.visibleDef = true } diff --git a/src/views/security/user/UserList.vue b/src/views/security/user/UserList.vue index 8057b68..839e614 100644 --- a/src/views/security/user/UserList.vue +++ b/src/views/security/user/UserList.vue @@ -48,7 +48,7 @@ 编辑 - + 更多 @@ -138,7 +138,7 @@ export default { }, created () { // 动态加载权限 - if (this.hasPerm('sys:user:edit') || this.hasPerm('sys:user:resetPwd') || this.hasPerm('sys:user:grantRole') || this.hasPerm('sys:user:delete')) { + if (this.hasPerm('sys:user:edit') || this.hasPerm('sys:user:resetPwd') || this.hasPerm('sys:user:grantRole') || this.hasPerm('sys:user:del')) { this.columns.push({ title: '操作', width: '150px', diff --git a/src/views/sys/dictionary/DictionaryList.vue b/src/views/sys/dictionary/DictionaryList.vue index 02c4d12..02c2509 100644 --- a/src/views/sys/dictionary/DictionaryList.vue +++ b/src/views/sys/dictionary/DictionaryList.vue @@ -1,36 +1,34 @@