From 9656524f34a9ae0517969ff241147bc89444a064 Mon Sep 17 00:00:00 2001 From: zichen1019 <1510748736@qq.com> Date: Fri, 20 Aug 2021 21:55:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A7=92=E8=89=B2=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=BC=96=E8=BE=91=EF=BC=9A=E6=B7=BB=E5=8A=A0=E6=9D=83?= =?UTF-8?q?=E9=99=90=E8=8C=83=E5=9B=B4=E9=99=90=E5=88=B6=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/data_scope_department.js | 9 + src/components/Crud/Edit/index.vue | 18 +- src/views/borrow/borrow.vue | 13 +- src/views/user/components/data-permission.vue | 247 ++++++++++++++++++ src/views/user/role.vue | 17 +- 5 files changed, 280 insertions(+), 24 deletions(-) create mode 100644 src/api/data_scope_department.js create mode 100644 src/views/user/components/data-permission.vue diff --git a/src/api/data_scope_department.js b/src/api/data_scope_department.js new file mode 100644 index 0000000..d7bd05c --- /dev/null +++ b/src/api/data_scope_department.js @@ -0,0 +1,9 @@ +import api from '@/utils/api' + +export function getAll(params) { + return api({ + url: '/dataScopeDepartment/all', + method: 'get', + params + }) +} diff --git a/src/components/Crud/Edit/index.vue b/src/components/Crud/Edit/index.vue index 9c80023..a4ec5b7 100644 --- a/src/components/Crud/Edit/index.vue +++ b/src/components/Crud/Edit/index.vue @@ -1,8 +1,5 @@ @@ -15,18 +12,13 @@ export default { type: Object, required: true }, + permission: { + type: Object, + required: true + }, disabledEdit: { type: Boolean, default: false - }, - flag: { - type: Boolean, - defalut: false - } - }, - methods: { - editFn() { - this.$emit('editFn', this.data) } } } diff --git a/src/views/borrow/borrow.vue b/src/views/borrow/borrow.vue index e61d50c..f43289b 100644 --- a/src/views/borrow/borrow.vue +++ b/src/views/borrow/borrow.vue @@ -52,13 +52,9 @@ > @@ -97,7 +93,6 @@ + + diff --git a/src/views/user/role.vue b/src/views/user/role.vue index 4eff965..012e153 100644 --- a/src/views/user/role.vue +++ b/src/views/user/role.vue @@ -10,9 +10,12 @@ - + @@ -87,6 +90,7 @@ + @@ -99,6 +103,8 @@ import CustomTable from '@/components/Crud/Table' import Pagination from '@/components/Crud/Pagination' import CrudRole from '@/api/role' import { getPermissionsByRoleId, getTree } from '@/api/permission' +import DataPermission from './components/data-permission' +import Utils from '@/utils/contact' // crud交由presenter持有 const defaultCrud = presenter(CRUD({ @@ -118,7 +124,7 @@ const defaultForm = form({ export default { name: 'RoleList', - components: { Pagination, Query, Crud, CustomTable, Edit }, + components: { Pagination, Query, Crud, CustomTable, Edit, DataPermission }, mixins: [defaultCrud, defaultForm, header()], data() { return { @@ -163,6 +169,13 @@ export default { [CRUD.HOOK.afterValidateCU]() { this.form.resourcePermissionIds = Array.from(this.checkedIds) }, + /** + * 加载数据权限窗口 + */ + editDataPermission(data) { + console.log('加载数据权限窗口') + Utils.$emit('openDataPermission', data) + }, /** * 改变展示方式 */