audit-e2w 0.0.0-stage → 1.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +152 -3
- package/cordis.patch.yml +3 -0
- package/dsh_plugins/audit-e2w/lib/engine.mjs +174 -0
- package/dsh_plugins/audit-e2w/lib/index.js +122 -0
- package/dsh_plugins/audit-e2w/lib/skill.js +42 -0
- package/excel_word/README.md +388 -0
- package/excel_word/qoder_engine.py +437 -0
- package/excel_word/requirements.txt +4 -0
- package/excel_word/wesync/__init__.py +19 -0
- package/excel_word/wesync/__main__.py +6 -0
- package/excel_word/wesync/ai/__init__.py +52 -0
- package/excel_word/wesync/ai/actions.py +369 -0
- package/excel_word/wesync/ai/client.py +340 -0
- package/excel_word/wesync/ai/config.py +291 -0
- package/excel_word/wesync/ai/docs.py +177 -0
- package/excel_word/wesync/ai/prompts.py +288 -0
- package/excel_word/wesync/ai/tasks/__init__.py +26 -0
- package/excel_word/wesync/ai/tasks/actions_task.py +97 -0
- package/excel_word/wesync/ai/tasks/combined.py +123 -0
- package/excel_word/wesync/ai/tasks/diff_note.py +61 -0
- package/excel_word/wesync/ai/tasks/headings.py +119 -0
- package/excel_word/wesync/ai/tasks/help_task.py +69 -0
- package/excel_word/wesync/ai/tasks/roles.py +128 -0
- package/excel_word/wesync/align.py +155 -0
- package/excel_word/wesync/api.py +1292 -0
- package/excel_word/wesync/backup_history.py +100 -0
- package/excel_word/wesync/changelog.py +58 -0
- package/excel_word/wesync/cli.py +191 -0
- package/excel_word/wesync/commands/__init__.py +8 -0
- package/excel_word/wesync/commands/blank_cmd.py +279 -0
- package/excel_word/wesync/commands/bookmark_cmd.py +146 -0
- package/excel_word/wesync/commands/clear_cmd.py +50 -0
- package/excel_word/wesync/commands/export_cmd.py +270 -0
- package/excel_word/wesync/commands/incremental_cmd.py +157 -0
- package/excel_word/wesync/commands/marks_cmd.py +160 -0
- package/excel_word/wesync/commands/placeholders_cmd.py +92 -0
- package/excel_word/wesync/commands/writeback_cmd.py +469 -0
- package/excel_word/wesync/config.py +97 -0
- package/excel_word/wesync/console.py +85 -0
- package/excel_word/wesync/docx_blank.py +156 -0
- package/excel_word/wesync/docx_bookmarks.py +294 -0
- package/excel_word/wesync/docx_columns.py +257 -0
- package/excel_word/wesync/docx_edit.py +77 -0
- package/excel_word/wesync/docx_grid.py +212 -0
- package/excel_word/wesync/docx_marks.py +399 -0
- package/excel_word/wesync/docx_meta.py +157 -0
- package/excel_word/wesync/docx_newtable.py +220 -0
- package/excel_word/wesync/docx_placeholders.py +200 -0
- package/excel_word/wesync/docx_rows.py +67 -0
- package/excel_word/wesync/errors.py +5 -0
- package/excel_word/wesync/excel_blocks.py +502 -0
- package/excel_word/wesync/excel_export.py +143 -0
- package/excel_word/wesync/excel_marks.py +265 -0
- package/excel_word/wesync/excel_totals.py +53 -0
- package/excel_word/wesync/fsops.py +219 -0
- package/excel_word/wesync/gui/__init__.py +53 -0
- package/excel_word/wesync/gui/__main__.py +6 -0
- package/excel_word/wesync/gui/app.py +613 -0
- package/excel_word/wesync/gui/manual.py +70 -0
- package/excel_word/wesync/gui/pages/__init__.py +80 -0
- package/excel_word/wesync/gui/pages/_page.py +211 -0
- package/excel_word/wesync/gui/pages/ai_page.py +854 -0
- package/excel_word/wesync/gui/pages/batch_page.py +456 -0
- package/excel_word/wesync/gui/pages/blank_page.py +530 -0
- package/excel_word/wesync/gui/pages/bookmark_page.py +97 -0
- package/excel_word/wesync/gui/pages/export_page.py +141 -0
- package/excel_word/wesync/gui/pages/feedback_page.py +196 -0
- package/excel_word/wesync/gui/pages/format_page.py +551 -0
- package/excel_word/wesync/gui/pages/help_page.py +158 -0
- package/excel_word/wesync/gui/pages/history_page.py +168 -0
- package/excel_word/wesync/gui/pages/marks_page.py +211 -0
- package/excel_word/wesync/gui/pages/settings_page.py +450 -0
- package/excel_word/wesync/gui/pages/writeback_page.py +473 -0
- package/excel_word/wesync/gui/resources.py +22 -0
- package/excel_word/wesync/gui/runner.py +90 -0
- package/excel_word/wesync/gui/store.py +50 -0
- package/excel_word/wesync/gui/theme.py +271 -0
- package/excel_word/wesync/gui/widgets/__init__.py +8 -0
- package/excel_word/wesync/gui/widgets/ai_config.py +362 -0
- package/excel_word/wesync/gui/widgets/cards.py +139 -0
- package/excel_word/wesync/gui/widgets/chips.py +565 -0
- package/excel_word/wesync/gui/widgets/filebar.py +58 -0
- package/excel_word/wesync/gui/widgets/logpane.py +126 -0
- package/excel_word/wesync/gui/widgets/nav.py +294 -0
- package/excel_word/wesync/gui/widgets/theme_choice.py +93 -0
- package/excel_word/wesync/report_format.py +1585 -0
- package/excel_word/wesync/settings.py +35 -0
- package/excel_word/wesync/sort_rules.py +293 -0
- package/excel_word/wesync/valuefmt.py +485 -0
- package/package.json +53 -6
- package/packaging//344/275/277/347/224/250/350/257/264/346/230/216.txt +247 -0
- package/qoder_plugins/audit-toolbox/README.md +159 -0
- package/qoder_plugins/audit-toolbox/catalog.mjs +265 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"""导出页:Word → Excel。"""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from PySide6.QtWidgets import QWidget
|
|
6
|
+
|
|
7
|
+
from ... import api
|
|
8
|
+
from ..widgets.cards import make_action_bar
|
|
9
|
+
from ..widgets.chips import ChipRow
|
|
10
|
+
from ._page import BasePage
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ExportPage(BasePage):
|
|
14
|
+
title = "创建Excel"
|
|
15
|
+
subtitle = "导出全部表格;保留已填值,默认备份。"
|
|
16
|
+
|
|
17
|
+
def build(self, body: QWidget) -> None:
|
|
18
|
+
card = self.card(body)
|
|
19
|
+
self.tip_label(card, "导出选项").setObjectName("SectionTitle")
|
|
20
|
+
self.options = ChipRow([
|
|
21
|
+
("links", "Excel 链接回 Word", True, "从工作簿跳回 Word 表格"),
|
|
22
|
+
("totals", "合计自动求和", True, "修改明细后合计自动更新"),
|
|
23
|
+
("backup", "覆盖前备份", True, "关闭则不可回滚", True),
|
|
24
|
+
])
|
|
25
|
+
self.links = self.options["links"]
|
|
26
|
+
self.totals = self.options["totals"]
|
|
27
|
+
self.backup = self.options["backup"]
|
|
28
|
+
# 「本次调整」开关放在选项上方(它控制选项的可用性),故先建它再放选项
|
|
29
|
+
self.adjustment = self.bind_defaults(card.layout(), {
|
|
30
|
+
"excel_links": self.links,
|
|
31
|
+
"totals_formula": self.totals,
|
|
32
|
+
"auto_backup": self.backup,
|
|
33
|
+
})
|
|
34
|
+
# 「本次调整」块已在上面,选项追加在它之后
|
|
35
|
+
card.layout().addWidget(self.options)
|
|
36
|
+
actions = make_action_bar(
|
|
37
|
+
card,
|
|
38
|
+
"全量导出",
|
|
39
|
+
lambda: self._start(False),
|
|
40
|
+
(
|
|
41
|
+
("仅预演", lambda: self._start(True)),
|
|
42
|
+
("增量导出", self._incremental),
|
|
43
|
+
("重新判定✓/✕", self._rejudge),
|
|
44
|
+
("清理 Word 书签", self._clear_bookmarks),
|
|
45
|
+
),
|
|
46
|
+
primary_index=1,
|
|
47
|
+
)
|
|
48
|
+
actions.setObjectName("ExportActions")
|
|
49
|
+
action_layout = actions.layout()
|
|
50
|
+
action_layout.itemAt(3).widget().setToolTip("按 Excel 当前内容重判 B 列✓/✕,只改标记")
|
|
51
|
+
action_layout.itemAt(4).widget().setToolTip("只清理本工具写入的书签,保留 Word 自带书签")
|
|
52
|
+
card.layout().addWidget(actions)
|
|
53
|
+
|
|
54
|
+
def _incremental(self) -> None:
|
|
55
|
+
if not self.ctx.require_docx():
|
|
56
|
+
return
|
|
57
|
+
docx, custom_excel = self.ctx.docx, self.ctx.excel
|
|
58
|
+
links, totals, backup = self.links.isChecked(), self.totals.isChecked(), self.backup.isChecked()
|
|
59
|
+
excel = api.workbook_path(docx, custom_excel)
|
|
60
|
+
if not excel.exists():
|
|
61
|
+
self.ctx.error("未找到工作簿", f"未找到工作簿:\n{excel}\n\n请先执行一次「全量导出」。")
|
|
62
|
+
return
|
|
63
|
+
if not self.ctx.confirm(
|
|
64
|
+
"确认增量导出",
|
|
65
|
+
f"只登记 Word 中尚未锚定的新增表格、标注与占位符:\n\nWord:{self.ctx.docx}\nExcel:{excel}\n\n"
|
|
66
|
+
"既有工作簿行、编号与公式位置不会改动;新表格按发现顺序写入「新增表格」(XT01、XT02…)。\n"
|
|
67
|
+
+ ("写盘前会自动备份,确认开始?" if self.backup.isChecked() else "本次已取消备份,确认开始?"),
|
|
68
|
+
):
|
|
69
|
+
self.ctx.log("已取消增量导出。", "muted")
|
|
70
|
+
return
|
|
71
|
+
self.ctx.run_steps(
|
|
72
|
+
[("增量导出", lambda: api.run_incremental_export(
|
|
73
|
+
docx, custom_excel,
|
|
74
|
+
with_excel_links=links,
|
|
75
|
+
totals_formula=totals,
|
|
76
|
+
backup=backup,
|
|
77
|
+
))]
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
def _rejudge(self) -> None:
|
|
81
|
+
if not self.ctx.require_docx():
|
|
82
|
+
return
|
|
83
|
+
docx, custom_excel = self.ctx.docx, self.ctx.excel
|
|
84
|
+
backup = self.backup.isChecked()
|
|
85
|
+
self.ctx.run_steps(
|
|
86
|
+
[("重新判定✓/✕", lambda: api.run_rejudge(docx, custom_excel, backup=backup))]
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
def _clear_bookmarks(self) -> None:
|
|
90
|
+
if not self.ctx.require_docx():
|
|
91
|
+
return
|
|
92
|
+
docx = self.ctx.docx
|
|
93
|
+
backup = self.backup.isChecked()
|
|
94
|
+
if not self.ctx.confirm(
|
|
95
|
+
"清理 Word 书签",
|
|
96
|
+
f"将删除 Word 里所有本工具写入的书签(CPAH_/TBL_/MRK_):\n\nWord:{self.ctx.docx}\n\n"
|
|
97
|
+
"保留 Word 自带书签(如 _Toc 目录书签)。"
|
|
98
|
+
+ ("写盘前会自动备份,确认清理?" if self.backup.isChecked() else "本次已取消备份,确认清理?"),
|
|
99
|
+
):
|
|
100
|
+
self.ctx.log("已取消清理书签。", "muted")
|
|
101
|
+
return
|
|
102
|
+
self.ctx.run_steps([("清理 Word 书签", lambda: api.run_clear_bookmarks(
|
|
103
|
+
docx, backup=backup
|
|
104
|
+
))])
|
|
105
|
+
|
|
106
|
+
def _start(self, dry_run: bool) -> None:
|
|
107
|
+
if not self.ctx.require_docx():
|
|
108
|
+
return
|
|
109
|
+
docx, custom_excel = self.ctx.docx, self.ctx.excel
|
|
110
|
+
excel = api.workbook_path(docx, custom_excel)
|
|
111
|
+
with_links = self.links.isChecked()
|
|
112
|
+
totals_formula = self.totals.isChecked()
|
|
113
|
+
backup = self.backup.isChecked()
|
|
114
|
+
if not dry_run:
|
|
115
|
+
backup_note = (
|
|
116
|
+
"原工作簿(若存在)会先备份到 _backup,确认全量导出?"
|
|
117
|
+
if backup
|
|
118
|
+
else "已取消备份:原工作簿(若存在)将被直接覆盖、不可回滚,确认全量导出?"
|
|
119
|
+
)
|
|
120
|
+
message = (
|
|
121
|
+
f"将按当前 Word 重建工作簿:\n\nWord:{docx}\nExcel:{excel}\n\n"
|
|
122
|
+
+ backup_note
|
|
123
|
+
)
|
|
124
|
+
if not self.ctx.confirm("确认导出", message):
|
|
125
|
+
self.ctx.log("已取消导出。", "muted")
|
|
126
|
+
return
|
|
127
|
+
self.ctx.run_steps(
|
|
128
|
+
[
|
|
129
|
+
(
|
|
130
|
+
"导出到 Excel(预演)" if dry_run else "导出到 Excel",
|
|
131
|
+
lambda: api.run_export(
|
|
132
|
+
docx,
|
|
133
|
+
custom_excel,
|
|
134
|
+
dry_run=dry_run,
|
|
135
|
+
with_excel_links=with_links,
|
|
136
|
+
totals_formula=totals_formula,
|
|
137
|
+
backup=backup,
|
|
138
|
+
),
|
|
139
|
+
)
|
|
140
|
+
]
|
|
141
|
+
)
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"""问题反馈页:联系邮箱、反馈草稿与功能建议。"""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from urllib.parse import urlencode
|
|
6
|
+
|
|
7
|
+
from PySide6.QtCore import QUrl, Qt
|
|
8
|
+
from PySide6.QtGui import QDesktopServices
|
|
9
|
+
from PySide6.QtWidgets import (
|
|
10
|
+
QApplication,
|
|
11
|
+
QComboBox,
|
|
12
|
+
QFrame,
|
|
13
|
+
QHBoxLayout,
|
|
14
|
+
QLabel,
|
|
15
|
+
QLineEdit,
|
|
16
|
+
QPlainTextEdit,
|
|
17
|
+
QPushButton,
|
|
18
|
+
QVBoxLayout,
|
|
19
|
+
QWidget,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
from ... import __version__
|
|
23
|
+
from ._page import BasePage
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class FeedbackPage(BasePage):
|
|
27
|
+
title = "问题反馈"
|
|
28
|
+
subtitle = "问题、建议或使用困难,都可以整理成邮件草稿后联系;仅生成草稿,不自动发送。"
|
|
29
|
+
EMAIL = "auditlg@163.com"
|
|
30
|
+
|
|
31
|
+
_PAGE_QSS = """
|
|
32
|
+
QFrame#Card { border-radius: 10px; }
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
def build(self, body: QWidget) -> None:
|
|
36
|
+
self.setStyleSheet(self._PAGE_QSS)
|
|
37
|
+
self._build_actions(body)
|
|
38
|
+
|
|
39
|
+
contact = self.card(body)
|
|
40
|
+
contact.setObjectName("ContactBanner")
|
|
41
|
+
row = QWidget()
|
|
42
|
+
layout = QHBoxLayout(row)
|
|
43
|
+
layout.setContentsMargins(0, 0, 0, 0)
|
|
44
|
+
layout.setSpacing(18)
|
|
45
|
+
email_box = QWidget()
|
|
46
|
+
email_layout = QVBoxLayout(email_box)
|
|
47
|
+
email_layout.setContentsMargins(0, 0, 0, 0)
|
|
48
|
+
email_layout.setSpacing(2)
|
|
49
|
+
email_layout.addWidget(QLabel("联系邮箱"))
|
|
50
|
+
email = QLabel(self.EMAIL)
|
|
51
|
+
email.setObjectName("ContactEmail")
|
|
52
|
+
email_layout.addWidget(email)
|
|
53
|
+
layout.addWidget(email_box, 1)
|
|
54
|
+
hint = QLabel("建议附上软件版本、文件类型和问题截图")
|
|
55
|
+
hint.setObjectName("ContactTag")
|
|
56
|
+
hint.setAlignment(Qt.AlignCenter)
|
|
57
|
+
hint.setWordWrap(True)
|
|
58
|
+
layout.addWidget(hint, 1)
|
|
59
|
+
contact.layout().addWidget(row)
|
|
60
|
+
|
|
61
|
+
self._build_donation_card(body)
|
|
62
|
+
self._build_feedback_card(body)
|
|
63
|
+
self._build_suggestion_card(body)
|
|
64
|
+
|
|
65
|
+
def _build_actions(self, body: QWidget) -> None:
|
|
66
|
+
row = QWidget()
|
|
67
|
+
layout = QHBoxLayout(row)
|
|
68
|
+
layout.setContentsMargins(0, 0, 0, 0)
|
|
69
|
+
layout.setSpacing(10)
|
|
70
|
+
layout.addStretch(1)
|
|
71
|
+
copy = QPushButton("复制邮箱")
|
|
72
|
+
copy.clicked.connect(lambda _checked=False: self._copy_email())
|
|
73
|
+
layout.addWidget(copy)
|
|
74
|
+
write = QPushButton("写邮件")
|
|
75
|
+
write.setObjectName("Primary")
|
|
76
|
+
write.clicked.connect(lambda _checked=False: self._write_email())
|
|
77
|
+
layout.addWidget(write)
|
|
78
|
+
body.layout().insertWidget(body.layout().count() - 1, row)
|
|
79
|
+
|
|
80
|
+
@staticmethod
|
|
81
|
+
def _card_title(card: QWidget, step: str, title: str) -> None:
|
|
82
|
+
heading = QLabel(f"{step} {title}")
|
|
83
|
+
heading.setObjectName("SectionTitle")
|
|
84
|
+
card.layout().addWidget(heading)
|
|
85
|
+
|
|
86
|
+
def _field_label(self, card: QWidget, text: str) -> None:
|
|
87
|
+
label = QLabel(text)
|
|
88
|
+
label.setObjectName("CardDesc")
|
|
89
|
+
card.layout().addWidget(label)
|
|
90
|
+
|
|
91
|
+
def _build_donation_card(self, body: QWidget) -> None:
|
|
92
|
+
card = self.card(body)
|
|
93
|
+
self._card_title(card, "1", "打赏支持")
|
|
94
|
+
self.tip_label(card, "如果工具帮到了你,可自愿打赏;不影响使用。")
|
|
95
|
+
placeholder = QFrame()
|
|
96
|
+
placeholder.setObjectName("DonationPlaceholder")
|
|
97
|
+
placeholder.setMinimumHeight(150)
|
|
98
|
+
layout = QVBoxLayout(placeholder)
|
|
99
|
+
layout.setAlignment(Qt.AlignCenter)
|
|
100
|
+
layout.setSpacing(5)
|
|
101
|
+
title = QLabel("打赏码预留位置")
|
|
102
|
+
title.setAlignment(Qt.AlignCenter)
|
|
103
|
+
title.setStyleSheet("font-size: 14px; font-weight: 600;")
|
|
104
|
+
layout.addWidget(title)
|
|
105
|
+
note = QLabel("后续放入真实收款码\n当前仅展示,不收款")
|
|
106
|
+
note.setAlignment(Qt.AlignCenter)
|
|
107
|
+
note.setWordWrap(True)
|
|
108
|
+
layout.addWidget(note)
|
|
109
|
+
card.layout().addWidget(placeholder)
|
|
110
|
+
|
|
111
|
+
def _build_feedback_card(self, body: QWidget) -> None:
|
|
112
|
+
card = self.card(body)
|
|
113
|
+
self._card_title(card, "2", "问题反馈")
|
|
114
|
+
|
|
115
|
+
self._field_label(card, "问题类型")
|
|
116
|
+
self.type_combo = QComboBox()
|
|
117
|
+
self.type_combo.setMaximumWidth(360)
|
|
118
|
+
for item in ("请选择问题类型", "导出", "同步", "标注与占位", "格式调整", "备份与回滚", "其他"):
|
|
119
|
+
self.type_combo.addItem(item)
|
|
120
|
+
card.layout().addWidget(self.type_combo)
|
|
121
|
+
|
|
122
|
+
self._field_label(card, "软件版本")
|
|
123
|
+
self.version_edit = QLineEdit(f"v{__version__}")
|
|
124
|
+
self.version_edit.setMaximumWidth(180)
|
|
125
|
+
card.layout().addWidget(self.version_edit)
|
|
126
|
+
|
|
127
|
+
self._field_label(card, "文件类型")
|
|
128
|
+
self.file_type_edit = QLineEdit()
|
|
129
|
+
self.file_type_edit.setMaximumWidth(360)
|
|
130
|
+
self.file_type_edit.setPlaceholderText("例如:Word + Excel")
|
|
131
|
+
card.layout().addWidget(self.file_type_edit)
|
|
132
|
+
|
|
133
|
+
self._field_label(card, "问题描述")
|
|
134
|
+
self.description_edit = QPlainTextEdit()
|
|
135
|
+
self.description_edit.setPlaceholderText("请说明做了什么、期望结果和实际结果;如需附截图,请在邮件客户端中添加。")
|
|
136
|
+
self.description_edit.setMinimumHeight(110)
|
|
137
|
+
card.layout().addWidget(self.description_edit)
|
|
138
|
+
|
|
139
|
+
def _build_suggestion_card(self, body: QWidget) -> None:
|
|
140
|
+
card = self.card(body)
|
|
141
|
+
self._card_title(card, "3", "功能建议")
|
|
142
|
+
self._field_label(card, "希望增加或改进什么")
|
|
143
|
+
self.suggestion_edit = QPlainTextEdit()
|
|
144
|
+
self.suggestion_edit.setPlaceholderText("欢迎描述你的使用场景和期望效果。")
|
|
145
|
+
self.suggestion_edit.setMinimumHeight(110)
|
|
146
|
+
card.layout().addWidget(self.suggestion_edit)
|
|
147
|
+
compose = QPushButton("整理成邮件")
|
|
148
|
+
compose.setObjectName("Primary")
|
|
149
|
+
compose.clicked.connect(lambda _checked=False: self._compose_mail())
|
|
150
|
+
card.layout().addWidget(compose)
|
|
151
|
+
|
|
152
|
+
def _copy_email(self) -> None:
|
|
153
|
+
QApplication.clipboard().setText(self.EMAIL)
|
|
154
|
+
self.ctx.info("已复制邮箱", f"联系邮箱 {self.EMAIL} 已复制到剪贴板。")
|
|
155
|
+
|
|
156
|
+
def _open_mail(self, url: QUrl, fallback_text: str) -> None:
|
|
157
|
+
if QDesktopServices.openUrl(url):
|
|
158
|
+
return
|
|
159
|
+
QApplication.clipboard().setText(fallback_text)
|
|
160
|
+
self.ctx.info("邮件草稿已复制", "未能打开系统邮件客户端,已将邮件内容或邮箱地址复制到剪贴板。")
|
|
161
|
+
|
|
162
|
+
def _write_email(self) -> None:
|
|
163
|
+
self._open_mail(QUrl(f"mailto:{self.EMAIL}"), self.EMAIL)
|
|
164
|
+
|
|
165
|
+
def _compose_mail(self) -> None:
|
|
166
|
+
description = self.description_edit.toPlainText().strip()
|
|
167
|
+
suggestion = self.suggestion_edit.toPlainText().strip()
|
|
168
|
+
if not description and not suggestion:
|
|
169
|
+
self.ctx.info("尚未填写内容", "请先填写问题描述或功能建议,再整理成邮件。")
|
|
170
|
+
return
|
|
171
|
+
|
|
172
|
+
problem_type = self.type_combo.currentText()
|
|
173
|
+
if problem_type == "请选择问题类型":
|
|
174
|
+
problem_type = "未选择"
|
|
175
|
+
version = self.version_edit.text().strip() or "未填写"
|
|
176
|
+
file_type = self.file_type_edit.text().strip() or "未填写"
|
|
177
|
+
if description and suggestion:
|
|
178
|
+
subject_kind = "问题反馈与功能建议"
|
|
179
|
+
elif description:
|
|
180
|
+
subject_kind = "问题反馈"
|
|
181
|
+
else:
|
|
182
|
+
subject_kind = "功能建议"
|
|
183
|
+
subject = f"[审计工具箱] {subject_kind}"
|
|
184
|
+
body = (
|
|
185
|
+
"审计工具箱反馈邮件草稿\n"
|
|
186
|
+
"\n【问题反馈】\n"
|
|
187
|
+
f"问题类型:{problem_type}\n"
|
|
188
|
+
f"软件版本:{version}\n"
|
|
189
|
+
f"文件类型:{file_type}\n"
|
|
190
|
+
f"问题描述:\n{description or '(未填写)'}\n"
|
|
191
|
+
"\n【功能建议】\n"
|
|
192
|
+
f"{suggestion or '(未填写)'}\n"
|
|
193
|
+
"\n说明:本邮件由审计工具箱“问题反馈”页面整理,尚未发送。\n"
|
|
194
|
+
)
|
|
195
|
+
query = urlencode({"subject": subject, "body": body})
|
|
196
|
+
self._open_mail(QUrl(f"mailto:{self.EMAIL}?{query}"), f"收件人:{self.EMAIL}\n主题:{subject}\n\n{body}")
|