feat: 所有参数字段改为文本类型,长文本字段标记input_style

This commit is contained in:
2026-04-29 00:35:19 +08:00
parent 151829296e
commit 643a934c83
6 changed files with 308 additions and 3276 deletions

23
app.py
View File

@@ -127,14 +127,11 @@ def parse_with_llm(text, category_type, images=None, category_id=None, subcatego
# 使用类别配置的字段 # 使用类别配置的字段
for field in cat['fields']: for field in cat['fields']:
field_desc = field['label'] field_desc = field['label']
if field['type'] == 'number': # 所有字段都是文本类型
field_desc += '(数字)' if field.get('input_style') == 'long':
elif field['type'] == 'boolean': field_desc += '(长文本)'
field_desc += '(true/false)' else:
elif field['type'] == 'date': field_desc += '(文本)'
field_desc += '(日期格式YYYY-MM-DD)'
elif field['type'] == 'json':
field_desc += '(JSON对象)'
if field.get('description'): if field.get('description'):
field_desc += f" - {field['description']}" field_desc += f" - {field['description']}"
fields[field['key']] = field_desc fields[field['key']] = field_desc
@@ -145,12 +142,10 @@ def parse_with_llm(text, category_type, images=None, category_id=None, subcatego
if subcat and 'extra_fields' in subcat: if subcat and 'extra_fields' in subcat:
for field in subcat['extra_fields']: for field in subcat['extra_fields']:
field_desc = field['label'] field_desc = field['label']
if field['type'] == 'number': if field.get('input_style') == 'long':
field_desc += '(数字)' field_desc += '(长文本)'
elif field['type'] == 'boolean': else:
field_desc += '(true/false)' field_desc += '(文本)'
elif field['type'] == 'date':
field_desc += '(日期格式YYYY-MM-DD)'
if field.get('description'): if field.get('description'):
field_desc += f" - {field['description']}" field_desc += f" - {field['description']}"
fields[field['key']] = field_desc fields[field['key']] = field_desc

View File

@@ -59,16 +59,18 @@
{ {
"key": "reasoning_capability", "key": "reasoning_capability",
"label": "推理能力", "label": "推理能力",
"type": "boolean", "type": "text",
"description": "是否专门推理模型", "description": "是否专门推理模型",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "thinking_mode", "key": "thinking_mode",
"label": "思考模式", "label": "思考模式",
"type": "text", "type": "text",
"description": "思考模式类型", "description": "思考模式类型",
"required": false "required": false,
"input_style": "normal"
} }
] ]
}, },
@@ -90,16 +92,18 @@
{ {
"key": "vision_capability", "key": "vision_capability",
"label": "视觉能力", "label": "视觉能力",
"type": "boolean", "type": "text",
"description": "是否支持图像输入", "description": "是否支持图像输入",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "multimodal", "key": "multimodal",
"label": "多模态", "label": "多模态",
"type": "boolean", "type": "text",
"description": "是否多模态模型", "description": "是否多模态模型",
"required": false "required": false,
"input_style": "normal"
} }
] ]
} }
@@ -110,98 +114,112 @@
"label": "名称", "label": "名称",
"type": "text", "type": "text",
"description": "模型名称", "description": "模型名称",
"required": true "required": true,
"input_style": "normal"
}, },
{ {
"key": "organization", "key": "organization",
"label": "厂商", "label": "厂商",
"type": "text", "type": "text",
"description": "开发公司/组织", "description": "开发公司/组织",
"required": true "required": true,
"input_style": "normal"
}, },
{ {
"key": "parameters", "key": "parameters",
"label": "参数量(B)", "label": "参数量(B)",
"type": "number", "type": "text",
"description": "模型参数量单位B十亿", "description": "模型参数量单位B十亿",
"required": true "required": true,
"input_style": "normal"
}, },
{ {
"key": "architecture", "key": "architecture",
"label": "架构", "label": "架构",
"type": "text", "type": "text",
"description": "模型架构如Transformer、MoE", "description": "模型架构如Transformer、MoE",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "context_length", "key": "context_length",
"label": "上下文长度", "label": "上下文长度",
"type": "number", "type": "text",
"description": "最大上下文窗口", "description": "最大上下文窗口",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "is_open_source", "key": "is_open_source",
"label": "开源", "label": "开源",
"type": "boolean", "type": "text",
"description": "是否开源模型", "description": "是否开源模型",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "mmlu", "key": "mmlu",
"label": "MMLU分数", "label": "MMLU分数",
"type": "number", "type": "text",
"description": "MMLU基准测试分数", "description": "MMLU基准测试分数",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "humaneval", "key": "humaneval",
"label": "HumanEval分数", "label": "HumanEval分数",
"type": "number", "type": "text",
"description": "HumanEval代码能力分数", "description": "HumanEval代码能力分数",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "input_price", "key": "input_price",
"label": "输入价格($/1K)", "label": "输入价格($/1K)",
"type": "number", "type": "text",
"description": "每1K输入token价格", "description": "每1K输入token价格",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "output_price", "key": "output_price",
"label": "输出价格($/1K)", "label": "输出价格($/1K)",
"type": "number", "type": "text",
"description": "每1K输出token价格", "description": "每1K输出token价格",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "license", "key": "license",
"label": "许可证", "label": "许可证",
"type": "text", "type": "text",
"description": "使用许可证类型", "description": "使用许可证类型",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "publish_date", "key": "publish_date",
"label": "发布日期", "label": "发布日期",
"type": "date", "type": "text",
"description": "模型发布日期", "description": "模型发布日期",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "description", "key": "description",
"label": "描述", "label": "描述",
"type": "text", "type": "text",
"description": "模型简介", "description": "模型简介",
"required": false "required": false,
"input_style": "long"
}, },
{ {
"key": "views", "key": "views",
"label": "热度", "label": "热度",
"type": "number", "type": "text",
"description": "浏览次数", "description": "浏览次数",
"required": false "required": false,
"input_style": "normal"
} }
] ]
}, },
@@ -269,16 +287,18 @@
{ {
"key": "nvlink", "key": "nvlink",
"label": "NVLink", "label": "NVLink",
"type": "boolean", "type": "text",
"description": "是否支持NVLink互联", "description": "是否支持NVLink互联",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "multi_instance", "key": "multi_instance",
"label": "MIG", "label": "MIG",
"type": "boolean", "type": "text",
"description": "是否支持多实例GPU", "description": "是否支持多实例GPU",
"required": false "required": false,
"input_style": "normal"
} }
] ]
} }
@@ -289,126 +309,144 @@
"label": "名称", "label": "名称",
"type": "text", "type": "text",
"description": "GPU名称", "description": "GPU名称",
"required": true "required": true,
"input_style": "normal"
}, },
{ {
"key": "manufacturer", "key": "manufacturer",
"label": "厂商", "label": "厂商",
"type": "text", "type": "text",
"description": "制造商", "description": "制造商",
"required": true "required": true,
"input_style": "normal"
}, },
{ {
"key": "architecture", "key": "architecture",
"label": "架构", "label": "架构",
"type": "text", "type": "text",
"description": "GPU架构如Ampere、Hopper", "description": "GPU架构如Ampere、Hopper",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "memory_gb", "key": "memory_gb",
"label": "显存(GB)", "label": "显存(GB)",
"type": "number", "type": "text",
"description": "显存容量", "description": "显存容量",
"required": true "required": true,
"input_style": "normal"
}, },
{ {
"key": "cuda_cores", "key": "cuda_cores",
"label": "CUDA核心", "label": "CUDA核心",
"type": "number", "type": "text",
"description": "CUDA核心数量", "description": "CUDA核心数量",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "tensor_cores", "key": "tensor_cores",
"label": "Tensor核心", "label": "Tensor核心",
"type": "number", "type": "text",
"description": "Tensor核心数量", "description": "Tensor核心数量",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "memory_bandwidth_gbs", "key": "memory_bandwidth_gbs",
"label": "显存带宽(GB/s)", "label": "显存带宽(GB/s)",
"type": "number", "type": "text",
"description": "显存带宽", "description": "显存带宽",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "fp32_tflops", "key": "fp32_tflops",
"label": "FP32性能(TF)", "label": "FP32性能(TF)",
"type": "number", "type": "text",
"description": "FP32浮点性能", "description": "FP32浮点性能",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "fp16_tflops", "key": "fp16_tflops",
"label": "FP16性能(TF)", "label": "FP16性能(TF)",
"type": "number", "type": "text",
"description": "FP16半精度性能", "description": "FP16半精度性能",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "int8_perf_tops", "key": "int8_perf_tops",
"label": "INT8性能(TOPS)", "label": "INT8性能(TOPS)",
"type": "number", "type": "text",
"description": "INT8整数性能", "description": "INT8整数性能",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "price_usd", "key": "price_usd",
"label": "价格($)", "label": "价格($)",
"type": "number", "type": "text",
"description": "参考价格(美元)", "description": "参考价格(美元)",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "currency", "key": "currency",
"label": "币种", "label": "币种",
"type": "text", "type": "text",
"description": "价格币种", "description": "价格币种",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "min_price", "key": "min_price",
"label": "最低价", "label": "最低价",
"type": "number", "type": "text",
"description": "最低价格", "description": "最低价格",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "max_price", "key": "max_price",
"label": "最高价", "label": "最高价",
"type": "number", "type": "text",
"description": "最高价格", "description": "最高价格",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "price_unit", "key": "price_unit",
"label": "价格单位", "label": "价格单位",
"type": "text", "type": "text",
"description": "价格单位,如万", "description": "价格单位,如万",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "release_year", "key": "release_year",
"label": "发布年份", "label": "发布年份",
"type": "number", "type": "text",
"description": "发布年份", "description": "发布年份",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "description", "key": "description",
"label": "描述", "label": "描述",
"type": "text", "type": "text",
"description": "GPU简介", "description": "GPU简介",
"required": false "required": false,
"input_style": "long"
}, },
{ {
"key": "publish_date", "key": "publish_date",
"label": "发布日期", "label": "发布日期",
"type": "text", "type": "text",
"description": "产品发布日期,格式 YYYY-MM-DD", "description": "产品发布日期,格式 YYYY-MM-DD",
"required": false "required": false,
"input_style": "normal"
} }
] ]
}, },
@@ -458,16 +496,18 @@
{ {
"key": "pcie_gen", "key": "pcie_gen",
"label": "PCIe版本", "label": "PCIe版本",
"type": "number", "type": "text",
"description": "PCIe代数", "description": "PCIe代数",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "max_memory", "key": "max_memory",
"label": "最大内存(GB)", "label": "最大内存(GB)",
"type": "number", "type": "text",
"description": "支持最大内存容量", "description": "支持最大内存容量",
"required": false "required": false,
"input_style": "normal"
} }
] ]
}, },
@@ -493,14 +533,16 @@
"label": "集成显卡", "label": "集成显卡",
"type": "text", "type": "text",
"description": "集成GPU型号", "description": "集成GPU型号",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "tdp_range", "key": "tdp_range",
"label": "功耗范围(W)", "label": "功耗范围(W)",
"type": "text", "type": "text",
"description": "功耗范围", "description": "功耗范围",
"required": false "required": false,
"input_style": "normal"
} }
] ]
} }
@@ -511,98 +553,112 @@
"label": "名称", "label": "名称",
"type": "text", "type": "text",
"description": "CPU名称", "description": "CPU名称",
"required": true "required": true,
"input_style": "normal"
}, },
{ {
"key": "manufacturer", "key": "manufacturer",
"label": "厂商", "label": "厂商",
"type": "text", "type": "text",
"description": "制造商", "description": "制造商",
"required": true "required": true,
"input_style": "normal"
}, },
{ {
"key": "architecture", "key": "architecture",
"label": "架构", "label": "架构",
"type": "text", "type": "text",
"description": "CPU架构如Zen 4", "description": "CPU架构如Zen 4",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "cores", "key": "cores",
"label": "核心数", "label": "核心数",
"type": "number", "type": "text",
"description": "物理核心数", "description": "物理核心数",
"required": true "required": true,
"input_style": "normal"
}, },
{ {
"key": "threads", "key": "threads",
"label": "线程数", "label": "线程数",
"type": "number", "type": "text",
"description": "逻辑线程数", "description": "逻辑线程数",
"required": true "required": true,
"input_style": "normal"
}, },
{ {
"key": "base_clock_ghz", "key": "base_clock_ghz",
"label": "基础频率(GHz)", "label": "基础频率(GHz)",
"type": "number", "type": "text",
"description": "基础频率", "description": "基础频率",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "boost_clock_ghz", "key": "boost_clock_ghz",
"label": "加速频率(GHz)", "label": "加速频率(GHz)",
"type": "number", "type": "text",
"description": "加速频率", "description": "加速频率",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "l3_cache_mb", "key": "l3_cache_mb",
"label": "L3缓存(MB)", "label": "L3缓存(MB)",
"type": "number", "type": "text",
"description": "三级缓存大小", "description": "三级缓存大小",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "tdp_watts", "key": "tdp_watts",
"label": "TDP功耗(W)", "label": "TDP功耗(W)",
"type": "number", "type": "text",
"description": "热设计功耗", "description": "热设计功耗",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "price_usd", "key": "price_usd",
"label": "价格($)", "label": "价格($)",
"type": "number", "type": "text",
"description": "参考价格(美元)", "description": "参考价格(美元)",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "currency", "key": "currency",
"label": "币种", "label": "币种",
"type": "text", "type": "text",
"description": "价格币种", "description": "价格币种",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "release_year", "key": "release_year",
"label": "发布年份", "label": "发布年份",
"type": "number", "type": "text",
"description": "发布年份", "description": "发布年份",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "description", "key": "description",
"label": "描述", "label": "描述",
"type": "text", "type": "text",
"description": "CPU简介", "description": "CPU简介",
"required": false "required": false,
"input_style": "long"
}, },
{ {
"key": "publish_date", "key": "publish_date",
"label": "发布日期", "label": "发布日期",
"type": "text", "type": "text",
"description": "产品发布日期,格式 YYYY-MM-DD", "description": "产品发布日期,格式 YYYY-MM-DD",
"required": false "required": false,
"input_style": "normal"
} }
] ]
}, },
@@ -656,70 +712,80 @@
"key": "name", "key": "name",
"label": "名称", "label": "名称",
"required": true, "required": true,
"type": "text" "type": "text",
"input_style": "normal"
}, },
{ {
"description": "手机品牌", "description": "手机品牌",
"key": "brand", "key": "brand",
"label": "品牌", "label": "品牌",
"required": true, "required": true,
"type": "text" "type": "text",
"input_style": "normal"
}, },
{ {
"description": "CPU型号", "description": "CPU型号",
"key": "processor", "key": "processor",
"label": "处理器", "label": "处理器",
"required": false, "required": false,
"type": "text" "type": "text",
"input_style": "normal"
}, },
{ {
"description": "RAM容量", "description": "RAM容量",
"key": "ram_gb", "key": "ram_gb",
"label": "内存(GB)", "label": "内存(GB)",
"required": false, "required": false,
"type": "number" "type": "text",
"input_style": "normal"
}, },
{ {
"description": "存储容量", "description": "存储容量",
"key": "storage_gb", "key": "storage_gb",
"label": "存储(GB)", "label": "存储(GB)",
"required": false, "required": false,
"type": "number" "type": "text",
"input_style": "normal"
}, },
{ {
"description": "屏幕尺寸(英寸)", "description": "屏幕尺寸(英寸)",
"key": "screen_size", "key": "screen_size",
"label": "屏幕尺寸", "label": "屏幕尺寸",
"required": false, "required": false,
"type": "text" "type": "text",
"input_style": "normal"
}, },
{ {
"description": "电池容量", "description": "电池容量",
"key": "battery_mah", "key": "battery_mah",
"label": "电池(mAh)", "label": "电池(mAh)",
"required": false, "required": false,
"type": "number" "type": "text",
"input_style": "normal"
}, },
{ {
"description": "参考价格", "description": "参考价格",
"key": "price", "key": "price",
"label": "价格", "label": "价格",
"required": false, "required": false,
"type": "number" "type": "text",
"input_style": "normal"
}, },
{ {
"description": "产品简介", "description": "产品简介",
"key": "description", "key": "description",
"label": "描述", "label": "描述",
"required": false, "required": false,
"type": "text" "type": "text",
"input_style": "long"
}, },
{ {
"description": "产品发布日期,格式 YYYY-MM-DD", "description": "产品发布日期,格式 YYYY-MM-DD",
"key": "publish_date", "key": "publish_date",
"label": "发布日期", "label": "发布日期",
"required": false, "required": false,
"type": "text" "type": "text",
"input_style": "normal"
} }
], ],
"updated_at": "2026-04-28 18:28:01" "updated_at": "2026-04-28 18:28:01"
@@ -773,84 +839,96 @@
"label": "名称", "label": "名称",
"type": "text", "type": "text",
"description": "电脑型号", "description": "电脑型号",
"required": true "required": true,
"input_style": "normal"
}, },
{ {
"key": "brand", "key": "brand",
"label": "品牌", "label": "品牌",
"type": "text", "type": "text",
"description": "品牌", "description": "品牌",
"required": true "required": true,
"input_style": "normal"
}, },
{ {
"key": "processor", "key": "processor",
"label": "处理器", "label": "处理器",
"type": "text", "type": "text",
"description": "CPU型号", "description": "CPU型号",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "gpu", "key": "gpu",
"label": "显卡", "label": "显卡",
"type": "text", "type": "text",
"description": "GPU型号", "description": "GPU型号",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "ram_gb", "key": "ram_gb",
"label": "内存(GB)", "label": "内存(GB)",
"type": "number", "type": "text",
"description": "RAM容量", "description": "RAM容量",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "storage_gb", "key": "storage_gb",
"label": "存储(GB)", "label": "存储(GB)",
"type": "number", "type": "text",
"description": "存储容量", "description": "存储容量",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "screen_size", "key": "screen_size",
"label": "屏幕尺寸", "label": "屏幕尺寸",
"type": "text", "type": "text",
"description": "屏幕尺寸", "description": "屏幕尺寸",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "weight_kg", "key": "weight_kg",
"label": "重量(kg)", "label": "重量(kg)",
"type": "number", "type": "text",
"description": "重量", "description": "重量",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "price", "key": "price",
"label": "价格", "label": "价格",
"type": "number", "type": "text",
"description": "参考价格", "description": "参考价格",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "year", "key": "year",
"label": "年份", "label": "年份",
"type": "number", "type": "text",
"description": "发布年份", "description": "发布年份",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "description", "key": "description",
"label": "描述", "label": "描述",
"type": "text", "type": "text",
"description": "产品简介", "description": "产品简介",
"required": false "required": false,
"input_style": "long"
}, },
{ {
"key": "publish_date", "key": "publish_date",
"label": "发布日期", "label": "发布日期",
"type": "text", "type": "text",
"description": "产品发布日期,格式 YYYY-MM-DD", "description": "产品发布日期,格式 YYYY-MM-DD",
"required": false "required": false,
"input_style": "normal"
} }
] ]
}, },
@@ -900,49 +978,56 @@
"label": "名称", "label": "名称",
"type": "text", "type": "text",
"description": "车型名称", "description": "车型名称",
"required": true "required": true,
"input_style": "normal"
}, },
{ {
"key": "brand", "key": "brand",
"label": "品牌", "label": "品牌",
"type": "text", "type": "text",
"description": "汽车品牌", "description": "汽车品牌",
"required": true "required": true,
"input_style": "normal"
}, },
{ {
"key": "price", "key": "price",
"label": "价格(万)", "label": "价格(万)",
"type": "number", "type": "text",
"description": "参考价格(万元)", "description": "参考价格(万元)",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "year", "key": "year",
"label": "年份", "label": "年份",
"type": "number", "type": "text",
"description": "生产年份", "description": "生产年份",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "specs", "key": "specs",
"label": "参数", "label": "参数",
"type": "json", "type": "text",
"description": "详细规格参数", "description": "详细规格参数",
"required": false "required": false,
"input_style": "long"
}, },
{ {
"key": "description", "key": "description",
"label": "描述", "label": "描述",
"type": "text", "type": "text",
"description": "车型简介", "description": "车型简介",
"required": false "required": false,
"input_style": "long"
}, },
{ {
"key": "publish_date", "key": "publish_date",
"label": "发布日期", "label": "发布日期",
"type": "text", "type": "text",
"description": "产品发布日期,格式 YYYY-MM-DD", "description": "产品发布日期,格式 YYYY-MM-DD",
"required": false "required": false,
"input_style": "normal"
} }
] ]
}, },
@@ -1005,70 +1090,80 @@
"label": "名称", "label": "名称",
"type": "text", "type": "text",
"description": "产品名称", "description": "产品名称",
"required": true "required": true,
"input_style": "normal"
}, },
{ {
"key": "brand", "key": "brand",
"label": "品牌", "label": "品牌",
"type": "text", "type": "text",
"description": "品牌", "description": "品牌",
"required": true "required": true,
"input_style": "normal"
}, },
{ {
"key": "sensor", "key": "sensor",
"label": "传感器", "label": "传感器",
"type": "text", "type": "text",
"description": "传感器类型/尺寸", "description": "传感器类型/尺寸",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "megapixels", "key": "megapixels",
"label": "像素", "label": "像素",
"type": "number", "type": "text",
"description": "有效像素MP", "description": "有效像素MP",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "video_resolution", "key": "video_resolution",
"label": "视频分辨率", "label": "视频分辨率",
"type": "text", "type": "text",
"description": "最高视频分辨率", "description": "最高视频分辨率",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "lens_mount", "key": "lens_mount",
"label": "镜头卡口", "label": "镜头卡口",
"type": "text", "type": "text",
"description": "镜头卡口类型", "description": "镜头卡口类型",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "price", "key": "price",
"label": "价格", "label": "价格",
"type": "number", "type": "text",
"description": "参考价格", "description": "参考价格",
"required": false "required": false,
"input_style": "normal"
}, },
{ {
"key": "specs", "key": "specs",
"label": "参数", "label": "参数",
"type": "json", "type": "text",
"description": "详细规格参数", "description": "详细规格参数",
"required": false "required": false,
"input_style": "long"
}, },
{ {
"key": "description", "key": "description",
"label": "描述", "label": "描述",
"type": "text", "type": "text",
"description": "产品简介", "description": "产品简介",
"required": false "required": false,
"input_style": "long"
}, },
{ {
"key": "publish_date", "key": "publish_date",
"label": "发布日期", "label": "发布日期",
"type": "text", "type": "text",
"description": "产品发布日期,格式 YYYY-MM-DD", "description": "产品发布日期,格式 YYYY-MM-DD",
"required": false "required": false,
"input_style": "normal"
} }
] ]
} }

