浏览代码

enable note edit button

master
azri 10 小时前
父节点
当前提交
54615b43df
共有 3 个文件被更改,包括 92 次插入28 次删除
  1. 41
    12
      resources/views/home.blade.php
  2. 45
    16
      resources/views/project.blade.php
  3. 6
    0
      routes/web.php

+ 41
- 12
resources/views/home.blade.php 查看文件

@@ -86,21 +86,50 @@
86 86
             </div>
87 87
         </div>
88 88
 
89
-        <div class="border rounded p-5">
89
+        <div x-data="{ editNote: false }">
90
+            <div x-show="!editNote" class="border rounded p-5 space-y-4 mb-3">
91
+                <h5 class="font-semibold mb-4">Rekod Penetapan KPI Pelaburan</h5>
92
+                <p class="text-xs font-bold">
93
+                    YB Dato’ Pengerusi memohon agar sasaran adalah melebihi sasaran tahun 2024:
94
+                    <span class="text-[#BD8736]">DEADLINE, 2 WEEK from JPPP MEETING.</span>
95
+                </p>
96
+                <p class="text-xs font-bold">
97
+                    15-04-2025 | Jumlah Pelaburan Komited telah dikemaskini berdasarkan data yang diisi
98
+                    oleh S-GLC. Jumlah pelaburan komited berjumlah RM 2,000,333.00.
99
+                </p>
100
+            </div>
90 101
 
91
-            <h5 class="font-semibold mb-4">Rekod Penetapan KPI Pelaburan</h5>
92
-            <p class="text-xs font-bold">YB Dato’ Pengerusi memohon agar sasaran adalah melebihi sasaran tahun 2024: <span
93
-                    class="text-[#BD8736]">DEADLINE, 2 WEEK from JPPP MEETING.</span></p>
94
-            <p class="text-xs font-bold">15-04-2025 | Jumlah Pelaburan Komited telah dikemaskini berdasarkan data yang diisi
95
-                oleh S-GLC. Jumlah pelaburan komited berjumlah RM 2,000,333.00.</p>
96
-        </div>
102
+            <!-- Edit mode -->
103
+            <div x-show="editNote" class="border rounded p-5 space-y-4 mb-3">
104
+                <label for="note" class="text-sm font-semibold text-gray-700 block">Kemaskini Nota:</label>
105
+                <textarea id="textNote" x-model="noteText" placeholder="Masukkan nota baru di sini..."
106
+                    class="w-full h-32 p-3 border border-gray-300 rounded-lg text-sm text-gray-800 resize-none focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white"></textarea>
107
+            </div>
97 108
 
98
-        <button
99
-            class="bg-[#012961] hover:bg-blue-700 text-white font-semibold w-fit text-xs py-2 px-4 rounded-lg shadow-md transition duration-200 ml-auto">
100
-            <i class="fa-solid fa-edit text-white text-xs"></i>
101
-            <span>Kemaskini</span>
102
-        </button>
109
+            <!-- Buttons -->
110
+            <div class="flex justify-end gap-2">
111
+                <!-- Show when not editing -->
112
+                <button @click="editNote = true" x-show="!editNote"
113
+                    class="bg-[#012961] hover:bg-blue-700 text-white font-semibold w-fit text-xs py-2 px-4 rounded-lg shadow-md transition duration-200">
114
+                    <i class="fa-solid fa-edit text-white text-xs"></i>
115
+                    <span>Kemaskini</span>
116
+                </button>
117
+
118
+                <!-- Show when editing -->
119
+                <button onclick="updateNote()" @click="editNote = false" x-show="editNote"
120
+                    class="bg-[#012961] hover:bg-blue-700 text-white font-semibold w-fit text-xs py-2 px-4 rounded-lg shadow-md transition duration-200">
121
+                    <i class="fa-solid fa-save text-white text-xs"></i>
122
+                    <span>Simpan</span>
123
+                </button>
124
+            </div>
125
+
126
+            <script>
127
+                function updateNote(){
128
+                    console.log("update note")
129
+                }
130
+            </script>
103 131
 
132
+        </div>
104 133
 
105 134
     </div>
106 135
 @endsection

+ 45
- 16
resources/views/project.blade.php 查看文件

