global.less 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. @import './index.less';
  2. body {
  3. &.colorWeak {
  4. filter: invert(80%);
  5. }
  6. &.userLayout {
  7. overflow: auto;
  8. }
  9. }
  10. .layout.ant-layout {
  11. height: auto;
  12. overflow-x: hidden;
  13. &.mobile,
  14. &.tablet {
  15. .ant-layout-content {
  16. .content {
  17. margin: 24px 0 0;
  18. }
  19. }
  20. /**
  21. * ant-table-wrapper
  22. * 覆盖的表格手机模式样式,如果想修改在手机上表格最低宽度,可以在这里改动
  23. */
  24. .ant-table-wrapper {
  25. .ant-table-content {
  26. overflow-y: auto;
  27. }
  28. .ant-table-body {
  29. min-width: 800px;
  30. }
  31. }
  32. .topmenu {
  33. /* 必须为 topmenu 才能启用流式布局 */
  34. &.content-width-Fluid {
  35. .header-index-wide {
  36. margin-left: 0;
  37. }
  38. }
  39. }
  40. }
  41. &.mobile {
  42. .sidemenu {
  43. .ant-header-fixedHeader {
  44. &.ant-header-side-opened,
  45. &.ant-header-side-closed {
  46. width: 100%;
  47. }
  48. }
  49. }
  50. }
  51. &.ant-layout-has-sider {
  52. flex-direction: row;
  53. }
  54. .trigger {
  55. font-size: 20px;
  56. line-height: 64px;
  57. padding: 0 24px;
  58. cursor: pointer;
  59. transition: color 0.3s;
  60. &:hover {
  61. background: rgba(0, 0, 0, 0.025);
  62. }
  63. }
  64. .topmenu {
  65. .ant-header-fixedHeader {
  66. position: fixed;
  67. top: 0;
  68. right: 0;
  69. z-index: 9;
  70. width: 100%;
  71. transition: width 0.2s;
  72. &.ant-header-side-opened {
  73. width: 100%;
  74. }
  75. &.ant-header-side-closed {
  76. width: 100%;
  77. }
  78. }
  79. /* 必须为 topmenu 才能启用流式布局 */
  80. &.content-width-Fluid {
  81. .header-index-wide {
  82. max-width: unset;
  83. .header-index-left {
  84. flex: 1 1 1000px;
  85. .logo{
  86. margin-left: 25px;
  87. }
  88. .ant-menu.ant-menu-horizontal{
  89. max-width: calc(100vw - 190px - 238px - 25px);
  90. flex: 1 1 calc(100vw - 190px - 238px - 25px);
  91. }
  92. }
  93. .header-index-right{
  94. margin-right:25px;
  95. }
  96. }
  97. .page-header-index-wide {
  98. max-width: unset;
  99. }
  100. }
  101. }
  102. .sidemenu {
  103. .ant-header-fixedHeader {
  104. position: fixed;
  105. top: 0;
  106. right: 0;
  107. z-index: 9;
  108. width: 100%;
  109. transition: width 0.2s;
  110. &.ant-header-side-opened {
  111. width: calc(100% - 256px);
  112. }
  113. &.ant-header-side-closed {
  114. width: calc(100% - 80px);
  115. }
  116. }
  117. }
  118. .header {
  119. height: 64px;
  120. padding: 0 12px 0 0;
  121. background: #fff;
  122. box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  123. position: relative;
  124. }
  125. .header,
  126. .top-nav-header-index {
  127. .user-wrapper {
  128. float: right;
  129. height: 100%;
  130. .action {
  131. cursor: pointer;
  132. padding: 0 12px;
  133. display: inline-block;
  134. transition: all 0.3s;
  135. height: 100%;
  136. color: rgba(0, 0, 0, 0.65);
  137. &:hover {
  138. background: rgba(0, 0, 0, 0.025);
  139. }
  140. .avatar {
  141. margin: 20px 8px 20px 0;
  142. color: #1890ff;
  143. background: hsla(0, 0%, 100%, 0.85);
  144. vertical-align: middle;
  145. }
  146. .icon {
  147. font-size: 16px;
  148. padding: 4px;
  149. }
  150. }
  151. }
  152. &.dark {
  153. .user-wrapper {
  154. .action {
  155. color: rgba(255, 255, 255, 0.85);
  156. a {
  157. color: rgba(255, 255, 255, 0.85);
  158. }
  159. &:hover {
  160. background: rgba(255, 255, 255, 0.16);
  161. }
  162. }
  163. }
  164. }
  165. }
  166. &.mobile,
  167. &.tablet {
  168. .top-nav-header-index {
  169. .header-index-wide {
  170. .header-index-left {
  171. .trigger {
  172. color: rgba(255, 255, 255, 0.85);
  173. padding: 0 12px;
  174. }
  175. .logo.top-nav-header {
  176. flex: 0 0 56px;
  177. text-align: center;
  178. line-height: 58px;
  179. h1 {
  180. display: none;
  181. }
  182. }
  183. }
  184. }
  185. &.light {
  186. .header-index-wide {
  187. .header-index-left {
  188. .trigger {
  189. color: rgba(0, 0, 0, 0.65);
  190. }
  191. }
  192. }
  193. //
  194. }
  195. }
  196. }
  197. &.tablet {
  198. // overflow: hidden; text-overflow:ellipsis; white-space: nowrap;
  199. .top-nav-header-index {
  200. .header-index-wide {
  201. .header-index-left {
  202. .logo > a {
  203. overflow: hidden;
  204. text-overflow: ellipsis;
  205. white-space: nowrap;
  206. }
  207. }
  208. .ant-menu.ant-menu-horizontal {
  209. flex: 1 1 auto;
  210. white-space: normal;
  211. }
  212. }
  213. }
  214. }
  215. .top-nav-header-index {
  216. box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  217. position: relative;
  218. transition: background 0.3s, width 0.2s;
  219. .header-index-wide {
  220. max-width: 1200px;
  221. margin: auto;
  222. padding-left: 0;
  223. display: flex;
  224. height: 64px;
  225. .ant-menu.ant-menu-horizontal {
  226. max-width: 835px;
  227. flex: 0 1 835px;
  228. border: none;
  229. height: 64px;
  230. line-height: 64px;
  231. }
  232. .header-index-left {
  233. flex: 0 1 1000px;
  234. display: flex;
  235. .logo.top-nav-header {
  236. flex: 0 0 165px;
  237. width: 165px;
  238. height: 64px;
  239. position: relative;
  240. line-height: 64px;
  241. transition: all 0.3s;
  242. overflow: hidden;
  243. img,
  244. svg {
  245. display: inline-block;
  246. vertical-align: middle;
  247. height: 32px;
  248. width: 32px;
  249. }
  250. h1 {
  251. color: #fff;
  252. display: inline-block;
  253. vertical-align: top;
  254. font-size: 16px;
  255. margin: 0 0 0 12px;
  256. font-weight: 400;
  257. }
  258. }
  259. }
  260. .header-index-right {
  261. flex: 0 0 238px;
  262. align-self: flex-end;
  263. height: 64px;
  264. overflow: hidden;
  265. .content-box {
  266. float: right;
  267. }
  268. }
  269. }
  270. &.light {
  271. background-color: #fff;
  272. .header-index-wide {
  273. .header-index-left {
  274. .logo {
  275. h1 {
  276. color: #002140;
  277. }
  278. }
  279. }
  280. }
  281. }
  282. }
  283. // 内容区
  284. .layout-content {
  285. margin: 24px 24px 0px;
  286. height: 100%;
  287. height: 64px;
  288. padding: 0 12px 0 0;
  289. }
  290. // footer
  291. .ant-layout-footer {
  292. padding: 0;
  293. }
  294. }
  295. .topmenu {
  296. .page-header-index-wide {
  297. max-width: 1200px;
  298. margin: 0 auto;
  299. }
  300. }
  301. // drawer-sider 自定义
  302. .ant-drawer.drawer-sider {
  303. .sider {
  304. box-shadow: none;
  305. }
  306. &.dark {
  307. .ant-drawer-content {
  308. background-color: rgb(0, 21, 41);
  309. }
  310. }
  311. &.light {
  312. box-shadow: none;
  313. .ant-drawer-content {
  314. background-color: #fff;
  315. }
  316. }
  317. .ant-drawer-body {
  318. padding: 0;
  319. }
  320. }
  321. // 菜单样式
  322. .sider {
  323. box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
  324. position: relative;
  325. z-index: @ant-global-sider-zindex;
  326. min-height: 100vh;
  327. .ant-layout-sider-children {
  328. overflow-y: hidden;
  329. &:hover {
  330. overflow-y: auto;
  331. }
  332. }
  333. &.ant-fixed-sidemenu {
  334. position: fixed;
  335. height: 100%;
  336. }
  337. .logo {
  338. position: relative;
  339. height: 64px;
  340. padding-left: 24px;
  341. overflow: hidden;
  342. line-height: 64px;
  343. background: #002140;
  344. transition: all .3s;
  345. img,
  346. svg,
  347. h1 {
  348. display: inline-block;
  349. vertical-align: middle;
  350. }
  351. img,
  352. svg {
  353. height: 32px;
  354. width: 32px;
  355. }
  356. h1 {
  357. color: #fff;
  358. font-size: 18px;
  359. margin: 0 0 0 12px;
  360. font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
  361. font-weight: 600;
  362. vertical-align: middle;
  363. }
  364. }
  365. &.light {
  366. background-color: #fff;
  367. box-shadow: 2px 0px 8px 0px rgba(29, 35, 41, 0.05);
  368. .logo {
  369. background: #fff;
  370. box-shadow: 1px 1px 0px 0px #e8e8e8;
  371. h1 {
  372. color: unset;
  373. }
  374. }
  375. .ant-menu-light {
  376. border-right-color: transparent;
  377. }
  378. }
  379. }
  380. // 外置的样式控制
  381. .user-dropdown-menu {
  382. span {
  383. user-select: none;
  384. }
  385. }
  386. .user-dropdown-menu-wrapper.ant-dropdown-menu {
  387. padding: 4px 0;
  388. .ant-dropdown-menu-item {
  389. width: 160px;
  390. }
  391. .ant-dropdown-menu-item > .anticon:first-child,
  392. .ant-dropdown-menu-item > a > .anticon:first-child,
  393. .ant-dropdown-menu-submenu-title > .anticon:first-child .ant-dropdown-menu-submenu-title > a > .anticon:first-child {
  394. min-width: 12px;
  395. margin-right: 8px;
  396. }
  397. }
  398. // 数据列表 样式
  399. .table-alert {
  400. margin-bottom: 16px;
  401. }
  402. .table-page-search-wrapper {
  403. .ant-form-inline {
  404. .ant-form-item {
  405. display: flex;
  406. margin-bottom: 24px;
  407. margin-right: 0;
  408. .ant-form-item-control-wrapper {
  409. flex: 1 1;
  410. display: inline-block;
  411. vertical-align: middle;
  412. }
  413. > .ant-form-item-label {
  414. line-height: 32px;
  415. padding-right: 8px;
  416. width: auto;
  417. }
  418. .ant-form-item-control {
  419. height: 32px;
  420. line-height: 32px;
  421. }
  422. }
  423. }
  424. .table-page-search-submitButtons {
  425. display: block;
  426. margin-bottom: 24px;
  427. white-space: nowrap;
  428. }
  429. }
  430. .content {
  431. .table-operator {
  432. margin-bottom: 18px;
  433. button {
  434. margin-right: 8px;
  435. }
  436. }
  437. }
  438. /* 表格操作按钮样式 */
  439. td .actionBtn {
  440. font-size: 20px;
  441. padding: 0 10px;
  442. }
  443. td .icon-blues {
  444. color: #1890FF;
  445. }
  446. td .icon-green {
  447. color: #16b50e;
  448. }
  449. td .icon-red {
  450. color: red;
  451. }
  452. td .icon-orange {
  453. color: #ffaa00;
  454. }