123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- <!DOCTYPE html>
- <html lang="zh-cn">
- <head>
- <meta charset="UTF-8" />
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>河南星火燎原软件科技有限公司</title>
- <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
- <link rel="stylesheet" href="../librarys/bootstrap@3.4.1/bootstrap.css" />
- <link
- rel="stylesheet"
- href="../librarys/bootstrap@3.4.1/bootstrap-datepicker.css"
- />
- <link
- rel="stylesheet"
- href="../librarys/bootstrapValidator@0.5.3/bootstrapValidator.css"
- />
- <link rel="stylesheet" href="../css/comm.css" />
- <link rel="stylesheet" href="../css/header.css" />
- <style>
- body {
- background-color: #fff;
- }
- .history_main {
- margin: 20px auto;
- width: 1000px;
- }
- .history_main .header_box {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 10px;
- }
- .header_left {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- }
- .header_left #dhyearPicker {
- margin-right: 16px;
- }
- .header_left .history_radio {
- cursor: pointer;
- }
- .header_left .searchBtn {
- margin-left: 16px;
- }
- .history_main .table.table-bordered th {
- text-align: center;
- background-color: #f7f7f7;
- }
- .history_main .table.table-bordered td {
- text-align: center;
- background-color: #fff;
- }
- .history_main .table.table-bordered .action_btn {
- margin: 0 10px;
- cursor: pointer;
- }
- </style>
- </head>
- <body>
- <div class="top_header_root" data-header_page="history">
- <div class="header_html_root">
- <div class="header_html_item" data-url="index">用户信息</div>
- <div class="header_html_item" data-url="history">发展历程</div>
- <div class="header_html_item" data-url="service">服务案例</div>
- <div class="header_html_item" data-url="school">学校图标</div>
- <div class="header_html_item" data-url="trial">申请试用</div>
- <div class="header_html_item" data-url="news">新闻资讯</div>
- <div class="header_html_item" data-url="log">登录日志</div>
- </div>
- </div>
- <div class="history_main">
- <div class="header_box">
- <div class="header_left">
- <div class="input-group date" id="dhyearPicker">
- <input type="text" class="form-control" name="dhyear" />
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-calendar"></span>
- </span>
- </div>
- <div class="radio-inline">
- <input
- id="s_0"
- class="history_radio"
- name="history_type"
- type="radio"
- value="1"
- />
- <label for="s_0" class="history_radio">中文</label>
- </div>
- <div class="radio-inline">
- <input
- id="s_1"
- class="history_radio"
- name="history_type"
- type="radio"
- value="2"
- />
- <label for="s_1" class="history_radio">英文</label>
- </div>
- <div type="button" class="btn btn-primary searchBtn">搜索</div>
- </div>
- <div type="button" class="btn btn-primary history_add_btn">添加</div>
- </div>
- <table class="table table-bordered">
- <thead>
- <tr>
- <th style="width: 60px">序号</th>
- <th style="width: 80px">年份</th>
- <th style="width: 80px">月份</th>
- <th style="width: 80px">类型</th>
- <th>内容</th>
- <th style="width: 100px">创建人</th>
- <th style="width: 160px">创建时间</th>
- <th style="width: 140px">操作</th>
- </tr>
- </thead>
- <tbody class="historyTableBody"></tbody>
- </table>
- <div class="history_page page_box">
- <!-- <div class="page_prev disabled"><</div>
- <div data-page="1" class="page_num selected">1</div>
- <div class="page_num">2</div>
- <div class="page_next">></div> -->
- </div>
- </div>
-
- <script src="../librarys/jquery@1.12.4/jquery.min.js"></script>
- <script src="../librarys/bootstrap@3.4.1/bootstrap.js"></script>
- <script src="../librarys/bootstrap@3.4.1/bootstrap-datepicker.js"></script>
- <script src="../librarys/bootstrapValidator@0.5.3/bootstrapValidator.js"></script>
- <script src="../utils/index.js"></script>
- <script>
- $(function () {
- let page_url = $(".top_header_root").data("header_page");
- $(
- '.header_html_root .header_html_item[data-url="' + page_url + '"]'
- ).addClass("selected");
- $(".header_html_root").on("click", ".header_html_item", function () {
- let _url = $(this).data("url");
- if (_url === "index") {
- window.location.href = "/index.html";
- } else {
- window.location.href = "/sections/" + _url + ".html";
- }
- });
- if (!$.isLogin()) {
- window.location.href = "/sections/login.html";
- return;
- }
- let historySearch = {
- page: Number($.getQueryletiable("page")) || 1,
- size: 10,
- dhyear:
- $.getQueryletiable("dhyear") || new Date().getFullYear().toString(),
- type: Number($.getQueryletiable("type")) || 1,
- total: 0,
- list: []
- };
- $(".header_left #dhyearPicker")
- .datepicker({
- autoclose: true,
- startView: 2,
- maxViewMode: 2,
- minViewMode: 2,
- format: "yyyy",
- language: "zh-CN"
- })
- .datepicker("setDate", String(historySearch.dhyear));
- $(".header_left #dhyearPicker input[name='dhyear']").on(
- "change",
- function () {
- historySearch.dhyear = $(this).val();
- window.location.href =
- "/sections/history.html?page=" +
- historySearch.page +
- "&dhyear=" +
- historySearch.dhyear +
- "&type=" +
- historySearch.type;
- }
- );
- $(".header_left input[name='history_type']").each(function (
- _index,
- _typeItem
- ) {
- if (Number($(_typeItem).val()) === historySearch.type) {
- $(_typeItem).attr("checked", true);
- } else {
- $(_typeItem).attr("checked", false);
- }
- });
- $(".header_left").on(
- "click",
- 'input:radio[name="history_type"]',
- function () {
- window.location.href =
- "/sections/history.html?page=" +
- historySearch.page +
- "&dhyear=" +
- historySearch.dhyear +
- "&type=" +
- $('.header_left input:radio[name="history_type"]:checked').val();
- }
- );
- $(".header_left .searchBtn").click(function () {
- window.location.href =
- "/sections/history.html?page=" +
- historySearch.page +
- "&dhyear=" +
- historySearch.dhyear +
- "&type=" +
- historySearch.type;
- });
- // 获取用户列表
- function getHistoryList() {
- $.ajax({
- type: "POST",
- url: $.baseUrl + "dh/list",
- dataType: "json",
- contentType: "application/json; charset=utf-8",
- data: JSON.stringify({
- page: historySearch.page,
- size: historySearch.size,
- dhyear: historySearch.dhyear,
- type: historySearch.type
- }),
- success: function (data) {
- if (data.code === 0) {
- historySearch.total = data.obj.total;
- historySearch.list = data.obj.list;
- setTableHtml();
- setPageList();
- } else {
- historySearch.total = 0;
- historySearch.list = [];
- alert(data.msg);
- }
- }
- });
- }
- // 设置表格信息
- function setTableHtml() {
- let historyTableBodyHtml = "";
- $.each(historySearch.list, function (_historyIndex, _historyItem) {
- historyTableBodyHtml +=
- "<tr><td>" +
- (_historyIndex +
- 1 +
- (historySearch.page - 1) * historySearch.size) +
- "</td><td>" +
- (_historyItem.dhyear ? _historyItem.dhyear : "") +
- "</td><td>" +
- (_historyItem.dhmonth ? _historyItem.dhmonth : "") +
- "</td><td>" +
- (_historyItem.ltype === 1 ? "中文" : "英文") +
- "</td><td>" +
- (_historyItem.content ? _historyItem.content : "") +
- "</td><td>" +
- (_historyItem.createname ? _historyItem.createname : "") +
- "</td><td>" +
- $.dateFormat(_historyItem.createtime) +
- '</td><td><span class="my_theme_color action_btn modify_btn" data-dhid="' +
- _historyItem.dhid +
- '">修改</span><span class="my_theme_color">|</span><span class="del_color action_btn del_btn" data-dhid="' +
- _historyItem.dhid +
- '">删除</span></td></tr>';
- });
- $(".historyTableBody").html(historyTableBodyHtml);
- let del_dhid = null;
- $(".historyTableBody").on("click", ".del_btn", function () {
- $("#userDelModal").modal("show");
- del_dhid = $(this).data("dhid");
- });
- $("#userDelModal .del_save").on("click", function () {
- $.ajax({
- type: "POST",
- url: $.baseUrl + "user/del",
- dataType: "json",
- contentType: "application/json; charset=utf-8",
- data: JSON.stringify({
- dhid: del_dhid
- }),
- success: function (data) {
- $("#userDelModal").modal("hide");
- if (data.code === 0) {
- window.location.href =
- "/index.html?page=" +
- historySearch.page +
- "&userstate=" +
- historySearch.userstate +
- "&username=" +
- historySearch.username;
- } else {
- alert(data.msg);
- }
- }
- });
- });
- }
- function setPageList() {}
- getHistoryList();
- });
- </script>
- </body>
- </html>
|