UpdateScreenDialog.razor 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. @using AI.Platform.Page.Pages.Site.Model
  2. @using System.Threading.Tasks
  3. @using System.Text.Json
  4. @if (IsVisible)
  5. {
  6. <div class="modal-overlay">
  7. <div class="modal-content filter_box">
  8. @if (Model?.Type == 1 || Model?.Type == 2)
  9. {
  10. <div class="filter_row">
  11. <span>设备码</span><Input Placeholder="设备码" @bind-Value="Model.sn" Style="width:30%" />
  12. <span>站点</span>
  13. <Select @bind-Value="Model.SiteId"
  14. Style="width:30%"
  15. TItemValue="long"
  16. TItem="string"
  17. DefaultActiveFirstOption="true" EnableSearch AllowClear>
  18. <SelectOptions>
  19. @foreach (var department in Model.Sites)
  20. {
  21. <SelectOption TItemValue="long" TItem="string" Value="@department.Id" Label="@department.Name" />
  22. }
  23. </SelectOptions>
  24. </Select>
  25. </div>
  26. <div class="filter_row" style="justify-content:start">
  27. <span>备注</span><Input Placeholder="备注" @bind-Value="Model.Remark" Style="width:30%" />
  28. </div>
  29. }
  30. @if (Model?.Type == 3)
  31. {
  32. <h3>是否删除设备?@(Model.sn)</h3>
  33. }
  34. <div class="filter_row" style="justify-content:end;margin-top:5%;">
  35. <Button Icon="plus" OnClick="onSure" Style="margin-right:2%">确定</Button>
  36. <Button Icon="reload" OnClick="Close" Style="margin-right:2%">取消</Button>
  37. </div>
  38. </div>
  39. </div>
  40. }
  41. <style>
  42. /* 遮罩层:全屏、半透明 */
  43. .modal-overlay {
  44. position: fixed;
  45. top: 0;
  46. left: 0;
  47. width: 100vw;
  48. height: 100vh;
  49. background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色遮罩 */
  50. display: flex;
  51. justify-content: center;
  52. align-items: center;
  53. z-index: 1000;
  54. }
  55. /* 弹窗内容:白色卡片,居中由父容器控制 */
  56. .modal-content {
  57. background: white;
  58. border-radius: 8px;
  59. width: 80%;
  60. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  61. /* 注意:不要设 height: 100vh,否则会拉满全屏 */
  62. }
  63. .filter_box {
  64. display: flex;
  65. flex-direction: column;
  66. align-items: center;
  67. background: #ffffff;
  68. padding: 2%;
  69. }
  70. .filter_row {
  71. display: flex;
  72. flex-direction: row;
  73. justify-content: space-between;
  74. align-items: center;
  75. width: 100%;
  76. margin-top: 2%;
  77. }
  78. </style>