guozhongbo 1 anno fa
parent
commit
20f78034b6
5 ha cambiato i file con 1728 aggiunte e 62 eliminazioni
  1. 43
    43
      index.html
  2. 11
    11
      sections/history.html
  3. 25
    8
      sections/login.html
  4. 824
    0
      sections/school.html
  5. 825
    0
      sections/service.html

+ 43
- 43
index.html Vedi File

@@ -374,7 +374,7 @@
374 374
           userstate: Number($.getQueryletiable("userstate")) || 0,
375 375
           username: $.getQueryletiable("username") || "",
376 376
           total: 0,
377
-          list: [],
377
+          list: []
378 378
         };
379 379
         $('.header_left input:radio[name="user_radio"]').each(function (
380 380
           _index,
@@ -397,7 +397,7 @@
397 397
               page: userSearch.page,
398 398
               size: userSearch.size,
399 399
               userstate: userSearch.userstate,
400
-              username: userSearch.username,
400
+              username: userSearch.username
401 401
             }),
402 402
             success: function (data) {
403 403
               if (data.code === 0) {
@@ -410,7 +410,7 @@
410 410
                 userSearch.list = [];
411 411
                 alert(data.msg);
412 412
               }
413
-            },
413
+            }
414 414
           });
415 415
         }
416 416
         // 设置页码信息
@@ -521,7 +521,7 @@
521 521
               dataType: "json",
522 522
               contentType: "application/json; charset=utf-8",
523 523
               data: JSON.stringify({
524
-                userid: del_userid,
524
+                userid: del_userid
525 525
               }),
526 526
               success: function (data) {
527 527
                 $("#userDelModal").modal("hide");
@@ -536,7 +536,7 @@
536 536
                 } else {
537 537
                   alert(data.msg);
538 538
                 }
539
-              },
539
+              }
540 540
             });
541 541
           });
542 542
         }
@@ -552,41 +552,41 @@
552 552
             feedbackIcons: {
553 553
               valid: "glyphicon glyphicon-ok",
554 554
               invalid: "glyphicon glyphicon-remove",
555
-              validating: "glyphicon glyphicon-refresh",
555
+              validating: "glyphicon glyphicon-refresh"
556 556
             },
557 557
             fields: {
558 558
               username: {
559 559
                 validators: {
560 560
                   notEmpty: {
561
-                    message: "请输入用户姓名",
562
-                  },
563
-                },
561
+                    message: "请输入用户姓名"
562
+                  }
563
+                }
564 564
               },
565 565
               loginname: {
566 566
                 validators: {
567 567
                   notEmpty: {
568
-                    message: "请输入登录账号",
568
+                    message: "请输入登录账号"
569 569
                   },
570 570
                   stringLength: {
571 571
                     //长度限制
572 572
                     min: 4,
573 573
                     max: 18,
574
-                    message: "登录账号长度必须在4~18个字符之间",
575
-                  },
576
-                },
574
+                    message: "登录账号长度必须在4~18个字符之间"
575
+                  }
576
+                }
577 577
               },
578 578
               loginpwd: {
579 579
                 validators: {
580 580
                   notEmpty: {
581
-                    message: "请输入登录密码",
581
+                    message: "请输入登录密码"
582 582
                   },
583 583
                   stringLength: {
584 584
                     //长度限制
585 585
                     min: 6,
586 586
                     max: 16,
587
-                    message: "登录密码长度必须在6~16个字符之间",
588
-                  },
589
-                },
587
+                    message: "登录密码长度必须在6~16个字符之间"
588
+                  }
589
+                }
590 590
               },
591 591
               userphone: {
592 592
                 validators: {
@@ -595,11 +595,11 @@
595 595
                   // },
596 596
                   regexp: {
597 597
                     regexp: /^1\d{10}$/,
598
-                    message: "请输入正确的11位手机号",
599
-                  },
600
-                },
601
-              },
602
-            },
598
+                    message: "请输入正确的11位手机号"
599
+                  }
600
+                }
601
+              }
602
+            }
603 603
           });
604 604
           //先校验,在调是否通过校验的方法
605 605
           $("#UserAddForm").data("bootstrapValidator").validate();
@@ -617,7 +617,7 @@
617 617
                 loginname: $("#UserAddForm #loginnameInput").val(),
618 618
                 loginpwd: $("#UserAddForm #loginpwdInput").val(),
619 619
                 createid: $.userInfo.userid,
620
-                userphone: $("#UserAddForm #userphoneInput").val(),
620
+                userphone: $("#UserAddForm #userphoneInput").val()
621 621
               }),
622 622
               success: function (data) {
623 623
                 if (data.code === 0) {
@@ -629,7 +629,7 @@
629 629
                 } else {
630 630
                   alert(data.msg);
631 631
                 }
632
-              },
632
+              }
633 633
             });
634 634
           }
635 635
         });
@@ -656,41 +656,41 @@
656 656
             feedbackIcons: {
657 657
               valid: "glyphicon glyphicon-ok",
658 658
               invalid: "glyphicon glyphicon-remove",
659
-              validating: "glyphicon glyphicon-refresh",
659
+              validating: "glyphicon glyphicon-refresh"
660 660
             },
661 661
             fields: {
662 662
               username: {
663 663
                 validators: {
664 664
                   notEmpty: {
665
-                    message: "请输入用户姓名",
666
-                  },
667
-                },
665
+                    message: "请输入用户姓名"
666
+                  }
667
+                }
668 668
               },
669 669
               loginname: {
670 670
                 validators: {
671 671
                   notEmpty: {
672
-                    message: "请输入登录账号",
672
+                    message: "请输入登录账号"
673 673
                   },
674 674
                   stringLength: {
675 675
                     //长度限制
676 676
                     min: 4,
677 677
                     max: 18,
678
-                    message: "登录账号长度必须在4~18个字符之间",
679
-                  },
680
-                },
678
+                    message: "登录账号长度必须在4~18个字符之间"
679
+                  }
680
+                }
681 681
               },
682 682
               loginpwd: {
683 683
                 validators: {
684 684
                   notEmpty: {
685
-                    message: "请输入登录密码",
685
+                    message: "请输入登录密码"
686 686
                   },
687 687
                   stringLength: {
688 688
                     //长度限制
689 689
                     min: 6,
690 690
                     max: 16,
691
-                    message: "登录密码长度必须在6~16个字符之间",
692
-                  },
693
-                },
691
+                    message: "登录密码长度必须在6~16个字符之间"
692
+                  }
693
+                }
694 694
               },
695 695
               userphone: {
696 696
                 validators: {
@@ -699,11 +699,11 @@
699 699
                   // },
700 700
                   regexp: {
701 701
                     regexp: /^1\d{10}$/,
702
-                    message: "请输入正确的11位手机号",
703
-                  },
704
-                },
705
-              },
706
-            },
702
+                    message: "请输入正确的11位手机号"
703
+                  }
704
+                }
705
+              }
706
+            }
707 707
           });
708 708
           //先校验,在调是否通过校验的方法
709 709
           $("#userModifyForm").data("bootstrapValidator").validate();
@@ -721,7 +721,7 @@
721 721
                 loginname: $("#userModifyForm #m_loginnameInput").val(),
722 722
                 loginpwd: $("#userModifyForm #m_loginpwdInput").val(),
723 723
                 userid: modify_userid,
724
-                userphone: $("#userModifyForm #m_userphoneInput").val(),
724
+                userphone: $("#userModifyForm #m_userphoneInput").val()
725 725
               }),
726 726
               success: function (data) {
727 727
                 if (data.code === 0) {
@@ -735,7 +735,7 @@
735 735
                 } else {
736 736
                   alert(data.msg);
737 737
                 }
738
-              },
738
+              }
739 739
             });
740 740
           }
741 741
         });

+ 11
- 11
sections/history.html Vedi File

@@ -157,7 +157,7 @@
157 157
             $.getQueryletiable("dhyear") || new Date().getFullYear().toString(),
158 158
           type: Number($.getQueryletiable("type")) || 1,
159 159
           total: 0,
160
-          list: [],
160
+          list: []
161 161
         };
162 162
         $(".header_left #dhyearPicker")
163 163
           .datepicker({
@@ -166,7 +166,7 @@
166 166
             maxViewMode: 2,
167 167
             minViewMode: 2,
168 168
             format: "yyyy",
169
-            language: "zh-CN",
169
+            language: "zh-CN"
170 170
           })
171 171
           .datepicker("setDate", String(historySearch.dhyear));