View File

@@ -54,49 +54,30 @@
"name": "EOS R7", "name": "EOS R7",
"brand": "佳能 (Canon)", "brand": "佳能 (Canon)",
"year": 2022, "year": 2022,
"specs": { "specs": "{\n \"RAW照片输出\": \"14bit\",\n \"上市时间\": \"2022-06\",\n \"传感器尺寸\": \"APS-C\",\n \"传感器类型\": \"CMOS\",\n \"像素\": \"3000-4000万\",\n \"功能\": \"Wi-Fi 4K视频 5轴防抖 高速连拍 翻转自拍\",\n \"取景器类型\": \"电子取景器\",\n \"品牌\": \"佳能 (Canon)\",\n \"商品编号\": \"10090975539899\",\n \"型号\": \"EOS R7\",\n \"外接电源\": \"支持外接电源\",\n \"存储介质\": \"SD卡 SDHC卡 SDXC卡\",\n \"店铺\": \"佳能 (Canon) 数码旗舰店\",\n \"接口\": \"Wi-Fi 蓝牙 HDMI\",\n \"最大光圈\": \"F3.5\",\n \"有效像素\": \"3250万\",\n \"标准ISO感光度\": \"ISO 100-32000\",\n \"液晶屏像素\": \"162万\",\n \"液晶屏尺寸\": \"3.2英寸\",\n \"液晶屏类型\": \"侧翻屏 旋转屏\",\n \"滤镜直径\": \"55mm\",\n \"焦点数量\": \"5915个\",\n \"电池类型\": \"锂离子电池\",\n \"类型\": \"机身\",\n \"视频拍摄能力\": \"4K 60P\",\n \"视频采样\": \"4:2:2\",\n \"连拍速度\": \"电子最高约30张/秒机械最高约15张/秒\",\n \"适用对象\": \"入门级\",\n \"镜头卡口\": \"佳能RF卡口\",\n \"高清摄像\": \"4K超高清视频\"\n}",
"品牌": "佳能 (Canon)",
"商品编号": "10090975539899",
"店铺": "佳能 (Canon) 数码旗舰店",
"外接电源": "支持外接电源",
"电池类型": "锂离子电池",
"接口": "Wi-Fi 蓝牙 HDMI",
"高清摄像": "4K超高清视频",
"焦点数量": "5915个",
"型号": "EOS R7",
"有效像素": "3250万",
"传感器类型": "CMOS",
"上市时间": "2022-06",
"取景器类型": "电子取景器",
"液晶屏像素": "162万",
"液晶屏尺寸": "3.2英寸",
"液晶屏类型": "侧翻屏 旋转屏",
"最大光圈": "F3.5",
"标准ISO感光度": "ISO 100-32000",
"连拍速度": "电子最高约30张/秒机械最高约15张/秒",
"存储介质": "SD卡 SDHC卡 SDXC卡",
"功能": "Wi-Fi 4K视频 5轴防抖 高速连拍 翻转自拍",
"滤镜直径": "55mm",
"视频拍摄能力": "4K 60P",
"传感器尺寸": "APS-C",
"视频采样": "4:2:2",
"像素": "3000-4000万",
"镜头卡口": "佳能RF卡口",
"RAW照片输出": "14bit",
"适用对象": "入门级",
"类型": "机身"
},
"description": "入门级机身", "description": "入门级机身",
"id": "c8c3f124b2ce", "id": "c8c3f124b2ce",
"category_id": "71fa2b4d818f", "category_id": "71fa2b4d818f",
"created_at": "2026-04-28 16:38:03", "created_at": "2026-04-28 16:38:03",
"visible": true, "visible": true,
"raw_text": "", "raw_text": "",
"images": [ "images": [],
"/static/uploads/9703a1d16424_1777365365.png" "publish_date": "2022-06-01",
],
"publish_date": "2022-01-01",
"views": 0, "views": 0,
"is_pinned": false "is_pinned": false,
"updated_at": "2026-04-29 00:24:06",
"parse_sources": [
{
"type": "smart_update",
"timestamp": "2026-04-28 23:32:40",
"images": [
"/static/uploads/deca243eff98_1777390343.png"
],
"text": "",
"updated_fields": []
}
],
"subcategory_id": "dslr",
"megapixels": "3000"
} }
] ]

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View File

