diff --git a/README.md b/README.md index 87cc9d0..62bd05a 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@

- Downloads + Downloads Build Status Build Status Coverage Status - Downloads + Downloads Downloads diff --git a/package.json b/package.json index 382a184..9e76592 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "saber-admin", - "version": "3.1.0", + "version": "3.2.0", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/src/api/system/menu.js b/src/api/system/menu.js index 5ff0482..dc4266a 100644 --- a/src/api/system/menu.js +++ b/src/api/system/menu.js @@ -46,3 +46,14 @@ export const getMenu = (id) => { } }) } + +export const getLazyMenuList = (parentId, params) => { + return request({ + url: '/api/blade-system/menu/lazy-menu-list', + method: 'get', + params: { + ...params, + parentId + } + }) +} diff --git a/src/api/system/role.js b/src/api/system/role.js index 8a862ab..1801d43 100644 --- a/src/api/system/role.js +++ b/src/api/system/role.js @@ -18,13 +18,14 @@ export const grantTree = () => { }) } -export const grant = (roleIds, menuIds) => { +export const grant = (roleIds, menuIds, dataScopeIds) => { return request({ url: '/api/blade-system/role/grant', method: 'post', data: { roleIds, - menuIds + menuIds, + dataScopeIds } }) } diff --git a/src/api/system/scope.js b/src/api/system/scope.js new file mode 100644 index 0000000..938066d --- /dev/null +++ b/src/api/system/scope.js @@ -0,0 +1,50 @@ +import request from '@/router/axios'; + +export const getListDataScope = (current, size, params) => { + return request({ + url: '/api/blade-system/data-scope/list', + method: 'get', + params: { + ...params, + current, + size, + } + }) +} + +export const removeDataScope = (ids) => { + return request({ + url: '/api/blade-system/data-scope/remove', + method: 'post', + params: { + ids, + } + }) +} + +export const addDataScope = (row) => { + return request({ + url: '/api/blade-system/data-scope/submit', + method: 'post', + data: row + }) +} + +export const updateDataScope = (row) => { + return request({ + url: '/api/blade-system/data-scope/submit', + method: 'post', + data: row + }) +} + +export const getMenuDataScope = (id) => { + return request({ + url: '/api/blade-system/data-scope/detail', + method: 'get', + params: { + id, + } + }) +} + diff --git a/src/lang/en.js b/src/lang/en.js index 5cb73c7..8e1b6a0 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -50,7 +50,6 @@ export default { route: { info: 'info', website: 'website', - avuexwebsite: 'avuex', dashboard: 'dashboard', tags: 'tags', store: 'store', diff --git a/src/lang/zh.js b/src/lang/zh.js index 854f0aa..0e71651 100644 --- a/src/lang/zh.js +++ b/src/lang/zh.js @@ -50,7 +50,6 @@ export default { route: { info: '个人信息', website: 'bladex官网', - avuexwebsite: 'avuex官网', dashboard: '首页', tags: '标签', store: '本地存储', diff --git a/src/mock/menu.js b/src/mock/menu.js index ce5eaea..8bcaada 100644 --- a/src/mock/menu.js +++ b/src/mock/menu.js @@ -18,15 +18,6 @@ const top = [{ path: "https://bladex.vip/#/", parentId: 1 }, - { - label: "avuex官网", - icon: 'el-icon-document', - meta: { - i18n: 'avuexwebsite', - }, - path: "https://avuex.avue.top", - parentId: 2 - }, { label: "测试", icon: 'el-icon-document', diff --git a/src/views/authority/datascope.vue b/src/views/authority/datascope.vue new file mode 100644 index 0000000..330e8ac --- /dev/null +++ b/src/views/authority/datascope.vue @@ -0,0 +1,727 @@ + + + + diff --git a/src/views/system/role.vue b/src/views/authority/role.vue similarity index 82% rename from src/views/system/role.vue rename to src/views/authority/role.vue index 53f6b25..9954349 100644 --- a/src/views/system/role.vue +++ b/src/views/authority/role.vue @@ -32,14 +32,27 @@ - - + width="345px"> + + + + + + + + + + 取 消 @@ -64,8 +77,10 @@ label: "title", value: "key" }, - list: [], - defaultObj: [], + menuGrantList: [], + dataScopeGrantList: [], + menuTreeObj: [], + dataScopeTreeObj: [], selectionList: [], query: {}, loading: true, @@ -194,8 +209,9 @@ }, methods: { submit() { - const menuLIst = this.$refs.tree.getCheckedKeys(); - grant(this.idsArray, menuLIst).then(() => { + const menuList = this.$refs.treeMenu.getCheckedKeys(); + const dataScopeList = this.$refs.treeDataScope.getCheckedKeys(); + grant(this.idsArray, menuList, dataScopeList).then(() => { this.box = false; this.$message({ type: "success", @@ -203,6 +219,16 @@ }); this.onLoad(this.page); }); + + /*const menuLIst = this.$refs.tree.getCheckedKeys(); + grant(this.idsArray, menuLIst).then(() => { + this.box = false; + this.$message({ + type: "success", + message: "操作成功!" + }); + this.onLoad(this.page); + });*/ }, rowSave(row, done, loading) { add(row).then(() => { @@ -266,7 +292,21 @@ this.$message.warning("只能选择一条数据"); return; } - this.defaultObj = []; + this.menuTreeObj = []; + this.dataScopeTreeObj = []; + grantTree() + .then(res => { + this.menuGrantList = res.data.data.menu; + this.dataScopeGrantList = res.data.data.dataScope; + getRole(this.ids).then(res => { + this.menuTreeObj = res.data.data.menu; + this.dataScopeTreeObj = res.data.data.dataScope; + this.box = true; + }); + }); + + + /*this.defaultObj = []; grantTree() .then(res => { this.list = res.data.data; @@ -275,7 +315,7 @@ .then(res => { this.defaultObj = res.data.data; this.box = true; - }); + });*/ }, handleDelete() { if (this.selectionList.length === 0) { diff --git a/src/views/wel/index.vue b/src/views/wel/index.vue index 84b541e..578d7dd 100644 --- a/src/views/wel/index.vue +++ b/src/views/wel/index.vue @@ -3,10 +3,10 @@

- Downloads + Downloads Build Status Coverage Status - Downloads + Downloads Downloads @@ -125,6 +125,23 @@ + +

1.升级 SpringBoot 至 2.5.6
+
2.升级 SpringBootAdmin 至 2.5.3
+
3.升级 SpringCloud 至 2020.0.4
+
4.升级 Nacos 至 2.0.3
+
5.升级 Knife4j 至 2.0.9
+
6.升级 Mybatis-Plus 至 3.4.3.4
+
7.新增注解配置数据权限特性
+
8.新增Web在线配置数据权限特性
+
9.新增自定义Sql配置数据权限特性
+
10.新增懒加载表格树特性
+
11.新增部门管理祖级节点字段
+
12.新增CacheUtil工具类
+
13.优化部门管理新增逻辑
+
14.优化租户拦截器初始化逻辑
+
15.优化适配各新版本API变动
+
1.升级 SpringBoot 至 2.5.2
2.升级 SpringBootAdmin 至 2.4.2
@@ -411,7 +428,7 @@ data() { return { activeNames: ['1', '2', '3', '5'], - logActiveNames: ['26'] + logActiveNames: ['27'] }; }, computed: {