clean code

This commit is contained in:
2025-07-01 17:50:25 +08:00
parent f71b2985da
commit f7ffc1b072
4 changed files with 22 additions and 13 deletions

View File

@@ -821,7 +821,7 @@
{#each formColumnsDisplay as col} {#each formColumnsDisplay as col}
{#if col.key === "description_of_the_issue"} {#if col.key === "description_of_the_issue"}
<td <td
class="sticky left-0 px-4 py-2 font-medium text-blue-600" class="sticky left-0 px-4 py-2 font-medium text-blue-600 max-w-xs whitespace-normal align-top break-words"
style="background-color: #f0f8ff; cursor: pointer;" style="background-color: #f0f8ff; cursor: pointer;"
> >
{row[col.key]} {row[col.key]}

View File

@@ -707,7 +707,7 @@
{#each columns as col} {#each columns as col}
{#if col.key === "description_of_the_issue"} {#if col.key === "description_of_the_issue"}
<td <td
class="sticky left-0 px-4 py-2 font-medium text-blue-600" class="sticky left-0 px-4 py-2 font-medium text-blue-600 max-w-xs whitespace-normal align-top break-words"
style="background-color: #f0f8ff; cursor: pointer;" style="background-color: #f0f8ff; cursor: pointer;"
> >
{row[col.key]} {row[col.key]}

View File

@@ -1224,7 +1224,7 @@
<thead class="bg-gray-100"> <thead class="bg-gray-100">
<tr> <tr>
{#each columns as col} {#each columns as col}
{#if col.key === "name"} {#if col.key === "issue_name"}
<th <th
class="sticky left-0 px-4 py-3 text-left font-semibold text-gray-700 uppercase tracking-wider whitespace-nowrap" class="sticky left-0 px-4 py-3 text-left font-semibold text-gray-700 uppercase tracking-wider whitespace-nowrap"
style="background-color: #f0f8ff; z-index: 10;" style="background-color: #f0f8ff; z-index: 10;"
@@ -1245,15 +1245,24 @@
{#each paginatedRows as row} {#each paginatedRows as row}
<tr class="hover:bg-gray-50 transition"> <tr class="hover:bg-gray-50 transition">
{#each columns as col} {#each columns as col}
{#if col.key === "requested_date" || col.key === "po_due" || col.key === "updated_at"} {#if col.key === "requested_date" || col.key === "po_due" || col.key === "updated_at"}
<td class="px-4 py-2 text-gray-500"> <td class="px-4 py-2 text-gray-500">
{#if row[col.key]} {#if row[col.key]}
{new Date(row[col.key]).toLocaleString()} {new Date(row[col.key]).toLocaleString()}
{:else} {:else}
— —
{/if} {/if}
</td>
{:else if col.key === "po_remark"}
<td class="px-4 py-2 text-gray-700 max-w-xs whitespace-normal align-top break-words">
{row[col.key] || "—"}
</td> </td>
{:else if col.key === "prepared"} {:else if col.key === "issue_name"}
<td class="sticky left-0 px-4 py-2 font-medium text-blue-600 max-w-xs whitespace-normal align-top break-words"
style="background-color: #f0f8ff; cursor: pointer;">
{row.issue_name || "—"}
</td>
{:else if col.key === "prepared"}
<td class="px-4 py-2 text-center"> <td class="px-4 py-2 text-center">
<button <button
class="bg-blue-600 text-white text-xs px-3 py-1.5 rounded hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed" class="bg-blue-600 text-white text-xs px-3 py-1.5 rounded hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed"

View File

@@ -562,7 +562,7 @@
<thead class="bg-gray-100"> <thead class="bg-gray-100">
<tr> <tr>
{#each columns as col} {#each columns as col}
{#if col.key === "name"} {#if col.key === "villa_name"}
<th <th
class="sticky left-0 px-4 py-3 text-left font-semibold text-gray-700 uppercase tracking-wider whitespace-nowrap" class="sticky left-0 px-4 py-3 text-left font-semibold text-gray-700 uppercase tracking-wider whitespace-nowrap"
style="background-color: #f0f8ff; z-index: 10;" style="background-color: #f0f8ff; z-index: 10;"
@@ -585,7 +585,7 @@
{#each columns as col} {#each columns as col}
{#if col.key === "name"} {#if col.key === "name"}
<td <td
class="left-0 px-4 py-2 max-w-xs whitespace-normal align-top break-words" class="left-0 px-4 py-2 max-w-xs whitespace-normal break-words"
> >
{row[col.key]} {row[col.key]}
</td> </td>