|
@@ -23,6 +23,26 @@ CBindSchoolInfo::CBindSchoolInfo(QWidget *parent)
|
|
connect(ui.pushButton_ok, SIGNAL(clicked()), this, SLOT(slot_clickButton()));
|
|
connect(ui.pushButton_ok, SIGNAL(clicked()), this, SLOT(slot_clickButton()));
|
|
connect(ui.pushButton_canncel, SIGNAL(clicked()), this, SLOT(slot_clickButton()));
|
|
connect(ui.pushButton_canncel, SIGNAL(clicked()), this, SLOT(slot_clickButton()));
|
|
connect(ui.comboBox_school, SIGNAL(currentIndexChanged(int)), this, SLOT(slot_comboxIndexChange(int)));
|
|
connect(ui.comboBox_school, SIGNAL(currentIndexChanged(int)), this, SLOT(slot_comboxIndexChange(int)));
|
|
|
|
+ connect(ui.comboBox_school, &QComboBox::editTextChanged, this, [=](QString strContext){
|
|
|
|
+ QCompleter * pCompleter = ui.comboBox_school->completer();
|
|
|
|
+ int nRow = pCompleter->completionCount();
|
|
|
|
+ //无法从前50个学校中获取时,调用后端接口获取
|
|
|
|
+ if (nRow == 0)
|
|
|
|
+ {
|
|
|
|
+ m_vctschool.clear();
|
|
|
|
+ RequestSchoolInfo(strContext);
|
|
|
|
+ for (auto& iter : m_vctschool)
|
|
|
|
+ {
|
|
|
|
+ QString strName(QString::number(iter.schoolId));
|
|
|
|
+ strName.append("-");
|
|
|
|
+ strName.append(iter.schoolName);
|
|
|
|
+ strName.append("-");
|
|
|
|
+ strName.append(iter.schoolArea);
|
|
|
|
+ ui.comboBox_school->addItem(strName, iter.schoolId);
|
|
|
|
+ }
|
|
|
|
+ pCompleter->popup();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
|
|
RequestSchoolInfo();
|
|
RequestSchoolInfo();
|
|
CheckBindSchool();
|
|
CheckBindSchool();
|
|
@@ -33,13 +53,16 @@ CBindSchoolInfo::~CBindSchoolInfo()
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-void CBindSchoolInfo::RequestSchoolInfo()
|
|
|
|
|
|
+void CBindSchoolInfo::RequestSchoolInfo(QString strSchoolName)
|
|
{
|
|
{
|
|
WCHAR server_url[MAX_PATH] = { 0 };
|
|
WCHAR server_url[MAX_PATH] = { 0 };
|
|
GetPrivateProfileString(L"USER", L"server_url", L"", server_url, MAX_PATH, g_strConfigPath.c_str());
|
|
GetPrivateProfileString(L"USER", L"server_url", L"", server_url, MAX_PATH, g_strConfigPath.c_str());
|
|
|
|
|
|
QString url(QString::fromStdWString(server_url));
|
|
QString url(QString::fromStdWString(server_url));
|
|
- url.append("/teacher/third/school?schoolName=""");
|
|
|
|
|
|
+ if (strSchoolName.isEmpty())
|
|
|
|
+ strSchoolName = "";
|
|
|
|
+ QString strUrl = QString("/teacher/third/school?schoolName=%1").arg(strSchoolName);
|
|
|
|
+ url.append(strUrl.toStdString().c_str());
|
|
|
|
|
|
QNetworkRequest request;
|
|
QNetworkRequest request;
|
|
request.setUrl(url);
|
|
request.setUrl(url);
|