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) + }, /** * 改变展示方式 */