role.css 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. .role-info-cards-container {
  2. display: flex;
  3. flex-wrap: wrap;
  4. gap: 16px;
  5. justify-content: flex-start;
  6. padding: 20px;
  7. }
  8. .role-item {
  9. background-color: #ffffff;
  10. border-radius: 16px;
  11. padding: 20px;
  12. box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  13. width: 280px;
  14. transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  15. position: relative;
  16. }
  17. .role-item:hover {
  18. transform: translateY(-4px);
  19. box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  20. }
  21. .role-info-create-role-button {
  22. background-color: #0a84ff;
  23. color: white;
  24. border: none;
  25. padding: 12px 24px;
  26. border-radius: 22px;
  27. cursor: pointer;
  28. font-size: 17px;
  29. font-weight: 600;
  30. box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  31. transition: background-color 0.3s, transform 0.2s;
  32. margin: 20px;
  33. }
  34. .role-info-create-role-button:hover {
  35. background-color: #0051a8;
  36. transform: translateY(-2px);
  37. }
  38. /* 弹出菜单样式 */
  39. #role-action-menu {
  40. position: absolute;
  41. background-color: #ffffff;
  42. border: 1px solid #d1d1d6;
  43. border-radius: 12px;
  44. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  45. padding: 12px;
  46. z-index: 1000;
  47. width: 150px;
  48. }
  49. #role-action-menu button {
  50. width: 100%;
  51. padding: 10px;
  52. background-color: #0a84ff;
  53. color: white;
  54. border: none;
  55. border-radius: 10px;
  56. cursor: pointer;
  57. font-size: 15px;
  58. margin-bottom: 8px;
  59. transition: background-color 0.3s;
  60. }
  61. #role-action-menu button:last-child {
  62. margin-bottom: 0;
  63. }
  64. #role-action-menu button:hover {
  65. background-color: #0051a8;
  66. }
  67. /* 模态框内按钮 */
  68. .role-info-button {
  69. padding: 12px 24px;
  70. background-color: #34c759;
  71. color: white;
  72. border: none;
  73. border-radius: 12px;
  74. cursor: pointer;
  75. transition: background-color 0.3s, transform 0.2s;
  76. margin-bottom: 12px;
  77. font-size: 16px;
  78. font-weight: 500;
  79. }
  80. .role-info-button:hover {
  81. background-color: #28a745;
  82. transform: translateY(-2px);
  83. }
  84. .role-info-button-delete {
  85. background-color: #ff3b30;
  86. }
  87. .role-info-button-delete:hover {
  88. background-color: #c23321;
  89. }
  90. /* 创建角色模态框 */
  91. .CreateRoleModal-modal {
  92. display: none; /* 隐藏模态框 */
  93. position: fixed;
  94. z-index: 2000; /* 在最上层 */
  95. left: 0;
  96. top: 0;
  97. width: 100%; /* 100% 宽 */
  98. height: 100%; /* 100% 高 */
  99. overflow: auto; /* 如果需要滚动条 */
  100. background-color: rgba(0, 0, 0, 0.4); /* 半透明背景 */
  101. }
  102. .CreateRoleModal-modal-content {
  103. background-color: #ffffff;
  104. margin: 10% auto; /* 居中 */
  105. padding: 30px;
  106. border-radius: 20px;
  107. width: 90%;
  108. max-width: 500px;
  109. box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  110. position: relative;
  111. }
  112. .CreateRoleModal-close {
  113. color: #8e8e93;
  114. position: absolute;
  115. top: 20px;
  116. right: 20px;
  117. font-size: 24px;
  118. font-weight: bold;
  119. cursor: pointer;
  120. transition: color 0.3s;
  121. }
  122. .CreateRoleModal-close:hover,
  123. .CreateRoleModal-close:focus {
  124. color: #ff3b30;
  125. }
  126. /* 表单元素 */
  127. form label {
  128. display: block;
  129. margin-bottom: 8px;
  130. font-weight: 500;
  131. color: #3c3c43;
  132. }
  133. form input[type="text"] {
  134. width: 100%;
  135. padding: 10px 14px;
  136. margin-bottom: 16px;
  137. border: 1px solid #d1d1d6;
  138. border-radius: 12px;
  139. font-size: 16px;
  140. background-color: #f2f2f7;
  141. color: #1c1c1e;
  142. }
  143. form input[type="submit"],
  144. form button {
  145. background-color: #0a84ff;
  146. color: white;
  147. border: none;
  148. padding: 12px 24px;
  149. border-radius: 22px;
  150. cursor: pointer;
  151. font-size: 17px;
  152. font-weight: 600;
  153. transition: background-color 0.3s, transform 0.2s;
  154. }
  155. form input[type="submit"]:hover,
  156. form button:hover {
  157. background-color: #0051a8;
  158. transform: translateY(-2px);
  159. }
  160. /* 权限复选框容器 */
  161. #permissionsContainer div {
  162. margin-bottom: 8px; /* 减少下方间距 */
  163. }
  164. #permissionsContainer label {
  165. display: inline-block; /* 让复选框和文字同一行 */
  166. margin-left: 8px;
  167. margin-bottom: 4px; /* 减少下方间距 */
  168. font-weight: 400;
  169. color: #3c3c43;
  170. vertical-align: middle; /* 让标签和复选框对齐 */
  171. }
  172. /* 子权限复选框容器 */
  173. .role-sub-permissions {
  174. margin-left: 15px; /* 保持左侧缩进 */
  175. margin-bottom: 4px; /* 减少子权限复选框的下方间距 */
  176. }
  177. .role-sub-permissions input[type="checkbox"] + label {
  178. display: inline-block; /* 使标签和复选框同一行 */
  179. margin-left: 8px;
  180. vertical-align: middle;
  181. padding: 0; /* 移除子权限项的内边距 */
  182. }
  183. /* 父权限容器样式 */
  184. .parent-permission {
  185. border-top: 1px solid #ccc;
  186. border-bottom: 1px solid #ccc;
  187. padding: 12px 0;
  188. }
  189. /* 移除第一个父权限容器的上边框 */
  190. .permissionsContainer .parent-permission:first-child {
  191. border-top: none;
  192. }
  193. /* 移除最后一个父权限容器的下边框 */
  194. .permissionsContainer .parent-permission:last-child {
  195. border-bottom: none;
  196. }
  197. /* 禁用按钮样式 */
  198. .role-info-button-disabled {
  199. padding: 12px 24px;
  200. background-color: #c7c7cc;
  201. color: white;
  202. border: none;
  203. border-radius: 12px;
  204. cursor: not-allowed;
  205. font-size: 16px;
  206. text-align: center;
  207. }
  208. /* 置顶角色样式 */
  209. .top-role {
  210. border: 2px solid #0a84ff;
  211. }
  212. /* 响应式调整 */
  213. @media (max-width: 600px) {
  214. .role-info-cards-container {
  215. flex-direction: column;
  216. align-items: center;
  217. }
  218. .role-item {
  219. width: 90%;
  220. }
  221. .CreateRoleModal-modal-content {
  222. width: 95%;
  223. }
  224. }
  225. /* 优化模态框内权限部分的布局 */
  226. .CreateRoleModal-modal-content form {
  227. display: flex;
  228. flex-direction: column;
  229. }
  230. .CreateRoleModal-modal-content form label {
  231. margin-bottom: 4px; /* 减少标签下方间距 */
  232. }
  233. .CreateRoleModal-modal-content form input[type="text"] {
  234. margin-bottom: 12px; /* 调整输入框下方间距 */
  235. }