97 lines
4.5 KiB
HTML
97 lines
4.5 KiB
HTML
<div class="easyui-layout" style="width:100%;height:100%">
|
|
<div id='southdiv' data-options="region:'south'" style="width:100%;height:50px;padding:5px">
|
|
<div style="text-align:center;padding:2px">
|
|
<a id="submitb" class="easyui-linkbutton" iconCls="fa-floppy-o" onclick="submitform()">保存</a>
|
|
<a class="easyui-linkbutton" iconCls="fa-close" onclick="javascript:$('#dd').dialog('close')">取消</a>
|
|
</div>
|
|
</div>
|
|
<div data-options="region:'center'" style="width:100%;height:100%;padding:5px 15px;">
|
|
<form method="post" id="schedulesetff">
|
|
{% comment %} <div style="margin-bottom:10px">
|
|
<input id="name" class="easyui-textbox" name="name" style="width:480px" data-options="
|
|
label:'名称'"
|
|
required=true>
|
|
</div> {% endcomment %}
|
|
<div style="margin-bottom:5px">
|
|
<select id="set" class="easyui-combobox" name="set" style="width:200px" data-options="
|
|
label:'配置方案',
|
|
onSelect: function(res){
|
|
if(res.value=='interval'){
|
|
$('#set1').show()
|
|
$('#set2').hide()
|
|
}else{
|
|
$('#set2').show()
|
|
$('#set1').hide()
|
|
}
|
|
|
|
}
|
|
"
|
|
>
|
|
<option value="interval">简单配置</option>
|
|
<option value="crontab">高级配置</option>
|
|
</select>
|
|
</div>
|
|
<div style="margin-bottom:5px" id="set1">
|
|
<label style='display:inline-block;'>简单配置</label>
|
|
<span style="font-weight:bold">每隔</span>
|
|
<input id="every" name="every" type="text" class="easyui-numberbox" value="1" data-options="min:1,max:31"/>
|
|
<select id="period" class="easyui-combobox" style="width:80px" name="period">
|
|
|
|
|
|
<option value="days">天</option>
|
|
|
|
<option value="hours">小时</option>
|
|
<option value="minutes">分</option>
|
|
<option value="seconds">秒</option>
|
|
</select>
|
|
</div>
|
|
<div id="set2">
|
|
<div >高级配置</div>
|
|
<div style="margin-bottom:5px">
|
|
<input id="minute" class="easyui-textbox" name="minute" style="width:480px" data-options="label:'分钟'" value="*">
|
|
</div>
|
|
<div style="margin-bottom:5px">
|
|
<input id="hour" class="easyui-textbox" name="hour" style="width:480px" data-options="label:'小时'" value="*">
|
|
</div>
|
|
<div style="margin-bottom:5px">
|
|
<input id="day_of_week" class="easyui-textbox" name="day_of_week" style="width:480px" data-options="label:'每周中的天'" value="*">
|
|
</div>
|
|
<div style="margin-bottom:5px">
|
|
<input id="day_of_month" class="easyui-textbox" name="day_of_month" style="width:480px" data-options="label:'每月中的天'" value="*">
|
|
</div>
|
|
<div style="margin-bottom:5px">
|
|
<input id="month_of_year" class="easyui-textbox" name="month_of_year" style="width:480px" data-options="label:'每年中的月'" value="*">
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<script>
|
|
function submitform() {
|
|
var data = $('#schedulesetff').serializeJSON();
|
|
$.ajax({
|
|
type: "POST",
|
|
url: 'api/myschedule/?a=add',
|
|
data: JSON.stringify(data),
|
|
datatype: "json",
|
|
processData: false,
|
|
contentType: "application/json;charset=utf-8",
|
|
beforeSend: function () {
|
|
var bo = $('#schedulesetff').form('validate')
|
|
if (bo == false) {
|
|
return bo
|
|
} else {
|
|
$('#submitb').linkbutton('disable');
|
|
}
|
|
},
|
|
success: function (data) {
|
|
if (data.code == 1) {
|
|
$("#schedulesettable").datagrid('reload');
|
|
$("#dd").dialog("close");
|
|
} else { $.messager.alert('提示', data.msg); }
|
|
$('#submitb').linkbutton('enable');
|
|
},
|
|
});
|
|
|
|
}
|
|
</script>
|
|
</div> |