|
@@ -157,8 +157,6 @@ void ExpertManageView::slotDetailClicked()
|
|
|
}
|
|
|
QFUser *user = m_userList[row];
|
|
|
|
|
|
- qDebug() << __FUNCTION__ << __LINE__ << user->id << user->userNo << user->userName << user->role << user->remark;
|
|
|
-
|
|
|
showExpertInfo(user);
|
|
|
}
|
|
|
|
|
@@ -166,6 +164,7 @@ void ExpertManageView::slotDeleteClicked()
|
|
|
{
|
|
|
hideExpertInfoWidget();
|
|
|
MessageBox *m = new MessageBox("删除专家信息", "删除后不可恢复,确认删除?", topLevelWidget());
|
|
|
+ connect(m, &MessageBox::yesSignal, this, &ExpertManageView::slotConfirmDeleteExpert);
|
|
|
m->exec();
|
|
|
}
|
|
|
|
|
@@ -190,10 +189,24 @@ void ExpertManageView::slotConfirmAddExpert()
|
|
|
int code = ExpertManager::addUser(*user);
|
|
|
QFDAlert::showAlertWithCode(code, this);
|
|
|
|
|
|
- qDebug() << __FUNCTION__ << __LINE__ << code << user->id << user->userNo << user->userName;
|
|
|
-
|
|
|
if (code == QF_CODE_ADD_USER_SUCCEEDED) {
|
|
|
hideExpertInfoWidget();
|
|
|
refreshList();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+void ExpertManageView::slotConfirmDeleteExpert()
|
|
|
+{
|
|
|
+ int row = m_expertListWidget->selectedRow();
|
|
|
+ if (row < 0 || row >= m_userList.count()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ QFUser *user = m_userList[row];
|
|
|
+
|
|
|
+ int code = ExpertManager::deleteUser(user->id);
|
|
|
+ QFDAlert::showAlertWithCode(code, this);
|
|
|
+
|
|
|
+ if (code == QF_CODE_DELETE_USER_SUCCEEDED) {
|
|
|
+ refreshList();
|
|
|
+ }
|
|
|
+}
|