官网 管理后台
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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  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 = $(
  486. "#historyAddForm input[name='history_dhyear']"
  487. ).val();
  488. let _dhmonth = _dhyear && _dhyear.split("-")[1];
  489. $.ajax({
  490. type: "POST",
  491. url: _url,
  492. dataType: "json",
  493. contentType: "application/json; charset=utf-8",
  494. data: JSON.stringify({
  495. dhyear: _dhyear && _dhyear.split("-")[0],
  496. dhmonth: Number(_dhmonth) + "月",
  497. content: $(
  498. "#historyAddForm textarea[name='history_content']"
  499. ).val(),
  500. ltype: $(
  501. "#historyAddForm input[name='history_ltype']:checked"
  502. ).val(),
  503. createid: $.userInfo.userid
  504. }),
  505. success: function (data) {
  506. if (data.code === 0) {
  507. window.location.href =
  508. "/sections/history.html?page=1&dhyear=" +
  509. historySearch.dhyear +
  510. "&ltype=" +
  511. historySearch.ltype;
  512. } else {
  513. alert(data.msg);
  514. }
  515. }
  516. });
  517. }
  518. });
  519. let modify_dhid = null;
  520. $(".historyTableBody").on("click", ".modify_btn", function () {
  521. modify_dhid = $(this).data("dhid");
  522. $("#historyModifyModal").modal("show");
  523. $.each(historySearch.list, function (_index, _historyItem) {
  524. if (_historyItem.dhid === modify_dhid) {
  525. $(
  526. "#historyModifyForm input[name='m_history_ltype'][value='" +
  527. _historyItem.ltype +
  528. "']"
  529. ).attr("checked", true);
  530. let _monthStr =
  531. _historyItem.dhyear && _historyItem.dhmonth
  532. ? _historyItem.dhmonth.split("月")[0]
  533. : "";
  534. $("#historyModifyModal #modifyDhyearPicker")
  535. .datepicker({
  536. autoclose: true,
  537. startView: 1,
  538. maxViewMode: 2,
  539. minViewMode: 1,
  540. format: "yyyy-mm",
  541. language: "zh-CN"
  542. })
  543. .datepicker(
  544. "setDate",
  545. _monthStr
  546. ? _historyItem.dhyear +
  547. "-" +
  548. (Number(_monthStr) < 9 ? "0" + _monthStr : _monthStr)
  549. : "now"
  550. );
  551. $("#historyModifyForm textarea[name='m_history_content']").val(
  552. _historyItem.content
  553. );
  554. }
  555. });
  556. });
  557. $("#historyModifyModal .modify_save").on("click", function () {
  558. // 添加表单验证
  559. $("#historyModifyForm").bootstrapValidator({
  560. // 默认的提示消息
  561. message: "请输入内容",
  562. // 表单框里右侧的icon
  563. // feedbackIcons: {
  564. // valid: "glyphicon glyphicon-ok",
  565. // invalid: "glyphicon glyphicon-remove",
  566. // validating: "glyphicon glyphicon-refresh",
  567. // },
  568. fields: {
  569. history_ltype: {
  570. validators: {
  571. notEmpty: {
  572. message: "请选择类型"
  573. }
  574. }
  575. },
  576. history_dhyear: {
  577. validators: {
  578. notEmpty: {
  579. format: "YYYY-MM",
  580. message: "请选择日期"
  581. }
  582. }
  583. },
  584. history_content: {
  585. validators: {
  586. notEmpty: {
  587. message: "请输入内容"
  588. }
  589. }
  590. }
  591. }
  592. });
  593. //先校验,在调是否通过校验的方法
  594. $("#historyModifyForm").data("bootstrapValidator").validate();
  595. //校验表单是否通过
  596. let flag = $("#historyModifyForm")
  597. .data("bootstrapValidator")
  598. .isValid();
  599. if (flag) {
  600. let _url = $.baseUrl + "dh/update";
  601. let _dhyear = $(
  602. "#historyModifyForm input[name='m_history_dhyear']"
  603. ).val();
  604. let _dhmonth = _dhyear && _dhyear.split("-")[1];
  605. $.ajax({
  606. type: "POST",
  607. url: _url,
  608. dataType: "json",
  609. contentType: "application/json; charset=utf-8",
  610. data: JSON.stringify({
  611. dhid: modify_dhid,
  612. dhyear: _dhyear && _dhyear.split("-")[0],
  613. dhmonth: Number(_dhmonth) + "月",
  614. content: $(
  615. "#historyModifyForm textarea[name='m_history_content']"
  616. ).val(),
  617. ltype: $(
  618. "#historyModifyForm input[name='m_history_ltype']:checked"
  619. ).val()
  620. }),
  621. success: function (data) {
  622. if (data.code === 0) {
  623. window.location.href =
  624. "/sections/history.html?page=1&dhyear=" +
  625. historySearch.dhyear +
  626. "&ltype=" +
  627. historySearch.ltype;
  628. } else {
  629. alert(data.msg);
  630. }
  631. }
  632. });
  633. }
  634. });
  635. // 获取用户列表
  636. function getHistoryList() {
  637. $.ajax({
  638. type: "POST",
  639. url: $.baseUrl + "dh/list",
  640. dataType: "json",
  641. contentType: "application/json; charset=utf-8",
  642. data: JSON.stringify({
  643. page: historySearch.page,
  644. size: historySearch.size,
  645. dhyear: historySearch.dhyear,
  646. ltype: historySearch.ltype,
  647. }),
  648. success: function (data) {
  649. if (data.code === 0) {
  650. historySearch.total = data.obj.total;
  651. historySearch.list = data.obj.list;
  652. setTableHtml();
  653. setPageList();
  654. } else {
  655. historySearch.total = 0;
  656. historySearch.list = [];
  657. alert(data.msg);
  658. }
  659. }
  660. });
  661. }
  662. // 设置表格信息
  663. function setTableHtml() {
  664. let historyTableBodyHtml = "";
  665. $.each(historySearch.list, function (_historyIndex, _historyItem) {
  666. historyTableBodyHtml +=
  667. "<tr><td>" +
  668. (_historyIndex +
  669. 1 +
  670. (historySearch.page - 1) * historySearch.size) +
  671. "</td><td>" +
  672. (_historyItem.dhyear ? _historyItem.dhyear : "") +
  673. "</td><td>" +
  674. (_historyItem.dhmonth ? _historyItem.dhmonth : "") +
  675. "</td><td>" +
  676. (_historyItem.ltype === 1 ? "中文" : "英文") +
  677. "</td><td>" +
  678. (_historyItem.content ? _historyItem.content : "") +
  679. "</td><td>" +
  680. (_historyItem.createname ? _historyItem.createname : "") +
  681. "</td><td>" +
  682. $.dateFormat(_historyItem.createtime) +
  683. '</td><td><span class="my_theme_color action_btn modify_btn" data-dhid="' +
  684. _historyItem.dhid +
  685. '">修改</span><span class="my_theme_color">|</span><span class="del_color action_btn del_btn" data-dhid="' +
  686. _historyItem.dhid +
  687. '">删除</span></td></tr>';
  688. });
  689. $(".historyTableBody").html(historyTableBodyHtml);
  690. let del_dhid = null;
  691. $(".historyTableBody").on("click", ".del_btn", function () {
  692. $("#historyDelModal").modal("show");
  693. del_dhid = $(this).data("dhid");
  694. });
  695. $("#historyDelModal .del_save").on("click", function () {
  696. $.ajax({
  697. type: "POST",
  698. url: $.baseUrl + "dh/remove",
  699. dataType: "json",
  700. contentType: "application/json; charset=utf-8",
  701. data: JSON.stringify({
  702. dhid: del_dhid
  703. }),
  704. success: function (data) {
  705. $("#historyDelModal").modal("hide");
  706. if (data.code === 0) {
  707. window.location.href =
  708. "/sections/history.html?page=" +
  709. historySearch.page +
  710. "&dhyear=" +
  711. historySearch.dhyear +
  712. "&ltype=" +
  713. historySearch.ltype;
  714. } else {
  715. alert(data.msg);
  716. }
  717. }
  718. });
  719. });
  720. }
  721. // 设置页码信息
  722. function setPageList() {
  723. let pageBoxHtml =
  724. '<div class="page_prev ' +
  725. (historySearch.page === 1 ? "disabled" : "") +
  726. '">&lt;</div>';
  727. for (
  728. let _pageIndex = 0;
  729. _pageIndex < Math.ceil(historySearch.total / historySearch.size);
  730. _pageIndex++
  731. ) {
  732. pageBoxHtml +=
  733. '<div data-page="' +
  734. (_pageIndex + 1) +
  735. '" class="page_num ' +
  736. (_pageIndex + 1 === historySearch.page ? "selected" : "") +
  737. '">' +
  738. (_pageIndex + 1) +
  739. "</div>";
  740. }
  741. pageBoxHtml +=
  742. '<div class="page_next ' +
  743. (historySearch.page ===
  744. Math.ceil(historySearch.total / historySearch.size)
  745. ? "disabled"
  746. : "") +
  747. '">&gt;</div>';
  748. if (historySearch.total > 0) {
  749. $(".history_page.page_box").html(pageBoxHtml);
  750. $(".history_page.page_box").on("click", ".page_prev", function () {
  751. if (historySearch.page > 1) {
  752. historySearch.page--;
  753. window.location.href =
  754. "/sections/history.html?page=" +
  755. historySearch.page +
  756. "&dhyear=" +
  757. historySearch.dhyear +
  758. "&ltype=" +
  759. historySearch.ltype;
  760. }
  761. });
  762. $(".history_page.page_box").on("click", ".page_num", function () {
  763. historySearch.page = $(this).data("page");
  764. window.location.href =
  765. "/sections/history.html?page=" +
  766. historySearch.page +
  767. "&dhyear=" +
  768. historySearch.dhyear +
  769. "&ltype=" +
  770. historySearch.ltype;
  771. });
  772. $(".history_page.page_box").on("click", ".page_next", function () {
  773. if (
  774. historySearch.page <
  775. Math.ceil(historySearch.total / historySearch.size)
  776. ) {
  777. historySearch.page++;
  778. window.location.href =
  779. "/sections/history.html?page=" +
  780. historySearch.page +
  781. "&dhyear=" +
  782. historySearch.dhyear +
  783. "&ltype=" +
  784. historySearch.ltype;
  785. }
  786. });
  787. } else {
  788. $(".history_page.page_box").html("");
  789. }
  790. }
  791. getHistoryList();
  792. });
  793. </script>
  794. </body>
  795. </html>