From 66a52e8405b5d771de5e429ac756c380255f2111 Mon Sep 17 00:00:00 2001 From: Geequlim Date: Wed, 20 May 2020 21:01:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E7=BB=84=E5=AD=97=E6=AE=B5=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=8E=A8=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/excel-exporter/TableParser.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/excel-exporter/TableParser.ts b/src/excel-exporter/TableParser.ts index cb0bcf7..ba1d945 100644 --- a/src/excel-exporter/TableParser.ts +++ b/src/excel-exporter/TableParser.ts @@ -19,6 +19,14 @@ export enum DataType { string = 'string', } +const TypeCompatibility = { + string: 5, + float: 4, + int: 3, + bool: 2, + null: 1 +}; + export interface ColumnDescription { type: DataType; name: string; @@ -165,6 +173,9 @@ export class TableParser { let field = field_maps.get(column.name); field.column.is_array = true; field.indexes.push(c_idx); + if (TypeCompatibility[column.type] > TypeCompatibility[field.column.type]) { + field.column.type = column.type; + } } c_idx += 1; }