UpdateScreenDialog.razor 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. <EditForm Model="@Model" OnValidSubmit="onSure" style="width:100%">
  11. <DataAnnotationsValidator />
  12. <div class="filter_row">
  13. <div class="filter_colume">
  14. <div class="filter_row_around">
  15. <span>设备码</span><Input Placeholder="设备码" @bind-Value="Model.sn" Style="width:80%" />
  16. </div>
  17. <ValidationMessage For="@(()=>Model.sn)" style="color:red" />
  18. </div>
  19. <div class="filter_colume">
  20. <div class="filter_row_around">
  21. <span>站点</span>
  22. <Select @bind-Value="Model.SiteId"
  23. Style="width:80%"
  24. TItemValue="long"
  25. TItem="string"
  26. DefaultActiveFirstOption="true" EnableSearch AllowClear>
  27. <SelectOptions>
  28. @foreach (var department in Model.Sites)
  29. {
  30. <SelectOption TItemValue="long" TItem="string" Value="@department.Id" Label="@department.Name" />
  31. }
  32. </SelectOptions>
  33. </Select>
  34. </div>
  35. <ValidationMessage For="@(() => Model.SiteId)" style="color:red" />
  36. </div>
  37. </div>
  38. <div class="filter_row" style="justify-content:start">
  39. <div class="filter_colume">
  40. <div class="filter_row_around">
  41. <span>备注</span><Input Placeholder="备注" @bind-Value="Model.Remark" Style="width:80%" />
  42. </div>
  43. <ValidationMessage For="@(() => Model.Remark)" style="color:red" />
  44. </div>
  45. </div>
  46. <div class="filter_row" style="justify-content:end;margin-top:5%;">
  47. <button Icon="plus" type="submit" style="margin-right:2%">确定</button>
  48. <button Icon="reload" type="button" @onclick="Close" style="margin-right:2%">取消</button>
  49. </div>
  50. </EditForm>
  51. }
  52. @if (Model?.Type == 3)
  53. {
  54. <h3>是否删除设备?@(Model.sn)</h3>
  55. <div class="filter_row" style="justify-content:end;margin-top:5%;">
  56. <Button Icon="plus" OnClick="onSure" Style="margin-right:2%">确定</Button>
  57. <Button Icon="reload" OnClick="Close" Style="margin-right:2%">取消</Button>
  58. </div>
  59. }
  60. </div>
  61. </div>
  62. }
  63. <style>
  64. /* 遮罩层:全屏、半透明 */
  65. .modal-overlay {
  66. position: fixed;
  67. top: 0;
  68. left: 0;
  69. width: 100vw;
  70. height: 100vh;
  71. background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色遮罩 */
  72. display: flex;
  73. justify-content: center;
  74. align-items: center;
  75. z-index: 1000;
  76. }
  77. /* 弹窗内容:白色卡片,居中由父容器控制 */
  78. .modal-content {
  79. background: white;
  80. border-radius: 8px;
  81. width: 80%;
  82. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  83. /* 注意:不要设 height: 100vh,否则会拉满全屏 */
  84. }
  85. .filter_box {
  86. display: flex;
  87. flex-direction: column;
  88. align-items: center;
  89. background: #ffffff;
  90. padding: 2%;
  91. }
  92. .filter_row {
  93. display: flex;
  94. flex-direction: row;
  95. justify-content: space-between;
  96. align-items: center;
  97. width: 100%;
  98. margin-top: 2%;
  99. }
  100. .filter_row_around {
  101. display: flex;
  102. flex-direction: row;
  103. justify-content: space-around;
  104. align-items: center;
  105. width: 100%;
  106. margin-top: 2%;
  107. }
  108. .filter_colume {
  109. display: flex;
  110. flex-direction: column;
  111. justify-content: center;
  112. align-items: end;
  113. width: 100%;
  114. margin-top: 2%;
  115. }
  116. </style>