Ver código fonte

点击"执行"触发任务执行,不应该刷新任务列表,取消之;

xueli.xue 9 anos atrás
pai
commit
c33b9c8a23

+ 9 - 2
xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js Ver arquivo

161
 	$("#job_list").on('click', '.job_operate',function() {
161
 	$("#job_list").on('click', '.job_operate',function() {
162
 		var typeName;
162
 		var typeName;
163
 		var url;
163
 		var url;
164
+		var needFresh = false;
165
+
164
 		var type = $(this).attr("type");
166
 		var type = $(this).attr("type");
165
 		if ("job_pause" == type) {
167
 		if ("job_pause" == type) {
166
 			typeName = "暂停";
168
 			typeName = "暂停";
167
 			url = base_url + "/jobinfo/pause";
169
 			url = base_url + "/jobinfo/pause";
170
+			needFresh = true;
168
 		} else if ("job_resume" == type) {
171
 		} else if ("job_resume" == type) {
169
 			typeName = "恢复";
172
 			typeName = "恢复";
170
 			url = base_url + "/jobinfo/resume";
173
 			url = base_url + "/jobinfo/resume";
174
+			needFresh = true;
171
 		} else if ("job_del" == type) {
175
 		} else if ("job_del" == type) {
172
 			typeName = "删除";
176
 			typeName = "删除";
173
 			url = base_url + "/jobinfo/remove";
177
 			url = base_url + "/jobinfo/remove";
178
+			needFresh = true;
174
 		} else if ("job_trigger" == type) {
179
 		} else if ("job_trigger" == type) {
175
 			typeName = "执行";
180
 			typeName = "执行";
176
 			url = base_url + "/jobinfo/trigger";
181
 			url = base_url + "/jobinfo/trigger";
193
 				success : function(data){
198
 				success : function(data){
194
 					if (data.code == 200) {
199
 					if (data.code == 200) {
195
 						ComAlert.show(1, typeName + "成功", function(){
200
 						ComAlert.show(1, typeName + "成功", function(){
196
-							//window.location.reload();
197
-							jobTable.fnDraw();
201
+							if (needFresh) {
202
+								//window.location.reload();
203
+								jobTable.fnDraw();
204
+							}
198
 						});
205
 						});
199
 					} else {
206
 					} else {
200
 						ComAlert.show(1, typeName + "失败");
207
 						ComAlert.show(1, typeName + "失败");