From a366d096592426d57cf156b148c79a615ceb0a5c Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 10 Apr 2023 18:17:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B7=B2=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E5=9B=BE=E6=A0=87=E9=AB=98=E4=BA=AE=E5=9B=9E?= =?UTF-8?q?=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/components/IconSelect/index.vue | 80 +++++++++++++++----- ruoyi-ui/src/views/system/menu/index.vue | 2 +- 2 files changed, 63 insertions(+), 19 deletions(-) diff --git a/ruoyi-ui/src/components/IconSelect/index.vue b/ruoyi-ui/src/components/IconSelect/index.vue index 20a5d1a8..9f7a9fac 100644 --- a/ruoyi-ui/src/components/IconSelect/index.vue +++ b/ruoyi-ui/src/components/IconSelect/index.vue @@ -1,14 +1,20 @@ @@ -17,6 +23,11 @@ import icons from './requireIcons' export default { name: 'IconSelect', + props: { + activeIcon: { + type: String + } + }, data() { return { name: '', @@ -46,22 +57,55 @@ export default { .icon-body { width: 100%; padding: 10px; + .icon-search { + position: relative; + margin-bottom: 5px; + } .icon-list { height: 200px; - overflow-y: scroll; - div { - height: 30px; - line-height: 30px; - margin-bottom: -5px; - cursor: pointer; - width: 33%; - float: left; + ::v-deep .el-scrollbar { + height: 100%; + .el-scrollbar__wrap { + overflow-x: hidden; + } } - span { - display: inline-block; - vertical-align: -0.15em; - fill: currentColor; - overflow: hidden; + .list-container { + display: flex; + flex-wrap: wrap; + .icon-item-wrapper { + width: calc(100% / 3); + height: 30px; + line-height: 30px; + margin-bottom: -5px; + cursor: pointer; + display: flex; + .icon-item { + display: flex; + max-width: 100%; + height: 100%; + padding: 0 2px; + &:hover { + background: #ececec; + border-radius: 5px; + } + .icon { + flex-shrink: 0; + } + span { + display: inline-block; + vertical-align: -0.15em; + fill: currentColor; + padding-left: 2px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + .icon-item.active { + background: #ececec; + border-radius: 5px; + } + } } } } diff --git a/ruoyi-ui/src/views/system/menu/index.vue b/ruoyi-ui/src/views/system/menu/index.vue index 38a2a8a3..cf4d28f7 100644 --- a/ruoyi-ui/src/views/system/menu/index.vue +++ b/ruoyi-ui/src/views/system/menu/index.vue @@ -134,7 +134,7 @@ trigger="click" @show="$refs['iconSelect'].reset()" > - +