瀏覽代碼

登录日志

gzb
wangzhonglu 1 年之前
父節點
當前提交
4f3b928231
共有 1 個檔案被更改,包括 313 行新增0 行删除
  1. 313
    0
      sections/log.html

+ 313
- 0
sections/log.html 查看文件

@@ -0,0 +1,313 @@
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 rel="stylesheet" href="../css/comm.css" />
15
+    <link rel="stylesheet" href="../css/header.css" />
16
+    <style>
17
+      body {
18
+        background-color: #fff;
19
+      }
20
+      .log_main {
21
+        margin: 20px auto;
22
+        width: 1000px;
23
+      }
24
+      .log_main .header_box {
25
+        display: flex;
26
+        justify-content: space-between;
27
+        align-items: center;
28
+        margin-bottom: 10px;
29
+      }
30
+      .header_left {
31
+        display: flex;
32
+        justify-content: flex-start;
33
+        align-items: center;
34
+      }
35
+      .header_left #dhyearPicker {
36
+        margin-right: 16px;
37
+      }
38
+      .log_radio {
39
+        cursor: pointer;
40
+      }
41
+      .header_left .searchBtn {
42
+        margin-left: 16px;
43
+      }
44
+      .log_main .table.table-bordered th {
45
+        text-align: center;
46
+        background-color: #f7f7f7;
47
+      }
48
+      .log_main .table.table-bordered td {
49
+        text-align: center;
50
+        background-color: #fff;
51
+      }
52
+      .log_main .table.table-bordered .action_btn {
53
+        margin: 0 10px;
54
+        cursor: pointer;
55
+      }
56
+    </style>
57
+  </head>
58
+  <body>
59
+    <div class="top_header_root" data-header_page="log">
60
+      <div class="header_html_root">
61
+        <div class="header_html_item" data-url="index">用户信息</div>
62
+        <div class="header_html_item" data-url="history">发展历程</div>
63
+        <div class="header_html_item" data-url="service">服务案例</div>
64
+        <div class="header_html_item" data-url="school">学校图标</div>
65
+        <div class="header_html_item" data-url="trial">申请试用</div>
66
+        <div class="header_html_item" data-url="news">新闻资讯</div>
67
+        <div class="header_html_item" data-url="log">登录日志</div>
68
+      </div>
69
+    </div>
70
+    <div class="log_main">
71
+      <div class="header_box">
72
+        <div class="header_left">
73
+          <div class="input-group date" id="dhyearPicker">
74
+            <input type="text" class="form-control" name="dhyear" />
75
+            <span class="input-group-addon">
76
+              <span class="glyphicon glyphicon-calendar"></span>
77
+            </span>
78
+          </div>
79
+          <div class="radio-inline">
80
+            <input
81
+              id="s_0"
82
+              class="log_radio"
83
+              name="log_type"
84
+              type="radio"
85
+              value="1"
86
+            />
87
+            <label for="s_0" class="log_radio">中文</label>
88
+          </div>
89
+          <div class="radio-inline">
90
+            <input
91
+              id="s_1"
92
+              class="log_radio"
93
+              name="log_type"
94
+              type="radio"
95
+              value="2"
96
+            />
97
+            <label for="s_1" class="log_radio">英文</label>
98
+          </div>
99
+          <div type="button" class="btn btn-primary searchBtn">搜索</div>
100
+        </div>
101
+      </div>
102
+      <table class="table table-bordered">
103
+        <thead>
104
+          <tr>
105
+            <th style="width: 60px">序号</th>
106
+            <th style="width: 80px">年份</th>
107
+            <th style="width: 80px">月份</th>
108
+            <th style="width: 80px">类型</th>
109
+            <th>内容</th>
110
+            <th style="width: 100px">创建人</th>
111
+            <th style="width: 160px">创建时间</th>
112
+          </tr>
113
+        </thead>
114
+        <tbody class="historyTableBody"></tbody>
115
+      </table>
116
+      <div class="log_page page_box">
117
+        <!-- <div class="page_prev disabled">&lt;</div>
118
+        <div data-page="1" class="page_num selected">1</div>
119
+        <div class="page_num">2</div>
120
+        <div class="page_next">&gt;</div> -->
121
+      </div>
122
+    </div>
123
+    <script src="../librarys/jquery@1.12.4/jquery.min.js"></script>
124
+    <script src="../librarys/bootstrap@3.4.1/bootstrap.js"></script>
125
+    <script src="../librarys/bootstrap@3.4.1/bootstrap-datepicker.js"></script>
126
+    <script src="../librarys/bootstrap@3.4.1/bootstrap-datepicker.zh-CN.min.js"></script>
127
+    <script src="../utils/index.js"></script>
128
+    <script>
129
+      $(function () {
130
+        let page_url = $(".top_header_root").data("header_page");
131
+        $(
132
+          '.header_html_root .header_html_item[data-url="' + page_url + '"]'
133
+        ).addClass("selected");
134
+        $(".header_html_root").on("click", ".header_html_item", function () {
135
+          let _url = $(this).data("url");
136
+          if (_url === "index") {
137
+            window.location.href = "/index.html";
138
+          } else {
139
+            window.location.href = "/sections/" + _url + ".html";
140
+          }
141
+        });
142
+        if (!$.isLogin()) {
143
+          window.location.href = "/sections/login.html";
144
+          return;
145
+        }
146
+        let historySearch = {
147
+          page: Number($.getQueryletiable("page")) || 1,
148
+          size: 10,
149
+          dhyear:
150
+            $.getQueryletiable("dhyear") || new Date().getFullYear().toString(),
151
+          ltype: Number($.getQueryletiable("ltype")) || 1,
152
+          total: 0,
153
+          list: []
154
+        };
155
+        $(".header_left #dhyearPicker")
156
+          .datepicker({
157
+            autoclose: true,
158
+            startView: 2,
159
+            maxViewMode: 2,
160
+            minViewMode: 2,
161
+            format: "yyyy",
162
+            language: "zh-CN"
163
+          })
164
+          .datepicker("setDate", String(historySearch.dhyear));
165
+        $(".header_left #dhyearPicker input[name='dhyear']").on(
166
+          "change",
167
+          function () {
168
+            historySearch.dhyear = $(this).val();
169
+            window.location.href =
170
+              "/sections/history.html?page=" +
171
+              historySearch.page +
172
+              "&dhyear=" +
173
+              historySearch.dhyear +
174
+              "&ltype=" +
175
+              historySearch.ltype;
176
+          }
177
+        );
178
+        $(".header_left .searchBtn").click(function () {
179
+          window.location.href =
180
+            "/sections/history.html?page=" +
181
+            historySearch.page +
182
+            "&dhyear=" +
183
+            historySearch.dhyear +
184
+            "&ltype=" +
185
+            historySearch.ltype;
186
+        });
187
+        // 获取用户列表
188
+        function getHistoryList() {
189
+          $.ajax({
190
+            type: "POST",
191
+            url: $.baseUrl + "dh/list",
192
+            dataType: "json",
193
+            contentType: "application/json; charset=utf-8",
194
+            data: JSON.stringify({
195
+              page: historySearch.page,
196
+              size: historySearch.size,
197
+              dhyear: historySearch.dhyear,
198
+              ltype: historySearch.ltype,
199
+            }),
200
+            success: function (data) {
201
+              if (data.code === 0) {
202
+                historySearch.total = data.obj.total;
203
+                historySearch.list = data.obj.list;
204
+                setTableHtml();
205
+                setPageList();
206
+              } else {
207
+                historySearch.total = 0;
208
+                historySearch.list = [];
209
+                alert(data.msg);
210
+              }
211
+            }
212
+          });
213
+        }
214
+        // 设置表格信息
215
+        function setTableHtml() {
216
+          let historyTableBodyHtml = "";
217
+          $.each(historySearch.list, function (_historyIndex, _historyItem) {
218
+            historyTableBodyHtml +=
219
+              "<tr><td>" +
220
+              (_historyIndex +
221
+                1 +
222
+                (historySearch.page - 1) * historySearch.size) +
223
+              "</td><td>" +
224
+              (_historyItem.dhyear ? _historyItem.dhyear : "") +
225
+              "</td><td>" +
226
+              (_historyItem.dhmonth ? _historyItem.dhmonth : "") +
227
+              "</td><td>" +
228
+              (_historyItem.ltype === 1 ? "中文" : "英文") +
229
+              "</td><td>" +
230
+              (_historyItem.content ? _historyItem.content : "") +
231
+              "</td><td>" +
232
+              (_historyItem.createname ? _historyItem.createname : "") +
233
+              "</td><td>" +
234
+              $.dateFormat(_historyItem.createtime) +
235
+              '</td></tr>';
236
+          });
237
+          $(".historyTableBody").html(historyTableBodyHtml);
238
+        }
239
+        // 设置页码信息
240
+        function setPageList() {
241
+          let pageBoxHtml =
242
+            '<div class="page_prev ' +
243
+            (historySearch.page === 1 ? "disabled" : "") +
244
+            '">&lt;</div>';
245
+          for (
246
+            let _pageIndex = 0;
247
+            _pageIndex < Math.ceil(historySearch.total / historySearch.size);
248
+            _pageIndex++
249
+          ) {
250
+            pageBoxHtml +=
251
+              '<div data-page="' +
252
+              (_pageIndex + 1) +
253
+              '" class="page_num ' +
254
+              (_pageIndex + 1 === historySearch.page ? "selected" : "") +
255
+              '">' +
256
+              (_pageIndex + 1) +
257
+              "</div>";
258
+          }
259
+          pageBoxHtml +=
260
+            '<div class="page_next ' +
261
+            (historySearch.page ===
262
+            Math.ceil(historySearch.total / historySearch.size)
263
+              ? "disabled"
264
+              : "") +
265
+            '">&gt;</div>';
266
+          if (historySearch.total > 0) {
267
+            $(".log_page.page_box").html(pageBoxHtml);
268
+            $(".log_page.page_box").on("click", ".page_prev", function () {
269
+              if (historySearch.page > 1) {
270
+                historySearch.page--;
271
+                window.location.href =
272
+                  "/sections/history.html?page=" +
273
+                  historySearch.page +
274
+                  "&dhyear=" +
275
+                  historySearch.dhyear +
276
+                  "&ltype=" +
277
+                  historySearch.ltype;
278
+              }
279
+            });
280
+            $(".log_page.page_box").on("click", ".page_num", function () {
281
+              historySearch.page = $(this).data("page");
282
+              window.location.href =
283
+                "/sections/history.html?page=" +
284
+                historySearch.page +
285
+                "&dhyear=" +
286
+                historySearch.dhyear +
287
+                "&ltype=" +
288
+                historySearch.ltype;
289
+            });
290
+            $(".log_page.page_box").on("click", ".page_next", function () {
291
+              if (
292
+                historySearch.page <
293
+                Math.ceil(historySearch.total / historySearch.size)
294
+              ) {
295
+                historySearch.page++;
296
+                window.location.href =
297
+                  "/sections/history.html?page=" +
298
+                  historySearch.page +
299
+                  "&dhyear=" +
300
+                  historySearch.dhyear +
301
+                  "&ltype=" +
302
+                  historySearch.ltype;
303
+              }
304
+            });
305
+          } else {
306
+            $(".log_page.page_box").html("");
307
+          }
308
+        }
309
+        getHistoryList();
310
+      });
311
+    </script>
312
+  </body>
313
+</html>

Loading…
取消
儲存