• 【HTML】原生js实现的图书馆管理系统


    1、引言

    设计结课作业,课程设计无处下手,网页要求的总数量太多?没有合适的模板?数据库,java,python,vue,html作业复杂工程量过大?毕设毫无头绪等等一系列问题。你想要解决的问题,在微信公众号“coding加油站”中全部会得到解决

    2、作品介绍

    原生js实现的图书馆管理系统采用html,css,js技术来实现,符合所学知识体系,适用于常见的作业以及课程设计,需要获取更多的作品,请关注微信公众号:coding加油站,获取,如需更多资料,可在微信后台留言。欢迎大家来提问,交流学习。

    2.1、作品简介方面 

    原生js实现的图书馆管理系统采用常规方式来实现,符合绝大部分的要求。代码配置有相关文档讲解,如需从代码中学到知识点,那么这个作品将是你的不二之选

    2.2、作品二次开发工具

    此作品代码相对简单,基本使用课堂中所学知识点来完成,只需要修改相关的介绍文字,一些图片,就可以改为自己独一无二的代码,网页作品下载后可使用任意编辑软件(例如:DW、HBuilder、NotePAD 、Vscode 、Sublime 、Webstorm 所有编辑器均可使用),java,python等相关作业使用自己常使用的工具亦可完成相关二次开发。

    2.3、作品技术介绍

    html网页作品技术方面:使用CSS制作了网页背景图、鼠标经过及选中导航变色效果、下划线等相关技术来美化相关界面,部分采用了javascript来做校验。 使用html5,以及css3等相关技术完成技术的布局,在本作品中,会使用常见的布局,常见的浮动布局,flex布局都会有使用到哦。同时在操作方面上运用了html5和css3,采用了div+css结构、表单、超链接、浮动、绝对定位、相对定位、字体样式、引用视频等基础知识,同时使用了一些js的相关知识。例如使用到了dom,和bom来获取浏览器的相关api,同时使用css对样式进行相关的美化,使得界面更加符合网页设计

    3、作品演示

    【coding加油站】原生js实现的图书管理系统

    3.1、登录页

     相关代码:

    1. html>
    2. <html lang="en">
    3. <head>
    4. <meta charset="UTF-8">
    5. <title>1title>
    6. <style>
    7. .div1{
    8. width:400px;
    9. height:220px;
    10. margin:0 auto;
    11. position:absolute;
    12. left:40%;
    13. top:35%;
    14. background: none repeat scroll 0 0 skyblue;
    15. border: 1px solid brown;
    16. height: 250px;
    17. padding-top: 30px;
    18. text-align: center;
    19. }
    20. style>
    21. head>
    22. <body>
    23. <div class="bg">div>
    24. <div class="div1" id="loginBox">
    25. <form action="LoginServlet" method="post">
    26. <h3>图书管理系统h3>
    27. <p>
    28. <input type="text" name="username" id="username" placeholder="账号" autocomplete="off">p>
    29. <p>
    30. <input type="password" name="password" id="password" placeholder="密码">
    31. p>
    32. <p style="color: red" class="tip">p>
    33. <p><button type="button" id="login">登录button>p>
    34. form>
    35. <span><a href="3.html" style="color: brown">注册a>span>
    36. div>
    37. <script type="text/javascript" src="js/jquery.min.js">script>
    38. <script type="text/javascript">
    39. $(function(){
    40. $('#login').click(function(){
    41. username = $('.div1 #username').val();
    42. password = $('.div1 #password').val();
    43. if(username!='admin'||password!='admin'){
    44. $('.div1 .tip').text('用户名或密码错误');
    45. if(username!=''||password!=''){
    46. $('.div1 .tip').text('用户名或密码不能为空');
    47. }
    48. }else{
    49. console.log('下一步');
    50. alert('用户登陆成功')
    51. window.location.href="2.html";
    52. }
    53. });
    54. });
    55. script>
    56. body>
    57. html>

    3.2、管理界面

    相关代码:

    1. html>
    2. <html lang="en">
    3. <head>
    4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    5. <title>2title>
    6. <style>
    7. #div1{
    8. background-color: skyblue;
    9. width: auto;
    10. height:70px;
    11. font-size: 30px;
    12. text-align: center;
    13. line-height: 70px;
    14. }
    15. .modal {
    16. position: fixed;
    17. top: 0;
    18. right: 0;
    19. bottom: 0;
    20. left: 0;
    21. z-index: 1050;
    22. display: none;
    23. overflow: hidden;
    24. outline: 0;
    25. }
    26. .modal.fade .modal-dialog {
    27. transition: -webkit-transform 0.3s ease-out;
    28. transition: transform 0.3s ease-out;
    29. transition: transform 0.3s ease-out, -webkit-transform 0.3s ease-out;
    30. -webkit-transform: translate(0, -25%);
    31. transform: translate(0, -25%);
    32. }
    33. .modal.show .modal-dialog {
    34. -webkit-transform: translate(0, 0);
    35. transform: translate(0, 0);
    36. }
    37. .modal-open .modal {
    38. overflow-x: hidden;
    39. overflow-y: auto;
    40. }
    41. .modal-dialog {
    42. position: relative;
    43. width: auto;
    44. margin: 10px;
    45. pointer-events: none;
    46. }
    47. .modal-content {
    48. position: relative;
    49. display: -ms-flexbox;
    50. display: flex;
    51. -ms-flex-direction: column;
    52. flex-direction: column;
    53. pointer-events: auto;
    54. background-color: #fff
    55. background-clip: padding-box;
    56. border: 1px solid rgba(0, 0, 0, 0.2);
    57. border-radius: 0.3rem;
    58. outline: 0;
    59. }
    60. .modal-backdrop {
    61. position: fixed;
    62. top: 0;
    63. right: 0;
    64. bottom: 0;
    65. left: 0;
    66. z-index: 1040;
    67. background-color: skyblue;
    68. }
    69. .modal-backdrop.fade {
    70. opacity: 0;
    71. }
    72. .modal-backdrop.show {
    73. opacity: 0.5;
    74. }
    75. .modal-header {
    76. display: -ms-flexbox;
    77. display: flex;
    78. -ms-flex-align: start;
    79. align-items: flex-start;
    80. -ms-flex-pack: justify;
    81. justify-content: space-between;
    82. padding: 15px;
    83. border-bottom: 1px solid #e9ecef;
    84. border-top-left-radius: 0.3rem;
    85. border-top-right-radius: 0.3rem;
    86. }
    87. .modal-header .close {
    88. padding: 15px;
    89. margin: -15px -15px -15px auto;
    90. }
    91. .modal-title {
    92. margin-bottom: 0;
    93. line-height: 1.5;
    94. }
    95. .modal-body {
    96. position: relative;
    97. -ms-flex: 1 1 auto;
    98. flex: 1 1 auto;
    99. padding: 15px;
    100. }
    101. .modal-footer {
    102. display: -ms-flexbox;
    103. display: flex;
    104. -ms-flex-align: center;
    105. align-items: center;
    106. -ms-flex-pack: end;
    107. justify-content: flex-end;
    108. padding: 15px;
    109. border-top: 1px solid #e9ecef;
    110. }
    111. .modal-footer > :not(:first-child) {
    112. margin-left: .25rem;
    113. }
    114. .modal-footer > :not(:last-child) {
    115. margin-right: .25rem;
    116. }
    117. body {
    118. margin: 0;
    119. font-size: 1.3rem;
    120. font-weight: 400;
    121. line-height: 1.5;
    122. color: #212529;
    123. text-align: center;
    124. background-color: #fff;
    125. }
    126. .table{
    127. background-color: skyblue;
    128. border: 1px solid brown;
    129. }
    130. style>
    131. head>
    132. <body onload="loadUserDatas()">
    133. <div id="div1">图书管理系统div>
    134. <br><br>
    135. <div class="container">
    136. <table class="table" id="table" align="center">
    137. <thead>
    138. <tr>
    139. <th>序号th>
    140. <th>图书编号th>
    141. <th>图书名th>
    142. <th>图书作者th>
    143. <th>出版社th>
    144. <th>图书数量th>
    145. <th>图书价钱th>
    146. tr>
    147. thead>
    148. <tbody id="tbody">
    149. tbody>
    150. table>
    151. <br>
    152. <caption>操作caption>
    153. <br><br>
    154. <caption>
    155. <form class="form-inline" role="form">
    156. <input type="text" class="form-group form-control" autocomplete="off" id="s_code" placeholder="按工号查询" >
    157.              
    158. <input type="text" class="form-group form-control" autocomplete="off" id="s_userName" placeholder="按图书名查询" >
    159. form>
    160. caption>
    161. <br>
    162. <form class="form-inline" role="form">
    163. <button type="button" class="btn btn-info" id="user_find" onclick="optionUserData(this);">查询button>     
    164. <button type="button" class="btn btn-success" id="user_add" data-toggle="modal"
    165. data-target="#myModal" onclick="optionUserData(this);">新增button>     
    166. <button type="button" class="btn btn-danger" id="user_delete" onclick="optionUserData(this);">删除button>     
    167. <button type="button" class="btn btn-default" id="user_edit" data-toggle="modal"
    168. data-target="#myModal" onclick="optionUserData(this);">编辑button>
    169. form>
    170. <div class="modal hide" id="myModal" role="dialog" >
    171. <div class="modal-dialog">
    172. <div class="modal-content">
    173. <div class="modal-header">
    174. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
    175. 返回
    176. button>
    177. div>
    178. <div class="modal-body" id="modal-body">
    179. <label for="name">图书编号:label>
    180. <input type="text" class="form-control" id="m_code" placeholder="请输入图书编号" autocomplete="off">
    181. <label for="name">图书名:label>
    182. <input type="text" class="form-control" id="m_userName" placeholder="请输入图书名" autocomplete="off">
    183. <label for="name">图书作者:label>
    184. <input type="text" class="form-control" id="m_sex" placeholder="请输入作者" autocomplete="off">
    185. <label for="name">出版社:label>
    186. <input type="text" class="form-control" id="m_passWord" placeholder="请输入出版社" autocomplete="off">
    187. <label for="name">图书数量:label>
    188. <input type="text" class="form-control" id="m_age" placeholder="请输入图书数量" autocomplete="off">
    189. <label for="name">图书价钱:label>
    190. <input type="text" class="form-control" id="m_birthday" placeholder="请输入图书价钱" autocomplete="off">
    191. div>
    192. <div class="modal-footer">
    193. <button type="button" class="btn btn-default"
    194. data-dismiss="modal">保存
    195. button>
    196. <button type="button" class="btn btn-primary" data-dismiss="modal" aria-hidden="true" >提交更改button>
    197. div>
    198. div>
    199. div>
    200. div>
    201. div>
    202. <script type="text/javascript" src="js/jquery.min.js">script>
    203. <script type="text/javascript" src="js/index.js">script>
    204. <script type="text/javascript" src="js/bootstrap.js">script>
    205. body>
    206. html>

     3.3、编辑界面

    相关代码:

    1. class="modal hide" id="myModal" role="dialog" >
    2. 返回
  • data-dismiss="modal">保存
  • 总结

    以上就是本次项目的全部内容,需要交流或者获取代码请关注微信公众号:coding加油站获取

  • 相关阅读:
    【MySQL】数据类型
    Waiting for table metadata lock
    R语言ggplot2可视化:使用patchwork包(直接使用加号+)将一个ggplot2可视化结果和数据表格横向组合起来形成最终结果图
    如何使用python连接mysql数据库编写爬虫代码。
    【Html/Css】Https证书申请、安装和使用(新手IIS安装参考)
    【Python】给定一个长度为n的数列,将这个数列按从小到大的顺序排列。1<=n<=200
    LeetCode 384. 打乱数组
    Learning with Mini-Batch
    一篇文章玩透awk
    python练习(5)
  • 原文地址:https://blog.csdn.net/pandas23/article/details/126613189