|
@@ -1,15 +1,15 @@
|
|
|
@page "/setting/unifiedsetting"
|
|
@page "/setting/unifiedsetting"
|
|
|
@using EasyTemplate.Service
|
|
@using EasyTemplate.Service
|
|
|
@using EasyTemplate.Tool.Entity.App
|
|
@using EasyTemplate.Tool.Entity.App
|
|
|
|
|
+@using EasyTemplate.Page.Components.IdSelector
|
|
|
@inject NozzleService nozzleService
|
|
@inject NozzleService nozzleService
|
|
|
@inject IJSRuntime JSRuntime
|
|
@inject IJSRuntime JSRuntime
|
|
|
|
|
|
|
|
-<h3>统一设备设置</h3>
|
|
|
|
|
|
|
|
|
|
<div class="container-fluid">
|
|
<div class="container-fluid">
|
|
|
<div class="row">
|
|
<div class="row">
|
|
|
<!-- 油机列 -->
|
|
<!-- 油机列 -->
|
|
|
- <div class="col-md-3 border-end">
|
|
|
|
|
|
|
+ <div class="col-md-3 border-end position-relative" style="height: calc(100vh - 100px);">
|
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
|
<h5>油机列表</h5>
|
|
<h5>油机列表</h5>
|
|
|
<button class="btn btn-sm btn-primary" @onclick="ShowCreateEngineModal">
|
|
<button class="btn btn-sm btn-primary" @onclick="ShowCreateEngineModal">
|
|
@@ -18,29 +18,28 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 显示所有油机选项 -->
|
|
<!-- 显示所有油机选项 -->
|
|
|
- <div class="list-group mb-3">
|
|
|
|
|
|
|
+ @* <div class="list-group mb-3">
|
|
|
<button class="list-group-item list-group-item-action @(selectedEngineId == 0 ? "active" : "")"
|
|
<button class="list-group-item list-group-item-action @(selectedEngineId == 0 ? "active" : "")"
|
|
|
@onclick="() => SelectEngine(0)">
|
|
@onclick="() => SelectEngine(0)">
|
|
|
显示所有油机
|
|
显示所有油机
|
|
|
</button>
|
|
</button>
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div> *@
|
|
|
|
|
|
|
|
<!-- 油机列表 -->
|
|
<!-- 油机列表 -->
|
|
|
- <div class="list-group" style="max-height: 400px; overflow-y: auto;">
|
|
|
|
|
|
|
+ <div class="list-group flex-grow-1" style="max-height: 400px; overflow-y: auto; margin-bottom: 50px;">
|
|
|
@if (paginatedEngines != null)
|
|
@if (paginatedEngines != null)
|
|
|
{
|
|
{
|
|
|
@foreach (var engine in paginatedEngines)
|
|
@foreach (var engine in paginatedEngines)
|
|
|
{
|
|
{
|
|
|
- <div class="list-group-item d-flex justify-content-between align-items-center @(selectedEngineId == engine.EngineId ? "active" : "")">
|
|
|
|
|
- <div @onclick="() => SelectEngine(engine.EngineId)" style="cursor: pointer;">
|
|
|
|
|
- <div><strong>ID: @engine.EngineId</strong></div>
|
|
|
|
|
- <small>工厂: @engine.factory_id</small>
|
|
|
|
|
|
|
+ <div @onclick="() => SelectEngine(engine.EngineId)" class="list-group-item d-flex justify-content-between align-items-center py-1 @(selectedEngineId == engine.EngineId ? "active" : "")">
|
|
|
|
|
+ <div style="cursor: pointer;">
|
|
|
|
|
+ <div><strong>油机 @engine.EngineId</strong></div>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
- <button class="btn btn-sm btn-info me-1" @onclick="() => ShowEditEngineModal(engine)">
|
|
|
|
|
|
|
+ <button class="btn btn-sm btn-info me-1 p-1" @onclick="() => ShowEditEngineModal(engine)">
|
|
|
<i class="fas fa-edit"></i>
|
|
<i class="fas fa-edit"></i>
|
|
|
</button>
|
|
</button>
|
|
|
- <button class="btn btn-sm btn-danger" @onclick="() => DeleteEngine(engine.EngineId)">
|
|
|
|
|
|
|
+ <button class="btn btn-sm btn-danger p-1" @onclick="() => DeleteEngine(engine.EngineId)">
|
|
|
<i class="fas fa-trash"></i>
|
|
<i class="fas fa-trash"></i>
|
|
|
</button>
|
|
</button>
|
|
|
</div>
|
|
</div>
|
|
@@ -52,15 +51,16 @@
|
|
|
<!-- 油机分页控件 -->
|
|
<!-- 油机分页控件 -->
|
|
|
@if (engines != null && engines.Count > pageSize)
|
|
@if (engines != null && engines.Count > pageSize)
|
|
|
{
|
|
{
|
|
|
- <nav aria-label="油机分页">
|
|
|
|
|
|
|
+ <nav aria-label="油机分页" class="position-absolute" style="bottom: 50px; left: 0; right: 0;">
|
|
|
<ul class="pagination pagination-sm justify-content-center mt-2 mb-0">
|
|
<ul class="pagination pagination-sm justify-content-center mt-2 mb-0">
|
|
|
<li class="page-item @(currentPage_Engine == 1 ? "disabled" : "")">
|
|
<li class="page-item @(currentPage_Engine == 1 ? "disabled" : "")">
|
|
|
<a class="page-link" @onclick="() => ChangePage_Engine(currentPage_Engine - 1)" tabindex="-1">上一页</a>
|
|
<a class="page-link" @onclick="() => ChangePage_Engine(currentPage_Engine - 1)" tabindex="-1">上一页</a>
|
|
|
</li>
|
|
</li>
|
|
|
@for (int i = 1; i <= totalPages_Engine; i++)
|
|
@for (int i = 1; i <= totalPages_Engine; i++)
|
|
|
{
|
|
{
|
|
|
|
|
+ var item = i;
|
|
|
<li class="page-item @(currentPage_Engine == i ? "active" : "")">
|
|
<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>
|
|
|
}
|
|
}
|
|
|
<li class="page-item @(currentPage_Engine == totalPages_Engine ? "disabled" : "")">
|
|
<li class="page-item @(currentPage_Engine == totalPages_Engine ? "disabled" : "")">
|
|
@@ -72,7 +72,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 主板列 -->
|
|
<!-- 主板列 -->
|
|
|
- <div class="col-md-3 border-end">
|
|
|
|
|
|
|
+ <div class="col-md-3 border-end position-relative" style="height: calc(100vh - 100px);">
|
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
|
<h5>主板列表</h5>
|
|
<h5>主板列表</h5>
|
|
|
<button class="btn btn-sm btn-primary" @onclick="ShowCreateBoardModal" disabled="@(selectedEngineId == 0)">
|
|
<button class="btn btn-sm btn-primary" @onclick="ShowCreateBoardModal" disabled="@(selectedEngineId == 0)">
|
|
@@ -80,30 +80,30 @@
|
|
|
</button>
|
|
</button>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <!-- 显示所有主板选项 -->
|
|
|
|
|
|
|
+
|
|
|
|
|
+ @* <!-- 显示所有主板选项 -->
|
|
|
<div class="list-group mb-3">
|
|
<div class="list-group mb-3">
|
|
|
<button class="list-group-item list-group-item-action @(selectedBoardId == 0 ? "active" : "")"
|
|
<button class="list-group-item list-group-item-action @(selectedBoardId == 0 ? "active" : "")"
|
|
|
@onclick="() => SelectBoard(0)" disabled="@(selectedEngineId == 0)">
|
|
@onclick="() => SelectBoard(0)" disabled="@(selectedEngineId == 0)">
|
|
|
显示所有主板
|
|
显示所有主板
|
|
|
</button>
|
|
</button>
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div> *@
|
|
|
|
|
|
|
|
<!-- 主板列表 -->
|
|
<!-- 主板列表 -->
|
|
|
- <div class="list-group" style="max-height: 400px; overflow-y: auto;">
|
|
|
|
|
|
|
+ <div class="list-group flex-grow-1" style="max-height: 400px; overflow-y: auto; margin-bottom: 50px;">
|
|
|
@if (paginatedBoards != null)
|
|
@if (paginatedBoards != null)
|
|
|
{
|
|
{
|
|
|
@foreach (var board in paginatedBoards)
|
|
@foreach (var board in paginatedBoards)
|
|
|
{
|
|
{
|
|
|
- <div @onclick="() => SelectBoard(board.BoardId)" class="list-group-item d-flex justify-content-between align-items-center @(selectedBoardId == board.BoardId ? "active" : "")">
|
|
|
|
|
|
|
+ <div @onclick="() => SelectBoard(board.BoardId)" class="list-group-item d-flex justify-content-between align-items-center py-1 @(selectedBoardId == board.BoardId ? "active" : "")">
|
|
|
<div style="cursor: pointer;">
|
|
<div style="cursor: pointer;">
|
|
|
- <div><strong>ID: @board.BoardId</strong></div>
|
|
|
|
|
- <small>IP: @board.ip</small>
|
|
|
|
|
|
|
+ <div><strong>主板 @board.BoardId</strong></div>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
- <button class="btn btn-sm btn-info me-1" @onclick="() => ShowEditBoardModal(board)">
|
|
|
|
|
|
|
+ <button class="btn btn-sm btn-info me-1 p-1" @onclick="() => ShowEditBoardModal(board)">
|
|
|
<i class="fas fa-edit"></i>
|
|
<i class="fas fa-edit"></i>
|
|
|
</button>
|
|
</button>
|
|
|
- <button class="btn btn-sm btn-danger" @onclick="() => DeleteBoard(board.BoardId)">
|
|
|
|
|
|
|
+ <button class="btn btn-sm btn-danger p-1" @onclick="() => DeleteBoard(board.BoardId)">
|
|
|
<i class="fas fa-trash"></i>
|
|
<i class="fas fa-trash"></i>
|
|
|
</button>
|
|
</button>
|
|
|
</div>
|
|
</div>
|
|
@@ -115,15 +115,16 @@
|
|
|
<!-- 主板分页控件 -->
|
|
<!-- 主板分页控件 -->
|
|
|
@if (filteredBoards != null && filteredBoards.Count > pageSize)
|
|
@if (filteredBoards != null && filteredBoards.Count > pageSize)
|
|
|
{
|
|
{
|
|
|
- <nav aria-label="主板分页">
|
|
|
|
|
|
|
+ <nav aria-label="主板分页" class="position-absolute" style="bottom: 50px; left: 0; right: 0;">
|
|
|
<ul class="pagination pagination-sm justify-content-center mt-2 mb-0">
|
|
<ul class="pagination pagination-sm justify-content-center mt-2 mb-0">
|
|
|
<li class="page-item @(currentPage_Board == 1 ? "disabled" : "")">
|
|
<li class="page-item @(currentPage_Board == 1 ? "disabled" : "")">
|
|
|
<a class="page-link" @onclick="() => ChangePage_Board(currentPage_Board - 1)" tabindex="-1">上一页</a>
|
|
<a class="page-link" @onclick="() => ChangePage_Board(currentPage_Board - 1)" tabindex="-1">上一页</a>
|
|
|
</li>
|
|
</li>
|
|
|
@for (int i = 1; i <= totalPages_Board; i++)
|
|
@for (int i = 1; i <= totalPages_Board; i++)
|
|
|
{
|
|
{
|
|
|
|
|
+ var item = i;
|
|
|
<li class="page-item @(currentPage_Board == i ? "active" : "")">
|
|
<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>
|
|
|
}
|
|
}
|
|
|
<li class="page-item @(currentPage_Board == totalPages_Board ? "disabled" : "")">
|
|
<li class="page-item @(currentPage_Board == totalPages_Board ? "disabled" : "")">
|
|
@@ -135,7 +136,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 油枪列 -->
|
|
<!-- 油枪列 -->
|
|
|
- <div class="col-md-6">
|
|
|
|
|
|
|
+ <div class="col-md-6 position-relative" style="height: calc(100vh - 100px);">
|
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
|
<h5>油枪列表</h5>
|
|
<h5>油枪列表</h5>
|
|
|
<button class="btn btn-sm btn-primary" @onclick="ShowCreateNozzleModal" disabled="@(selectedBoardId == 0)">
|
|
<button class="btn btn-sm btn-primary" @onclick="ShowCreateNozzleModal" disabled="@(selectedBoardId == 0)">
|
|
@@ -144,22 +145,21 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 油枪列表 -->
|
|
<!-- 油枪列表 -->
|
|
|
- <div class="list-group" style="max-height: 400px; overflow-y: auto;">
|
|
|
|
|
|
|
+ <div class="list-group flex-grow-1" style="margin-bottom: 50px;">
|
|
|
@if (paginatedNozzles != null)
|
|
@if (paginatedNozzles != null)
|
|
|
{
|
|
{
|
|
|
@foreach (var nozzle in paginatedNozzles)
|
|
@foreach (var nozzle in paginatedNozzles)
|
|
|
{
|
|
{
|
|
|
- <div class="list-group-item d-flex justify-content-between align-items-center">
|
|
|
|
|
|
|
+ <div class="list-group-item d-flex justify-content-between align-items-center py-1">
|
|
|
<div>
|
|
<div>
|
|
|
- <div><strong>ID: @nozzle.NozzleId</strong></div>
|
|
|
|
|
- <small>节点: @nozzle.node | 产品: @nozzle.product | 状态: @(nozzle.disable ? "禁用" : "启用")</small>
|
|
|
|
|
- <div><small>MN码: @nozzle.mncode</small></div>
|
|
|
|
|
|
|
+ <div><strong>油枪 @nozzle.NozzleId</strong></div>
|
|
|
|
|
+ <small>节点: @nozzle.node | 产品: @nozzle.product | 状态: @(nozzle.disable ? "禁用" : "启用") | MN码: @nozzle.mncode</small>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
- <button class="btn btn-sm btn-info me-1" @onclick="() => ShowEditNozzleModal(nozzle)">
|
|
|
|
|
|
|
+ <button class="btn btn-sm btn-info me-1 p-1" @onclick="() => ShowEditNozzleModal(nozzle)">
|
|
|
<i class="fas fa-edit"></i>
|
|
<i class="fas fa-edit"></i>
|
|
|
</button>
|
|
</button>
|
|
|
- <button class="btn btn-sm btn-danger" @onclick="() => DeleteNozzle(nozzle.NozzleId)">
|
|
|
|
|
|
|
+ <button class="btn btn-sm btn-danger p-1" @onclick="() => DeleteNozzle(nozzle.NozzleId)">
|
|
|
<i class="fas fa-trash"></i>
|
|
<i class="fas fa-trash"></i>
|
|
|
</button>
|
|
</button>
|
|
|
</div>
|
|
</div>
|
|
@@ -171,15 +171,16 @@
|
|
|
<!-- 油枪分页控件 -->
|
|
<!-- 油枪分页控件 -->
|
|
|
@if (filteredNozzles != null && filteredNozzles.Count > pageSize)
|
|
@if (filteredNozzles != null && filteredNozzles.Count > pageSize)
|
|
|
{
|
|
{
|
|
|
- <nav aria-label="油枪分页">
|
|
|
|
|
|
|
+ <nav aria-label="油枪分页" class="position-absolute" style="bottom: 50px; left: 0; right: 0;">
|
|
|
<ul class="pagination pagination-sm justify-content-center mt-2 mb-0">
|
|
<ul class="pagination pagination-sm justify-content-center mt-2 mb-0">
|
|
|
<li class="page-item @(currentPage_Nozzle == 1 ? "disabled" : "")">
|
|
<li class="page-item @(currentPage_Nozzle == 1 ? "disabled" : "")">
|
|
|
<a class="page-link" @onclick="() => ChangePage_Nozzle(currentPage_Nozzle - 1)" tabindex="-1">上一页</a>
|
|
<a class="page-link" @onclick="() => ChangePage_Nozzle(currentPage_Nozzle - 1)" tabindex="-1">上一页</a>
|
|
|
</li>
|
|
</li>
|
|
|
@for (int i = 1; i <= totalPages_Nozzle; i++)
|
|
@for (int i = 1; i <= totalPages_Nozzle; i++)
|
|
|
{
|
|
{
|
|
|
|
|
+ var item = i;
|
|
|
<li class="page-item @(currentPage_Nozzle == i ? "active" : "")">
|
|
<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>
|
|
|
}
|
|
}
|
|
|
<li class="page-item @(currentPage_Nozzle == totalPages_Nozzle ? "disabled" : "")">
|
|
<li class="page-item @(currentPage_Nozzle == totalPages_Nozzle ? "disabled" : "")">
|
|
@@ -203,7 +204,12 @@
|
|
|
<div class="modal-body">
|
|
<div class="modal-body">
|
|
|
<div class="mb-3">
|
|
<div class="mb-3">
|
|
|
<label class="form-label">油机ID</label>
|
|
<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>
|
|
|
<div class="mb-3">
|
|
<div class="mb-3">
|
|
|
<label class="form-label">工厂ID</label>
|
|
<label class="form-label">工厂ID</label>
|
|
@@ -231,9 +237,18 @@
|
|
|
<button type="button" class="btn-close" @onclick="CloseBoardModal"></button>
|
|
<button type="button" class="btn-close" @onclick="CloseBoardModal"></button>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="modal-body">
|
|
<div class="modal-body">
|
|
|
|
|
+ <div class="mb-3">
|
|
|
|
|
+ <label class="form-label">主板ID</label>
|
|
|
|
|
+ <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">
|
|
<div class="mb-3">
|
|
|
<label class="form-label">所属油机ID</label>
|
|
<label class="form-label">所属油机ID</label>
|
|
|
- <select class="form-select" @bind="currentBoard.EngineId" disabled="@isBoardEditMode">
|
|
|
|
|
|
|
+ <select class="form-select" @bind="currentBoard.EngineId">
|
|
|
<option value="0">请选择油机</option>
|
|
<option value="0">请选择油机</option>
|
|
|
@if (engines != null)
|
|
@if (engines != null)
|
|
|
{
|
|
{
|
|
@@ -244,10 +259,6 @@
|
|
|
}
|
|
}
|
|
|
</select>
|
|
</select>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="mb-3">
|
|
|
|
|
- <label class="form-label">主板ID</label>
|
|
|
|
|
- <input class="form-control" @bind="currentBoard.BoardId" disabled="@isBoardEditMode" />
|
|
|
|
|
- </div>
|
|
|
|
|
<div class="mb-3">
|
|
<div class="mb-3">
|
|
|
<label class="form-label">IP地址</label>
|
|
<label class="form-label">IP地址</label>
|
|
|
<input class="form-control" @bind="currentBoard.ip" />
|
|
<input class="form-control" @bind="currentBoard.ip" />
|
|
@@ -272,11 +283,16 @@
|
|
|
<div class="modal-body">
|
|
<div class="modal-body">
|
|
|
<div class="mb-3">
|
|
<div class="mb-3">
|
|
|
<label class="form-label">油枪ID</label>
|
|
<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>
|
|
|
<div class="mb-3">
|
|
<div class="mb-3">
|
|
|
<label class="form-label">所属主板ID</label>
|
|
<label class="form-label">所属主板ID</label>
|
|
|
- <select class="form-select" @bind="currentNozzle.BoardId" disabled="@isNozzleEditMode">
|
|
|
|
|
|
|
+ <select class="form-select" @bind="currentNozzle.BoardId">
|
|
|
<option value="0">请选择主板</option>
|
|
<option value="0">请选择主板</option>
|
|
|
@if (boards != null)
|
|
@if (boards != null)
|
|
|
{
|
|
{
|
|
@@ -322,7 +338,7 @@
|
|
|
private List<TBoard> boards = new(); // 用于下拉选择
|
|
private List<TBoard> boards = new(); // 用于下拉选择
|
|
|
|
|
|
|
|
// 分页相关
|
|
// 分页相关
|
|
|
- private const int pageSize = 10; // 每页显示条数
|
|
|
|
|
|
|
+ private const int pageSize = 8; // 每页显示条数
|
|
|
private int currentPage_Engine = 1;
|
|
private int currentPage_Engine = 1;
|
|
|
private int totalPages_Engine => engines == null ? 0 : (int)Math.Ceiling((double)engines.Count / pageSize);
|
|
private int totalPages_Engine => engines == null ? 0 : (int)Math.Ceiling((double)engines.Count / pageSize);
|
|
|
private List<TEngine> paginatedEngines => engines?.Skip((currentPage_Engine - 1) * pageSize).Take(pageSize).ToList() ?? new List<TEngine>();
|
|
private List<TEngine> paginatedEngines => engines?.Skip((currentPage_Engine - 1) * pageSize).Take(pageSize).ToList() ?? new List<TEngine>();
|
|
@@ -373,8 +389,8 @@
|
|
|
boards = new List<TBoard>(allBoards); // 用于下拉选择
|
|
boards = new List<TBoard>(allBoards); // 用于下拉选择
|
|
|
|
|
|
|
|
// 默认显示所有数据
|
|
// 默认显示所有数据
|
|
|
- filteredBoards = new List<TBoard>(allBoards);
|
|
|
|
|
- filteredNozzles = new List<TNozzle>(allNozzles);
|
|
|
|
|
|
|
+ //filteredBoards = new List<TBoard>(allBoards);
|
|
|
|
|
+ //filteredNozzles = new List<TNozzle>(allNozzles);
|
|
|
|
|
|
|
|
// 重置分页
|
|
// 重置分页
|
|
|
currentPage_Engine = 1;
|
|
currentPage_Engine = 1;
|
|
@@ -426,8 +442,8 @@
|
|
|
if (engineId == 0)
|
|
if (engineId == 0)
|
|
|
{
|
|
{
|
|
|
// 显示所有主板和油枪
|
|
// 显示所有主板和油枪
|
|
|
- filteredBoards = new List<TBoard>(allBoards);
|
|
|
|
|
- filteredNozzles = new List<TNozzle>(allNozzles);
|
|
|
|
|
|
|
+ //filteredBoards = new List<TBoard>(allBoards);
|
|
|
|
|
+ //filteredNozzles = new List<TNozzle>(allNozzles);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -749,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" />
|
|
|
}
|
|
}
|