From be3c2204aa2084568862a6b5e50e1ed56fb93c35 Mon Sep 17 00:00:00 2001 From: 20300 <643145201@qq.com> Date: Sat, 27 Apr 2024 20:18:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=8E=88=E6=9D=83=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E9=83=A8=E9=97=A8=E5=92=8C=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/dataSource/Permissions.js | 8 + .../auth/AuthDataSource.vue | 249 ++---------------- .../dataAssets/assetAuthorization/index.vue | 112 ++++---- 3 files changed, 69 insertions(+), 300 deletions(-) create mode 100644 src/api/dataSource/Permissions.js diff --git a/src/api/dataSource/Permissions.js b/src/api/dataSource/Permissions.js new file mode 100644 index 0000000..7a1a6be --- /dev/null +++ b/src/api/dataSource/Permissions.js @@ -0,0 +1,8 @@ +import request from '@/utils/request' + +export function getAllUserAndDept(dataType,dataId) { + return request({ + url: '/data/permissions/getAllUserAndDept?dataType='+dataType+'&dataId='+dataId, + method: 'get' + }) +} diff --git a/src/views/dataAssets/assetAuthorization/auth/AuthDataSource.vue b/src/views/dataAssets/assetAuthorization/auth/AuthDataSource.vue index 9718306..dd7211c 100644 --- a/src/views/dataAssets/assetAuthorization/auth/AuthDataSource.vue +++ b/src/views/dataAssets/assetAuthorization/auth/AuthDataSource.vue @@ -58,7 +58,7 @@ - + @@ -97,249 +97,34 @@ export default { pageNum: 1, pageSize: 1, // 基本信息 - baseInfo: { - name: "测试1", - systemName: "云计算系统", - databaseName: "yunjisuan", - }, + baseInfo: {}, // 部门列表 deptList: [], // 用户列表 userList: [] }; }, + props: { + userAndDeptDataPermissionsListResp: { + type: Object + } + }, + watch: { + userAndDeptDataPermissionsListResp: { + handler(newValue,oldValue){ + this.baseInfo = newValue.dataInfo + this.deptList = this.handleTree(newValue.deptDataPermissionList,"deptId") + console.log("前台deptList:",this.deptList) + this.userList = newValue.userDataPermissionsList + } + } + }, created() { this.loading = true; setTimeout(() => this.loading = false, 200) - this.init() }, methods: { parseTime, - init(){ - let response = { - "code": 200, - "msg": "操作成功", - "data": [ - { - "createBy": 1, - "createTime": "2023-09-29 11:47:27", - "updateBy": null, - "updateTime": null, - "deptId": 100, - "parentId": 0, - "ancestors": "0", - "deptName": "muyu牧鱼科技", - "orderNum": 0, - "leader": "muyu牧鱼", - "phone": "15888888888", - "email": "ry@qq.com", - "status": "0", - "delFlag": "0", - "parentName": null, - "children": [] - }, - { - "createBy": 1, - "createTime": "2023-09-29 11:47:27", - "updateBy": null, - "updateTime": null, - "deptId": 101, - "parentId": 100, - "ancestors": "0,100", - "deptName": "深圳总公司", - "orderNum": 1, - "leader": "muyu牧鱼", - "phone": "15888888888", - "email": "ry@qq.com", - "status": "0", - "delFlag": "0", - "parentName": null, - "children": [] - }, - { - "createBy": 1, - "createTime": "2023-09-29 11:47:27", - "updateBy": null, - "updateTime": null, - "deptId": 102, - "parentId": 100, - "ancestors": "0,100", - "deptName": "长沙分公司", - "orderNum": 2, - "leader": "muyu牧鱼", - "phone": "15888888888", - "email": "ry@qq.com", - "status": "0", - "delFlag": "0", - "parentName": null, - "children": [] - }, - { - "createBy": 1, - "createTime": "2023-09-29 11:47:27", - "updateBy": null, - "updateTime": null, - "deptId": 103, - "parentId": 101, - "ancestors": "0,100,101", - "deptName": "研发部门", - "orderNum": 1, - "leader": "muyu牧鱼", - "phone": "15888888888", - "email": "ry@qq.com", - "status": "0", - "delFlag": "0", - "parentName": null, - "children": [] - }, - { - "createBy": 1, - "createTime": "2023-09-29 11:47:27", - "updateBy": null, - "updateTime": null, - "deptId": 104, - "parentId": 101, - "ancestors": "0,100,101", - "deptName": "市场部门", - "isAuth": true, - "orderNum": 2, - "leader": "muyu牧鱼", - "phone": "15888888888", - "email": "ry@qq.com", - "status": "0", - "delFlag": "0", - "parentName": null, - "children": [] - }, - { - "createBy": 1, - "createTime": "2023-09-29 11:47:27", - "updateBy": null, - "updateTime": null, - "deptId": 105, - "parentId": 101, - "ancestors": "0,100,101", - "deptName": "测试部门", - "orderNum": 3, - "leader": "muyu牧鱼", - "phone": "15888888888", - "email": "ry@qq.com", - "status": "0", - "delFlag": "0", - "parentName": null, - "children": [] - }, - { - "createBy": 1, - "createTime": "2023-09-29 11:47:27", - "updateBy": null, - "updateTime": null, - "deptId": 106, - "parentId": 101, - "ancestors": "0,100,101", - "deptName": "财务部门", - "orderNum": 4, - "leader": "muyu牧鱼", - "phone": "15888888888", - "email": "ry@qq.com", - "status": "0", - "delFlag": "0", - "parentName": null, - "children": [] - }, - { - "createBy": 1, - "createTime": "2023-09-29 11:47:27", - "updateBy": null, - "updateTime": null, - "deptId": 107, - "parentId": 101, - "ancestors": "0,100,101", - "deptName": "运维部门", - "orderNum": 5, - "leader": "muyu牧鱼", - "phone": "15888888888", - "email": "ry@qq.com", - "status": "0", - "delFlag": "0", - "parentName": null, - "children": [] - }, - { - "createBy": 1, - "createTime": "2023-09-29 11:47:27", - "updateBy": null, - "updateTime": null, - "deptId": 108, - "parentId": 102, - "ancestors": "0,100,102", - "deptName": "市场部门", - "orderNum": 1, - "leader": "muyu牧鱼", - "phone": "15888888888", - "email": "ry@qq.com", - "status": "0", - "delFlag": "0", - "parentName": null, - "children": [] - }, - { - "createBy": 1, - "createTime": "2023-09-29 11:47:27", - "updateBy": null, - "updateTime": null, - "deptId": 109, - "parentId": 102, - "ancestors": "0,100,102", - "deptName": "财务部门", - "orderNum": 2, - "leader": "muyu牧鱼", - "phone": "15888888888", - "email": "ry@qq.com", - "status": "0", - "delFlag": "0", - "parentName": null, - "children": [] - } - ] - } - this.deptList = this.handleTree(response.data, "deptId"); - this.userList = [ - { - "createBy": "admin", - "createTime": "2023-04-23 16:11:38", - "updateBy": null, - "updateTime": null, - "remark": "管理员", - "userId": 1, - "deptId": 103, - "userName": "admin", - "nickName": "智能车联", - "email": "ry@163.com", - "phonenumber": "15888888888", - "isAuth": true, - "dept": { - "deptName": "研发部门" - } - }, - { - "createBy": "admin", - "createTime": "2023-04-23 16:11:38", - "updateBy": null, - "updateTime": null, - "remark": "测试员", - "userId": 2, - "deptId": 105, - "userName": "ry", - "nickName": "智能车联", - "email": "ry@qq.com", - "phonenumber": "15666666666", - "dept": { - "deptName": "测试部门" - } - } - ] - } }, }; diff --git a/src/views/dataAssets/assetAuthorization/index.vue b/src/views/dataAssets/assetAuthorization/index.vue index 76c455f..23bc0a3 100644 --- a/src/views/dataAssets/assetAuthorization/index.vue +++ b/src/views/dataAssets/assetAuthorization/index.vue @@ -2,30 +2,30 @@ + @node-click="(data) => showAssets=data.type">
-
{{ data.name + '('+data.databaseName + '-' + data.systemName+')' }}
-
{{ data.name + '-'+data.as + '(' + data.dataTotal+'条)' }}
+
{{ data.dataSource.name + '('+data.dataSource.dataSourceDatabaseName + '-' + data.dataSource.fromSystem+')' }}
+
{{ data.dataTable.tableName + '-'+data.dataTable.tableAnnotation + '(' + data.dataTable.recordCount+'条)' }}
- - + +
@@ -118,7 +97,4 @@ export default { .el-main { background-color: #f1f1f1; } -.custom-tree-node{ - height: 30px; -}