common.scss 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  1. @import './variable.scss';
  2. /** 背景颜色 */
  3. .zh-bg-success {
  4. background-color: $zh-green;
  5. }
  6. .zh-bg-gray {
  7. background-color: $zh-light-gray;
  8. }
  9. .zh-bg-blue {
  10. background-color: $zh-blue;
  11. }
  12. .zh-bg-red {
  13. background-color: $zh-red;
  14. }
  15. .zh-bg-yellow {
  16. background-color: $zh-yellow;
  17. }
  18. .zh-bg-green {
  19. background-color: $zh-green;
  20. }
  21. .zh-bg-white {
  22. background-color: $zh-white;
  23. }
  24. /** 字体颜色 */
  25. .zh-gray {
  26. color: $zh-gray;
  27. }
  28. .zh-red {
  29. color: $zh-red;
  30. }
  31. .zh-blue {
  32. color: $zh-blue;
  33. }
  34. .zh-green {
  35. color: $zh-green;
  36. }
  37. .zh-yellow {
  38. color: $zh-yellow;
  39. }
  40. .zh-muted {
  41. color: $zh-muted;
  42. }
  43. /** 文本水平对齐方向 */
  44. .zh-text-center {
  45. text-align: center;
  46. }
  47. .zh-text-left {
  48. text-align: left;
  49. }
  50. .zh-text-right {
  51. text-align: right;
  52. }
  53. .zh-width-100P {
  54. width: 100%;
  55. }
  56. .zh-height-100P {
  57. height: 100%;
  58. }
  59. /** 字体粗细 */
  60. @for $i from 1 through 9 {
  61. .zh-fw-#{$i * 100} {
  62. font-weight: $i * 100;
  63. }
  64. }
  65. /* 预设常用样式 */
  66. @for $i from 1 through 50 {
  67. /* font-size */
  68. .zh-fz-#{$i} {
  69. font-size: 1px * $i;
  70. }
  71. /* padding */
  72. .zh-pd-#{$i} {
  73. padding: 1px * $i;
  74. }
  75. .zh-pd-top-#{$i} {
  76. padding-top: 1px * $i;
  77. }
  78. .zh-pd-right-#{$i} {
  79. padding-right: 1px * $i;
  80. }
  81. .zh-pd-bottom-#{$i} {
  82. padding-bottom: 1px * $i;
  83. }
  84. .zh-pd-left-#{$i} {
  85. padding-left: 1px * $i;
  86. }
  87. .zh-pd-tb-#{$i} {
  88. padding-top: 1px * $i;
  89. padding-bottom: 1px * $i;
  90. }
  91. .zh-pd-lr-#{$i} {
  92. padding-right: 1px * $i;
  93. padding-left: 1px * $i;
  94. }
  95. /* margin */
  96. .zh-mg-#{$i} {
  97. margin: 1px * $i;
  98. }
  99. .zh-mg-top-#{$i} {
  100. margin-top: 1px * $i;
  101. }
  102. .zh-mg-right-#{$i} {
  103. margin-right: 1px * $i;
  104. }
  105. .zh-mg-bottom-#{$i} {
  106. margin-bottom: 1px * $i;
  107. }
  108. .zh-mg-left-#{$i} {
  109. margin-left: 1px * $i;
  110. }
  111. .zh-mg-tb-#{$i} {
  112. margin-top: 1px * $i;
  113. margin-bottom: 1px * $i;
  114. }
  115. .zh-mg-lr-#{$i} {
  116. margin-right: 1px * $i;
  117. margin-left: 1px * $i;
  118. }
  119. // width & height
  120. .zh-width-#{$i} {
  121. width: 1px * $i;
  122. }
  123. .zh-height-#{$i} {
  124. height: 1px * $i;
  125. }
  126. // radius
  127. .zh-radius-#{$i} {
  128. border-radius: 1px * $i;
  129. }
  130. // line-height
  131. .zh-lh-#{$i} {
  132. line-height: 1px * $i;
  133. }
  134. }
  135. .zh-block {
  136. display:inline-block;
  137. }
  138. /** flex布局 */
  139. .zh-flex {
  140. display: flex;
  141. }
  142. .zh-flex-wrap {
  143. @extend .zh-flex;
  144. flex-wrap: wrap;
  145. }
  146. .zh-flex-row {
  147. @extend .zh-flex;
  148. flex-direction: row;
  149. }
  150. .zh-flex-column {
  151. @extend .zh-flex;
  152. flex-direction: column;
  153. }
  154. .zh-flex-sub {
  155. flex: 1;
  156. }
  157. .zh-flex-twice {
  158. flex: 2;
  159. }
  160. .zh-flex-treble {
  161. flex: 3;
  162. }
  163. .zh-flex-quadruple {
  164. flex: 4;
  165. }
  166. .zh-flex-quintuple {
  167. flex: 5;
  168. }
  169. .zh-align-start {
  170. @extend .zh-flex;
  171. align-items: flex-start;
  172. }
  173. .zh-align-end {
  174. @extend .zh-flex;
  175. align-items: flex-end;
  176. }
  177. .zh-align-center {
  178. @extend .zh-flex;
  179. align-items: center;
  180. }
  181. .zh-align-stretch {
  182. @extend .zh-flex;
  183. align-items: stretch;
  184. }
  185. .zh-align-baseline {
  186. @extend .zh-flex;
  187. align-items: baseline;
  188. }
  189. .zh-self-start {
  190. @extend .zh-flex;
  191. align-self: flex-start;
  192. }
  193. .zh-self-center {
  194. @extend .zh-flex;
  195. align-self: flex-center;
  196. }
  197. .zh-self-end {
  198. @extend .zh-flex;
  199. align-self: flex-end;
  200. }
  201. .zh-self-stretch {
  202. @extend .zh-flex;
  203. align-self: stretch;
  204. }
  205. .zh-justify-start {
  206. @extend .zh-flex;
  207. justify-content: flex-start;
  208. }
  209. .zh-justify-end {
  210. @extend .zh-flex;
  211. justify-content: flex-end;
  212. }
  213. .zh-justify-center {
  214. @extend .zh-flex;
  215. justify-content: center;
  216. }
  217. .zh-justify-between {
  218. @extend .zh-flex;
  219. justify-content: space-between;
  220. }
  221. .zh-justify-around {
  222. @extend .zh-flex;
  223. justify-content: space-around;
  224. }
  225. .zh-flex-row-center {
  226. @extend .zh-flex-row;
  227. @extend .zh-justify-center;
  228. @extend .zh-align-center;
  229. }
  230. .zh-flex-column-center {
  231. @extend .zh-flex-column;
  232. @extend .zh-justify-center;
  233. @extend .zh-align-center;
  234. }
  235. // grid布局
  236. .zh-grid {
  237. display: flex;
  238. flex-wrap: wrap;
  239. }
  240. @mixin multi-border($n) {
  241. &.zh-grid-border {
  242. & > div {
  243. @include zh-border;
  244. &:not(:nth-last-child(-n + #{$n})) {
  245. &::after {
  246. border-bottom: 1px solid $zh-line-color;
  247. }
  248. }
  249. &:not(:nth-child(#{$n}n)) {
  250. &::after {
  251. border-right: 1px solid $zh-line-color;
  252. }
  253. }
  254. }
  255. }
  256. }
  257. .zh-grid.zh-col-2 {
  258. & > div {
  259. width: 50%;
  260. }
  261. @include multi-border(2);
  262. }
  263. .zh-grid.zh-col-3 {
  264. & > div {
  265. width: calc(100% / 3);
  266. }
  267. @include multi-border(3);
  268. }
  269. @mixin space-calc($i, $n) {
  270. & > div {
  271. width: calc((100% - #{($n - 1) * $i}px) / #{$n});
  272. &:not(:nth-last-child(-n + #{$n})) {
  273. margin-bottom: #{$i}px;
  274. }
  275. &:not(:nth-child(#{$n}n)) {
  276. margin-right: #{$i}px;
  277. }
  278. }
  279. }
  280. // 处理列之间需要有空隙情况
  281. @for $i from 1 through 50 {
  282. .zh-grid.zh-col-1.zh-col-space-#{$i} {
  283. & > div {
  284. margin-bottom: #{$i}px;
  285. }
  286. }
  287. .zh-grid.zh-col-2.zh-col-space-#{$i} {
  288. @include space-calc($i, 2);
  289. }
  290. .zh-grid.zh-col-3.zh-col-space-#{$i} {
  291. @include space-calc($i, 3);
  292. }
  293. .zh-grid.zh-col-4.zh-col-space-#{$i} {
  294. @include space-calc($i, 4);
  295. }
  296. .zh-grid.zh-col-5.zh-col-space-#{$i} {
  297. @include space-calc($i, 5);
  298. }
  299. .zh-grid.zh-col-6.zh-col-space-#{$i} {
  300. @include space-calc($i, 6);
  301. }
  302. }
  303. /** 省略号 */
  304. @for $i from 1 through 2 {
  305. .zh-ellipsis-#{$i} {
  306. display: -webkit-box;
  307. -webkit-box-orient: vertical;
  308. -webkit-line-clamp: #{$i};
  309. overflow: hidden;
  310. }
  311. }
  312. /** 鼠标手 */
  313. .zh-pointer {
  314. cursor: pointer;
  315. }
  316. /** 线条 */
  317. @for $i from 1 through 5 {
  318. .zh-border-top-#{$i} {
  319. border-top: 1px * $i solid #f3f3f3;
  320. }
  321. }
  322. /** 布局 */
  323. .wrap-container {
  324. @extend .zh-width-100P;
  325. @extend .zh-height-100P;
  326. position: absolute;
  327. top: 0;
  328. left: 0;
  329. overflow: hidden;
  330. background: white;
  331. }
  332. /** 滚动条自定义 */
  333. ::-webkit-scrollbar{
  334. width: 8px;
  335. height: 8px;
  336. }
  337. ::-webkit-scrollbar-track{
  338. background: rgb(239, 239, 239);
  339. border-radius: 2px;
  340. }
  341. ::-webkit-scrollbar-thumb{
  342. background: #bfbfbf;
  343. border-radius: 10px;
  344. }
  345. ::-webkit-scrollbar-thumb:hover{
  346. background: #636363;
  347. }
  348. // 弹窗左右结构
  349. .sheet-box {
  350. overflow: hidden;
  351. .sheet-box-left {
  352. height: calc(100vh - 25px);
  353. overflow-y: auto;
  354. .sheet-left-panel {
  355. overflow-x: hidden;
  356. }
  357. }
  358. }
  359. .sheet-right-panel,.sheet-panel-record {
  360. height: calc((100vh - 48px - 92px - 64px) / 2);
  361. overflow-x: hidden;
  362. overflow-y: auto;
  363. }
  364. .sheet-btns {
  365. height: 54px;
  366. }