```
feat(main): 添加本地雷达存储依赖注入到对象树右键菜单 为对象树右键菜单的动作处理函数添加 localRadarStore 引用, 以便在上下文操作中能够访问本地雷达数据存储。 perf(api): 设置网络请求超时机制 为所有 API 客户端请求添加 15 秒超时设置,避免服务器不 可达时 UI 界面永久卡死。同时扩展样本数据搜索路径以包含 更多数据源目录。 ```
This commit is contained in:
parent
ad6699d48d
commit
f4d07d9506
|
|
@ -1959,9 +1959,9 @@ void buildWorkbench(QMainWindow& window, geopro::data::LocalSampleRepository& re
|
|||
// 对象树右键菜单动作路由。
|
||||
QObject::connect(
|
||||
objectTree, &geopro::app::ObjectTreePanel::contextActionRequested, &window,
|
||||
[&nav, &projectRepo, &window, anomalyTabGroup, toast, objAttrView, objectTree](
|
||||
const QString& action, const QString& id, int confType, const QString& typeId,
|
||||
const QString& name) {
|
||||
[&nav, &projectRepo, &window, anomalyTabGroup, toast, objAttrView, objectTree,
|
||||
&localRadarStore](const QString& action, const QString& id, int confType,
|
||||
const QString& typeId, const QString& name) {
|
||||
if (action == QStringLiteral("properties")) {
|
||||
nav.selectObject(id, confType);
|
||||
// 右键「属性」:用可编辑面板渲染(与左键单击同口径)。
|
||||
|
|
@ -2536,6 +2536,7 @@ int main(int argc, char* argv[])
|
|||
const QString appDir = QCoreApplication::applicationDirPath();
|
||||
const QStringList candidates = {
|
||||
appDir + QStringLiteral("/sampledata"),
|
||||
QDir::cleanPath(appDir + QStringLiteral("/../../../../docs/剖面网格数据的色阶数据2等文件")),
|
||||
QStringLiteral("D:/Git/lanbingtech/geopro/docs/剖面网格数据的色阶数据2等文件"),
|
||||
};
|
||||
for (const auto& c : candidates) {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ struct ApiClient::Impl {
|
|||
QNetworkRequest buildRequest(const QString& path) const {
|
||||
QNetworkRequest req{QUrl(baseUrl + path)};
|
||||
req.setHeader(QNetworkRequest::ContentTypeHeader, QString::fromLatin1(kContentTypeJson));
|
||||
req.setTransferTimeout(15000); // 15 秒超时:避免服务器不可达时 UI 永久卡住
|
||||
if (!token.isEmpty()) {
|
||||
req.setRawHeader(QByteArray(kTokenHeader), token.toUtf8());
|
||||
}
|
||||
|
|
@ -100,6 +101,7 @@ IApiCall* ApiClient::postMultipartAsync(const QString& path,
|
|||
|
||||
// multipart 自带 boundary 的 Content-Type:用不含 JSON 头的请求,只保留 token。
|
||||
QNetworkRequest req{QUrl(impl_->baseUrl + path)};
|
||||
req.setTransferTimeout(15000);
|
||||
if (!impl_->token.isEmpty()) req.setRawHeader(QByteArray(kTokenHeader), impl_->token.toUtf8());
|
||||
|
||||
QNetworkReply* reply = impl_->nam.post(req, multi);
|
||||
|
|
|
|||
Loading…
Reference in New Issue