mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
commitTMP
This commit is contained in:
@@ -30,6 +30,7 @@ AMMtasksWidget::AMMtasksWidget(ConnectorToServer* connectorToServer, QWidget *pa
|
||||
preparationTreeWidget();
|
||||
|
||||
ui->btnAssignTaskToTrainee->setEnabled(false);
|
||||
ui->btnUpdateTasks->setVisible(false);
|
||||
|
||||
threadPreparation = new QThread();
|
||||
taskTreePreparation = new TaskTreePreparation();
|
||||
|
||||
@@ -21,54 +21,45 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>AMM</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_1"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Code</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editCode">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnUpdateTasks">
|
||||
<property name="text">
|
||||
<string>Update List</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnAssignTaskToTrainee">
|
||||
<property name="text">
|
||||
<string>Assign task</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_1"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Code</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editCode">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnUpdateTasks">
|
||||
<property name="text">
|
||||
<string>Update List</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnAssignTaskToTrainee">
|
||||
<property name="text">
|
||||
<string>Assign task</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <QFile>
|
||||
#include <QMessageBox>
|
||||
#include <QTreeWidget>
|
||||
#include <QThread>
|
||||
#include "fimtaskswidget.h"
|
||||
#include "ui_fimtaskswidget.h"
|
||||
#include "tasksAmmFim.h"
|
||||
@@ -10,10 +11,14 @@ FIMtasksWidget::FIMtasksWidget(ConnectorToServer* connectorToServer, QWidget *pa
|
||||
QWidget(parent),
|
||||
ui(new Ui::FIMtasksWidget),
|
||||
connectorToServer(connectorToServer),
|
||||
treeWidget(nullptr),
|
||||
userName(""),
|
||||
loginTraineeSelected("")
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
qDebug() << "FIMtasksWidget init thread ID " << QThread::currentThreadId();
|
||||
|
||||
treeWidget = new QTreeWidget();
|
||||
ui->horizontalLayout_1->addWidget(treeWidget);
|
||||
|
||||
@@ -22,6 +27,7 @@ FIMtasksWidget::FIMtasksWidget(ConnectorToServer* connectorToServer, QWidget *pa
|
||||
preparationTreeWidget();
|
||||
|
||||
ui->btnAssignTaskToTrainee->setEnabled(false);
|
||||
ui->btnUpdateTasks->setVisible(false);
|
||||
}
|
||||
|
||||
FIMtasksWidget::~FIMtasksWidget()
|
||||
@@ -145,8 +151,8 @@ void FIMtasksWidget::fillTree()
|
||||
|
||||
itemTask->setText(0, task->title);
|
||||
itemTask->setText(1, QString::number(task->id));
|
||||
itemTask->setFlags(itemTask->flags() | Qt::ItemIsUserCheckable);
|
||||
itemTask->setCheckState(0, Qt::Checked);
|
||||
//itemTask->setFlags(itemTask->flags() | Qt::ItemIsUserCheckable);
|
||||
//itemTask->setCheckState(0, Qt::Checked);
|
||||
itemTask->setIcon(0, QIcon(":/resources/icons/procedure.png"));
|
||||
|
||||
treeWidget->addTopLevelItem(itemTask);
|
||||
@@ -201,11 +207,13 @@ void FIMtasksWidget::reSetHeadTreeWidget()
|
||||
|
||||
void FIMtasksWidget::slot_NeedUpdateUI()
|
||||
{
|
||||
qDebug() << "FIMtasksWidget::slot_NeedUpdateUI thread ID " << QThread::currentThreadId();
|
||||
loadTasksFIM();
|
||||
}
|
||||
|
||||
void FIMtasksWidget::slot_traineeSelected(QString login)
|
||||
{
|
||||
qDebug() << "FIMtasksWidget::slot_traineeSelected thread ID " << QThread::currentThreadId();
|
||||
loginTraineeSelected = login;
|
||||
}
|
||||
|
||||
@@ -241,6 +249,17 @@ void FIMtasksWidget::deleteAllTaskAmmFim()
|
||||
listTaskAmmFim.clear();
|
||||
}
|
||||
|
||||
void FIMtasksWidget::updateTaskItem(QTreeWidgetItem *itemTask)
|
||||
{
|
||||
for (int i = 0; i < itemTask->childCount(); i++)
|
||||
{
|
||||
QTreeWidgetItem* itemMalfunction = itemTask->child(i);
|
||||
itemMalfunction->setCheckState(0, Qt::Checked);
|
||||
itemMalfunction->setExpanded(false);
|
||||
}
|
||||
itemTask->setExpanded(false);
|
||||
}
|
||||
|
||||
void FIMtasksWidget::on_btnUpdateTasks_clicked()
|
||||
{
|
||||
connectorToServer->sendQueryTasksXML("fim");
|
||||
@@ -265,5 +284,7 @@ void FIMtasksWidget::on_btnAssignTaskToTrainee_clicked()
|
||||
taskNew.title = task->title;
|
||||
|
||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_ASSIGN_TASK_FIM_TO_TRAINEE, trainee_id, &taskNew);
|
||||
|
||||
updateTaskItem(current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,18 +43,18 @@ public Q_SLOTS:
|
||||
void slot_traineeSelected(QString login);
|
||||
|
||||
private:
|
||||
TaskAmmFim* getTaskByID(int id);
|
||||
void loadFIMtasksFromXML(QByteArray array);
|
||||
void fillTree();
|
||||
|
||||
void preparationTreeWidget();
|
||||
void reSetHeadTreeWidget();
|
||||
|
||||
void fillTree();
|
||||
|
||||
void loadTasksFIM();
|
||||
|
||||
TaskAmmFim* getTaskByID(int id);
|
||||
void deleteAllTaskAmmFim();
|
||||
|
||||
void updateTaskItem(QTreeWidgetItem *itemTask);
|
||||
|
||||
private:
|
||||
Ui::FIMtasksWidget *ui;
|
||||
ConnectorToServer* connectorToServer;
|
||||
|
||||
@@ -15,49 +15,40 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_1"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>FIM</string>
|
||||
<widget class="QToolButton" name="btnUpdateTasks">
|
||||
<property name="text">
|
||||
<string>Update List</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnAssignTaskToTrainee">
|
||||
<property name="text">
|
||||
<string>Assign task</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Code</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editCode">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="4" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnUpdateTasks">
|
||||
<property name="text">
|
||||
<string>Update List</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnAssignTaskToTrainee">
|
||||
<property name="text">
|
||||
<string>Assign task</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Code</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editCode"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_1"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
Reference in New Issue
Block a user