mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-28 03:09:24 +08:00
实现系统管理表格操作接口、分页操作
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "PvApp.h"
|
||||
#include "DataFields.h"
|
||||
#include "Fields.h"
|
||||
|
||||
extern const std::string POP_OPER_NEW;
|
||||
extern const std::string POP_OPER_EDIT;
|
||||
extern const std::string POP_OPER_DEL;
|
||||
|
||||
class PvPopWidget : public PvObject
|
||||
{
|
||||
@@ -16,10 +20,14 @@ public:
|
||||
ParamLine(std::string type, std::string key) : type(type), key(key) {}
|
||||
};
|
||||
|
||||
PvPopWidget(PARAM* p, int width, int height);
|
||||
PvPopWidget(PARAM* p, int width, int height, std::string name);
|
||||
|
||||
std::shared_ptr<ParamLine> addParamLine(std::string type, std::string key, std::string title, int x, int y, bool editable = true);
|
||||
|
||||
void addParamLineEdit(std::string key, std::string title, int x, int y, bool editable=true);
|
||||
|
||||
void addParamTextEdit(std::string key, std::string title, int x, int y, bool editable = true);
|
||||
|
||||
void addParamCombox(std::string key, std::string title, int x, int y, std::vector<std::string> items);
|
||||
|
||||
void setParamText(std::shared_ptr<ParamLine> line, std::string text);
|
||||
@@ -27,13 +35,23 @@ public:
|
||||
|
||||
void setCallbackConfirm(std::function<void()> callback) { callbackConfirm = callback; };
|
||||
|
||||
void setTitle(std::string title);
|
||||
void setStatus(std::string text);
|
||||
|
||||
void setMsg(std::string msg);
|
||||
|
||||
void setData(const Fields& fields);
|
||||
Fields getData();
|
||||
Fields getChangedData();
|
||||
void checkChangedData(Fields& fields);
|
||||
|
||||
void setData(DataFields fields);
|
||||
DataFields getData();
|
||||
|
||||
void setLineGeometry(int wKey, int wVal, int h);
|
||||
|
||||
void setPrimaryKeys(std::vector<std::string> keys);
|
||||
|
||||
std::string name;
|
||||
std::string status;
|
||||
|
||||
int width {800};
|
||||
int height {600};
|
||||
|
||||
@@ -44,10 +62,13 @@ public:
|
||||
struct {
|
||||
int widget;
|
||||
int title;
|
||||
int msg;
|
||||
} ui;
|
||||
|
||||
std::map<std::string, std::shared_ptr<ParamLine>> mapLines;
|
||||
DataFields data;
|
||||
|
||||
std::function<void()> callbackConfirm = nullptr;
|
||||
|
||||
Fields dataOrigin;
|
||||
Fields primaryKeys;
|
||||
};
|
||||
Reference in New Issue
Block a user