125 lines
6.2 KiB
HTML
125 lines
6.2 KiB
HTML
<div class="easyui-layout" style="width:100%;height:100%;">
|
|
<div id='southdiv' data-options="region:'south'" style="height:50px;text-align:center;padding:5px">
|
|
<a href="javascript:void(0)" iconCls="fa-check" class="easyui-linkbutton" onclick="kssubmitForm()"
|
|
id="submitb">提交</a>
|
|
<a href="javascript:void(0)" iconCls="fa-close" class="easyui-linkbutton" onclick="closeForm()">取消</a>
|
|
</div>
|
|
<div data-options="region:'center'" style="height:100%;padding:15px 15px;">
|
|
<form id="ksff" method="post" name="ksff" enctype="multipart/form-data">
|
|
<div style="margin-bottom:5px;">
|
|
<input id="name" name="name" class="easyui-textbox" style="width:90%" data-options="label:'考试名称'"
|
|
required=true />
|
|
</div>
|
|
<div style="margin-bottom:5px;">
|
|
<!-- <input id="exampaper" editable="false" name="exampaper" class="easyui-combobox" style="width:90%"
|
|
data-options="label:'选择试卷'" required=true />
|
|
<a id="editpaper" class='easyui-linkbutton' onclick="editpaper()" style="width:auto;display:none" >编辑</a> -->
|
|
|
|
<input id="exampapername" class="easyui-textbox" style="width:90%" data-options="label:'选择试卷'"
|
|
editable=false>
|
|
<input type="hidden" name="exampaper" id="exampaper"/>
|
|
<a id="choseexampaper" class='easyui-linkbutton' onclick="javascript:opendg2('选择试卷','html/exampaper/chose/', 'exampaper')" style="width:auto">选择</a>
|
|
<a id="editpaper" class='easyui-linkbutton' onclick="editpaper()" style="width:auto;display:none" >编辑</a>
|
|
</div>
|
|
<div style="margin-bottom:5px;">
|
|
<input id="totalscore" name="totalscore" class="easyui-numberbox" style="width:90%"
|
|
data-options="label:'满分'" editable=false />
|
|
</div>
|
|
<div style="margin-bottom:5px;">
|
|
<input id="passscore" name="passscore" class="easyui-numberbox" style="width:90%"
|
|
data-options="label:'通过分数'" required=true />
|
|
</div>
|
|
<div style="margin-bottom:5px;">
|
|
<input id="duration" name="duration" class="easyui-numberbox" style="width:90%"
|
|
data-options="label:'答卷时长',prompt:'分钟'" required=true />
|
|
</div>
|
|
<div style="margin-bottom:5px;">
|
|
<input id="starttime" editable="false" name="starttime" class="easyui-datetimebox" style="width:90%"
|
|
data-options="label:'最早参加',currentText:'今天',closeText:'关闭',showSeconds: false,required:true" />
|
|
</div>
|
|
<div style="margin-bottom:5px;">
|
|
<input id="endtime" editable="false" name="endtime" class="easyui-datetimebox" style="width:90%"
|
|
data-options="label:'最迟参加',currentText:'今天',closeText:'关闭',showSeconds: false,required:true" />
|
|
</div>
|
|
<div style="margin-bottom:5px;">
|
|
<input id="testnum" name="testnum" class="easyui-numberbox" style="width:90%"
|
|
data-options="label:'考试机会',prompt:'次数',min:1" required=true value="10"/>
|
|
</div>
|
|
<div style="margin-bottom:5px;">
|
|
<label>是否公开</label>
|
|
<input id="ispublicbutton" class="easyui-switchbutton" data-options="onText:'公开',offText:'不公开'" style="width: 80px;">
|
|
<input id="ispublic" name="ispublic" value="yes" type="hidden"></input>
|
|
</div>
|
|
<div style="margin-bottom:5px" id="choosediv">
|
|
<input class="easyui-textbox" id="participantname" style="width:500px;height:120px" editable="false"
|
|
data-options="label:'通知人员',multiline:true,prompt:'请选择'" >
|
|
<input type="hidden" id="participant" name="participant" />
|
|
<a class='easyui-linkbutton' onclick="choseusers()" style="width:auto">选择</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
$('#choosediv').hide()
|
|
$('#ispublicbutton').switchbutton({
|
|
checked: true,
|
|
onChange: function(checked){
|
|
if (checked == true){
|
|
$('#ispublic').val('yes')
|
|
$('#choosediv').hide()
|
|
}
|
|
if (checked == false){
|
|
$('#ispublic').val('no')
|
|
$('#choosediv').show()
|
|
}
|
|
}
|
|
|
|
})
|
|
function kssubmitForm() {
|
|
if($('#ispublic').val()=='yes'){
|
|
$('#participant').val('')
|
|
}
|
|
var ksdata = $('#ksff').serializeJSON();
|
|
$.ajax({
|
|
type: "POST",
|
|
url: 'api/examtest?a=add',
|
|
data: JSON.stringify(ksdata),
|
|
datatype: "json",
|
|
processData: false,
|
|
contentType: "application/json;charset=utf-8",
|
|
beforeSend: function () {
|
|
var bo = $('#ksff').form('validate')
|
|
if (bo == false) {
|
|
return bo
|
|
} else {
|
|
$('#submitb').linkbutton('disable');
|
|
}
|
|
},
|
|
success: function (data) {
|
|
if (data.code == 1) {
|
|
$('#kstable').datagrid('reload');
|
|
$("#dd").dialog("close");
|
|
} else { $.messager.alert('提示', '失败!'); }
|
|
$('#submitb').linkbutton('enable');
|
|
},
|
|
});
|
|
}
|
|
function editpaper(){
|
|
var id=$('#exampaper').combobox('getValue')
|
|
var url = 'html/exampaper/edit/?id' + id
|
|
var myw = screen.availWidth * 0.7;
|
|
opendg2('编辑试卷',url,myw)
|
|
}
|
|
function aaa(x) {
|
|
if (x == "participant") {
|
|
$('#participant').attr('value', top.$('#in').val());
|
|
$('#participantname').textbox('setValue', top.$('#in').attr('show'));
|
|
$('#participantnum').textbox('setValue', top.$('#in').attr('total'));
|
|
}
|
|
else if (x == "exampaper") {
|
|
$('#exampaper').attr('value', top.$('#in').val());
|
|
$('#exampapername').textbox('setValue', top.$('#in').attr('show'));
|
|
$('#totalscore').numberbox('setValue', top.$('#in').attr('show2'))
|
|
}
|
|
}
|
|
</script> |