mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Заготовка для Карточки обучаемого
This commit is contained in:
@@ -28,7 +28,10 @@ add_library(InstructorsAndTrainees SHARED
|
||||
trainees/viewertrainees.h
|
||||
trainees/viewertrainees.ui
|
||||
trainees/traineesview.cpp
|
||||
trainees/traineesview.h
|
||||
trainees/traineesview.h
|
||||
trainees/personalcardtrainee.cpp
|
||||
trainees/personalcardtrainee.h
|
||||
trainees/personalcardtrainee.ui
|
||||
|
||||
instructors/viewerinstructors.cpp
|
||||
instructors/viewerinstructors.h
|
||||
|
||||
36
InstructorsAndTrainees/trainees/personalcardtrainee.cpp
Normal file
36
InstructorsAndTrainees/trainees/personalcardtrainee.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#include "personalcardtrainee.h"
|
||||
#include "ui_personalcardtrainee.h"
|
||||
|
||||
PersonalCardTrainee::PersonalCardTrainee(ConnectorToServer* connectorToServer, int id_trainee, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
connectorToServer(connectorToServer),
|
||||
id_trainee(id_trainee),
|
||||
ui(new Ui::PersonalCardTrainee)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
loadInfo();
|
||||
}
|
||||
|
||||
PersonalCardTrainee::~PersonalCardTrainee()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void PersonalCardTrainee::loadInfo()
|
||||
{
|
||||
Trainee trainee = connectorToServer->getTrainee(id_trainee);
|
||||
|
||||
ui->lblName->setText(trainee.getName());
|
||||
|
||||
if(trainee.getLoggedIn())
|
||||
ui->lblLoginIn->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGreen.png")));
|
||||
else
|
||||
ui->lblLoginIn->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGray.png")));
|
||||
|
||||
QList<TaskAmmFim> listTasksAMM = connectorToServer->getListTasksAMMforTrainee(id_trainee);
|
||||
QList<TaskAmmFim> listTasksFIM = connectorToServer->getListTasksFIMforTrainee(id_trainee);
|
||||
|
||||
ui->lblCntAMM->setText(QString::number(listTasksAMM.count()));
|
||||
ui->lblCntFIM->setText(QString::number(listTasksFIM.count()));
|
||||
}
|
||||
30
InstructorsAndTrainees/trainees/personalcardtrainee.h
Normal file
30
InstructorsAndTrainees/trainees/personalcardtrainee.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef PERSONALCARDTRAINEE_H
|
||||
#define PERSONALCARDTRAINEE_H
|
||||
|
||||
#include"connectortoserver.h"
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class PersonalCardTrainee;
|
||||
}
|
||||
|
||||
class PersonalCardTrainee : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PersonalCardTrainee(ConnectorToServer* connectorToServer, int id_trainee, QWidget *parent = nullptr);
|
||||
~PersonalCardTrainee();
|
||||
|
||||
private:
|
||||
void loadInfo();
|
||||
|
||||
private:
|
||||
ConnectorToServer* connectorToServer;
|
||||
int id_trainee;
|
||||
|
||||
private:
|
||||
Ui::PersonalCardTrainee *ui;
|
||||
};
|
||||
|
||||
#endif // PERSONALCARDTRAINEE_H
|
||||
229
InstructorsAndTrainees/trainees/personalcardtrainee.ui
Normal file
229
InstructorsAndTrainees/trainees/personalcardtrainee.ui
Normal file
@@ -0,0 +1,229 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>PersonalCardTrainee</class>
|
||||
<widget class="QWidget" name="PersonalCardTrainee">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>537</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Trainee</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblName">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblLoginIn">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../resources.qrc">:/resources/icons/circleGray.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>Last login time</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblLoginTime">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Assigned FIM</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblCntFIM">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Assigned AMM</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblCntAMM">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Time of operation</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblTimeOperation">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>Last time of exit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblTimeExit">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>300</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>320</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><Здесь будет мессенджер></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><Здесь будут задачи></string>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "editortrainees.h"
|
||||
#include "viewertrainees.h"
|
||||
#include "personalcardtrainee.h"
|
||||
#include "ui_viewertrainees.h"
|
||||
|
||||
ViewerTrainees::ViewerTrainees(ConnectorToServer* connectorToServer, QWidget *parent) :
|
||||
@@ -11,6 +12,7 @@ ViewerTrainees::ViewerTrainees(ConnectorToServer* connectorToServer, QWidget *pa
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(treeWidget, &QTreeWidget::currentItemChanged, this, &ViewerTrainees::on_treeWidget_currentItemChanged);
|
||||
connect(treeWidget, &QTreeWidget::itemDoubleClicked, this, &ViewerTrainees::on_itemDoubleClicked);
|
||||
|
||||
ui->horizontalLayout_11->addWidget(treeWidget);
|
||||
|
||||
@@ -154,6 +156,30 @@ void ViewerTrainees::on_treeWidget_currentItemChanged(QTreeWidgetItem *current,
|
||||
}
|
||||
}
|
||||
|
||||
void ViewerTrainees::on_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
||||
{
|
||||
if(item == nullptr)
|
||||
return;
|
||||
|
||||
if(item->childCount() == 0)
|
||||
{//Выбран обучаемый
|
||||
QString login = item->text(ColumnsTreeTrainees::clmn_Login);
|
||||
if(login != "")
|
||||
{
|
||||
int id_trainee = connectorToServer->getIdTraineeByLogin(login);
|
||||
|
||||
PersonalCardTrainee cardTrainee(connectorToServer, id_trainee, this);
|
||||
|
||||
QDialog* dialog = new QDialog(this);
|
||||
QHBoxLayout *layout = new QHBoxLayout(dialog);
|
||||
layout->addWidget(&cardTrainee);
|
||||
dialog->setWindowTitle(tr("Personal card trainee"));
|
||||
dialog->setMinimumSize(1600, 800);
|
||||
dialog->exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ViewerTrainees::updateButtons()
|
||||
{
|
||||
if(authComplited)
|
||||
|
||||
@@ -36,6 +36,7 @@ public Q_SLOTS:
|
||||
void on_btnEditorTrainees_clicked();
|
||||
private Q_SLOTS:
|
||||
void on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
|
||||
void on_itemDoubleClicked(QTreeWidgetItem *item, int column);
|
||||
|
||||
public Q_SLOTS:
|
||||
//слот обработки сигнала об изменении вкладки диалога в мессенджере
|
||||
|
||||
Reference in New Issue
Block a user