UpdateSiteDialog.razor 3.0 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.Name" Style="width:30%" />
  12. <span>归属集团</span>
  13. <Select @bind-Value="Model.ParentId"
  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">
  27. <span>联系方式</span><Input Placeholder="联系方式" @bind-Value="Model.Contact" Style="width:30%" />
  28. <span>地址</span><Input Placeholder="地址" @bind-Value="Model.Address" Style="width:30%" />
  29. </div>
  30. }
  31. @if (Model?.Type == 3)
  32. {
  33. <h3>是否删除站点?@(Model.Name)</h3>
  34. }
  35. <div class="filter_row" style="justify-content:end;margin-top:5%;">
  36. <Button Icon="plus" OnClick="onSure" Style="margin-right:2%">确定</Button>
  37. <Button Icon="reload" OnClick="Close" Style="margin-right:2%">取消</Button>
  38. </div>
  39. </div>
  40. </div>
  41. }
  42. <style>
  43. /* 遮罩层:全屏、半透明 */
  44. .modal-overlay {
  45. position: fixed;
  46. top: 0;
  47. left: 0;
  48. width: 100vw;
  49. height: 100vh;
  50. background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色遮罩 */
  51. display: flex;
  52. justify-content: center;
  53. align-items: center;
  54. z-index: 1000;
  55. }
  56. /* 弹窗内容:白色卡片,居中由父容器控制 */
  57. .modal-content {
  58. background: white;
  59. border-radius: 8px;
  60. width: 80%;
  61. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  62. /* 注意:不要设 height: 100vh,否则会拉满全屏 */
  63. }
  64. .filter_box {
  65. display: flex;
  66. flex-direction: column;
  67. align-items: center;
  68. background: #ffffff;
  69. padding: 2%;
  70. }
  71. .filter_row {
  72. display: flex;
  73. flex-direction: row;
  74. justify-content: space-between;
  75. align-items: center;
  76. width: 100%;
  77. margin-top: 2%;
  78. }
  79. </style>