Commit b1afd4170f704fddbec8b196210dfff6a6967a2b

Authored by 郑超
1 parent ffc2a8e8

update

src/main/java/com/cnlive/shenhe/controller/ShyActivityController.java
1 1 package com.cnlive.shenhe.controller;
2   -//
3   -// _ooOoo_
4   -// o8888888o
5   -// 88" . "88
6   -// (| -_- |)
7   -// O\ = /O
8   -// ____/`---'\____
9   -// . ' \\| |// `.
10   -// / \\||| : |||// \
11   -// / _||||| -:- |||||- \
12   -// | | \\\ - /// | |
13   -// | \_| ''\---/'' | |
14   -// \ .-\__ `-` ___/-. /
15   -// ___`. .' /--.--\ `. . __
16   -// ."" '< `.___\_<|>_/___.' >'"".
17   -// | | : `- \`.;`\ _ /`;.`/ - ` : | |
18   -// \ \ `-. \_ __\ /__ _/ .-` / /
19   -// ======`-.____`-.___\_____/___.-`____.-'======
20   -// `=---='
21   -//
22   -// .............................................
23   -// 佛祖镇楼 BUG辟易
24   -// 佛曰:
25   -// 写字楼里写字间,写字间里程序员;
26   -// 程序人员写程序,又拿程序换酒钱。
27   -// 酒醒只在网上坐,酒醉还来网下眠;
28   -// 酒醉酒醒日复日,网上网下年复年。
29   -// 但愿老死电脑间,不愿鞠躬老板前;
30   -// 奔驰宝马贵者趣,公交自行程序员。
31   -// 别人笑我忒疯癫,我笑自己命太贱;
32   -//
33 2  
  3 +import com.alibaba.fastjson.JSON;
34 4 import com.cnlive.shenhe.bean.ErrorEnum;
35 5 import com.cnlive.shenhe.bean.ResponseBean;
36 6 import com.cnlive.shenhe.entity.ShyActivity;
... ... @@ -49,16 +19,16 @@ import java.util.List;
49 19 * @create 2022-03-08 12:37
50 20 */
51 21 @Controller
52   -@RequestMapping("/page")
  22 +@RequestMapping("/activity")
