global.less 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  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. .action {
  268. max-width: 140px;
  269. overflow: hidden;
  270. text-overflow:ellipsis;
  271. white-space:nowrap;
  272. }
  273. }
  274. }
  275. }
  276. &.light {
  277. background-color: #fff;
  278. .header-index-wide {
  279. .header-index-left {
  280. .logo {
  281. h1 {
  282. color: #002140;
  283. }
  284. }
  285. }
  286. }
  287. }
  288. }
  289. // 内容区
  290. .layout-content {
  291. margin: 24px 24px 0px;
  292. height: 100%;
  293. height: 64px;
  294. padding: 0 12px 0 0;
  295. }
  296. // footer
  297. .ant-layout-footer {
  298. padding: 0;
  299. }
  300. }
  301. .topmenu {
  302. .page-header-index-wide {
  303. max-width: 1200px;
  304. margin: 0 auto;
  305. }
  306. }
  307. // drawer-sider 自定义
  308. .ant-drawer.drawer-sider {
  309. .sider {
  310. box-shadow: none;
  311. }
  312. &.dark {
  313. .ant-drawer-content {
  314. background-color: rgb(0, 21, 41);
  315. }
  316. }
  317. &.light {
  318. box-shadow: none;
  319. .ant-drawer-content {
  320. background-color: #fff;
  321. }
  322. }
  323. .ant-drawer-body {
  324. padding: 0;
  325. }
  326. }
  327. // 菜单样式
  328. .sider {
  329. box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
  330. position: relative;
  331. z-index: @ant-global-sider-zindex;
  332. min-height: 100vh;
  333. .ant-layout-sider-children {
  334. overflow-y: hidden;
  335. &:hover {
  336. overflow-y: auto;
  337. }
  338. }
  339. &.ant-fixed-sidemenu {
  340. position: fixed;
  341. height: 100%;
  342. }
  343. .logo {
  344. position: relative;
  345. height: 64px;
  346. padding-left: 24px;
  347. overflow: hidden;
  348. line-height: 64px;
  349. background: #002140;
  350. transition: all .3s;
  351. img,
  352. svg,
  353. h1 {
  354. display: inline-block;
  355. vertical-align: middle;
  356. }
  357. img,
  358. svg {
  359. height: 32px;
  360. width: 32px;
  361. }
  362. h1 {
  363. color: #fff;
  364. font-size: 20px;
  365. margin: 0 0 0 12px;
  366. font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
  367. font-weight: 600;
  368. vertical-align: middle;
  369. }
  370. }
  371. &.light {
  372. background-color: #fff;
  373. box-shadow: 2px 0px 8px 0px rgba(29, 35, 41, 0.05);
  374. .logo {
  375. background: #fff;
  376. box-shadow: 1px 1px 0px 0px #e8e8e8;
  377. h1 {
  378. color: unset;
  379. }
  380. }
  381. .ant-menu-light {
  382. border-right-color: transparent;
  383. }
  384. }
  385. }
  386. // 外置的样式控制
  387. .user-dropdown-menu {
  388. span {
  389. user-select: none;
  390. }
  391. }
  392. .user-dropdown-menu-wrapper.ant-dropdown-menu {
  393. padding: 4px 0;
  394. .ant-dropdown-menu-item {
  395. width: 160px;
  396. }
  397. .ant-dropdown-menu-item > .anticon:first-child,
  398. .ant-dropdown-menu-item > a > .anticon:first-child,
  399. .ant-dropdown-menu-submenu-title > .anticon:first-child .ant-dropdown-menu-submenu-title > a > .anticon:first-child {
  400. min-width: 12px;
  401. margin-right: 8px;
  402. }
  403. }
  404. // 数据列表 样式
  405. .table-alert {
  406. margin-bottom: 16px;
  407. }
  408. .table-page-search-wrapper {
  409. .ant-form-inline {
  410. .ant-form-item {
  411. display: flex;
  412. margin-bottom: 24px;
  413. margin-right: 0;
  414. .ant-form-item-control-wrapper {
  415. flex: 1 1;
  416. display: inline-block;
  417. vertical-align: middle;
  418. }
  419. > .ant-form-item-label {
  420. line-height: 32px;
  421. padding-right: 8px;
  422. width: auto;
  423. }
  424. .ant-form-item-control {
  425. height: 32px;
  426. line-height: 32px;
  427. }
  428. }
  429. }
  430. .table-page-search-submitButtons {
  431. display: block;
  432. margin-bottom: 24px;
  433. white-space: nowrap;
  434. }
  435. }
  436. .content {
  437. .table-operator {
  438. margin-bottom: 18px;
  439. button {
  440. margin-right: 8px;
  441. }
  442. }
  443. }