Commit 507148a93f097ce6de94d70fccc6085ecc1bfcd5
1 parent
d70c9e8c
1.修复未选择选项时,无法点击批量删除按钮
Showing
6 changed files
with
126 additions
and
10 deletions
WebRoot/WEB-INF/jsp/sunvote/coursemanagement/coursemanagement_list2.jsp
@@ -22,6 +22,10 @@ | @@ -22,6 +22,10 @@ | ||
22 | <link href="static/css/teach.css" rel="stylesheet"> | 22 | <link href="static/css/teach.css" rel="stylesheet"> |
23 | <!-- 日期框 --> | 23 | <!-- 日期框 --> |
24 | <link rel="stylesheet" href="static/ace/css/datepicker.css" /> | 24 | <link rel="stylesheet" href="static/ace/css/datepicker.css" /> |
25 | +<style type="text/css"> | ||
26 | + #remove{ | ||
27 | + background:#ccc} | ||
28 | +</style> | ||
25 | </head> | 29 | </head> |
26 | 30 | ||
27 | <body class="no-skin"> | 31 | <body class="no-skin"> |
@@ -91,7 +95,7 @@ | @@ -91,7 +95,7 @@ | ||
91 | <input type="button" onclick="add()" value="分配任课" /> | 95 | <input type="button" onclick="add()" value="分配任课" /> |
92 | </div> | 96 | </div> |
93 | <div class="removeAll"> | 97 | <div class="removeAll"> |
94 | - <input type="button" onclick="deleteAll()" value="移除任课" /> | 98 | + <input type="button" onclick="deleteAll()" disabled id="remove" value="移除任课" /> |
95 | </div> | 99 | </div> |
96 | <div class="page_box"> | 100 | <div class="page_box"> |
97 | 101 | ||
@@ -169,7 +173,22 @@ | @@ -169,7 +173,22 @@ | ||
169 | }}); | 173 | }}); |
170 | window.top.remove.show(); | 174 | window.top.remove.show(); |
171 | } | 175 | } |
172 | - | 176 | + $("input[type=checkbox]").on('click',function(){ |
177 | + var str = ''; | ||
178 | + for(var i=0;i < document.getElementsByName('ids').length;i++){ | ||
179 | + if(document.getElementsByName('ids')[i].checked){ | ||
180 | + if(str=='') str += document.getElementsByName('ids')[i].value; | ||
181 | + else str += ',' + document.getElementsByName('ids')[i].value; | ||
182 | + } | ||
183 | + } | ||
184 | + if(str==''){ | ||
185 | + $("#remove").attr("disabled","disabled"); | ||
186 | + $("#remove").css("background","#ccc"); | ||
187 | + }else{ | ||
188 | + $("#remove").removeAttr("disabled"); | ||
189 | + $("#remove").css("background","#f29c9f"); | ||
190 | + } | ||
191 | + }) | ||
173 | </script> | 192 | </script> |
174 | 193 | ||
175 | 194 |
WebRoot/WEB-INF/jsp/sunvote/grade/grade_list2.jsp
@@ -23,6 +23,10 @@ | @@ -23,6 +23,10 @@ | ||
23 | rel="stylesheet"> --> | 23 | rel="stylesheet"> --> |
24 | <link rel="stylesheet" href="static/css/bootstrap.min.css" /> | 24 | <link rel="stylesheet" href="static/css/bootstrap.min.css" /> |
25 | <link href="static/css/teach.css" rel="stylesheet"> | 25 | <link href="static/css/teach.css" rel="stylesheet"> |
26 | +<style type="text/css"> | ||
27 | + #remove{ | ||
28 | + background:#ccc} | ||
29 | +</style> | ||
26 | </head> | 30 | </head> |
27 | <body class="no-skin"> | 31 | <body class="no-skin"> |
28 | <form action="grade/listcs.do" method="post" name="Form" id="Form"> | 32 | <form action="grade/listcs.do" method="post" name="Form" id="Form"> |
@@ -88,7 +92,7 @@ | @@ -88,7 +92,7 @@ | ||
88 | <input type="button" onclick="add()" value="添加年级" /> | 92 | <input type="button" onclick="add()" value="添加年级" /> |
89 | </div> | 93 | </div> |
90 | <div class="removeAll"> | 94 | <div class="removeAll"> |
91 | - <input type="button" onclick="del()" value="移除年级" /> | 95 | + <input type="button" onclick="del()" disabled id="remove" value="移除年级" /> |
92 | </div> | 96 | </div> |
93 | <div class="page_box"> | 97 | <div class="page_box"> |
94 | 98 | ||
@@ -177,7 +181,22 @@ | @@ -177,7 +181,22 @@ | ||
177 | }}); | 181 | }}); |
178 | window.top.remove.show(); | 182 | window.top.remove.show(); |
179 | } | 183 | } |
180 | - | 184 | + $("input[type=checkbox]").on('click',function(){ |
185 | + var str = ''; | ||
186 | + for(var i=0;i < document.getElementsByName('ids').length;i++){ | ||
187 | + if(document.getElementsByName('ids')[i].checked){ | ||
188 | + if(str=='') str += document.getElementsByName('ids')[i].value; | ||
189 | + else str += ',' + document.getElementsByName('ids')[i].value; | ||
190 | + } | ||
191 | + } | ||
192 | + if(str==''){ | ||
193 | + $("#remove").attr("disabled","disabled"); | ||
194 | + $("#remove").css("background","#ccc"); | ||
195 | + }else{ | ||
196 | + $("#remove").removeAttr("disabled"); | ||
197 | + $("#remove").css("background","#f29c9f"); | ||
198 | + } | ||
199 | + }) | ||
181 | </script> | 200 | </script> |
182 | 201 | ||
183 | 202 |
WebRoot/WEB-INF/jsp/sunvote/pagetemplate/pagetemplate_list2.jsp
@@ -21,6 +21,10 @@ | @@ -21,6 +21,10 @@ | ||
21 | <link href="static/css/teach.css" rel="stylesheet"> | 21 | <link href="static/css/teach.css" rel="stylesheet"> |
22 | <!-- 日期框 --> | 22 | <!-- 日期框 --> |
23 | <link rel="stylesheet" href="static/ace/css/datepicker.css" /> | 23 | <link rel="stylesheet" href="static/ace/css/datepicker.css" /> |
24 | +<style type="text/css"> | ||
25 | + #remove{ | ||
26 | + background:#ccc} | ||
27 | +</style> | ||
24 | </head> | 28 | </head> |
25 | <body class="no-skin"> | 29 | <body class="no-skin"> |
26 | 30 | ||
@@ -100,7 +104,7 @@ | @@ -100,7 +104,7 @@ | ||
100 | <input type="button" onclick="$('.title_time').modal('show');" value="添加模板" /> | 104 | <input type="button" onclick="$('.title_time').modal('show');" value="添加模板" /> |
101 | </div> | 105 | </div> |
102 | <div class="removeAll"> | 106 | <div class="removeAll"> |
103 | - <input type="button" onclick="del('')" value="批量删除" /> | 107 | + <input type="button" onclick="del('')" disabled id="remove" value="批量删除" /> |
104 | </div> | 108 | </div> |
105 | <div class="page_box"> | 109 | <div class="page_box"> |
106 | 110 | ||
@@ -346,7 +350,22 @@ | @@ -346,7 +350,22 @@ | ||
346 | window.location.href='<%=basePath%>pagetemplate/excel.do'; | 350 | window.location.href='<%=basePath%>pagetemplate/excel.do'; |
347 | } | 351 | } |
348 | 352 | ||
349 | - | 353 | + $("input[type=checkbox]").on('click',function(){ |
354 | + var str = ''; | ||
355 | + for(var i=0;i < document.getElementsByName('ids').length;i++){ | ||
356 | + if(document.getElementsByName('ids')[i].checked){ | ||
357 | + if(str=='') str += document.getElementsByName('ids')[i].value; | ||
358 | + else str += ',' + document.getElementsByName('ids')[i].value; | ||
359 | + } | ||
360 | + } | ||
361 | + if(str==''){ | ||
362 | + $("#remove").attr("disabled","disabled"); | ||
363 | + $("#remove").css("background","#ccc"); | ||
364 | + }else{ | ||
365 | + $("#remove").removeAttr("disabled"); | ||
366 | + $("#remove").css("background","#f29c9f"); | ||
367 | + } | ||
368 | + }) | ||
350 | </script> | 369 | </script> |
351 | 370 | ||
352 | 371 |
WebRoot/WEB-INF/jsp/sunvote/paper/paper_list5.jsp
@@ -32,6 +32,10 @@ | @@ -32,6 +32,10 @@ | ||
32 | <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script> | 32 | <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script> |
33 | <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> | 33 | <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> |
34 | <![endif]--> | 34 | <![endif]--> |
35 | +<style type="text/css"> | ||
36 | + #remove{ | ||
37 | + background:#ccc} | ||
38 | +</style> | ||
35 | </head> | 39 | </head> |
36 | <body> | 40 | <body> |
37 | 41 | ||
@@ -119,7 +123,7 @@ | @@ -119,7 +123,7 @@ | ||
119 | <input type="button" onclick="parent.$('.title_time').modal('show');" value="新建试卷" /> | 123 | <input type="button" onclick="parent.$('.title_time').modal('show');" value="新建试卷" /> |
120 | </div> | 124 | </div> |
121 | <div class="removeAll"> | 125 | <div class="removeAll"> |
122 | - <input type="button" onclick="deleteAll()" value="批量删除" /> | 126 | + <input type="button" onclick="deleteAll()" disabled id="remove" value="批量删除" /> |
123 | </div> | 127 | </div> |
124 | <div class="page_box"> | 128 | <div class="page_box"> |
125 | 129 | ||
@@ -215,7 +219,22 @@ | @@ -215,7 +219,22 @@ | ||
215 | }}); | 219 | }}); |
216 | window.top.remove.show(); | 220 | window.top.remove.show(); |
217 | } | 221 | } |
218 | - | 222 | + $("input[type=checkbox]").on('click',function(){ |
223 | + var str = ''; | ||
224 | + for(var i=0;i < document.getElementsByName('ids').length;i++){ | ||
225 | + if(document.getElementsByName('ids')[i].checked){ | ||
226 | + if(str=='') str += document.getElementsByName('ids')[i].value; | ||
227 | + else str += ',' + document.getElementsByName('ids')[i].value; | ||
228 | + } | ||
229 | + } | ||
230 | + if(str==''){ | ||
231 | + $("#remove").attr("disabled","disabled"); | ||
232 | + $("#remove").css("background","#ccc"); | ||
233 | + }else{ | ||
234 | + $("#remove").removeAttr("disabled"); | ||
235 | + $("#remove").css("background","#f29c9f"); | ||
236 | + } | ||
237 | + }) | ||
219 | 238 | ||
220 | </script> | 239 | </script> |
221 | </html> | 240 | </html> |
222 | \ No newline at end of file | 241 | \ No newline at end of file |
WebRoot/WEB-INF/jsp/sunvote/sclass/sclass_list2.jsp
@@ -24,6 +24,10 @@ | @@ -24,6 +24,10 @@ | ||
24 | rel="stylesheet"> --> | 24 | rel="stylesheet"> --> |
25 | <link rel="stylesheet" href="static/css/bootstrap.min.css" /> | 25 | <link rel="stylesheet" href="static/css/bootstrap.min.css" /> |
26 | <link href="static/css/teach.css" rel="stylesheet"> | 26 | <link href="static/css/teach.css" rel="stylesheet"> |
27 | +<style type="text/css"> | ||
28 | + #remove{ | ||
29 | + background:#ccc} | ||
30 | +</style> | ||
27 | </head> | 31 | </head> |
28 | <body class="no-skin"> | 32 | <body class="no-skin"> |
29 | 33 | ||
@@ -104,7 +108,7 @@ | @@ -104,7 +108,7 @@ | ||
104 | <input type="button" onclick="add();" value="添加班级" /> | 108 | <input type="button" onclick="add();" value="添加班级" /> |
105 | </div> | 109 | </div> |
106 | <div class="removeAll"> | 110 | <div class="removeAll"> |
107 | - <input type="button" onclick="del();" value="删除" /> | 111 | + <input type="button" onclick="del();" disabled id="remove" value="删除" /> |
108 | </div> | 112 | </div> |
109 | 113 | ||
110 | <div class="page_box"> | 114 | <div class="page_box"> |
@@ -209,6 +213,22 @@ | @@ -209,6 +213,22 @@ | ||
209 | }); | 213 | }); |
210 | window.top.modal.show(); | 214 | window.top.modal.show(); |
211 | } | 215 | } |
216 | + $("input[type=checkbox]").on('click',function(){ | ||
217 | + var str = ''; | ||
218 | + for(var i=0;i < document.getElementsByName('ids').length;i++){ | ||
219 | + if(document.getElementsByName('ids')[i].checked){ | ||
220 | + if(str=='') str += document.getElementsByName('ids')[i].value; | ||
221 | + else str += ',' + document.getElementsByName('ids')[i].value; | ||
222 | + } | ||
223 | + } | ||
224 | + if(str==''){ | ||
225 | + $("#remove").attr("disabled","disabled"); | ||
226 | + $("#remove").css("background","#ccc"); | ||
227 | + }else{ | ||
228 | + $("#remove").removeAttr("disabled"); | ||
229 | + $("#remove").css("background","#f29c9f"); | ||
230 | + } | ||
231 | + }) | ||
212 | </script> | 232 | </script> |
213 | 233 | ||
214 | 234 |
WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_list2.jsp
@@ -24,6 +24,10 @@ | @@ -24,6 +24,10 @@ | ||
24 | rel="stylesheet"> --> | 24 | rel="stylesheet"> --> |
25 | <link rel="stylesheet" href="static/css/bootstrap.min.css" /> | 25 | <link rel="stylesheet" href="static/css/bootstrap.min.css" /> |
26 | <link href="static/css/teach.css" rel="stylesheet"> | 26 | <link href="static/css/teach.css" rel="stylesheet"> |
27 | +<style type="text/css"> | ||
28 | + #remove{ | ||
29 | + background:#ccc} | ||
30 | +</style> | ||
27 | </head> | 31 | </head> |
28 | <body class="no-skin"> | 32 | <body class="no-skin"> |
29 | 33 | ||
@@ -120,7 +124,7 @@ | @@ -120,7 +124,7 @@ | ||
120 | <input type="button" onclick="export2();" value="批量导出" /> | 124 | <input type="button" onclick="export2();" value="批量导出" /> |
121 | </div> | 125 | </div> |
122 | <div class="removeAll"> | 126 | <div class="removeAll"> |
123 | - <input type="button" onclick="del()" value="删除" /> | 127 | + <input type="button" onclick="del()" disabled id="remove" value="删除" /> |
124 | </div> | 128 | </div> |
125 | <div class="page_box"> | 129 | <div class="page_box"> |
126 | <div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div> | 130 | <div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div> |
@@ -297,6 +301,22 @@ | @@ -297,6 +301,22 @@ | ||
297 | function export2(){ | 301 | function export2(){ |
298 | window.open('<%=basePath%>teacher/excel?school_id=${pd.SCHOOL_ID}','_blank'); | 302 | window.open('<%=basePath%>teacher/excel?school_id=${pd.SCHOOL_ID}','_blank'); |
299 | } | 303 | } |
304 | + $("input[type=checkbox]").on('click',function(){ | ||
305 | + var str = ''; | ||
306 | + for(var i=0;i < document.getElementsByName('ids').length;i++){ | ||
307 | + if(document.getElementsByName('ids')[i].checked){ | ||
308 | + if(str=='') str += document.getElementsByName('ids')[i].value; | ||
309 | + else str += ',' + document.getElementsByName('ids')[i].value; | ||
310 | + } | ||
311 | + } | ||
312 | + if(str==''){ | ||
313 | + $("#remove").attr("disabled","disabled"); | ||
314 | + $("#remove").css("background","#ccc"); | ||
315 | + }else{ | ||
316 | + $("#remove").removeAttr("disabled"); | ||
317 | + $("#remove").css("background","#f29c9f"); | ||
318 | + } | ||
319 | + }) | ||
300 | </script> | 320 | </script> |
301 | 321 | ||
302 | 322 |