CheckStatus + UI fejlesztése
This commit is contained in:
@@ -10,8 +10,10 @@ namespace WorkFlowCheck.Common.Enums
|
|||||||
{
|
{
|
||||||
Open = 0,
|
Open = 0,
|
||||||
InProgress = 1,
|
InProgress = 1,
|
||||||
Blocked = 3,
|
Blocked = 2,
|
||||||
Storno = 4,
|
Storno = 3,
|
||||||
Sent = 5
|
Sent = 4,
|
||||||
|
Signed = 5,
|
||||||
|
Closed = 6
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,9 @@
|
|||||||
|
|
||||||
<div class="card shadow p-4">
|
<div class="card shadow p-4">
|
||||||
<div class="d-flex justify-content-end">
|
<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>
|
</div>
|
||||||
<table id="tbCheckPointsPage" class="table table-bordered table-hover table-sm" style="width:100%">
|
<table id="tbCheckPointsPage" class="table table-bordered table-hover table-sm" style="width:100%">
|
||||||
<thead class="table-primary">
|
<thead class="table-primary">
|
||||||
@@ -48,13 +50,7 @@
|
|||||||
sortable: false,
|
sortable: false,
|
||||||
className: "text-center",
|
className: "text-center",
|
||||||
render: function ( data, type, row ) {
|
render: function ( data, type, row ) {
|
||||||
if (data === true) {
|
return renderCheckBox(data);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
<thead class="table-primary">
|
<thead class="table-primary">
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
|
<th>Status</th>
|
||||||
<th>IsEditable</th>
|
<th>IsEditable</th>
|
||||||
<th>DocumentNumber</th>
|
<th>DocumentNumber</th>
|
||||||
<th>DateExecution</th>
|
<th>DateExecution</th>
|
||||||
@@ -27,6 +28,7 @@
|
|||||||
<tfoot class="table-light">
|
<tfoot class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
|
<th>Status</th>
|
||||||
<th>IsEditable</th>
|
<th>IsEditable</th>
|
||||||
<th>DocumentNumber</th>
|
<th>DocumentNumber</th>
|
||||||
<th>DateExecution</th>
|
<th>DateExecution</th>
|
||||||
@@ -49,20 +51,19 @@
|
|||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{ data: "id" },
|
{ data: "id" },
|
||||||
|
{ data: "checkStatus",
|
||||||
|
render:function(data, type, row)
|
||||||
|
{
|
||||||
|
return renderCheckStatus(data);
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
data: "isEditable",
|
data: "isEditable",
|
||||||
searchable: false,
|
searchable: false,
|
||||||
sortable: false,
|
sortable: false,
|
||||||
// visible: (aDurchgang==1 ? true : false),
|
|
||||||
className: "text-center",
|
className: "text-center",
|
||||||
render: function ( data, type, row ) {
|
render: function ( data, type, row ) {
|
||||||
if (data === true) {
|
return renderCheckBox(data);
|
||||||
return '<input type="checkbox" class="editor-active" disabled checked>';
|
|
||||||
}
|
|
||||||
if (data === false) {
|
|
||||||
return '<input type="checkbox" class="editor-active" disabled>';
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -79,8 +80,8 @@
|
|||||||
{ data: "shortName" },
|
{ data: "shortName" },
|
||||||
{ data: "description" },
|
{ data: "description" },
|
||||||
{ data: "userDTO.userName" },
|
{ data: "userDTO.userName" },
|
||||||
{ data: null, render: function (data, type, row) {
|
{ data: "checkStatus", render: function (data, type, row) {
|
||||||
return renderActionButtons(row.id);
|
return renderActionButtonsforCheckListHeader(data, row.id);
|
||||||
}}
|
}}
|
||||||
],
|
],
|
||||||
columnDefs: [
|
columnDefs: [
|
||||||
@@ -89,7 +90,7 @@
|
|||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"targets": 3,
|
"targets": 8,
|
||||||
"className": "text-center",
|
"className": "text-center",
|
||||||
"width": "10%"
|
"width": "10%"
|
||||||
}
|
}
|
||||||
@@ -111,6 +112,12 @@
|
|||||||
window.location.href = `@Url.Page("./CheckListHeaderEditPage")?id=${row.id}`;
|
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 ()
|
$('#tbCheckListHeadersPage').on('click', '.delete-btn', function ()
|
||||||
{
|
{
|
||||||
const row = table.row($(this).closest('tr')).data();
|
const row = table.row($(this).closest('tr')).data();
|
||||||
|
|||||||
@@ -51,13 +51,7 @@
|
|||||||
sortable: false,
|
sortable: false,
|
||||||
className: "text-center",
|
className: "text-center",
|
||||||
render: function ( data, type, row ) {
|
render: function ( data, type, row ) {
|
||||||
if (data === true) {
|
return renderCheckBox(data);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -51,13 +51,7 @@
|
|||||||
sortable: false,
|
sortable: false,
|
||||||
className: "text-center",
|
className: "text-center",
|
||||||
render: function ( data, type, row ) {
|
render: function ( data, type, row ) {
|
||||||
if (data === true) {
|
return renderCheckBox(data);
|
||||||
return '<input type="checkbox" class="editor-active" disabled checked>';
|
|
||||||
}
|
|
||||||
if (data === false) {
|
|
||||||
return '<input type="checkbox" class="editor-active" disabled>';
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -55,6 +55,22 @@ builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
|
|||||||
builder.Services.AddFluentValidationSetup();
|
builder.Services.AddFluentValidationSetup();
|
||||||
|
|
||||||
var app = builder.Build();
|
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>();
|
app.UseMiddleware<JwtMiddleware>();
|
||||||
|
|
||||||
// Configure the HTTP request pipeline.
|
// Configure the HTTP request pipeline.
|
||||||
|
|||||||
@@ -105,3 +105,69 @@ function renderActionButtons(rowId) {
|
|||||||
</button>
|
</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