#ifndef SHOWXIANGDANLABELFORM_H
#define SHOWXIANGDANLABELFORM_H

#include <QWidget>
#include "handle/printer/baseboxprinter.h"
#include "handle/printer/boxtemlateone.h"
#include <pqQtlib/core/pqapppath.h>
#include <pqQtlib/utils/pqfileutils.h>
#include "QMessageBox"
#include "QDir"
#include "struct_/modelinfo.h"

namespace Ui {
class ShowXiangDanLabelForm;
}

class ShowXiangDanLabelForm : public QWidget
{
    Q_OBJECT

public:
    explicit ShowXiangDanLabelForm(QWidget *parent = nullptr);
    ~ShowXiangDanLabelForm();
    inline void setBaseModelName(QString baseModelName){BaseModel = baseModelName;}
    inline void setStatus(int status){Status = status;}

    inline void setModelName(QString ModelName){this->ModelName = ModelName;}

    void init(QString baseModelName,int status,QString ModelName = nullptr);

signals:
    void back();

private slots:
    void controlHide();
    void controlShow();
    void addComboBox();
//    void changeData(int index);
    void showBaseModel();//显示默认模板
    void addBoxData();//添加数据到BoxModel的方法
    void upData(QSharedPointer<BoxModel> boxModelData);//进入更新页面时添加原始数据


private slots:
//    void on_addNewModel_clicked();

//    void on_upModel_clicked();

//    void on_ModelList_cellClicked(int row, int column);

    void on_backButton_clicked();

    void on_delModel_clicked();

    void on_saveButton_clicked();

    void on_upModel_clicked();

private:
    Ui::ShowXiangDanLabelForm *ui;
    QSharedPointer<BaseBoxPrinter> _boxPrinter;

    QSharedPointer<BoxModel> boxModel;
    QList<QSharedPointer<BoxModel>> boxModelList;

    PackInfoManger *pack;
    GlobalInfo * glo = GlobalInfo::this_();

private:
    QDir _dataDir;
    QString BaseModel;//添加新自定义模板时参数
    QString ModelName;//更新自定义模板时参数

    int Status;
};

#endif // SHOWXIANGDANLABELFORM_H
