Merge branch 'jskim-node' of https://g.wace.me/jskim/vexplor_dev into jskim-node
This commit is contained in:
@@ -43,9 +43,8 @@ function CardListRenderer({ component, getQueryResult }: CardRendererProps) {
|
||||
const queryResult = getQueryResult(component.queryId);
|
||||
if (queryResult && queryResult.rows && queryResult.rows.length > 0) {
|
||||
const row = queryResult.rows[0];
|
||||
return row[item.fieldName] !== undefined
|
||||
? String(row[item.fieldName])
|
||||
: item.value;
|
||||
const val = row[item.fieldName];
|
||||
return val !== undefined && val !== null ? String(val) : "";
|
||||
}
|
||||
}
|
||||
return item.value;
|
||||
|
||||
@@ -54,9 +54,12 @@ function getGridCellValue(
|
||||
): string {
|
||||
if (cell.cellType === "static") return cell.value ?? "";
|
||||
|
||||
if (cell.cellType === "field" && cell.field && row) {
|
||||
const raw = String(row[cell.field] ?? "");
|
||||
return applyNumberFormat(raw, cell.numberFormat, cell.currencySuffix);
|
||||
if (cell.cellType === "field") {
|
||||
if (cell.field && row) {
|
||||
const raw = String(row[cell.field] ?? "");
|
||||
return applyNumberFormat(raw, cell.numberFormat, cell.currencySuffix);
|
||||
}
|
||||
return ""; // 데이터 없으면 플레이스홀더 숨김
|
||||
}
|
||||
|
||||
return cell.value ?? "";
|
||||
@@ -277,7 +280,7 @@ function ClassicTableRenderer({ component, getQueryResult }: TableRendererProps)
|
||||
color: "#d1d5db",
|
||||
}}
|
||||
>
|
||||
{col.field ? `{${col.field}}` : "—"}
|
||||
{""}
|
||||
</td>
|
||||
))}
|
||||
</tr>
|
||||
|
||||
@@ -372,33 +372,35 @@ export function CategoryColumnList({
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="space-y-3">
|
||||
<div className="space-y-1">
|
||||
<div className="flex h-full flex-col">
|
||||
<div className="shrink-0 space-y-1 px-3 pt-3">
|
||||
<h3 className="text-lg font-semibold">카테고리 컬럼</h3>
|
||||
<p className="text-muted-foreground text-xs">관리할 카테고리 컬럼을 선택하세요</p>
|
||||
</div>
|
||||
|
||||
<div className="relative">
|
||||
<Search className="text-muted-foreground absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2" />
|
||||
<Input
|
||||
type="text"
|
||||
placeholder="컬럼 검색..."
|
||||
value={searchQuery}
|
||||
onChange={(e) => setSearchQuery(e.target.value)}
|
||||
className="h-8 pl-8 pr-8 text-xs"
|
||||
/>
|
||||
{searchQuery && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setSearchQuery("")}
|
||||
className="text-muted-foreground hover:text-foreground absolute right-2 top-1/2 -translate-y-1/2"
|
||||
>
|
||||
<X className="h-4 w-4" />
|
||||
</button>
|
||||
)}
|
||||
<div className="shrink-0 px-3 pt-3">
|
||||
<div className="relative">
|
||||
<Search className="text-muted-foreground absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2" />
|
||||
<Input
|
||||
type="text"
|
||||
placeholder="컬럼 검색..."
|
||||
value={searchQuery}
|
||||
onChange={(e) => setSearchQuery(e.target.value)}
|
||||
className="h-8 pl-8 pr-8 text-xs"
|
||||
/>
|
||||
{searchQuery && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setSearchQuery("")}
|
||||
className="text-muted-foreground hover:text-foreground absolute right-2 top-1/2 -translate-y-1/2"
|
||||
>
|
||||
<X className="h-4 w-4" />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-1">
|
||||
<div className="flex-1 min-h-0 overflow-y-auto space-y-1 px-3 py-3">
|
||||
{filteredColumns.length === 0 && searchQuery ? (
|
||||
<div className="text-muted-foreground py-4 text-center text-xs">
|
||||
'{searchQuery}'에 대한 검색 결과가 없습니다
|
||||
|
||||
@@ -106,22 +106,13 @@ export const CategoryValueManager: React.FC<CategoryValueManagerProps> = ({
|
||||
|
||||
const handleAddValue = async (newValue: TableCategoryValue) => {
|
||||
try {
|
||||
if (!menuObjid) {
|
||||
toast({
|
||||
title: "오류",
|
||||
description: "메뉴 정보가 없습니다. 카테고리 값을 추가할 수 없습니다.",
|
||||
variant: "destructive",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const response = await addCategoryValue(
|
||||
{
|
||||
...newValue,
|
||||
tableName,
|
||||
columnName,
|
||||
},
|
||||
menuObjid
|
||||
menuObjid || 0
|
||||
);
|
||||
|
||||
if (response.success && response.data) {
|
||||
|
||||
Reference in New Issue
Block a user