172 172
         $(".header_left #dhyearPicker input[name='dhyear']").on(
@@ -225,7 +225,7 @@
225 225
               page: historySearch.page,
226 226
               size: historySearch.size,
227 227
               dhyear: historySearch.dhyear,
228
-              type: historySearch.type,
228
+              type: historySearch.type
229 229
             }),
230 230
             success: function (data) {
231 231
               if (data.code === 0) {
@@ -238,7 +238,7 @@
238 238
                 historySearch.list = [];
239 239
                 alert(data.msg);
240 240
               }
241
-            },
241
+            }
242 242
           });
243 243
         }
244 244
         // 设置表格信息
@@ -247,7 +247,9 @@
247 247
           $.each(historySearch.list, function (_historyIndex, _historyItem) {
248 248
             historyTableBodyHtml +=
249 249
               "<tr><td>" +
250
-              (_historyIndex + 1 + (historySearch.page - 1) * historySearch.size) +
250
+              (_historyIndex +
251
+                1 +
252
+                (historySearch.page - 1) * historySearch.size) +
251 253
               "</td><td>" +
252 254
               (_historyItem.dhyear ? _historyItem.dhyear : "") +
253 255
               "</td><td>" +
@@ -255,7 +257,7 @@
255 257
               "</td><td>" +
256 258
               (_historyItem.ltype === 1 ? "中文" : "英文") +
257 259
               "</td><td>" +
258
-                (_historyItem.content ? _historyItem.content : "") +
260
+              (_historyItem.content ? _historyItem.content : "") +
259 261
               "</td><td>" +
260 262
               (_historyItem.createname ? _historyItem.createname : "") +
261 263
               "</td><td>" +
@@ -279,7 +281,7 @@
279 281
               dataType: "json",
280 282
               contentType: "application/json; charset=utf-8",
281 283
               data: JSON.stringify({
282
-                dhid: del_dhid,
284
+                dhid: del_dhid
283 285
               }),
284 286
               success: function (data) {
285 287
                 $("#userDelModal").modal("hide");
@@ -294,13 +296,11 @@
294 296
                 } else {
295 297
                   alert(data.msg);
296 298
                 }
297
-              },
299
+              }
298 300
             });
299 301
           });
300 302
         }
301
-        function setPageList() {
302
-          
303
-        }
303
+        function setPageList() {}
304 304
         getHistoryList();
305 305
       });
306 306
     </script>

+ 25
- 8
sections/login.html Vedi File

@@ -62,7 +62,9 @@
62 62
         </div>
63 63
         <div class="form-group">
64 64
           <div class="col-xs-offset-4 col-xs-10">
65
-            <div class="btn btn-primary col-xs-4 my_theme_bg" id="loginBtn">登录</div>
65
+            <div class="btn btn-primary col-xs-4 my_theme_bg" id="loginBtn">
66
+              登录
67
+            </div>
66 68
           </div>
67 69
         </div>
68 70
       </form>
@@ -82,7 +84,7 @@
82 84
             !$("#rememberInput").attr("checked")
83 85
           );
84 86
         });
85
-        $("#loginBtn").click(function () {
87
+        function login() {
86 88
           let inputLoginname = $("#inputLoginname").val();
87 89
           let inputPassword = $("#inputPassword").val();
88 90
           let rememberInput = $("#rememberInput").attr("checked");
@@ -115,18 +117,33 @@
115 117
             success: function (data) {
116 118
               if (data.code === 0) {
117 119
                 if (rememberInput) {
118
-                  localStorage.setItem("loginInfo", JSON.stringify({
119
-                    loginname: inputLoginname,
120
-                    loginpwd: inputPassword
121
-                  }));
120
+                  localStorage.setItem(
121
+                    "loginInfo",
122
+                    JSON.stringify({
123
+                      loginname: inputLoginname,
124
+                      loginpwd: inputPassword
125
+                    })
126
+                  );
122 127
                 }
123
-                localStorage.setItem("xhWebAdminUser", JSON.stringify(data.obj));
128
+                localStorage.setItem(
129
+                  "xhWebAdminUser",
130
+                  JSON.stringify(data.obj)
131
+                );
124 132
                 window.location.href = "/index.html";
125 133
               } else {
126 134
                 alert(data.msg);
127 135
               }
128
-            },
136
+            }
129 137
           });
138
+        }
139
+        //回车事件
140
+        $(document).keyup(function (event) {
141
+          if (event.keyCode == 13) {
142
+            login();
143
+          }
144
+        });
145
+        $("#loginBtn").click(function () {
146
+          login();
130 147
         });
131 148
       });
132 149
     </script>

+ 824
- 0
sections/school.html Vedi File

