mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
实现策略配置功能
This commit is contained in:
@@ -17,8 +17,6 @@ public:
|
||||
bool show_border = true;
|
||||
int head_height = 40;
|
||||
int row_height = 35;
|
||||
int page_size = 10;
|
||||
int width = 500;
|
||||
};
|
||||
|
||||
struct Head
|
||||
@@ -48,72 +46,52 @@ public:
|
||||
struct Row
|
||||
{
|
||||
bool visible = false;
|
||||
int bkg {PV_ID_NUL};
|
||||
int widget {PV_ID_NUL};
|
||||
std::vector<int> vecCells {};
|
||||
};
|
||||
|
||||
public:
|
||||
PvTable(PARAM* p, int parent, int x, int y, int w, int rows, Options& option);
|
||||
PvTable(PARAM* p, int parent, int x, int y, int w, int rowCount, Options& option);
|
||||
|
||||
void addHead(std::string id, std::string text, int width, std::vector<std::pair<std::string, std::string>> mapping = {});
|
||||
void addHead(std::vector<std::string> vecText);
|
||||
|
||||
void setRowVisible(int row, bool v);
|
||||
void highlight(int row, bool v);
|
||||
void setRowVisible(int irow, bool v);
|
||||
void highlight(int irow, bool v);
|
||||
|
||||
void addOperate(std::vector<std::string> vecOpt);
|
||||
void setOperateCallback(CallbackTableOpt cb);
|
||||
|
||||
void set_text(PARAM* p, int row, int col, std::string text, std::string style = "");
|
||||
|
||||
void setRowData(int row, Fields& d);
|
||||
void setRowData(int row, std::vector<std::string> vd);
|
||||
void setRow(int irow, Fields& d);
|
||||
void setRow(int irow, std::vector<std::string> vd);
|
||||
Fields row(int irow);
|
||||
Fields rowMapping(int irow);
|
||||
|
||||
Fields getRowData(int row);
|
||||
void mappingData(Fields& fields);
|
||||
|
||||
void set_border_visible(PARAM* p, bool v);
|
||||
|
||||
void add_col_button(PARAM* p, int col, std::string title, PvRect& rt, std::string style);
|
||||
void add_col_button(PARAM* p, int col, std::vector<std::string> vec_title);
|
||||
void setOperateVisible(int row, bool v, int id = -1);
|
||||
|
||||
int item_posy(int row);
|
||||
|
||||
int border_id();
|
||||
|
||||
int rows();
|
||||
|
||||
int colums();
|
||||
int rowCount();
|
||||
int colCount();
|
||||
|
||||
std::vector<Fields> data();
|
||||
|
||||
PvTable::Head& header(int col);
|
||||
|
||||
private:
|
||||
int pvid_;
|
||||
PvRect rect_;
|
||||
Options option;
|
||||
PvRect rect;
|
||||
|
||||
int border_id_;
|
||||
std::vector<PvTable::Head> vecHeads;
|
||||
std::vector<PvTable::Row> vecRows;
|
||||
std::vector<Fields> vecData;
|
||||
|
||||
std::vector<PvTable::Head> vecHead_;
|
||||
std::vector<PvTable::Row> vecRows_;
|
||||
vector<pair<int, vector<int>>> vecOper;
|
||||
int nrow;
|
||||
int ncol;
|
||||
|
||||
std::vector<Fields> vecData_;
|
||||
|
||||
vector<pair<int, vector<int>>> vecOpt_;
|
||||
int nRow_;
|
||||
int nCol_;
|
||||
|
||||
string item_base_style_;
|
||||
|
||||
Options option_;
|
||||
|
||||
unordered_map<int, vector<int>> vec_col_item_btn_;
|
||||
|
||||
CallbackTableOpt cbOperate_ = nullptr;
|
||||
|
||||
int posCol_ = 0;
|
||||
int posCol = 0;
|
||||
|
||||
CallbackTableOpt callbackOper = nullptr;
|
||||
};
|
||||
|
||||
|
||||
@@ -144,9 +122,6 @@ private:
|
||||
// 下一页按钮
|
||||
int btnNext = PV_ID_NUL;
|
||||
|
||||
// 页面跳转按钮
|
||||
int btn_gopage_ = PV_ID_NUL;
|
||||
|
||||
int btnActive = PV_ID_NUL;
|
||||
|
||||
int labelInfo = PV_ID_NUL;
|
||||
@@ -170,7 +145,7 @@ public:
|
||||
|
||||
std::shared_ptr<PvPopWidget> addPop(int w, int h, int w0, std::string name, std::vector<std::string> primaryKeys);
|
||||
|
||||
void showPop(int index, std::string optr, Fields& fields);
|
||||
void showPop(int index, std::string optr, Fields fields);
|
||||
void hidePop(int index);
|
||||
|
||||
void updateDataFromDB();
|
||||
@@ -186,6 +161,7 @@ public:
|
||||
std::shared_ptr<PvTable> table;
|
||||
std::shared_ptr<PvPagination> pagination;
|
||||
std::vector<std::shared_ptr<PvPopWidget>> vecPop;
|
||||
Fields curRowData;
|
||||
};
|
||||
|
||||
#endif // ! _PvTable_H_
|
||||
Reference in New Issue
Block a user