From 5d3d0b3c7647c25da67dd9c725764dc132808aef Mon Sep 17 00:00:00 2001 From: rouchen <3133657697@qq.com> Date: Sat, 27 Apr 2024 19:50:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=95=B0=E6=8D=AE=E6=8E=88=E6=9D=83(?= =?UTF-8?q?=E5=88=9D=E7=89=88)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/kvt/kvt.js | 8 +- .../auth/AuthDataSource.vue | 161 +++++++++----- .../kvt/assetAuthorization/auth/AuthTable.vue | 206 ++++++++++-------- src/views/kvt/assetAuthorization/index.vue | 130 +++++++++-- src/views/system/user/index.vue | 1 - 5 files changed, 339 insertions(+), 167 deletions(-) diff --git a/src/api/kvt/kvt.js b/src/api/kvt/kvt.js index 0ce3db8..2889487 100644 --- a/src/api/kvt/kvt.js +++ b/src/api/kvt/kvt.js @@ -121,13 +121,7 @@ export function selectChildAll() { method: 'post' }) } -//查询所有部门列表 -export function selectDept() { - return request({ - url: '/kvt/kvt/selectDept', - method: 'post' - }) -} + //查询字典 export function selectDictionaryy(id) { return request({ diff --git a/src/views/kvt/assetAuthorization/auth/AuthDataSource.vue b/src/views/kvt/assetAuthorization/auth/AuthDataSource.vue index 760c03b..4ff236e 100644 --- a/src/views/kvt/assetAuthorization/auth/AuthDataSource.vue +++ b/src/views/kvt/assetAuthorization/auth/AuthDataSource.vue @@ -1,33 +1,34 @@ + @@ -67,11 +72,14 @@ @@ -90,7 +98,9 @@ import { listDept } from '@/api/system/dept' export default { name: "AuthDataSource", props: [ - "DataSource" + "deptlists", + "DataSource", + "userList" ], data() { return { @@ -102,27 +112,62 @@ export default { pageNum: 1, pageSize: 1, // 基本信息 - baseInfo: { - }, + baseInfo: {}, + // 部门列表 deptList: [], - // 用户列表 - userList: [] + // // 用户列表 + // userList: [] }; }, created() { this.loading = true; setTimeout(() => this.loading = false, 200) - this.init() + }, + watch: { + 'activeName.status'(newVal) { + if (newVal === 0) { + alert("闭关") + + // 开关为激活状态,执行相关逻辑 + } else if (newVal === 1) { + alert("打开") + // 开关为未激活状态,执行相关逻辑 + } + }, + 'userList.status'(newVal) { + if (newVal === 0) { + alert("闭关") + + // 开关为激活状态,执行相关逻辑 + } else if (newVal === 1) { + alert("打开") + // 开关为未激活状态,执行相关逻辑 + } + } }, methods: { parseTime, - init(){ - let response = []; - listDept().then(res => { - console.log(res) - this.deptList = res.date - }) + + /** 转换部门数据结构 */ + normalizer(node) { + if (node.children && !node.children.length) { + delete node.children; + } + return { + id: node.deptId, + label: node.deptName, + children: node.children + }; + + }, + + // init(){ + // let response = []; + // listDept().then(res => { + // console.log(res) + // this.deptList = res.date + // }) // "code": 200, // "msg": "操作成功", @@ -165,43 +210,43 @@ export default { // }, // ] - 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": "测试部门" - } - } - ] - } + // 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/kvt/assetAuthorization/auth/AuthTable.vue b/src/views/kvt/assetAuthorization/auth/AuthTable.vue index a71ccd9..0c1d26f 100644 --- a/src/views/kvt/assetAuthorization/auth/AuthTable.vue +++ b/src/views/kvt/assetAuthorization/auth/AuthTable.vue @@ -1,6 +1,7 @@