UpdateScreenDialog.razor 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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">
  15. <span>设备码</span><Input Placeholder="设备码" @bind-Value="Model.sn" Style="width:75%" />
  16. </div>
  17. <ValidationMessage For="@(()=>Model.sn)" style="color:red" />
  18. </div>
  19. <div class="filter_colume">
  20. <div class="filter_row">
  21. <span>站点</span>
  22. <Select @bind-Value="Model.SiteId"
  23. Style="width:75%"
  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">
  41. <span>备注</span><Input Placeholder="备注" @bind-Value="Model.Remark" Style="width:75%" />
  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" class="confirm_button">确定</button>
  48. <button Icon="reload" type="button" @onclick="Close" class="cancel_button">取消</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" Class="confirm_button">确定</button>
  57. <button Icon="reload" @onclick="Close" Class="cancel_button">取消</button>
  58. </div>
  59. }
  60. @* @if(Model?.Type == 4)
  61. {
  62. <h3>该设备已存在:@(Model.sn)</h3>
  63. <div class="filter_row" style="justify-content:end;margin-top:5%;">
  64. <button Icon="plus" @onclick="onSure" Class="confirm_button">确定</button>
  65. <button Icon="reload" @onclick="Close" Class="cancel_button">取消</button>
  66. </div>
  67. } *@
  68. </div>
  69. </div>
  70. }
  71. <style>
  72. /* 遮罩层:全屏、半透明 */
  73. .modal-overlay {
  74. position: fixed;
  75. top: 0;
  76. left: 0;
  77. width: 100vw;
  78. height: 100vh;
  79. background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色遮罩 */
  80. display: flex;
  81. justify-content: center;
  82. align-items: center;
  83. z-index: 1000;
  84. }
  85. /* 弹窗内容:白色卡片,居中由父容器控制 */
  86. .modal-content {
  87. background: white;
  88. border-radius: 8px;
  89. width: 80%;
  90. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  91. /* 注意:不要设 height: 100vh,否则会拉满全屏 */
  92. }
  93. .filter_box {
  94. display: flex;
  95. flex-direction: column;
  96. align-items: center;
  97. background: #ffffff;
  98. padding: 2%;
  99. }
  100. .filter_row {
  101. display: flex;
  102. flex-direction: row;
  103. justify-content: space-between;
  104. align-items: center;
  105. width: 100%;
  106. margin-top: 2%;
  107. }
  108. .filter_row_around {
  109. display: flex;
  110. flex-direction: row;
  111. justify-content: space-around;
  112. align-items: center;
  113. width: 100%;
  114. margin-top: 2%;
  115. }
  116. .filter_colume {
  117. display: flex;
  118. flex-direction: column;
  119. justify-content: center;
  120. align-items: end;
  121. width: 48%;
  122. margin-top: 2%;
  123. }
  124. .confirm_button {
  125. margin-right: 2%;
  126. padding: 0% 2%;
  127. background-color: #52c41a;
  128. color:#FFFFFF;
  129. display:flex;
  130. flex-direction:row;
  131. justify-content:center;
  132. align-content:center;
  133. border: solid #d9d9d9 1px;
  134. border-radius:5px;
  135. font-size: large;
  136. }
  137. .cancel_button {
  138. margin-right: 2%;
  139. padding: 0% 2%;
  140. background-color: #FFFFFF;
  141. color: #000000;
  142. display: flex;
  143. flex-direction: row;
  144. justify-content: center;
  145. align-content: center;
  146. border: solid #d9d9d9 1px;
  147. border-radius: 3px;
  148. font-size:large;
  149. }
  150. </style>