@@ -0,0 +1,824 @@
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/bootstrapValidator@0.5.3/bootstrapValidator.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
+      .user_main {
21
+        margin: 20px auto;
22
+        width: 1000px;
23
+      }
24
+      .user_main .header_box {
25
+        display: flex;
26
+        justify-content: space-between;
27
+        align-items: center;
28
+        margin-bottom: 10px;
29
+      }
30
+      .header_left .user_radio {
31
+        cursor: pointer;
32
+      }
33
+      .header_left #searchschoolname {
34
+        display: inline-block;
35
+        margin-left: 16px;
36
+        width: 240px;
37
+      }
38
+      .header_left .searchBtn {
39
+        margin-left: 16px;
40
+      }
41
+      .user_main .table.table-bordered th {
42
+        text-align: center;
43
+        background-color: #f7f7f7;
44
+      }
45
+      .user_main .table.table-bordered td {
46
+        text-align: center;
47
+        background-color: #fff;
48
+        line-height: 40px;
49
+      }
50
+      .user_main .table.table-bordered .action_btn {
51
+        margin: 0 10px;
52
+        cursor: pointer;
53
+      }
54
+      .user_main .table.table-bordered .action_show {
55
+        display: block;
56
+      }
57
+      .user_main .table.table-bordered .action_hide {
58
+        display: none;
59
+      }
60
+      .ser_img {
61
+        width: 40px;
62
+        height: 40px;
63
+        cursor: pointer;
64
+      }
65
+      .showimgurl,
66
+      .showimgurl img {
67
+        width: 100%;
68
+        height: 100%;
69
+      }
70
+    </style>
71
+  </head>
72
+  <body>
73
+    <div class="top_header_root" data-header_page="school">
74
+      <div class="header_html_root">
75
+        <div class="header_html_item" data-url="index">用户信息</div>
76
+        <div class="header_html_item" data-url="history">发展历程</div>
77
+        <div class="header_html_item" data-url="service">服务案例</div>
78
+        <div class="header_html_item" data-url="school">学校图标</div>
79
+        <div class="header_html_item" data-url="trial">申请试用</div>
80
+        <div class="header_html_item" data-url="news">新闻资讯</div>
81
+        <div class="header_html_item" data-url="log">登录日志</div>
82
+      </div>
83
+    </div>
84
+    <div class="user_main">
85
+      <div class="header_box">
86
+        <div class="header_left">
87
+          <div class="radio-inline">
88
+            <input
89
+              id="s_1"
90
+              class="user_radio"
91
+              name="user_radio"
92
+              type="radio"
93
+              value="1"
94
+            />
95
+            <label for="s_1" class="user_radio">中文</label>
96
+          </div>
97
+          <div class="radio-inline">
98
+            <input
99
+              id="s_2"
100
+              class="user_radio"
101
+              name="user_radio"
102
+              type="radio"
103
+              value="2"
104
+            />
105
+            <label for="s_2" class="user_radio">英文</label>
106
+          </div>
107
+          <input
108
+            type="text"
109
+            id="searchschoolname"
110
+            class="form-control"
111
+            placeholder="请输入学校名称"
112
+          />
113
+          <div type="button" class="btn btn-primary searchBtn">搜索</div>
114
+        </div>
115
+        <div type="button" class="btn btn-primary user_add_btn">添加</div>
116
+      </div>
117
+      <table class="table table-bordered">
118
+        <thead>
119
+          <tr>
120
+            <th style="width: 60px">序号</th>
121
+            <th>学校名称</th>
122
+            <th style="width: 140px">学校图标</th>
123
+            <th>创建人</th>
124
+            <th style="width: 160px">创建时间</th>
125
+            <th style="width: 140px">操作</th>
126
+          </tr>
127
+        </thead>
128
+        <tbody class="userTableBody"></tbody>
129
+      </table>
130
+      <div class="user_page page_box">
131
+        <!-- <div class="page_prev disabled">&lt;</div>
132
+        <div data-page="1" class="page_num selected">1</div>
133
+        <div class="page_num">2</div>
134
+        <div class="page_next">&gt;</div> -->
135
+      </div>
136
+    </div>
137
+    <!-- 查看图片 -->
138
+    <div
139
+      class="modal fade"
140
+      id="showImg"
141
+      tabindex="-1"
142
+      role="dialog"
143
+      aria-labelledby="imgTitle"
144
+    >
145
+      <div class="modal-dialog" role="document">
146
+        <div class="modal-content">
147
+          <div class="modal-header">
148
+            <button
149
+              type="button"
150
+              class="close"
151
+              data-dismiss="modal"
152
+              aria-label="Close"
153
+            >
154
+              <span aria-hidden="true">&times;</span>
155
+            </button>
156
+            <h4 class="modal-title" id="imgTitle">查看图片</h4>
157
+          </div>
158
+          <div class="modal-body">
159
+            <div class="showimgurl"></div>
160
+          </div>
161
+        </div>
162
+      </div>
163
+    </div>
164
+    <!-- 添加用户弹窗 -->
165
+    <div
166
+      class="modal fade"
167
+      id="userAddModal"
168
+      tabindex="-1"
169
+      role="dialog"
170
+      aria-labelledby="AddTitle"
171
+    >
172
+      <div class="modal-dialog" role="document">
173
+        <div class="modal-content">
174
+          <div class="modal-header">
175
+            <button
176
+              type="button"
177
+              class="close"
178
+              data-dismiss="modal"
179
+              aria-label="Close"
180
+            >
181
+              <span aria-hidden="true">&times;</span>
182
+            </button>
183
+            <h4 class="modal-title" id="AddTitle">添加学校</h4>
184
+          </div>
185
+          <div class="modal-body">
186
+            <form class="form-horizontal" id="UserAddForm">
187
+              <div class="form-group">
188
+                <label for="schoolnameInput" class="col-sm-2 control-label"
189
+                  >学校名称</label
190
+                >
191
+                <div class="col-sm-10">
192
+                  <input
193
+                    type="text"
194
+                    class="form-control"
195
+                    id="schoolnameInput"
196
+                    name="schoolname"
197
+                    placeholder="请输入学校名称"
198
+                  />
199
+                </div>
200
+              </div>
201
+              <div class="form-group">
202
+                <label for="loginnameInput" class="col-sm-2 control-label"
203
+                  >学校图标</label
204
+                >
205
+                <div class="col-sm-10">
206
+                  <input type="file" id="uploadFile" />
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="userModifyModal"
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="userModifyForm">
243
+              <div class="form-group">
244
+                <label for="m_schoolnameInput" class="col-sm-2 control-label"
245
+                  >用户姓名</label
246
+                >
247
+                <div class="col-sm-10">
248
+                  <input
249
+                    type="text"
250
+                    class="form-control"
251
+                    id="m_schoolnameInput"
252
+                    name="schoolname"
253
+                    placeholder="请输入用户姓名"
254
+                  />
255
+                </div>
256
+              </div>
257
+              <div class="form-group">
258
+                <label for="m_loginnameInput" class="col-sm-2 control-label"
259
+                  >登录账号</label
260
+                >
261
+                <div class="col-sm-10">
262
+                  <input
263
+                    type="text"
264
+                    class="form-control"
265
+                    id="m_loginnameInput"
266
+                    name="loginname"
267
+                    placeholder="请输入登录账号"
268
+                  />
269
+                </div>
270
+              </div>
271
+              <div class="form-group">
272
+                <label for="m_loginpwdInput" class="col-sm-2 control-label"
273
+                  >登录密码</label
274
+                >
275
+                <div class="col-sm-10">
276
+                  <input
277
+                    type="password"
278
+                    class="form-control"
279
+                    id="m_loginpwdInput"
280
+                    name="loginpwd"
281
+                    placeholder="请输入登录密码"
282
+                  />
283
+                </div>
284
+              </div>
285
+              <div class="form-group">
286
+                <label for="m_userphoneInput" class="col-sm-2 control-label"
287
+                  >手机号</label
288
+                >
289
+                <div class="col-sm-10">
290
+                  <input
291
+                    type="text"
292
+                    class="form-control"
293
+                    id="m_userphoneInput"
294
+                    name="userphone"
295
+                    placeholder="请输入手机号"
296
+                  />
297
+                </div>
298
+              </div>
299
+            </form>
300
+          </div>
301
+          <div class="modal-footer">
302
+            <div type="button" class="btn btn-default" data-dismiss="modal">
303
+              取消
304
+            </div>
305
+            <div type="button" class="btn btn-primary modify_save">确定</div>
306
+          </div>
307
+        </div>
308
+      </div>
309
+    </div>
310
+    <!-- 删除用户弹窗 -->
311
+    <div
312
+      class="modal fade"
313
+      id="userDelModal"
314
+      tabindex="-1"
315
+      role="dialog"
316
+      aria-labelledby="delTitle"
317
+    >
318
+      <div class="modal-dialog tip_modal" role="document">
319
+        <div class="modal-content">
320
+          <div class="modal-header">
321
+            <button
322
+              type="button"
323
+              class="close"
324
+              data-dismiss="modal"
325
+              aria-label="Close"
326
+            >
327
+              <span aria-hidden="true">&times;</span>
328
+            </button>
329
+            <h4 class="modal-title" id="delTitle">提示</h4>
330
+          </div>
331
+          <div class="modal-body">确定删除选中信息?</div>
332
+          <div class="modal-footer">
333
+            <div type="button" class="btn btn-default" data-dismiss="modal">
334
+              取消
335
+            </div>
336
+            <div type="button" class="btn btn-primary del_save">保存</div>
337
+          </div>
338
+        </div>
339
+      </div>
340
+    </div>
341
+    <script src="../librarys/jquery@1.12.4/jquery.min.js"></script>
342
+    <script src="../librarys/bootstrap@3.4.1/bootstrap.js"></script>
343
+    <script src="../librarys/bootstrapValidator@0.5.3/bootstrapValidator.js"></script>
344
+    <script src="../utils/index.js"></script>
345
+    <script>
346
+      $(function () {
347
+        let page_url = $(".top_header_root").data("header_page");
348
+        //导航跳转
349
+        $(
350
+          '.header_html_root .header_html_item[data-url="' + page_url + '"]'
351
+        ).addClass("selected");
352
+        $(".header_html_root").on("click", ".header_html_item", function () {
353
+          let _url = $(this).data("url");
354
+          if (_url === "index") {
355
+            window.location.href = "/index.html";
356
+          } else {
357
+            window.location.href = "/sections/" + _url + ".html";
358
+          }
359
+        });
360
+        //检测登录
361
+        if (!$.isLogin()) {
362
+          window.location.href = "/sections/login.html";
363
+          return;
364
+        }
365
+        let Search = {
366
+          page: Number($.getQueryletiable("page")) || 1,
367
+          size: 10,
368
+          ltype: Number($.getQueryletiable("ltype")) || 1,
369
+          schoolname: $.getQueryletiable("schoolname") || "",
370
+          total: 0,
371
+          list: []
372
+        };
373
+        //默认中英文单选框 1
374
+        $('.header_left input:radio[name="user_radio"]').each(function (
375
+          _index,
376
+          radioItem
377
+        ) {
378
+          if (Number($(radioItem).val()) === Search.ltype) {
379
+            $(radioItem).attr("checked", true);
380
+          } else {
381
+            $(radioItem).attr("checked", false);
382
+          }
383
+        });
384
+        // 获取用户列表
385
+        function getUserList() {
386
+          $.ajax({
387
+            type: "POST",
388
+            url: $.baseUrl + "sl/list",
389
+            dataType: "json",
390
+            contentType: "application/json; charset=utf-8",
391
+            data: JSON.stringify({
392
+              page: Search.page,
393
+              size: Search.size,
394
+              ltype: Search.ltype,
395
+              schoolname: Search.schoolname
396
+            }),
397
+            success: function (data) {
398
+              if (data.code === 0) {
399
+                Search.total = data.obj.total;
400
+                Search.list = data.obj.list;
401
+                console.log(Search);
402
+                setTableHtml();
403
+                setPageList();
404
+              } else {
405
+                Search.total = 0;
406
+                Search.list = [];
407
+                alert(data.msg);
408
+              }
409
+            }
410
+          });
411
+        }
412
+        // 设置页码信息
413
+        function setPageList() {
414
+          let pageBoxHtml =
415
+            '<div class="page_prev ' +
416
+            (Search.page === 1 ? "disabled" : "") +
417
+            '">&lt;</div>';
418
+          for (
419
+            let _pageIndex = 0;
420
+            _pageIndex < Math.ceil(Search.total / Search.size);
421
+            _pageIndex++
422
+          ) {
423
+            pageBoxHtml +=
424
+              '<div data-page="' +
425
+              (_pageIndex + 1) +
426
+              '" class="page_num ' +
427
+              (_pageIndex + 1 === Search.page ? "selected" : "") +
428
+              '">' +
429
+              (_pageIndex + 1) +
430
+              "</div>";
431
+          }
432
+          pageBoxHtml +=
433
+            '<div class="page_next ' +
434
+            (Search.page === Math.ceil(Search.total / Search.size)
435
+              ? "disabled"
436
+              : "") +
437
+            '">&gt;</div>';
438
+          if (Search.total > 0) {
439
+            $(".user_page.page_box").html(pageBoxHtml);
440
+            $(".user_page.page_box").on("click", ".page_prev", function () {
441
+              if (Search.page > 1) {
442
+                Search.page--;
443
+                window.location.href =
444
+                  "/index.html?page=" +
445
+                  Search.page +
446
+                  "&ltype=" +
447
+                  Search.ltype +
448
+                  "&schoolname=" +
449
+                  Search.schoolname;
450
+              }
451
+            });
452
+            $(".user_page.page_box").on("click", ".page_num", function () {
453
+              Search.page = $(this).data("page");
454
+              window.location.href =
455
+                "/index.html?page=" +
456
+                Search.page +
457
+                "&ltype=" +
458
+                Search.ltype +
459
+                "&schoolname=" +
460
+                Search.schoolname;
461
+            });
462
+            $(".user_page.page_box").on("click", ".page_next", function () {
463
+              if (Search.page < Math.ceil(Search.total / Search.size)) {
464
+                Search.page++;
465
+                window.location.href =
466
+                  "/index.html?page=" +
467
+                  Search.page +
468
+                  "&ltype=" +
469
+                  Search.ltype +
470
+                  "&schoolname=" +
471
+                  Search.schoolname;
472
+              }
473
+            });
474
+          } else {
475
+            $(".user_page.page_box").html("");
476
+          }
477
+        }
478
+        // 设置表格信息
479
+        function setTableHtml() {
480
+          let userTableBodyHtml = "";
481
+          $.each(Search.list, function (_userIndex, _userItem) {
482
+            userTableBodyHtml +=
483
+              "<tr><td>" +
484
+              (_userIndex + 1 + (Search.page - 1) * Search.size) +
485
+              "</td><td>" +
486
+              (_userItem.schoolname ? _userItem.schoolname : "") +
487
+              "</td><td><img class='ser_img' src='" +
488
+              (_userItem.schoollogo
489
+                ? $.showImageUrl + _userItem.schoollogo
490
+                : "") +
491
+              "' data-img='" +
492
+              (_userItem.schoollogo
493
+                ? $.showImageUrl + _userItem.schoollogo
494
+                : "") +
495
+              "' data-title='" +
496
+              (_userItem.schoolname ? _userItem.schoolname : "") +
497
+              "'></td><td>" +
498
+              (_userItem.createname ? _userItem.createname : "") +
499
+              "</td><td>" +
500
+              $.dateFormat(_userItem.createtime) +
501
+              '</td><td><div class="' +
502
+              (_userItem.ltype === 1 ? "action_show" : "action_hide") +
503
+              '"><span class="my_theme_color action_btn modify_btn" data-userid="' +
504
+              _userItem.userid +
505
+              '">修改</span><span class="my_theme_color">|</span><span class="del_color action_btn del_btn" data-userid="' +
506
+              _userItem.userid +
507
+              '">删除</span></div></td></tr>';
508
+          });
509
+          //点击图片放大 ser_img
510
+          $(".userTableBody").on("click", ".ser_img", function () {
511
+            let _url = $(this).data("img");
512
+            let title = $(this).data("title");
513
+            if (_url) {
514
+              $("#showImg").modal("show");
515
+              $(".showimgurl").html("<img src='" + _url + "'>");
516
+            }
517
+            if (title) {
518
+              $("#imgTitle").text(title);
519
+            }
520
+          });
521
+          $(".userTableBody").html(userTableBodyHtml);
522
+          let del_userid = null;
523
+          //删除弹窗
524
+          $(".userTableBody").on("click", ".del_btn", function () {
525
+            $("#userDelModal").modal("show");
526
+            del_userid = $(this).data("userid");
527
+          });
528
+          //确定删除
529
+          $("#userDelModal .del_save").on("click", function () {
530
+            $.ajax({
531
+              type: "POST",
532
+              url: $.baseUrl + "user/del",
533
+              dataType: "json",
534
+              contentType: "application/json; charset=utf-8",
535
+              data: JSON.stringify({
536
+                userid: del_userid
537
+              }),
538
+              success: function (data) {
539
+                $("#userDelModal").modal("hide");
540
+                if (data.code === 0) {
541
+                  window.location.href =
542
+                    "/index.html?page=" +
543
+                    Search.page +
544
+                    "&ltype=" +
545
+                    Search.ltype +
546
+                    "&schoolname=" +
547
+                    Search.schoolname;
548
+                } else {
549
+                  alert(data.msg);
550
+                }
551
+              }
552
+            });
553
+          });
554
+        }
555
+        //添加弹窗
556
+        $(".user_main .header_box .user_add_btn").click(function () {
557
+          $("#userAddModal").modal("show");
558
+        });
559
+        //获取图片地址
560
+        $("#uploadFile").on("change", function () {
561
+          let file = this.files[0]; //这是我们上传的文件
562
+          let size = file.size / 1024 / 1024;
563
+          let str = file.name.split(".");
564
+          let suffix = str[str.length - 1];
565
+          if (suffix !== "png" && suffix !== "jpg" && suffix !== "jpeg") {
566
+            alert("请上传png、jpg、jpeg类型的文件");
567
+            return false;
568
+          }
569
+          if (size > 10) {
570
+            alert("图片太大,不能超过10M!");
571
+            return false;
572
+          }
573
+          var formData = new FormData();
574
+          formData.append("file", file);
575
+          formData.append("savefolder", "schoolcase");
576
+          console.log(formData);
577
+          $.ajax({
578
+            type: "POST",
579
+            url: $.baseUrl + "file/upload",
580
+            dataType: "json",
581
+            contentType: "application/json; charset=utf-8",
582
+            data: JSON.stringify(formData),
583
+            success: function (data) {
584
+              if (data.code === 0) {
585
+                console.log(data);
586
+              } else {
587
+                alert(data.msg);
588
+              }
589
+            }
590
+          });
591
+        });
592
+
593
+        //确定添加
594
+        $("#userAddModal .add_save").on("click", function () {
595
+          // 添加表单验证
596
+          $("#UserAddForm").bootstrapValidator({
597
+            // 默认的提示消息
598
+            message: "请输入内容",
599
+            // 表单框里右侧的icon
600
+            feedbackIcons: {
601
+              valid: "glyphicon glyphicon-ok",
602
+              invalid: "glyphicon glyphicon-remove",
603
+              validating: "glyphicon glyphicon-refresh"
604
+            },
605
+            fields: {
606
+              schoolname: {
607
+                validators: {
608
+                  notEmpty: {
609
+                    message: "请输入用户姓名"
610
+                  }
611
+                }
612
+              },
613
+              loginname: {
614
+                validators: {
615
+                  notEmpty: {
616
+                    message: "请输入登录账号"
617
+                  },
618
+                  stringLength: {
619
+                    //长度限制
620
+                    min: 4,
621
+                    max: 18,
622
+                    message: "登录账号长度必须在4~18个字符之间"
623
+                  }
624
+                }
625
+              },
626
+              loginpwd: {
627
+                validators: {
628
+                  notEmpty: {
629
+                    message: "请输入登录密码"
630
+                  },
631
+                  stringLength: {
632
+                    //长度限制
633
+                    min: 6,
634
+                    max: 16,
635
+                    message: "登录密码长度必须在6~16个字符之间"
636
+                  }
637
+                }
638
+              },
639
+              userphone: {
640
+                validators: {
641
+                  // notEmpty: {
642
+                  //   message: "请输入手机号",
643
+                  // },
644
+                  regexp: {
645
+                    regexp: /^1\d{10}$/,
646
+                    message: "请输入正确的11位手机号"
647
+                  }
648
+                }
649
+              }
650
+            }
651
+          });
652
+          //先校验,在调是否通过校验的方法
653
+          $("#UserAddForm").data("bootstrapValidator").validate();
654
+          //校验表单是否通过
655
+          let flag = $("#UserAddForm").data("bootstrapValidator").isValid();
656
+          if (flag) {
657
+            let _url = $.baseUrl + "user/save";
658
+            $.ajax({
659
+              type: "POST",
660
+              url: _url,
661
+              dataType: "json",
662
+              contentType: "application/json; charset=utf-8",
663
+              data: JSON.stringify({
664
+                schoolname: $("#UserAddForm #schoolnameInput").val(),
665
+                loginname: $("#UserAddForm #loginnameInput").val(),
666
+                loginpwd: $("#UserAddForm #loginpwdInput").val(),
667
+                createid: $.userInfo.userid,
668
+                userphone: $("#UserAddForm #userphoneInput").val()
669
+              }),
670
+              success: function (data) {
671
+                if (data.code === 0) {
672
+                  window.location.href =
673
+                    "/index.html?page=1&ltype=" +
674
+                    Search.ltype +
675
+                    "&schoolname=" +
676
+                    Search.schoolname;
677
+                } else {
678
+                  alert(data.msg);
679
+                }
680
+              }
681
+            });
682
+          }
683
+        });
684
+        let modify_userid = null;
685
+        //修改
686
+        $(".userTableBody").on("click", ".modify_btn", function () {
687
+          modify_userid = $(this).data("userid");
688
+          $("#userModifyModal").modal("show");
689
+          $.each(Search.list, function (_index, _userItem) {
690
+            if (_userItem.userid === modify_userid) {
691
+              console.log("modify_userid", _userItem);
692
+              $("#userModifyForm #m_schoolnameInput").val(_userItem.schoolname);
693
+              $("#userModifyForm #m_loginnameInput").val(_userItem.loginname);
694
+              $("#userModifyForm #m_loginpwdInput").val(_userItem.loginpwd);
695
+              $("#userModifyForm #m_userphoneInput").val(_userItem.userphone);
696
+            }
697
+          });
698
+        });
699
+        //确定修改
700
+        $("#userModifyModal .modify_save").on("click", function () {
701
+          // 添加表单验证
702
+          $("#userModifyForm").bootstrapValidator({
703
+            // 默认的提示消息
704
+            message: "请输入内容",
705
+            // 表单框里右侧的icon
706
+            feedbackIcons: {
707
+              valid: "glyphicon glyphicon-ok",
708
+              invalid: "glyphicon glyphicon-remove",
709
+              validating: "glyphicon glyphicon-refresh"
710
+            },
711
+            fields: {
712
+              schoolname: {
713
+                validators: {
714
+                  notEmpty: {
715
+                    message: "请输入用户姓名"
716
+                  }
717
+                }
718
+              },
719
+              loginname: {
720
+                validators: {
721
+                  notEmpty: {
722
+                    message: "请输入登录账号"
723
+                  },
724
+                  stringLength: {
725
+                    //长度限制
726
+                    min: 4,
727
+                    max: 18,
728
+                    message: "登录账号长度必须在4~18个字符之间"
729
+                  }
730
+                }
731
+              },
732
+              loginpwd: {
733
+                validators: {
734
+                  notEmpty: {
735
+                    message: "请输入登录密码"
736
+                  },
737
+                  stringLength: {
738
+                    //长度限制
739
+                    min: 6,
740
+                    max: 16,
741
+                    message: "登录密码长度必须在6~16个字符之间"
742
+                  }
743
+                }
744
+              },
745
+              userphone: {
746
+                validators: {
747
+                  // notEmpty: {
748
+                  //   message: "请输入手机号",
749
+                  // },
750
+                  regexp: {
751
+                    regexp: /^1\d{10}$/,
752
+                    message: "请输入正确的11位手机号"
753
+                  }
754
+                }
755
+              }
756
+            }
757
+          });
758
+          //先校验,在调是否通过校验的方法
759
+          $("#userModifyForm").data("bootstrapValidator").validate();
760
+          //校验表单是否通过
761
+          let flag = $("#userModifyForm").data("bootstrapValidator").isValid();
762
+          if (flag) {
763
+            let _url = $.baseUrl + "user/update";
764
+            $.ajax({
765
+              type: "POST",
766
+              url: _url,
767
+              dataType: "json",
768
+              contentType: "application/json; charset=utf-8",
769
+              data: JSON.stringify({
770
+                schoolname: $("#userModifyForm #m_schoolnameInput").val(),
771
+                loginname: $("#userModifyForm #m_loginnameInput").val(),
772
+                loginpwd: $("#userModifyForm #m_loginpwdInput").val(),
773
+                userid: modify_userid,
774
+                userphone: $("#userModifyForm #m_userphoneInput").val()
775
+              }),
776
+              success: function (data) {
777
+                if (data.code === 0) {
778
+                  window.location.href =
779
+                    "/index.html?page=" +
780
+                    Search.page +
781
+                    "&ltype=" +
782
+                    Search.ltype +
783
+                    "&schoolname=" +
784
+                    Search.schoolname;
785
+                } else {
786
+                  alert(data.msg);
787
+                }
788
+              }
789
+            });
790
+          }
791
+        });
792
+        //切换中英文
793
+        $(".header_left").on(
794
+          "click",
795
+          'input:radio[name="user_radio"]',
796
+          function () {
797
+            window.location.href =
798
+              "/sections/school.html?page=" +
799
+              Search.page +
800
+              "&ltype=" +
801
+              $('.header_left input:radio[name="user_radio"]:checked').val() +
802
+              "&schoolname=" +
803
+              Search.schoolname;
804
+          }
805
+        );
806
+        $("#searchschoolname").val(Search.schoolname);
807
+        $("#searchschoolname").on("change", function () {
808
+          Search.schoolname = $(this).val();
809
+        });
810
+        //搜索
811
+        $(".header_left .searchBtn").click(function () {
812
+          window.location.href =
813
+            "/sections/school.html?page=" +
814
+            Search.page +
815
+            "&ltype=" +
816
+            Search.ltype +
817
+            "&schoolname=" +
818
+            Search.schoolname;
819
+        });
820
+        getUserList();
821
+      });
822
+    </script>
823
+  </body>
824
+</html>

