User operation log, v1
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "event/EventCenter.h"
|
||||
#include "AccountFormDialog.h"
|
||||
#include <qDebug>
|
||||
#include "log/UserOperationLog.h"
|
||||
|
||||
#define ADD_CENTER_ITEM(row,col,text)\
|
||||
item = new QTableWidgetItem(text);\
|
||||
@@ -137,7 +138,8 @@ SelectFormWidget::SelectFormWidget(QWidget *parent) :
|
||||
});
|
||||
connect(edit_patient, &EditPatientForm::editAccept,[=](PatientInformation* inf){
|
||||
int selectedRow = currentRow;
|
||||
if (inf->PatientUID.isEmpty()) {
|
||||
bool isAdd = inf->PatientUID.isEmpty();
|
||||
if (isAdd) {
|
||||
selectedRow = model->rowCount();
|
||||
inf->PatientUID = QUuid::createUuid().toString();
|
||||
printf(inf->PatientUID.toStdString().data());
|
||||
@@ -155,6 +157,13 @@ SelectFormWidget::SelectFormWidget(QWidget *parent) :
|
||||
else{
|
||||
//TODO:add some error handle logic
|
||||
}
|
||||
if(isAdd){
|
||||
LOG_USER_OPERATION(AddPatient);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_USER_OPERATION(ChangePatientInfo);
|
||||
}
|
||||
btnSelect->setEnabled(true);
|
||||
});
|
||||
|
||||
@@ -170,11 +179,12 @@ SelectFormWidget::SelectFormWidget(QWidget *parent) :
|
||||
table->selectRow(0);
|
||||
model->selectRow(0);
|
||||
PatientInformation pat;
|
||||
#define ADD_PATIENT_PROPERTY(val)\
|
||||
pat. val = model->data(model->index(0,PatientInformationEnum:: val)).toString();
|
||||
#define ADD_PATIENT_PROPERTY(val)\
|
||||
pat. val = model->data(model->index(0,PatientInformationEnum:: val)).toString();
|
||||
EDIT_PATIENT()
|
||||
#undef ADD_PATIENT_PROPERTY
|
||||
#undef ADD_PATIENT_PROPERTY
|
||||
edit_patient->setPatientInformation(&pat);
|
||||
LOG_USER_OPERATION(DeletePatient);
|
||||
} else{
|
||||
currentRow=-1;
|
||||
}
|
||||
@@ -188,6 +198,7 @@ SelectFormWidget::SelectFormWidget(QWidget *parent) :
|
||||
connect(btnSelect, &QToolButton::clicked,[=](){
|
||||
if (currentRow<0)return;
|
||||
EventCenter::Default()->triggerEvent(GUIEvents::PatientSelected, nullptr,edit_patient->getPatientInformation()->Copy());
|
||||
LOG_USER_OPERATION(SelectPatient);
|
||||
});
|
||||
|
||||
connect(btnAccount, &QToolButton::clicked,[=](){
|
||||
|
||||
Reference in New Issue
Block a user