53 23 public class ShyActivityController {
54 24 @Autowired
55 25 private ShyActivityImpl shyActivityImpl;
56 26  
57 27 @PostMapping("/add")
58 28 @ResponseBody
59   - public ResponseBean insterShyActivity(ShyActivity shyActivity, Model model){
  29 + public ResponseBean insterShyActivity(ShyActivity shyActivity, Model model) {
60 30 int i = shyActivityImpl.insertShyActivity(shyActivity);
61   - if (i>0) {
  31 + if (i > 0) {
62 32 return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "当前用户添加成功");
63 33 }
64 34 return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "添加失败,请重试");
... ... @@ -66,31 +36,34 @@ public class ShyActivityController {
66 36  
67 37 @DeleteMapping("/delete/{id}")
68 38 @ResponseBody
69   - public ResponseBean deleteShyActivity(@PathVariable(value = "id") Integer id,Model model){
  39 + public ResponseBean deleteShyActivity(@PathVariable(value = "id") Integer id, Model model) {
70 40 int i = shyActivityImpl.deleteShyActivity(id);
71   - if (i>0) {
  41 + if (i > 0) {
72 42 return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "删除当前用户添加成功");
73 43 }
74 44 return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "删除失败,请重试");
75 45  
76 46 }
  47 +
77 48 @PutMapping("/update")
78 49 @ResponseBody
79   - public ResponseBean updateShyActivity(ShyActivity shyActivity,Model model){
  50 + public ResponseBean updateShyActivity(ShyActivity shyActivity, Model model) {
80 51 int i = shyActivityImpl.updateShyActivity(shyActivity);
81   - if (i>0) {
  52 + if (i > 0) {
82 53 return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "修改当前用户添加成功");
83 54 }
84 55 return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "修改失败,请重试");
85 56  
86 57 }
87 58  
88   - @GetMapping("/get/{page}/{Pagesize}")
89   - public String getShyActivity(Integer id,@PathVariable(name = "page",value = "1") Integer page,@PathVariable(name = "Pagesize",value = "10") Integer Pagesize,Model model){
90   - PageInfo<ShyActivity> shyActivityPageInfo = shyActivityImpl.selectByExample(page, Pagesize, id);
91   - List<ShyActivity> list = shyActivityPageInfo.getList();
92   - model.addAttribute("list", list);
93   - return "page/activity.html";
94   - }
  59 +// @GetMapping("/page")
  60 +// public String getShyActivity(Model model, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "1") Integer pageSize,
  61 +// Integer id) {
  62 +// System.out.println(id);
  63 +// PageInfo<ShyActivity> shyActivityPageInfo = shyActivityImpl.selectByExample(page, pageSize);
  64 +// List<ShyActivity> list = shyActivityPageInfo.getList();
  65 +// model.addAttribute("list", JSON.toJSONString(list));
  66 +// return "page/activity.html";
  67 +// }
95 68  
96 69 }
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/ShyActivityImpl.java
... ... @@ -92,10 +92,10 @@ public class ShyActivityImpl {
92 92 * @param pageSize
93 93 * @return
94 94 */
95   - public PageInfo<ShyActivity> selectByExample(Integer page, Integer pageSize,Integer id) {
  95 + public PageInfo<ShyActivity> selectByExample(Integer page, Integer pageSize) {
96 96 Example example = new Example(ShyActivity.class);
97   - Example.Criteria criteria = example.createCriteria();
98   - criteria.andEqualTo(id);
  97 +// Example.Criteria criteria = example.createCriteria();
  98 +// criteria.andEqualTo(id);
99 99 PageHelper.startPage(page, pageSize, true);
100 100 List<ShyActivity> shyActivities = ShyActivityMapper.selectByExample(example);
101 101 PageInfo<ShyActivity> shyActivityPageInfo = new PageInfo<>(shyActivities);
... ...
src/main/resources/templates/common/frame.html
... ... @@ -11,15 +11,15 @@
11 11 </a>
12 12 <!-- Header Navbar: style can be found in header.less -->
13 13 <script>
14   - $(document).ready(function(){
15   - $("#dropdown").click(function(){
16   - $("#dropdown-menu").toggle();
17   - });
18   - });
19   - $(document).bind("click",function(){
20   - $('#dropdown-menu').hide();
21   - });
22   - </script>
  14 + $(document).ready(function () {
  15 + $("#dropdown").click(function () {
  16 + $("#dropdown-menu").toggle();
  17 + });
  18 + });
  19 + $(document).bind("click", function () {
  20 + $('#dropdown-menu').hide();
  21 + });
  22 + </script>
23 23 <nav class="navbar navbar-static-top" role="navigation">
24 24 <!-- Sidebar toggle button-->
25 25 <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
... ... @@ -29,7 +29,8 @@
29 29 <ul class="nav navbar-nav">
30 30 <li class="dropdown messages-menu" style="margin: 0 auto">
31 31 <span class="label label-primary" style="height: 2em;
32   -line-height: 2em; margin: 0 auto;font-size: 2em" th:text="${session.sessionUser.company}+'('+${session.sessionUser.spid}+')'">
  32 +line-height: 2em; margin: 0 auto;font-size: 2em"
  33 + th:text="${session.sessionUser.company}+'('+${session.sessionUser.spid}+')'">
33 34 </span>
34 35 </li>
35 36 <!-- User Account: style can be found in dropdown.less -->
... ... @@ -40,19 +41,22 @@ line-height: 2em; margin: 0 auto;font-size: 2em&quot; th:text=&quot;${session.sessionUser.
40 41 </span>
41 42  
42 43 </a>
43   - <ul class="dropdown-menu" id="dropdown-menu" >
  44 + <ul class="dropdown-menu" id="dropdown-menu">
44 45 <li class="user-header">
45 46 <img th:src="@{${session.sessionUser.logo}}" class="img-circle" alt="User Image">
46 47 <p th:text="${session.sessionUser.email}">
47 48  
48 49 </p>
49 50 </li>
50   - <li class="user-footer" >
51   - <div class="pull-left" th:if="${session.sessionUser.spid==0 }">
52   - <a style="background:#3c8dbc" href="http://console.open.cnlive.com/open/console/user/info" target="black" class="btn btn-default btn-flat">账号管理</a>
  51 + <li class="user-footer">
  52 + <div class="pull-left" th:if="${session.sessionUser.spid==0 }">
  53 + <a style="background:#3c8dbc"
  54 + href="http://console.open.cnlive.com/open/console/user/info" target="black"
  55 + class="btn btn-default btn-flat">账号管理</a>
53 56 </div>
54 57 <div class="pull-right">
55   - <a style="background:#3c8dbc" href="/users/logout" class="btn btn-default btn-flat">注销</a>
  58 + <a style="background:#3c8dbc" href="/users/logout"
  59 + class="btn btn-default btn-flat">注销</a>
56 60 </div>
57 61 </li>
58 62 </ul>
... ... @@ -82,9 +86,9 @@ line-height: 2em; margin: 0 auto;font-size: 2em&quot; th:text=&quot;${session.sessionUser.
82 86 <li><a href="/topic/page?shenhe_status=0&receive=0" id="/topic/page"> 话题审核</a></li>
83 87 <li><a href="/channel/page?shenhe_status=0&receive=0" id="/channel/page"> 频道审核</a></li>
84 88 <li><a href="/liveApply/page?shenhe_state=0&receive=0" id="/liveApply/page">直播申请审核</a></li>
  89 + <li><a href="/activity/page?shenhe_state=0&receive=0" id="/activity/page"> 活动管理</a></li>
85 90 </ul>
86 91 </li>
87   -<!-- <li class="treeview" th:if="${session.sessionUser.spid==0 or session.sessionUser.master}"> -->
88 92 <li class="treeview" th:if="${session.sessionUser.spid==0 }">
89 93 <a href="#">
90 94 <span class="menu-item-top">系统管理</span>
... ...
src/main/resources/templates/page/activity.html
... ... @@ -3,65 +3,71 @@
3 3  
4 4 <head th:replace="../templates/common/head::head"></head>
5 5 <style type="text/css">
6   - .fixed-table-toolbar .bs-bars, .fixed-table-toolbar .columns, .fixed-table-toolbar .search{margin-top: 0px;}
7   - .table{margin-bottom:0;}
8   -
9   -
10   - .switch {
11   - position: relative;
12   - display: inline-block;
13   - width: 60px;
14   - height: 34px;
15   -}
16   -
17   -.switch input {display:none;}
18   -
19   -.slider {
20   - position: absolute;
21   - cursor: pointer;
22   - top: 0;
23   - left: 0;
24   - right: 0;
25   - bottom: 0;
26   - background-color: red;
27   - -webkit-transition: .4s;
28   - transition: .4s;
29   -}
30   -
31   -.slider:before {
32   - position: absolute;
33   - content: "";
34   - height: 26px;
35   - width: 26px;
36   - left: 4px;
37   - bottom: 4px;
38   - background-color: white;
39   - -webkit-transition: .4s;
40   - transition: .4s;
41   -}
42   -
43   -input:checked + .slider {
44   - background-color: #2196F3;
45   -}
46   -
47   -input:focus + .slider {
48   - box-shadow: 0 0 1px #2196F3;
49   -}
50   -
51   -input:checked + .slider:before {
52   - -webkit-transform: translateX(26px);
53   - -ms-transform: translateX(26px);
54   - transform: translateX(26px);
55   -}
56   -
57   -/* Rounded sliders */
58   -.slider.round {
59   - border-radius: 34px;
60   -}
61   -
62   -.slider.round:before {
63   - border-radius: 50%;
64   -}
  6 + .fixed-table-toolbar .bs-bars, .fixed-table-toolbar .columns, .fixed-table-toolbar .search {
  7 + margin-top: 0px;
  8 + }
  9 +
  10 + .table {
  11 + margin-bottom: 0;
  12 + }
  13 +
  14 + .switch {
  15 + position: relative;
  16 + display: inline-block;
  17 + width: 60px;
  18 + height: 34px;
  19 + }
  20 +
  21 + .switch input {
  22 + display: none;
  23 + }
  24 +
  25 + .slider {
  26 + position: absolute;
  27 + cursor: pointer;
  28 + top: 0;
  29 + left: 0;
  30 + right: 0;
  31 + bottom: 0;
  32 + background-color: red;
  33 + -webkit-transition: .4s;
  34 + transition: .4s;
  35 + }
  36 +
  37 + .slider:before {
  38 + position: absolute;
  39 + content: "";
  40 + height: 26px;
  41 + width: 26px;
  42 + left: 4px;
  43 + bottom: 4px;
  44 + background-color: white;
  45 + -webkit-transition: .4s;
  46 + transition: .4s;
  47 + }
  48 +
  49 + input:checked + .slider {
  50 + background-color: #2196F3;
  51 + }
  52 +
  53 + input:focus + .slider {
  54 + box-shadow: 0 0 1px #2196F3;
  55 + }
  56 +
  57 + input:checked + .slider:before {
  58 + -webkit-transform: translateX(26px);
  59 + -ms-transform: translateX(26px);
  60 + transform: translateX(26px);
  61 + }
  62 +
  63 + /* Rounded sliders */
  64 + .slider.round {
  65 + border-radius: 34px;
  66 + }
  67 +
  68 + .slider.round:before {
  69 + border-radius: 50%;
  70 + }
65 71  
66 72 </style>
67 73 <body class="skin-blue sidebar-mini">
... ... @@ -73,7 +79,7 @@ input:checked + .slider:before {
73 79 <div class="content-wrapper" style="min-height: 788px;">
74 80 <section class="content-header">
75 81 <h1>
76   - 活动管理
  82 + 活动管理
77 83 </h1>
78 84 <ol class="breadcrumb">
79 85 <li>首页</li>
... ... @@ -81,332 +87,12 @@ input:checked + .slider:before {
81 87 <li class="active">活动管理</li>
82 88 </ol>
83 89 </section>
84   - <section class="content">
85   - <div class="row">
86   - <div class="col-xs-12">
87   - <div class="box box-info">
88   - <div class="box-body">
89   - <div class="btn-group margin-bottom " style="padding: 0; width: 98%; float: right;">
90   - <div class="columns columns-right btn-group ">
91   - <button class="btn btn-success" onclick="javascript:add()" type="button" name="refresh" title="添加" id="email_addS">添加</button>
92   - </div>
93   - <div class="col-md-6 pull-right" style="padding: 0; width: 5%;">
94   - <button class="btn btn-default" type="button" name="refresh"
95   - title="搜索" id="emailQuery">搜索</button>
96   - </div>
97   - <div class="col-md-6 pull-right" style="padding: 0; width: 20%;">
98   - <label for="mobile" class="control-label cb-toolbar"
99   - style="font-size: 15px; top: 8px; font-weight: 100;">邮件地址:</label>
100   - <div class="col-sm-7" style="padding: 0;">
101   - <input class="form-control" type="text" th:value="${param.email}" id="email_query">
102   - </div>
103   - </div>
104   - <div class="col-md-5 pull-right" style="padding: 0; width: 15%;">
105   - <label for="sp_id" class="control-label cb-toolbar"
106   - style="font-size: 15px; top: 8px; font-weight: 100;">邮件人:</label>
107   - <div class="col-sm-7" style="padding: 0;">
108   - <input class="form-control" type="text" th:value="${param.remark}" id="remark_query">
109   - </div>
110   - </div>
111   - </div>
112   -
113   -
114   -
115   - <div class="fixed-table-container" style="padding-bottom: 0px;">
116   - <div class="fixed-table-body">
117   - <table data-toggle="table" data-pagination="true" data-search="false" data-show-refresh="true"
118   - data-show-toggle="true" data-show-columns="true" data-toolbar="#toolbar" class="table table-hover">
119   - <thead>
120   - <tr>
121   - <th style="text-align: center; width: 5%;" data-field="sp_id" tabindex="0">
122   - <div class="th-inner ">活动ID</div>
123   - <div class="fht-cell"></div>
124   - </th>
125   - <th style="text-align: center; width: 12%;" data-field="sp_id_brief" tabindex="0">
126   - <div class="th-inner ">活动名称</div>
127   - <div class="fht-cell"></div>
128   - </th>
129   -<!-- <th style="text-align: center; width: 8%;" data-field="type" tabindex="0">-->
130   -<!-- <div class="th-inner ">邮件人</div>-->
131   -<!-- <div class="fht-cell"></div>-->
132   -<!-- </th>-->
133   -<!-- <th style="text-align: center; width: 12%;" data-field="type" tabindex="0">-->
134   -<!-- <div class="th-inner ">通知类型</div>-->
135   -<!-- <div class="fht-cell"></div>-->
136   -<!-- </th>-->
137   -<!-- <th style="text-align: center; width: 6%;" data-field="type" tabindex="0">-->
138   -<!-- <div class="th-inner ">使用状态</div>-->
139   -<!-- <div class="fht-cell"></div>-->
140   -<!-- </th>-->
141   -<!-- <th style="text-align: center; width: 8%;" data-field="type" tabindex="0">-->
142   -<!-- <div class="th-inner ">修改人</div>-->
143   -<!-- <div class="fht-cell"></div>-->
144   -<!-- </th>-->
145   - <th style="text-align: center; width: 12%;" data-field="upload_time" tabindex="0">
146   - <div class="th-inner ">创建时间</div>
147   - <div class="fht-cell"></div>
148   - </th>
149   - <th style="text-align: center; width: 12%;" data-field="updated_at" tabindex="0">
150   - <div class="th-inner ">更新时间</div>
151   - <div class="fht-cell"></div>
152   - </th>
153   - <th style="text-align: center; width: 10%;" data-field="action" tabindex="0">
154   - <div class="th-inner ">操作</div>
155   - <div class="fht-cell"></div>
156   - </th>
157   - </tr>
158   - </thead>
159   - <tbody>
160   - <tr th:data-index="${emailStat.index}" th:each="ls:${list}">
161   - <td style="text-align: center; width: 5%;" th:text="${ls.id}">82</td>
162   - <td style="text-align: center; width: 12%;" th:text="${ls.activity}">视讯中国</td>
163   - <td style="text-align: center; width: 12%;" th:text="${#dates.format(ls.createTime, 'yyyy-MM-dd HH:mm:ss')}">2018-11-22
164   - 23:08:48</td>
165   - <td style="text-align: center; width: 12%;" th:text="${#dates.format(ls.updateTime, 'yyyy-MM-dd HH:mm:ss')}">2016-08-03
166   - 14:27:17</td>
167   - <td style="text-align: center; width: 10%;">
168   - <span>&nbsp;</span>
169   - <a class="edit" th:href="'javascript:edit('+${ls.id}+',\''+${ls.activity}'">
170   - <button class="btn btn-primary btn-xs">修改</button>
171   - </a><span> </span><span>&nbsp;</span>
172   - <span>&nbsp;</span>
173   - <a class="delete" th:href="'javascript:deleted('+${ls.id}+')'">
174   - <button class="btn btn-danger btn-xs">删除</button>
175   - </a><span> </span><span>&nbsp;</span></td>
176   - </tr>
177   -
178   - </tbody>
179   - </table>
180   - </div>
181   -
182   - <div class="fixed-table-pagination" style="display: block;">
183   - <div class="pull-left pagination-detail">
184   - <span class="pagination-info"
185   - th:text="'共 '+${ls.total}+' 条记录,每页显示'">共 0 条记录</span>
186   - <select class="" id="pageSize" name="pageSize"
187   - onchange="selectPageSize()">
188   - <option value="10" th:selected="${pageSize==10}">10</option>
189   - <option value="20" th:selected="${pageSize==20}">20</option>
190   - <option value="50" th:selected="${pageSize==50}">50</option>
191   - <option value="100" th:selected="${pageSize==100}">100</option>
192   - </select> <span class="pagination-info">条记录</span>
193   - </div>
194   - <div class="pull-right pagination">
195   - <ul class="pagination" th:if="${emailPage.pages>1}">
196   - <li class="page-pre"><a
197   - th:href="'javascript:fanye(1);'">‹‹</a></li>
198   - <li class="page-pre" th:if="${!emailPage.isFirstPage}"><a
199   - th:onclick="'javascript:fanye(\''+${emailPage.pageNum-1}+'\');'">‹</a>
200   - </li>
  90 + <div>
  91 + <td style="text-align: center; width: 6%;"
  92 + th:text="${list}"></td>
  93 + </div>
201 94  
202   - <li class="page-number" th:if="${emailPage.pageNum-3>=1}"><a
203   - th:onclick="'javascript:fanye(\''+${emailPage.pageNum-3}+'\');'"
204   - th:text="${emailPage.pageNum-3}">2</a></li>
205   - <li class="page-number" th:if="${emailPage.pageNum-2>=1}"><a
206   - th:onclick="'javascript:fanye(\''+${emailPage.pageNum-2}+'\');'"
207   - th:text="${emailPage.pageNum-2}">2</a></li>
208   - <li class="page-number" th:if="${emailPage.pageNum-1>=1}"><a
209   - th:onclick="'javascript:fanye(\''+${emailPage.pageNum-1}+'\');'"
210   - th:text="${emailPage.pageNum-1}">2</a></li>
211   - <li class="page-number active"><a
212   - href="javaScript:void(0);" th:text="${emailPage.pageNum}">2</a></li>
213   - <li class="page-number"
214   - th:if="${emailPage.pageNum+1<=emailPage.pages}"><a
215   - th:onclick="'javascript:fanye(\''+${emailPage.pageNum+1}+'\');'"
216   - th:text="${emailPage.pageNum+1}">2</a></li>
217   - <li class="page-number"
218   - th:if="${emailPage.pageNum+2<=emailPage.pages}"><a
219   - th:onclick="'javascript:fanye(\''+${emailPage.pageNum+2}+'\');'"
220   - th:text="${emailPage.pageNum+2}">2</a></li>
221   - <li class="page-number"
222   - th:if="${emailPage.pageNum+3<=emailPage.pages}"><a
223   - th:onclick="'javascript:fanye(\''+${emailPage.pageNum+3}+'\');'"
224   - th:text="${emailPage.pageNum+3}">2</a></li>
225   -
226   - <li class="page-next" th:if="${!emailPage.isLastPage}"><a
227   - th:onclick="'javascript:fanye(\''+${emailPage.pageNum+1}+'\');'">›</a>
228   - </li>
229   - <li class="page-next"><a
230   - th:onclick="'javascript:fanye(\''+${emailPage.pages}+'\');'">››</a>
231   - </li>
232   - </ul>
233   - </div>
234   - </div>
235   - </div>
236   - </div>
237   - <div class="clearfix"></div>
238   - </div>
239   - </div>
240   - </div>
241   - </section>
242 95 </div>
243   -
244   -<!-- 模态框(Modal) -->
245   -<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
246   - <div class="modal-dialog">
247   - <div class="modal-content" style="margin-top: 30%;">
248   - <div class="modal-header">
249   - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
250   - <h4 class="modal-title" id="myModalLabel">编辑邮件消息</h4>
251   - </div>
252   - <div class="modal-body">
253   - <form action="/page/add" method="post" id="editWrite">
254   - <input type="text" name="redirect_url" value="" class="hide" id="redirect_url"/>
255   - <div class="form-group hide">
256   - <label class="control-label col-sm-3" style="font-size: 15px;" >Id:</label>
257   - <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;">
258   - <input class="form-control" style="width:30%;" type="text" value="" id="id" name="id">
259   - </div>
260   - </div>
261   - <div class="form-group">
262   - <label class="control-label col-sm-3" style="font-size: 15px;">活动名称:</label>
263   - <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;">
264   - <input class="form-control" style="width:40%;" type="text" value="" id="email_edit" name="activity">
265   - </div>
266   - </div>
267   -
268   -
269   - </form>
270   - </div>
271   - <div class="modal-footer">
272   - <button type="button" class="btn btn-primary" onclick="javascript:$('#editWrite').submit();">提交</button>
273   - <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
274   - </div>
275   - </div><!-- /.modal-content -->
276   - </div><!-- /.modal-dialog -->
277   -</div>
278   -<!-- /.modal -->
279   - <script>
280   - //打开编辑窗口
281   - function edit(Id,email,remark,write_business){
282   - $("#myModalLabel").text("编辑活动名称");
283   - $("#id").val(Id);
284   - $("#email_edit").val(email);
285   - $("#email_edit").attr("readonly","true");
286   - $("#remark_edit").val(remark);
287   - $("#redirect_url").val(location.pathname+location.search);
288   - $(".write_check input").prop("checked",false);
289   - if($.trim(write_business)!=''){
290   - var array = write_business.split(",")
291   - for (var i=0;i<array.length;i++){
292   - $("#write_check_"+array[i]).prop("checked",true);
293   - }
294   - }
295   - $('#editModal').modal('show');
296   - }
297   -
298   - //打开添加窗口
299   - function add(){
300   - $("#id").val("");
301   - $("#email_edit").val("");
302   - $("#email_edit").removeAttr("readonly");
303   - $("#remark_edit").val("");
304   - $(".write_check input").prop("checked",false);
305   -
306   - $("#redirect_url").val(location.pathname+location.search);
307   - $("#myModalLabel").text("添加活动名称");
308   - $('#editModal').modal('show');
309   - }
310   -
311   - //删除操作
312   - function deleted(id){
313   - var r = confirm("您确定删除本条内容吗?");
314   - if (r == true) {
315   - $.post("/page/deleted?id=" + id, function (data) {
316   - if (data.errorCode == 0) {
317   - alert(data.errorMessage);
318   - location.href = location.href;
319   - } else {
320   - alert(data.errorMessage);
321   - }
322   - })
323   - }
324   - }
325   -
326   -
327   - //开关的点击事件
328   - $(".slider").on('click',function(e){
329   - var myId=$(this).prop("id");
330   - // var myIndex = $(".slider").index($(this));
331   - var checked=$("#id"+myId).prop("checked");//获取当前状态,下一个状态用!checked表示
332   - $.post("/email/updateState?id=" + myId+"&isEnable="+!checked, function (data) {
333   - if (data.errorCode == 0) {
334   - alert(data.errorMessage);
335   - location.href = location.href;
336   - } else {
337   - alert(data.errorMessage);
338   - location.href = location.href;
339   - }
340   - })
341   - })
342   -
343   - //翻页函数
344   - function fanye(page) {
345   - var param = location.search;
346   - if (param.indexOf("page=") != -1) {
347   - var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
348   - var split = se.split("&");
349   - var h = "";
350   - for (var i = 0; i < split.length; i++) {
351   - var s = split[i];
352   - if (s.indexOf("page=") < 0) h = h + "&" + split[i];
353   - }
354   - h = h.substring(1, h.length);
355   - window.location.href = "/email/page?" + h + "&page=" + page;
356   - } else {
357   - param = param.substring(1, param.length);
358   - window.location.href = "/email/page?" + param + "&page=" + page;
359   - }
360   - }
361   -
362   - //选择每页数量触发函数
363   - function selectPageSize(){
364   - var pageSize=$("#pageSize").val();
365   - var param = location.search;
366   - if (param.indexOf("pageSize=") != -1) {
367   - var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
368   - var split = se.split("&");
369   - var h = "";
370   - for (var i = 0; i < split.length; i++) {
371   - var s = split[i];
372   - if (s.indexOf("pageSize=") < 0 &&s.indexOf("page=") < 0) h = h + "&" + split[i];
373   - }
374   - h = h.substring(1, h.length);
375   - window.location.href = "/email/page?" + h + "&pageSize=" + pageSize;
376   - } else {
377   - var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
378   - var split = se.split("&");
379   - var h = "";
380   - for (var i = 0; i < split.length; i++) {
381   - var s = split[i];
382   - if (s.indexOf("page=") < 0) h = h + "&" + split[i];
383   - }
384   - h = h.substring(1, h.length);
385   - window.location.href = "/email/page?" + h + "&pageSize=" + pageSize;
386   - }
387   - }
388   -
389   - //搜索
390   - $('#emailQuery').click(function () {
391   - var email = $("#email_query").val();
392   - var remark = $("#remark_query").val();
393   - var pageSize = $("#pageSize").val();
394   - window.location.href = "/email/page?email=" + email + "&remark=" + remark+ "&pageSize=" + pageSize;
395   - });
396   -
397   - //鼠标回车事件
398   - $(document).keyup(function(event){
399   - if(event.keyCode ==13){
400   - $("#emailQuery").trigger("click");
401   - }
402   - });
403   - </script>
404   -
405   - <footer th:replace="../templates/common/foot::foot" ></footer>
406   -
407   -
408   - <!-- Add the sidebar's background. This div must be placed
409   - immediately after the control sidebar -->
410 96 <div class="control-sidebar-bg" style="position: fixed; height: auto;"></div>
411 97  
412 98 </div><!-- ./wrapper -->
... ...