+ 825
- 0
sections/service.html Vedi File

@@ -0,0 +1,825 @@
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/bootstrapValidator@0.5.3/bootstrapValidator.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
+      .user_main {
21
+        margin: 20px auto;
22
+        width: 1000px;
23
+      }
24
+      .user_main .header_box {
25
+        display: flex;
26
+        justify-content: space-between;
27
+        align-items: center;
28
+        margin-bottom: 10px;
29
+      }
30
+      .header_left .user_radio {
31
+        cursor: pointer;
32
+      }
33
+      .header_left #searchscname {
34
+        display: inline-block;
35
+        margin-left: 16px;
36
+        width: 240px;
37
+      }
38
+      .header_left .searchBtn {
39
+        margin-left: 16px;
40
+      }
41
+      .user_main .table.table-bordered th {
42
+        text-align: center;
43
+        background-color: #f7f7f7;
44
+      }
45
+      .user_main .table.table-bordered td {
46
+        text-align: center;
47
+        background-color: #fff;
48
+        line-height: 40px;
49
+      }
50
+      .user_main .table.table-bordered .action_btn {
51
+        margin: 0 10px;
52
+        cursor: pointer;
53
+      }
54
+      .user_main .table.table-bordered .action_show {
55
+        display: block;
56
+      }
57
+      .user_main .table.table-bordered .action_hide {
58
+        display: none;
59
+      }
60
+      .ser_img {
61
+        width: 40px;
62
+        height: 40px;
63
+        cursor: pointer;
64
+      }
65
+      .showimgurl,
66
+      .showimgurl img {
67
+        width: 100%;
68
+        height: 100%;
69
+      }
70
+      #uploadFile {
71
+        display: inline-block;
72
+        width: 100px;
73
+        height: 100px;
74
+      }
75
+    </style>
76
+  </head>
77
+  <body>
78
+    <div class="top_header_root" data-header_page="service">
79
+      <div class="header_html_root">
80
+        <div class="header_html_item" data-url="index">用户信息</div>
81
+        <div class="header_html_item" data-url="history">发展历程</div>
82
+        <div class="header_html_item" data-url="service">服务案例</div>
83
+        <div class="header_html_item" data-url="school">学校图标</div>
84
+        <div class="header_html_item" data-url="trial">申请试用</div>
85
+        <div class="header_html_item" data-url="news">新闻资讯</div>
86
+        <div class="header_html_item" data-url="log">登录日志</div>
87
+      </div>
88
+    </div>
89
+    <div class="user_main">
90
+      <div class="header_box">
91
+        <div class="header_left">
92
+          <div class="radio-inline">
93
+            <input
94
+              id="s_1"
95
+              class="user_radio"
96
+              name="user_radio"
97
+              type="radio"
98
+              value="1"
99
+            />
100
+            <label for="s_1" class="user_radio">中文</label>
101
+          </div>
102
+          <div class="radio-inline">
103
+            <input
104
+              id="s_2"
105
+              class="user_radio"
106
+              name="user_radio"
107
+              type="radio"
108
+              value="2"
109
+            />
110
+            <label for="s_2" class="user_radio">英文</label>
111
+          </div>
112
+          <input
113
+            type="text"
114
+            id="searchscname"
115
+            class="form-control"
116
+            placeholder="请输入服务名称"
117
+          />
118
+          <div type="button" class="btn btn-primary searchBtn">搜索</div>
119
+        </div>
120
+        <div type="button" class="btn btn-primary user_add_btn">添加</div>
121
+      </div>
122
+      <table class="table table-bordered">
123
+        <thead>
124
+          <tr>
125
+            <th style="width: 60px">序号</th>
126
+            <th>服务名称</th>
127
+            <th style="width: 140px">服务地址</th>
128
+            <th>创建人</th>
129
+            <th style="width: 160px">创建时间</th>
130
+            <th style="width: 140px">操作</th>
131
+          </tr>
132
+        </thead>
133
+        <tbody class="userTableBody"></tbody>
134
+      </table>
135
+      <div class="user_page page_box">
136
+        <!-- <div class="page_prev disabled">&lt;</div>
137
+        <div data-page="1" class="page_num selected">1</div>
138
+        <div class="page_num">2</div>
139
+        <div class="page_next">&gt;</div> -->
140
+      </div>
141
+    </div>
142
+    <!-- 查看图片 -->
143
+    <div
144
+      class="modal fade"
145
+      id="showImg"
146
+      tabindex="-1"
147
+      role="dialog"
148
+      aria-labelledby="imgTitle"
149
+    >
150
+      <div class="modal-dialog" role="document">
151
+        <div class="modal-content">
152
+          <div class="modal-header">
153
+            <button
154
+              type="button"
155
+              class="close"
156
+              data-dismiss="modal"
157
+              aria-label="Close"
158
+            >
159
+              <span aria-hidden="true">&times;</span>
160
+            </button>
161
+            <h4 class="modal-title" id="imgTitle">查看图片</h4>
162
+          </div>
163
+          <div class="modal-body">
164
+            <div class="showimgurl"></div>
165
+          </div>
166
+        </div>
167
+      </div>
168
+    </div>
169
+    <!-- 添加用户弹窗 -->
170
+    <div
171
+      class="modal fade"
172
+      id="userAddModal"
173
+      tabindex="-1"
174
+      role="dialog"
175
+      aria-labelledby="AddTitle"
176
+    >
177
+      <div class="modal-dialog" role="document">
178
+        <div class="modal-content">
179
+          <div class="modal-header">
180
+            <button
181
+              type="button"
182
+              class="close"
183
+              data-dismiss="modal"
184
+              aria-label="Close"
185
+            >
186
+              <span aria-hidden="true">&times;</span>
187
+            </button>
188
+            <h4 class="modal-title" id="AddTitle">添加服务案例</h4>
189
+          </div>
190
+          <div class="modal-body">
191
+            <form class="form-horizontal" id="UserAddForm">
192
+              <div class="form-group">
193
+                <label for="scnameInput" class="col-sm-2 control-label"
194
+                  >服务名称</label
195
+                >
196
+                <div class="col-sm-10">
197
+                  <input
198
+                    type="text"
199
+                    class="form-control"
200
+                    id="scnameInput"
201
+                    name="scname"
202
+                    placeholder="请输入服务名称"
203
+                  />
204
+                </div>
205
+              </div>
206
+              <div class="form-group">
207
+                <label for="loginnameInput" class="col-sm-2 control-label"
208
+                  >上传图片</label
209
+                >
210
+                <div class="col-sm-10">
211
+                  <input type="file" id="uploadFile" />
212
+                </div>
213
+              </div>
214
+            </form>
215
+          </div>
216
+          <div class="modal-footer">
217
+            <div type="button" class="btn btn-default" data-dismiss="modal">
218
+              取消
219
+            </div>
220
+            <div type="button" class="btn btn-primary add_save">确定</div>
221
+          </div>
222
+        </div>
223
+      </div>
224
+    </div>
225
+    <!-- 修改用户弹窗 -->
226
+    <div
227
+      class="modal fade"
228
+      id="userModifyModal"
229
+      tabindex="-1"
230
+      role="dialog"
231
+      aria-labelledby="modifyTitle"
232
+    >
233
+      <div class="modal-dialog" role="document">
234
+        <div class="modal-content">
235
+          <div class="modal-header">
236
+            <button
237
+              type="button"
238
+              class="close"
239
+              data-dismiss="modal"
240
+              aria-label="Close"
241
+            >
242
+              <span aria-hidden="true">&times;</span>
243
+            </button>
244
+            <h4 class="modal-title" id="modifyTitle">修改服务案例</h4>
245
+          </div>
246
+          <div class="modal-body">
247
+            <form class="form-horizontal" id="userModifyForm">
248
+              <div class="form-group">
249
+                <label for="m_scnameInput" class="col-sm-2 control-label"
250
+                  >用户姓名</label
251
+                >
252
+                <div class="col-sm-10">
253
+                  <input
254
+                    type="text"
255
+                    class="form-control"
256
+                    id="m_scnameInput"
257
+                    name="scname"
258
+                    placeholder="请输入用户姓名"
259
+                  />
260
+                </div>
261
+              </div>
262
+              <div class="form-group">
263
+                <label for="m_loginnameInput" class="col-sm-2 control-label"
264
+                  >登录账号</label
265
+                >
266
+                <div class="col-sm-10">
267
+                  <input
268
+                    type="text"
269
+                    class="form-control"
270
+                    id="m_loginnameInput"
271
+                    name="loginname"
272
+                    placeholder="请输入登录账号"
273
+                  />
274
+                </div>
275
+              </div>
276
+              <div class="form-group">
277
+                <label for="m_loginpwdInput" class="col-sm-2 control-label"
278
+                  >登录密码</label
279
+                >
280
+                <div class="col-sm-10">
281
+                  <input
282
+                    type="password"
283
+                    class="form-control"
284
+                    id="m_loginpwdInput"
285
+                    name="loginpwd"
286
+                    placeholder="请输入登录密码"
287
+                  />
288
+                </div>
289
+              </div>
290
+              <div class="form-group">
291
+                <label for="m_userphoneInput" class="col-sm-2 control-label"
292
+                  >手机号</label
293
+                >
294
+                <div class="col-sm-10">
295
+                  <input
296
+                    type="text"
297
+                    class="form-control"
298
+                    id="m_userphoneInput"
299
+                    name="userphone"
300
+                    placeholder="请输入手机号"
301
+                  />
302
+                </div>
303
+              </div>
304
+            </form>
305
+          </div>
306
+          <div class="modal-footer">
307
+            <div type="button" class="btn btn-default" data-dismiss="modal">
308
+              取消
309
+            </div>
310
+            <div type="button" class="btn btn-primary modify_save">确定</div>
311
+          </div>
312
+        </div>
313
+      </div>
314
+    </div>
315
+    <!-- 删除用户弹窗 -->
316
+    <div
317
+      class="modal fade"
318
+      id="userDelModal"
319
+      tabindex="-1"
320
+      role="dialog"
321
+      aria-labelledby="delTitle"
322
+    >
323
+      <div class="modal-dialog tip_modal" role="document">
324
+        <div class="modal-content">
325
+          <div class="modal-header">
326
+            <button
327
+              type="button"
328
+              class="close"
329
+              data-dismiss="modal"
330
+              aria-label="Close"
331
+            >
332
+              <span aria-hidden="true">&times;</span>
333
+            </button>
334
+            <h4 class="modal-title" id="delTitle">提示</h4>
335
+          </div>
336
+          <div class="modal-body">确定删除选中信息?</div>
337
+          <div class="modal-footer">
338
+            <div type="button" class="btn btn-default" data-dismiss="modal">
339
+              取消
340
+            </div>
341
+            <div type="button" class="btn btn-primary del_save">保存</div>
342
+          </div>
343
+        </div>
344
+      </div>
345
+    </div>
346
+    <script src="../librarys/jquery@1.12.4/jquery.min.js"></script>
347
+    <script src="../librarys/bootstrap@3.4.1/bootstrap.js"></script>
348
+    <script src="../librarys/bootstrapValidator@0.5.3/bootstrapValidator.js"></script>
349
+    <script src="../utils/index.js"></script>
350
+    <script>
351
+      $(function () {
352
+        let page_url = $(".top_header_root").data("header_page");
353
+        //导航跳转
354
+        $(
355
+          '.header_html_root .header_html_item[data-url="' + page_url + '"]'
356
+        ).addClass("selected");
357
+        $(".header_html_root").on("click", ".header_html_item", function () {
358
+          let _url = $(this).data("url");
359
+          if (_url === "index") {
360
+            window.location.href = "/index.html";
361
+          } else {
362
+            window.location.href = "/sections/" + _url + ".html";
363
+          }
364
+        });
365
+        //检测登录
366
+        if (!$.isLogin()) {
367
+          window.location.href = "/sections/login.html";
368
+          return;
369
+        }
370
+        let Search = {
371
+          page: Number($.getQueryletiable("page")) || 1,
372
+          size: 10,
373
+          ltype: Number($.getQueryletiable("ltype")) || 1,
374
+          scname: $.getQueryletiable("scname") || "",
375
+          total: 0,
376
+          list: []
377
+        };
378
+        //默认中英文单选框 1
379
+        $('.header_left input:radio[name="user_radio"]').each(function (
380
+          _index,
381
+          radioItem
382
+        ) {
383
+          if (Number($(radioItem).val()) === Search.ltype) {
384
+            $(radioItem).attr("checked", true);
385
+          } else {
386
+            $(radioItem).attr("checked", false);
387
+          }
388
+        });
389
+        // 获取用户列表
390
+        function getUserList() {
391
+          $.ajax({
392
+            type: "POST",
393
+            url: $.baseUrl + "sc/list",
394
+            dataType: "json",
395
+            contentType: "application/json; charset=utf-8",
396
+            data: JSON.stringify({
397
+              page: Search.page,
398
+              size: Search.size,
399
+              ltype: Search.ltype,
400
+              scname: Search.scname
401
+            }),
402
+            success: function (data) {
403
+              if (data.code === 0) {
404
+                Search.total = data.obj.total;
405
+                Search.list = data.obj.list;
406
+                console.log(Search);
407
+                setTableHtml();
408
+                setPageList();
409
+              } else {
410
+                Search.total = 0;
411
+                Search.list = [];
412
+                alert(data.msg);
413
+              }
414
+            }
415
+          });
416
+        }
417
+        // 设置页码信息
418
+        function setPageList() {
419
+          let pageBoxHtml =
420
+            '<div class="page_prev ' +
421
+            (Search.page === 1 ? "disabled" : "") +
422
+            '">&lt;</div>';
423
+          for (
424
+            let _pageIndex = 0;
425
+            _pageIndex < Math.ceil(Search.total / Search.size);
426
+            _pageIndex++
427
+          ) {
428
+            pageBoxHtml +=
429
+              '<div data-page="' +
430
+              (_pageIndex + 1) +
431
+              '" class="page_num ' +
432
+              (_pageIndex + 1 === Search.page ? "selected" : "") +
433
+              '">' +
434
+              (_pageIndex + 1) +
435
+              "</div>";
436
+          }
437
+          pageBoxHtml +=
438
+            '<div class="page_next ' +
439
+            (Search.page === Math.ceil(Search.total / Search.size)
440
+              ? "disabled"
441
+              : "") +
442
+            '">&gt;</div>';
443
+          if (Search.total > 0) {
444
+            $(".user_page.page_box").html(pageBoxHtml);
445
+            $(".user_page.page_box").on("click", ".page_prev", function () {
446
+              if (Search.page > 1) {
447
+                Search.page--;
448
+                window.location.href =
449
+                  "/index.html?page=" +
450
+                  Search.page +
451
+                  "&ltype=" +
452
+                  Search.ltype +
453
+                  "&scname=" +
454
+                  Search.scname;
455
+              }
456
+            });
457
+            $(".user_page.page_box").on("click", ".page_num", function () {
458
+              Search.page = $(this).data("page");
459
+              window.location.href =
460
+                "/index.html?page=" +
461
+                Search.page +
462
+                "&ltype=" +
463
+                Search.ltype +
464
+                "&scname=" +
465
+                Search.scname;
466
+            });
467
+            $(".user_page.page_box").on("click", ".page_next", function () {
468
+              if (Search.page < Math.ceil(Search.total / Search.size)) {
469
+                Search.page++;
470
+                window.location.href =
471
+                  "/index.html?page=" +
472
+                  Search.page +
473
+                  "&ltype=" +
474
+                  Search.ltype +
475
+                  "&scname=" +
476
+                  Search.scname;
477
+              }
478
+            });
479
+          } else {
480
+            $(".user_page.page_box").html("");
481
+          }
482
+        }
483
+        // 设置表格信息
484
+        function setTableHtml() {
485
+          let userTableBodyHtml = "";
486
+          $.each(Search.list, function (_userIndex, _userItem) {
487
+            userTableBodyHtml +=
488
+              "<tr><td>" +
489
+              (_userIndex + 1 + (Search.page - 1) * Search.size) +
490
+              "</td><td>" +
491
+              (_userItem.scname ? _userItem.scname : "") +
492
+              "</td><td><img class='ser_img' src='" +
493
+              (_userItem.scpic ? $.showImageUrl + _userItem.scpic : "") +
494
+              "' data-img='" +
495
+              (_userItem.scpic ? $.showImageUrl + _userItem.scpic : "") +
496
+              "' data-title='" +
497
+              (_userItem.scname ? _userItem.scname : "") +
498
+              "'></td><td>" +
499
+              (_userItem.createname ? _userItem.createname : "") +
500
+              "</td><td>" +
501
+              $.dateFormat(_userItem.createtime) +
502
+              '</td><td><div class="' +
503
+              (_userItem.ltype === 1 ? "action_show" : "action_hide") +
504
+              '"><span class="my_theme_color action_btn modify_btn" data-userid="' +
505
+              _userItem.userid +
506
+              '">修改</span><span class="my_theme_color">|</span><span class="del_color action_btn del_btn" data-userid="' +
507
+              _userItem.userid +
508
+              '">删除</span></div></td></tr>';
509
+          });
510
+          //点击图片放大 ser_img
511
+          $(".userTableBody").on("click", ".ser_img", function () {
512
+            let _url = $(this).data("img");
513
+            let title = $(this).data("title");
514
+            if (_url) {
515
+              $("#showImg").modal("show");
516
+              $(".showimgurl").html("<img src='" + _url + "'>");
517
+            }
518
+            if (title) {
519
+              $("#imgTitle").text(title);
520
+            }
521
+          });
522
+          $(".userTableBody").html(userTableBodyHtml);
523
+          let del_userid = null;
524
+          //删除弹窗
525
+          $(".userTableBody").on("click", ".del_btn", function () {
526
+            $("#userDelModal").modal("show");
527
+            del_userid = $(this).data("userid");
528
+          });
529
+          //确定删除
530
+          $("#userDelModal .del_save").on("click", function () {
531
+            $.ajax({
532
+              type: "POST",
533
+              url: $.baseUrl + "user/del",
534
+              dataType: "json",
535
+              contentType: "application/json; charset=utf-8",
536
+              data: JSON.stringify({
537
+                userid: del_userid
538
+              }),
539
+              success: function (data) {
540
+                $("#userDelModal").modal("hide");
541
+                if (data.code === 0) {
542
+                  window.location.href =
543
+                    "/index.html?page=" +
544
+                    Search.page +
545
+                    "&ltype=" +
546
+                    Search.ltype +
547
+                    "&scname=" +
548
+                    Search.scname;
549
+                } else {
550
+                  alert(data.msg);
551
+                }
552
+              }
553
+            });
554
+          });
555
+        }
556
+        //添加弹窗
557
+        $(".user_main .header_box .user_add_btn").click(function () {
558
+          $("#userAddModal").modal("show");
559
+        });
560
+        //获取图片地址
561
+        $("#uploadFile").on("change", function () {
562
+          let file = this.files[0]; //这是我们上传的文件
563
+          let size = file.size / 1024 / 1024;
564
+          let str = file.name.split(".");
565
+          let suffix = str[str.length - 1];
566
+          if (suffix !== "png" && suffix !== "jpg" && suffix !== "jpeg") {
567
+            alert("请上传png、jpg、jpeg类型的文件");
568
+            return false;
569
+          }
570
+          if (size > 10) {
571
+            alert("图片太大,不能超过10M!");
572
+            return false;
573
+          }
574
+          var formData = new FormData();
575
+          formData.append("file", file);
576
+          formData.append("savefolder", "servicecase");
577
+          console.log(formData);
578
+          $.ajax({
579
+            type: "POST",
580
+            url: $.baseUrl + "file/upload",
581
+            dataType: "json",
582
+            contentType: "application/json; charset=utf-8",
583
+            data: JSON.stringify(formData),
584
+            success: function (data) {
585
+              if (data.code === 0) {
586
+                console.log(data);
587
+              } else {
588
+                alert(data.msg);
589
+              }
590
+            }
591
+          });
592
+        });
593
+
594
+        //确定添加
595
+        $("#userAddModal .add_save").on("click", function () {
596
+          // 添加表单验证
597
+          $("#UserAddForm").bootstrapValidator({
598
+            // 默认的提示消息
599
+            message: "请输入内容",
600
+            // 表单框里右侧的icon
601
+            feedbackIcons: {
602
+              valid: "glyphicon glyphicon-ok",
603
+              invalid: "glyphicon glyphicon-remove",
604
+              validating: "glyphicon glyphicon-refresh"
605
+            },
606
+            fields: {
607
+              scname: {
608
+                validators: {
609
+                  notEmpty: {
610
+                    message: "请输入用户姓名"
611
+                  }
612
+                }
613
+              },
614
+              loginname: {
615
+                validators: {
616
+                  notEmpty: {
617
+                    message: "请输入登录账号"
618
+                  },
619
+                  stringLength: {
620
+                    //长度限制
621
+                    min: 4,
622
+                    max: 18,
623
+                    message: "登录账号长度必须在4~18个字符之间"
624
+                  }
625
+                }
626
+              },
627
+              loginpwd: {
628
+                validators: {
629
+                  notEmpty: {
630
+                    message: "请输入登录密码"
631
+                  },
632
+                  stringLength: {
633
+                    //长度限制
634
+                    min: 6,
635
+                    max: 16,
636
+                    message: "登录密码长度必须在6~16个字符之间"
637
+                  }
638
+                }
639
+              },
640
+              userphone: {
641
+                validators: {
642
+                  // notEmpty: {
643
+                  //   message: "请输入手机号",
644
+                  // },
645
+                  regexp: {
646
+                    regexp: /^1\d{10}$/,
647
+                    message: "请输入正确的11位手机号"
648
+                  }
649
+                }
650
+              }
651
+            }
652
+          });
653
+          //先校验,在调是否通过校验的方法
654
+          $("#UserAddForm").data("bootstrapValidator").validate();
655
+          //校验表单是否通过
656
+          let flag = $("#UserAddForm").data("bootstrapValidator").isValid();
657
+          if (flag) {
658
+            let _url = $.baseUrl + "user/save";
659
+            $.ajax({
660
+              type: "POST",
661
+              url: _url,
662
+              dataType: "json",
663
+              contentType: "application/json; charset=utf-8",
664
+              data: JSON.stringify({
665
+                scname: $("#UserAddForm #scnameInput").val(),
666
+                loginname: $("#UserAddForm #loginnameInput").val(),
667
+                loginpwd: $("#UserAddForm #loginpwdInput").val(),
668
+                createid: $.userInfo.userid,
669
+                userphone: $("#UserAddForm #userphoneInput").val()
670
+              }),
671
+              success: function (data) {
672
+                if (data.code === 0) {
673
+                  window.location.href =
674
+                    "/index.html?page=1&ltype=" +
675
+                    Search.ltype +
676
+                    "&scname=" +
677
+                    Search.scname;
678
+                } else {
679
+                  alert(data.msg);
680
+                }
681
+              }
682
+            });
683
+          }
684
+        });
685
+        let modify_userid = null;
686
+        //修改
687
+        $(".userTableBody").on("click", ".modify_btn", function () {
688
+          modify_userid = $(this).data("userid");
689
+          $("#userModifyModal").modal("show");
690
+          $.each(Search.list, function (_index, _userItem) {
691
+            if (_userItem.userid === modify_userid) {
692
+              console.log("modify_userid", _userItem);
693
+              $("#userModifyForm #m_scnameInput").val(_userItem.scname);
694
+              $("#userModifyForm #m_loginnameInput").val(_userItem.loginname);
695
+              $("#userModifyForm #m_loginpwdInput").val(_userItem.loginpwd);
696
+              $("#userModifyForm #m_userphoneInput").val(_userItem.userphone);
697
+            }
698
+          });
699
+        });
700
+        //确定修改
701
+        $("#userModifyModal .modify_save").on("click", function () {
702
+          // 添加表单验证
703
+          $("#userModifyForm").bootstrapValidator({
704
+            // 默认的提示消息
705
+            message: "请输入内容",
706
+            // 表单框里右侧的icon
707
+            feedbackIcons: {
708
+              valid: "glyphicon glyphicon-ok",
709
+              invalid: "glyphicon glyphicon-remove",
710
+              validating: "glyphicon glyphicon-refresh"
711
+            },
712
+            fields: {
713
+              scname: {
714
+                validators: {
715
+                  notEmpty: {
716
+                    message: "请输入用户姓名"
717
+                  }
718
+                }
719
+              },
720
+              loginname: {
721
+                validators: {
722
+                  notEmpty: {
723
+                    message: "请输入登录账号"
724
+                  },
725
+                  stringLength: {
726
+                    //长度限制
727
+                    min: 4,
728
+                    max: 18,
729
+                    message: "登录账号长度必须在4~18个字符之间"
730
+                  }
731
+                }
732
+              },
733
+              loginpwd: {
734
+                validators: {
735
+                  notEmpty: {
736
+                    message: "请输入登录密码"
737
+                  },
738
+                  stringLength: {
739
+                    //长度限制
740
+                    min: 6,
741
+                    max: 16,
742
+                    message: "登录密码长度必须在6~16个字符之间"
743
+                  }
744
+                }
745
+              },
746
+              userphone: {
747
+                validators: {
748
+                  // notEmpty: {
749
+                  //   message: "请输入手机号",
750
+                  // },
751
+                  regexp: {
752
+                    regexp: /^1\d{10}$/,
753
+                    message: "请输入正确的11位手机号"
754
+                  }
755
+                }
756
+              }
757
+            }
758
+          });
759
+          //先校验,在调是否通过校验的方法
760
+          $("#userModifyForm").data("bootstrapValidator").validate();
761
+          //校验表单是否通过
762
+          let flag = $("#userModifyForm").data("bootstrapValidator").isValid();
763
+          if (flag) {
764
+            let _url = $.baseUrl + "user/update";
765
+            $.ajax({
766
+              type: "POST",
767
+              url: _url,
768
+              dataType: "json",
769
+              contentType: "application/json; charset=utf-8",
770
+              data: JSON.stringify({
771
+                scname: $("#userModifyForm #m_scnameInput").val(),
772
+                loginname: $("#userModifyForm #m_loginnameInput").val(),
773
+                loginpwd: $("#userModifyForm #m_loginpwdInput").val(),
774
+                userid: modify_userid,
775
+                userphone: $("#userModifyForm #m_userphoneInput").val()
776
+              }),
777
+              success: function (data) {
778
+                if (data.code === 0) {
779
+                  window.location.href =
780
+                    "/index.html?page=" +
781
+                    Search.page +
782
+                    "&ltype=" +
783
+                    Search.ltype +
784
+                    "&scname=" +
785
+                    Search.scname;
786
+                } else {
787
+                  alert(data.msg);
788
+                }
789
+              }
790
+            });
791
+          }
792
+        });
793
+        //切换中英文
794
+        $(".header_left").on(
795
+          "click",
796
+          'input:radio[name="user_radio"]',
797
+          function () {
798
+            window.location.href =
799
+              "/sections/service.html?page=" +
800
+              Search.page +
801
+              "&ltype=" +
802
+              $('.header_left input:radio[name="user_radio"]:checked').val() +
803
+              "&scname=" +
804
+              Search.scname;
805
+          }
806
+        );
807
+        $("#searchscname").val(Search.scname);
808
+        $("#searchscname").on("change", function () {
809
+          Search.scname = $(this).val();
810
+        });
811
+        //搜索
812
+        $(".header_left .searchBtn").click(function () {
813
+          window.location.href =
814
+            "/sections/service.html?page=" +
815
+            Search.page +
816
+            "&ltype=" +
817
+            Search.ltype +
818
+            "&scname=" +
819
+            Search.scname;
820
+        });
821
+        getUserList();
822
+      });
823
+    </script>
824
+  </body>
825
+</html>

Loading…
Annulla
Salva