|
|
@@ -1,6 +1,7 @@
|
|
|
@page "/setting/unifiedsetting"
|
|
|
@using EasyTemplate.Service
|
|
|
@using EasyTemplate.Tool.Entity.App
|
|
|
+@using EasyTemplate.Page.Components.IdSelector
|
|
|
@inject NozzleService nozzleService
|
|
|
@inject IJSRuntime JSRuntime
|
|
|
|
|
|
@@ -57,8 +58,9 @@
|
|
|
</li>
|
|
|
@for (int i = 1; i <= totalPages_Engine; i++)
|
|
|
{
|
|
|
+ var item = i;
|
|
|
<li class="page-item @(currentPage_Engine == i ? "active" : "")">
|
|
|
- <a class="page-link" @onclick="() => ChangePage_Engine(i)">@i</a>
|
|
|
+ <a class="page-link" @onclick="() => ChangePage_Engine(item)">@item</a>
|
|
|
</li>
|
|
|
}
|
|
|
<li class="page-item @(currentPage_Engine == totalPages_Engine ? "disabled" : "")">
|
|
|
@@ -120,8 +122,9 @@
|
|
|
</li>
|
|
|
@for (int i = 1; i <= totalPages_Board; i++)
|
|
|
{
|
|
|
+ var item = i;
|
|
|
<li class="page-item @(currentPage_Board == i ? "active" : "")">
|
|
|
- <a class="page-link" @onclick="() => ChangePage_Board(i)">@i</a>
|
|
|
+ <a class="page-link" @onclick="() => ChangePage_Board(item)">@item</a>
|
|
|
</li>
|
|
|
}
|
|
|
<li class="page-item @(currentPage_Board == totalPages_Board ? "disabled" : "")">
|
|
|
@@ -175,8 +178,9 @@
|
|
|
</li>
|
|
|
@for (int i = 1; i <= totalPages_Nozzle; i++)
|
|
|
{
|
|
|
+ var item = i;
|
|
|
<li class="page-item @(currentPage_Nozzle == i ? "active" : "")">
|
|
|
- <a class="page-link" @onclick="() => ChangePage_Nozzle(i)">@i</a>
|
|
|
+ <a class="page-link" @onclick="() => ChangePage_Nozzle(item)">@item</a>
|
|
|
</li>
|
|
|
}
|
|
|
<li class="page-item @(currentPage_Nozzle == totalPages_Nozzle ? "disabled" : "")">
|
|
|
@@ -200,7 +204,12 @@
|
|
|
<div class="modal-body">
|
|
|
<div class="mb-3">
|
|
|
<label class="form-label">油机ID</label>
|
|
|
- <input class="form-control" @bind="currentEngine.EngineId" disabled="@isEngineEditMode" />
|
|
|
+ <div class="input-group">
|
|
|
+ <input class="form-control" @bind="currentEngine.EngineId" disabled="@isEngineEditMode" />
|
|
|
+ <button class="btn btn-outline-secondary" type="button" @onclick="ShowEngineIdSelector" disabled="@isEngineEditMode">
|
|
|
+ <i class="fas fa-list"></i> 选择
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="mb-3">
|
|
|
<label class="form-label">工厂ID</label>
|
|
|
@@ -243,7 +252,12 @@
|
|
|
</div>
|
|
|
<div class="mb-3">
|
|
|
<label class="form-label">主板ID</label>
|
|
|
- <input class="form-control" @bind="currentBoard.BoardId" disabled="@isBoardEditMode" />
|
|
|
+ <div class="input-group">
|
|
|
+ <input class="form-control" @bind="currentBoard.BoardId" disabled="@isBoardEditMode" />
|
|
|
+ <button class="btn btn-outline-secondary" type="button" @onclick="ShowBoardIdSelector" disabled="@isBoardEditMode">
|
|
|
+ <i class="fas fa-list"></i> 选择
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="mb-3">
|
|
|
<label class="form-label">IP地址</label>
|
|
|
@@ -269,7 +283,12 @@
|
|
|
<div class="modal-body">
|
|
|
<div class="mb-3">
|
|
|
<label class="form-label">油枪ID</label>
|
|
|
- <input type="number" class="form-control" @bind="currentNozzle.NozzleId" disabled="@isNozzleEditMode" />
|
|
|
+ <div class="input-group">
|
|
|
+ <input type="number" class="form-control" @bind="currentNozzle.NozzleId" disabled="@isNozzleEditMode" />
|
|
|
+ <button class="btn btn-outline-secondary" type="button" @onclick="ShowNozzleIdSelector" disabled="@isNozzleEditMode">
|
|
|
+ <i class="fas fa-list"></i> 选择
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="mb-3">
|
|
|
<label class="form-label">所属主板ID</label>
|
|
|
@@ -746,4 +765,107 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // ID选择器相关状态
|
|
|
+ private bool showEngineIdSelector = false;
|
|
|
+ private bool showBoardIdSelector = false;
|
|
|
+ private bool showNozzleIdSelector = false;
|
|
|
+
|
|
|
+ // 显示ID选择器
|
|
|
+ private void ShowEngineIdSelector()
|
|
|
+ {
|
|
|
+ showEngineIdSelector = true;
|
|
|
+ StateHasChanged();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void ShowBoardIdSelector()
|
|
|
+ {
|
|
|
+ showBoardIdSelector = true;
|
|
|
+ StateHasChanged();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void ShowNozzleIdSelector()
|
|
|
+ {
|
|
|
+ showNozzleIdSelector = true;
|
|
|
+ StateHasChanged();
|
|
|
+ }
|
|
|
+
|
|
|
+ // ID选择回调
|
|
|
+ private void OnEngineIdSelected(int id)
|
|
|
+ {
|
|
|
+ currentEngine.EngineId = id;
|
|
|
+ showEngineIdSelector = false;
|
|
|
+ StateHasChanged();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void OnBoardIdSelected(int id)
|
|
|
+ {
|
|
|
+ currentBoard.BoardId = id;
|
|
|
+ showBoardIdSelector = false;
|
|
|
+ StateHasChanged();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void OnNozzleIdSelected(int id)
|
|
|
+ {
|
|
|
+ currentNozzle.NozzleId = id;
|
|
|
+ showNozzleIdSelector = false;
|
|
|
+ StateHasChanged();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 取消选择
|
|
|
+ private void CancelEngineIdSelection()
|
|
|
+ {
|
|
|
+ showEngineIdSelector = false;
|
|
|
+ StateHasChanged();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void CancelBoardIdSelection()
|
|
|
+ {
|
|
|
+ showBoardIdSelector = false;
|
|
|
+ StateHasChanged();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void CancelNozzleIdSelection()
|
|
|
+ {
|
|
|
+ showNozzleIdSelector = false;
|
|
|
+ StateHasChanged();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取已使用的ID列表
|
|
|
+ private List<int> GetUsedEngineIds()
|
|
|
+ {
|
|
|
+ return engines?.Select(e => e.EngineId).ToList() ?? new List<int>();
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<int> GetUsedBoardIds()
|
|
|
+ {
|
|
|
+ return allBoards?.Select(b => b.BoardId).ToList() ?? new List<int>();
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<int> GetUsedNozzleIds()
|
|
|
+ {
|
|
|
+ return allNozzles?.Select(n => n.NozzleId).ToList() ?? new List<int>();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+<!-- ID选择器组件 -->
|
|
|
+@if (showEngineIdSelector)
|
|
|
+{
|
|
|
+ <EngineIdSelector usedEngineIds="GetUsedEngineIds()"
|
|
|
+ OnSelected="OnEngineIdSelected"
|
|
|
+ OnCancelled="CancelEngineIdSelection" />
|
|
|
+}
|
|
|
+
|
|
|
+@if (showBoardIdSelector)
|
|
|
+{
|
|
|
+ <BoardIdSelector usedBoardIds="GetUsedBoardIds()"
|
|
|
+ OnSelected="OnBoardIdSelected"
|
|
|
+ OnCancelled="CancelBoardIdSelection" />
|
|
|
+}
|
|
|
+
|
|
|
+@if (showNozzleIdSelector)
|
|
|
+{
|
|
|
+ <NozzleIdSelector usedNozzleIds="GetUsedNozzleIds()"
|
|
|
+ OnSelected="OnNozzleIdSelected"
|
|
|
+ OnCancelled="CancelNozzleIdSelection" />
|
|
|
}
|