| | |
| | | #include <QDir> |
| | | #include <QFileDevice> |
| | | |
| | | #pragma execution_character_set("utf-8") |
| | | |
| | | ThreeMergeProblemList::ThreeMergeProblemList(QWidget *parent) : |
| | | QMainWindow(parent), |
| | | ui(new Ui::ThreeMergeProblemList) |
| | |
| | | ui->line_2->hide(); |
| | | |
| | | ui->groupBox->hide(); // 首次先隐藏 |
| | | |
| | | // pdf文件相关 |
| | | //m_pdfView = new QWebEngineView(); |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | 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() |
| | | { |
| | |
| | | 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())); |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | }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()); |
| | | |
| | | } |
| | | |
| | |
| | | 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()){ |
| | |
| | | } |
| | | 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); |
| | | auto item_17 = ui->tableWidget->item(row,17); |
| | | auto item_23 = ui->tableWidget->item(row,23); |
| | | 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(); |
| | | } |
| | | } |
| | | } |