This commit is contained in:
Dr Masroor Ehsan 2025-01-11 21:29:31 +06:00
parent 0ef547bb7f
commit 7a5d331b6c
7 changed files with 152 additions and 41 deletions

View File

@ -5,7 +5,7 @@
use App\Domain\ACL\Permission;
use App\Domain\Report\ReportStatus;
use App\Http\Controllers\HashidControllerBase;
use App\Http\Requests\CreateReportRequest;
use App\Http\Requests\StoreReportRequest;
use App\Models\Study;
use App\Models\StudyReport;
@ -25,7 +25,7 @@ public function popup()
return view('staff.reports.popup', compact('study', 'reports'));
}
public function save(CreateReportRequest $request)
public function save(StoreReportRequest $request)
{
abort_unless(me()->may([Permission::ReportEdit, Permission::ReportDictate, Permission::ReportApprove]), 403);
$this->decodeKeys();

View File

@ -8,7 +8,7 @@
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class CreateReportRequest extends FormRequest
class StoreReportRequest extends FormRequest
{
public function authorize(): bool
{

33
resources/css/editor.css Normal file
View File

@ -0,0 +1,33 @@
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,700;1,400;1,700&display=swap');
@media print {
body {
margin: 0 !important;
}
}
.main-container {
font-family: 'Inter';
width: fit-content;
margin-left: auto;
margin-right: auto;
}
.fixed-container {
min-height: 600px;
min-width: 300px;
/*height: 800px;*/
height: 100%;
width: 100%;
}
.ck-content {
font-family: 'Inter';
line-height: 1.6;
word-break: break-word;
}
.editor-container_classic-editor .editor-container__editor {
min-width: 600px;
min-height: 600px;
}

69
resources/js/editor.js Normal file
View File

@ -0,0 +1,69 @@
document.addEventListener('DOMContentLoaded', () => {
const {
ClassicEditor,
Bold,
Essentials,
Italic,
List,
ListProperties,
Paragraph,
PasteFromOffice,
RemoveFormat,
Table,
TableCellProperties,
TableColumnResize,
TableProperties,
TableToolbar,
Underline
} = window.CKEDITOR;
//const {PasteFromOfficeEnhanced} = window.CKEDITOR_PREMIUM_FEATURES;
const LICENSE_KEY = 'eyJhbGciOiJFUzI1NiJ9.eyJleHAiOjE3NjcxMzkxOTksImp0aSI6ImQ4ODJkYTBmLWNmYWUtNGU4Mi05ZjYxLTYyYzY4ZmZiZWUzMCIsInVzYWdlRW5kcG9pbnQiOiJodHRwczovL3Byb3h5LWV2ZW50LmNrZWRpdG9yLmNvbSIsImRpc3RyaWJ1dGlvbkNoYW5uZWwiOlsiY2xvdWQiLCJkcnVwYWwiXSwiZmVhdHVyZXMiOlsiRFJVUCJdLCJ2YyI6IjI0OGE5ZjdhIn0.m-nfFNt3CYv4_P81vYJn8nTGJeIXXi2hWIFr7EnWNVNkyW_wmIt3Oh_1lOiQE43kN9LXpM0-jEyomb1sSqkwzw';
//const LICENSE_KEY = 'eyJhbGciOiJFUzI1NiJ9.eyJleHAiOjE3MzY4MTI3OTksImp0aSI6IjRkNDQyODQ2LWIwNDUtNDU1Ny1hZTY0LTM3ZDE0OTdkYWIxNSIsInVzYWdlRW5kcG9pbnQiOiJodHRwczovL3Byb3h5LWV2ZW50LmNrZWRpdG9yLmNvbSIsImRpc3RyaWJ1dGlvbkNoYW5uZWwiOlsiY2xvdWQiLCJkcnVwYWwiLCJzaCJdLCJ3aGl0ZUxhYmVsIjp0cnVlLCJsaWNlbnNlVHlwZSI6InRyaWFsIiwiZmVhdHVyZXMiOlsiKiJdLCJ2YyI6ImIwYmRlYmVjIn0.fhO6LXEF3lP_QpHQY2c9hPnensaY2_0AbfgJ0p4wUlQFmIyn-9dwe5rbMh9SdZYgoqOY5J4-zN0-JfO2vFm3vg';
const editorConfig = {
toolbar: {
items: ['bold', 'italic', 'underline', 'removeFormat', '|', 'insertTable', '|', 'bulletedList', 'numberedList'],
shouldNotGroupWhenFull: false
},
plugins: [
Bold,
Essentials,
Italic,
List,
ListProperties,
Paragraph,
PasteFromOffice,
//PasteFromOfficeEnhanced,
RemoveFormat,
Table,
TableCellProperties,
TableColumnResize,
TableProperties,
TableToolbar,
Underline
],
initialData: '',
licenseKey: LICENSE_KEY,
list: {
properties: {
styles: true,
startIndex: true,
reversed: true
}
},
menuBar: {
isVisible: true
},
placeholder: 'Type or paste your content here!',
table: {
contentToolbar: ['tableColumn', 'tableRow', 'mergeTableCells', 'tableProperties', 'tableCellProperties']
}
};
ClassicEditor.create(document.querySelector('#editor'), editorConfig);
console.log("CKE");
});

View File

@ -4,44 +4,47 @@
<header class="py-4">
<div class="container">
<div class="p-2 p-lg-2 bg-light rounded-3">
<div class="m-2 m-lg-3">
<table class="table table-bordered border-gray">
<tr>
<td class="text-muted">Patient Name</td>
<td class="fw-semibold">{{ $report->study->patient_name }}</td>
<td class="text-muted">Patient ID</td>
<td class="fw-semibold">{{ $report->study->patient_id }}</td>
</tr>
<tr>
<td class="text-muted">Age/Gender</td>
<td class="fw-semibold">{{ $report->study->sexAge() }}</td>
<td class="text-muted">Accession No</td>
<td class="fw-semibold">{{ $report->study->accession_number }}</td>
</tr>
<tr>
<td class="text-muted">Referred By</td>
<td class="fw-semibold">{{ $report->study->referring_physician_name }}</td>
<td class="text-muted">Date</td>
<td class="fw-semibold">{{ $report->created_at->format('d-M-Y') }}</td>
</tr>
</table>
<div class="text-center">
<h6 class="text-muted">
{{ $report->study->modality }} Report
</h6>
<h3>
{{ $report->study->study_description }}
</h3>
</div>
<div class="text-center">
<h6 class="text-muted">
{{ $report->study->modality }} Report
</h6>
<h3>
{{ $report->study->study_description }}
</h3>
</div>
</div>
</div>
</header>
<section class="pt-4" name="patient">
<div class="container">
<div class="mx-2">
<table class="table table-bordered border-gray">
<tr>
<td class="text-muted">Patient Name</td>
<td class="fw-semibold">{{ $report->study->patient_name }}</td>
<td class="text-muted">ID</td>
<td class="fw-semibold">{{ $report->study->patient_id }}</td>
</tr>
<tr>
<td class="text-muted">Age / Gender</td>
<td class="fw-semibold">{{ $report->study->sexAge() }}</td>
<td class="text-muted">Accession No</td>
<td class="fw-semibold">{{ $report->study->accession_number }}</td>
</tr>
<tr>
<td class="text-muted">Referred By</td>
<td class="fw-semibold">{{ $report->study->referring_physician_name }}</td>
<td class="text-muted">Date</td>
<td class="fw-semibold">{{ $report->created_at->format('d-M-Y') }}</td>
</tr>
</table>
</div>
</div>
</section>
<section class="pt-4" name="report">
<div class="container px-lg-3">
<div class="border-dark mb-8">

View File

@ -21,8 +21,8 @@
</head>
<body>
<nav class="navbar navbar-light bg-light">
<div class="container px-lg-3">
<a class="navbar-brand fw-semibold" href="#">{{ config('app.name') }}</a>
<div class="container px-lg-2">
<span class="navbar-brand fw-semibold">{{ config('app.name') }}</span>
</div>
</nav>

View File

@ -16,7 +16,7 @@ function GetFilesArray(query) {
/**
* Js Files
*/
// Ppp JS Files
// App JS Files
const appJsFiles = GetFilesArray('resources/js/*.js');
const appCssFiles = GetFilesArray('resources/css/*.css');
@ -69,8 +69,6 @@ export default defineConfig({
'resources/css/app.css',
'resources/assets/css/demo.css',
//'resources/js/app.js',
...appJsFiles,
...appCssFiles,
...pageJsFiles,
...vendorJsFiles,
...LibsJsFiles,
@ -85,6 +83,14 @@ export default defineConfig({
}),
viteStaticCopy({
targets: [
{
src: [...appJsFiles],
dest: '../js'
},
{
src: [...appCssFiles],
dest: '../css'
},
{
src: [...ImageFiles],
dest: '../imgs'