element.scss 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. @import 'mixins/index.scss';
  2. /* Button 按钮
  3. ------------------------------- */
  4. .el-button {
  5. font-family: var(--el-font-family);
  6. }
  7. // 第三方字体图标大小
  8. .el-button:not(.is-circle) i.el-icon,
  9. .el-button i.iconfont,
  10. .el-button i.fa,
  11. .el-button--default i.iconfont,
  12. .el-button--default i.fa {
  13. font-size: 14px !important;
  14. margin-right: 5px;
  15. }
  16. .el-button--small i.iconfont,
  17. .el-button--small i.fa {
  18. font-size: 12px !important;
  19. margin-right: 5px;
  20. }
  21. /* Input 输入框、InputNumber 计数器
  22. ------------------------------- */
  23. // 菜单搜索
  24. .el-autocomplete-suggestion__wrap {
  25. max-height: 280px !important;
  26. }
  27. // InputNumber无控制器时与Input保持一致
  28. .el-input-number.is-without-controls .el-input__wrapper {
  29. padding-left: 7px !important;
  30. padding-right: 7px !important;
  31. .el-input__inner {
  32. text-align: left !important;
  33. }
  34. }
  35. .el-date-editor {
  36. //--el-date-editor-width: 220px;
  37. //--el-date-editor-monthrange-width: 300px;
  38. --el-date-editor-daterange-width: 250px;
  39. //--el-date-editor-datetimerange-width: 400px;
  40. }
  41. /* Form 表单
  42. ------------------------------- */
  43. .el-form {
  44. // 用于修改弹窗时表单内容间隔太大问题,如系统设置的新增菜单弹窗里的表单内容
  45. .el-form-item:last-of-type {
  46. margin-bottom: 0 !important;
  47. }
  48. // 修复行内表单最后一个 el-form-item 位置下移问题
  49. &.el-form--inline {
  50. // .el-form-item--large.el-form-item:last-of-type {
  51. // margin-bottom: 22px !important;
  52. // }
  53. // .el-form-item--default.el-form-item:last-of-type,
  54. // .el-form-item--small.el-form-item:last-of-type {
  55. // margin-bottom: 18px !important;
  56. // }
  57. .el-form-item,.el-form-item:last-of-type {
  58. margin: 5px 15px !important;
  59. .el-select,.el-input {
  60. width: 200px !important;
  61. }
  62. }
  63. }
  64. // https://gitee.com/lyt-top/vue-next-admin/issues/I5K1PM
  65. .el-form-item .el-form-item__label .el-icon {
  66. margin-right: 0px;
  67. }
  68. }
  69. /* Alert 警告
  70. ------------------------------- */
  71. .el-alert {
  72. border: 1px solid;
  73. }
  74. .el-alert__title {
  75. word-break: break-all;
  76. }
  77. /* Message 消息提示
  78. ------------------------------- */
  79. .el-message {
  80. min-width: unset !important;
  81. padding: 15px !important;
  82. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.02);
  83. }
  84. /* NavMenu 导航菜单
  85. ------------------------------- */
  86. // 鼠标 hover 时颜色
  87. .el-menu-hover-bg-color {
  88. background-color: var(--next-bg-menuBarActiveColor) !important;
  89. //background-color: var(--el-color-primary-light-7) !important;
  90. }
  91. // 默认样式修改
  92. .el-menu {
  93. border-right: none !important;
  94. width: auto;
  95. }
  96. .el-menu-item,
  97. .el-sub-menu__title {
  98. color: var(--next-bg-menuBarColor);
  99. height: 45px !important;
  100. line-height: 45px !important;
  101. // margin: 0 0 1px 0;
  102. }
  103. // 修复点击左侧菜单折叠再展开时,宽度不跟随问题
  104. .el-menu--collapse {
  105. width: 64px !important;
  106. }
  107. // 外部链接时
  108. .el-menu-item a,
  109. .el-menu-item a:hover,
  110. .el-menu-item i,
  111. .el-sub-menu__title i {
  112. color: inherit;
  113. text-decoration: none;
  114. }
  115. // 第三方图标字体间距/大小设置
  116. .el-menu-item .iconfont,
  117. .el-sub-menu .iconfont,
  118. .el-menu-item .fa,
  119. .el-sub-menu .fa {
  120. @include generalIcon;
  121. }
  122. // 水平菜单、横向菜单高亮 背景色,鼠标 hover 时,有子级菜单的背景色
  123. .el-menu-item.is-active,
  124. .el-sub-menu.is-active .el-sub-menu__title,
  125. .el-sub-menu:not(.is-opened):hover .el-sub-menu__title {
  126. @extend .el-menu-hover-bg-color;
  127. color: var(--el-color-primary-dark-2);
  128. }
  129. .el-sub-menu:not(.is-active) .el-sub-menu__title {
  130. color: var(--next-bg-menuBarColor);
  131. }
  132. // 鼠标 hover 时背景色
  133. .el-menu-item:hover {
  134. //@extend .el-menu-hover-bg-color;
  135. background-color: var(--el-color-primary-light-9);
  136. }
  137. .el-sub-menu.is-active.is-opened .el-sub-menu__title {
  138. background-color: unset !important;
  139. }
  140. // 当前选中菜单右侧边框
  141. .el-menu-item.is-active {
  142. border-right: solid 3px var(--el-color-primary);
  143. }
  144. // 子级菜单背景颜色
  145. // .el-menu--inline {
  146. // background: var(--next-bg-menuBar-light-1);
  147. // }
  148. // 水平菜单、横向菜单折叠 a 标签
  149. .el-popper.is-dark a {
  150. color: var(--el-color-white) !important;
  151. text-decoration: none;
  152. }
  153. // 水平菜单、横向菜单折叠背景色
  154. .el-popper.is-pure.is-light {
  155. // 水平菜单
  156. .el-menu--vertical {
  157. background: var(--next-bg-menuBar);
  158. .el-sub-menu.is-active .el-sub-menu__title {
  159. color: var(--el-menu-active-color);
  160. }
  161. .el-popper.is-pure.is-light {
  162. .el-menu--vertical {
  163. .el-sub-menu .el-sub-menu__title {
  164. background-color: unset !important;
  165. color: var(--next-bg-menuBarColor);
  166. }
  167. .el-sub-menu.is-active .el-sub-menu__title {
  168. color: var(--el-menu-active-color);
  169. }
  170. }
  171. }
  172. }
  173. // 横向菜单
  174. .el-menu--horizontal {
  175. background: var(--next-bg-topBar);
  176. .el-menu-item,
  177. .el-sub-menu {
  178. height: 45px !important;
  179. line-height: 45px !important;
  180. color: var(--next-bg-topBarColor);
  181. .el-sub-menu__title {
  182. height: 45px !important;
  183. line-height: 45px !important;
  184. color: var(--next-bg-topBarColor);
  185. }
  186. .el-popper.is-pure.is-light {
  187. .el-menu--horizontal {
  188. .el-sub-menu .el-sub-menu__title {
  189. background-color: unset !important;
  190. color: var(--next-bg-topBarColor);
  191. }
  192. .el-sub-menu.is-active .el-sub-menu__title {
  193. color: var(--el-menu-active-color);
  194. }
  195. }
  196. }
  197. }
  198. .el-menu-item.is-active,
  199. .el-sub-menu.is-active .el-sub-menu__title {
  200. color: var(--el-menu-active-color);
  201. }
  202. // 鼠标 hover 时背景色
  203. .el-menu-item:hover {
  204. background-color: var(--el-color-primary-light-9);
  205. }
  206. }
  207. }
  208. // 横向菜单(经典、横向)布局
  209. .el-menu.el-menu--horizontal {
  210. border-bottom: none !important;
  211. width: 100% !important;
  212. .el-menu-item,
  213. .el-sub-menu__title {
  214. height: 50px !important;
  215. color: var(--next-bg-topBarColor);
  216. }
  217. .el-menu-item:not(.is-active):hover,
  218. .el-sub-menu:not(.is-active):hover .el-sub-menu__title {
  219. color: var(--next-bg-topBarColor);
  220. //border-right: solid 3px var(--el-color-primary);
  221. }
  222. // 鼠标 hover 时背景色
  223. .el-menu-item:hover {
  224. background-color: var(--el-color-primary-light-9);
  225. }
  226. // 菜单激活时去掉全局右边框
  227. .el-menu-item.is-active {
  228. border-right: none;
  229. }
  230. }
  231. // 菜单收起时,图标不居中问题
  232. .el-menu--collapse {
  233. .el-menu-item .iconfont,
  234. .el-sub-menu .iconfont,
  235. .el-menu-item .fa,
  236. .el-sub-menu .fa {
  237. margin-right: 0 !important;
  238. }
  239. .el-sub-menu__title {
  240. padding-right: 0 !important;
  241. }
  242. }
  243. /* Tabs 标签页
  244. ------------------------------- */
  245. .el-tabs__nav-wrap::after {
  246. height: 1px !important;
  247. }
  248. /* Dropdown 下拉菜单
  249. ------------------------------- */
  250. .el-dropdown-menu {
  251. list-style: none !important;
  252. /*修复 Dropdown 下拉菜单样式问题 2022.03.04*/
  253. }
  254. .el-dropdown-menu .el-dropdown-menu__item {
  255. white-space: nowrap;
  256. &:not(.is-disabled):hover {
  257. background-color: var(--el-dropdown-menuItem-hover-fill);
  258. color: var(--el-dropdown-menuItem-hover-color);
  259. }
  260. }
  261. /* Steps 步骤条
  262. ------------------------------- */
  263. .el-step__icon-inner {
  264. font-size: 30px !important;
  265. font-weight: 400 !important;
  266. }
  267. .el-step__title {
  268. font-size: 14px;
  269. }
  270. /* Dialog 对话框
  271. ------------------------------- */
  272. .el-overlay {
  273. overflow: hidden;
  274. .el-overlay-dialog {
  275. display: flex;
  276. align-items: center;
  277. justify-content: center;
  278. position: unset !important;
  279. width: 100%;
  280. height: 100%;
  281. .el-dialog {
  282. padding: 0 !important;
  283. margin: 0 auto !important;
  284. position: absolute;
  285. .el-dialog__body {
  286. padding: 18px !important;
  287. }
  288. }
  289. }
  290. }
  291. .el-dialog__body {
  292. max-height: calc(100vh - 160px) !important;
  293. overflow-y: auto;
  294. overflow-x: auto;
  295. }
  296. // .el-dialog__title{
  297. // font-size: 14px;
  298. // color: #FFF;
  299. // //font-weight: 700;
  300. // line-height: normal;
  301. // }
  302. .el-dialog__header {
  303. margin-right: 0;
  304. padding: 8px;
  305. border-radius: var(--el-dialog-border-radius) var(--el-dialog-border-radius) 0 0;
  306. background: var(--el-color-primary);
  307. }
  308. .el-dialog__footer {
  309. padding: 15px;
  310. // border-top: 1px solid var(--el-color-primary-light-7);
  311. }
  312. .el-dialog__headerbtn {
  313. height: 37px;
  314. width: 40px;
  315. font-weight: 900;
  316. .el-dialog__close {
  317. color: #fff;
  318. }
  319. }
  320. .el-dialog__headerbtn:hover .el-dialog__close {
  321. color: var(--el-color-danger) !important;
  322. }
  323. /* Card 卡片
  324. ------------------------------- */
  325. .el-card__header {
  326. padding: 15px 20px;
  327. }
  328. .el-card__body {
  329. padding: 8px;
  330. }
  331. // 由于card没有size属性,所以通过其子元素来判断,当组件大小选择为默认时
  332. .el-card__body:has(.el-table--default) {
  333. padding: 20px;
  334. }
  335. /* Table 表格 element plus 2.2.0 版本
  336. ------------------------------- */
  337. .el-table {
  338. // 表头背景色
  339. --el-table-header-bg-color: var(--next-bg-main-color);
  340. .el-button.is-text {
  341. padding: 0;
  342. }
  343. // 表头字体颜色
  344. thead {
  345. color: var(--el-text-color-regular);
  346. th {
  347. font-weight: 500;
  348. }
  349. }
  350. }
  351. /*防止分栏布局二级菜单很多时,滚动条消失问题*/
  352. .layout-columns-warp .layout-aside .el-scrollbar__view {
  353. height: unset !important;
  354. }
  355. /* Pagination 分页
  356. ------------------------------- */
  357. // .el-pagination__editor {
  358. // margin-right: 8px;
  359. // }
  360. /*深色模式时分页高亮问题*/
  361. .el-pagination.is-background .btn-next.is-active,
  362. .el-pagination.is-background .btn-prev.is-active,
  363. .el-pagination.is-background .el-pager li.is-active {
  364. background-color: var(--el-color-primary) !important;
  365. color: var(--el-color-white) !important;
  366. }
  367. // 分页组件靠右显示
  368. .el-pagination {
  369. float: right;
  370. margin: 8px 0 0 0 !important;
  371. }
  372. // 强制给分页组件的下拉框设置宽度
  373. .el-pagination--small {
  374. .el-select {
  375. width: 100px !important;
  376. }
  377. }
  378. /* scrollbar
  379. ------------------------------- */
  380. .el-scrollbar__bar {
  381. z-index: 4;
  382. }
  383. /*防止页面切换时,滚动条高度不变的问题(滚动条高度非滚动条滚动高度)*/
  384. .el-scrollbar__wrap {
  385. max-height: 100%;
  386. }
  387. .el-select-dropdown .el-scrollbar__wrap {
  388. overflow-x: scroll !important;
  389. }
  390. /*修复Select 选择器高度问题*/
  391. .el-select-dropdown__wrap {
  392. max-height: 274px !important;
  393. }
  394. /*修复Cascader 级联选择器高度问题*/
  395. .el-cascader-menu__wrap.el-scrollbar__wrap {
  396. height: 204px !important;
  397. }
  398. /*用于界面高度自适应(main.vue),区分 scrollbar__view,防止其它使用 scrollbar 的地方出现滚动条消失*/
  399. .layout-container-view .el-scrollbar__view {
  400. height: 100%;
  401. }
  402. /* Drawer 抽屉
  403. ------------------------------- */
  404. .el-drawer {
  405. --el-drawer-padding-primary: unset !important;
  406. .el-drawer__header {
  407. padding: 8px !important;
  408. display: flex;
  409. align-items: center;
  410. margin-bottom: 0 !important;
  411. border-bottom: 1px solid var(--el-border-color);
  412. color: var(--el-color-white);
  413. background-color: var(--el-color-primary);
  414. }
  415. .el-drawer__body {
  416. width: 100%;
  417. height: 100%;
  418. overflow: auto;
  419. }
  420. .el-drawer__footer {
  421. padding: 5px;
  422. }
  423. }
  424. .el-drawer__close-btn:hover .el-drawer__close {
  425. color: var(--el-color-danger) !important;
  426. }
  427. // 级联选择-点击文本也生效
  428. .el-cascader-panel .el-radio {
  429. width: 100%;
  430. height: 100%;
  431. z-index: 10;
  432. position: absolute;
  433. top: 0px;
  434. right: -8px;
  435. }
  436. .el-cascader-panel .el-checkbox {
  437. width: 100%;
  438. height: 100%;
  439. z-index: 10;
  440. position: absolute;
  441. top: 0px;
  442. right: 0px;
  443. }
  444. .el-tree {
  445. --el-tree-node-content-height: 30px;
  446. }
  447. .el-table .el-table__cell {
  448. &:has(.cell .el-button, .el-tag, .el-switch, .el-avatar) {
  449. padding: 0;
  450. .cell { text-overflow: clip; }
  451. }
  452. .el-button.is-text {
  453. height: 20px;
  454. }
  455. .el-text--large {
  456. font-size: var(--el-font-size-base);;
  457. }
  458. .el-button--large {
  459. --el-button-size: 32px;
  460. }
  461. .el-tag--large {
  462. height: 28px;
  463. }
  464. .el-button--default {
  465. height: 28px;
  466. }
  467. .el-button [class*=el-icon]+span{
  468. margin-left: 0;
  469. }
  470. }
  471. .el-table [class*=el-table__row--level] .el-table__expand-icon {
  472. height: 14px;
  473. line-height: 14px;
  474. width: 14px;
  475. }
  476. $--el-table-text-color: #fb6d49;
  477. // hack列表页
  478. .layout-parent {
  479. height: 0;
  480. overflow: auto;
  481. // 方案一 如果怕影响其他页面,可以直接修改 src/views/home/index.vue 中 .home-container样式。
  482. // 方案二 此处修改是为了不修改框架原始页面,方便后期同步升级。
  483. // 自行取舍
  484. // 工作台 滚动条
  485. .home-container {
  486. overflow: auto !important;
  487. }
  488. // Table页自动撑满页面
  489. > div:first-child {
  490. display: flex;
  491. flex-direction: column;
  492. height: 100%;
  493. .full-table {
  494. flex: 1;
  495. display: flex;
  496. flex-direction: column;
  497. justify-content: space-between;
  498. .el-card__body {
  499. height: 100%;
  500. display: flex;
  501. //padding: 5px 5px 0px 5px;
  502. flex-direction: column;
  503. justify-content: space-between;
  504. .el-table {
  505. flex: 1;
  506. }
  507. .el-pagination > span:first-child {
  508. flex: 1;
  509. text-align: right;
  510. }
  511. }
  512. }
  513. }
  514. }
  515. /* Splitter 分隔面板
  516. ------------------------------- */
  517. .smallbar-el-splitter {
  518. .el-splitter-bar {
  519. width: 8px !important;
  520. .el-splitter-bar__dragger {
  521. height: 100px !important;
  522. }
  523. }
  524. }