Commit ab78fc0fcec69f238dd99a9e09ec99487a8c24b4

Authored by liwei2917
1 parent 9195d3f6

审核云用户管理增加提醒通知的设置

审核云管理模块增加键盘回车事件
src/main/java/com/cnlive/shenhe/controller/UsersController.java
... ... @@ -23,8 +23,11 @@ import org.springframework.web.bind.annotation.PostMapping;
23 23 import org.springframework.web.bind.annotation.RequestMapping;
24 24 import org.springframework.web.bind.annotation.ResponseBody;
25 25  
  26 +import java.util.HashMap;
26 27 import java.util.List;
  28 +import java.util.Map;
27 29  
  30 +import javax.print.attribute.HashAttributeSet;
28 31 import javax.servlet.http.HttpServletRequest;
29 32 import javax.servlet.http.HttpSession;
30 33  
... ... @@ -97,6 +100,7 @@ public class UsersController {
97 100 if (CommonUtils.isNull(pageSize)) pageSize = 10;
98 101 PageInfo<ShyUsers> usersPage = usersService.getPage(page, pageSize, orderByClause, username,mobile,sp_id,company_brief);
99 102 List<ShyUsers> list = usersPage.getList();
  103 + JSONObject notice = CommonConst.NOTICE;
100 104 if (!list.isEmpty()) {
101 105 for (ShyUsers users : list) {
102 106 //显示spid简称
... ... @@ -108,7 +112,60 @@ public class UsersController {
108 112 }
109 113 model.addAttribute("usersPage", usersPage);
110 114 model.addAttribute("pageSize", pageSize);
  115 + model.addAttribute("notice", notice);
111 116 return "page/users.html";
112 117 }
113 118  
  119 + /**
  120 + * 获取通知是否显示
  121 + * @param showType
  122 + * @param session
  123 + * @return
  124 + */
  125 + @PostMapping(value = "/getNoticeShow")
  126 + @ResponseBody
  127 + public Map<String,Object> getNoticeShow( HttpSession session) {
  128 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  129 + ShyUsers shyUser = new ShyUsers();
  130 + shyUser.setUser_id(sessionUser.getUserId());
  131 + shyUser =usersService.select(shyUser);
  132 + boolean isShow_chinnal=false;//是否显示频道消息框
  133 + boolean isShow_liveApply=false;//是否显示直播申请消息框
  134 + if(shyUser.getNotice_show().contains("1")){
  135 + isShow_chinnal=true;
  136 + }
  137 + if(shyUser.getNotice_show().contains("2")){
  138 + isShow_liveApply=true;
  139 + }
  140 + Map<String,Object> map=new HashMap<>();
  141 + map.put("isShow_chinnal", isShow_chinnal);
  142 + map.put("isShow_liveApply", isShow_liveApply);
  143 + return map;
  144 + }
  145 +
  146 +
  147 + @PostMapping(value = "/write")
  148 + public String write(Integer userId, String[] write_notice, HttpSession session, String redirect_url) {
  149 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  150 + Integer spid = sessionUser.getSpid();
  151 + if (spid != 0) {
  152 + return "page/error.html";
  153 + }
  154 + ShyUsers user = usersService.get(userId);
  155 + String write = "";
  156 + if (CommonUtils.isNotNull(write_notice) && write_notice.length > 0) {
  157 + for (String w : write_notice) {
  158 + write = write + "," + w;
  159 + }
  160 + write = write.substring(1);
  161 + }
  162 + user.setNotice_show(write);
  163 + boolean success = usersService.update(user);
  164 + if (success) {
  165 + return "redirect:" + redirect_url;
  166 + } else {
  167 + return "error.html";
  168 + }
  169 + }
  170 +
114 171 }
... ...
src/main/java/com/cnlive/shenhe/entity/ShyUsers.java
... ... @@ -53,6 +53,11 @@ public class ShyUsers {
53 53 */
54 54 private Boolean state;
55 55  
  56 + /**
  57 + * 通知显示 1:频道 2:直播申请
  58 + */
  59 + private String notice_show;
  60 +
56 61 private Date created_at;
57 62  
58 63 private Date updated_at;
... ... @@ -244,6 +249,24 @@ public class ShyUsers {
244 249 }
245 250  
246 251 /**
  252 + * 获取通知显示 1:频道 2:直播申请
  253 + *
  254 + * @return notice_show - 通知显示 1:频道 2:直播申请
  255 + */
  256 + public String getNotice_show() {
  257 + return notice_show;
  258 + }
  259 +
  260 + /**
  261 + * 设置通知显示 1:频道 2:直播申请
  262 + *
  263 + * @param notice_show 通知显示 1:频道 2:直播申请
  264 + */
  265 + public void setNotice_show(String notice_show) {
  266 + this.notice_show = notice_show;
  267 + }
  268 +
  269 + /**
247 270 * @return created_at
248 271 */
249 272 public Date getCreated_at() {
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/UsersServiceImpl.java
1 1 package com.cnlive.shenhe.serviceImpl;
2 2  
  3 +import com.cnlive.shenhe.entity.ShySites;
3 4 import com.cnlive.shenhe.entity.ShyUsers;
4 5 import com.cnlive.shenhe.mapper.ShyUsersMapper;
5 6 import com.cnlive.shenhe.utils.CommonUtils;
... ... @@ -56,4 +57,8 @@ public class UsersServiceImpl {
56 57 public ShyUsers select(ShyUsers shyUsers) {
57 58 return shyUsersMapper.selectOne(shyUsers);
58 59 }
  60 +
  61 + public boolean update(ShyUsers shyUsers) {
  62 + return shyUsersMapper.updateByPrimaryKeySelective(shyUsers) == 1;
  63 + }
59 64 }
... ...
src/main/java/com/cnlive/shenhe/utils/CommonConst.java
... ... @@ -83,8 +83,10 @@ public class CommonConst {
83 83 */
84 84 public static Integer BUSINESS_CHANNEL = 4;
85 85  
86   -
  86 + //白名单设置
87 87 public static JSONObject BUSINESS = JSONObject.parseObject("{\"1\":\"点播业务\",\"2\":\"评论业务\",\"3\":\"图文业务\",\"4\":\"频道业务\"}");
  88 + //通知消息设置
  89 + public static JSONObject NOTICE = JSONObject.parseObject("{\"1\":\"频道通知\",\"2\":\"直播申请通知\"}");
88 90  
89 91 /**
90 92 * 抽帧状态:未抽帧
... ...
src/main/resources/mapper/ShyUsersMapper.xml
... ... @@ -15,6 +15,7 @@
15 15 <result column="company_brief" jdbcType="VARCHAR" property="company_brief" />
16 16 <result column="company_name" jdbcType="VARCHAR" property="company_name" />
17 17 <result column="state" jdbcType="BIT" property="state" />
  18 + <result column="notice_show" jdbcType="VARCHAR" property="notice_show" />
18 19 <result column="created_at" jdbcType="TIMESTAMP" property="created_at" />
19 20 <result column="updated_at" jdbcType="TIMESTAMP" property="updated_at" />
20 21 <result column="tm" jdbcType="BIGINT" property="tm" />
... ...
src/main/resources/static/js/notice.js 0 → 100644
  1 + var x0=0,y0=0,x1=0,y1=0;
  2 +// var offx=6,offy=6;
  3 + var moveable=false;//鼠标是否是按下状态
  4 +// var hover='orange',normal='slategray';//color;
  5 + var hover='slategray',normal='slategray';//color;
  6 + var index=10000;//z-index;
  7 +
  8 + //创建一个对象;
  9 + function xWin(id,tit,msg,url){
  10 +  index = index+2;
  11 + if(id==1){
  12 + isShow_chinnal=false;
  13 + }else if(id==2){
  14 + isShow_liveApply=false;
  15 + }
  16 +  this.id      = id;
  17 +  this.width   = 300;//主窗体宽度
  18 +  this.height  = 200;//主窗体高度
  19 +  this.right   = 0;//位置距右
  20 +  this.bottom  = 0;//位置距下
  21 +  this.zIndex  = index;
  22 +  this.title   = tit;//标题
  23 +  this.message = msg;//消息体
  24 +  this.url = url;//url
  25 +  this.obj     = null;
  26 +  this.bulid   = bulid;
  27 +  this.bulid();
  28 + }
  29 + //初始化;
  30 + function bulid(){
  31 +  var str = ""
  32 +   + "<div id=xMsg" + this.id + " "
  33 +   + "style='"
  34 +   + "z-index:" + this.zIndex + ";"
  35 +   + "width:" + this.width + "px;"
  36 +   + "height:" + this.height + "px;"
  37 +   + "right:" + this.right + ";"
  38 +   + "bottom:" + this.bottom + ";"
  39 +   + "background-color:white;"
  40 +   + "color:" + normal + ";"
  41 +   + "font-size:18px;"
  42 +   + "font-family:Verdana;"
  43 +   + "position:fixed;"
  44 +   + "cursor:default;"
  45 +   + "-webkit-user-select:none;"
  46 +   + "-moz-user-select:none;"
  47 +   + "-ms-user-select:none;"
  48 +   + "user-select:none;"
  49 +   + "border:2px solid " + normal + ";"
  50 +   + "' "
  51 +   + "οnmοusedοwn='getFocus(this)'"
  52 + +">"
  53 +// 标题开始
  54 +    + "<div "
  55 +    + "style='"
  56 +    + "background-color:" + normal + ";"
  57 +    + "width:" + (this.width-2*2) + "px;"
  58 +    + "height:28px;"
  59 +    + "color:white;"
  60 +    + "' "
  61 +    + "onmousedown='startDrag(this)' "
  62 +    + "onmouseup='stopDrag(this)' "
  63 +    + "onmousemove='drag(this)' "
  64 +    + "ondblclick='min(this.childNodes[1])'"
  65 +    + ">"
  66 +     + "<span style='width:" + (this.width-2*25-4) + "px;padding-left:3px; display:-moz-inline-box; display:inline-block;'>" + this.title + "</span>"
  67 +     + "<span style='width:25px;border-width:0px;color:white;font-family:webdings;display:-moz-inline-box; display:inline-block;' onclick='min(this)'>0</span>"
  68 +     + "<span style='width:25px;border-width:0px;color:white;font-family:webdings;display:-moz-inline-box; display:inline-block;' onclick='cls(this," + this.id + ")'>r</span>"
  69 +    + "</div>"
  70 +//     主窗体开始
  71 + + "<div style='"
  72 +     + "width:100%;"
  73 +     + "height:" + (this.height-28-4) + "px;"
  74 +     + "min-height:" + (this.height-28-4) + "px;"
  75 +     + "background-color:white;"
  76 +     + "word-break:break-all;"
  77 +     + "padding:3px;"
  78 +     + "'>"
  79 +// 主窗体的内容部分
  80 + + "<div style='"
  81 +     + "width:100%;"
  82 +     + "height:" + (this.height-28-4-50) + "px;"
  83 +     + "min-height:" + (this.height-28-4-50) + "px;"
  84 +     + "line-height:20px;"
  85 +     + "text-align: center;"
  86 +     + "word-break:break-all;"
  87 +     + "padding:3px;"
  88 +     + "padding-top: 40px;"
  89 + + "color:red;"
  90 +     + "'>"
  91 + + this.message
  92 + + "</div>"
  93 +// 主窗体的按钮部分(按钮1)
  94 + + "<div style='"
  95 +    + "width:60px;"
  96 +    + "height:30px;"
  97 +    + "color: #fff;"
  98 +    + "line-height: 30px;"
  99 +    + "text-align: center;"
  100 +    + "font-size: 15px;"
  101 +    + "float:left;"
  102 +    + "margin-left: 120px;"
  103 +   + "background-color:" + normal + ";"
  104 +   + "'"
  105 + +" type='button'"
  106 + +" onclick='cls(this," + this.id + ")'"
  107 + +">确定</div>"
  108 +// 主窗体的按钮部分(按钮2)
  109 + + "<div style='"
  110 +    + "width:60px;"
  111 +    + "height:30px;"
  112 +    + "color: #fff;"
  113 +    + "line-height: 30px;"
  114 +    + "text-align: center;"
  115 +    + "font-size: 15px;"
  116 +    + "float:right;"
  117 +    + "margin-right:20px;"
  118 +   + "background-color:" + normal + ";"
  119 +   + "'"
  120 + +" type='button'"
  121 + +" onclick=\"toLink('"+this.url+"'," + this.id + ")\""
  122 + +">查看</div>"
  123 + + "</div>"
  124 +   
  125 +  
  126 + + "</div>";
  127 +  document.body.insertAdjacentHTML("beforeEnd",str);
  128 + }
  129 +
  130 + //开始拖动;
  131 + function startDrag(obj){
  132 +  if(event.button==0){
  133 +   //锁定标题栏;
  134 +//   obj.setCapture();
  135 +   //定义对象;
  136 +   var win = obj.parentNode;
  137 +//   var sha = win.nextSibling;
  138 +   //记录鼠标和层位置;
  139 +   x0 = event.clientX;
  140 +   y0 = event.clientY;
  141 +   x1 = parseInt(win.style.right.replace("px",""));
  142 +   y1 = parseInt(win.style.bottom.replace("px",""));
  143 +   //记录颜色;
  144 +   normal = obj.style.backgroundColor;
  145 +   //改变风格;
  146 +   obj.style.backgroundColor = hover;
  147 +   win.style.borderColor = hover;
  148 +   obj.nextSibling.style.color = hover;
  149 +//   sha.style.right = (x1 - offx)+"px";
  150 +//   sha.style.bottom  = (y1 - offy)+"px";
  151 +   moveable = true;
  152 +  }
  153 + }
  154 + //拖动;
  155 + function drag(obj){
  156 +  if(moveable){
  157 +   var win = obj.parentNode;
  158 +//   var sha = win.nextSibling;
  159 +   win.style.right = ( x1+x0-event.clientX)+"px";
  160 +   win.style.bottom  = ( y1+y0-event.clientY)+"px";
  161 +//   sha.style.right = (parseInt(win.style.right.replace("px","")) - offx)+"px";
  162 +//   sha.style.bottom  = (parseInt(win.style.bottom.replace("px","")) - offy)+"px";
  163 +  }
  164 + }
  165 + //停止拖动;
  166 + function stopDrag(obj){
  167 +  if(moveable){
  168 +   var win = obj.parentNode;
  169 +//   var sha = win.nextSibling;
  170 +   var msg = obj.nextSibling;
  171 +   win.style.borderColor     = normal;
  172 +   obj.style.backgroundColor = normal;
  173 +   msg.style.color           = normal;
  174 +//   sha.style.right = obj.parentNode.style.right;
  175 +//   sha.style.bottom  = obj.parentNode.style.bottom;
  176 +//   obj.releaseCapture();
  177 +   moveable = false;
  178 +  }
  179 + }
  180 + //获得焦点;
  181 + function getFocus(obj)
  182 + {
  183 +  if(obj.style.zIndex!=index)
  184 +  {
  185 +   index = index + 2;
  186 +   var idx = index;
  187 +   obj.style.zIndex=idx;
  188 +   obj.nextSibling.style.zIndex=idx-1;
  189 +  }
  190 + }
  191 + //最小化;
  192 + function min(obj){
  193 +  var win = obj.parentNode.parentNode;
  194 +//  var sha = win.nextSibling;
  195 +  var tit = obj.parentNode;
  196 +  var msg = tit.nextSibling;
  197 +  var flg = msg.style.display=="none";
  198 +  if(flg)
  199 +  {
  200 +   win.style.height  = (parseInt(msg.style.height.replace("px","")) + parseInt(tit.style.height.replace("px","")) + 2*2)+"px";
  201 +//   sha.style.height  = win.style.height;
  202 +   msg.style.display = "block";
  203 +   obj.innerHTML = "0";
  204 +  }
  205 +  else
  206 +  {
  207 +   win.style.height  = (parseInt(tit.style.height.replace("px","")) + 2*2)+"px";
  208 +//   sha.style.height  = win.style.height;
  209 +   obj.innerHTML = "2";
  210 +   msg.style.display = "none";
  211 +  }
  212 + }
  213 + //关闭;
  214 + function cls(obj,id){
  215 +  var win = obj.parentNode.parentNode;
  216 +//  var sha = win.nextSibling;
  217 +  win.style.visibility = "hidden";
  218 +//  sha.style.visibility = "hidden";
  219 + if(id==1){
  220 + isShow_chinnal=true;
  221 + }else if(id==2){
  222 + isShow_liveApply=true;
  223 + }
  224 + }
  225 + //点击查看跳转链接
  226 + function toLink(url,id){
  227 + if(id==1){
  228 + isShow_chinnal=true;
  229 + }else if(id==2){
  230 + isShow_liveApply=true;
  231 + } window.location.href= url;
  232 +// window.location.href= window.location.protocol+"//"+window.location.host+"/channel/page?shenhe_status=0&receive=0";
  233 + }
0 234 \ No newline at end of file
... ...
src/main/resources/templates/common/frame.html
... ... @@ -48,7 +48,7 @@ line-height: 2em; margin: 0 auto;font-size: 2em&quot; th:text=&quot;${session.sessionUser.
48 48 </p>
49 49 </li>
50 50 <li class="user-footer" >
51   - <div class="pull-left" th:if="${session.sessionUser.spid==0 or session.sessionUser.master}">
  51 + <div class="pull-left" th:if="${session.sessionUser.spid==0 }">
52 52 <a style="background:#3c8dbc" href="http://console.open.cnlive.com/open/console/user/info" target="black" class="btn btn-default btn-flat">账号管理</a>
53 53 </div>
54 54 <div class="pull-right">
... ...
src/main/resources/templates/common/head.html
... ... @@ -89,256 +89,45 @@
89 89 <!-- <script type="text/javascript" src="http://resweb.cnliveimg.com/system/dialog/zDrag.js"></script> -->
90 90 <!-- <script type="text/javascript" src="http://resweb.cnliveimg.com/system/dialog/zDialog.js"></script> -->
91 91 <!-- <link href="../../static/css/dialog.css" rel="stylesheet"> -->
92   -<!-- <link href="../../static/js/JetDialog.js" rel="stylesheet"> -->
93   -
94   - <script language=javascript>
95   -
96   - var x0=0,y0=0,x1=0,y1=0;
97   -// var offx=6,offy=6;
98   - var moveable=false;//鼠标是否是按下状态
99   -// var hover='orange',normal='slategray';//color;
100   - var hover='slategray',normal='slategray';//color;
101   - var index=10000;//z-index;
102   - var isShow=true;//是否显示消息框
103   -
104   - //创建一个对象;
105   - function xWin(id,tit,msg,url)
106   - {
107   -  index = index+2;
108   - isShow=false;
109   -  this.id      = id;
110   -  this.width   = 300;//主窗体宽度
111   -  this.height  = 200;//主窗体高度
112   -  this.right   = 0;//位置距右
113   -  this.bottom  = 0;//位置距下
114   -  this.zIndex  = index;
115   -  this.title   = tit;//标题
116   -  this.message = msg;//消息体
117   -  this.url = url;//url
118   -  this.obj     = null;
119   -  this.bulid   = bulid;
120   -  this.bulid();
121   - }
122   - //初始化;
123   - function bulid(){
124   -  var str = ""
125   -   + "<div id=xMsg" + this.id + " "
126   -   + "style='"
127   -   + "z-index:" + this.zIndex + ";"
128   -   + "width:" + this.width + "px;"
129   -   + "height:" + this.height + "px;"
130   -   + "right:" + this.right + ";"
131   -   + "bottom:" + this.bottom + ";"
132   -   + "background-color:white;"
133   -   + "color:" + normal + ";"
134   -   + "font-size:18px;"
135   -   + "font-family:Verdana;"
136   -   + "position:fixed;"
137   -   + "cursor:default;"
138   -   + "-webkit-user-select:none;"
139   -   + "-moz-user-select:none;"
140   -   + "-ms-user-select:none;"
141   -   + "user-select:none;"
142   -   + "border:2px solid " + normal + ";"
143   -   + "' "
144   -   + "οnmοusedοwn='getFocus(this)'"
145   - +">"
146   -// 标题开始
147   -    + "<div "
148   -    + "style='"
149   -    + "background-color:" + normal + ";"
150   -    + "width:" + (this.width-2*2) + "px;"
151   -    + "height:28px;"
152   -    + "color:white;"
153   -    + "' "
154   -    + "onmousedown='startDrag(this)' "
155   -    + "onmouseup='stopDrag(this)' "
156   -    + "onmousemove='drag(this)' "
157   -    + "ondblclick='min(this.childNodes[1])'"
158   -    + ">"
159   -     + "<span style='width:" + (this.width-2*25-4) + "px;padding-left:3px; display:-moz-inline-box; display:inline-block;'>" + this.title + "</span>"
160   -     + "<span style='width:25px;border-width:0px;color:white;font-family:webdings;display:-moz-inline-box; display:inline-block;' onclick='min(this)'>0</span>"
161   -     + "<span style='width:25px;border-width:0px;color:white;font-family:webdings;display:-moz-inline-box; display:inline-block;' onclick='cls(this)'>r</span>"
162   -    + "</div>"
163   -//     主窗体开始
164   - + "<div style='"
165   -     + "width:100%;"
166   -     + "height:" + (this.height-28-4) + "px;"
167   -     + "min-height:" + (this.height-28-4) + "px;"
168   -     + "background-color:white;"
169   -     + "word-break:break-all;"
170   -     + "padding:3px;"
171   -     + "'>"
172   -// 主窗体的内容部分
173   - + "<div style='"
174   -     + "width:100%;"
175   -     + "height:" + (this.height-28-4-50) + "px;"
176   -     + "min-height:" + (this.height-28-4-50) + "px;"
177   -     + "line-height:20px;"
178   -     + "text-align: center;"
179   -     + "word-break:break-all;"
180   -     + "padding:3px;"
181   -     + "padding-top: 40px;"
182   - + "color:red;"
183   -     + "'>"
184   - + this.message
185   - + "</div>"
186   -// 主窗体的按钮部分(按钮1)
187   - + "<div style='"
188   -    + "width:60px;"
189   -    + "height:30px;"
190   -    + "color: #fff;"
191   -    + "line-height: 30px;"
192   -    + "text-align: center;"
193   -    + "font-size: 15px;"
194   -    + "float:left;"
195   -    + "margin-left: 120px;"
196   -   + "background-color:" + normal + ";"
197   -   + "'"
198   - +" type='button'"
199   - +" onclick='cls(this)'"
200   - +">确定</div>"
201   -// 主窗体的按钮部分(按钮2)
202   - + "<div style='"
203   -    + "width:60px;"
204   -    + "height:30px;"
205   -    + "color: #fff;"
206   -    + "line-height: 30px;"
207   -    + "text-align: center;"
208   -    + "font-size: 15px;"
209   -    + "float:right;"
210   -    + "margin-right:20px;"
211   -   + "background-color:" + normal + ";"
212   -   + "'"
213   - +" type='button'"
214   - +" onclick=\"toLink('"+this.url+"')\""
215   - +">查看</div>"
216   - + "</div>"
217   -   
218   -  
219   - + "</div>";
220   -  document.body.insertAdjacentHTML("beforeEnd",str);
221   - }
  92 +
  93 +<!-- 右下角弹窗js -->
  94 + <script src="../../static/js/notice.js"></script>
222 95  
223   - //开始拖动;
224   - function startDrag(obj){
225   -  if(event.button==0){
226   -   //锁定标题栏;
227   -//   obj.setCapture();
228   -   //定义对象;
229   -   var win = obj.parentNode;
230   -//   var sha = win.nextSibling;
231   -   //记录鼠标和层位置;
232   -   x0 = event.clientX;
233   -   y0 = event.clientY;
234   -   x1 = parseInt(win.style.right.replace("px",""));
235   -   y1 = parseInt(win.style.bottom.replace("px",""));
236   -   //记录颜色;
237   -   normal = obj.style.backgroundColor;
238   -   //改变风格;
239   -   obj.style.backgroundColor = hover;
240   -   win.style.borderColor = hover;
241   -   obj.nextSibling.style.color = hover;
242   -//   sha.style.right = (x1 - offx)+"px";
243   -//   sha.style.bottom  = (y1 - offy)+"px";
244   -   moveable = true;
245   -  }
246   - }
247   - //拖动;
248   - function drag(obj){
249   -  if(moveable){
250   -   var win = obj.parentNode;
251   -//   var sha = win.nextSibling;
252   -   win.style.right = ( x1+x0-event.clientX)+"px";
253   -   win.style.bottom  = ( y1+y0-event.clientY)+"px";
254   -//   sha.style.right = (parseInt(win.style.right.replace("px","")) - offx)+"px";
255   -//   sha.style.bottom  = (parseInt(win.style.bottom.replace("px","")) - offy)+"px";
256   -  }
257   - }
258   - //停止拖动;
259   - function stopDrag(obj){
260   -  if(moveable){
261   -   var win = obj.parentNode;
262   -//   var sha = win.nextSibling;
263   -   var msg = obj.nextSibling;
264   -   win.style.borderColor     = normal;
265   -   obj.style.backgroundColor = normal;
266   -   msg.style.color           = normal;
267   -//   sha.style.right = obj.parentNode.style.right;
268   -//   sha.style.bottom  = obj.parentNode.style.bottom;
269   -//   obj.releaseCapture();
270   -   moveable = false;
271   -  }
272   - }
273   - //获得焦点;
274   - function getFocus(obj)
275   - {
276   -  if(obj.style.zIndex!=index)
277   -  {
278   -   index = index + 2;
279   -   var idx = index;
280   -   obj.style.zIndex=idx;
281   -   obj.nextSibling.style.zIndex=idx-1;
282   -  }
283   - }
284   - //最小化;
285   - function min(obj){
286   -  var win = obj.parentNode.parentNode;
287   -//  var sha = win.nextSibling;
288   -  var tit = obj.parentNode;
289   -  var msg = tit.nextSibling;
290   -  var flg = msg.style.display=="none";
291   -  if(flg)
292   -  {
293   -   win.style.height  = (parseInt(msg.style.height.replace("px","")) + parseInt(tit.style.height.replace("px","")) + 2*2)+"px";
294   -//   sha.style.height  = win.style.height;
295   -   msg.style.display = "block";
296   -   obj.innerHTML = "0";
297   -  }
298   -  else
299   -  {
300   -   win.style.height  = (parseInt(tit.style.height.replace("px","")) + 2*2)+"px";
301   -//   sha.style.height  = win.style.height;
302   -   obj.innerHTML = "2";
303   -   msg.style.display = "none";
304   -  }
305   - }
306   - //关闭;
307   - function cls(obj){
308   -  var win = obj.parentNode.parentNode;
309   -//  var sha = win.nextSibling;
310   -  win.style.visibility = "hidden";
311   -//  sha.style.visibility = "hidden";
312   - isShow=true;
313   - }
314   - //点击查看跳转链接
315   - function toLink(url){
316   - isShow=true;
317   - window.location.href= url;
318   -// window.location.href= window.location.protocol+"//"+window.location.host+"/channel/page?shenhe_status=0&receive=0";
319   - }
320   - //-->
321   - </script>
322 96 <script language='JScript'>
  97 +
  98 + var isShow_chinnal=false;//是否显示频道消息框
  99 + var isShow_liveApply=false;//是否显示直播申请消息框
  100 +
323 101 function initialize(){
324   -  var a = new xWin("1","新频道审核通知","您有三条未审核的频道消息,请尽快审核,谢谢!","www.baidu.com");
325   -//  var b = new xWin("2",100,200,0,200,"arui2","test2");
326   -  //var c = new xWin("3",200,160,250,50,"arui3","test3");
  102 + $.ajax({
  103 + type:'post',
  104 + dataType:'json',
  105 + data:'',
  106 + url: "/users/getNoticeShow",
  107 + success:function(data){
  108 + if(data.isShow_chinnal){
  109 + isShow_chinnal=true;
  110 + notice_channel();//第一次进来就弹窗
  111 + }
  112 + if(data.isShow_liveApply){
  113 + isShow_liveApply=true;
  114 + }
  115 + }
  116 + });
327 117 }
328   -// window.onload = initialize;
329   -
330 118  
331 119 var t1;
332 120 $(function(){
  121 + initialize();
333 122 t1 = window.setInterval(
334 123 function(){
335   - if(isShow){
336   - notice()
  124 + if(((parseInt(new Date().getTime()/1000))%(5*60)==0) && isShow_chinnal){
  125 + notice_channel()
337 126 }
338   - },10000);
  127 + },1000);
339 128 });
340 129  
341   - function notice(){
  130 + function notice_channel(){
342 131 $.ajax({
343 132 type:'get',
344 133 dataType:'json',
... ... @@ -346,9 +135,6 @@
346 135 url: "/api/channel/channelNotice",
347 136 success:function(data){
348 137 if(data!=null && data!="" ){
349   -// alert(data.title+":"+data.content);
350   - //去掉定时器的方法
351   -// window.clearInterval(t1);
352 138 new xWin(data.id,data.title,data.content,data.url);
353 139 }
354 140 }
... ...
src/main/resources/templates/page/users.html
... ... @@ -160,7 +160,7 @@
160 160 <td style="text-align: center; width: 12%;" th:text="${#dates.format(users.created_at, 'yyyy-MM-dd HH:mm:ss')}">2018-11-22 23:08:48</td>
161 161 <td style="text-align: center; width: 12%;" th:text="${#dates.format(users.updated_at, 'yyyy-MM-dd HH:mm:ss')}">2016-08-03 14:27:17</td>
162 162 <td style="text-align: center; width: 10%;"><span>&nbsp;</span><a
163   - class="edit" th:href="'javascript:edit('+${users.id}+',\''+${users.company_brief}+'\',\''+${users.state} +'\')'">
  163 + class="edit" th:href="'javascript:edit('+${users.id}+',\''+${users.company_brief}+'\',\''+${users.notice_show} +'\')'">
164 164 <button class="btn btn-primary btn-xs">设置</button>
165 165 </a><span> </span><span>&nbsp;</span></td>
166 166 </tr>
... ... @@ -244,14 +244,14 @@
244 244 </div>
245 245  
246 246 <div class="form-group">
247   - <label class="control-label col-sm-2" style="font-size: 15px;">:</label>
  247 + <label class="control-label col-sm-2" style="font-size: 15px;">提醒业务:</label>
248 248 <form action="/users/write" method="post" id="editWrite">
249   - <input type="text" name="siteId" value="" class="hide" id="edit_id"/>
  249 + <input type="text" name="userId" value="" class="hide" id="edit_id"/>
250 250 <input type="text" name="redirect_url" value="" class="hide" id="redirect_url"/>
251 251 <div class="col-sm-10" style="float: left">
252   - <div th:each="bu:${business}" style="padding-right: 30px;" class="write_check">
  252 + <div th:each="bu:${notice}" style="padding-right: 30px;" class="write_check">
253 253 <span th:text="${bu.value}" style="font-size: 15px"></span>
254   - <input type="checkbox" name="write_business" th:value="${bu.key}" th:id="'write_check_'+${bu.key}">
  254 + <input type="checkbox" name="write_notice" th:value="${bu.key}" th:id="'write_check_'+${bu.key}">
255 255 </div>
256 256 </div>
257 257 </form>
... ... @@ -260,7 +260,7 @@
260 260 </div>
261 261 <div class="modal-footer">
262 262 <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
263   -<!-- <button type="button" class="btn btn-primary" onclick="javascript:$('#editWrite').submit();">提交更改</button> -->
  263 + <button type="button" class="btn btn-primary" onclick="javascript:$('#editWrite').submit();">提交更改</button>
264 264 </div>
265 265 </div><!-- /.modal-content -->
266 266 </div><!-- /.modal-dialog -->
... ... @@ -268,13 +268,13 @@
268 268 <!-- /.modal -->
269 269 <script>
270 270 //打开编辑窗口
271   - function edit(id,company,write_business){
  271 + function edit(id,company,notice_show){
272 272 $("#edit_company").text(company);
273 273 $("#edit_id").val(id);
274 274 $("#redirect_url").val(location.pathname+location.search);
275 275 $(".write_check input").prop("checked",false);
276   - if($.trim(write_business)!=''){
277   - var array = write_business.split(",")
  276 + if($.trim(notice_show)!=''){
  277 + var array = notice_show.split(",")
278 278 for (var i=0;i<array.length;i++){
279 279 $("#write_check_"+array[i]).prop("checked",true);
280 280 }
... ... @@ -337,6 +337,12 @@
337 337 var pageSize = $("#pageSize").val();
338 338 window.location.href = "/users/page?company_brief=" + company_brief + "&username=" + username+ "&sp_id=" + sp_id+ "&mobile=" + mobile+ "&pageSize=" + pageSize;
339 339 });
  340 + //鼠标回车事件
  341 + $(document).keyup(function(event){
  342 + if(event.keyCode ==13){
  343 + $("#users_query").trigger("click");
  344 + }
  345 + });
340 346  
341 347 </script>
342 348  
... ...
src/main/resources/templates/page/usersFree.html
... ... @@ -408,6 +408,12 @@ input:checked + .slider:before {
408 408 window.location.href = "/usersFree/page?userId=" + userId + "&mobile=" + mobile+ "&pageSize=" + pageSize;
409 409 });
410 410  
  411 + //鼠标回车事件
  412 + $(document).keyup(function(event){
  413 + if(event.keyCode ==13){
  414 + $("#users_query").trigger("click");
  415 + }
  416 + });
411 417 </script>
412 418  
413 419 <footer th:replace="../templates/common/foot::foot" ></footer>
... ...