Device.razor 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173
  1. @page "/siteConfiguration/device"
  2. @attribute [ReuseTabsPage(Title = "设备管理")]
  3. <div class="equipment-management-container">
  4. <!-- 筛选条件 -->
  5. <div class="ant-card filter-section">
  6. <div class="ant-card-body">
  7. <div class="ant-form ant-form-horizontal">
  8. <div class="ant-row ant-row-top" style="row-gap: 16px;">
  9. <!-- 站点BUID -->
  10. <div class="ant-col ant-col-6">
  11. <div class="ant-form-item">
  12. <label class="ant-form-item-label">
  13. <span>车牌号</span>
  14. </label>
  15. <div class="ant-form-item-control">
  16. <div class="ant-form-item-control-input">
  17. <div class="ant-form-item-control-input-content">
  18. <input type="text"
  19. class="ant-input"
  20. placeholder="车牌号"
  21. @bind="License"
  22. @bind:event="oninput" />
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. </div>
  28. <!-- 站点名称 -->
  29. <div class="ant-col ant-col-6">
  30. <div class="ant-form-item">
  31. <label class="ant-form-item-label">
  32. <span>设备编号</span>
  33. </label>
  34. <div class="ant-form-item-control">
  35. <div class="ant-form-item-control-input">
  36. <div class="ant-form-item-control-input-content">
  37. <input type="text"
  38. class="ant-input"
  39. placeholder="设备编号"
  40. @bind="deviceNo"
  41. @bind:event="oninput" />
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. <!-- 操作按钮 -->
  48. <div class="ant-col ant-col-12">
  49. <div style="padding-top: 8px; text-align: right;">
  50. <span class="ant-space" style="gap: 8px;">
  51. <button type="button" class="ant-btn ant-btn-primary" @onclick="OnQuery">
  52. <span role="img" class="anticon anticon-search"></span>
  53. <span>查询</span>
  54. </button>
  55. <button type="button" class="ant-btn ant-btn-text" @onclick="OnNewDevice">
  56. <span role="img" class="anticon anticon-plus"></span>
  57. <span>新建设备</span>
  58. </button>
  59. </span>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <!-- 设备列表表格 -->
  67. <div class="ant-card table-section">
  68. <div class="ant-card-body">
  69. <div class="ant-spin-nested-loading">
  70. <div class="ant-spin-container">
  71. <div class="ant-table-wrapper">
  72. <div class="ant-table ant-table-bordered ant-table-middle">
  73. <div class="ant-table-container">
  74. <!-- 统一表头和数据表格的列宽 -->
  75. <div class="ant-table-header">
  76. <table class="table-header-fixed">
  77. <colgroup>
  78. <col style="width: 120px;" />
  79. <col style="width: 120px;" />
  80. <col style="width: 100px;" />
  81. <col style="width: 100px;" />
  82. <col style="width: 140px;" />
  83. <col style="width: 150px;" />
  84. <col style="width: 130px;" />
  85. </colgroup>
  86. <thead class="ant-table-thead">
  87. <tr>
  88. <th class="ant-table-cell">设备编号</th>
  89. <th class="ant-table-cell">车牌号</th>
  90. <th class="ant-table-cell">油品名称</th>
  91. <th class="ant-table-cell">罐容量</th>
  92. <th class="ant-table-cell">当前容量</th>
  93. <th class="ant-table-cell">最后更新时间</th>
  94. <th class="ant-table-cell">操作</th>
  95. </tr>
  96. </thead>
  97. </table>
  98. </div>
  99. <!-- 表格内容 -->
  100. <div class="ant-table-body">
  101. <table class="table-body-fixed">
  102. <colgroup>
  103. <col style="width: 120px;" />
  104. <col style="width: 120px;" />
  105. <col style="width: 100px;" />
  106. <col style="width: 100px;" />
  107. <col style="width: 140px;" />
  108. <col style="width: 150px;" />
  109. <col style="width: 130px;" />
  110. </colgroup>
  111. <tbody class="ant-table-tbody">
  112. @if (_loading)
  113. {
  114. <tr>
  115. <td colspan="7" class="ant-table-cell" style="text-align: center; padding: 40px;">
  116. <div class="ant-spin ant-spin-spinning">
  117. <span class="ant-spin-dot ant-spin-dot-spin">
  118. <i class="ant-spin-dot-item"></i>
  119. <i class="ant-spin-dot-item"></i>
  120. <i class="ant-spin-dot-item"></i>
  121. <i class="ant-spin-dot-item"></i>
  122. </span>
  123. </div>
  124. </td>
  125. </tr>
  126. }
  127. else if (_deviceList.Count == 0)
  128. {
  129. <tr>
  130. <td colspan="6" class="ant-table-cell" style="text-align: center; padding: 40px; color: #999;">
  131. 暂无数据
  132. </td>
  133. </tr>
  134. }
  135. else
  136. {
  137. @foreach (var device in _deviceList)
  138. {
  139. <tr class="ant-table-row">
  140. <td class="ant-table-cell">
  141. <span style="font-weight: 500;">@device.DeviceId</span>
  142. </td>
  143. <td class="ant-table-cell">@device.LicencePlate</td>
  144. <td class="ant-table-cell">@device.OilProductName</td>
  145. <td class="ant-table-cell">@FormatNumber(device.TankCapacity)</td>
  146. <td class="ant-table-cell">
  147. <div class="capacity-cell">
  148. <span>@FormatNumber(device.CurrentCapacity)</span>
  149. <div class="capacity-progress">
  150. <div class="progress-bar" style="width: @(GetCapacityPercent(device))%; background: @GetProgressColor(GetCapacityPercent(device));"></div>
  151. </div>
  152. </div>
  153. </td>
  154. <td class="ant-table-cell">@FormatDateTime(device.LastUpdatedTime)</td>
  155. <td class="ant-table-cell">
  156. <div class="action-buttons">
  157. <button type="button" class="ant-btn ant-btn-link ant-btn-sm" @onclick="@(() => OnEditDevice(device))">
  158. <span role="img" class="anticon anticon-edit"></span>
  159. <span>编辑</span>
  160. </button>
  161. <button type="button" class="ant-btn ant-btn-link ant-btn-sm ant-btn-dangerous" @onclick="@(() => OnDeleteDevice(device))">
  162. <span role="img" class="anticon anticon-delete"></span>
  163. <span>删除</span>
  164. </button>
  165. </div>
  166. </td>
  167. </tr>
  168. }
  169. }
  170. </tbody>
  171. </table>
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. <!-- 分页 -->
  177. @if (_totalCount > 0)
  178. {
  179. <div style="margin-top: 16px; text-align: right;">
  180. <div class="ant-pagination ant-pagination-total-text">
  181. 共 @_totalCount 条记录
  182. </div>
  183. <div class="ant-pagination ant-pagination-simple">
  184. <div class="ant-pagination-prev">
  185. <button type="button" class="ant-pagination-item-link" @onclick="@(() => OnPageChange(_currentPage - 1))" disabled="@(_currentPage <= 1)">
  186. <span role="img" class="anticon anticon-left"></span>
  187. </button>
  188. </div>
  189. <div class="ant-pagination-simple-pager">
  190. <input type="text"
  191. class="ant-pagination-simple-pager-input"
  192. value="@_currentPage"
  193. @onchange="@((ChangeEventArgs e) => OnPageInputChange(e))" />
  194. <span class="ant-pagination-slash">/</span>
  195. <span class="ant-pagination-simple-pager-text">@GetTotalPages()</span>
  196. </div>
  197. <div class="ant-pagination-next">
  198. <button type="button" class="ant-pagination-item-link" @onclick="@(() => OnPageChange(_currentPage + 1))" disabled="@(_currentPage >= GetTotalPages())">
  199. <span role="img" class="anticon anticon-right"></span>
  200. </button>
  201. </div>
  202. <div class="ant-pagination-options" style="margin-left: 8px;">
  203. <select class="ant-select ant-select-sm" @onchange="@((ChangeEventArgs e) => OnPageSizeChange(e))">
  204. <option value="10">10 条/页</option>
  205. <option value="20" selected>20 条/页</option>
  206. <option value="50">50 条/页</option>
  207. <option value="100">100 条/页</option>
  208. </select>
  209. </div>
  210. </div>
  211. </div>
  212. }
  213. </div>
  214. </div>
  215. </div>
  216. </div>
  217. <!-- 新建设备对话框 - 简化版 -->
  218. @if (_showNewDeviceDialog)
  219. {
  220. <div class="ant-modal-root">
  221. <div class="ant-modal-mask" style="z-index: 1000;" @onclick="@(() => _showNewDeviceDialog = false)"></div>
  222. <div class="ant-modal-wrap ant-modal-centered" style="z-index: 1000;">
  223. <div class="ant-modal modal-simple-size">
  224. <div class="ant-modal-content">
  225. <div class="ant-modal-header">
  226. <div class="ant-modal-title">新建设备</div>
  227. <button type="button" class="ant-modal-close" @onclick="@(() => _showNewDeviceDialog = false)">
  228. <span role="img" class="anticon anticon-close"></span>
  229. </button>
  230. </div>
  231. <div class="ant-modal-body">
  232. <!-- 简化版编辑设备表单 -->
  233. <div class="ant-form ant-form-vertical">
  234. <!-- 设备编号 -->
  235. <div class="ant-form-item">
  236. <label class="ant-form-item-label">
  237. <span class="ant-form-item-required">设备编号</span>
  238. </label>
  239. <div class="ant-form-item-control">
  240. <div class="ant-form-item-control-input">
  241. <div class="ant-form-item-control-input-content">
  242. <input type="text"
  243. class="ant-input"
  244. placeholder="请输入设备编号"
  245. @bind="_deviceModel.DeviceId"
  246. @bind:event="oninput" />
  247. </div>
  248. </div>
  249. <div class="ant-form-item-explain">设备的唯一标识符</div>
  250. </div>
  251. </div>
  252. <!-- 油品名称 -->
  253. <div class="ant-form-item">
  254. <label class="ant-form-item-label">
  255. <span class="ant-form-item-required">油品名称</span>
  256. </label>
  257. <div class="ant-form-item-control">
  258. <div class="ant-form-item-control-input">
  259. <div class="ant-form-item-control-input-content">
  260. <select class="ant-select" @onchange="@((ChangeEventArgs e) => OnOilProductChange(e))">
  261. <option value="">请选择油品</option>
  262. @foreach (var option in _oilProductOptions)
  263. {
  264. <option value="@option.Value" selected="@(_deviceModel.OilProductName == option.Value)">@option.Label</option>
  265. }
  266. </select>
  267. </div>
  268. </div>
  269. <div class="ant-form-item-explain">选择设备监控的油品类型</div>
  270. </div>
  271. </div>
  272. <!-- 罐容量 -->
  273. <div class="ant-form-item">
  274. <label class="ant-form-item-label">
  275. <span class="ant-form-item-required">罐容量(L)</span>
  276. </label>
  277. <div class="ant-form-item-control">
  278. <div class="ant-form-item-control-input">
  279. <div class="ant-form-item-control-input-content">
  280. <div class="ant-input-number">
  281. <input type="number"
  282. class="ant-input-number-input"
  283. placeholder="请输入罐容量"
  284. @bind="_deviceModel.TankCapacity"
  285. @bind:event="oninput"
  286. min="0"
  287. step="100" />
  288. <div class="ant-input-number-suffix">L</div>
  289. </div>
  290. </div>
  291. </div>
  292. <div class="ant-form-item-explain">油罐的最大容量</div>
  293. </div>
  294. </div>
  295. <!-- 车牌号 -->
  296. <div class="ant-form-item">
  297. <label class="ant-form-item-label">
  298. <span class="ant-form-item-required">车牌号</span>
  299. </label>
  300. <div class="ant-form-item-control">
  301. <div class="ant-form-item-control-input">
  302. <div class="ant-form-item-control-input-content">
  303. <input type="text"
  304. class="ant-input"
  305. placeholder="请输入车牌号"
  306. @bind="_deviceModel.LicencePlate" />
  307. </div>
  308. </div>
  309. <div class="ant-form-item-explain">设备关联的车牌号码</div>
  310. </div>
  311. </div>
  312. </div>
  313. </div>
  314. <div class="ant-modal-footer">
  315. <button type="button" class="ant-btn ant-btn-default" @onclick="@(() => _showNewDeviceDialog = false)">
  316. <span>取消</span>
  317. </button>
  318. <button type="button" class="ant-btn ant-btn-primary" @onclick="OnSaveDevice">
  319. <span>保存设备</span>
  320. </button>
  321. </div>
  322. </div>
  323. </div>
  324. </div>
  325. </div>
  326. }
  327. </div>
  328. <style>
  329. /* 容器样式 */
  330. .equipment-management-container {
  331. padding: 16px;
  332. background-color: #f5f7fa;
  333. min-height: 100vh;
  334. box-sizing: border-box;
  335. }
  336. /* Ant Design样式模拟 */
  337. .ant-card {
  338. background: #fff;
  339. border-radius: 8px;
  340. box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02);
  341. transition: box-shadow 0.3s ease;
  342. }
  343. .ant-card:hover {
  344. box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
  345. }
  346. .filter-section {
  347. margin-bottom: 16px;
  348. }
  349. .table-section {
  350. margin-top: 16px;
  351. }
  352. .ant-card-body {
  353. padding: 20px;
  354. }
  355. /* 表格样式优化 */
  356. .ant-table-container {
  357. border: 1px solid #f0f0f0;
  358. border-radius: 8px;
  359. overflow: hidden;
  360. }
  361. .table-header-fixed,
  362. .table-body-fixed {
  363. table-layout: fixed;
  364. width: 100%;
  365. border-collapse: collapse;
  366. }
  367. .ant-table-header table,
  368. .ant-table-body table {
  369. width: 100%;
  370. }
  371. .ant-table-thead > tr > th {
  372. color: rgba(0, 0, 0, 0.85);
  373. font-weight: 600;
  374. text-align: left;
  375. background: #fafafa;
  376. border-bottom: 1px solid #f0f0f0;
  377. transition: background 0.3s ease;
  378. padding: 12px 8px;
  379. white-space: nowrap;
  380. overflow: hidden;
  381. text-overflow: ellipsis;
  382. }
  383. .ant-table-tbody > tr > td {
  384. border-bottom: 1px solid #f0f0f0;
  385. padding: 12px 8px;
  386. transition: all 0.3s ease;
  387. white-space: nowrap;
  388. overflow: hidden;
  389. text-overflow: ellipsis;
  390. }
  391. /* 容量单元格样式 */
  392. .capacity-cell {
  393. display: flex;
  394. align-items: center;
  395. gap: 8px;
  396. width: 100%;
  397. }
  398. .capacity-progress {
  399. flex-shrink: 0;
  400. width: 60px;
  401. background: #f5f5f5;
  402. border-radius: 100px;
  403. height: 8px;
  404. overflow: hidden;
  405. }
  406. .progress-bar {
  407. height: 100%;
  408. border-radius: 100px;
  409. transition: width 0.3s ease, background 0.3s ease;
  410. }
  411. /* 操作按钮样式 */
  412. .action-buttons {
  413. display: flex;
  414. gap: 8px;
  415. flex-wrap: nowrap;
  416. }
  417. .ant-table-tbody > tr:hover {
  418. background: #fafafa;
  419. }
  420. .ant-table-tbody > tr:hover > td {
  421. background: #fafafa;
  422. }
  423. /* 加载样式 */
  424. .ant-spin-nested-loading {
  425. position: relative;
  426. }
  427. .ant-spin-container {
  428. position: relative;
  429. transition: opacity 0.3s;
  430. }
  431. .ant-spin {
  432. position: absolute;
  433. display: none;
  434. color: #1890ff;
  435. text-align: center;
  436. vertical-align: middle;
  437. opacity: 0;
  438. transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
  439. }
  440. .ant-spin-spinning {
  441. position: static;
  442. display: inline-block;
  443. opacity: 1;
  444. }
  445. .ant-spin-dot {
  446. position: relative;
  447. display: inline-block;
  448. font-size: 20px;
  449. width: 1em;
  450. height: 1em;
  451. }
  452. .ant-spin-dot-item {
  453. position: absolute;
  454. display: block;
  455. width: 9px;
  456. height: 9px;
  457. background-color: #1890ff;
  458. border-radius: 100%;
  459. transform: scale(0.75);
  460. transform-origin: 50% 50%;
  461. opacity: 0.3;
  462. animation: antSpinMove 1s infinite linear alternate;
  463. }
  464. .ant-spin-dot-item:nth-child(1) {
  465. top: 0;
  466. left: 0;
  467. }
  468. .ant-spin-dot-item:nth-child(2) {
  469. top: 0;
  470. right: 0;
  471. animation-delay: 0.4s;
  472. }
  473. .ant-spin-dot-item:nth-child(3) {
  474. right: 0;
  475. bottom: 0;
  476. animation-delay: 0.8s;
  477. }
  478. .ant-spin-dot-item:nth-child(4) {
  479. bottom: 0;
  480. left: 0;
  481. animation-delay: 1.2s;
  482. }
  483. @@keyframes antSpinMove {
  484. to {
  485. opacity: 1;
  486. }
  487. }
  488. /* 分页样式 */
  489. .ant-pagination {
  490. box-sizing: border-box;
  491. margin: 0;
  492. padding: 0;
  493. color: rgba(0, 0, 0, 0.85);
  494. font-size: 14px;
  495. line-height: 1.5715;
  496. list-style: none;
  497. }
  498. .ant-pagination-total-text {
  499. display: inline-block;
  500. height: 32px;
  501. margin-right: 8px;
  502. line-height: 30px;
  503. vertical-align: middle;
  504. }
  505. .ant-pagination-simple {
  506. display: inline-block;
  507. vertical-align: middle;
  508. }
  509. .ant-pagination-prev,
  510. .ant-pagination-next {
  511. display: inline-block;
  512. vertical-align: middle;
  513. }
  514. .ant-pagination-item-link {
  515. display: block;
  516. width: 36px;
  517. height: 36px;
  518. padding: 0;
  519. color: rgba(0, 0, 0, 0.85);
  520. text-align: center;
  521. background-color: #fff;
  522. border: 1px solid #d9d9d9;
  523. border-radius: 6px;
  524. outline: none;
  525. cursor: pointer;
  526. user-select: none;
  527. transition: all 0.3s;
  528. }
  529. .ant-pagination-item-link:hover {
  530. color: #1677ff;
  531. border-color: #1677ff;
  532. transform: translateY(-1px);
  533. }
  534. .ant-pagination-item-link:disabled {
  535. color: rgba(0, 0, 0, 0.25);
  536. background-color: #f5f5f5;
  537. border-color: #d9d9d9;
  538. cursor: not-allowed;
  539. }
  540. .ant-pagination-simple-pager {
  541. display: inline-block;
  542. height: 36px;
  543. margin: 0 12px;
  544. vertical-align: middle;
  545. }
  546. .ant-pagination-simple-pager-input {
  547. width: 60px;
  548. height: 36px;
  549. margin-right: 8px;
  550. text-align: center;
  551. background-color: #fff;
  552. border: 1px solid #d9d9d9;
  553. border-radius: 6px;
  554. outline: none;
  555. transition: all 0.3s;
  556. }
  557. .ant-pagination-simple-pager-input:focus {
  558. border-color: #1677ff;
  559. box-shadow: 0 0 0 2px rgba(5, 145, 255, 0.1);
  560. }
  561. .ant-pagination-slash {
  562. margin: 0 8px;
  563. }
  564. .ant-pagination-options {
  565. display: inline-block;
  566. vertical-align: middle;
  567. margin-left: 12px;
  568. }
  569. /* ====================== 模态框样式优化 ====================== */
  570. .ant-modal-root {
  571. position: fixed;
  572. top: 0;
  573. right: 0;
  574. bottom: 0;
  575. left: 0;
  576. z-index: 1000;
  577. overflow: auto;
  578. outline: 0;
  579. }
  580. .ant-modal-mask {
  581. position: fixed;
  582. top: 0;
  583. right: 0;
  584. bottom: 0;
  585. left: 0;
  586. z-index: 1000;
  587. height: 100%;
  588. background-color: rgba(0, 0, 0, 0.45);
  589. backdrop-filter: blur(2px);
  590. animation: fadeIn 0.2s ease-out;
  591. }
  592. @@keyframes fadeIn {
  593. from {
  594. opacity: 0;
  595. }
  596. to {
  597. opacity: 1;
  598. }
  599. }
  600. .ant-modal-wrap {
  601. position: fixed;
  602. top: 0;
  603. right: 0;
  604. bottom: 0;
  605. left: 0;
  606. overflow: auto;
  607. outline: 0;
  608. display: flex;
  609. align-items: center;
  610. justify-content: center;
  611. animation: modalSlideIn 0.3s ease-out;
  612. }
  613. @@keyframes modalSlideIn {
  614. from {
  615. opacity: 0;
  616. transform: translateY(-30px);
  617. }
  618. to {
  619. opacity: 1;
  620. transform: translateY(0);
  621. }
  622. }
  623. .ant-modal-centered {
  624. display: flex;
  625. align-items: center;
  626. justify-content: center;
  627. }
  628. .ant-modal {
  629. box-sizing: border-box;
  630. margin: 0;
  631. padding: 0;
  632. color: rgba(0, 0, 0, 0.85);
  633. font-size: 14px;
  634. line-height: 1.5715;
  635. list-style: none;
  636. position: relative;
  637. width: auto;
  638. max-width: calc(100vw - 32px);
  639. }
  640. .modal-simple-size {
  641. width: 500px;
  642. max-width: 90vw;
  643. }
  644. .ant-modal-content {
  645. position: relative;
  646. background-color: #fff;
  647. background-clip: padding-box;
  648. border: 0;
  649. border-radius: 12px;
  650. box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
  651. pointer-events: auto;
  652. overflow: hidden;
  653. }
  654. .ant-modal-header {
  655. padding: 20px 24px;
  656. color: rgba(0, 0, 0, 0.85);
  657. background: #fff;
  658. border-bottom: 1px solid #f0f0f0;
  659. border-radius: 12px 12px 0 0;
  660. position: relative;
  661. }
  662. .ant-modal-title {
  663. margin: 0;
  664. color: rgba(0, 0, 0, 0.85);
  665. font-weight: 600;
  666. font-size: 18px;
  667. line-height: 1.5;
  668. }
  669. .ant-modal-close {
  670. position: absolute;
  671. top: 20px;
  672. right: 20px;
  673. z-index: 10;
  674. padding: 0;
  675. color: rgba(0, 0, 0, 0.45);
  676. font-weight: 600;
  677. line-height: 1;
  678. text-decoration: none;
  679. background: transparent;
  680. border: 0;
  681. outline: 0;
  682. cursor: pointer;
  683. transition: all 0.3s;
  684. width: 32px;
  685. height: 32px;
  686. border-radius: 50%;
  687. display: flex;
  688. align-items: center;
  689. justify-content: center;
  690. }
  691. .ant-modal-close:hover {
  692. color: rgba(0, 0, 0, 0.75);
  693. background-color: rgba(0, 0, 0, 0.06);
  694. }
  695. .ant-modal-body {
  696. padding: 24px;
  697. font-size: 14px;
  698. line-height: 1.5715;
  699. word-wrap: break-word;
  700. }
  701. .ant-modal-footer {
  702. padding: 16px 24px;
  703. text-align: right;
  704. background: transparent;
  705. border-top: 1px solid #f0f0f0;
  706. border-radius: 0 0 12px 12px;
  707. display: flex;
  708. align-items: center;
  709. justify-content: flex-end;
  710. gap: 12px;
  711. }
  712. /* 表单样式 */
  713. .ant-form {
  714. box-sizing: border-box;
  715. margin: 0;
  716. padding: 0;
  717. font-size: 14px;
  718. font-variant: tabular-nums;
  719. line-height: 1.5715;
  720. list-style: none;
  721. }
  722. .ant-form-vertical .ant-form-item {
  723. margin-bottom: 24px;
  724. }
  725. .ant-form-item {
  726. margin-bottom: 0;
  727. transition: all 0.3s ease;
  728. }
  729. .ant-form-item:hover {
  730. transform: translateY(-1px);
  731. }
  732. .ant-form-item-label {
  733. line-height: 1.5;
  734. margin-bottom: 8px;
  735. }
  736. .ant-form-item-label > label {
  737. color: rgba(0, 0, 0, 0.85);
  738. font-size: 14px;
  739. font-weight: 500;
  740. }
  741. .ant-form-item-required::before {
  742. display: inline-block;
  743. margin-right: 4px;
  744. color: #ff4d4f;
  745. font-size: 14px;
  746. line-height: 1;
  747. content: '*';
  748. }
  749. .ant-form-item-control-input {
  750. min-height: 36px;
  751. }
  752. .ant-form-item-explain {
  753. color: rgba(0, 0, 0, 0.45);
  754. font-size: 12px;
  755. line-height: 1.5;
  756. margin-top: 4px;
  757. min-height: 18px;
  758. }
  759. .ant-input {
  760. box-sizing: border-box;
  761. margin: 0;
  762. font-variant: tabular-nums;
  763. list-style: none;
  764. font-feature-settings: 'tnum';
  765. position: relative;
  766. display: inline-block;
  767. width: 100%;
  768. min-width: 0;
  769. padding: 8px 12px;
  770. color: rgba(0, 0, 0, 0.85);
  771. font-size: 14px;
  772. line-height: 1.5715;
  773. background-color: #fff;
  774. background-image: none;
  775. border: 1px solid #d9d9d9;
  776. border-radius: 6px;
  777. transition: all 0.3s;
  778. }
  779. .ant-input:focus {
  780. border-color: #4096ff;
  781. box-shadow: 0 0 0 2px rgba(5, 145, 255, 0.1);
  782. outline: 0;
  783. }
  784. .ant-input:hover {
  785. border-color: #4096ff;
  786. }
  787. .ant-select {
  788. box-sizing: border-box;
  789. margin: 0;
  790. padding: 0;
  791. color: rgba(0, 0, 0, 0.85);
  792. font-size: 14px;
  793. line-height: 1.5715;
  794. list-style: none;
  795. position: relative;
  796. display: inline-block;
  797. cursor: pointer;
  798. width: 100%;
  799. }
  800. .ant-select select {
  801. width: 100%;
  802. height: 36px;
  803. padding: 0 11px;
  804. border: 1px solid #d9d9d9;
  805. border-radius: 6px;
  806. background-color: #fff;
  807. transition: all 0.3s;
  808. }
  809. .ant-select select:focus {
  810. border-color: #4096ff;
  811. box-shadow: 0 0 0 2px rgba(5, 145, 255, 0.1);
  812. outline: 0;
  813. }
  814. .ant-select select:hover {
  815. border-color: #4096ff;
  816. }
  817. /* 数字输入框样式 */
  818. .ant-input-number {
  819. position: relative;
  820. width: 100%;
  821. }
  822. .ant-input-number-input {
  823. width: 100%;
  824. padding-right: 30px;
  825. box-sizing: border-box;
  826. }
  827. .ant-input-number-suffix {
  828. position: absolute;
  829. right: 12px;
  830. top: 50%;
  831. transform: translateY(-50%);
  832. color: rgba(0, 0, 0, 0.45);
  833. font-size: 14px;
  834. }
  835. /* 按钮样式 */
  836. .ant-btn {
  837. line-height: 1.5715;
  838. position: relative;
  839. display: inline-flex;
  840. align-items: center;
  841. justify-content: center;
  842. gap: 8px;
  843. font-weight: 400;
  844. white-space: nowrap;
  845. text-align: center;
  846. background-image: none;
  847. border: 1px solid transparent;
  848. box-shadow: 0 2px 0 rgba(0, 0, 0, 0.015);
  849. cursor: pointer;
  850. transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  851. user-select: none;
  852. touch-action: manipulation;
  853. height: 36px;
  854. padding: 6px 15px;
  855. font-size: 14px;
  856. border-radius: 6px;
  857. }
  858. .ant-btn-primary {
  859. color: #fff;
  860. background-color: #1677ff;
  861. border-color: #1677ff;
  862. text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);
  863. box-shadow: 0 2px 0 rgba(5, 145, 255, 0.1);
  864. }
  865. .ant-btn-primary:hover {
  866. color: #fff;
  867. background-color: #4096ff;
  868. border-color: #4096ff;
  869. transform: translateY(-1px);
  870. box-shadow: 0 4px 12px rgba(5, 145, 255, 0.2);
  871. }
  872. .ant-btn-default {
  873. color: rgba(0, 0, 0, 0.85);
  874. background-color: #fff;
  875. border-color: #d9d9d9;
  876. }
  877. .ant-btn-default:hover {
  878. color: #1677ff;
  879. border-color: #1677ff;
  880. background-color: #fff;
  881. }
  882. .ant-btn-text {
  883. color: #1677ff;
  884. background-color: transparent;
  885. border-color: transparent;
  886. box-shadow: none;
  887. }
  888. .ant-btn-text:hover {
  889. color: #4096ff;
  890. background-color: rgba(0, 0, 0, 0.06);
  891. border-color: transparent;
  892. }
  893. .ant-btn-link {
  894. color: #1677ff;
  895. background-color: transparent;
  896. border-color: transparent;
  897. box-shadow: none;
  898. padding: 0;
  899. height: auto;
  900. }
  901. .ant-btn-link:hover {
  902. color: #4096ff;
  903. background-color: transparent;
  904. border-color: transparent;
  905. }
  906. .ant-btn-sm {
  907. height: 28px;
  908. padding: 0 11px;
  909. font-size: 13px;
  910. border-radius: 4px;
  911. }
  912. .ant-btn-dangerous {
  913. color: #ff4d4f;
  914. background-color: transparent;
  915. border-color: transparent;
  916. box-shadow: none;
  917. }
  918. .ant-btn-dangerous:hover {
  919. color: #ff7875;
  920. background-color: rgba(255, 77, 79, 0.06);
  921. border-color: transparent;
  922. }
  923. /* 图标样式 */
  924. .anticon {
  925. display: inline-flex;
  926. align-items: center;
  927. justify-content: center;
  928. color: inherit;
  929. font-style: normal;
  930. line-height: 0;
  931. text-align: center;
  932. text-transform: none;
  933. vertical-align: -0.125em;
  934. text-rendering: optimizeLegibility;
  935. -webkit-font-smoothing: antialiased;
  936. -moz-osx-font-smoothing: grayscale;
  937. }
  938. .anticon-search::before {
  939. content: "🔍";
  940. }
  941. .anticon-plus::before {
  942. content: "+";
  943. font-weight: bold;
  944. }
  945. .anticon-edit::before {
  946. content: "✏️";
  947. }
  948. .anticon-delete::before {
  949. content: "🗑️";
  950. }
  951. .anticon-close::before {
  952. content: "✕";
  953. font-size: 16px;
  954. }
  955. .anticon-left::before {
  956. content: "←";
  957. }
  958. .anticon-right::before {
  959. content: "→";
  960. }
  961. /* 间距样式 */
  962. .ant-space {
  963. display: inline-flex;
  964. gap: 8px;
  965. }
  966. /* 响应式设计 */
  967. @@media (max-width: 768px) {
  968. .equipment-management-container {
  969. padding: 12px;
  970. }
  971. .ant-card-body {
  972. padding: 16px;
  973. }
  974. .ant-col {
  975. width: 100% !important;
  976. }
  977. .modal-simple-size {
  978. width: 95vw !important;
  979. margin: 0 auto;
  980. }
  981. .ant-modal-header {
  982. padding: 16px;
  983. }
  984. .ant-modal-body {
  985. padding: 16px;
  986. }
  987. .ant-modal-footer {
  988. padding: 12px 16px;
  989. flex-direction: column;
  990. gap: 8px;
  991. }
  992. .ant-modal-footer button {
  993. width: 100%;
  994. }
  995. .ant-form-vertical .ant-form-item {
  996. margin-bottom: 20px;
  997. }
  998. .ant-table-thead > tr > th,
  999. .ant-table-tbody > tr > td {
  1000. padding: 10px 6px;
  1001. font-size: 13px;
  1002. }
  1003. .capacity-cell {
  1004. flex-direction: column;
  1005. align-items: flex-start;
  1006. gap: 4px;
  1007. }
  1008. .capacity-progress {
  1009. width: 100%;
  1010. }
  1011. .action-buttons {
  1012. flex-direction: column;
  1013. gap: 4px;
  1014. }
  1015. }
  1016. @@media (max-width: 480px) {
  1017. .ant-btn {
  1018. height: 40px;
  1019. font-size: 15px;
  1020. }
  1021. .ant-table-thead > tr > th,
  1022. .ant-table-tbody > tr > td {
  1023. font-size: 12px;
  1024. }
  1025. }
  1026. /* 小屏幕适配 */
  1027. @@media (max-width: 576px) {
  1028. .ant-table-wrapper {
  1029. overflow-x: auto;
  1030. }
  1031. .ant-table {
  1032. min-width: 600px;
  1033. }
  1034. .filter-section .ant-row {
  1035. flex-direction: column;
  1036. }
  1037. .filter-section .ant-col {
  1038. width: 100%;
  1039. }
  1040. .filter-section .ant-col-12 {
  1041. text-align: left;
  1042. margin-top: 8px;
  1043. }
  1044. }
  1045. </style>