From 5805bd955ab8609da4e403150c786b4f75ed1f2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=99=8C?= Date: Mon, 14 Aug 2023 19:02:35 +0800 Subject: [PATCH] no message --- src/style/fix.scss | 17 +++++++---------- src/views/user/group/save.vue | 9 ++++++++- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/style/fix.scss b/src/style/fix.scss index a938ba3..112b318 100644 --- a/src/style/fix.scss +++ b/src/style/fix.scss @@ -26,8 +26,11 @@ --el-upload-picture-card-size: 100%; } -.el-menu {border: none!important;} +.el-menu {border: none !important;} .el-menu .el-menu-item a {color: inherit;text-decoration: none;display: block;width:100%;height:100%;position: absolute;top:0px;left:0px;} + +.el-menu-item.is-active {color: var(--el-menu-active-color); background-color: #f9f9f9; } + .el-form-item-msg {font-size: 12px;color: #999;clear: both;width: 100%;} .el-container {height: 100%;} .el-aside {border-right: 1px solid var(--el-border-color-light);} @@ -44,14 +47,10 @@ .el-card__header {border-bottom: 0;font-size: 17px;font-weight: bold;padding:15px 20px 0px 20px;} .el-dialog__title {font-size: 17px;font-weight: bold;} -.el-drawer__header{ - margin-bottom: 12px; -} +.el-drawer__header{margin-bottom: 12px; } -.el-menu--collapse { - --el-menu-base-level-padding: 22px; -} +.el-menu--collapse {--el-menu-base-level-padding: 22px; } .el-drawer__header>:first-child {font-size: 17px;font-weight: bold;} .el-tree.menu .el-tree-node__content {height:36px;} @@ -80,9 +79,7 @@ .el-table th.is-sortable:hover {background: #eee;} .el-table .el-table__body-wrapper {background: #f6f8f9;} -.el-descriptions__body .el-descriptions__table .el-descriptions__cell{ - font-size: 13px; -} +.el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size: 13px; } .el-radio-button__inner {font-size: 12px;} .el-checkbox-button__inner {font-size: 12px;} diff --git a/src/views/user/group/save.vue b/src/views/user/group/save.vue index 6ef3fd1..4374636 100644 --- a/src/views/user/group/save.vue +++ b/src/views/user/group/save.vue @@ -212,7 +212,6 @@ // this.form = data Object.assign(this.form, data) - this.menu.checked = this.form.authority.menu || []; this.grid.checked = this.form.authority.grid || []; this.dept.checked = this.form.authority.dept || []; @@ -221,6 +220,14 @@ if (res.code==200) { // Object.assign(this.$data, res.data); this.menu.list = res.data.menu || []; + //获取接口返回的之前选中的和半选的合并,处理过滤掉有叶子节点的key + this.menu.checked = this.form.authority.menu || [] + this.$nextTick(() => { + let filterKeys = this.menu.checked.filter(key => this.$refs.menu.getNode(key).isLeaf) + this.$refs.menu.setCheckedKeys(filterKeys, true) + }) + + this.grid.list = res.data.grid || []; this.dept.list = res.data.dept || []; return false;