| | |
| | | #include <QMessageBox> |
| | | #include <QDir> |
| | | #include <QFileDevice> |
| | | #include "noedititemdelegate.h" |
| | | |
| | | #pragma execution_character_set("utf-8") |
| | | |
| | | ThreeMergeProblemList::ThreeMergeProblemList(QWidget *parent) : |
| | | QMainWindow(parent), |
| | |
| | | ui->setupUi(this); |
| | | |
| | | m_fdd = new FileDialogDelegate; |
| | | //m_noEdit = new ThreeComboBox; |
| | | |
| | | ui->statusbar->hide(); |
| | | ui->menubar->hide(); |
| | |
| | | ui->line->hide(); |
| | | ui->line_2->hide(); |
| | | |
| | | ui->groupBox->hide(); // 首次先隐藏 |
| | | |
| | | // pdf文件相关 |
| | | //m_pdfView = new QWebEngineView(); |
| | | |
| | | |
| | | } |
| | | |
| | | ThreeMergeProblemList::~ThreeMergeProblemList() |
| | | { |
| | | //delete m_noEdit; |
| | | delete ui; |
| | | } |
| | | |
| | |
| | | qDebug()<<"当前行首为空"<<row; |
| | | return 0; |
| | | } |
| | | // 处理为空的非首列单元,自动补零 |
| | | for(int i=1;i<ui->tableWidget->columnCount();++i){ |
| | | if(ui->tableWidget->item(row,i) == nullptr){ |
| | | qDebug()<<"发现空项:"<<row<<i; |
| | | ui->tableWidget->setItem(row,i,new QTableWidgetItem(" ")); |
| | | } |
| | | } |
| | | |
| | | |
| | | // 取出索引号来判断一下 |
| | | QString sql = QString("select id from standing_book_info where id=%1").arg(ui->tableWidget->item(row,0)->text()); |
| | | qDebug()<<"id sql:"<<sql; |
| | |
| | | |
| | | // path 为文件完整路径 |
| | | // id为子目录名字 |
| | | int ThreeMergeProblemList::saveFile(QString path, QString id,QString &absSavePath) |
| | | int ThreeMergeProblemList::saveFile(QString path, QString id,QString &absSavePath,QString proName) |
| | | { |
| | | // 根据id来指定子目录进行文件的拷贝和存储 |
| | | // 默认保存到当前evidence目录下的id子目录中 |
| | |
| | | return -1; |
| | | } |
| | | |
| | | QString curPath = QString("./evidence/%1/").arg(id); |
| | | QString curPath = QString("./evidence/%1_%2/").arg(id).arg(proName); |
| | | QDir dir; |
| | | if(!dir.exists(curPath)){ |
| | | // 则直接创建 |
| | |
| | | return -2; |
| | | } |
| | | |
| | | } |
| | | |
| | | // 使用web技术 加载pdf文件 |
| | | int ThreeMergeProblemList::loadPdfFile(QString path) |
| | | { |
| | | // QString dirPath = QApplication::applicationDirPath(); |
| | | // qDebug()<<"pdf:"<<path<<dirPath; |
| | | // qDebug()<<QDir::currentPath(); |
| | | // qDebug()<<path.mid(1); |
| | | // QString pdfJS = "file://"+QDir::currentPath()+"/web/viewer.html"; |
| | | // QString link = "?file="; |
| | | // QString fullPath = pdfJS+link+QDir::currentPath()+path.mid(1); |
| | | // qDebug()<<"fullPath"<<fullPath; |
| | | // m_pdfView->page()->load(QUrl::fromUserInput(fullPath)); |
| | | |
| | | return 0; |
| | | } |
| | | void ThreeMergeProblemList::initUi() |
| | | { |
| | |
| | | QTableWidgetItem *item_1 = new QTableWidgetItem(label); |
| | | item_1->setForeground(QBrush(QColor("#ff00ff"))); |
| | | ui->tableWidget->setHorizontalHeaderItem(i,item_1); |
| | | //ui->tableWidget->setItem(1,i,item_1); |
| | | } |
| | | |
| | | for(int i=14;i<14+10;++i){ |
| | |
| | | QStringList fwLabels; |
| | | fwLabels << "录入(直接输入后回车即可)"<<"上传"; |
| | | m_cbb_file_wri = new ComboBoxDelegate(fwLabels,this,true); |
| | | ui->tableWidget->setItemDelegateForColumn(13,m_cbb_file_wri); |
| | | ui->tableWidget->setItemDelegateForColumn(17,m_cbb_file_wri); |
| | | ui->tableWidget->setItemDelegateForColumn(23,m_cbb_file_wri); |
| | | ui->tableWidget->setItemDelegateForColumn(13+2,m_cbb_file_wri); |
| | | ui->tableWidget->setItemDelegateForColumn(17+2,m_cbb_file_wri); |
| | | ui->tableWidget->setItemDelegateForColumn(23+2,m_cbb_file_wri); |
| | | |
| | | // 处理年月日时间 |
| | | m_date_ymd = new DateDelegate(this,"yyyy/MM/dd"); |
| | | ui->tableWidget->setItemDelegateForColumn(19,m_date_ymd); |
| | | ui->tableWidget->setItemDelegateForColumn(21,m_date_ymd); |
| | | ui->tableWidget->setItemDelegateForColumn(24,m_date_ymd); |
| | | ui->tableWidget->setItemDelegateForColumn(29,m_date_ymd); |
| | | ui->tableWidget->setItemDelegateForColumn(31,m_date_ymd); |
| | | ui->tableWidget->setItemDelegateForColumn(34,m_date_ymd); |
| | | ui->tableWidget->setItemDelegateForColumn(19+2,m_date_ymd); |
| | | ui->tableWidget->setItemDelegateForColumn(21+2,m_date_ymd); |
| | | ui->tableWidget->setItemDelegateForColumn(24+2,m_date_ymd); |
| | | ui->tableWidget->setItemDelegateForColumn(29+2,m_date_ymd); |
| | | ui->tableWidget->setItemDelegateForColumn(31+2,m_date_ymd); |
| | | ui->tableWidget->setItemDelegateForColumn(34+2,m_date_ymd); |
| | | |
| | | |
| | | // 将标题导入第三行 |
| | | for(int i=0;i<ui->tableWidget->columnCount();++i){ |
| | | QString label = ui->tableWidget->horizontalHeaderItem(i)->text(); |
| | | QTableWidgetItem *item = new QTableWidgetItem(label); |
| | | if(i < 16){ |
| | | item->setBackground(QBrush(QColor("#ff00ff"))); |
| | | }else if(i < 16+10){ |
| | | item->setBackground(QBrush(QColor("#00aaff"))); |
| | | } |
| | | |
| | | ui->tableWidget->setItem(2,i,item); |
| | | } |
| | | |
| | | // 并且禁用编辑功能 |
| | | //ui->tableWidget->setItemDelegateForRow(1,m_noEdit); |
| | | //ui->tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); |
| | | m_noEdit = new TableItemDelegate; |
| | | ui->tableWidget->setItemDelegateForRow(0,m_noEdit); |
| | | ui->tableWidget->setItemDelegateForRow(1,m_noEdit); |
| | | ui->tableWidget->setItemDelegateForRow(2,m_noEdit); |
| | | |
| | | |
| | | // 合并第一行的情况,进行分类 |
| | | |
| | | |
| | | ui->tableWidget->setItem(0,1,new QTableWidgetItem("发现问题")); |
| | | ui->tableWidget->setItem(0,18,new QTableWidgetItem("发现问题22")); |
| | | ui->tableWidget->setSpan(0,1,2,15); |
| | | ui->tableWidget->item(0,1)->setTextAlignment(Qt::AlignCenter); |
| | | ui->tableWidget->item(0,1)->font().setBold(true); |
| | | |
| | | // 加载公司名 |
| | | readCompanyFromSQL(); |
| | |
| | | m_menuRectBook = new QMenu(this); |
| | | m_menuRectBook->addAction("删除当前行"); |
| | | m_menuRectBook->addAction("保存当前行"); |
| | | m_menuRectBook->addAction("查看已存佐证"); |
| | | |
| | | ui->tableWidget->setContextMenuPolicy(Qt::CustomContextMenu); |
| | | connect(ui->tableWidget,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(showMenuSlotRectBook(QPoint))); |
| | | |
| | | connect(m_menuRectBook->actions().at(0),SIGNAL(triggered(bool)),this,SLOT(deleteActionRectBook())); |
| | | connect(m_menuRectBook->actions().at(1),SIGNAL(triggered(bool)),this,SLOT(saveActionRectBook())); |
| | | connect(m_menuRectBook->actions().at(2),SIGNAL(triggered(bool)),this,SLOT(showSaveFile())); |
| | | |
| | | } |
| | | |
| | |
| | | int rows = saveDataLine(row); |
| | | if(rows>0){ |
| | | // 需要将文件拷贝到id目录 |
| | | QString fpath = ui->tableWidget->item(row,13)->text(); |
| | | QString spath = ui->tableWidget->item(row,17)->text(); |
| | | QString tpath = ui->tableWidget->item(row,23)->text(); |
| | | QString fpath = ui->tableWidget->item(row,13+2)->text(); |
| | | QString spath = ui->tableWidget->item(row,17+2)->text(); |
| | | QString tpath = ui->tableWidget->item(row,23+2)->text(); |
| | | QString fid = ui->tableWidget->item(row,0)->text(); |
| | | qDebug()<<"拷贝文件:"<<fid<<fpath; |
| | | QString proName = ui->tableWidget->item(row,7)->text(); // 项目名称 |
| | | qDebug()<<"拷贝文件:"<<fid<<proName<<fpath; |
| | | |
| | | QString absSavePath1,absSavePath2,absSavePath3; |
| | | |
| | | int sflag1 = saveFile(fpath,fid,absSavePath1); // 保存第一个 |
| | | int sflag1 = saveFile(fpath,fid,absSavePath1,proName); // 保存第一个 |
| | | if(sflag1==1){ |
| | | ui->tableWidget->setItem(row,13,new QTableWidgetItem(absSavePath1)); |
| | | ui->tableWidget->setItem(row,13+2,new QTableWidgetItem(absSavePath1)); |
| | | } |
| | | int sflag2 = saveFile(spath,fid,absSavePath2); // 保存第二个 |
| | | int sflag2 = saveFile(spath,fid,absSavePath2,proName); // 保存第二个 |
| | | if(sflag2==1){ |
| | | ui->tableWidget->setItem(row,17,new QTableWidgetItem(absSavePath2)); |
| | | ui->tableWidget->setItem(row,17+2,new QTableWidgetItem(absSavePath2)); |
| | | } |
| | | int sflag3 = saveFile(tpath,fid,absSavePath3); // 保存第三个 |
| | | int sflag3 = saveFile(tpath,fid,absSavePath3,proName); // 保存第三个 |
| | | if(sflag3==1){ |
| | | ui->tableWidget->setItem(row,23,new QTableWidgetItem(absSavePath3)); |
| | | ui->tableWidget->setItem(row,23+2,new QTableWidgetItem(absSavePath3)); |
| | | } |
| | | qDebug()<<"save falg:"<<sflag1<<sflag2<<sflag3; |
| | | if(sflag1 || sflag2 || sflag3){ |
| | |
| | | |
| | | }else if(curText == "涉及金额" || strcmp(curText.toLocal8Bit().data(),"涉及金额")==0){ |
| | | qDebug()<<"涉及金额"; |
| | | condition = QString(" where 涉及金额='%1'").arg(ui->lineEdit_sbook_condition->text()); |
| | | condition = QString(" where 涉及金额 <=%1").arg(ui->lineEdit_sbook_condition->text()); |
| | | |
| | | }else if(curText == "整顿金额" || strcmp(curText.toLocal8Bit().data(),"整顿金额")==0){ |
| | | qDebug()<<"整顿金额"; |
| | | condition = QString(" where 整顿金额='%1'").arg(ui->lineEdit_sbook_condition->text()); |
| | | condition = QString(" where 整顿金额 <=%1").arg(ui->lineEdit_sbook_condition->text()); |
| | | |
| | | } |
| | | |
| | |
| | | QString spath = ui->tableWidget->item(i,17)->text(); |
| | | QString tpath = ui->tableWidget->item(i,23)->text(); |
| | | QString fid = ui->tableWidget->item(i,0)->text(); |
| | | qDebug()<<"拷贝文件:"<<fid<<fpath; |
| | | QString proName = ui->tableWidget->item(i,7)->text(); // 项目名称 |
| | | qDebug()<<"拷贝文件:"<<fid<<proName<<fpath; |
| | | |
| | | QString absSavePath1,absSavePath2,absSavePath3; |
| | | |
| | | int sflag1 = saveFile(fpath,fid,absSavePath1); // 保存第一个 |
| | | int sflag1 = saveFile(fpath,fid,absSavePath1,proName); // 保存第一个 |
| | | if(sflag1==1){ |
| | | ui->tableWidget->setItem(i,13,new QTableWidgetItem(absSavePath1)); |
| | | ui->tableWidget->setItem(i,13+2,new QTableWidgetItem(absSavePath1)); |
| | | } |
| | | int sflag2 = saveFile(spath,fid,absSavePath2); // 保存第二个 |
| | | int sflag2 = saveFile(spath,fid,absSavePath2,proName); // 保存第二个 |
| | | if(sflag2==1){ |
| | | ui->tableWidget->setItem(i,17,new QTableWidgetItem(absSavePath2)); |
| | | ui->tableWidget->setItem(i,17+2,new QTableWidgetItem(absSavePath2)); |
| | | } |
| | | int sflag3 = saveFile(tpath,fid,absSavePath3); // 保存第三个 |
| | | int sflag3 = saveFile(tpath,fid,absSavePath3,proName); // 保存第三个 |
| | | if(sflag3==1){ |
| | | ui->tableWidget->setItem(i,23,new QTableWidgetItem(absSavePath3)); |
| | | ui->tableWidget->setItem(i,23+2,new QTableWidgetItem(absSavePath3)); |
| | | } |
| | | qDebug()<<"save falg:"<<sflag1<<sflag2<<sflag3; |
| | | if(sflag1 || sflag2 || sflag3){ |
| | |
| | | vecCon.append(condition); |
| | | } |
| | | if(ui->checkBox_qdx->isChecked()){ |
| | | QString condition= QString(" 问题定性='%1' ").arg(ui->comboBox_qdx->currentText()); |
| | | QString condition= QString(" 问题定性='%1'").arg(ui->comboBox_qdx->currentText()); |
| | | vecCon.append(condition); |
| | | } |
| | | if(ui->checkBox_about_money->isChecked()){ |
| | | QString condition= QString(" 涉及金额>='%1' and 涉及金额<='%2' ").arg(ui->comboBox_about_bgMonney->currentText()).arg(ui->comboBox_about_edMoney->currentText()); |
| | | QString condition= QString(" 涉及金额 >= %1 and 涉及金额 <= %2").arg(ui->comboBox_about_bgMonney->currentText()).arg(ui->comboBox_about_edMoney->currentText()); |
| | | vecCon.append(condition); |
| | | } |
| | | if(ui->checkBox_changeMoney->isChecked()){ |
| | | QString condition= QString(" 整改金额>='%1' and 整改金额<='%2' ").arg(ui->comboBox_change_bgMoney->currentText()).arg(ui->comboBox_change_edMoney->currentText()); |
| | | QString condition= QString(" 整改金额>=%1 and 整改金额<=%2").arg(ui->comboBox_change_bgMoney->currentText()).arg(ui->comboBox_change_edMoney->currentText()); |
| | | vecCon.append(condition); |
| | | } |
| | | if(ui->checkBox_change_over_time->isChecked()){ |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | void ThreeMergeProblemList::on_pushButton_multiSearch_clicked() |
| | | { |
| | | static int cnt=0; |
| | | if(cnt%2 == 1){ |
| | | ui->groupBox->hide(); |
| | | ui->pushButton_multiSearch->setText("多维度数据查询👆"); |
| | | }else{ |
| | | ui->groupBox->show(); |
| | | ui->pushButton_multiSearch->setText("多维度数据查询👇"); |
| | | } |
| | | cnt++; |
| | | } |
| | | |
| | | void ThreeMergeProblemList::showSaveFile() |
| | | { |
| | | int row = ui->tableWidget->currentRow(); |
| | | auto item = ui->tableWidget->currentItem(); |
| | | if(row>=0 && item){ |
| | | qDebug()<<"row"<<row; |
| | | // 取下标 13 17 23 |
| | | auto item_13 = ui->tableWidget->item(row,13+2); |
| | | auto item_17 = ui->tableWidget->item(row,17+2); |
| | | auto item_23 = ui->tableWidget->item(row,23+2); |
| | | if(item_13){ |
| | | qDebug()<<item_13->text(); |
| | | QString text = item_13->text(); |
| | | QStringList listPath = text.split("/"); |
| | | if(listPath.size() > 2){ |
| | | qDebug()<<"发现文件"<<listPath.back(); |
| | | QString type = listPath.back().split(".").back(); |
| | | qDebug()<<"type"<<type; |
| | | if(type == "pdf"){ |
| | | loadPdfFile(text); |
| | | } |
| | | } |
| | | } |
| | | if(item_17){ |
| | | qDebug()<<item_17->text(); |
| | | } |
| | | if(item_23){ |
| | | qDebug()<<item_23->text(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | void ThreeMergeProblemList::updateComboList(QMap<QString, ComInfo> & nameAndComInfos) |
| | | { |
| | | ui->comboBox_company->clear(); |
| | | |
| | | for(auto it = nameAndComInfos.begin();it != nameAndComInfos.end();++it){ |
| | | ui->comboBox_company->addItem(it.key()); |
| | | } |
| | | } |
| | | |
| | | void ThreeMergeProblemList::on_pushButton_save_export_clicked() |
| | | { |
| | | qDebug()<<"三合一导出保存"; |
| | | } |