@@ -45,7 +45,7 @@
45 45
             <div class="relative w-full lg:w-fit">
46 46
                 <select id="selectProjectStatus"
47 47
                     class="appearance-none w-full pl-4 pr-10 py-1 px-5 border border-gray-300 rounded-lg text-sm text-gray-700 cursor-pointer bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500"
48
-                    onchange="renderFDITable()">
48
+                    onchange="renderFDITable(); renderDDITable()">
49 49
                     <option value="all" selected>Status</option>
50 50
                     <option value="1">Perjanjian Muktamad</option>
51 51
                     <option value="0">Deraf Perjanjian</option>
@@ -55,7 +55,7 @@
55 55
             <div class="relative w-full lg:w-fit">
56 56
                 <select id="selectProjectArea"
57 57
                     class="appearance-none w-full pl-4 pr-10 py-1 px-5 border border-gray-300 rounded-lg text-sm text-gray-700 cursor-pointer bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500"
58
-                    onchange="renderFDITable()">
58
+                    onchange="renderFDITable(); renderDDITable()">
59 59
                     <option value="all" selected>Daerah</option>
60 60
                     <option value="Gambang">Gambang</option>
61 61
                     <option value="Pekan">Pekan</option>
@@ -65,7 +65,7 @@
65 65
             <div class="relative w-full lg:w-fit">
66 66
                 <select id="selectProjectYear"
67 67
                     class="appearance-none w-full pl-4 pr-10 py-1 px-5 border border-gray-300 rounded-lg text-sm text-gray-700 cursor-pointer bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500"
68
-                    onchange="renderFDITable()">
68
+                    onchange="renderFDITable(); renderDDITable()">
69 69
                     <option value="all" selected>Tahun</option>
70 70
                     <option value="2026">2026</option>
71 71
                     <option value="2025">2025</option>
@@ -217,21 +217,50 @@
217 217
             </div>
218 218
         </div>
219 219
 
220
-        <div class="border rounded p-5">
220
+        <div x-data="{ editNote: false }">
221
+            <div x-show="!editNote" class="border rounded p-5 space-y-4 mb-3">
222
+                <h5 class="font-semibold mb-4">Rekod Penetapan KPI Pelaburan</h5>
223
+                <p class="text-xs font-bold">
224
+                    YB Dato’ Pengerusi memohon agar sasaran adalah melebihi sasaran tahun 2024:
225
+                    <span class="text-[#BD8736]">DEADLINE, 2 WEEK from JPPP MEETING.</span>
226
+                </p>
227
+                <p class="text-xs font-bold">
228
+                    15-04-2025 | Jumlah Pelaburan Komited telah dikemaskini berdasarkan data yang diisi
229
+                    oleh S-GLC. Jumlah pelaburan komited berjumlah RM 2,000,333.00.
230
+                </p>
231
+            </div>
221 232
 
222
-            <h5 class="font-semibold mb-4">Rekod Penetapan KPI Pelaburan</h5>
223
-            <p class="text-xs font-bold">YB Dato’ Pengerusi memohon agar sasaran adalah melebihi sasaran tahun 2024: <span
224
-                    class="text-[#BD8736]">DEADLINE, 2 WEEK from JPPP MEETING.</span></p>
225
-            <p class="text-xs font-bold">15-04-2025 | Jumlah Pelaburan Komited telah dikemaskini berdasarkan data yang
226
-                diisi
227
-                oleh S-GLC. Jumlah pelaburan komited berjumlah RM 2,000,333.00.</p>
228
-        </div>
233
+            <!-- Edit mode -->
234
+            <div x-show="editNote" class="border rounded p-5 space-y-4 mb-3">
235
+                <label for="note" class="text-sm font-semibold text-gray-700 block">Kemaskini Nota:</label>
236
+                <textarea id="textNote" x-model="noteText" placeholder="Masukkan nota baru di sini..."
237
+                    class="w-full h-32 p-3 border border-gray-300 rounded-lg text-sm text-gray-800 resize-none focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white"></textarea>
238
+            </div>
229 239
 
