From 5cf36c8ad48bfd0550b478743d631ba53ec12509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E6=A3=AE?= Date: Tue, 11 Jan 2022 14:15:26 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=8A=A5=E5=91=8A=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=B5=81=E7=A8=8Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Report/PdfReport.py | 2 -- Report/scripts/contents.py | 10 ++++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Report/PdfReport.py b/Report/PdfReport.py index 28d2f5f..5cbd524 100644 --- a/Report/PdfReport.py +++ b/Report/PdfReport.py @@ -83,8 +83,6 @@ class ReportGenerator: def __init__(self, **kwargs): # 文本数据 self.text_model = kwargs['text_model'] - # from static.test.test_data import demo - # self.model = demo # 调用模板,在临时报告文件夹中创建指定名称的PDF文档 self.doc = MyDocTemplate(gen_pdf_path(name=kwargs['name'])) # 内容框 diff --git a/Report/scripts/contents.py b/Report/scripts/contents.py index 2f35d5d..16d1e89 100644 --- a/Report/scripts/contents.py +++ b/Report/scripts/contents.py @@ -52,12 +52,10 @@ def handle_manufacturing_content(param1, param2): elif section == '资质荣誉': # 如果资质荣誉无数据只显示第三段,有数据则删除第三段 if len(report_data[num][p_value][section]) == 1: - del report_content[num]['章节内容'][c_num]['小节内容'][0] - del report_content[num]['章节内容'][c_num]['小节内容'][1] - del report_content[num]['章节内容'][c_num]['小节内容'][2] - del report_content[num]['章节内容'][c_num]['小节内容'][3] - del report_content[num]['章节内容'][c_num]['小节内容'][4] - del report_content[num]['章节内容'][c_num]['小节内容'][5] + report_content[num]['章节内容'][c_num]['小节内容'] = list() + insert_dict = dict() + insert_dict['段落'] = '经查询,公司无技术、产品品质或品牌等方面的荣誉资质。' + report_content[num]['章节内容'][c_num]['小节内容'].append(insert_dict) else: # 第一段数据 p_0 = report_content[num]['章节内容'][c_num]['小节内容'][0]['段落']