You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWATI/Include/mGui/mSubWnd/iSubWndData.h

125 lines
3.7 KiB
C

#pragma once
#include "iSubWnd.h"
class ZxTableModel;
class ZxTableView;
class M_SUB_WND_EXPORT iSubWndData : public iSubWnd
{
Q_OBJECT
public:
explicit iSubWndData(QWidget *parent = 0, QString sExt = "");
~iSubWndData();
// 配置窗体
virtual void configWnd();
virtual void loadData(QString sWell = ""); //加载数据
virtual void runUpdate(); //刷新
virtual void setColWidths();
/// @brief 命令是否Enabled的状态判断通常来自Ribbon
/// @param b (out)trueEnabled falsedisabled
/// @param sName (in),Cmd Name
/// @param nID (in),Cmd ID
/// @param bLicensed (in),当前是否有授权
/// @return 本窗体是否已经进行状态判断(即属于本窗体可执行的命令)
virtual bool checkCmdEnable(bool &b, \
QString sName, int nID, \
bool bLicensed);
protected:
// 初始化UI
virtual QWidget* initUiMainWx();
virtual void initUiDockPtys();
virtual void bindTableSignals(ZxTableView* pTableView);
// 执行命令:通常来自图形右侧/左侧的工具栏
virtual bool runActionOf(QString sAction);
virtual void saveData();
virtual void exportData();
virtual void printData();
virtual void printPreviewData();
// 20240613启用隐藏列故该方式不再启用
/// @brief 对数据做一些特殊处理,比如隐藏某些列的处理
/// @param bLoad :
/// true load+show(隐藏)
/// false save(Add)
/// @param vvec (in & out)
/// @param listTitles (in & out)
// virtual void adjustData(bool bLoadMode, \
// VVecVariant& vvec, \
// QStringList* pListTitles = NULL, \
// bool bTitlesOnly = false);
// 根据表名获取不显示的字段索引
VecInt getHideCols(QString sTableName);
// 当index网格改变时自动填写井号之类的内容
void autoFillCodesBy(const QModelIndex& Index);
public slots:
// 具体的按钮按钮操作
virtual void slotDataLoad();
// 当前窗体所有信息的保存,比如关闭时提问的保存
virtual bool slotSaveAll();
virtual void slotSaveDatabase();
// 表格删除行时,对应删除数据库数据
// 如果sError非常证明未删除成功
virtual void slotRemoveRowsOfDB(int nRowFrom, int nRowTo, QString& sError);
virtual void slotTableCellClicked(const QModelIndex &index);
virtual void slotDataTableModified();
virtual void slotTableCellChanged(const QModelIndex& Index, const QModelIndex& nIndex);
// 主要是为了,右键删除之后,刷新右侧图
virtual void slotRowDeleted(QModelIndexList listOlds, QModelIndexList listNews, QModelIndex index);
signals:
void sigFreshWellAbout();
void sigNeedDelObjs(QStringList& listKeys, QString& sTable, QString& sError);
public:
virtual void firstLoadAndUpdate();
virtual bool loadDataBy(QString sTable, QString sFilterWellCode);
protected:
//virtual QString getOrderStrOf(QString sTable); //获取某表关键字组织为Order
virtual bool scanInfosByTable(QString sTable, QString& sSql);
// 保存数据
virtual bool _saveData(VVecVariant& vvec);
// 保存后,刷新当前井和工区数据
void refreshMemObjs(VVecVariant& vvec);
protected:
VVecVariant m_vvecData;
QStringList m_listFields;
QStringList m_listTags; //轴标题(表头)
QStringList m_listUnits; //单位
VecInt m_vecKeyIndexes;
ZxTableModel* m_pTableModel;
ZxTableView* m_pTableView;
QString m_sObjCode;
QString m_sWellFilter; //如果为空,则全部,否则为单井
bool m_bAutoFilling;
};