230
-        <button
231
-            class="bg-[#012961] hover:bg-blue-700 text-white font-semibold w-fit text-xs py-2 px-4 rounded-lg shadow-md transition duration-200 ml-auto">
232
-            <i class="fa-solid fa-edit text-white text-xs"></i>
233
-            <span>Kemaskini</span>
234
-        </button>
240
+            <!-- Buttons -->
241
+            <div class="flex justify-end gap-2">
242
+                <!-- Show when not editing -->
243
+                <button @click="editNote = true" x-show="!editNote"
244
+                    class="bg-[#012961] hover:bg-blue-700 text-white font-semibold w-fit text-xs py-2 px-4 rounded-lg shadow-md transition duration-200">
245
+                    <i class="fa-solid fa-edit text-white text-xs"></i>
246
+                    <span>Kemaskini</span>
247
+                </button>
248
+
249
+                <!-- Show when editing -->
250
+                <button onclick="updateNote()" @click="editNote = false" x-show="editNote"
251
+                    class="bg-[#012961] hover:bg-blue-700 text-white font-semibold w-fit text-xs py-2 px-4 rounded-lg shadow-md transition duration-200">
252
+                    <i class="fa-solid fa-save text-white text-xs"></i>
253
+                    <span>Simpan</span>
254
+                </button>
255
+            </div>
256
+
257
+            <script>
258
+                function updateNote() {
259
+                    console.log("update note")
260
+                }
261
+            </script>
262
+
263
+        </div>
235 264
 
236 265
     </div>
237 266
 @endsection

+ 6
- 0
routes/web.php 查看文件

@@ -343,6 +343,7 @@ Route::prefix('api')->group(function () {
343 343
                 "company_name" => "Kicap Bentong Sdn. Bhd (Jualan)",
344 344
                 "type" => "Kilang Memproses Kicap (Pembesaran)",
345 345
                 "status" => 0,
346
+                "year" => "2025",
346 347
                 "note" => "Dalam Proses Submit",
347 348
                 "moa_date" => "",
348 349
                 "area" => "Kawasan Perindustrian Bentong",
@@ -355,6 +356,7 @@ Route::prefix('api')->group(function () {
355 356
                 "company_name" => "Advanced Achieve Property Management Sdn. Bhd",
356 357
                 "type" => "International Space Port",
357 358
                 "status" => 1,
359
+                "year" => "2026",
358 360
                 "note" => "Dalam Proses Pindahan",
359 361
                 "moa_date" => "",
360 362
                 "area" => "KP Gebeng 1",
@@ -367,6 +369,7 @@ Route::prefix('api')->group(function () {
367 369
                 "company_name" => "BH Setia Sdn Bhd (Jualan IKS)",
368 370
                 "type" => "Data Center",
369 371
                 "status" => 1,
372
+                "year" => "2025",
370 373
                 "note" => "Proses Dalam Pindahan",
371 374
                 "moa_date" => "22-02-2025",
372 375
                 "area" => "KP Gebeng 2",
@@ -379,6 +382,7 @@ Route::prefix('api')->group(function () {
379 382
                 "company_name" => "Gading Senggara Property (Pajakan)",
380 383
                 "type" => "International Space Port",
381 384
                 "status" => 0,
385
+                "year" => "2026",
382 386
                 "note" => "Dalam Proses Memuktamadkan Perjanjian",
383 387
                 "moa_date" => "",
384 388
                 "area" => "KP Gebeng 3",
@@ -394,6 +398,7 @@ Route::prefix('api')->group(function () {
394 398
                 "company_name" => "Kicap Bentong Sdn. Bhd (Jualan)",
395 399
                 "type" => "Kilang Memproses Kicap (Pembesaran)",
396 400
                 "status" => null,
401
+                "year" => "2025",
397 402
                 "note" => "Dalam Proses Submit",
398 403
                 "moa_date" => "",
399 404
                 "area" => "Kawasan Perindustrian Bentong",
@@ -409,6 +414,7 @@ Route::prefix('api')->group(function () {
409 414
                 "company_name" => "Kicap Bentong Sdn. Bhd (Jualan)",
410 415
                 "type" => "Kilang Memproses Kicap (Pembesaran)",
411 416
                 "status" => null,
417
+                "year" => "2026",
412 418
                 "note" => "Dalam Proses Submit",
413 419
                 "moa_date" => "",
414 420
                 "area" => "Kawasan Perindustrian Bentong",

正在加载...
取消
保存