UpdateSiteDialog.razor 5.3 KB

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