#ifndef SELECTVALUEFORM_H
#define SELECTVALUEFORM_H

#include <QWidget>
#include "configinfo.h"
#include "handle/httprequest.h"
#include "globalinfo.h"
#include "handle/projectinfomanger.h"

namespace Ui {
class SelectValueForm;
}

//TODO: 小宋 从GlobalInfo::this_()->project().values() 取出所有，保存，然后自己保存下标在上层做分页
class SelectValueForm : public QWidget
{
    Q_OBJECT

public:
    explicit SelectValueForm(QWidget *parent = nullptr);
    ~SelectValueForm();

//    void getInfo(int page, int pageListNum = 20);

    inline void setStatus(int staus){status = staus;}


public slots:
    void Start();


signals:
    void back();
    void backFandU();
    void selectProject(QString batchno);


private slots:
    void result(int code, const QJsonObject & body);

    void refPage(int page, int pageListNum = 20);

    void parseObject(const QJsonObject & obj);

    void on_pushPrev_clicked();

    void on_pushNext_clicked();

    void on_searchButton_clicked();

    void on_backMainButton_clicked();

    void on_pushButton_2_clicked();

    void on_back_Button_clicked();

    void on_closeButton_clicked();

    void on_RefreshButton_clicked();

    void on_synButtong_clicked();

private:
    Ui::SelectValueForm *ui;
    int nowPage;
    int pageListNum;
    int totlePage;
    int totleNum;
    HttpRequest _request;
    int status;
    QList<QSharedPointer<ProjectInfo>> prolist;
    GlobalInfo *glo = GlobalInfo::this_();
    ProjectInfoManger *proinfo;
    PackInfoManger *Manger;
};

#endif // SELECTVALUEFORM_H
