官网 管理后台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

history.html 28KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773
  1. <!DOCTYPE html>
  2. <html lang="zh-cn">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <title>河南星火燎原软件科技有限公司</title>
  8. <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
  9. <link rel="stylesheet" href="../librarys/bootstrap@3.4.1/bootstrap.css" />
  10. <link
  11. rel="stylesheet"
  12. href="../librarys/bootstrap@3.4.1/bootstrap-datepicker.css"
  13. />
  14. <link
  15. rel="stylesheet"
  16. href="../librarys/bootstrapValidator@0.5.3/bootstrapValidator.css"
  17. />
  18. <link rel="stylesheet" href="../css/comm.css" />
  19. <link rel="stylesheet" href="../css/header.css" />
  20. <style>
  21. body {
  22. background-color: #fff;
  23. }
  24. .history_main {
  25. margin: 20px auto;
  26. width: 1000px;
  27. }
  28. .history_main .header_box {
  29. display: flex;
  30. justify-content: space-between;
  31. align-items: center;
  32. margin-bottom: 10px;
  33. }
  34. .header_left {
  35. display: flex;
  36. justify-content: flex-start;
  37. align-items: center;
  38. }
  39. .header_left #dhyearPicker {
  40. margin-right: 16px;
  41. }
  42. .history_radio {
  43. cursor: pointer;
  44. }
  45. .header_left .searchBtn {
  46. margin-left: 16px;
  47. }
  48. .history_main .table.table-bordered th {
  49. text-align: center;
  50. background-color: #f7f7f7;
  51. }
  52. .history_main .table.table-bordered td {
  53. text-align: center;
  54. background-color: #fff;
  55. }
  56. .history_main .table.table-bordered .action_btn {
  57. margin: 0 10px;
  58. cursor: pointer;
  59. }
  60. </style>
  61. </head>
  62. <body>
  63. <div class="top_header_root" data-header_page="history">
  64. <div class="header_html_root">
  65. <div class="header_html_item" data-url="index">用户信息</div>
  66. <div class="header_html_item" data-url="history">发展历程</div>
  67. <div class="header_html_item" data-url="service">服务案例</div>
  68. <div class="header_html_item" data-url="school">学校图标</div>
  69. <div class="header_html_item" data-url="trial">申请试用</div>
  70. <div class="header_html_item" data-url="news">新闻资讯</div>
  71. <div class="header_html_item" data-url="log">登录日志</div>
  72. </div>
  73. </div>
  74. <div class="history_main">
  75. <div class="header_box">
  76. <div class="header_left">
  77. <div class="input-group date" id="dhyearPicker">
  78. <input type="text" class="form-control" name="dhyear" />
  79. <span class="input-group-addon">
  80. <span class="glyphicon glyphicon-calendar"></span>
  81. </span>
  82. </div>
  83. <div class="radio-inline">
  84. <input
  85. id="s_0"
  86. class="history_radio"
  87. name="history_type"
  88. type="radio"
  89. value="1"
  90. />
  91. <label for="s_0" class="history_radio">中文</label>
  92. </div>
  93. <div class="radio-inline">
  94. <input
  95. id="s_1"
  96. class="history_radio"
  97. name="history_type"
  98. type="radio"
  99. value="2"
  100. />
  101. <label for="s_1" class="history_radio">英文</label>
  102. </div>
  103. <div type="button" class="btn btn-primary searchBtn">搜索</div>
  104. </div>
  105. <div type="button" class="btn btn-primary history_add_btn">添加</div>
  106. </div>
  107. <table class="table table-bordered">
  108. <thead>
  109. <tr>
  110. <th style="width: 60px">序号</th>
  111. <th style="width: 80px">年份</th>
  112. <th style="width: 80px">月份</th>
  113. <th style="width: 80px">类型</th>
  114. <th>内容</th>
  115. <th style="width: 100px">创建人</th>
  116. <th style="width: 160px">创建时间</th>
  117. <th style="width: 140px">操作</th>
  118. </tr>
  119. </thead>
  120. <tbody class="historyTableBody"></tbody>
  121. </table>
  122. <div class="history_page page_box">
  123. <!-- <div class="page_prev disabled">&lt;</div>
  124. <div data-page="1" class="page_num selected">1</div>
  125. <div class="page_num">2</div>
  126. <div class="page_next">&gt;</div> -->
  127. </div>
  128. </div>
  129. <!-- 添加发展历程 -->
  130. <div
  131. class="modal fade"
  132. id="historyAddModal"
  133. tabindex="-1"
  134. role="dialog"
  135. aria-labelledby="addTitle"
  136. >
  137. <div class="modal-dialog" role="document">
  138. <div class="modal-content">
  139. <div class="modal-header">
  140. <button
  141. type="button"
  142. class="close"
  143. data-dismiss="modal"
  144. aria-label="Close"
  145. >
  146. <span aria-hidden="true">&times;</span>
  147. </button>
  148. <h4 class="modal-title" id="addTitle">添加发展历程</h4>
  149. </div>
  150. <div class="modal-body">
  151. <form class="form-horizontal" id="historyAddForm">
  152. <div class="form-group">
  153. <label class="col-sm-2 control-label">类型</label>
  154. <div class="col-sm-10">
  155. <div class="radio-inline">
  156. <input
  157. id="add_0"
  158. class="history_radio"
  159. name="history_ltype"
  160. type="radio"
  161. value="1"
  162. checked
  163. />
  164. <label for="add_0" class="history_radio">中文</label>
  165. </div>
  166. <div class="radio-inline">
  167. <input
  168. id="add_1"
  169. class="history_radio"
  170. name="history_ltype"
  171. type="radio"
  172. value="2"
  173. />
  174. <label for="add_1" class="history_radio">英文</label>
  175. </div>
  176. </div>
  177. </div>
  178. <div class="form-group">
  179. <label for="addDhyearPicker" class="col-sm-2 control-label"
  180. >日期</label
  181. >
  182. <div class="col-sm-10">
  183. <div class="input-group date" id="addDhyearPicker">
  184. <input
  185. type="text"
  186. class="form-control"
  187. name="history_dhyear"
  188. />
  189. <span class="input-group-addon">
  190. <span class="glyphicon glyphicon-calendar"></span>
  191. </span>
  192. </div>
  193. </div>
  194. </div>
  195. <div class="form-group">
  196. <label for="contentInput" class="col-sm-2 control-label"
  197. >内容</label
  198. >
  199. <div class="col-sm-10">
  200. <textarea
  201. type="text"
  202. class="form-control"
  203. id="contentInput"
  204. name="history_content"
  205. placeholder="请输入内容"
  206. ></textarea>
  207. </div>
  208. </div>
  209. </form>
  210. </div>
  211. <div class="modal-footer">
  212. <div type="button" class="btn btn-default" data-dismiss="modal">
  213. 取消
  214. </div>
  215. <div type="button" class="btn btn-primary add_save">确定</div>
  216. </div>
  217. </div>
  218. </div>
  219. </div>
  220. <!-- 修改发展历程 -->
  221. <div
  222. class="modal fade"
  223. id="historyModifyModal"
  224. tabindex="-1"
  225. role="dialog"
  226. aria-labelledby="modifyTitle"
  227. >
  228. <div class="modal-dialog" role="document">
  229. <div class="modal-content">
  230. <div class="modal-header">
  231. <button
  232. type="button"
  233. class="close"
  234. data-dismiss="modal"
  235. aria-label="Close"
  236. >
  237. <span aria-hidden="true">&times;</span>
  238. </button>
  239. <h4 class="modal-title" id="modifyTitle">修改发展历程</h4>
  240. </div>
  241. <div class="modal-body">
  242. <form class="form-horizontal" id="historyModifyForm">
  243. <div class="form-group">
  244. <label class="col-sm-2 control-label">类型</label>
  245. <div class="col-sm-10">
  246. <div class="radio-inline">
  247. <input
  248. id="modify_0"
  249. class="history_radio"
  250. name="m_history_ltype"
  251. type="radio"
  252. value="1"
  253. checked
  254. />
  255. <label for="modify_0" class="history_radio">中文</label>
  256. </div>
  257. <div class="radio-inline">
  258. <input
  259. id="modify_1"
  260. class="history_radio"
  261. name="m_history_ltype"
  262. type="radio"
  263. value="2"
  264. />
  265. <label for="modify_1" class="history_radio">英文</label>
  266. </div>
  267. </div>
  268. </div>
  269. <div class="form-group">
  270. <label for="modifyDhyearPicker" class="col-sm-2 control-label"
  271. >日期</label
  272. >
  273. <div class="col-sm-10">
  274. <div class="input-group date" id="modifyDhyearPicker">
  275. <input
  276. type="text"
  277. class="form-control"
  278. name="m_history_dhyear"
  279. />
  280. <span class="input-group-addon">
  281. <span class="glyphicon glyphicon-calendar"></span>
  282. </span>
  283. </div>
  284. </div>
  285. </div>
  286. <div class="form-group">
  287. <label for="m_contentInput" class="col-sm-2 control-label"
  288. >内容</label
  289. >
  290. <div class="col-sm-10">
  291. <textarea
  292. type="text"
  293. class="form-control"
  294. id="m_contentInput"
  295. name="m_history_content"
  296. placeholder="请输入内容"
  297. ></textarea>
  298. </div>
  299. </div>
  300. </form>
  301. </div>
  302. <div class="modal-footer">
  303. <div type="button" class="btn btn-default" data-dismiss="modal">
  304. 取消
  305. </div>
  306. <div type="button" class="btn btn-primary modify_save">确定</div>
  307. </div>
  308. </div>
  309. </div>
  310. </div>
  311. <!-- 删除发展历程弹窗 -->
  312. <div
  313. class="modal fade"
  314. id="historyDelModal"
  315. tabindex="-1"
  316. role="dialog"
  317. aria-labelledby="delTitle"
  318. >
  319. <div class="modal-dialog tip_modal" role="document">
  320. <div class="modal-content">
  321. <div class="modal-header">
  322. <button
  323. type="button"
  324. class="close"
  325. data-dismiss="modal"
  326. aria-label="Close"
  327. >
  328. <span aria-hidden="true">&times;</span>
  329. </button>
  330. <h4 class="modal-title" id="delTitle">提示</h4>
  331. </div>
  332. <div class="modal-body">确定删除选中信息?</div>
  333. <div class="modal-footer">
  334. <div type="button" class="btn btn-default" data-dismiss="modal">
  335. 取消
  336. </div>
  337. <div type="button" class="btn btn-primary del_save">保存</div>
  338. </div>
  339. </div>
  340. </div>
  341. </div>
  342. <script src="../librarys/jquery@1.12.4/jquery.min.js"></script>
  343. <script src="../librarys/bootstrap@3.4.1/bootstrap.js"></script>
  344. <script src="../librarys/bootstrap@3.4.1/bootstrap-datepicker.js"></script>
  345. <script src="../librarys/bootstrap@3.4.1/bootstrap-datepicker.zh-CN.min.js"></script>
  346. <script src="../librarys/bootstrapValidator@0.5.3/bootstrapValidator.js"></script>
  347. <script src="../utils/index.js"></script>
  348. <script>
  349. $(function () {
  350. let page_url = $(".top_header_root").data("header_page");
  351. $(
  352. '.header_html_root .header_html_item[data-url="' + page_url + '"]'
  353. ).addClass("selected");
  354. $(".header_html_root").on("click", ".header_html_item", function () {
  355. let _url = $(this).data("url");
  356. if (_url === "index") {
  357. window.location.href = "/index.html";
  358. } else {
  359. window.location.href = "/sections/" + _url + ".html";
  360. }
  361. });
  362. if (!$.isLogin()) {
  363. window.location.href = "/sections/login.html";
  364. return;
  365. }
  366. let historySearch = {
  367. page: Number($.getQueryletiable("page")) || 1,
  368. size: 10,
  369. dhyear:
  370. $.getQueryletiable("dhyear") || new Date().getFullYear().toString(),
  371. ltype: Number($.getQueryletiable("ltype")) || 1,
  372. total: 0,
  373. list: [],
  374. };
  375. $(".header_left #dhyearPicker")
  376. .datepicker({
  377. autoclose: true,
  378. startView: 2,
  379. maxViewMode: 2,
  380. minViewMode: 2,
  381. format: "yyyy",
  382. language: "zh-CN",
  383. })
  384. .datepicker("setDate", String(historySearch.dhyear));
  385. $(".header_left #dhyearPicker input[name='dhyear']").on(
  386. "change",
  387. function () {
  388. historySearch.dhyear = $(this).val();
  389. window.location.href =
  390. "/sections/history.html?page=" +
  391. historySearch.page +
  392. "&dhyear=" +
  393. historySearch.dhyear +
  394. "&ltype=" +
  395. historySearch.ltype;
  396. }
  397. );
  398. $(".header_left input[name='history_type']").each(function (
  399. _index,
  400. _typeItem
  401. ) {
  402. if (Number($(_typeItem).val()) === historySearch.ltype) {
  403. $(_typeItem).attr("checked", true);
  404. } else {
  405. $(_typeItem).attr("checked", false);
  406. }
  407. });
  408. $(".header_left").on(
  409. "click",
  410. 'input:radio[name="history_type"]',
  411. function () {
  412. window.location.href =
  413. "/sections/history.html?page=" +
  414. historySearch.page +
  415. "&dhyear=" +
  416. historySearch.dhyear +
  417. "&ltype=" +
  418. $('.header_left input:radio[name="history_type"]:checked').val();
  419. }
  420. );
  421. $(".header_left .searchBtn").click(function () {
  422. window.location.href =
  423. "/sections/history.html?page=" +
  424. historySearch.page +
  425. "&dhyear=" +
  426. historySearch.dhyear +
  427. "&ltype=" +
  428. historySearch.ltype;
  429. });
  430. $(".history_main .header_box .history_add_btn").click(function () {
  431. $("#historyAddModal").modal("show");
  432. $("#historyAddModal #addDhyearPicker")
  433. .datepicker({
  434. autoclose: true,
  435. startView: 1,
  436. maxViewMode: 2,
  437. minViewMode: 1,
  438. format: "yyyy-mm",
  439. language: "zh-CN",
  440. })
  441. .datepicker("setDate", "now");
  442. });
  443. $("#historyAddModal .add_save").on("click", function () {
  444. // 添加表单验证
  445. $("#historyAddForm").bootstrapValidator({
  446. // 默认的提示消息
  447. message: "请输入内容",
  448. // 表单框里右侧的icon
  449. // feedbackIcons: {
  450. // valid: "glyphicon glyphicon-ok",
  451. // invalid: "glyphicon glyphicon-remove",
  452. // validating: "glyphicon glyphicon-refresh",
  453. // },
  454. fields: {
  455. history_ltype: {
  456. validators: {
  457. notEmpty: {
  458. message: "请选择类型",
  459. },
  460. },
  461. },
  462. history_dhyear: {
  463. validators: {
  464. notEmpty: {
  465. format: "YYYY-MM",
  466. message: "请选择日期",
  467. },
  468. },
  469. },
  470. history_content: {
  471. validators: {
  472. notEmpty: {
  473. message: "请输入内容",
  474. },
  475. },
  476. },
  477. },
  478. });
  479. //先校验,在调是否通过校验的方法
  480. $("#historyAddForm").data("bootstrapValidator").validate();
  481. //校验表单是否通过
  482. let flag = $("#historyAddForm").data("bootstrapValidator").isValid();
  483. if (flag) {
  484. let _url = $.baseUrl + "dh/save";
  485. let _dhyear = $("#historyAddForm input[name='history_dhyear']").val();
  486. let _dhmonth = _dhyear && _dhyear.split("-")[1];
  487. $.ajax({
  488. type: "POST",
  489. url: _url,
  490. dataType: "json",
  491. contentType: "application/json; charset=utf-8",
  492. data: JSON.stringify({
  493. dhyear: _dhyear && _dhyear.split("-")[0],
  494. dhmonth: Number(_dhmonth) + "月",
  495. content: $(
  496. "#historyAddForm textarea[name='history_content']"
  497. ).val(),
  498. ltype: $(
  499. "#historyAddForm input[name='history_ltype']:checked"
  500. ).val(),
  501. createid: $.userInfo.userid,
  502. }),
  503. success: function (data) {
  504. if (data.code === 0) {
  505. window.location.href =
  506. "/sections/history.html?page=1&dhyear=" +
  507. historySearch.dhyear +
  508. "&ltype=" +
  509. historySearch.ltype;
  510. } else {
  511. alert(data.msg);
  512. }
  513. },
  514. });
  515. }
  516. });
  517. let modify_dhid = null;
  518. $(".historyTableBody").on("click", ".modify_btn", function () {
  519. modify_dhid = $(this).data("dhid");
  520. $("#historyModifyModal").modal("show");
  521. $.each(historySearch.list, function (_index, _historyItem) {
  522. if (_historyItem.dhid === modify_dhid) {
  523. $("#historyModifyForm input[name='m_history_ltype'][value='" + _historyItem.ltype + "']").attr("checked", true);
  524. let _monthStr = _historyItem.dhyear && _historyItem.dhmonth ? _historyItem.dhmonth.split("月")[0] : "";
  525. $("#historyModifyModal #modifyDhyearPicker")
  526. .datepicker({
  527. autoclose: true,
  528. startView: 1,
  529. maxViewMode: 2,
  530. minViewMode: 1,
  531. format: "yyyy-mm",
  532. language: "zh-CN",
  533. })
  534. .datepicker("setDate", _monthStr ? _historyItem.dhyear + "-" + (Number(_monthStr) < 9 ? "0" + _monthStr : _monthStr) : "now");
  535. $("#historyModifyForm textarea[name='m_history_content']").val(_historyItem.content);
  536. }
  537. });
  538. });
  539. $("#historyModifyModal .modify_save").on("click", function () {
  540. // 添加表单验证
  541. $("#historyModifyForm").bootstrapValidator({
  542. // 默认的提示消息
  543. message: "请输入内容",
  544. // 表单框里右侧的icon
  545. // feedbackIcons: {
  546. // valid: "glyphicon glyphicon-ok",
  547. // invalid: "glyphicon glyphicon-remove",
  548. // validating: "glyphicon glyphicon-refresh",
  549. // },
  550. fields: {
  551. history_ltype: {
  552. validators: {
  553. notEmpty: {
  554. message: "请选择类型",
  555. },
  556. },
  557. },
  558. history_dhyear: {
  559. validators: {
  560. notEmpty: {
  561. format: "YYYY-MM",
  562. message: "请选择日期",
  563. },
  564. },
  565. },
  566. history_content: {
  567. validators: {
  568. notEmpty: {
  569. message: "请输入内容",
  570. },
  571. },
  572. },
  573. },
  574. });
  575. //先校验,在调是否通过校验的方法
  576. $("#historyModifyForm").data("bootstrapValidator").validate();
  577. //校验表单是否通过
  578. let flag = $("#historyModifyForm").data("bootstrapValidator").isValid();
  579. if (flag) {
  580. let _url = $.baseUrl + "dh/update";
  581. let _dhyear = $("#historyModifyForm input[name='m_history_dhyear']").val();
  582. let _dhmonth = _dhyear && _dhyear.split("-")[1];
  583. $.ajax({
  584. type: "POST",
  585. url: _url,
  586. dataType: "json",
  587. contentType: "application/json; charset=utf-8",
  588. data: JSON.stringify({
  589. dhid: modify_dhid,
  590. dhyear: _dhyear && _dhyear.split("-")[0],
  591. dhmonth: Number(_dhmonth) + "月",
  592. content: $(
  593. "#historyModifyForm textarea[name='m_history_content']"
  594. ).val(),
  595. ltype: $(
  596. "#historyModifyForm input[name='m_history_ltype']:checked"
  597. ).val(),
  598. }),
  599. success: function (data) {
  600. if (data.code === 0) {
  601. window.location.href =
  602. "/sections/history.html?page=1&dhyear=" +
  603. historySearch.dhyear +
  604. "&ltype=" +
  605. historySearch.ltype;
  606. } else {
  607. alert(data.msg);
  608. }
  609. },
  610. });
  611. }
  612. });
  613. // 获取用户列表
  614. function getHistoryList() {
  615. $.ajax({
  616. type: "POST",
  617. url: $.baseUrl + "dh/list",
  618. dataType: "json",
  619. contentType: "application/json; charset=utf-8",
  620. data: JSON.stringify({
  621. page: historySearch.page,
  622. size: historySearch.size,
  623. dhyear: historySearch.dhyear,
  624. ltype: historySearch.ltype,
  625. }),
  626. success: function (data) {
  627. if (data.code === 0) {
  628. historySearch.total = data.obj.total;
  629. historySearch.list = data.obj.list;
  630. setTableHtml();
  631. setPageList();
  632. } else {
  633. historySearch.total = 0;
  634. historySearch.list = [];
  635. alert(data.msg);
  636. }
  637. },
  638. });
  639. }
  640. // 设置表格信息
  641. function setTableHtml() {
  642. let historyTableBodyHtml = "";
  643. $.each(historySearch.list, function (_historyIndex, _historyItem) {
  644. historyTableBodyHtml +=
  645. "<tr><td>" +
  646. (_historyIndex +
  647. 1 +
  648. (historySearch.page - 1) * historySearch.size) +
  649. "</td><td>" +
  650. (_historyItem.dhyear ? _historyItem.dhyear : "") +
  651. "</td><td>" +
  652. (_historyItem.dhmonth ? _historyItem.dhmonth : "") +
  653. "</td><td>" +
  654. (_historyItem.ltype === 1 ? "中文" : "英文") +
  655. "</td><td>" +
  656. (_historyItem.content ? _historyItem.content : "") +
  657. "</td><td>" +
  658. (_historyItem.createname ? _historyItem.createname : "") +
  659. "</td><td>" +
  660. $.dateFormat(_historyItem.createtime) +
  661. '</td><td><span class="my_theme_color action_btn modify_btn" data-dhid="' +
  662. _historyItem.dhid +
  663. '">修改</span><span class="my_theme_color">|</span><span class="del_color action_btn del_btn" data-dhid="' +
  664. _historyItem.dhid +
  665. '">删除</span></td></tr>';
  666. });
  667. $(".historyTableBody").html(historyTableBodyHtml);
  668. let del_dhid = null;
  669. $(".historyTableBody").on("click", ".del_btn", function () {
  670. $("#historyDelModal").modal("show");
  671. del_dhid = $(this).data("dhid");
  672. });
  673. $("#historyDelModal .del_save").on("click", function () {
  674. $.ajax({
  675. type: "POST",
  676. url: $.baseUrl + "dh/remove",
  677. dataType: "json",
  678. contentType: "application/json; charset=utf-8",
  679. data: JSON.stringify({
  680. dhid: del_dhid,
  681. }),
  682. success: function (data) {
  683. $("#historyDelModal").modal("hide");
  684. if (data.code === 0) {
  685. window.location.href =
  686. "/sections/history.html?page=" +
  687. historySearch.page +
  688. "&dhyear=" +
  689. historySearch.dhyear +
  690. "&ltype=" +
  691. historySearch.ltype;
  692. } else {
  693. alert(data.msg);
  694. }
  695. },
  696. });
  697. });
  698. }
  699. // 设置页码信息
  700. function setPageList() {
  701. let pageBoxHtml =
  702. '<div class="page_prev ' +
  703. (historySearch.page === 1 ? "disabled" : "") +
  704. '">&lt;</div>';
  705. for (
  706. let _pageIndex = 0;
  707. _pageIndex < Math.ceil(historySearch.total / historySearch.size);
  708. _pageIndex++
  709. ) {
  710. pageBoxHtml +=
  711. '<div data-page="' +
  712. (_pageIndex + 1) +
  713. '" class="page_num ' +
  714. (_pageIndex + 1 === historySearch.page ? "selected" : "") +
  715. '">' +
  716. (_pageIndex + 1) +
  717. "</div>";
  718. }
  719. pageBoxHtml +=
  720. '<div class="page_next ' +
  721. (historySearch.page ===
  722. Math.ceil(historySearch.total / historySearch.size)
  723. ? "disabled"
  724. : "") +
  725. '">&gt;</div>';
  726. if (historySearch.total > 0) {
  727. $(".history_page.page_box").html(pageBoxHtml);
  728. $(".history_page.page_box").on("click", ".page_prev", function () {
  729. if (historySearch.page > 1) {
  730. historySearch.page--;
  731. window.location.href =
  732. "/sections/history.html?page=" +
  733. historySearch.page +
  734. "&dhyear=" +
  735. historySearch.dhyear +
  736. "&ltype=" +
  737. historySearch.ltype;
  738. }
  739. });
  740. $(".history_page.page_box").on("click", ".page_num", function () {
  741. historySearch.page = $(this).data("page");
  742. window.location.href =
  743. "/sections/history.html?page=" +
  744. historySearch.page +
  745. "&dhyear=" +
  746. historySearch.dhyear +
  747. "&ltype=" +
  748. historySearch.ltype;
  749. });
  750. $(".history_page.page_box").on("click", ".page_next", function () {
  751. if (
  752. historySearch.page <
  753. Math.ceil(historySearch.total / historySearch.size)
  754. ) {
  755. historySearch.page++;
  756. window.location.href =
  757. "/sections/history.html?page=" +
  758. historySearch.page +
  759. "&dhyear=" +
  760. historySearch.dhyear +
  761. "&ltype=" +
  762. historySearch.ltype;
  763. }
  764. });
  765. } else {
  766. $(".history_page.page_box").html("");
  767. }
  768. }
  769. getHistoryList();
  770. });
  771. </script>
  772. </body>
  773. </html>