mirror of https://gitee.com/y_project/RuoYi.git
Pre Merge pull request !405 from 小马1988/master
commit
e3340067a9
|
@ -922,5 +922,37 @@ function gen_cron() {
|
|||
+ $("#v_month").val() + " "
|
||||
+ $("#v_week").val() + " "
|
||||
+ $("#v_year").val();
|
||||
$("#cron").val(str);
|
||||
var vals = $("input[name^='v_']");
|
||||
var cron = $("#cron");
|
||||
var item = [];
|
||||
vals.each(function() {
|
||||
item.push(this.value);
|
||||
});
|
||||
// 修复表达式错误BUG,如果后一项不为* 那么前一项肯定不为*,要不然就成了每秒执行了
|
||||
// 获取当前选中tab
|
||||
var currentIndex = 0;
|
||||
$(".nav-tabs>li").each(function(i, item) {
|
||||
if ($(item).hasClass("active")) {
|
||||
currentIndex = i;
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
// 当前选中项之前的如果为*,则都设置成0
|
||||
for (var i = currentIndex; i >= 1; i--) {
|
||||
if (item[i] != "*" && item[i - 1] == "*") {
|
||||
item[i - 1] = "0";
|
||||
}
|
||||
}
|
||||
// 当前选中项之后的如果不为*则都设置成*
|
||||
if (item[currentIndex] == "*") {
|
||||
for (var i = currentIndex + 1; i < item.length; i++) {
|
||||
if (i == 5) {
|
||||
item[i] = "?";
|
||||
} else {
|
||||
item[i] = "*";
|
||||
}
|
||||
}
|
||||
}
|
||||
cron.val(item.join(" ")).change();
|
||||
}
|
|
@ -1105,13 +1105,13 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>表达式字段</td>
|
||||
<td><input type="text" class="form-control" id="v_second" value="*" readonly=""></td>
|
||||
<td><input type="text" class="form-control" id="v_min" value="*" readonly=""></td>
|
||||
<td><input type="text" class="form-control" id="v_hour" value="*" readonly=""></td>
|
||||
<td><input type="text" class="form-control" id="v_day" value="*" readonly=""></td>
|
||||
<td><input type="text" class="form-control" id="v_month" value="*" readonly=""></td>
|
||||
<td><input type="text" class="form-control" id="v_week" value="?" readonly=""></td>
|
||||
<td><input type="text" class="form-control" id="v_year" readonly=""></td>
|
||||
<td><input type="text" class="form-control" name="v_second" id="v_second" value="*"></td>
|
||||
<td><input type="text" class="form-control" name="v_min" id="v_min" value="*"></td>
|
||||
<td><input type="text" class="form-control" name="v_hour" id="v_hour" value="*"></td>
|
||||
<td><input type="text" class="form-control" name="v_day" id="v_day" value="*"></td>
|
||||
<td><input type="text" class="form-control" name="v_month" id="v_month" value="*"></td>
|
||||
<td><input type="text" class="form-control" name="v_week" id="v_week" value="?"></td>
|
||||
<td><input type="text" class="form-control" name="v_year" id="v_year"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cron 表达式</td>
|
||||
|
|
Loading…
Reference in New Issue