|
|
@@ -8,7 +8,7 @@
|
|
|
<div class="container-fluid">
|
|
|
<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">
|
|
|
<h5>油机列表</h5>
|
|
|
<button class="btn btn-sm btn-primary" @onclick="ShowCreateEngineModal">
|
|
|
@@ -17,28 +17,28 @@
|
|
|
</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" : "")"
|
|
|
@onclick="() => SelectEngine(0)">
|
|
|
显示所有油机
|
|
|
</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)
|
|
|
{
|
|
|
@foreach (var engine in paginatedEngines)
|
|
|
{
|
|
|
- <div @onclick="() => SelectEngine(engine.EngineId)" class="list-group-item d-flex justify-content-between align-items-center @(selectedEngineId == engine.EngineId ? "active" : "")">
|
|
|
+ <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>
|
|
|
- <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>
|
|
|
</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>
|
|
|
</button>
|
|
|
</div>
|
|
|
@@ -50,7 +50,7 @@
|
|
|
<!-- 油机分页控件 -->
|
|
|
@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">
|
|
|
<li class="page-item @(currentPage_Engine == 1 ? "disabled" : "")">
|
|
|
<a class="page-link" @onclick="() => ChangePage_Engine(currentPage_Engine - 1)" tabindex="-1">上一页</a>
|
|
|
@@ -70,7 +70,7 @@
|
|
|
</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">
|
|
|
<h5>主板列表</h5>
|
|
|
<button class="btn btn-sm btn-primary" @onclick="ShowCreateBoardModal" disabled="@(selectedEngineId == 0)">
|
|
|
@@ -78,29 +78,30 @@
|
|
|
</button>
|
|
|
</div>
|
|
|
|
|
|
- <!-- 显示所有主板选项 -->
|
|
|
+
|
|
|
+ @* <!-- 显示所有主板选项 -->
|
|
|
<div class="list-group mb-3">
|
|
|
<button class="list-group-item list-group-item-action @(selectedBoardId == 0 ? "active" : "")"
|
|
|
@onclick="() => SelectBoard(0)" disabled="@(selectedEngineId == 0)">
|
|
|
显示所有主板
|
|
|
</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)
|
|
|
{
|
|
|
@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><strong>主板 @board.BoardId</strong></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>
|
|
|
</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>
|
|
|
</button>
|
|
|
</div>
|
|
|
@@ -112,7 +113,7 @@
|
|
|
<!-- 主板分页控件 -->
|
|
|
@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">
|
|
|
<li class="page-item @(currentPage_Board == 1 ? "disabled" : "")">
|
|
|
<a class="page-link" @onclick="() => ChangePage_Board(currentPage_Board - 1)" tabindex="-1">上一页</a>
|
|
|
@@ -132,7 +133,7 @@
|
|
|
</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">
|
|
|
<h5>油枪列表</h5>
|
|
|
<button class="btn btn-sm btn-primary" @onclick="ShowCreateNozzleModal" disabled="@(selectedBoardId == 0)">
|
|
|
@@ -141,22 +142,21 @@
|
|
|
</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)
|
|
|
{
|
|
|
@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><strong>油枪 @nozzle.NozzleId</strong></div>
|
|
|
- <small>节点: @nozzle.node | 产品: @nozzle.product | 状态: @(nozzle.disable ? "禁用" : "启用")</small>
|
|
|
- <div><small>MN码: @nozzle.mncode</small></div>
|
|
|
+ <small>节点: @nozzle.node | 产品: @nozzle.product | 状态: @(nozzle.disable ? "禁用" : "启用") | MN码: @nozzle.mncode</small>
|
|
|
</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>
|
|
|
</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>
|
|
|
</button>
|
|
|
</div>
|
|
|
@@ -168,7 +168,7 @@
|
|
|
<!-- 油枪分页控件 -->
|
|
|
@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">
|
|
|
<li class="page-item @(currentPage_Nozzle == 1 ? "disabled" : "")">
|
|
|
<a class="page-link" @onclick="() => ChangePage_Nozzle(currentPage_Nozzle - 1)" tabindex="-1">上一页</a>
|
|
|
@@ -319,7 +319,7 @@
|
|
|
private List<TBoard> boards = new(); // 用于下拉选择
|
|
|
|
|
|
// 分页相关
|
|
|
- private const int pageSize = 10; // 每页显示条数
|
|
|
+ private const int pageSize = 8; // 每页显示条数
|
|
|
private int currentPage_Engine = 1;
|
|
|
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>();
|
|
|
@@ -542,7 +542,7 @@
|
|
|
// 如果删除的是当前选中的油机,重置选择
|
|
|
if (selectedEngineId == id)
|
|
|
{
|
|
|
- SelectEngine(0);
|
|
|
+ //SelectEngine(0);
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|