From 1067567f1c7b5a4a809e5e5478323bf983b9136b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E5=BF=97=E8=8A=B3?= Date: Sun, 9 Apr 2023 13:20:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E6=8B=89=E5=9B=BE=E6=A0=87=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E7=BB=84=E4=BB=B6=E4=BC=98=E5=8C=96=EF=BC=9A1.?= =?UTF-8?q?=E5=B7=B2=E9=80=89=E6=8B=A9=E5=9B=BE=E6=A0=87=E9=AB=98=E4=BA=AE?= =?UTF-8?q?=E5=9B=9E=E6=98=BE=202.=E6=BB=9A=E5=8A=A8=E6=9D=A1=E9=87=87?= =?UTF-8?q?=E7=94=A8el-scrollbar?= 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 2ace1224..24043214 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 2ee25af3..2a83f9e9 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()" > - +