帮助页面修改
This commit is contained in:
parent
5718503f26
commit
d891b4f583
|
|
@ -0,0 +1,164 @@
|
||||||
|
# 使用帮助
|
||||||
|
|
||||||
|
## 概述
|
||||||
|
|
||||||
|
欢迎使用 UFT30 Change Code 工具!这是一款强大的编码转换工具,支持批量转码和非LS格式转换。
|
||||||
|
|
||||||
|
### 功能导航
|
||||||
|
|
||||||
|
```
|
||||||
|
UFT30 Change Code
|
||||||
|
├── 📁 功能转码
|
||||||
|
│ └── 业务转码
|
||||||
|
├── 📁 功能查询
|
||||||
|
│ ├── UF20功能查询
|
||||||
|
│ └── UFT3功能查询
|
||||||
|
├── 元数据更新
|
||||||
|
├── 设置
|
||||||
|
├── 关于
|
||||||
|
└── 使用技巧
|
||||||
|
```
|
||||||
|
|
||||||
|
点击左侧导航栏的功能项,查看详细的使用说明。
|
||||||
|
|
||||||
|
## 功能转码
|
||||||
|
|
||||||
|
### 业务转码
|
||||||
|
|
||||||
|
将UF20函数转换为UFT3函数格式的核心功能。
|
||||||
|
|
||||||
|
#### 功能列表管理
|
||||||
|
|
||||||
|
- 点击"添加"按钮,输入函数名添加到转码列表
|
||||||
|
- 双击表格行可编辑函数名
|
||||||
|
- 选中行后点击"删除"移除函数
|
||||||
|
- 点击"清空"清空所有函数
|
||||||
|
|
||||||
|
#### 配置文件同步
|
||||||
|
|
||||||
|
- 自动读取 uf2touft3/cust.json 配置
|
||||||
|
- 配置文件外部修改时自动刷新列表
|
||||||
|
|
||||||
|
#### 转换操作
|
||||||
|
|
||||||
|
- 点击"开始转换"启动转换任务
|
||||||
|
- 转换过程中可查看进度条和状态信息
|
||||||
|
- 点击"停止转换"中止当前任务
|
||||||
|
|
||||||
|
## 功能查询
|
||||||
|
|
||||||
|
### UF20功能查询
|
||||||
|
|
||||||
|
查询UF20系统中的函数信息。
|
||||||
|
|
||||||
|
#### 查询条件
|
||||||
|
|
||||||
|
- 从下拉框选择查询字段:功能名称、英文名称、功能编号
|
||||||
|
- 输入框输入查询关键词
|
||||||
|
- 点击"Aa"切换精确/模糊匹配模式
|
||||||
|
- 点击放大镜图标或按回车执行查询
|
||||||
|
|
||||||
|
#### 结果操作
|
||||||
|
|
||||||
|
- 双击查询结果可直接添加到转码列表
|
||||||
|
- 结果表格显示:功能名称、英文名称、功能编号
|
||||||
|
|
||||||
|
### UFT3功能查询
|
||||||
|
|
||||||
|
查询UFT3系统中的函数信息。
|
||||||
|
|
||||||
|
#### 查询条件
|
||||||
|
|
||||||
|
- 从下拉框选择查询字段:功能名称、英文名称、功能编号
|
||||||
|
- 输入框输入查询关键词
|
||||||
|
- 点击"Aa"切换精确/模糊匹配模式
|
||||||
|
- 点击放大镜图标或按回车执行查询
|
||||||
|
|
||||||
|
#### 结果显示
|
||||||
|
|
||||||
|
- 结果表格显示:功能名称、英文名称、功能编号
|
||||||
|
|
||||||
|
## 元数据更新
|
||||||
|
|
||||||
|
更新UF20和UFT3系统的元数据配置。
|
||||||
|
|
||||||
|
### UF20配置更新
|
||||||
|
|
||||||
|
- 勾选需要更新的UF20接口项
|
||||||
|
- 点击"全选"选中所有UF20项
|
||||||
|
- 点击"取消"清除UF20选择
|
||||||
|
- 点击"更新UF20"执行更新
|
||||||
|
|
||||||
|
### UFT3配置更新
|
||||||
|
|
||||||
|
- 勾选需要更新的UFT3接口项
|
||||||
|
- 点击"全选"选中所有UFT3项
|
||||||
|
- 点击"取消"清除UFT3选择
|
||||||
|
- 点击"更新UFT3"执行更新
|
||||||
|
|
||||||
|
### 更新内容
|
||||||
|
|
||||||
|
- UF20: 接口、标准字段、数据类型、错误编号
|
||||||
|
- UFT3: 接口、标准字段、数据类型、表结构
|
||||||
|
|
||||||
|
## 设置
|
||||||
|
|
||||||
|
配置工具的运行参数和选项。
|
||||||
|
|
||||||
|
### 路径配置
|
||||||
|
|
||||||
|
- 设置Python脚本路径
|
||||||
|
- 配置转换工具路径
|
||||||
|
- 设置配置文件目录
|
||||||
|
|
||||||
|
### 显示设置
|
||||||
|
|
||||||
|
- 调整界面主题
|
||||||
|
- 设置字体大小
|
||||||
|
- 配置语言选项
|
||||||
|
|
||||||
|
### 高级设置
|
||||||
|
|
||||||
|
- 设置自动保存间隔
|
||||||
|
- 配置日志级别
|
||||||
|
- 设置最大并发任务数
|
||||||
|
|
||||||
|
## 关于
|
||||||
|
|
||||||
|
### UFT30 Change Code
|
||||||
|
|
||||||
|
一款强大的编码转换工具,支持批量转码和非LS格式转换。
|
||||||
|
|
||||||
|
#### 基本信息
|
||||||
|
|
||||||
|
- **版本**: 1.0.0
|
||||||
|
- **作者**: UFT30 Team
|
||||||
|
- **版权**: Copyright © 2024
|
||||||
|
- **联系方式**: support@uft30.com
|
||||||
|
|
||||||
|
#### 功能特性
|
||||||
|
|
||||||
|
- 支持UF20到UFT3函数格式转换
|
||||||
|
- 批量转换处理
|
||||||
|
- 非LS格式转换支持
|
||||||
|
- 功能查询与快速添加
|
||||||
|
- 元数据自动更新
|
||||||
|
|
||||||
|
## 使用技巧
|
||||||
|
|
||||||
|
### 高效使用技巧
|
||||||
|
|
||||||
|
- 在功能查询中找到需要转换的函数,双击可快速添加到转码列表
|
||||||
|
- 精确匹配适合已知完整函数名的查询
|
||||||
|
- 模糊匹配可以使用部分关键词查找
|
||||||
|
- 配置文件可以手动编辑,工具会自动检测变化
|
||||||
|
- 批量转换前建议先进行元数据更新
|
||||||
|
- 使用Ctrl+F快速搜索帮助内容
|
||||||
|
|
||||||
|
### 注意事项
|
||||||
|
|
||||||
|
- 首次使用前请先执行"元数据更新"加载最新配置
|
||||||
|
- 转换前建议备份重要文件
|
||||||
|
- 确保 uf2touft3/uf2touft3.exe 存在且可执行
|
||||||
|
- 配置文件 uf2touft3/cust.json 会自动同步转码列表
|
||||||
|
- 大文件转换可能需要较长时间,请耐心等待
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
# 💡 使用技巧
|
||||||
|
|
||||||
|
## 高效使用技巧
|
||||||
|
|
||||||
|
- 在功能查询中找到需要转换的函数,双击可快速添加到转码列表
|
||||||
|
- 精确匹配适合已知完整函数名的查询
|
||||||
|
- 模糊匹配可以使用部分关键词查找
|
||||||
|
- 配置文件可以手动编辑,工具会自动检测变化
|
||||||
|
- 批量转换前建议先进行元数据更新
|
||||||
|
- 使用Ctrl+F快速搜索帮助内容
|
||||||
|
|
||||||
|
## 注意事项
|
||||||
|
|
||||||
|
- 首次使用前请先执行"元数据更新"加载最新配置
|
||||||
|
- 转换前建议备份重要文件
|
||||||
|
- 确保 uf2touft3/uf2touft3.exe 存在且可执行
|
||||||
|
- 配置文件 uf2touft3/cust.json 会自动同步转码列表
|
||||||
|
- 大文件转换可能需要较长时间,请耐心等待
|
||||||
|
|
@ -1,7 +1,15 @@
|
||||||
#include "helppage.h"
|
#include "helppage.h"
|
||||||
|
#include <QHBoxLayout>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QTextEdit>
|
#include <QTextBrowser>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QTextStream>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QRegularExpression>
|
||||||
|
#include <QStandardItemModel>
|
||||||
|
#include <QModelIndex>
|
||||||
|
#include "ElaTreeView.h"
|
||||||
|
|
||||||
HelpPage::HelpPage(QWidget *parent)
|
HelpPage::HelpPage(QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
|
|
@ -15,48 +23,193 @@ HelpPage::~HelpPage()
|
||||||
|
|
||||||
void HelpPage::initUI()
|
void HelpPage::initUI()
|
||||||
{
|
{
|
||||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
QHBoxLayout *mainLayout = new QHBoxLayout(this);
|
||||||
|
mainLayout->setContentsMargins(10, 10, 10, 10);
|
||||||
|
mainLayout->setSpacing(10);
|
||||||
|
|
||||||
|
initTreeView();
|
||||||
|
initContentPages();
|
||||||
|
|
||||||
|
mainLayout->addWidget(m_treeView);
|
||||||
|
mainLayout->addWidget(m_stackedWidget);
|
||||||
|
}
|
||||||
|
|
||||||
|
void HelpPage::initTreeView()
|
||||||
|
{
|
||||||
|
m_treeView = new ElaTreeView;
|
||||||
|
m_treeView->setFixedWidth(200);
|
||||||
|
|
||||||
|
QStandardItemModel *model = new QStandardItemModel(this);
|
||||||
|
model->setHorizontalHeaderLabels(QStringList() << "功能导航");
|
||||||
|
|
||||||
|
QStandardItem *overviewItem = new QStandardItem("📋 概述");
|
||||||
|
overviewItem->setData("概述", Qt::UserRole);
|
||||||
|
model->appendRow(overviewItem);
|
||||||
|
|
||||||
|
QStandardItem *convertItem = new QStandardItem("📦 功能转码");
|
||||||
|
convertItem->setData("功能转码", Qt::UserRole);
|
||||||
|
QStandardItem *businessConvertItem = new QStandardItem("业务转码");
|
||||||
|
businessConvertItem->setData("功能转码", Qt::UserRole);
|
||||||
|
convertItem->appendRow(businessConvertItem);
|
||||||
|
model->appendRow(convertItem);
|
||||||
|
|
||||||
|
QStandardItem *searchItem = new QStandardItem("🔍 功能查询");
|
||||||
|
searchItem->setData("功能查询", Qt::UserRole);
|
||||||
|
QStandardItem *uf20SearchItem = new QStandardItem("UF20功能查询");
|
||||||
|
uf20SearchItem->setData("功能查询", Qt::UserRole);
|
||||||
|
QStandardItem *uft3SearchItem = new QStandardItem("UFT3功能查询");
|
||||||
|
uft3SearchItem->setData("功能查询", Qt::UserRole);
|
||||||
|
searchItem->appendRow(uf20SearchItem);
|
||||||
|
searchItem->appendRow(uft3SearchItem);
|
||||||
|
model->appendRow(searchItem);
|
||||||
|
|
||||||
|
QStandardItem *metadataItem = new QStandardItem("🔄 元数据更新");
|
||||||
|
metadataItem->setData("元数据更新", Qt::UserRole);
|
||||||
|
model->appendRow(metadataItem);
|
||||||
|
|
||||||
|
QStandardItem *settingsItem = new QStandardItem("⚙️ 设置");
|
||||||
|
settingsItem->setData("设置", Qt::UserRole);
|
||||||
|
model->appendRow(settingsItem);
|
||||||
|
|
||||||
|
QStandardItem *aboutItem = new QStandardItem("📖 关于");
|
||||||
|
aboutItem->setData("关于", Qt::UserRole);
|
||||||
|
model->appendRow(aboutItem);
|
||||||
|
|
||||||
|
QStandardItem *tipsItem = new QStandardItem("💡 使用技巧");
|
||||||
|
tipsItem->setData("使用技巧", Qt::UserRole);
|
||||||
|
model->appendRow(tipsItem);
|
||||||
|
|
||||||
|
m_treeView->setModel(model);
|
||||||
|
m_treeView->expand(model->index(1, 0));
|
||||||
|
m_treeView->expand(model->index(2, 0));
|
||||||
|
|
||||||
|
connect(m_treeView, &QTreeView::clicked, this, [this](const QModelIndex& index) {
|
||||||
|
QString section = index.data(Qt::UserRole).toString();
|
||||||
|
updateContent(section);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void HelpPage::initContentPages()
|
||||||
|
{
|
||||||
|
m_stackedWidget = new QStackedWidget;
|
||||||
|
|
||||||
|
QWidget *contentPage = new QWidget;
|
||||||
|
QVBoxLayout *layout = new QVBoxLayout(contentPage);
|
||||||
layout->setContentsMargins(30, 30, 30, 30);
|
layout->setContentsMargins(30, 30, 30, 30);
|
||||||
|
|
||||||
QLabel *title = new QLabel("<h1>使用帮助</h1>");
|
m_titleLabel = new QLabel("<h1>使用帮助</h1>");
|
||||||
layout->addWidget(title);
|
layout->addWidget(m_titleLabel);
|
||||||
|
|
||||||
QTextEdit *helpText = new QTextEdit;
|
m_contentBrowser = new QTextBrowser;
|
||||||
helpText->setReadOnly(true);
|
m_contentBrowser->setReadOnly(true);
|
||||||
helpText->setStyleSheet("background-color: white;");
|
m_contentBrowser->setStyleSheet("background-color: white;");
|
||||||
helpText->setHtml(R"(
|
layout->addWidget(m_contentBrowser);
|
||||||
<h2>批量转码工具</h2>
|
|
||||||
<p>批量转码工具用于将指定目录下的多个文件从一种编码格式转换为另一种编码格式。</p>
|
|
||||||
<ul>
|
|
||||||
<li><strong>源目录:</strong> 选择包含待转换文件的目录</li>
|
|
||||||
<li><strong>目标目录:</strong> 选择转换后文件的保存目录</li>
|
|
||||||
<li><strong>文件过滤:</strong> 设置要转换的文件类型,如 *.txt</li>
|
|
||||||
<li><strong>源编码:</strong> 选择源文件的编码格式</li>
|
|
||||||
<li><strong>目标编码:</strong> 选择目标编码格式</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h2>非LS转码工具</h2>
|
m_stackedWidget->addWidget(contentPage);
|
||||||
<p>非LS转码工具用于在LS和非LS格式之间进行转换。</p>
|
|
||||||
<ul>
|
|
||||||
<li><strong>非LS转LS:</strong> 将非LS格式转换为LS格式</li>
|
|
||||||
<li><strong>LS转非LS:</strong> 将LS格式转换为非LS格式</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h2>支持的编码格式</h2>
|
loadHelpFile();
|
||||||
<ul>
|
updateContent("概述");
|
||||||
<li>GBK</li>
|
}
|
||||||
<li>GB2312</li>
|
|
||||||
<li>UTF-8</li>
|
void HelpPage::loadHelpFile()
|
||||||
<li>UTF-16</li>
|
{
|
||||||
<li>ASCII</li>
|
QString helpFilePath = QDir::currentPath() + "/help/help.md";
|
||||||
</ul>
|
QFile file(helpFilePath);
|
||||||
|
|
||||||
<h2>注意事项</h2>
|
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
<ul>
|
QTextStream in(&file);
|
||||||
<li>转换前请备份重要文件</li>
|
m_helpContent = in.readAll();
|
||||||
<li>确保有足够的磁盘空间</li>
|
file.close();
|
||||||
<li>大文件转换可能需要较长时间</li>
|
} else {
|
||||||
</ul>
|
m_helpContent = "# 使用帮助\n\n## 概述\n\n帮助文档加载失败,请检查资源文件。";
|
||||||
)");
|
}
|
||||||
layout->addWidget(helpText);
|
}
|
||||||
|
|
||||||
|
void HelpPage::updateContent(const QString §ion)
|
||||||
|
{
|
||||||
|
QString htmlContent = markdownToHtml(extractSection(section));
|
||||||
|
m_contentBrowser->setHtml(htmlContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString HelpPage::extractSection(const QString §ionName)
|
||||||
|
{
|
||||||
|
QStringList lines = m_helpContent.split("\n");
|
||||||
|
QString sectionContent;
|
||||||
|
bool inSection = false;
|
||||||
|
|
||||||
|
for (const QString &line : lines) {
|
||||||
|
if (line.startsWith("## ")) {
|
||||||
|
QString title = line.mid(3).trimmed();
|
||||||
|
if (title == sectionName) {
|
||||||
|
inSection = true;
|
||||||
|
sectionContent = line + "\n";
|
||||||
|
} else if (inSection) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (inSection) {
|
||||||
|
sectionContent += line + "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return sectionContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString HelpPage::markdownToHtml(const QString &markdown)
|
||||||
|
{
|
||||||
|
QStringList lines = markdown.split("\n");
|
||||||
|
QString html;
|
||||||
|
bool inList = false;
|
||||||
|
|
||||||
|
for (const QString &line : lines) {
|
||||||
|
QString trimmedLine = line.trimmed();
|
||||||
|
|
||||||
|
if (trimmedLine.isEmpty()) {
|
||||||
|
if (!inList) {
|
||||||
|
html += "<br>";
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (trimmedLine.startsWith("### ")) {
|
||||||
|
if (inList) {
|
||||||
|
html += "</ul>";
|
||||||
|
inList = false;
|
||||||
|
}
|
||||||
|
html += "<h3>" + trimmedLine.mid(4) + "</h3>";
|
||||||
|
} else if (trimmedLine.startsWith("#### ")) {
|
||||||
|
if (inList) {
|
||||||
|
html += "</ul>";
|
||||||
|
inList = false;
|
||||||
|
}
|
||||||
|
html += "<h4>" + trimmedLine.mid(5) + "</h4>";
|
||||||
|
} else if (trimmedLine.startsWith("- ")) {
|
||||||
|
if (!inList) {
|
||||||
|
html += "<ul style='margin-top: 4px; margin-bottom: 4px; padding-left: 20px;'>";
|
||||||
|
inList = true;
|
||||||
|
}
|
||||||
|
QString text = trimmedLine.mid(2);
|
||||||
|
text.replace(QRegularExpression("\\*\\*(.+?)\\*\\*"), "<strong>\\1</strong>");
|
||||||
|
html += "<li style='margin-bottom: 2px;'>" + text + "</li>";
|
||||||
|
} else if (trimmedLine.startsWith("```")) {
|
||||||
|
if (inList) {
|
||||||
|
html += "</ul>";
|
||||||
|
inList = false;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
if (inList) {
|
||||||
|
html += "</ul>";
|
||||||
|
inList = false;
|
||||||
|
}
|
||||||
|
QString text = trimmedLine;
|
||||||
|
text.replace(QRegularExpression("\\*\\*(.+?)\\*\\*"), "<strong>\\1</strong>");
|
||||||
|
html += "<p style='margin-top: 4px; margin-bottom: 4px;'>" + text + "</p>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (inList) {
|
||||||
|
html += "</ul>";
|
||||||
|
}
|
||||||
|
|
||||||
|
return html;
|
||||||
}
|
}
|
||||||
|
|
@ -2,6 +2,10 @@
|
||||||
#define HELPPAGE_H
|
#define HELPPAGE_H
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
#include <QStackedWidget>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QTextBrowser>
|
||||||
|
#include "ElaTreeView.h"
|
||||||
|
|
||||||
class HelpPage : public QWidget
|
class HelpPage : public QWidget
|
||||||
{
|
{
|
||||||
|
|
@ -13,6 +17,18 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initUI();
|
void initUI();
|
||||||
|
void initTreeView();
|
||||||
|
void initContentPages();
|
||||||
|
void loadHelpFile();
|
||||||
|
void updateContent(const QString §ion);
|
||||||
|
QString extractSection(const QString §ionName);
|
||||||
|
QString markdownToHtml(const QString &markdown);
|
||||||
|
|
||||||
|
ElaTreeView* m_treeView;
|
||||||
|
QStackedWidget* m_stackedWidget;
|
||||||
|
QLabel* m_titleLabel;
|
||||||
|
QTextBrowser* m_contentBrowser;
|
||||||
|
QString m_helpContent;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // HELPPAGE_H
|
#endif // HELPPAGE_H
|
||||||
Loading…
Reference in New Issue