From 66fec3359ace6a29f77cbc2e3ff9ed60489d9015 Mon Sep 17 00:00:00 2001 From: 487 <2195436316@qq.com> Date: Tue, 27 Dec 2022 17:11:00 +0800 Subject: [PATCH] =?UTF-8?q?ui=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LibManageSystem_Sever/addbook.cpp | 103 ++++++++++++++++++ .../clientRes/icons8-chat-message-100.png | Bin 0 -> 2088 bytes .../clientRes/icons8-user-64.png | Bin 0 -> 1001 bytes LibManagementSystem/clientResources.qrc | 2 + LibManagementSystem/infoedit.ui | 6 + LibManagementSystem/login.cpp | 2 + LibManagementSystem/mainwidget.ui | 31 +++++- LibManagementSystem/regis.ui | 3 + LibManagementSystem/user_info.cpp | 37 ++++--- LibManagementSystem/user_info.h | 4 +- LibManagementSystem/user_info.ui | 65 +++++++---- 11 files changed, 204 insertions(+), 49 deletions(-) create mode 100644 LibManageSystem_Sever/addbook.cpp create mode 100644 LibManagementSystem/clientRes/icons8-chat-message-100.png create mode 100644 LibManagementSystem/clientRes/icons8-user-64.png diff --git a/LibManageSystem_Sever/addbook.cpp b/LibManageSystem_Sever/addbook.cpp new file mode 100644 index 0000000..41e2d0f --- /dev/null +++ b/LibManageSystem_Sever/addbook.cpp @@ -0,0 +1,103 @@ +#include "addbook.h" +#include "ui_addbook.h" +#include +#include +addbook::addbook(Operat* _db,QWidget *parent) : + QMainWindow(parent),ui(new Ui::addbook), + db(_db) +{ + ui->setupUi(this); + ui->pushButton->setStyleSheet( //正常状态样式 + "QPushButton{" + "background-color:#67a6f8;"//设置按钮背景色 + "border-radius:6px;"//设置圆角半径 + "color:white;"//设置按钮字体颜色 + "}" + ); + QRegularExpression regExp1("[0-9-]+"); + ui->datelEdit->setValidator(new QRegularExpressionValidator(regExp1,this)); + QRegularExpression regExp2("[0-9]+"); + ui->numlEdit->setValidator(new QRegularExpressionValidator(regExp2,this)); + QRegularExpression regExp3("[0-9.]+"); + ui->pricelEdit->setValidator(new QRegularExpressionValidator(regExp3,this)); + ui->isbncodelEdit->setValidator(new QRegularExpressionValidator(regExp2,this)); +} + +addbook::~addbook() +{ + delete ui; +} + +void addbook::removeTEXT() +{ + ui->namelEdit->clear(); + ui->authorlEdit->clear(); + ui->presslEdit->clear(); + ui->datelEdit->clear(); + ui->isbncodelEdit->clear(); + ui->textEdit->clear(); + ui->numlEdit->clear(); + ui->comboBox->setCurrentIndex(0); + ui->pricelEdit->clear(); +} + +void addbook::on_pushButton_clicked() +{ + QString Name=ui->namelEdit->text().trimmed(); + QString Author=ui->authorlEdit->text().trimmed(); + QString Press=ui->presslEdit->text().trimmed(); + QString Printdate=ui->datelEdit->text().trimmed(); + QString Isbn_code=ui->isbncodelEdit->text().trimmed(); + QString Description=ui->textEdit->toPlainText().trimmed(); + QString Num=ui->numlEdit->text().trimmed(); + QString k; + if(ui->comboBox->currentIndex()==0) + { + k=""; + } + else k=ui->comboBox->currentText(); + QString Type=k; + QString Price=ui->pricelEdit->text().trimmed(); + if(!Name.isEmpty()&&!Author.isEmpty()&&!Press.isEmpty()&&!Printdate.isEmpty()&&!Isbn_code.isEmpty()&&!Description.isEmpty()&&!Num.isEmpty()&&!Type.isEmpty()&&!Price.isEmpty()) + { + bool flag=db->addbook(Name,Author,Press,Printdate,Isbn_code,Description,Num,Type,Price); + if(flag==true) + { + QMessageBox::information(this,"提示","添加成功"); + removeTEXT(); + } + else + { + int ret=QMessageBox::question(NULL,"警告","图书馆中已经有该书,是否要前往删改书籍页面?",QMessageBox::Yes|QMessageBox::No,QMessageBox::Yes); + switch(ret) + { + case QMessageBox::Yes: + emit ToEditWidget(); + break; + default: break; + } + } + + } + else QMessageBox::warning(this,"警告","请输入书籍的完整信息"); +} + +void addbook::on_returnBtn_clicked() +{ + emit RetMagWidget(); +} + + +void addbook::on_presslEdit_textChanged(const QString &arg1) +{ + //自动补全选项 + QStringMatcher str("出版社"); + if(str.indexIn(arg1,0) == -1){ + QStringList complete_list; + QCompleter* complete_line; + complete_list << arg1 + "出版社"; + complete_line = new QCompleter(complete_list); + ui->presslEdit->setCompleter(complete_line); + } +} + diff --git a/LibManagementSystem/clientRes/icons8-chat-message-100.png b/LibManagementSystem/clientRes/icons8-chat-message-100.png new file mode 100644 index 0000000000000000000000000000000000000000..060eb3739ead7c69583c94ba750e30313b39d812 GIT binary patch literal 2088 zcmV+@2-o+CP)ijovUhGMcz^p6=a6yXns zkYy?i6CulxWi&NrXzYwOrpA(JA(X;U)URZV7Ae%nJo7&9%$d`@zu$fDz3=pfYCsA zlV^Z^fDynq5gz6yU@fpr|E<-(h2?ADR$y8G6 ze(|wchPyGq&L&Oha3d3>7c2CO+&SSN)78LApFYT%r?*Kuz>fL_dHwX|tGhuuYf=KG z7jq-Y!=C`!nv??Ure4}MpGki&lO)u={K3Q6r80b(i~#iU zSvM^Qjx$L>UC4DFMn0XU;i{*Zg{t29H>IrZLu)#4*7JNfZ#sLO|Hk;p9A3t;Q~N z8j>jKxm9T_#i+AmN04PPIUw#v_VWn1-4kmg83MS^c~;_ywTrU>*{rdVjh+^bt+v3Yq~wTNP}M>PI)SKb;0v#;}gt;>^W6 zR8m1t$Do&^7^HQcqd~~Du`G^oI`FDfZ}40%S%o`=FO6zY-T^KTy?g*Zbta+wPN6GnVr>opu5zC3 zWkCwb=^~q+HL*4a0KJ@NJ2prmIh$v*M@_8F0hG?H*t`&=kQ|t_ce|R^#M&G{Dfih< zN1Ym^kQ|CEvo6K4s^vjqP%+qDQLGDCZ1W|sv2r!cSFb!(&8WmBtg2& z@(LO%UPu6(oVGEE!9h>ZhTm>1@CA4*OmMNaBR^4u-|HEE z*Mf5$y^%I?8I@PqeuHXWlw{$i$GU<_w{S;ANphGGxNv%6T{X$evidK2FE+vTxg^D(UE)1X>+Mzbb*TuA1a! z`J|F|2wRybzu62AYgk@k`-S%FQ7SvaS(At=PT>LvLjW^G~KU2&)8ejLK}-bH}l9RX)mj(@U!%P?;5UA{RAPn`h!~;4`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X*J3|z2x90LvH9z(KIXcTtjbvTN6vH7K-#&pO_z5T!YNBOI4;TLeAj5 z#Mqe1I&2oQ4lnYAeclbZgGKl)F?!uBWIdnA`L)h{rBQI3>D)7djF?GIxh1p-tWS)O zLCmTOzrCvz_|&$cjtv}FdV_I5j}I$r70J)F{>_5WHn7lOUX69c8ET7Zw3o6lv<)mZ zyuf*W^6Xjoyj8WpgMn+30epa`O6z(UFJOD}_tl|o;MQ`IB-RUxI^ayi^7_riv#+=I z1Q?LVUtj7GjQhY;^8cx#h3@1TPLb82P3TpHHzfmDJA#b#G}x5=Nq|#vFWw)}A+}}& zdH0oM#Axud*fEAB&5WXY^tYriDDLXRxP8P{yJ5s~{A3Y;)n14h2<8**7R%%&99>n{P;d-ZU~8!dpb8g{p!bpyb^Tr}!?+wzsH!)O=pMvJrA*AIJUZz1 zcaWJDe=}PS6k~{ESrjT5ut)v;gqLHpBhHC$rx@tG;&c3NWigfGvvsqliUYQrd;Isd z9lcF%t}$7~0hgP5Tw28e6L`(sVQb~~TD^qi1NfqW_V;nHzp(xO*(7E=IyyQ!!W`xw XEgSIE`efJU00000NkvXXu0mjfUANU$ literal 0 HcmV?d00001 diff --git a/LibManagementSystem/clientResources.qrc b/LibManagementSystem/clientResources.qrc index 27458db..ec7b08a 100644 --- a/LibManagementSystem/clientResources.qrc +++ b/LibManagementSystem/clientResources.qrc @@ -4,5 +4,7 @@ clientRes/LibIcon.png clientRes/MainBackGround.png clientRes/education-book.png + clientRes/icons8-user-64.png + clientRes/icons8-chat-message-100.png diff --git a/LibManagementSystem/infoedit.ui b/LibManagementSystem/infoedit.ui index 55ee44f..c5137b6 100644 --- a/LibManagementSystem/infoedit.ui +++ b/LibManagementSystem/infoedit.ui @@ -10,6 +10,9 @@ 392 + + WaitCursor + Form @@ -223,6 +226,9 @@ color:#67a6f8; 13 + + PointingHandCursor + color: rgb(1, 53, 174); border:none; diff --git a/LibManagementSystem/login.cpp b/LibManagementSystem/login.cpp index 6f9f047..00b952a 100644 --- a/LibManagementSystem/login.cpp +++ b/LibManagementSystem/login.cpp @@ -57,6 +57,7 @@ void login::fail_login(QString failmsg) box->setText(failmsg); box->show(); box->setAttribute(Qt::WA_DeleteOnClose); +// qDebug() << "登陆失败"; } void login::receive_login() @@ -64,6 +65,7 @@ void login::receive_login() ui->accountlineEdit->clear(); ui->passwordlineEdit->clear(); emit open_main(); +// qDebug() << "登陆成功"; } void login::fail_regis(QString failmsg) diff --git a/LibManagementSystem/mainwidget.ui b/LibManagementSystem/mainwidget.ui index 3409aa6..87a81bb 100644 --- a/LibManagementSystem/mainwidget.ui +++ b/LibManagementSystem/mainwidget.ui @@ -22,6 +22,9 @@ Form + + + #mainwidget{ background-image: url(:/images/clientRes/MainBackGround.png); @@ -132,9 +135,9 @@ QPushButton:hover{ - 560 - 4 - 141 + 10 + 0 + 41 41 @@ -147,9 +150,25 @@ QPushButton:hover{ PointingHandCursor - + 个人中心 + + + + + + + + + :/images/clientRes/icons8-user-64.png:/images/clientRes/icons8-user-64.png + + + + 35 + 35 + + false @@ -210,6 +229,8 @@ border-color:"transparent" - + + + diff --git a/LibManagementSystem/regis.ui b/LibManagementSystem/regis.ui index 7b48d86..9fb441c 100644 --- a/LibManagementSystem/regis.ui +++ b/LibManagementSystem/regis.ui @@ -327,6 +327,9 @@ color:#67a6f8; 13 + + PointingHandCursor + color: rgb(1, 53, 174); border:none; diff --git a/LibManagementSystem/user_info.cpp b/LibManagementSystem/user_info.cpp index 9c7e0e4..e3d6b65 100644 --- a/LibManagementSystem/user_info.cpp +++ b/LibManagementSystem/user_info.cpp @@ -130,24 +130,6 @@ void user_info::on_infoEdit_clicked() fillInfo(); } -void user_info::on_commandLinkButton_clicked() -{ - if(user->message != "无"){ - QMessageBox* box = new QMessageBox(this); - box->setIcon(QMessageBox::Information); - box->setWindowTitle("消息"); - box->setText(user->message); - box->show(); - } - else{ - QMessageBox* box = new QMessageBox(this); - box->setIcon(QMessageBox::Information); - box->setWindowTitle("消息"); - box->setText("当前无消息!"); - box->show(); - } -} - void user_info::edit_confirm(QByteArray msg) { emit send_editInfo(msg); @@ -239,3 +221,22 @@ void user_info::receive_cancel() user->appointedbook = ""; fillInfo(); } + +void user_info::on_pushButton_clicked() +{ + if(user->message != ""){ + QMessageBox* box = new QMessageBox(this); + box->setIcon(QMessageBox::Information); + box->setWindowTitle("消息"); + box->setText(user->message); + box->show(); + } + else{ + QMessageBox* box = new QMessageBox(this); + box->setIcon(QMessageBox::Information); + box->setWindowTitle("消息"); + box->setText("当前无消息!"); + box->show(); + } +} + diff --git a/LibManagementSystem/user_info.h b/LibManagementSystem/user_info.h index dc88013..c7a7e42 100644 --- a/LibManagementSystem/user_info.h +++ b/LibManagementSystem/user_info.h @@ -40,8 +40,6 @@ private slots: void on_infoEdit_clicked(); - void on_commandLinkButton_clicked(); - void edit_confirm(QByteArray); void on_exit_clicked(); @@ -50,6 +48,8 @@ private slots: void on_cancekApp_clicked(); + void on_pushButton_clicked(); + public slots: void fail_editInfo(QString); diff --git a/LibManagementSystem/user_info.ui b/LibManagementSystem/user_info.ui index aa7fe5c..e2403f3 100644 --- a/LibManagementSystem/user_info.ui +++ b/LibManagementSystem/user_info.ui @@ -424,28 +424,6 @@ background-color:"transparent"; 书籍信息: - - - - 640 - 0 - 141 - 41 - - - - - Segoe UI - 12 - - - - PointingHandCursor - - - 我的消息 - - @@ -533,6 +511,43 @@ color:#67a6f8; × 取消预约书籍 + + + + 670 + 6 + 131 + 41 + + + + + 11 + + + + PointingHandCursor + + + color: rgb(255, 255, 255); + + + 我的消息 + + + + :/images/clientRes/icons8-chat-message-100.png:/images/clientRes/icons8-chat-message-100.png + + + + 20 + 20 + + + + true + + infoEdit return_2 sex @@ -550,11 +565,13 @@ color:#67a6f8; phone book_view app_book_2 - commandLinkButton exit cancekApp + pushButton - + + + -- Gitee