#ifndef TASKLISTWIDGET_H
#define TASKLISTWIDGET_H

#include <QWidget>
#include <QListView>

#include "dao/service/SysLocalService.h"
#include "dao/service/TaskService.h"
#include "frame/CustomMessageBox.h"

class CalibrationMainForm;

namespace Ui {
class TaskListWidget;
}

class TaskListWidget : public QWidget
{
    Q_OBJECT

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

protected:
    void showEvent(QShowEvent * event) override;
    void resizeEvent(QResizeEvent * event) override;

private:
    Ui::TaskListWidget *ui;
    CalibrationMainForm * parentForm;
    Page page;

    // 待检设备清单
    QList<TaskDTO> taskList;

    void initForm();
    void initFormTable();

    void initMeasureStatusSelect();
    void initUrgentSelect();

private slots:
    void getTaskToBeDoneList(int currPage);
    void rowSelectedHandler(int rowIdx, bool selected);
    void on_btnQuery_clicked();
    void on_btnResetQuery_clicked();
    void on_btnNextToConf_clicked();

signals:
    void taskEquipmentSelected();

};

#endif // TASKLISTWIDGET_H
