From aa6b1dec3f1f1cdbd13766dad6c64845fa6e5ce0 Mon Sep 17 00:00:00 2001 From: Viajero <2737079298@qq.com> Date: Tue, 14 Oct 2025 15:35:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E2=80=9C=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 2 +- templates/edited.html | 256 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 257 insertions(+), 1 deletion(-) create mode 100644 templates/edited.html diff --git a/app.py b/app.py index 19fd0d6..e40026c 100644 --- a/app.py +++ b/app.py @@ -295,7 +295,7 @@ def edit_entry(doc_id): # 保持原始数据格式,不进行JSON转换 # 直接传递包含data字段的原始文档 - return render_template('edit.html', document=document) + return render_template('edited.html', document=document) # 更新数据路由 @app.route('/update/', methods=['POST']) diff --git a/templates/edited.html b/templates/edited.html new file mode 100644 index 0000000..8125021 --- /dev/null +++ b/templates/edited.html @@ -0,0 +1,256 @@ +{% extends "base.html" %} + +{% block title %}编辑成果信息 - 紫金·稷下薪火·云枢智海师生成果共创系统{% endblock %} + +{% block content %} + + +
+

编辑成果信息

+ +
+
+ {% if document.data %} + {# 从原始数据中解析字段 #} + {% set data_string = document.data %} + {% set pairs = data_string.split('|###|') %} + + {% for pair in pairs %} + {% if ':' in pair %} + {% set key_value = pair.split(':', 1) %} + {% set field_key = key_value[0].strip() %} + {% set field_value = key_value[1].strip() %} + + {# 处理列表格式 [item1|##|item2] #} + {% if field_value.startswith('[') and field_value.endswith(']') %} + {% set list_content = field_value[1:-1] %} + {% set field_value = list_content.split('|##|')|join(', ') %} + {% endif %} + +
+ + + +
+ {% endif %} + {% endfor %} + {% else %} + {# 如果没有data字段,显示提示信息 #} +
+

该记录没有可编辑的数据

+
+ {% endif %} + + {% if document.image %} +
+ +
+ 原图片 +
+
当前关联的图片,编辑时无法修改图片
+
+ {% endif %} + +
+ + 取消返回 + +
+
+
+
+ + +{% endblock %} \ No newline at end of file