CheckStatus + UI fejlesztése
This commit is contained in:
@@ -10,8 +10,10 @@ namespace WorkFlowCheck.Common.Enums
|
||||
{
|
||||
Open = 0,
|
||||
InProgress = 1,
|
||||
Blocked = 3,
|
||||
Storno = 4,
|
||||
Sent = 5
|
||||
Blocked = 2,
|
||||
Storno = 3,
|
||||
Sent = 4,
|
||||
Signed = 5,
|
||||
Closed = 6
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,9 @@
|
||||
|
||||
<div class="card shadow p-4">
|
||||
<div class="d-flex justify-content-end">
|
||||
<button class="btn btn-primary float-right">Új elem hozzáadása</button>
|
||||
<button class="btn btn-primary float-right new-btn" data-bs-toggle="tooltip" data-bs-placement="top" title="Új elem hozzáadása">
|
||||
<i class="bi bi-plus-square"></i>
|
||||
</button>
|
||||
</div>
|
||||
<table id="tbCheckPointsPage" class="table table-bordered table-hover table-sm" style="width:100%">
|
||||
<thead class="table-primary">
|
||||
@@ -48,13 +50,7 @@
|
||||
sortable: false,
|
||||
className: "text-center",
|
||||
render: function ( data, type, row ) {
|
||||
if (data === true) {
|
||||
return '<input type="checkbox" class="form-check-input no-click" checked>';
|
||||
}
|
||||
if (data === false) {
|
||||
return '<input type="checkbox" class="form-check-input no-click" >';
|
||||
}
|
||||
return data;
|
||||
return renderCheckBox(data);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Status</th>
|
||||
<th>IsEditable</th>
|
||||
<th>DocumentNumber</th>
|
||||
<th>DateExecution</th>
|
||||
@@ -27,6 +28,7 @@
|
||||
<tfoot class="table-light">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Status</th>
|
||||
<th>IsEditable</th>
|
||||
<th>DocumentNumber</th>
|
||||
<th>DateExecution</th>
|
||||
@@ -49,21 +51,20 @@
|
||||
},
|
||||
columns: [
|
||||
{ data: "id" },
|
||||
{ data: "checkStatus",
|
||||
render:function(data, type, row)
|
||||
{
|
||||
return renderCheckStatus(data);
|
||||
}
|
||||
},
|
||||
{
|
||||
data: "isEditable",
|
||||
searchable: false,
|
||||
sortable: false,
|
||||
// visible: (aDurchgang==1 ? true : false),
|
||||
className: "text-center",
|
||||
render: function ( data, type, row ) {
|
||||
if (data === true) {
|
||||
return '<input type="checkbox" class="editor-active" disabled checked>';
|
||||
}
|
||||
if (data === false) {
|
||||
return '<input type="checkbox" class="editor-active" disabled>';
|
||||
}
|
||||
return data;
|
||||
}
|
||||
data: "isEditable",
|
||||
searchable: false,
|
||||
sortable: false,
|
||||
className: "text-center",
|
||||
render: function ( data, type, row ) {
|
||||
return renderCheckBox(data);
|
||||
}
|
||||
|
||||
},
|
||||
{ data: "documentNumber"},
|
||||
@@ -79,8 +80,8 @@
|
||||
{ data: "shortName" },
|
||||
{ data: "description" },
|
||||
{ data: "userDTO.userName" },
|
||||
{ data: null, render: function (data, type, row) {
|
||||
return renderActionButtons(row.id);
|
||||
{ data: "checkStatus", render: function (data, type, row) {
|
||||
return renderActionButtonsforCheckListHeader(data, row.id);
|
||||
}}
|
||||
],
|
||||
columnDefs: [
|
||||
@@ -89,7 +90,7 @@
|
||||
"visible": false
|
||||
},
|
||||
{
|
||||
"targets": 3,
|
||||
"targets": 8,
|
||||
"className": "text-center",
|
||||
"width": "10%"
|
||||
}
|
||||
@@ -111,6 +112,12 @@
|
||||
window.location.href = `@Url.Page("./CheckListHeaderEditPage")?id=${row.id}`;
|
||||
});
|
||||
|
||||
$('#tbCheckListHeadersPage').on('click', '.pdf-btn', function ()
|
||||
{
|
||||
const row = table.row($(this).closest('tr')).data();
|
||||
window.location.href = `@Url.Page("./CheckListHeaderEditPage")?id=${row.id}`;
|
||||
});
|
||||
|
||||
$('#tbCheckListHeadersPage').on('click', '.delete-btn', function ()
|
||||
{
|
||||
const row = table.row($(this).closest('tr')).data();
|
||||
|
||||
@@ -51,13 +51,7 @@
|
||||
sortable: false,
|
||||
className: "text-center",
|
||||
render: function ( data, type, row ) {
|
||||
if (data === true) {
|
||||
return '<input type="checkbox" class="form-check-input no-click" checked>';
|
||||
}
|
||||
if (data === false) {
|
||||
return '<input type="checkbox" class="form-check-input no-click">';
|
||||
}
|
||||
return data;
|
||||
return renderCheckBox(data);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@@ -51,13 +51,7 @@
|
||||
sortable: false,
|
||||
className: "text-center",
|
||||
render: function ( data, type, row ) {
|
||||
if (data === true) {
|
||||
return '<input type="checkbox" class="editor-active" disabled checked>';
|
||||
}
|
||||
if (data === false) {
|
||||
return '<input type="checkbox" class="editor-active" disabled>';
|
||||
}
|
||||
return data;
|
||||
return renderCheckBox(data);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@@ -55,6 +55,22 @@ builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
|
||||
builder.Services.AddFluentValidationSetup();
|
||||
|
||||
var app = builder.Build();
|
||||
string imageDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Images");
|
||||
|
||||
//----------------- Munkakönyvtárak létrehozása -----------------------------
|
||||
if (!Directory.Exists(imageDirectory))
|
||||
{
|
||||
Directory.CreateDirectory(imageDirectory);
|
||||
}
|
||||
string pdfDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Pdf");
|
||||
|
||||
// Ensure the Images directory exists
|
||||
if (!Directory.Exists(pdfDirectory))
|
||||
{
|
||||
Directory.CreateDirectory(pdfDirectory);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
app.UseMiddleware<JwtMiddleware>();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
|
||||
@@ -105,3 +105,69 @@ function renderActionButtons(rowId) {
|
||||
</button>
|
||||
`;
|
||||
}
|
||||
function renderActionButtonsforCheckListHeader(data, rowId) {
|
||||
if (data === 4) {
|
||||
return `
|
||||
<button class="btn btn-primary edit-btn btn-sm" data-id="${rowId}">
|
||||
<i class="bi bi-pencil-fill"></i>
|
||||
</button>
|
||||
<button class="btn btn-secondary pdf-btn btn-sm" data-id="${rowId}">
|
||||
<i class="bi bi-file-earmark-pdf-fill"></i>
|
||||
</button>`;
|
||||
}
|
||||
else {
|
||||
|
||||
return `
|
||||
<button class="btn btn-primary edit-btn btn-sm" data-id="${rowId}">
|
||||
<i class="bi bi-pencil-fill"></i>
|
||||
</button>
|
||||
<button class="btn btn-danger delete-btn btn-sm" data-id="${rowId}">
|
||||
<i class="bi bi-trash-fill"></i>
|
||||
</button>`;
|
||||
}
|
||||
}
|
||||
|
||||
function renderCheckStatus(data) {
|
||||
//Open = 0,
|
||||
//InProgress = 1,
|
||||
//Blocked = 2,
|
||||
//Storno = 3,
|
||||
//Sent = 4,
|
||||
//Signed = 5,
|
||||
//Closed = 6
|
||||
switch (data) {
|
||||
case 0:
|
||||
return 'Nyitott';
|
||||
break;
|
||||
case 1:
|
||||
return 'Folyamatban';
|
||||
break;
|
||||
case 2:
|
||||
return 'Blokkolt';
|
||||
break;
|
||||
case 3:
|
||||
return 'Stornózva';
|
||||
break;
|
||||
case 4:
|
||||
return 'Beküldve';
|
||||
break;
|
||||
case 5:
|
||||
return 'Jóváhagyva';
|
||||
break;
|
||||
case 6:
|
||||
return 'Lezárt';
|
||||
break;
|
||||
default:
|
||||
return '';
|
||||
break;
|
||||
}
|
||||
}
|
||||
function renderCheckBox(data) {
|
||||
if (data === true) {
|
||||
return '<input type="checkbox" class="form-check-input no-click" checked>';
|
||||
}
|
||||
if (data === false) {
|
||||
return '<input type="checkbox" class="form-check-input no-click">';
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user