DPS/DataPlatform/FileGenerate.h

62 lines
1.5 KiB
C
Raw Normal View History

2025-06-23 10:41:33 +08:00
#pragma once
#include <QObject>
#include<QString>
#include "report/reportdataset.h"
#include "json.hpp"
using json = nlohmann::json;
class FileGenerate :public QObject
{
Q_OBJECT
public:
FileGenerate();
~FileGenerate();
2025-06-23 18:01:09 +08:00
/*读取文档模版*/
2025-06-23 10:41:33 +08:00
// bool getTemplate();
2025-06-23 18:01:09 +08:00
/*生成需求文档*/
2025-06-23 10:41:33 +08:00
bool generate(QString filePath, json& parameter);
2025-06-23 18:01:09 +08:00
/*设置数据*/
2025-06-23 10:41:33 +08:00
void setData();
2025-06-23 18:01:09 +08:00
/*清理数据*/
2025-06-23 10:41:33 +08:00
void clearData();
2025-06-23 18:01:09 +08:00
/*生成*/
2025-06-23 10:41:33 +08:00
bool generateFile(QString& filePath, QString fileName);
2025-06-23 18:01:09 +08:00
unsigned int projectId = 0; //需生成文档的项目 id
2025-06-23 10:41:33 +08:00
QList<QString> m_listFileName;
QHash<QString, QList<QObject*>> m_DataSets;
2025-06-23 18:01:09 +08:00
//封面
2025-06-23 10:41:33 +08:00
QList<QObject*> CoverRightItem;
QList<QObject*> ModelItem;
QList<QObject*> LogoItem;
2025-06-23 18:01:09 +08:00
//根模块
2025-06-23 10:41:33 +08:00
QList<QObject*> PackItem;
QList<QObject*> PackTable;
2025-06-23 18:01:09 +08:00
QList<QObject*> RootPack; //根模块名称
2025-06-23 10:41:33 +08:00
QList<QObject*> ChildPackItem;
QList<QObject*> ChildPackTable;
2025-06-23 18:01:09 +08:00
QList<QObject*> ChildPack1; //第一层子模块名称 firstChildPack
2025-06-23 10:41:33 +08:00
QList<QObject*> Ch_childPackItem;
QList<QObject*> Ch_childPackTable;
2025-06-23 18:01:09 +08:00
QList<QObject*> ChildPack2; //第二 层子模块名称 secChildPack
2025-06-23 10:41:33 +08:00
QList<QObject*> classGroupItem;
2025-06-23 18:01:09 +08:00
QList<QObject*> classname; //第一层数据类
QList<QObject*> relatTableData; //关系表
QList<QObject*> interfaceTableData; //接口表
QList<QObject*> AttTableData; //属性表数据
2025-06-23 10:41:33 +08:00
QList<QObject*> classGroupItem111;
QList<QObject*> classname5;
2025-06-23 18:01:09 +08:00
QList<QObject*> AttTableData111; //属性表数据
QList<QObject*> relatTableData111; //关系表
QList<QObject*> interfaceTableData111; //接口表
2025-06-23 10:41:33 +08:00
};