From efddb5166089573f9b2508d30b217ddebbb2fab2 Mon Sep 17 00:00:00 2001
From: wumu <mayi@mayi.com>
Date: 星期二, 08 十月 2024 22:48:55 +0800
Subject: [PATCH] 1008

---
 internal_system_v1/threemergeproblemlist.cpp |   75 +++++++++++++++++++++++++++++++++++--
 1 files changed, 70 insertions(+), 5 deletions(-)

diff --git a/internal_system_v1/threemergeproblemlist.cpp b/internal_system_v1/threemergeproblemlist.cpp
index cea9c81..b25ef6b 100644
--- a/internal_system_v1/threemergeproblemlist.cpp
+++ b/internal_system_v1/threemergeproblemlist.cpp
@@ -7,6 +7,8 @@
 #include <QDir>
 #include <QFileDevice>
 
+#pragma execution_character_set("utf-8")
+
 ThreeMergeProblemList::ThreeMergeProblemList(QWidget *parent) :
     QMainWindow(parent),
     ui(new Ui::ThreeMergeProblemList)
@@ -39,6 +41,10 @@
     ui->line_2->hide();
 
     ui->groupBox->hide(); // 棣栨鍏堥殣钘�
+
+    // pdf鏂囦欢鐩稿叧
+    //m_pdfView = new QWebEngineView();
+
 
 }
 
@@ -95,6 +101,15 @@
         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;
@@ -189,6 +204,22 @@
         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()
 {
@@ -433,12 +464,14 @@
     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()));
 
 }
 
@@ -767,11 +800,11 @@
 
     }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());
 
     }
 
@@ -872,15 +905,15 @@
         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()){
@@ -930,3 +963,35 @@
     }
     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();
+        }
+    }
+}

--
Gitblit v1.8.0