Browse Source

V1.6.3
1、修复了一些bug

Apple 1 month ago
parent
commit
6e9fcd8f37

+ 6 - 6
TransmitterSwitch/ExecPlanData/plancard.cpp

@@ -192,7 +192,7 @@ void PlanCard::deletePlanItem(const enum_WeekDay weekDay, const QDateTime& time,
     }
     }
 }
 }
 
 
-/* 删除一项,传入行号 */
+/* 删除一项,传入行号,传入的是原始行号 */
 PlanInfo PlanCard::deletePlanItem(const int row)
 PlanInfo PlanCard::deletePlanItem(const int row)
 {
 {
     if(row < 0 || row >= m_model->rowCount())
     if(row < 0 || row >= m_model->rowCount())
@@ -200,10 +200,10 @@ PlanInfo PlanCard::deletePlanItem(const int row)
         return PlanInfo(); /* 没有选中行 */
         return PlanInfo(); /* 没有选中行 */
     }
     }
     /* 获取原始模型的行号 */
     /* 获取原始模型的行号 */
-    auto sourceRow = m_sortModel->mapToSource(m_sortModel->index(row, 0)).row();
+    // auto sourceRow = m_sortModel->mapToSource(m_sortModel->index(row, 0)).row();
     /* 获取该行计划 */
     /* 获取该行计划 */
-    auto item1 = m_model->item(sourceRow, 0);
-    auto item2 = m_model->item(sourceRow, 1);
+    auto item1 = m_model->item(row, 0);
+    auto item2 = m_model->item(row, 1);
     PlanInfo info;
     PlanInfo info;
     info.onWeekDay = static_cast<enum_WeekDay>(item1->data(UserRole_WeekDay).toInt());
     info.onWeekDay = static_cast<enum_WeekDay>(item1->data(UserRole_WeekDay).toInt());
     info.onDateTime = item1->data(UserRole_Time).toDateTime();
     info.onDateTime = item1->data(UserRole_Time).toDateTime();
@@ -211,7 +211,7 @@ PlanInfo PlanCard::deletePlanItem(const int row)
     info.offDateTime = item2->data(UserRole_Time).toDateTime();
     info.offDateTime = item2->data(UserRole_Time).toDateTime();
 
 
     /* 删除该行 */
     /* 删除该行 */
-    m_model->removeRow(sourceRow);
+    m_model->removeRow(row);
 
 
     /* 判断数据有没有空 */
     /* 判断数据有没有空 */
     if(m_model->rowCount() == 0)
     if(m_model->rowCount() == 0)
@@ -356,7 +356,7 @@ void PlanCard::setPlanList(const QList<PlanInfo>& list)
 
 
 
 
 /**
 /**
- * @brief 获取选中的行,返回的是表面上的行号,不是实际的真实行号,真实行号需要通过sortModel来获取
+ * @brief 获取选中的行,返回的是真实行号
  * 
  * 
  * @return int 
  * @return int 
  */
  */

+ 13 - 4
TransmitterSwitch/ManagerPlan/managerplan.cpp

@@ -657,16 +657,16 @@ void ManagerPlan::do_deletePlanItem()
     auto& list = findPlanList(chnID);
     auto& list = findPlanList(chnID);
 
 
     /* 获取选中的行 */
     /* 获取选中的行 */
-    auto index = ui->pCard->getSelectedRow();
-    if(index < 0 || index >= list.size())
+    auto row = ui->pCard->getSelectedRow();
+    if(row < 0 || row >= list.size())
     {
     {
         /* 没有选中行 */
         /* 没有选中行 */
         TipWidget::display(TipWidget::OPERATOR_WARN, "没有选中行!", this);
         TipWidget::display(TipWidget::OPERATOR_WARN, "没有选中行!", this);
         return;
         return;
     }
     }
-    LH_WRITE_LOG_DEBUG(QString("删除行: %1").arg(index));
+    LH_WRITE_LOG_DEBUG(QString("删除行: %1").arg(row));
     /* 删除选中的行 */
     /* 删除选中的行 */
-    auto plan = ui->pCard->deletePlanItem(index);
+    auto plan = ui->pCard->deletePlanItem(row);
     /* 删除UI的计划 */
     /* 删除UI的计划 */
     list.removeOne(plan);
     list.removeOne(plan);
 
 
@@ -719,6 +719,15 @@ void ManagerPlan::do_tableView_clicked(PlanInfo& info)
         ui->dateEdit_specialEnd->setDate(info.offDateTime.date());
         ui->dateEdit_specialEnd->setDate(info.offDateTime.date());
         ui->timeEdit_specialEnd->setTime(info.offDateTime.time());
         ui->timeEdit_specialEnd->setTime(info.offDateTime.time());
     }
     }
+    /* 判断是正常日还是特殊日,自动切换显示的页面 */
+    if(info.onWeekDay != enum_WeekDay::WeekDay_Special)
+    {
+        /* 正常日 */
+        ui->tabWidget->setCurrentIndex(0);
+    }else {
+        /* 特殊日 */
+        ui->tabWidget->setCurrentIndex(1);
+    }
 }
 }
 
 
 
 

+ 1 - 1
TransmitterSwitch/Resource/QSS/white/importtemplate.qss

@@ -168,7 +168,7 @@ QTableWidget::item
 QTableWidget::item:selected
 QTableWidget::item:selected
 {
 {
     color: #FFFFFF;
     color: #FFFFFF;
-    background: #4458FE;
+    background: #93a3f2;
 }
 }
 
 
 /* ==========================================================
 /* ==========================================================

+ 1 - 1
TransmitterSwitch/Template/importtemplate.cpp

@@ -138,7 +138,7 @@ void ImportTemplate::do_checkBox_stateChanged(int state)
 void ImportTemplate::showEvent(QShowEvent *event)
 void ImportTemplate::showEvent(QShowEvent *event)
 {
 {
     /* 设置列宽度 */
     /* 设置列宽度 */
-    int width = (ui->tableWidget->width() - 88 - 16) / 2;
+    int width = (ui->tableWidget->width() - 88 - 24) / 2;
     ui->tableWidget->setColumnWidth(0, width);
     ui->tableWidget->setColumnWidth(0, width);
     ui->tableWidget->setColumnWidth(1, width);
     ui->tableWidget->setColumnWidth(1, width);
     ui->tableWidget->setColumnWidth(2, 88);
     ui->tableWidget->setColumnWidth(2, 88);

+ 1 - 1
TransmitterSwitch/transmitterswitch.ui

@@ -170,7 +170,7 @@
                </size>
                </size>
               </property>
               </property>
               <property name="text">
               <property name="text">
-               <string>复制到其他发射机</string>
+               <string>复制到其他频率</string>
               </property>
               </property>
              </widget>
              </widget>
             </item>
             </item>