geopro/src/app/panels/web/ProjectWebView.hpp

26 lines
791 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <QString>
#include <QWidget>
class QWebEngineView;
namespace geopro::app {
// 项目管理 webview 宿主:内嵌 QWebEngineView承载需「直接嵌入」的 web 管理页
// (在线监测 / 工具组件 / 批量导出 / 告警管理)。
// 构造期注入 DocumentCreation 脚本,把登录 token 写入页面 localStorage["token"]
// 早于页面自身脚本执行,确保 web 端读取鉴权时已就绪。
class ProjectWebView : public QWidget {
Q_OBJECT
public:
explicit ProjectWebView(const QString& token, QWidget* parent = nullptr);
// 加载嵌入页(完整 URL含 #/embed?space=..&projectId=..&target=..)。
void load(const QString& url);
private:
QWebEngineView* view_ = nullptr;
};
} // namespace geopro::app