Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 643a934c83 |
23
app.py
23
app.py
@@ -127,14 +127,11 @@ def parse_with_llm(text, category_type, images=None, category_id=None, subcatego
|
||||
# 使用类别配置的字段
|
||||
for field in cat['fields']:
|
||||
field_desc = field['label']
|
||||
if field['type'] == 'number':
|
||||
field_desc += '(数字)'
|
||||
elif field['type'] == 'boolean':
|
||||
field_desc += '(true/false)'
|
||||
elif field['type'] == 'date':
|
||||
field_desc += '(日期格式YYYY-MM-DD)'
|
||||
elif field['type'] == 'json':
|
||||
field_desc += '(JSON对象)'
|
||||
# 所有字段都是文本类型
|
||||
if field.get('input_style') == 'long':
|
||||
field_desc += '(长文本)'
|
||||
else:
|
||||
field_desc += '(文本)'
|
||||
if field.get('description'):
|
||||
field_desc += f" - {field['description']}"
|
||||
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:
|
||||
for field in subcat['extra_fields']:
|
||||
field_desc = field['label']
|
||||
if field['type'] == 'number':
|
||||
field_desc += '(数字)'
|
||||
elif field['type'] == 'boolean':
|
||||
field_desc += '(true/false)'
|
||||
elif field['type'] == 'date':
|
||||
field_desc += '(日期格式YYYY-MM-DD)'
|
||||
if field.get('input_style') == 'long':
|
||||
field_desc += '(长文本)'
|
||||
else:
|
||||
field_desc += '(文本)'
|
||||
if field.get('description'):
|
||||
field_desc += f" - {field['description']}"
|
||||
fields[field['key']] = field_desc
|
||||
|
||||
@@ -59,16 +59,18 @@
|
||||
{
|
||||
"key": "reasoning_capability",
|
||||
"label": "推理能力",
|
||||
"type": "boolean",
|
||||
"type": "text",
|
||||
"description": "是否专门推理模型",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "thinking_mode",
|
||||
"label": "思考模式",
|
||||
"type": "text",
|
||||
"description": "思考模式类型",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -90,16 +92,18 @@
|
||||
{
|
||||
"key": "vision_capability",
|
||||
"label": "视觉能力",
|
||||
"type": "boolean",
|
||||
"type": "text",
|
||||
"description": "是否支持图像输入",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "multimodal",
|
||||
"label": "多模态",
|
||||
"type": "boolean",
|
||||
"type": "text",
|
||||
"description": "是否多模态模型",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -110,98 +114,112 @@
|
||||
"label": "名称",
|
||||
"type": "text",
|
||||
"description": "模型名称",
|
||||
"required": true
|
||||
"required": true,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "organization",
|
||||
"label": "厂商",
|
||||
"type": "text",
|
||||
"description": "开发公司/组织",
|
||||
"required": true
|
||||
"required": true,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "parameters",
|
||||
"label": "参数量(B)",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "模型参数量,单位B(十亿)",
|
||||
"required": true
|
||||
"required": true,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "architecture",
|
||||
"label": "架构",
|
||||
"type": "text",
|
||||
"description": "模型架构,如Transformer、MoE",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "context_length",
|
||||
"label": "上下文长度",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "最大上下文窗口",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "is_open_source",
|
||||
"label": "开源",
|
||||
"type": "boolean",
|
||||
"type": "text",
|
||||
"description": "是否开源模型",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "mmlu",
|
||||
"label": "MMLU分数",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "MMLU基准测试分数",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "humaneval",
|
||||
"label": "HumanEval分数",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "HumanEval代码能力分数",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "input_price",
|
||||
"label": "输入价格($/1K)",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "每1K输入token价格",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "output_price",
|
||||
"label": "输出价格($/1K)",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "每1K输出token价格",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "license",
|
||||
"label": "许可证",
|
||||
"type": "text",
|
||||
"description": "使用许可证类型",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "publish_date",
|
||||
"label": "发布日期",
|
||||
"type": "date",
|
||||
"type": "text",
|
||||
"description": "模型发布日期",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "description",
|
||||
"label": "描述",
|
||||
"type": "text",
|
||||
"description": "模型简介",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "long"
|
||||
},
|
||||
{
|
||||
"key": "views",
|
||||
"label": "热度",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "浏览次数",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -269,16 +287,18 @@
|
||||
{
|
||||
"key": "nvlink",
|
||||
"label": "NVLink",
|
||||
"type": "boolean",
|
||||
"type": "text",
|
||||
"description": "是否支持NVLink互联",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "multi_instance",
|
||||
"label": "MIG",
|
||||
"type": "boolean",
|
||||
"type": "text",
|
||||
"description": "是否支持多实例GPU",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -289,126 +309,144 @@
|
||||
"label": "名称",
|
||||
"type": "text",
|
||||
"description": "GPU名称",
|
||||
"required": true
|
||||
"required": true,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "manufacturer",
|
||||
"label": "厂商",
|
||||
"type": "text",
|
||||
"description": "制造商",
|
||||
"required": true
|
||||
"required": true,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "architecture",
|
||||
"label": "架构",
|
||||
"type": "text",
|
||||
"description": "GPU架构,如Ampere、Hopper",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "memory_gb",
|
||||
"label": "显存(GB)",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "显存容量",
|
||||
"required": true
|
||||
"required": true,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "cuda_cores",
|
||||
"label": "CUDA核心",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "CUDA核心数量",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "tensor_cores",
|
||||
"label": "Tensor核心",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "Tensor核心数量",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "memory_bandwidth_gbs",
|
||||
"label": "显存带宽(GB/s)",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "显存带宽",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "fp32_tflops",
|
||||
"label": "FP32性能(TF)",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "FP32浮点性能",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "fp16_tflops",
|
||||
"label": "FP16性能(TF)",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "FP16半精度性能",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "int8_perf_tops",
|
||||
"label": "INT8性能(TOPS)",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "INT8整数性能",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "price_usd",
|
||||
"label": "价格($)",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "参考价格(美元)",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "currency",
|
||||
"label": "币种",
|
||||
"type": "text",
|
||||
"description": "价格币种",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "min_price",
|
||||
"label": "最低价",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "最低价格",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "max_price",
|
||||
"label": "最高价",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "最高价格",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "price_unit",
|
||||
"label": "价格单位",
|
||||
"type": "text",
|
||||
"description": "价格单位,如万",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "release_year",
|
||||
"label": "发布年份",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "发布年份",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "description",
|
||||
"label": "描述",
|
||||
"type": "text",
|
||||
"description": "GPU简介",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "long"
|
||||
},
|
||||
{
|
||||
"key": "publish_date",
|
||||
"label": "发布日期",
|
||||
"type": "text",
|
||||
"description": "产品发布日期,格式 YYYY-MM-DD",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -458,16 +496,18 @@
|
||||
{
|
||||
"key": "pcie_gen",
|
||||
"label": "PCIe版本",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "PCIe代数",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "max_memory",
|
||||
"label": "最大内存(GB)",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "支持最大内存容量",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -493,14 +533,16 @@
|
||||
"label": "集成显卡",
|
||||
"type": "text",
|
||||
"description": "集成GPU型号",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "tdp_range",
|
||||
"label": "功耗范围(W)",
|
||||
"type": "text",
|
||||
"description": "功耗范围",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -511,98 +553,112 @@
|
||||
"label": "名称",
|
||||
"type": "text",
|
||||
"description": "CPU名称",
|
||||
"required": true
|
||||
"required": true,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "manufacturer",
|
||||
"label": "厂商",
|
||||
"type": "text",
|
||||
"description": "制造商",
|
||||
"required": true
|
||||
"required": true,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "architecture",
|
||||
"label": "架构",
|
||||
"type": "text",
|
||||
"description": "CPU架构,如Zen 4",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "cores",
|
||||
"label": "核心数",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "物理核心数",
|
||||
"required": true
|
||||
"required": true,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "threads",
|
||||
"label": "线程数",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "逻辑线程数",
|
||||
"required": true
|
||||
"required": true,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "base_clock_ghz",
|
||||
"label": "基础频率(GHz)",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "基础频率",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "boost_clock_ghz",
|
||||
"label": "加速频率(GHz)",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "加速频率",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "l3_cache_mb",
|
||||
"label": "L3缓存(MB)",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "三级缓存大小",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "tdp_watts",
|
||||
"label": "TDP功耗(W)",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "热设计功耗",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "price_usd",
|
||||
"label": "价格($)",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "参考价格(美元)",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "currency",
|
||||
"label": "币种",
|
||||
"type": "text",
|
||||
"description": "价格币种",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "release_year",
|
||||
"label": "发布年份",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "发布年份",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "description",
|
||||
"label": "描述",
|
||||
"type": "text",
|
||||
"description": "CPU简介",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "long"
|
||||
},
|
||||
{
|
||||
"key": "publish_date",
|
||||
"label": "发布日期",
|
||||
"type": "text",
|
||||
"description": "产品发布日期,格式 YYYY-MM-DD",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -656,70 +712,80 @@
|
||||
"key": "name",
|
||||
"label": "名称",
|
||||
"required": true,
|
||||
"type": "text"
|
||||
"type": "text",
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"description": "手机品牌",
|
||||
"key": "brand",
|
||||
"label": "品牌",
|
||||
"required": true,
|
||||
"type": "text"
|
||||
"type": "text",
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"description": "CPU型号",
|
||||
"key": "processor",
|
||||
"label": "处理器",
|
||||
"required": false,
|
||||
"type": "text"
|
||||
"type": "text",
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"description": "RAM容量",
|
||||
"key": "ram_gb",
|
||||
"label": "内存(GB)",
|
||||
"required": false,
|
||||
"type": "number"
|
||||
"type": "text",
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"description": "存储容量",
|
||||
"key": "storage_gb",
|
||||
"label": "存储(GB)",
|
||||
"required": false,
|
||||
"type": "number"
|
||||
"type": "text",
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"description": "屏幕尺寸(英寸)",
|
||||
"key": "screen_size",
|
||||
"label": "屏幕尺寸",
|
||||
"required": false,
|
||||
"type": "text"
|
||||
"type": "text",
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"description": "电池容量",
|
||||
"key": "battery_mah",
|
||||
"label": "电池(mAh)",
|
||||
"required": false,
|
||||
"type": "number"
|
||||
"type": "text",
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"description": "参考价格",
|
||||
"key": "price",
|
||||
"label": "价格",
|
||||
"required": false,
|
||||
"type": "number"
|
||||
"type": "text",
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"description": "产品简介",
|
||||
"key": "description",
|
||||
"label": "描述",
|
||||
"required": false,
|
||||
"type": "text"
|
||||
"type": "text",
|
||||
"input_style": "long"
|
||||
},
|
||||
{
|
||||
"description": "产品发布日期,格式 YYYY-MM-DD",
|
||||
"key": "publish_date",
|
||||
"label": "发布日期",
|
||||
"required": false,
|
||||
"type": "text"
|
||||
"type": "text",
|
||||
"input_style": "normal"
|
||||
}
|
||||
],
|
||||
"updated_at": "2026-04-28 18:28:01"
|
||||
@@ -773,84 +839,96 @@
|
||||
"label": "名称",
|
||||
"type": "text",
|
||||
"description": "电脑型号",
|
||||
"required": true
|
||||
"required": true,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "brand",
|
||||
"label": "品牌",
|
||||
"type": "text",
|
||||
"description": "品牌",
|
||||
"required": true
|
||||
"required": true,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "processor",
|
||||
"label": "处理器",
|
||||
"type": "text",
|
||||
"description": "CPU型号",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "gpu",
|
||||
"label": "显卡",
|
||||
"type": "text",
|
||||
"description": "GPU型号",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "ram_gb",
|
||||
"label": "内存(GB)",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "RAM容量",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "storage_gb",
|
||||
"label": "存储(GB)",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "存储容量",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "screen_size",
|
||||
"label": "屏幕尺寸",
|
||||
"type": "text",
|
||||
"description": "屏幕尺寸",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "weight_kg",
|
||||
"label": "重量(kg)",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "重量",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "price",
|
||||
"label": "价格",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "参考价格",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "year",
|
||||
"label": "年份",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "发布年份",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "description",
|
||||
"label": "描述",
|
||||
"type": "text",
|
||||
"description": "产品简介",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "long"
|
||||
},
|
||||
{
|
||||
"key": "publish_date",
|
||||
"label": "发布日期",
|
||||
"type": "text",
|
||||
"description": "产品发布日期,格式 YYYY-MM-DD",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -900,49 +978,56 @@
|
||||
"label": "名称",
|
||||
"type": "text",
|
||||
"description": "车型名称",
|
||||
"required": true
|
||||
"required": true,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "brand",
|
||||
"label": "品牌",
|
||||
"type": "text",
|
||||
"description": "汽车品牌",
|
||||
"required": true
|
||||
"required": true,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "price",
|
||||
"label": "价格(万)",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "参考价格(万元)",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "year",
|
||||
"label": "年份",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "生产年份",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "specs",
|
||||
"label": "参数",
|
||||
"type": "json",
|
||||
"type": "text",
|
||||
"description": "详细规格参数",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "long"
|
||||
},
|
||||
{
|
||||
"key": "description",
|
||||
"label": "描述",
|
||||
"type": "text",
|
||||
"description": "车型简介",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "long"
|
||||
},
|
||||
{
|
||||
"key": "publish_date",
|
||||
"label": "发布日期",
|
||||
"type": "text",
|
||||
"description": "产品发布日期,格式 YYYY-MM-DD",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1005,70 +1090,80 @@
|
||||
"label": "名称",
|
||||
"type": "text",
|
||||
"description": "产品名称",
|
||||
"required": true
|
||||
"required": true,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "brand",
|
||||
"label": "品牌",
|
||||
"type": "text",
|
||||
"description": "品牌",
|
||||
"required": true
|
||||
"required": true,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "sensor",
|
||||
"label": "传感器",
|
||||
"type": "text",
|
||||
"description": "传感器类型/尺寸",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "megapixels",
|
||||
"label": "像素",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "有效像素(MP)",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "video_resolution",
|
||||
"label": "视频分辨率",
|
||||
"type": "text",
|
||||
"description": "最高视频分辨率",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "lens_mount",
|
||||
"label": "镜头卡口",
|
||||
"type": "text",
|
||||
"description": "镜头卡口类型",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "price",
|
||||
"label": "价格",
|
||||
"type": "number",
|
||||
"type": "text",
|
||||
"description": "参考价格",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
},
|
||||
{
|
||||
"key": "specs",
|
||||
"label": "参数",
|
||||
"type": "json",
|
||||
"type": "text",
|
||||
"description": "详细规格参数",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "long"
|
||||
},
|
||||
{
|
||||
"key": "description",
|
||||
"label": "描述",
|
||||
"type": "text",
|
||||
"description": "产品简介",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "long"
|
||||
},
|
||||
{
|
||||
"key": "publish_date",
|
||||
"label": "发布日期",
|
||||
"type": "text",
|
||||
"description": "产品发布日期,格式 YYYY-MM-DD",
|
||||
"required": false
|
||||
"required": false,
|
||||
"input_style": "normal"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -54,49 +54,30 @@
|
||||
"name": "EOS R7",
|
||||
"brand": "佳能 (Canon)",
|
||||
"year": 2022,
|
||||
"specs": {
|
||||
"品牌": "佳能 (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",
|
||||
"适用对象": "入门级",
|
||||
"类型": "机身"
|
||||
},
|
||||
"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}",
|
||||
"description": "入门级机身",
|
||||
"id": "c8c3f124b2ce",
|
||||
"category_id": "71fa2b4d818f",
|
||||
"created_at": "2026-04-28 16:38:03",
|
||||
"visible": true,
|
||||
"raw_text": "",
|
||||
"images": [
|
||||
"/static/uploads/9703a1d16424_1777365365.png"
|
||||
],
|
||||
"publish_date": "2022-01-01",
|
||||
"images": [],
|
||||
"publish_date": "2022-06-01",
|
||||
"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"
|
||||
}
|
||||
]
|
||||
3109
logs/app.log
3109
logs/app.log
File diff suppressed because it is too large
Load Diff
BIN
static/uploads/deca243eff98_1777390343.png
Normal file
BIN
static/uploads/deca243eff98_1777390343.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 52 KiB |
@@ -1904,7 +1904,7 @@
|
||||
if (!cat) return '';
|
||||
|
||||
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;
|
||||
@@ -1922,22 +1922,14 @@
|
||||
const required = field.required ? 'required' : '';
|
||||
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 inputStyle = field.input_style || 'normal';
|
||||
|
||||
let inputHtml = '';
|
||||
if (field.type === 'boolean') {
|
||||
inputHtml = `<select name="${field.key}" class="w-full px-3 py-2 border rounded-lg" ${required}>
|
||||
<option value="true" ${value === true ? 'selected' : ''}>是</option>
|
||||
<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}>`;
|
||||
if (inputStyle === 'long') {
|
||||
// 长文本用 textarea
|
||||
inputHtml = `<textarea name="${field.key}" rows="4" class="w-full px-3 py-2 border rounded-lg" ${required}>${value}</textarea>`;
|
||||
} else {
|
||||
// 普通文本用 input
|
||||
inputHtml = `<input type="text" name="${field.key}" value="${value}" class="w-full px-3 py-2 border rounded-lg" ${required}>`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user