diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue index 97203fad38..ee20e269b9 100644 --- a/apps/desktop/src/components/grid/DataGrid.vue +++ b/apps/desktop/src/components/grid/DataGrid.vue @@ -431,14 +431,19 @@ function typeColorClass(t: string): string { // Strip precision/scale suffix like (20,6) const base = t.replace(/\(.*\)$/, "").toLowerCase(); if (["int", "int2", "int4", "int8", "smallint", "bigint", "integer", "serial", "bigserial", "tinyint", "mediumint"].includes(base)) return "text-blue-500"; - if (["float4", "float8", "double", "decimal", "numeric", "real", "float", "money"].includes(base)) return "text-cyan-500"; - if (["varchar", "text", "char", "character varying", "character", "string", "nvarchar", "nchar", "ntext", "longtext", "mediumtext", "tinytext", "clob"].includes(base)) return "text-green-500"; + // number: Oracle/Dameng NUMBER;binary_float/binary_double: Oracle IEEE 浮点 + if (["float4", "float8", "double", "decimal", "numeric", "real", "float", "money", "number", "binary_float", "binary_double", "dec"].includes(base)) return "text-cyan-500"; + // varchar2/nvarchar2/long: Oracle/Dameng 字符类型(LONG 在 Oracle 中是变长字符) + if (["varchar", "varchar2", "nvarchar2", "text", "char", "character varying", "character", "string", "nvarchar", "nchar", "ntext", "longtext", "mediumtext", "tinytext", "clob", "long"].includes(base)) return "text-green-500"; if (["bool", "boolean", "bit"].includes(base)) return "text-orange-500"; if (["timestamp", "timestamptz", "datetime", "date", "time", "timetz", "datetime2", "smalldatetime"].includes(base)) return "text-purple-500"; - if (["json", "jsonb", "xml", "array"].includes(base)) return "text-pink-500"; + // xmltype: Oracle XMLType + if (["json", "jsonb", "xml", "xmltype", "array"].includes(base)) return "text-pink-500"; if (["uuid", "uniqueidentifier"].includes(base)) return "text-amber-500"; - if (["bytea", "blob", "binary", "varbinary", "image"].includes(base)) return "text-red-400"; - if (["geometry", "geography"].includes(base)) return "text-emerald-500"; + // raw/long raw/bfile: Oracle 二进制 + if (["bytea", "blob", "binary", "varbinary", "image", "raw", "long raw", "bfile"].includes(base)) return "text-red-400"; + // sdo_geometry: Oracle Spatial + if (["geometry", "geography", "sdo_geometry"].includes(base)) return "text-emerald-500"; return "text-muted-foreground"; } const contextCell = ref<{ rowId: number; rowIndex: number; col: number } | null>(null);