device-management-content.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. <!DOCTYPE html>
  2. <html lang="zh-CN" class="iframe-content">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>设备管理列表 - 爱智农</title>
  7. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css">
  8. <link rel="stylesheet" href="https://at.alicdn.com/t/font_3114978_qe0b39no76.css">
  9. <link rel="stylesheet" href="../assets/css/global.css">
  10. <style>
  11. :root {
  12. --primary: #4CAF50;
  13. --primary-dark: #388E3C;
  14. --primary-light: #A5D6A7;
  15. --primary-bg: #F1F8E9;
  16. --success: #4CAF50;
  17. --warning: #FFC107;
  18. --danger: #F44336;
  19. --info: #2196F3;
  20. --disabled: #9E9E9E;
  21. --border: #E0E0E0;
  22. --text-primary: #212121;
  23. --text-secondary: #757575;
  24. --radius: 8px;
  25. }
  26. body {
  27. font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  28. background-color: #f5f7f9;
  29. color: var(--text-primary);
  30. margin: 0;
  31. padding: 0;
  32. height: auto; overflow-y: auto; overflow-x: hidden;
  33. min-height: 100%;
  34. overflow-y: auto;
  35. overflow-x: hidden;
  36. padding-top: 15px; /* 添加顶部填充以确保内容不被系统元素遮挡 */
  37. }
  38. /* 内容页面框架 */
  39. #content-frame {
  40. width: 100%;
  41. height: 100%;
  42. border: none;
  43. overflow: hidden;
  44. margin-top: 0; /* 移除顶部外边距 */
  45. padding-top: 0; /* 移除顶部内边距 */
  46. }
  47. /* 移除白色圆形按钮 */
  48. .circle-btn,
  49. .floating-button,
  50. .round-button,
  51. button[class*='circle'],
  52. div[class*='circle'],
  53. [class*='float-btn'],
  54. body > div:not(#app),
  55. body > button {
  56. display: none !important;
  57. visibility: hidden !important;
  58. opacity: 0 !important;
  59. position: absolute !important;
  60. top: -9999px !important;
  61. left: -9999px !important;
  62. z-index: -9999 !important;
  63. pointer-events: none !important;
  64. }
  65. .page-container {
  66. padding: 20px;
  67. position: relative;
  68. min-height: 100vh; width: 100%; max-width: 100%; box-sizing: border-box;
  69. width: 100%;
  70. max-width: 100%;
  71. box-sizing: border-box;
  72. padding-top: 40px; /* 增加顶部内边距,给按钮腾出空间 */
  73. }
  74. /* 防止重复菜单 */
  75. body > div:not(.page-container):not(.modal-container),
  76. iframe#sidebar,
  77. div.system-menu,
  78. [id^="system-menu"],
  79. [class^="system-menu"],
  80. #admin-sidebar,
  81. .menu-popup,
  82. .user-avatar-circle {
  83. display: none !important;
  84. width: 0 !important;
  85. height: 0 !important;
  86. opacity: 0 !important;
  87. position: absolute !important;
  88. top: -9999px !important;
  89. left: -9999px !important;
  90. z-index: -9999 !important;
  91. pointer-events: none !important;
  92. }
  93. /* 防止右侧白圈和浮动元素 */
  94. .circle-btn,
  95. .floating-circle,
  96. .round-button,
  97. .scroll-top-btn,
  98. [class*="round"],
  99. [class*="circle"],
  100. .help-btn,
  101. .chat-btn,
  102. body > .btn,
  103. body > button,
  104. body > div:not(.page-container):not(.modal-container) {
  105. display: none !important;
  106. visibility: hidden !important;
  107. opacity: 0 !important;
  108. pointer-events: none !important;
  109. }
  110. /* 页面标题和操作按钮容器 */
  111. .page-header {
  112. display: flex;
  113. justify-content: space-between;
  114. align-items: center;
  115. margin-bottom: 20px;
  116. padding-bottom: 16px;
  117. border-bottom: 1px solid #e0e0e0;
  118. padding-top: 10px;
  119. position: relative;
  120. z-index: 10;
  121. }
  122. /* 添加新增按钮的特定样式 */
  123. .button-container {
  124. position: relative;
  125. z-index: 20;
  126. }
  127. #addDeviceBtn,
  128. #importBtn,
  129. #exportBtn {
  130. position: relative;
  131. z-index: 5;
  132. height: 38px;
  133. visibility: visible !important;
  134. opacity: 1 !important;
  135. display: inline-flex !important;
  136. }
  137. .card {
  138. background-color: white;
  139. border-radius: 8px;
  140. box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  141. }
  142. .table-container {
  143. overflow-x: auto;
  144. }
  145. table {
  146. width: 100%;
  147. border-collapse: collapse;
  148. }
  149. th {
  150. background-color: #f9fafb;
  151. padding: 12px 16px;
  152. text-align: left;
  153. font-weight: 500;
  154. color: #6b7280;
  155. border-bottom: 1px solid #e5e7eb;
  156. }
  157. td {
  158. padding: 12px 16px;
  159. border-bottom: 1px solid #e5e7eb;
  160. }
  161. tr:hover {
  162. background-color: #f9fafb;
  163. }
  164. .btn {
  165. display: inline-flex;
  166. align-items: center;
  167. justify-content: center;
  168. padding: 8px 16px;
  169. border-radius: 4px;
  170. font-weight: 500;
  171. cursor: pointer;
  172. transition: all 0.2s;
  173. }
  174. .btn-primary {
  175. background-color: #4CAF50;
  176. color: white;
  177. }
  178. .btn-primary:hover {
  179. background-color: #388E3C;
  180. }
  181. .btn-default {
  182. background-color: white;
  183. border: 1px solid #d1d5db;
  184. color: #374151;
  185. }
  186. .btn-default:hover {
  187. background-color: #f9fafb;
  188. }
  189. .btn-danger {
  190. background-color: #ef4444;
  191. color: white;
  192. }
  193. .btn-danger:hover {
  194. background-color: #dc2626;
  195. }
  196. .btn-sm {
  197. padding: 4px 8px;
  198. font-size: 12px;
  199. }
  200. .btn-icon {
  201. margin-right: 4px;
  202. }
  203. .search-box {
  204. display: flex;
  205. gap: 8px;
  206. }
  207. .input {
  208. padding: 8px 12px;
  209. border: 1px solid #d1d5db;
  210. border-radius: 4px;
  211. flex-grow: 1;
  212. }
  213. .input:focus {
  214. outline: none;
  215. border-color: #4CAF50;
  216. box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
  217. }
  218. .select {
  219. padding: 8px 12px;
  220. border: 1px solid #d1d5db;
  221. border-radius: 4px;
  222. background-color: white;
  223. }
  224. .modal-overlay {
  225. position: fixed;
  226. top: 0;
  227. left: 0;
  228. right: 0;
  229. bottom: 0;
  230. background-color: rgba(0, 0, 0, 0.5);
  231. display: flex;
  232. align-items: center;
  233. justify-content: center;
  234. z-index: 50;
  235. display: none;
  236. }
  237. .modal {
  238. background-color: white;
  239. border-radius: 8px;
  240. width: 100%;
  241. max-width: 600px;
  242. box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  243. }
  244. .modal-header {
  245. padding: 16px 24px;
  246. border-bottom: 1px solid #e5e7eb;
  247. display: flex;
  248. align-items: center;
  249. justify-content: space-between;
  250. }
  251. .modal-title {
  252. font-size: 18px;
  253. font-weight: 500;
  254. }
  255. .modal-close {
  256. cursor: pointer;
  257. font-size: 20px;
  258. }
  259. .modal-body {
  260. padding: 24px;
  261. }
  262. .modal-footer {
  263. padding: 16px 24px;
  264. border-top: 1px solid #e5e7eb;
  265. display: flex;
  266. justify-content: flex-end;
  267. gap: 8px;
  268. }
  269. .form-group {
  270. margin-bottom: 16px;
  271. }
  272. .form-label {
  273. display: block;
  274. margin-bottom: 4px;
  275. font-weight: 500;
  276. }
  277. .form-input {
  278. width: 100%;
  279. padding: 8px 12px;
  280. border: 1px solid #d1d5db;
  281. border-radius: 4px;
  282. }
  283. .form-input:focus {
  284. outline: none;
  285. border-color: #4CAF50;
  286. box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
  287. }
  288. .badge {
  289. display: inline-block;
  290. padding: 2px 8px;
  291. border-radius: 9999px;
  292. font-size: 12px;
  293. font-weight: 500;
  294. }
  295. .badge-success {
  296. background-color: #d1fae5;
  297. color: #065f46;
  298. }
  299. .badge-warning {
  300. background-color: #fef3c7;
  301. color: #92400e;
  302. }
  303. .badge-danger {
  304. background-color: #fee2e2;
  305. color: #b91c1c;
  306. }
  307. .pagination {
  308. display: flex;
  309. align-items: center;
  310. justify-content: flex-end;
  311. gap: 4px;
  312. }
  313. .pagination-item {
  314. display: inline-flex;
  315. align-items: center;
  316. justify-content: center;
  317. width: 32px;
  318. height: 32px;
  319. border-radius: 4px;
  320. cursor: pointer;
  321. transition: all 0.2s;
  322. }
  323. .pagination-item:hover {
  324. background-color: #f3f4f6;
  325. }
  326. .pagination-item.active {
  327. background-color: #4CAF50;
  328. color: white;
  329. }
  330. .pagination-item.disabled {
  331. color: #9ca3af;
  332. cursor: not-allowed;
  333. }
  334. .grid-2 {
  335. display: grid;
  336. grid-template-columns: 1fr 1fr;
  337. gap: 16px;
  338. }
  339. </style>
  340. </head>
  341. <body>
  342. <div class="page-container responsive-container">
  343. <div class="flex justify-between items-center mb-6 page-header">
  344. <h1 class="text-2xl font-bold">设备管理列表</h1>
  345. <div class="flex gap-2 button-container">
  346. <button class="btn btn-primary" id="addDeviceBtn">
  347. <i class="iconfont icon-plus btn-icon"></i>
  348. 新增设备
  349. </button>
  350. <button class="btn btn-default" id="importBtn">
  351. <i class="iconfont icon-import btn-icon"></i>
  352. 导入
  353. </button>
  354. <button class="btn btn-default" id="exportBtn">
  355. <i class="iconfont icon-export btn-icon"></i>
  356. 导出
  357. </button>
  358. </div>
  359. </div>
  360. <div class="card p-6 mb-6">
  361. <div class="flex flex-wrap gap-4">
  362. <div class="search-box flex-grow">
  363. <input type="text" class="input" placeholder="请输入设备名称/编号/位置">
  364. <button class="btn btn-primary">
  365. <i class="iconfont icon-search btn-icon"></i>
  366. 搜索
  367. </button>
  368. <button class="btn btn-default">
  369. <i class="iconfont icon-reload btn-icon"></i>
  370. 重置
  371. </button>
  372. </div>
  373. <div class="flex gap-2">
  374. <select class="select">
  375. <option value="">所有设备类型</option>
  376. <option value="sensor">传感器</option>
  377. <option value="camera">摄像头</option>
  378. <option value="controller">控制器</option>
  379. <option value="weather">气象设备</option>
  380. </select>
  381. <select class="select">
  382. <option value="">所有状态</option>
  383. <option value="1">在线</option>
  384. <option value="0">离线</option>
  385. <option value="2">维护中</option>
  386. </select>
  387. </div>
  388. </div>
  389. </div>
  390. <!-- 设备表单弹窗 -->
  391. <div class="modal-overlay" id="deviceModal">
  392. // ... existing code ...
  393. </div>
  394. </div>
  395. <script>
  396. // 监听iframe加载完成
  397. document.getElementById('content-frame').onload = function() {
  398. // 确保iframe高度铺满
  399. this.style.height = window.innerHeight + 'px';
  400. };
  401. // 页面大小变化时调整iframe大小
  402. window.addEventListener('resize', function() {
  403. document.getElementById('content-frame').style.height = window.innerHeight + 'px';
  404. });
  405. </script>
  406. </body>
  407. </html>