gaoluyang
5 天以前 c7566bba45e6f90594d36ec4b80ac4ff89f577ee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
@use './variables.module.scss' as vars;
 
#app {
 
  .main-container {
    min-height: 100%;
    transition: margin-left .28s;
    margin-left: vars.$base-sidebar-width;
    position: relative;
  }
 
  .sidebarHide {
    margin-left: 0!important;
  }
 
  .sidebar-container {
    transition: width 0.28s;
    width: vars.$base-sidebar-width !important;
    height: 100%;
    position: fixed;
    font-size: 0px;
    /* 业务定制:侧边栏从 50px 顶栏下方开始 */
    top: 50px;
    bottom: 0;
    left: 0;
    z-index: 1001;
    overflow: hidden;
    box-shadow: var(--lims-shadow);
 
    // reset element-ui css
    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
    }
 
    .scrollbar-wrapper {
      overflow-x: hidden !important;
    }
 
    .el-scrollbar__bar.is-vertical {
      right: 0px;
    }
 
    .el-scrollbar {
      height: 100%;
    }
 
    &.has-logo {
      .el-scrollbar {
        height: calc(100% - 50px);
      }
    }
 
    .is-horizontal {
      display: none;
    }
 
    a {
      display: inline-block;
      width: 100%;
      overflow: hidden;
    }
 
    .svg-icon {
      margin-right: 10px !important;
    }
 
    .el-menu {
      border: none;
      height: 100%;
      width: 100% !important;
    }
 
    .el-menu-item, .menu-title {
      overflow: hidden !important;
      text-overflow: ellipsis !important;
      white-space: nowrap !important;
      height: 44px !important;
      line-height: 44px !important;
    }
 
    .el-menu-item .el-menu-tooltip__trigger {
      display: inline-block !important;
    }
 
    // menu hover
    .sub-menu-title-noDropdown,
    .el-sub-menu__title {
      &:hover {
        background-color: var(--menu-hover);
      }
    }
 
    & .theme-dark .is-active > .el-sub-menu__title {
      color: vars.$base-menu-color-active !important;
    }
 
    & .nest-menu .el-sub-menu>.el-sub-menu__title,
    & .el-sub-menu .el-menu-item {
      min-width: vars.$base-sidebar-width !important;
 
      &:hover {
        background-color: var(--menu-hover);
      }
    }
 
    & .theme-dark .nest-menu .el-sub-menu>.el-sub-menu__title,
    & .theme-dark .el-sub-menu .el-menu-item {
      background-color: vars.$base-sub-menu-background;
 
      &:hover {
        background-color: vars.$base-sub-menu-hover !important;
      }
    }
 
    // theme-dark 深色主题
    &.theme-dark {
      box-shadow: 2px 0 8px rgba(0, 0, 0, 0.4);
      border-right: none;
 
      .el-menu-item.is-active {
        position: relative;
 
        &::before {
          content: '';
          position: absolute;
          inset: 0;
          background-color: var(--current-color-dark-bg, rgba(13, 148, 136, 0.2));
          pointer-events: none;
          z-index: 1;
        }
      }
 
      .el-sub-menu.is-active > .el-sub-menu__title {
        color: var(--current-color, var(--el-color-primary)) !important;
      }
 
      .el-menu-item:not(.is-active),
      .submenu-title-noDropdown,
      .el-sub-menu__title {
        position: relative;
 
        &::before {
          content: '';
          position: absolute;
          inset: 0;
          background-color: transparent;
          pointer-events: none;
          z-index: 1;
          transition: background-color 0.2s;
        }
 
        &:hover::before {
          background-color: var(--current-color-dark-bg, rgba(13, 148, 136, 0.2));
        }
      }
    }
    
    // theme-light 浅色主题(实验室青绿:白底 + 青绿选中 + 左侧 3px 竖条)
    &.theme-light {
      border-right: 1px solid var(--sidebar-border, #eef1f1);
      box-shadow: var(--lims-shadow);
 
      .el-menu-item,
      .el-sub-menu__title {
        position: relative;
        color: var(--sidebar-text, #{vars.$base-menu-color});
      }
 
      // 二级菜单展开箭头跟随文字色(element-plus 默认为占位灰)
      .el-sub-menu__title .el-sub-menu__icon-arrow {
        color: inherit !important;
      }
 
      // 选中:浅青底 + 主色文字
      .el-menu-item.is-active {
        color: var(--el-color-primary) !important;
        background-color: var(--menu-active-bg, #e4f2ef) !important;
        font-weight: 600;
      }
 
      // 选中项左侧竖条
      .el-menu-item.is-active::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        background-color: var(--el-color-primary);
        border-radius: 0 2px 2px 0;
      }
 
      .el-sub-menu.is-active > .el-sub-menu__title {
        color: var(--el-color-primary) !important;
        font-weight: 600;
        background-color: transparent !important;
      }
 
      .el-menu-item:not(.is-active):hover,
      .submenu-title-noDropdown:hover,
      .el-sub-menu__title:hover {
        background-color: var(--menu-hover) !important;
        color: var(--el-color-primary) !important;
      }
 
      // 二级菜单展开面:极浅灰底,与一级菜单区分层次
      .nest-menu .el-sub-menu > .el-sub-menu__title,
      .el-sub-menu .el-menu-item {
        background-color: var(--sidebar-sub-bg, #{vars.$base-sub-menu-background});
 
        &:hover {
          background-color: var(--sidebar-sub-hover, #{vars.$base-sub-menu-hover}) !important;
        }
      }
    }
  }
 
  .hideSidebar {
    .sidebar-container {
      width: 70px !important;
    }
 
    .main-container {
      margin-left: 70px;
    }
 
    .sub-menu-title-noDropdown {
      padding: 0 !important;
      position: relative;
 
      .el-tooltip {
        padding: 0 !important;
 
        .svg-icon {
          width: 1.5em;
          height: 1.5em;
          margin-left: 25px;
        }
      }
    }
 
    // 折叠态:选中项不铺底色,避免窄条上出现色块(业务定制)
    .el-menu-item.is-active,
    .el-sub-menu.is-active > .el-sub-menu__title {
      background-color: transparent !important;
    }
 
    .el-sub-menu {
      overflow: hidden;
 
      &>.el-sub-menu__title {
        padding: 0 !important;
 
        .svg-icon {
          width: 1.5em;
          height: 1.5em;
          margin-left: 25px;
        }
 
      }
    }
 
    // 折叠态:图标在上、文字在下(业务定制,与旧版一致)
    .el-menu--collapse {
      .el-sub-menu {
        &>.el-sub-menu__title {
          height: auto;
          flex-direction: column;
          align-items: center;
          margin-bottom: 10px;
 
          &>span {
            display: block !important;
            visibility: visible !important;
            white-space: normal;
            text-align: center;
            line-height: normal;
          }
        }
      }
    }
  }
 
  .el-menu--collapse .el-menu .el-sub-menu {
    min-width: vars.$base-sidebar-width !important;
  }
 
  // mobile responsive
  .mobile {
    .main-container {
      margin-left: 0px;
    }
 
    .sidebar-container {
      transition: transform .28s;
      width: vars.$base-sidebar-width !important;
    }
 
    &.hideSidebar {
      .sidebar-container {
        pointer-events: none;
        transition-duration: 0.3s;
        transform: translate3d(-(vars.$base-sidebar-width), 0, 0);
      }
    }
  }
 
  .withoutAnimation {
 
    .main-container,
    .sidebar-container {
      transition: none;
    }
  }
}
 
// when menu collapsed
.el-menu--vertical {
  &>.el-menu {
    .svg-icon {
      margin-right: 16px;
    }
  }
 
  .nest-menu .el-sub-menu>.el-sub-menu__title,
  .el-menu-item {
    &:hover {
      // you can use $sub-menuHover
      background-color: rgba(0, 0, 0, 0.06) !important;
    }
  }
 
  // the scroll bar appears when the sub-menu is too long
  >.el-menu--popup {
    max-height: 100vh;
    overflow-y: auto;
 
    &::-webkit-scrollbar-track-piece {
      background: #d3dce6;
    }
 
    &::-webkit-scrollbar {
      width: 6px;
    }
 
    &::-webkit-scrollbar-thumb {
      background: #99a9bf;
      border-radius: 20px;
    }
  }
}