| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- @using AI.Platform.Page.Pages.Site.Model
- @using System.Threading.Tasks
- @using System.Text.Json
- @if (IsVisible)
- {
- <div class="modal-overlay">
- <div class="modal-content filter_box">
- @if (Model?.Type == 1 || Model?.Type == 2)
- {
- <EditForm Model="@Model" OnValidSubmit="onSure" style="width:100%">
- <DataAnnotationsValidator />
- @* <ValidationSummary /> *@
- <div class="filter_row">
- <div class="filter_colume">
- <div class="filter_row_around">
- <span>站名</span><Input Placeholder="站名" @bind-Value="Model.Name" Style="width:80%" />
- </div>
- <ValidationMessage For="@(() => Model.Name)" style="color:red" />
- </div>
-
- <div class="filter_colume">
- <div class="filter_row_around">
- <span>归属集团</span>
- <Select @bind-Value="Model.ParentId"
- Style="width:80%"
- TItemValue="long"
- TItem="string"
- DefaultActiveFirstOption="true" EnableSearch AllowClear>
- <SelectOptions>
- @foreach (var department in Model.Sites)
- {
- <SelectOption TItemValue="long" TItem="string" Value="@department.Id" Label="@department.Name" />
- }
- </SelectOptions>
- </Select>
- </div>
- <ValidationMessage For="@(() => Model.ParentId)" style="color:red" />
- </div>
- </div>
- <div class="filter_row">
- <div class="filter_colume">
- <div class="filter_row_around">
- <span>联系方式</span><Input Placeholder="联系方式" @bind-Value="Model.Contact" Style="width:80%" />
- </div>
- <ValidationMessage For="@(() => Model.Address)" style="color:red" />
- </div>
- <div class="filter_colume">
- <div class="filter_row_around">
- <span>地址</span><Input Placeholder="地址" @bind-Value="Model.Address" Style="width:80%" />
- </div>
- <ValidationMessage For="@(() => Model.Address)" style="color:red" />
- </div>
-
- </div>
- <div class="filter_row" style="justify-content:end;margin-top:5%;">
- <button Icon="plus" type="submit" style="margin-right:2%">确定</button>
- <button Icon="reload" type="button" @onclick="Close" style="margin-right:2%">取消</button>
- </div>
- </EditForm>
-
- }
-
- @if (Model?.Type == 3)
- {
- <h3>是否删除站点?@(Model.Name)</h3>
- <div class="filter_row" style="justify-content:end;margin-top:5%;">
- <Button Icon="plus" OnClick="onSure" Style="margin-right:2%">确定</Button>
- <Button Icon="reload" OnClick="Close" Style="margin-right:2%">取消</Button>
- </div>
- }
-
- </div>
- </div>
- }
- <style>
- /* 遮罩层:全屏、半透明 */
- .modal-overlay {
- position: fixed;
- top: 0;
- left: 0;
- width: 100vw;
- height: 100vh;
- background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色遮罩 */
- display: flex;
- justify-content: center;
- align-items: center;
- z-index: 1000;
- }
- /* 弹窗内容:白色卡片,居中由父容器控制 */
- .modal-content {
- background: white;
- border-radius: 8px;
- width: 80%;
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
- /* 注意:不要设 height: 100vh,否则会拉满全屏 */
- }
- .filter_box {
- display: flex;
- flex-direction: column;
- align-items: center;
- background: #ffffff;
- padding: 2%;
- }
- .filter_row {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- width: 100%;
- margin-top: 2%;
- }
- .filter_row_around {
- display: flex;
- flex-direction: row;
- justify-content: space-around;
- align-items: center;
- width: 100%;
- margin-top: 2%;
- }
- .filter_colume {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: end;
- width: 100%;
- margin-top: 2%;
- }
- </style>
|