@@ -1904,7 +1904,7 @@
if (!cat) return ''; if (!cat) return '';
const fields = cat.fields || []; const fields = cat.fields || [];
const fixedFields = ['id', 'subcategory_id', 'images', 'visible', 'created_at', 'updated_at', 'raw_text', 'is_pinned', 'views']; const fixedFields = ['id', 'subcategory_id', 'images', 'visible', 'created_at', 'updated_at', 'raw_text', 'is_pinned', 'views', 'parse_sources', 'product_images'];
// 合并子类别额外字段 // 合并子类别额外字段
let allFields = fields; let allFields = fields;
@@ -1922,22 +1922,14 @@
const required = field.required ? 'required' : ''; const required = field.required ? 'required' : '';
const requiredMark = field.required ? '<span class="text-red-500">*</span>' : ''; const requiredMark = field.required ? '<span class="text-red-500">*</span>' : '';
const desc = field.description ? `<p class="text-xs text-gray-400 mt-1">${field.description}</p>` : ''; const desc = field.description ? `<p class="text-xs text-gray-400 mt-1">${field.description}</p>` : '';
const inputStyle = field.input_style || 'normal';
let inputHtml = ''; let inputHtml = '';
if (field.type === 'boolean') { if (inputStyle === 'long') {
inputHtml = `<select name="${field.key}" class="w-full px-3 py-2 border rounded-lg" ${required}> // 长文本用 textarea
<option value="true" ${value === true ? 'selected' : ''}>是</option> inputHtml = `<textarea name="${field.key}" rows="4" class="w-full px-3 py-2 border rounded-lg" ${required}>${value}</textarea>`;
<option value="false" ${value === false || !value ? 'selected' : ''}>否</option>
</select>`;
} else if (field.type === 'number') {
inputHtml = `<input type="number" name="${field.key}" value="${value}" step="any" class="w-full px-3 py-2 border rounded-lg" ${required}>`;
} else if (field.type === 'date') {
inputHtml = `<input type="date" name="${field.key}" value="${value}" class="w-full px-3 py-2 border rounded-lg" ${required}>`;
} else if (field.type === 'json') {
inputHtml = `<textarea name="${field.key}" rows="3" class="w-full px-3 py-2 border rounded-lg font-mono text-sm" ${required}>${typeof value === 'object' ? JSON.stringify(value, null, 2) : value}</textarea>`;
} else if (field.type === 'url') {
inputHtml = `<input type="url" name="${field.key}" value="${value}" class="w-full px-3 py-2 border rounded-lg" ${required}>`;
} else { } else {
// 普通文本用 input
inputHtml = `<input type="text" name="${field.key}" value="${value}" class="w-full px-3 py-2 border rounded-lg" ${required}>`; inputHtml = `<input type="text" name="${field.key}" value="${value}" class="w-full px-3 py-2 border rounded-lg" ${required}>`;
} }