#ifndef SYSCHARTNAVIGATIONMGT_H
#define SYSCHARTNAVIGATIONMGT_H

#include <topcore/topclassabs.h>
#include <topcore/topclasshelper.h>
#include <tdatabaseutil/tsqlselectorv2.h>

class QVBoxLayout;
class TSplitter;
class TTableViewV2;
class TSearchEntry;
class TUiLoader;
class TPageTool;
class TDialog;
class TWidget;
class TSqlSelectorV2;
class TTableView;
class SysChartNavigation;

class SysChartNavigationMgt: public TopClassAbs
{
    Q_OBJECT
public:
    explicit SysChartNavigationMgt(const QString &iModuleName = QString(""),
                                      const QVariantMap &iUrlPars = QVariantMap(),
                                      QWidget *iParent = nullptr);
    ~SysChartNavigationMgt();
public slots:
    void refresh(bool iResetPageBol = true);
    QVariantList selectedItems() const;
    QVariantList selectedDataMaps() const;
    QString specifiedClass();

private slots:
    void onSelectionChanged();
    void onDetailChanged();
    void onPageChanged();

private:
    void initUi();
    void initSpecifiedClass();
    TSqlSelectorV2 getSqlSelector(bool iResetPageBol = true);
    void graphOnly();
    void parseParams(const QVariantMap &iParamMap);

private:
    TSplitter *mBodySplitter = nullptr;
    QWidget *mBodyWidget = nullptr;
    QWidget *mMgtWidget = nullptr;
    QVBoxLayout *mBodyLayout = nullptr;
    TSearchEntry *mSearchEntry = nullptr;
    TPageTool *mPageTool = nullptr;
    TTableView *mTableView = nullptr;
    SysChartNavigation *mDetail = nullptr;
    TopClassTableConf mTableConf;
    QString mSpecifiedClass;
    QString mLastChartNaviId = "";
    int mToolBarMode = 0; //0:工具栏只有搜索,1:工具栏还有导出功能
};
#endif // SYSCHARTNAVIGATIONMGT_H