From aa6ee88d7bd84640843289ad482d2451c5df586e Mon Sep 17 00:00:00 2001 From: YukiChiyoda Date: Mon, 15 Jan 2024 21:58:12 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=82=20=E5=89=8D=E7=AB=AF=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=EF=BC=9A=E9=87=8D=E5=BB=BAHTML=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/DataBase/exporter_html.py | 10 +- app/resources/data/template.html | 2308 ++++++++++++++++----------- app/web_ui/templates/christmas.html | 2 +- app/web_ui/templates/home.html | 2 +- app/web_ui/templates/index.html | 2 +- app/web_ui/templates/wordcloud.html | 2 +- 6 files changed, 1417 insertions(+), 909 deletions(-) diff --git a/app/DataBase/exporter_html.py b/app/DataBase/exporter_html.py index 83c6a482..a6572462 100644 --- a/app/DataBase/exporter_html.py +++ b/app/DataBase/exporter_html.py @@ -16,19 +16,17 @@ from app.util.image import get_image_path, get_image from app.util.music import get_music_path - icon_files = { './icon/word.png': ['doc', 'docx'], './icon/excel.png': ['xls', 'xlsx'], './icon/csv.png': ['csv'], './icon/txt.png': ['txt'], - './icon/zip.png': ['zip', '7z','rar'], + './icon/zip.png': ['zip', '7z', 'rar'], './icon/ppt.png': ['ppt', 'pptx'], './icon/pdf.png': ['pdf'], } - class HtmlExporter(ExporterBase): def text(self, doc, message): type_ = message[2] @@ -287,7 +285,9 @@ def export(self): content = f.read() html_head, html_end = content.split('/*注意看这是分割线*/') f = open(filename, 'w', encoding='utf-8') - f.write(html_head.replace("Chat Records", f"{self.contact.remark}")) + html_head = html_head.replace("出错了", f"{self.contact.remark}") + html_head = html_head.replace("

出错了

", f"

{self.contact.remark}

") + f.write(html_head) self.rangeSignal.emit(len(messages)) for index, message in enumerate(messages): type_ = message[2] @@ -333,7 +333,7 @@ def count_finish_num(self, num): @return: """ self.num += 1 - print('子线程完成',self.num,'/',self.total_num) + print('子线程完成', self.num, '/', self.total_num) if self.num == self.total_num: # 所有子线程都完成之后就发送完成信号 self.okSignal.emit(1) diff --git a/app/resources/data/template.html b/app/resources/data/template.html index 932da6cf..0017aeb3 100644 --- a/app/resources/data/template.html +++ b/app/resources/data/template.html @@ -1,484 +1,492 @@ - - - - - Chat Records - - - -
-
-
- - -
-
- - -
-
-
-
+ +@media screen and (max-width: 768px) { + body { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + } + + ::-webkit-scrollbar { + display: none; + } + + .page { + width: 100%; + height: 100%; + box-shadow: none; + } + + .page .side-bar, .page .mid-bar { + display: none + } + + .page .main-body .nav-bar { + height: 120px; + } + + .page .main-body .nav-bar .turner-bar { + transform: none; + font-size: 12px; + } + + .page .main-body .nav-bar .turner-bar input { + font-size: 14px; + } + + .page .main-body .nav-bar .turner-bar .button { + padding: 10px 12px 10px 12px; + } +} + + 出错了 + + +
+ +
+
+

出错了

- 昨天 12:35 + 8:16
- 当你看到这条消息的时候说明程序出问题了 + 错误提示
-
您好,由于程序出现了bug导致不能显示聊天记录。您可以逐个选择导出的消息类型,来判断是哪种消息类型导致的错误。
请关注微信公众号,回复:联系方式
添加QQ群寻求帮助
+
很抱歉,由于程序出现未知错误,您的聊天记录未能成功展示。
您可以关注下方微信公众号,回复:联系方式,获取QQ交流群群号,并在群内寻求帮助。 +
- +
- +
-
非常感谢
+
好的
- +
-
-
- -
-
不客气
-
-
- 昨天 13:15 -
-
- +
+ + - - + +} + + diff --git a/app/web_ui/templates/christmas.html b/app/web_ui/templates/christmas.html index 2f1a718d..1bcb7942 100644 --- a/app/web_ui/templates/christmas.html +++ b/app/web_ui/templates/christmas.html @@ -1,5 +1,5 @@ - + diff --git a/app/web_ui/templates/home.html b/app/web_ui/templates/home.html index 991acdf0..4a43eb1e 100644 --- a/app/web_ui/templates/home.html +++ b/app/web_ui/templates/home.html @@ -1,6 +1,6 @@ - + diff --git a/app/web_ui/templates/index.html b/app/web_ui/templates/index.html index 4507f9d7..0f35d499 100644 --- a/app/web_ui/templates/index.html +++ b/app/web_ui/templates/index.html @@ -1,5 +1,5 @@ - + diff --git a/app/web_ui/templates/wordcloud.html b/app/web_ui/templates/wordcloud.html index 79f9f45c..294de464 100644 --- a/app/web_ui/templates/wordcloud.html +++ b/app/web_ui/templates/wordcloud.html @@ -1,6 +1,6 @@ - +