first commit
This commit is contained in:
834
WebRoot/jsp/question/displayexam.jsp
Normal file
834
WebRoot/jsp/question/displayexam.jsp
Normal file
@ -0,0 +1,834 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
|
||||
.hiddenscroll::-webkit-scrollbar{
|
||||
display: none;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doupdate() {
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/exam/examplan/updateExamPlan.do", $("#editForm").serialize(), function (result) {
|
||||
if (result == 1) {
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (result == 0) {
|
||||
showAlert('d', '用户信息保存失败');
|
||||
} else {
|
||||
showAlert('d', result);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#editForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
passscore: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '及格分数不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
examnum: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '允许考试次数不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '允许考试次数必须为数字'
|
||||
}
|
||||
}
|
||||
},
|
||||
// releasetime: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '发布时间不能为空'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// startdate: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '考试开始日期不能为空'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// enddate: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '考试结束日期不能为空'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
examminutes: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '考试时间(分钟)不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '考试时间(分钟)必须为数字'
|
||||
}
|
||||
}
|
||||
},
|
||||
examuserids: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '考试人员不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
var addDetailFun = function() {
|
||||
var questitleid=$('#id').val();
|
||||
// stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/exam/examTitleRange/showExamTitleRangeAdd.do' ,{questitleid:questitleid}, function(data) {
|
||||
$("#subDetailDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editDetailFun = function(id) {
|
||||
// stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/exam/examTitleRange/showExamTitleRangeEdit.do', {id:id} , function(data) {
|
||||
$("#subDetailDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
};
|
||||
var deleteDetailFun = function(id) {
|
||||
// stopBubbleDefaultEvent();
|
||||
if(confirm("信息删除后不能恢复,请问要执行删除操作吗?")){
|
||||
$.post(ext.contextPath + '/exam/examTitleRange/deleteExamTitleRange.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertDetaildiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var deletesDetailFun = function() {
|
||||
var checkedItems = $("#table_Detail").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertDetaildiv');
|
||||
}else{
|
||||
if(confirm("信息删除后不能恢复,请问要执行删除操作吗?")){
|
||||
$.post(ext.contextPath + '/exam/examTitleRange/deleteExamTitleRanges.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertDetaildiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= $("#examuserids").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"editForm",hiddenId:"examuserids",textId:"_auditMan",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var typechange = function(){
|
||||
if($("#examtype").val()=="正式考试"){
|
||||
$("#frequency-div").hide();
|
||||
// $("#frequency").attr("value","");
|
||||
}else if($("#examtype").val()=="模拟考试"){
|
||||
$("#frequency-div").show();
|
||||
}
|
||||
}
|
||||
|
||||
//下一题
|
||||
var donext = function() {
|
||||
var quesnum = $("#quesnum");
|
||||
$.post(ext.contextPath + '/exam/examrecord/donext.do', {quesnum:quesnum} , function(data) {
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
//初始化题目
|
||||
var init = function(){
|
||||
var quesnum = $("#quesnum");
|
||||
var examrecordid = $('#examrecordid');
|
||||
// console.log(quesnum);
|
||||
// console.log(examrecordid);
|
||||
$.post(ext.contextPath + '/exam/examrecord/doexamhtml.do', {quesnum:quesnum,examrecordid:examrecordid} , function(data) {
|
||||
$('#examhtml').html(data);
|
||||
});
|
||||
};
|
||||
// 保存用户答案
|
||||
var saveanswer = function(){
|
||||
var quesid = $("#quesid").val();
|
||||
var examrecordid = $('#examrecordid').val();
|
||||
var questype = $('#questype').val();
|
||||
var useranswer = '';
|
||||
// console.log(questype);
|
||||
if(questype == '填空题'){
|
||||
// console.log("1");
|
||||
useranswer= $('#useranswer').val();
|
||||
// console.log(useranswer);
|
||||
}else{
|
||||
var id_array=new Array();
|
||||
$('input[name="option"]:checked').each(function(){
|
||||
id_array.push($(this).attr('id'));//向数组中添加元素
|
||||
});
|
||||
useranswer=id_array.join(',');//将数组元素连接起来以构建一个字符串
|
||||
// console.log("2"+useranswer);
|
||||
}
|
||||
$.post(ext.contextPath + '/exam/examrecord/dosaveanswer.do', {quesid:quesid,useranswer:useranswer,questype:questype} , function(data) {
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
切换上下题
|
||||
*/
|
||||
function doSwitch(switchtype){//switchtype为上一个/下一个的切换类型 quesnum 为当前题序号
|
||||
//切换之前先保存用户答案
|
||||
saveanswer();
|
||||
//变色
|
||||
var quescolorid = $('#quesid').val();
|
||||
console.log("-----"+quescolorid);
|
||||
$("#"+quescolorid).css({
|
||||
"border-color":"#568dbd",
|
||||
"background":"#568dbd",
|
||||
});
|
||||
$("#"+quescolorid+"000").css({
|
||||
'color':'white',
|
||||
});
|
||||
|
||||
var quesnum = $('#quesnum').val();
|
||||
var examrecordid = $('#examrecordid').val();
|
||||
// console.log(examrecordid);
|
||||
$.post("<%=request.getContextPath()%>/exam/examrecord/doexamhtml.do",{switchtype:switchtype,quesnum:quesnum,examrecordid:examrecordid},function(data){
|
||||
if(data==1){
|
||||
swal("没有上一道题了");
|
||||
}else if(data == 2){
|
||||
swal("没有下一道题了");
|
||||
// fullscreen();
|
||||
}else{
|
||||
var arr= JSON.parse(data);
|
||||
var questitlediv = '<div>'+arr.quesnum+'、'+arr.quesdescript+'</div>';
|
||||
var questoptiondiv = '';
|
||||
// console.log(arr.rows);
|
||||
if(arr.questype=='填空题'){
|
||||
questoptiondiv += '<div><input type="text" name="useranswer" id="useranswer" style="width: 90%;" value="'+arr.useranswer+'" placeholder="请将正确答案填写此处 多个答案用,隔开"/>'+
|
||||
'</div>';
|
||||
}else if(arr.questype=='多选题'){
|
||||
var array = arr.useranswer.split(",");
|
||||
for(var i = 0;i<arr.rows.length;i++){
|
||||
var count = 0;
|
||||
for(var j = 0;j<array.length;j++){
|
||||
count++;
|
||||
if(arr.rows[i].optionid == array[j]){
|
||||
questoptiondiv += '<div><input type="checkbox" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" checked="checked"/>'+
|
||||
''+arr.rows[i].optionx+'.'+arr.rows[i].optioncontent+'</div>';
|
||||
break;
|
||||
}else{
|
||||
if(count == array.length){
|
||||
questoptiondiv += '<div><input type="checkbox" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" />'+
|
||||
''+arr.rows[i].optionx+'.'+arr.rows[i].optioncontent+'</div>';
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// console.log("aaa"+i);
|
||||
}
|
||||
}else if(arr.questype=='单选题' || arr.questype=='判断题'){
|
||||
for(var i = 0;i<arr.rows.length;i++){
|
||||
if(arr.rows[i].optionid == arr.useranswer){
|
||||
questoptiondiv += '<div><input type="radio" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" checked="checked"/>'+
|
||||
''+arr.rows[i].optionx+'.'+arr.rows[i].optioncontent+'</div>';
|
||||
}else{
|
||||
questoptiondiv += '<div><input type="radio" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" />'+
|
||||
''+arr.rows[i].optionx+'.'+arr.rows[i].optioncontent+'</div>';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$('#questitlediv').html(questitlediv);
|
||||
$('#questoptiondiv').html(questoptiondiv);
|
||||
$("#quesnum").val(arr.quesnum);
|
||||
$("#quesid").val(arr.quesid);
|
||||
$('#questype').val(arr.questype);
|
||||
if(arr.questype=='单选题' || arr.questype=='判断题'){
|
||||
$('#leftquesttype').html(arr.questype+":(每题"+arr.singlyscore+"分,只有一个正确答案)");
|
||||
}else if(arr.questype=='多选题'){
|
||||
$('#leftquesttype').html(arr.questype+":(每题"+arr.singlyscore+"分,有多个正确答案)");
|
||||
}else if(arr.questype=='填空题'){
|
||||
$('#leftquesttype').html(arr.questype+":(每题"+arr.singlyscore+"分,请将答案填写在输入框内并用,隔开)");
|
||||
}
|
||||
// $('#leftquesttype').html(arr.questype);
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
function dojumpques(id){
|
||||
var examrecordid = $('#examrecordid').val();
|
||||
var questitleid = id;
|
||||
$.post(ext.contextPath + '/exam/examrecord/dojumpques.do', {examrecordid:examrecordid,questitleid:questitleid} , function(data) {
|
||||
// console.log(data);
|
||||
var arr= JSON.parse(data);
|
||||
var questitlediv = '<div>'+arr.quesnum+'、'+arr.quesdescript+'</div>';
|
||||
var questoptiondiv = '';
|
||||
console.log(arr.rows);
|
||||
if(arr.questype=='填空题'){
|
||||
questoptiondiv += '<div><input type="text" name="useranswer" id="useranswer" style="width: 90%;" value="'+arr.useranswer+'" placeholder="请将正确答案填写此处 多个答案用,隔开"/>'+
|
||||
'</div>';
|
||||
}else if(arr.questype=='多选题'){
|
||||
var array = arr.useranswer.split(",");
|
||||
for(var i = 0;i<arr.rows.length;i++){
|
||||
var count = 0;
|
||||
for(var j = 0;j<array.length;j++){
|
||||
count++;
|
||||
if(arr.rows[i].optionid == array[j]){
|
||||
questoptiondiv += '<div><input type="checkbox" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" checked="checked"/>'+
|
||||
''+arr.rows[i].optionx+'.'+arr.rows[i].optioncontent+'</div>';
|
||||
break;
|
||||
}else{
|
||||
if(count == array.length){
|
||||
questoptiondiv += '<div><input type="checkbox" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" />'+
|
||||
''+arr.rows[i].optionx+'.'+arr.rows[i].optioncontent+'</div>';
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// console.log("aaa"+i);
|
||||
}
|
||||
}else if(arr.questype=='单选题' || arr.questype=='判断题'){
|
||||
for(var i = 0;i<arr.rows.length;i++){
|
||||
if(arr.rows[i].optionid == arr.useranswer){
|
||||
questoptiondiv += '<div><input type="radio" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" checked="checked"/>'+
|
||||
''+arr.rows[i].optionx+'.'+arr.rows[i].optioncontent+'</div>';
|
||||
}else{
|
||||
questoptiondiv += '<div><input type="radio" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" />'+
|
||||
''+arr.rows[i].optionx+'.'+arr.rows[i].optioncontent+'</div>';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$('#questitlediv').html(questitlediv);
|
||||
$('#questoptiondiv').html(questoptiondiv);
|
||||
$("#quesnum").val(arr.quesnum);
|
||||
$("#quesid").val(arr.quesid);
|
||||
$('#questype').val(arr.questype);
|
||||
if(arr.questype=='单选题' || arr.questype=='判断题'){
|
||||
$('#leftquesttype').html(arr.questype+":(每题"+arr.singlyscore+"分,只有一个正确答案)");
|
||||
}else if(arr.questype=='多选题'){
|
||||
$('#leftquesttype').html(arr.questype+":(每题"+arr.singlyscore+"分,有多个正确答案)");
|
||||
}else if(arr.questype=='填空题'){
|
||||
$('#leftquesttype').html(arr.questype+":(每题"+arr.singlyscore+"分,请将答案填写在输入框内并用,隔开)");
|
||||
}
|
||||
// $('#leftquesttype').html(arr.questype);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//交卷功能
|
||||
var dosendpaper = function() {
|
||||
//交卷之前先保存用户最后一题答案
|
||||
saveanswer();
|
||||
|
||||
var examrecordid = $("#examrecordid").val();
|
||||
|
||||
swal({
|
||||
title: "您确定要交卷吗?",
|
||||
// text:"这将花费大约几秒的时间",
|
||||
dangerMode: true,
|
||||
icon: "warning",
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
|
||||
$.post(ext.contextPath + '/exam/examrecord/dosendpaper.do', {examrecordid:examrecordid} , function(data) {
|
||||
exitfullscreen();
|
||||
swal("交卷成功!");
|
||||
closeModal('subModal');
|
||||
location.reload();
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
//获取当前时间
|
||||
function time() {
|
||||
//获得显示时间的div
|
||||
t_div = document.getElementById('nowtime');
|
||||
var now = new Date()
|
||||
//替换div内容
|
||||
// t_div.innerHTML = "现在是" + now.getFullYear() + "年" + (now.getMonth() + 1) + "月" + now.getDate() + "日" + now.getHours() + "时" + now.getMinutes() + "分" + now.getSeconds() + "秒";
|
||||
var hours = now.getHours();
|
||||
var min = now.getMinutes();
|
||||
var sec = now.getSeconds();
|
||||
if(hours<10){
|
||||
hours = "0"+hours;
|
||||
}
|
||||
if(min<10){
|
||||
min = "0"+min;
|
||||
}
|
||||
if(sec<10){
|
||||
sec = "0"+sec;
|
||||
}
|
||||
t_div.innerHTML = hours + ":" + min + ":" + sec;
|
||||
//等待一秒钟后调用time方法,由于settimeout在time方法内,所以可以无限调用
|
||||
setTimeout(time, 1000);
|
||||
}
|
||||
|
||||
//全屏功能 F11
|
||||
function fullscreen(){
|
||||
//全屏
|
||||
var docElm = document.documentElement;
|
||||
//W3C
|
||||
if(docElm.requestFullscreen) {
|
||||
docElm.requestFullscreen();
|
||||
}
|
||||
|
||||
//FireFox
|
||||
else if(docElm.mozRequestFullScreen) {
|
||||
docElm.mozRequestFullScreen();
|
||||
}
|
||||
|
||||
//Chrome等
|
||||
else if(docElm.webkitRequestFullScreen) {
|
||||
docElm.webkitRequestFullScreen();
|
||||
}
|
||||
|
||||
//IE11
|
||||
else if(elem.msRequestFullscreen) {
|
||||
elem.msRequestFullscreen();
|
||||
}
|
||||
}
|
||||
|
||||
//退出全屏
|
||||
function exitfullscreen(){
|
||||
//W3C
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
}
|
||||
//FireFox
|
||||
else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen();
|
||||
}
|
||||
//Chrome等
|
||||
else if (document.webkitCancelFullScreen) {
|
||||
document.webkitCancelFullScreen();
|
||||
}
|
||||
//IE11
|
||||
else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen();
|
||||
}
|
||||
}
|
||||
|
||||
//题目标记功能
|
||||
function domarkques(){
|
||||
var testpaperid = $('#quesid').val();
|
||||
$.post(ext.contextPath + '/exam/examrecord/domarkques.do', {testpaperid:testpaperid} , function(data) {
|
||||
console.log(data);
|
||||
$("#"+data).css({
|
||||
"border-color":"#E7505A",
|
||||
"background":"#E7505A",
|
||||
});
|
||||
$("#"+data+"000").css({
|
||||
'color':'white',
|
||||
});
|
||||
|
||||
swal("标记成功");
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(function () {
|
||||
// $("#status").select2({ minimumResultsForSearch: -1 }).val("${rankType.status}").trigger("change");
|
||||
// init();
|
||||
time();
|
||||
fullscreen();
|
||||
typechange();
|
||||
|
||||
$("#examtype").change(function(){
|
||||
typechange();
|
||||
})
|
||||
|
||||
$("#startdate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
})
|
||||
$("#enddate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
})
|
||||
|
||||
var examPlanId=$('#id').val();
|
||||
|
||||
});
|
||||
|
||||
function doclose() {
|
||||
exitfullscreen();
|
||||
closeModal('subModal');
|
||||
}
|
||||
|
||||
//退出全屏
|
||||
function exitfullscreen(){
|
||||
//W3C
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
}
|
||||
//FireFox
|
||||
else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen();
|
||||
}
|
||||
//Chrome等
|
||||
else if (document.webkitCancelFullScreen) {
|
||||
document.webkitCancelFullScreen();
|
||||
}
|
||||
//IE11
|
||||
else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="modal fade hiddenscroll" id="subModal">
|
||||
<input type="hidden" name="quesnum" id="quesnum" value="${quesnum}" />
|
||||
<input type="hidden" name="quesid" id="quesid" value="${quesid}" />
|
||||
<input type="hidden" name="questype" id="questype" value="${questype}" />
|
||||
<input type="hidden" name="questitlenum" id="questitlenum" value="${questitlenum}" />
|
||||
<input type="hidden" name="examrecordid" id="examrecordid" value="${examrecordid}" />
|
||||
<input type="hidden" name="examtime" id="examtime" value="${examtime}" />
|
||||
<!-- <input type="hidden" name="questitleid" id="questitleid" value="${questitleid}"> -->
|
||||
<div>
|
||||
<div class="modal-content">
|
||||
<!-- <div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">考试界面</h4>
|
||||
</div> -->
|
||||
<div class="modal-body">
|
||||
<div style="width: 100%;height: 100%;background-color: #568DBD;">
|
||||
<div id="margintopdiv" style="width: 100%;height: 2%;"></div>
|
||||
|
||||
<div id="topdiv" style="width: 100%;height: 10%;">
|
||||
<div style="width:15%;height: 100%;float: left;"></div>
|
||||
<div id="logo" style="width:13%;height: 100%;float: left;">
|
||||
<div style="width: 100%;height:10%;"></div>
|
||||
<div style="width: 100%;height: 80%;">
|
||||
<img src="<%=request.getContextPath()%>/IMG/login/bksw1.png" style="width: 100%;height: 100%;">
|
||||
</div>
|
||||
</div>
|
||||
<div style="width:0.5%;height:100%;float:left;"></div>
|
||||
<div style="width:0.1%;height:100%;float:left;background-color:#EEEEEE"></div>
|
||||
<div style="width:0.5%;height:100%;float:left;color: white;"></div>
|
||||
<div id="logotitle" style="width:28%;height: 100%;float: left;">
|
||||
<div style="width: 100%;height: 34%;color: white;font-weight: 600;font-size: x-large;">
|
||||
北 控 水 务 集 团 有 限 公 司
|
||||
</div>
|
||||
<div style="width: 100%;height: 32%;"></div>
|
||||
<div style="width: 100%;height: 34%;color: white;font-weight: 600;font-size: x-large;">
|
||||
广东业务区技能实训平台应知考试
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 26%;height: 100%;float: left;">
|
||||
</div>
|
||||
<div style="width: 15%;height: 100%;float: left;">
|
||||
<div style="width: 100%;height: 35%;color: white;font-weight: 900;font-size: medium;">
|
||||
<div style="width: 80%;height: 100%;float: left;">考生编号 : ${examusernumber}</div>
|
||||
<div style="width: 20%;height: 100%;float: left;">
|
||||
<button type="button" class="btn btn-danger" onclick="doclose()">关闭</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div style="width: 100%;height: 50%;color: white;font-weight: 900;font-size: medium;">
|
||||
考生姓名 : ${examusername}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="maindiv" style="width: 100%;height: 90%;">
|
||||
<div id="marginleft" style="width: 2%;height:100%;float: left;"></div>
|
||||
<div id="leftmain" style="width:78%;height: 100%;float: left;">
|
||||
<div id="lefttop" style="width: 100%;height:2.5%;text-align: right;color: blanchedalmond;">
|
||||
考试类别:${examtype}
|
||||
</div>
|
||||
|
||||
<div id="leftmid" style="width:100%;height:90.5%;">
|
||||
<!-- <div style="width: 100%;height: 2.5%;"></div> -->
|
||||
<div id="lefttitle" style="width: 100%;height: 5%;background-color: white;color: #568DBD;text-align: center;font-weight: 600;font-size: x-large;">${examname}</div>
|
||||
|
||||
<div id="leftquesttype" style="width: 100%;height: 3%;background-color:#EBEBEB;color: black;text-align: left;font-weight: 600;">
|
||||
<c:if test="${questype == '判断题'}">
|
||||
${questype}:(每题${singlyscore}分,只有一个正确答案)
|
||||
</c:if>
|
||||
<c:if test="${questype == '单选题'}">
|
||||
${questype}:(每题${singlyscore}分,只有一个正确答案)
|
||||
</c:if>
|
||||
<c:if test="${questype == '多选题'}">
|
||||
${questype}:(每题${singlyscore}分,有多个正确答案)
|
||||
</c:if>
|
||||
<c:if test="${questype == '填空题'}">
|
||||
${questype}:(每题${singlyscore}分,请将答案填写在输入框内并用,隔开)
|
||||
</c:if>
|
||||
|
||||
</div>
|
||||
<!--竖版-->
|
||||
<!-- <div id="leftques" style="width: 100%;height: 92.5%;">
|
||||
<div id="questitledivout" style="width: 24%;height: 100%;background-color: white;float: left;">
|
||||
<div style="width: 10%;height: 100%;float: left;"></div>
|
||||
<div style="width: 80%;height: 100%;float: left;">
|
||||
<div style="width: 100%;height: 20%;"></div>
|
||||
<div id="questitlediv" style="width: 100%;height: 60%;font-size: x-large;"> ${quesnum}、${questitlelist.quesdescript} </div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div style="width:1%;height: 100%;background-color: #EBEBEB;float: left;"></div>
|
||||
<div id="questoptiondivout" style="width: 75%;height: 100%;background-color: white;float: left;">
|
||||
<div style="width: 10%;height: 100%;float: left;"></div>
|
||||
<div style="width: 80%;height: 100%;float: left;">
|
||||
<div style="width: 100%;height: 20%;"></div>
|
||||
<div id="questoptiondiv" style="width: 100%;height: 60%;font-size: x-large;">
|
||||
判断填空题
|
||||
<c:if test="${questypename == '填空题'}">
|
||||
<div>
|
||||
<input type="text" name="useranswer" id="useranswer" style="width: 90%;" value="" placeholder="请将正确答案填写此处 多个答案用,隔开"/>'+
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${questypename == '多选题'}">
|
||||
<c:forEach var="quesoptionlist" items="${quesoptionlist}">
|
||||
<div>
|
||||
<input type="checkbox" name="option" id="${quesoptionlist.optionid}" value="${quesoptionlist.optionid}" style="zoom: 140%;"/>
|
||||
${quesoptionlist.optioncontent}
|
||||
</div>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${questypename == '单选题' || questypename == '判断题'}">
|
||||
<c:forEach var="quesoptionlist" items="${quesoptionlist}">
|
||||
<div>
|
||||
<input type="radio" name="option" id="${quesoptionlist.optionid}" value="${quesoptionlist.optionid}" style="zoom: 140%;"/>
|
||||
${quesoptionlist.optioncontent}
|
||||
</div>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!--横版-->
|
||||
<div id="leftques" style="width: 100%;height: 92.5%;background-color: white;">
|
||||
<div style="width: 10%;height: 100%;float: left;"></div>
|
||||
<div style="width: 80%;height: 100%;float: left;">
|
||||
<div style="width: 100%;height: 10%;"></div>
|
||||
<div id="questitlediv" style="width: 100%;height: auto; min-height:15%;font-size: x-large;border-bottom: 3px solid #EBEBEB;">${quesnum}、${questitlelist.quesdescript}</div>
|
||||
<!-- <div style="width: 100%;height: 0.5%;background-color: #EBEBEB;"></div> -->
|
||||
<div style="width: 100%;height: 5%;"></div>
|
||||
<div id="questoptiondiv" style="width:100%;height:60%;font-size: x-large;">
|
||||
<!--判断填空题-->
|
||||
<c:if test="${questypename == '填空题'}">
|
||||
<div>
|
||||
<input type="text" name="useranswer" id="useranswer" style="width: 90%;" value="" placeholder="请将正确答案填写此处 多个答案用,隔开"/>'+
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${questypename == '多选题'}">
|
||||
<c:forEach var="quesoptionlist" items="${quesoptionlist}">
|
||||
<div>
|
||||
<input type="checkbox" name="option" id="${quesoptionlist.optionid}" value="${quesoptionlist.optionid}" style="zoom: 140%;"/>
|
||||
${quesoptionlist.optionx}.${quesoptionlist.optioncontent}
|
||||
</div>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${questypename == '单选题' || questypename == '判断题'}">
|
||||
<c:forEach var="quesoptionlist" items="${quesoptionlist}">
|
||||
<div>
|
||||
<input type="radio" name="option" id="${quesoptionlist.optionid}" value="${quesoptionlist.optionid}" style="zoom: 140%;"/>
|
||||
${quesoptionlist.optionx}.${quesoptionlist.optioncontent}
|
||||
</div>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="marginmid" style="width:2%;height:100%;float:left;"></div>
|
||||
|
||||
<div id="rightmain" style="width: 16%;height: 100%;float: left;">
|
||||
<div id="lefttop" style="width: 100%;height:4%;"></div>
|
||||
|
||||
<div style="width: 100%;height:2%;color: white;">北京时间</div>
|
||||
<div id="nowtime" style="width: 100%;height:5%;color: white;font-weight: 600;"></div>
|
||||
<div style="width:100%;height:2%;color: white;">剩余时间</div>
|
||||
<div id="timer" style="width:100%;height:5%;color: white;font-weight: 600;"></div>
|
||||
<!-- 题目跳转卡片 -->
|
||||
<!-- <div id="selectques" style="width: 100%;height: 50%;cursor: pointer;" onclick="doSwitch('prev')">
|
||||
<img src="<%=request.getContextPath()%>/IMG/main/selectques.png" style="width: 100%;height: 100%;">
|
||||
</div> -->
|
||||
|
||||
<div id="selectques" style="width: 100%;height: 56%;background-color: #EBEBEB;">
|
||||
<div style="width: 1%;height: 100%;float: left;"></div>
|
||||
|
||||
<div style="width: 98%;height: 100%;float: left;">
|
||||
<div style="width: 100%;height: 1%;"></div>
|
||||
|
||||
|
||||
<div class="hiddenscroll" style="width: 100%;height: 98%;overflow-x: hidden;overflow-y: auto;word-break: break-all;word-wrap: break-word;">
|
||||
<!-- 循环题型 -->
|
||||
<c:forEach var="selectcard" items="${selectcard}">
|
||||
<div style="width: 100%;">${selectcard.ord}、${selectcard.questypename}(共${selectcard.questypenum}题)</div>
|
||||
<div style="width: 100%;height: auto;background-color: white;">
|
||||
<!-- <div style="width: 100%;height: 10%;"></div> -->
|
||||
<div class="hiddenscroll" style="width:100%;overflow-x: hidden;overflow-y: auto;word-break: break-all;word-wrap: break-word;">
|
||||
<c:forEach var="selecttitlelist" items="${selectcard.selecttitlelist}">
|
||||
<div id="${selecttitlelist.questitleid}" class="cricle" style="border-style:solid;border-color:#568DBD;border-width:1px;border-radius: 50%;height: 28px;width: 12%;margin: 2% 3.5%;display: inline-block;background: #FFFFFF;vertical-align: top;cursor: pointer;" onclick="dojumpques('${selecttitlelist.questitleid}')">
|
||||
<div id="${selecttitlelist.questitleid}000" style="display: block;color: #568DBD;height: 20px;line-height: 28px;text-align: center">${selecttitlelist.questitlenum}</div>
|
||||
</div>
|
||||
</c:forEach>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</c:forEach>
|
||||
|
||||
</div>
|
||||
|
||||
<div style="width: 100%;height: 1%;"></div>
|
||||
</div>
|
||||
|
||||
<div style="width: 1%;height: 100%;float: left;"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div style="width:100%;height:2%"></div>
|
||||
|
||||
<div style="width:100%;height:5%;cursor: pointer;" onclick="domarkques()">
|
||||
<img src="<%=request.getContextPath()%>/IMG/main/mark.png" style="width: 35%;height: 100%;">
|
||||
</div>
|
||||
<div style="width:100%;height:1.3%"></div>
|
||||
<div style="width:100%;height:5%;cursor: pointer;" onclick="doSwitch('next')">
|
||||
<img src="<%=request.getContextPath()%>/IMG/main/nextques.png" style="width: 35%;height: 100%;">
|
||||
</div>
|
||||
<div style="width:100%;height:1.3%"></div>
|
||||
<div style="width:100%;height:5%;cursor: pointer;" onclick="dosendpaper()">
|
||||
<img src="<%=request.getContextPath()%>/IMG/main/sendpaper.png" style="width: 35%;height: 100%;">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <div id="examhtml">
|
||||
<div>
|
||||
${quesnum}、${questitlelist.quesdescript}
|
||||
</div>
|
||||
<c:forEach var="quesoptionlist" items="${quesoptionlist}">
|
||||
<div>
|
||||
<input type="checkbox" name="option" id="${quesoptionlist.optionid}" value="${quesoptionlist.optionid}" />
|
||||
${quesoptionlist.optioncontent}
|
||||
</div>
|
||||
</c:forEach>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- <div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosendpaper()">交卷</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSwitch('prev')">上一题</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSwitch('next')">下一题</button>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
<script>
|
||||
//倒计时功能
|
||||
var oBox= document.getElementById('timer');
|
||||
var maxtime = $("#examtime").val() * 60;
|
||||
function CountDown() {
|
||||
if (maxtime >= 0) {
|
||||
minutes = Math.floor(maxtime / 60);
|
||||
seconds = Math.floor(maxtime % 60);
|
||||
if(minutes < 10){
|
||||
minutes = "0"+minutes;
|
||||
}
|
||||
if(seconds < 10){
|
||||
seconds = "0"+seconds;
|
||||
}
|
||||
msg = minutes + ":" + seconds ;
|
||||
oBox.innerHTML = msg;
|
||||
if (maxtime == 5 * 60)swal("还剩5分钟!请考生仔细检查试卷");
|
||||
--maxtime;
|
||||
} else{
|
||||
clearInterval(timer);
|
||||
swal("时间到,考试结束!");
|
||||
closeModal('subModal');
|
||||
}
|
||||
}
|
||||
timer = setInterval("CountDown()", 1000);
|
||||
|
||||
</script>
|
||||
100
WebRoot/jsp/question/quesImport.jsp
Normal file
100
WebRoot/jsp/question/quesImport.jsp
Normal file
@ -0,0 +1,100 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.tools.CommUtil"%>
|
||||
<%request.setAttribute("nowDate", CommUtil.nowDate().replaceAll("[[\\s-:punct:]]","")); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var control;
|
||||
function initUpload(ctrlName, uploadUrl) {
|
||||
control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync: true, //默认异步上传
|
||||
showCaption: true,//是否显示标题
|
||||
showUpload: false, //是否显示上传按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
allowedFileExtensions: ["xls", "xlsx"], //接收的文件后缀
|
||||
maxFileCount: 1,//最大上传文件数限制
|
||||
previewFileIcon: '<i class="glyphicon glyphicon-file"></i>',
|
||||
showPreview: false, //是否显示预览
|
||||
previewFileIconSettings: {
|
||||
'docx': '<i ass="fa fa-file-word-o text-primary"></i>',
|
||||
'xlsx': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o text-danger"></i>',
|
||||
'jpg': '<i class="fa fa-file-photo-o text-warning"></i>',
|
||||
'pdf': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
'zip': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
},
|
||||
//参数
|
||||
// uploadExtraData: function () {
|
||||
// var data = {
|
||||
// "companyId": '${param.companyId}', //此处自定义传参
|
||||
// };
|
||||
// return data;
|
||||
// }
|
||||
});
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if(data.response.status == true){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
swal({
|
||||
text: data.response.msg,
|
||||
closeOnClickOutside: false,
|
||||
});
|
||||
showAlert('s',data.response.msg,'mainAlertdiv');
|
||||
}else{
|
||||
swal(data.response.msg);
|
||||
showAlert('d',data.response.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function(){
|
||||
initUpload("filelist", ext.contextPath+ "/question/quesTitle/saveExcelData.do");
|
||||
})
|
||||
//导入上传文件的数据
|
||||
function importExcelFun(){
|
||||
if($("#filelist").val() == null || $("#filelist").val()==""){
|
||||
showAlert('d','上传的文件不能为空!');
|
||||
}else{
|
||||
control.fileinput("upload");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">导入题库</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="importFile" name="importFile" class="form-horizontal" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="box-body">
|
||||
<div>
|
||||
<input id="filelist" name="filelist" class="file-loading" type="file" multiple accept=".xls,.xlsx">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="importExcelFun()" id="btn_save">导入</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
107
WebRoot/jsp/question/quesOptionAdd.jsp
Normal file
107
WebRoot/jsp/question/quesOptionAdd.jsp
Normal file
@ -0,0 +1,107 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
// $("#subForm").bootstrapValidator('validate');//提交验证
|
||||
// if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/question/quesOption/saveQuesOption.do", $("#subForm2").serialize(), function(data) {
|
||||
if (data == 1){
|
||||
closeModal('subDetailModal');
|
||||
$(".modal-backdrop").remove();
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else if(data == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
// }
|
||||
}
|
||||
|
||||
function doclose() {
|
||||
closeModal('subDetailModal');
|
||||
}
|
||||
//输入框验证
|
||||
// $("#subForm").bootstrapValidator({
|
||||
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
// fields: {
|
||||
// project: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '名称不能为空'
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subDetailModal" style="width: 800px;">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm2">
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" id="questitleid" name="questitleid" value ="${questitleid}">
|
||||
<label class="col-sm-2 control-label">选项答案</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="optionvalue" class="form-control pull-right" name="optionvalue" >
|
||||
<option value="T">正确</option>
|
||||
<option value="F">错误</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">选项编码</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="optionnumber" name="optionnumber" class="form-control pull-right" placeholder="选项编码">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">选项内容</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="textarea" id="optioncontent" name="optioncontent" class="form-control pull-right" placeholder="选项内容">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">排序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="optionord" name="optionord" class="form-control pull-right" placeholder="排序">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">状态</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="optionstatus" class="form-control pull-right" name="optionstatus" >
|
||||
<option value="启用">启用</option>
|
||||
<option value="禁用">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" onclick="doclose()">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
106
WebRoot/jsp/question/quesOptionEdit.jsp
Normal file
106
WebRoot/jsp/question/quesOptionEdit.jsp
Normal file
@ -0,0 +1,106 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
// $("#subForm2").bootstrapValidator('validate');//提交验证
|
||||
// if ($("#subForm2").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/question/quesOption/updateQuesOption.do", $("#subForm2").serialize(), function(data) {
|
||||
if (data == 1){
|
||||
closeModal('subDetailModal');
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else if(data == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data);
|
||||
}
|
||||
},'json');
|
||||
// }
|
||||
}
|
||||
// //输入框验证
|
||||
// $("#subForm2").bootstrapValidator({
|
||||
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
// fields: {
|
||||
// project: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '名称不能为空'
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
//
|
||||
|
||||
function doclose() {
|
||||
closeModal('subDetailModal');
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subDetailModal" style="width: 800px;">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm2">
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" id="quesOptionid" name="quesOptionid" value ="${quesOption.id}">
|
||||
<label class="col-sm-2 control-label">选项答案</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="optionvalue" class="form-control pull-right" name="optionvalue" >
|
||||
<option value="T" <c:if test="${quesOption.optionvalue=='T'}">selected</c:if>>正确</option>
|
||||
<option value="F" <c:if test="${quesOption.optionvalue=='F'}">selected</c:if>>错误</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">选项编码</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="optionnumber" name="optionnumber" class="form-control pull-right" placeholder="选项编码" value ="${quesOption.optionnumber}">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">选项内容</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="textarea" id="optioncontent" name="optioncontent" class="form-control pull-right" placeholder="选项内容" value ="${quesOption.optioncontent}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">排序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="optionord" name="optionord" class="form-control pull-right" placeholder="排序" value ="${quesOption.ord}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">状态</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="optionstatus" class="form-control pull-right" name="optionstatus" >
|
||||
<option value="启用" <c:if test="${quesOption.status=='启用'}">selected</c:if>>启用</option>
|
||||
<option value="禁用" <c:if test="${quesOption.status=='禁用'}">selected</c:if>>禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" onclick="doclose()">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
388
WebRoot/jsp/question/quesTitleAdd.jsp
Normal file
388
WebRoot/jsp/question/quesTitleAdd.jsp
Normal file
@ -0,0 +1,388 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
/* table[ip] tr th,table[ip] tr td{
|
||||
border: 1px solid grey;
|
||||
text-align: center;
|
||||
height: 30px;
|
||||
width:25%;
|
||||
} */
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dodevicesave() {
|
||||
if($('#search_pid2').val()==null||$('#search_pid2').val()==''){
|
||||
showAlert('d','请选择工作领域','alertDiv');
|
||||
return;
|
||||
}
|
||||
if($('#ranktype').val()==null||$('#ranktype').val()==''){
|
||||
showAlert('d','请选择题目难度','alertDiv');
|
||||
return;
|
||||
}
|
||||
if($('#questtype').val()==null||$('#questtype').val()==''){
|
||||
showAlert('d','请选择题目类型','alertDiv');
|
||||
return;
|
||||
}
|
||||
if($('#quesdescript').val()==null||$('#quesdescript').val()==''){
|
||||
showAlert('d','请输入题目描述','alertDiv');
|
||||
return;
|
||||
}
|
||||
$.post(ext.contextPath + "/question/quesTitle/saveQuesTitle.do", $("#subForm").serialize(), function(data) {
|
||||
if (data == 1) {
|
||||
// closeModal('subModal');
|
||||
// console.log("ok");
|
||||
$("#table").bootstrapTable('refresh');
|
||||
document.getElementById("subModal").setAttribute("class", "modal hidden fade");
|
||||
$(".modal-backdrop").remove();
|
||||
}else if(data == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
var addDetailFun = function() {
|
||||
var questitleid=$('#id').val();
|
||||
// stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/question/quesOption/showQuesOptionAdd.do' ,{questitleid:questitleid}, function(data) {
|
||||
$("#subDetailDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editDetailFun = function(id) {
|
||||
// stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/question/quesOption/showQuesOptionEdit.do', {id:id} , function(data) {
|
||||
$("#subDetailDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deleteDetailFun = function(id) {
|
||||
// stopBubbleDefaultEvent();
|
||||
if(confirm("信息删除后不能恢复,请问要执行删除操作吗?")){
|
||||
$.post(ext.contextPath + '/question/quesOption/deleteQuesOption.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertDetaildiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var deletesDetailFun = function() {
|
||||
var checkedItems = $("#table_Detail").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertDetaildiv');
|
||||
}else{
|
||||
if(confirm("信息删除后不能恢复,请问要执行删除操作吗?")){
|
||||
$.post(ext.contextPath + '/question/quesOption/deleteQuesOptions.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertDetaildiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$(function() {
|
||||
//树(工作领域)
|
||||
$.post(ext.contextPath + '/question/subjecttype/getSubjecttypeJson.do', { ng: '' }, function (data) {
|
||||
//console.log("data",data[0]);
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#search_pid2").val(data[0].id);
|
||||
$("#companyselect2").hide();
|
||||
$("#companyName2").text("公司:" + data[0].text);
|
||||
// showtable();
|
||||
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
// $("#search_pid2").val(data[0].id);
|
||||
// $("#cname_input2").val(data[0].text);
|
||||
// showtable();
|
||||
//$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
$('#companytree2').treeview({
|
||||
data: data,
|
||||
showBorder: false,
|
||||
levels: 2
|
||||
});
|
||||
$('#companytree2').on('nodeSelected', function (event, data) {
|
||||
var nodesnum=0;
|
||||
if(data.nodes!=null){
|
||||
nodesnum=data.nodes.length;
|
||||
}else{
|
||||
nodesnum=nodesnum;
|
||||
}
|
||||
|
||||
if(nodesnum==0){
|
||||
$("#search_pid2").val(data.id);
|
||||
$("#cname_input2").val(data.text);
|
||||
document.getElementById('company_select2').style.display = "none";
|
||||
$("ul#company_select2").hide();
|
||||
}
|
||||
// $("ul#company_select2").hide();
|
||||
});
|
||||
} else {
|
||||
//待完善
|
||||
};
|
||||
}, 'json');
|
||||
|
||||
//防止点击树收起下拉框
|
||||
$("#company_select2").on("click", function (e) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
//点击树之外其他区域收起
|
||||
$(document).click(function(){
|
||||
$("#company_select2").hide();
|
||||
});
|
||||
//
|
||||
//题目难度搜索
|
||||
$.post(ext.contextPath + "/question/ranktype/getRankType4Select.do", {}, function (data) {
|
||||
var select = $("#ranktype").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' })
|
||||
select.val('').trigger("change");
|
||||
select.on("change", function (e) {
|
||||
//console.log($("#equipmentCardClass").val());
|
||||
});
|
||||
}, 'json');
|
||||
//题目类型搜索
|
||||
$.post(ext.contextPath + "/question/questtype/getQuestType4Select.do", {}, function (data) {
|
||||
var select = $("#questtype").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' })
|
||||
select.val('').trigger("change");
|
||||
select.on("change", function (e) {
|
||||
//console.log($("#equipmentCardClass").val());
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
|
||||
|
||||
var questitleid=$('#id').val();
|
||||
$("#table_Detail").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/question/quesOption/getQuesOptionList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 5, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
paginationDetailHAlign:' hidden',//去除分页的显示
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
questitleid: questitleid
|
||||
}
|
||||
},
|
||||
sortName: 'ord', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'optionvalue', // 返回json数据中的name
|
||||
title: '选项答案', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if(value=="T"){
|
||||
return "正确";
|
||||
}else if(value=="F"){
|
||||
return "错误";
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'optioncontent', // 返回json数据中的name
|
||||
title: '选项内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居h中
|
||||
width: '30%'
|
||||
},{
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '10%'
|
||||
},{
|
||||
field: 'ord', // 返回json数据中的name
|
||||
title: '顺序', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '10%'
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts= '';
|
||||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editDetailFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteDetailFun(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_Detail");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
},
|
||||
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content" style="width: 800px;">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增题目</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" enctype="multipart/form-data" >
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<input type="hidden" id="id" name="id" value="${quesTitleid}">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-3" style="margin-top: -0.8%;margin-right: 0.5%;">
|
||||
<input id="search_pid2" name="search_pid2" type="hidden" />
|
||||
<span id="companyName2" style="width:220px;border: none;background: transparent;"></span>
|
||||
<ul class="col-lg-5 col-md-5 col-sm-5 col-xs-5" id="companyselect2" style="list-style-type:none;padding-left:10px;margin-top:8px;width:170px;">
|
||||
<li class="dropdown messages-menu" >
|
||||
<!-- Menu toggle button -->
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style="width:80px;"
|
||||
onclick="document.getElementById('company_select2').style.display = 'block';">
|
||||
<div class="input-group" style="height: 25px">
|
||||
<span class="input-group-addon" style="height:25px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold">问卷类型:</span>
|
||||
<input class="form-control " id="cname_input2" name="cname_input2" style="height:28px;width:120px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;text-align:center;"
|
||||
readonly />
|
||||
</div>
|
||||
</a>
|
||||
<ul id="company_select2" class="dropdown-menu" data-stopPropagation="true">
|
||||
<li>
|
||||
<!-- <a href="javascript:company_selectchange();"> -->
|
||||
<!-- -->
|
||||
<div id="companytree2" style="width: 275px;overflow:auto;"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<label class="col-sm-2 control-label">题目难度</label>
|
||||
<div class="col-sm-2">
|
||||
<select type="text" id="ranktype" class="form-control pull-right" name="ranktype" style="width: 160px">
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">题目类型</label>
|
||||
<div class="col-sm-2">
|
||||
<select type="text" id="questtype" class="form-control pull-right" name="questtype" style="width: 160px">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">题目描述</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="textarea" id="quesdescript" name="quesdescript" class="form-control pull-right" placeholder="题目描述">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">状态</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="status" class="form-control pull-right" name="status" >
|
||||
<option value="启用">启用</option>
|
||||
<option value="禁用">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<%--<div class="form-group">
|
||||
<label class="col-sm-2 control-label">考核点</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="testpoint" name ="testpoint" placeholder="考核点" value="${quesTitle.testpoint}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">试题解析</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="analysis" name ="analysis" placeholder="试题解析" value="${quesTitle.analysis}"></textarea>
|
||||
</div>
|
||||
</div>--%>
|
||||
</form>
|
||||
|
||||
<div class="box box-primary" >
|
||||
<div id="mainAlertDetaildiv"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">题目选项</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deletesDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<table id="table_Detail" data-use-row-attr-func="true" data-reorderable-rows="true"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dodevicesave()" >保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
398
WebRoot/jsp/question/quesTitleEdit.jsp
Normal file
398
WebRoot/jsp/question/quesTitleEdit.jsp
Normal file
@ -0,0 +1,398 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
/* table[ip] tr th,table[ip] tr td{
|
||||
border: 1px solid grey;
|
||||
text-align: center;
|
||||
height: 30px;
|
||||
width:25%;
|
||||
} */
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
function dodevicesave() {
|
||||
if($('#search_pid2').val()==null||$('#search_pid2').val()==''){
|
||||
showAlert('d','请选择工作领域','alertDiv');
|
||||
return;
|
||||
}
|
||||
if($('#ranktype').val()==null||$('#ranktype').val()==''){
|
||||
showAlert('d','请选择题目难度','alertDiv');
|
||||
return;
|
||||
}
|
||||
if($('#questtype').val()==null||$('#questtype').val()==''){
|
||||
showAlert('d','请选择题目类型','alertDiv');
|
||||
return;
|
||||
}
|
||||
if($('#quesdescript').val()==null||$('#quesdescript').val()==''){
|
||||
showAlert('d','请输入题目描述','alertDiv');
|
||||
return;
|
||||
}
|
||||
$.post(ext.contextPath + "/question/quesTitle/updateQuesTitle.do", $("#subForm").serialize(), function(data) {
|
||||
if (data == 1) {
|
||||
// closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
document.getElementById("subModal").setAttribute("class", "modal hidden fade");
|
||||
$(".modal-backdrop").remove();
|
||||
}else if(data == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
|
||||
var addDetailFun = function() {
|
||||
var questitleid=$('#id').val();
|
||||
// stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/question/quesOption/showQuesOptionAdd.do' ,{questitleid:questitleid}, function(data) {
|
||||
$("#subDetailDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editDetailFun = function(id) {
|
||||
// stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/question/quesOption/showQuesOptionEdit.do', {id:id} , function(data) {
|
||||
$("#subDetailDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deleteDetailFun = function(id) {
|
||||
// stopBubbleDefaultEvent();
|
||||
if(confirm("信息删除后不能恢复,请问要执行删除操作吗?")){
|
||||
$.post(ext.contextPath + '/question/quesOption/deleteQuesOption.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertDetaildiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var deletesDetailFun = function() {
|
||||
var checkedItems = $("#table_Detail").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertDetaildiv');
|
||||
}else{
|
||||
if(confirm("信息删除后不能恢复,请问要执行删除操作吗?")){
|
||||
$.post(ext.contextPath + '/question/quesOption/deleteQuesOptions.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertDetaildiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$(function() {
|
||||
//树(工作领域)
|
||||
$.post(ext.contextPath + '/question/subjecttype/getSubjecttypeJson.do', { ng: '' }, function (data) {
|
||||
//console.log("data",data[0]);
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#search_pid2").val(data[0].id);
|
||||
$("#companyselect2").hide();
|
||||
$("#companyName2").text("公司:" + data[0].text);
|
||||
// showtable();
|
||||
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
// $("#search_pid2").val(data[0].id);
|
||||
// $("#cname_input2").val(data[0].text);
|
||||
// showtable();
|
||||
//$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
$('#companytree2').treeview({
|
||||
data: data,
|
||||
showBorder: false,
|
||||
levels: 2
|
||||
});
|
||||
$('#companytree2').on('nodeSelected', function (event, data) {
|
||||
var nodesnum=0;
|
||||
if(data.nodes!=null){
|
||||
nodesnum=data.nodes.length;
|
||||
}else{
|
||||
nodesnum=nodesnum;
|
||||
}
|
||||
|
||||
if(nodesnum==0){
|
||||
$("#search_pid2").val(data.id);
|
||||
$("#cname_input2").val(data.text);
|
||||
document.getElementById('company_select2').style.display = "none";
|
||||
$("ul#company_select2").hide();
|
||||
}
|
||||
// $("ul#company_select2").hide();
|
||||
});
|
||||
} else {
|
||||
//待完善
|
||||
};
|
||||
}, 'json');
|
||||
|
||||
//防止点击树收起下拉框
|
||||
$("#company_select2").on("click", function (e) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
//点击树之外其他区域收起
|
||||
$(document).click(function(){
|
||||
$("#company_select2").hide();
|
||||
});
|
||||
//
|
||||
//题目难度搜索
|
||||
$.post(ext.contextPath + "/question/ranktype/getRankType4Select.do", {}, function (data) {
|
||||
var select = $("#ranktype").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' })
|
||||
select.on("change", function (e) {
|
||||
//console.log($("#equipmentCardClass").val());
|
||||
});
|
||||
var ranktypeid="${quesTitle.ranktypeid}";
|
||||
select.val(ranktypeid).trigger("change");
|
||||
}, 'json');
|
||||
//题目类型搜索
|
||||
$.post(ext.contextPath + "/question/questtype/getQuestType4Select.do", {}, function (data) {
|
||||
var select = $("#questtype").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' })
|
||||
select.on("change", function (e) {
|
||||
//console.log($("#equipmentCardClass").val());
|
||||
});
|
||||
var questtypeid="${quesTitle.questtypeid}";
|
||||
select.val(questtypeid).trigger("change");
|
||||
}, 'json');
|
||||
|
||||
|
||||
|
||||
var questitleid=$('#id').val();
|
||||
$("#table_Detail").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/question/quesOption/getQuesOptionList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 5, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
paginationDetailHAlign:' hidden',//去除分页的显示
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
questitleid: questitleid
|
||||
}
|
||||
},
|
||||
sortName: 'ord', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'optionvalue', // 返回json数据中的name
|
||||
title: '选项答案', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if(value=="T"){
|
||||
return "正确";
|
||||
}else if(value=="F"){
|
||||
return "错误";
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'optioncontent', // 返回json数据中的name
|
||||
title: '选项内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居h中
|
||||
width: '30%'
|
||||
},{
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '10%'
|
||||
},{
|
||||
field: 'ord', // 返回json数据中的name
|
||||
title: '顺序', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '10%'
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts= '';
|
||||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editDetailFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteDetailFun(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_Detail");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
},
|
||||
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content" style="width: 800px;">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑题目</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" enctype="multipart/form-data" >
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<input type="hidden" id="id" name="id" value="${quesTitle.id}">
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-3" style="margin-top: -0.8%;margin-right: 0.5%;">
|
||||
<input id="search_pid2" name="search_pid2" type="hidden" value ="${quesTitle.subjecttypeid}"/>
|
||||
<span id="companyName2" style="width:220px;border: none;background: transparent;"></span>
|
||||
<ul class="col-lg-5 col-md-5 col-sm-5 col-xs-5" id="companyselect2" style="list-style-type:none;padding-left:10px;margin-top:8px;width:170px;">
|
||||
<li class="dropdown messages-menu" >
|
||||
<!-- Menu toggle button -->
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style="width:80px;"
|
||||
onclick="document.getElementById('company_select2').style.display = 'block';">
|
||||
<div class="input-group" style="height: 25px">
|
||||
<span class="input-group-addon" style="height:25px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold">问卷类型:</span>
|
||||
<input class="form-control " id="cname_input2" name="cname_input2" style="height:28px;width:120px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;text-align:center;"
|
||||
readonly value="${_subjectTypeName}" />
|
||||
</div>
|
||||
</a>
|
||||
<ul id="company_select2" class="dropdown-menu" data-stopPropagation="true">
|
||||
<li>
|
||||
<!-- <a href="javascript:company_selectchange();"> -->
|
||||
<!-- -->
|
||||
<div id="companytree2" style="width: 275px;overflow:auto;"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<label class="col-sm-2 control-label">题目难度</label>
|
||||
<div class="col-sm-2">
|
||||
<select type="text" id="ranktype" class="form-control pull-right" name="ranktype" style="width: 160px">
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">题目类型</label>
|
||||
<div class="col-sm-2">
|
||||
<select type="text" id="questtype" class="form-control pull-right" name="questtype" style="width: 160px">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">题目描述</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="textarea" id="quesdescript" name="quesdescript" class="form-control pull-right" placeholder="题目描述" value ="${quesTitle.quesdescript}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<!-- <label class="col-sm-2 control-label">排序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="ord" name="ord" class="form-control pull-right" placeholder="排序" value ="${quesTitle.ord}">
|
||||
</div> -->
|
||||
<label class="col-sm-2 control-label">状态</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="status" class="form-control pull-right" name="status" >
|
||||
<option value="启用" <c:if test="${quesTitle.status=='启用'}">selected</c:if>>启用</option>
|
||||
<option value="禁用" <c:if test="${quesTitle.status=='禁用'}">selected</c:if>>禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<%--<div class="form-group">
|
||||
<label class="col-sm-2 control-label">考核点</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="testpoint" name ="testpoint" placeholder="考核点">${quesTitle.testpoint}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">试题解析</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="analysis" name ="analysis" placeholder="试题解析">${quesTitle.analysis}</textarea>
|
||||
</div>
|
||||
</div>--%>
|
||||
</form>
|
||||
|
||||
<div class="box box-primary" >
|
||||
<div id="mainAlertDetaildiv"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">题目选项</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deletesDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<table id="table_Detail" data-use-row-attr-func="true" data-reorderable-rows="true"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dodevicesave()" >保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
464
WebRoot/jsp/question/quesTitleList.jsp
Normal file
464
WebRoot/jsp/question/quesTitleList.jsp
Normal file
@ -0,0 +1,464 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html style="height: 100%;">
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<!-- <style type="text/css">
|
||||
.input { padding: 5px; margin: 0; border: 1px solid #beceeb; }
|
||||
.clear { display: none;
|
||||
position: absolute;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin: 6px 0 0 -20px;
|
||||
background: url(../IMG/remove-icon-small.png);}
|
||||
|
||||
.input::-ms-clear { display: none; }
|
||||
.input:valid + .clear { display: inline; }
|
||||
|
||||
</style> -->
|
||||
<title>
|
||||
<%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
.form-group {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/question/quesTitle/showQuesTitleAdd.do', {}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var editFun = function (id) {
|
||||
$.post(ext.contextPath + '/question/quesTitle/showQuesTitleEdit.do', { id: id }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var displayFun = function (id) {
|
||||
$.post(ext.contextPath + '/question/quesTitle/dodisplayexam.do', { questitleid: id }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var deleteFun = function (id) {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/question/quesTitle/deleteQuesTitle.do', { id: id }, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
swal({
|
||||
text: "您确定要删除这些记录吗?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/question/quesTitle/deleteQuesTitles.do', { ids: datas }, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var initFun = function () {
|
||||
var height = $(window).height();
|
||||
if(height<100){
|
||||
height = window.screen.height-150;
|
||||
}
|
||||
$table = $("#table").bootstrapTable({ // 对应table标签的id
|
||||
height: (height-80),
|
||||
url: ext.contextPath + '/question/quesTitle/getQuesTitleList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val(),
|
||||
subjecttypeid: $('#search_pid1').val(),
|
||||
ranktype: $("#ranktype1").val(),
|
||||
questtype: $("#questtype1").val()
|
||||
}
|
||||
},
|
||||
sortName: 'ord', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: '_subjectTypeName', // 返回json数据中的name
|
||||
title: '问卷类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: 200
|
||||
}, {
|
||||
field: '_rankTypeName', // 返回json数据中的name
|
||||
title: '难度', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: 80
|
||||
}, {
|
||||
field: '_questTypeName', // 返回json数据中的name
|
||||
title: '题型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: 120
|
||||
}, {
|
||||
field: 'code', // 返回json数据中的name
|
||||
title: '题目编码', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: 140
|
||||
}, {
|
||||
field: 'quesdescript', // 返回json数据中的name
|
||||
title: '题目', // 表格表头显示文字
|
||||
align: 'left', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: 80
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var str = '';
|
||||
/* str += '<button class="btn btn-default btn-sm" title="预览" onclick="displayFun(\'' + row.id + '\')"><i class="fa fa-eye"></i></button>';*/
|
||||
str += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i></button>';
|
||||
str += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></button>';
|
||||
str = '<div class="btn-group" >' + str + '</div>';
|
||||
return str;
|
||||
/* return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>'; */
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
};
|
||||
var $table;
|
||||
var companyId;
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
//导出设备表,要用get请求的方式
|
||||
function downloadFun() {
|
||||
// var checkedItems = $("#table").bootstrapTable('getAllSelections');
|
||||
// var datas="";
|
||||
// $.each(checkedItems, function(index, item){
|
||||
// datas+=item.id+",";
|
||||
// });
|
||||
// var search_equName = "";
|
||||
// var deptName = "";
|
||||
// if(datas == ""){
|
||||
// search_equName = $("#search_name").val();
|
||||
// deptName = $("#search_dept").val();
|
||||
// }
|
||||
//console.info(deptName)
|
||||
// window.open(ext.contextPath + "/question/quesTitle/downloadQuesExcel.do");
|
||||
window.open(ext.contextPath + "/base/downloadFile.do?key=123abcdabcd&tbName=tb_common_file");
|
||||
}
|
||||
//导入设备列表
|
||||
function importFun(){
|
||||
$.post(ext.contextPath + '/question/quesTitle/importQues.do', {} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
function selectnode(){
|
||||
console.log($('#companytree1').treeview('getChecked'));
|
||||
var arr = $('#companytree1').treeview('getChecked');
|
||||
var ids = "";
|
||||
for(var i=0;i<arr.length;i++){
|
||||
ids+= arr[i].id+",";
|
||||
}
|
||||
console.log(ids);
|
||||
}
|
||||
|
||||
$(function () {
|
||||
//树(工作领域)
|
||||
$.post(ext.contextPath + '/question/subjecttype/getSubjecttypeJson.do', { ng: '' }, function (data) {
|
||||
//console.log("data",data[0]);
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#search_pid1").val(data[0].id);
|
||||
$("#companyselect1").hide();
|
||||
$("#companyName1").text("公司:" + data[0].text);
|
||||
// showtable();
|
||||
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
// $("#search_pid1").val(data[0].id);
|
||||
// $("#cname_input1").val(data[0].text);
|
||||
// showtable();
|
||||
//$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
$('#companytree1').treeview({
|
||||
data: data,
|
||||
showBorder: false,
|
||||
showCheckbox: false,
|
||||
levels: 2
|
||||
});
|
||||
$('#companytree1').on('nodeSelected', function (event, data) {
|
||||
var nodesnum=0;
|
||||
if(data.nodes!=null){
|
||||
nodesnum=data.nodes.length;
|
||||
}else{
|
||||
nodesnum=nodesnum;
|
||||
}
|
||||
|
||||
if(nodesnum==0){
|
||||
$("#search_pid1").val(data.id);
|
||||
$("#cname_input1").val(data.text);
|
||||
document.getElementById('company_select').style.display = "none";
|
||||
$("ul#company_select").hide();
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}
|
||||
|
||||
|
||||
// $("ul#company_select").hide();
|
||||
});
|
||||
} else {
|
||||
//待完善
|
||||
};
|
||||
}, 'json');
|
||||
|
||||
//防止点击树收起下拉框
|
||||
$("#company_select").on("click", function (e) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
//点击树之外其他区域收起
|
||||
$(document).click(function(){
|
||||
$("#company_select").hide();
|
||||
});
|
||||
//
|
||||
|
||||
//题目难度搜索
|
||||
$.post(ext.contextPath + "/question/ranktype/getRankType4Select.do", {}, function (data) {
|
||||
var select = $("#ranktype1").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' })
|
||||
select.val('').trigger("change");
|
||||
select.on("change", function (e) {
|
||||
//console.log($("#equipmentCardClass").val());
|
||||
dosearch();
|
||||
});
|
||||
}, 'json');
|
||||
//题目类型搜索
|
||||
$.post(ext.contextPath + "/question/questtype/getQuestType4Select.do", {}, function (data) {
|
||||
var select = $("#questtype1").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' })
|
||||
select.val('').trigger("change");
|
||||
select.on("change", function (e) {
|
||||
//console.log($("#equipmentCardClass").val());
|
||||
dosearch();
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
initFun();
|
||||
|
||||
// $('#removea').click(function () {
|
||||
// $('#search_name').val("");
|
||||
// })
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini" style="overflow: auto !important;height: 100%;">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<!--<section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<li class="active">Here</li>
|
||||
</ol>
|
||||
</section> -->
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subjectType4SelectDiv"></div>
|
||||
<div>
|
||||
<div class="form-group">
|
||||
<div class="btn-group" style="padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i>
|
||||
新增</button>
|
||||
<!-- <button type="button" class="btn btn-default" onclick="editFun();"><i class="fa fa-edit"></i> 编辑</button> -->
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i>删除</button>
|
||||
<%--<button type="button" class="btn btn-default btn-sm" onclick="importFun();"><i class="fa fa-cloud-upload"></i>导入题库</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="downloadFun();"><i class="fa fa-cloud-download"></i>模板下载</button>--%>
|
||||
<!--<button type="button" class="btn btn-default" onclick="syncFun();"><i class="fa fa-upload"></i> 同步</button> -->
|
||||
</div>
|
||||
|
||||
<div class="form-group pull-right form-inline ">
|
||||
<div class="form-group form-inline">
|
||||
<div class="input-group input-group-sm pull-left hidden">
|
||||
<input id="search_pid1" name="search_pid1" type="hidden" />
|
||||
<span id="companyName1" style="width:220px;border: none;background: transparent;"></span>
|
||||
<ul class="col-lg-6 col-md-6 col-sm-6 col-xs-6" id="companyselect1" style="list-style-type:none;padding-left:10px;margin-top:8px;width:170px;">
|
||||
<li class="dropdown messages-menu" >
|
||||
<!-- Menu toggle button -->
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style="width:80px;"
|
||||
onclick="document.getElementById('company_select').style.display = 'block';">
|
||||
<div class="input-group" style="height: 25px">
|
||||
<span class="input-group-addon" style="height:25px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold">问卷类型:</span>
|
||||
<input class="form-control " id="cname_input1" name="cname_input1" style="height:28px;width:120px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;text-align:center;"
|
||||
readonly />
|
||||
</div>
|
||||
</a>
|
||||
<ul id="company_select" class="dropdown-menu" data-stopPropagation="true">
|
||||
<li>
|
||||
<div id="companytree1" style="width: 275px;overflow:auto;">
|
||||
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm pull-left">
|
||||
<label class="form-label">难度类型:</label>
|
||||
<select class="form-control select2 " id="ranktype1"
|
||||
name="ranktype1" style="width: 160px;">
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group input-group-sm pull-left">
|
||||
<label class="form-label">题目类型:</label>
|
||||
<select class="form-control select2 " id="questtype1"
|
||||
name="questtype1" style="width: 160px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include>
|
||||
<jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
224
WebRoot/jsp/question/questTypeAdd.jsp
Normal file
224
WebRoot/jsp/question/questTypeAdd.jsp
Normal file
@ -0,0 +1,224 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function saveRankTypeFun() {
|
||||
// console.log($("#addForm").serialize());
|
||||
|
||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/question/questtype/saveQuestType.do", $("#addForm").serialize(), function (result) {
|
||||
|
||||
if (result == 1) {
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (result == 0) {
|
||||
showAlert('d', '用户信息保存失败');
|
||||
} else {
|
||||
showAlert('d', result);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#addForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '题型名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '编号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
answertype: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '答题方式不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
// choosenum: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '选项数不能为空'
|
||||
// },
|
||||
// regexp: {
|
||||
// regexp: /^[0-9]*$/,
|
||||
// message: '顺序必须为数字'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// choosequest: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '选题量不能为空'
|
||||
// },
|
||||
// regexp: {
|
||||
// regexp: /^[0-9]*$/,
|
||||
// message: '顺序必须为数字'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// haveundernum: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '所属小题数不能为空'
|
||||
// },
|
||||
// regexp: {
|
||||
// regexp: /^[0-9]*$/,
|
||||
// message: '顺序必须为数字'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// valuetype: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '得分标准不能为空'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '状态不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
ord: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '顺序必须为数字'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
// alert('123')
|
||||
$("#answertype").select2({ minimumResultsForSearch: -1 }).val($("#answertype").val()).trigger("change");
|
||||
// $("#valuetype").select2({ minimumResultsForSearch: -1 }).val($("#valuetype").val()).trigger("change");
|
||||
$("#status").select2({ minimumResultsForSearch: -1 }).val($("#status").val()).trigger("change");
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增界面</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为addForm -->
|
||||
<form class="form-horizontal" id="addForm">
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<input type="hidden" name="id" value="${questType.id }" />
|
||||
<!-- 界面提醒div强制id为alertdiv -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*题型名称</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="题型名称" value="${questType.name}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*编号</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="code" name="code" placeholder="编号" value="${questType.code}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*答题方式</label>
|
||||
<div class="col-sm-9">
|
||||
<select id="answertype" name="answertype" class="form-control select2" style="width: 120px;">
|
||||
<option value="0" selected>单选</option>
|
||||
<option value="1">多选</option>
|
||||
<option value="2">填空</option>
|
||||
<option value="3">问答</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">评分原则</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="memo" name="memo" placeholder="评分原则" value="${questType.memo}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-3 control-label">*选项数</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="choosenum" name="choosenum" placeholder="选项数" value="${questType.choosenum}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*选题量</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="choosequest" name="choosequest" placeholder="选题量" value="${questType.choosequest}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*所属小题数</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="haveundernum" name="haveundernum" placeholder="所属小题数" value="${questType.haveundernum}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*得分标准</label>
|
||||
<div class="col-sm-9">
|
||||
<select id="valuetype" name="valuetype" class="form-control select2" style="width: 120px;">
|
||||
<option value="全对得分" selected>全对得分</option>
|
||||
<option value="单项得分">单项得分</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*状态</label>
|
||||
<div class="col-sm-9">
|
||||
<select id="status" name="status" class="form-control select2">
|
||||
<option value="启用" selected>启用</option>
|
||||
<option value="禁用">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*顺序(数字)</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="ord" name="ord" placeholder="顺序" value="${questType.ord}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="saveRankTypeFun()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
193
WebRoot/jsp/question/questTypeEdit.jsp
Normal file
193
WebRoot/jsp/question/questTypeEdit.jsp
Normal file
@ -0,0 +1,193 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doupdate() {
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/question/questtype/updateQuestType.do", $("#editForm").serialize(), function (result) {
|
||||
if (result == 1) {
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (result == 0) {
|
||||
showAlert('d', '用户信息保存失败');
|
||||
} else {
|
||||
showAlert('d', result);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#editForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '题型名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '编号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
answertype: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '答题方式不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
// choosenum: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '选项数不能为空'
|
||||
// },
|
||||
// regexp: {
|
||||
// regexp: /^[0-9]*$/,
|
||||
// message: '顺序必须为数字'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// choosequest: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '选题量不能为空'
|
||||
// },
|
||||
// regexp: {
|
||||
// regexp: /^[0-9]*$/,
|
||||
// message: '顺序必须为数字'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// haveundernum: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '所属小题数不能为空'
|
||||
// },
|
||||
// regexp: {
|
||||
// regexp: /^[0-9]*$/,
|
||||
// message: '顺序必须为数字'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// valuetype: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '得分标准不能为空'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '状态不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
ord: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '顺序必须为数字'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
// alert('123')
|
||||
$("#answertype").select2({ minimumResultsForSearch: -1 }).val("${questType.answertype}").trigger("change");
|
||||
$("#status").select2({ minimumResultsForSearch: -1 }).val("${questType.status}").trigger("change");
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑界面</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为editForm -->
|
||||
<form class="form-horizontal" id="editForm">
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<input type="hidden" name="id" value="${questType.id }" />
|
||||
<!-- 界面提醒div强制id为alertdiv -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*题型名称</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="题型名称" value="${questType.name}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*编号</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="code" name="code" placeholder="编号" value="${questType.code}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*答题方式</label>
|
||||
<div class="col-sm-9">
|
||||
<select id="answertype" name="answertype" class="form-control select2" style="width: 120px;">
|
||||
<option value="0">单选</option>
|
||||
<option value="1">多选</option>
|
||||
<option value="2">填空</option>
|
||||
<option value="3">问答</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">评分原则</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="memo" name="memo" placeholder="评分原则" value="${questType.memo}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*状态</label>
|
||||
<div class="col-sm-9">
|
||||
<select id="status" name="status" class="form-control select2">
|
||||
<option value="启用">启用</option>
|
||||
<option value="禁用">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*顺序(数字)</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="ord" name="ord" placeholder="顺序" value="${questType.ord}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
300
WebRoot/jsp/question/questTypeList.jsp
Normal file
300
WebRoot/jsp/question/questTypeList.jsp
Normal file
@ -0,0 +1,300 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<!-- <style type="text/css">
|
||||
.input { padding: 5px; margin: 0; border: 1px solid #beceeb; }
|
||||
.clear { display: none;
|
||||
position: absolute;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin: 6px 0 0 -20px;
|
||||
background: url(../IMG/remove-icon-small.png);}
|
||||
|
||||
.input::-ms-clear { display: none; }
|
||||
.input:valid + .clear { display: inline; }
|
||||
|
||||
</style> -->
|
||||
<title>
|
||||
<%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/question/questtype/showQuestTypeAdd.do', {}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var editFun = function (id) {
|
||||
$.post(ext.contextPath + '/question/questtype/showQuestTypeEdit.do', { id: id }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var deleteFun = function (id) {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/question/questtype/deleteQuestType.do', { id: id }, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
swal({
|
||||
text: "您确定要删除这些记录吗?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/question/questtype/deleteQuestTypes.do', { ids: datas }, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var initFun = function () {
|
||||
$table = $("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/question/questtype/getQuestTypeList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
// sortName: 'id', // 要排序的字段
|
||||
// sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '题目类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
// field: 'valuetype', // 返回json数据中的name
|
||||
// title: '得分标准', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle' // 上下居中
|
||||
// }, {
|
||||
// field: 'choosequest', // 返回json数据中的name
|
||||
// title: '选题量', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle' // 上下居中
|
||||
// }, {
|
||||
// field: 'haveundernum', // 返回json数据中的name
|
||||
// title: '小题数', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle' // 上下居中
|
||||
// }, {
|
||||
field: 'memo', // 返回json数据中的name
|
||||
title: '评分原则', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'ord', // 返回json数据中的name
|
||||
title: '顺序', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'insertdate', // 返回json数据中的name
|
||||
title: '新增时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 19);
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
// width: 60, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var str = '';
|
||||
str += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i></button>';
|
||||
str += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></button>';
|
||||
str = '<div class="btn-group" >' + str + '</div>';
|
||||
return str;
|
||||
/* return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>'; */
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
};
|
||||
var $table;
|
||||
var companyId;
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
$(function () {
|
||||
initFun();
|
||||
// init();
|
||||
//简易公司combotree
|
||||
// $.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
|
||||
// $('#companySelectTree').html(data);
|
||||
// });
|
||||
|
||||
|
||||
// $('#removea').click(function () {
|
||||
// $('#search_name').val("");
|
||||
// })
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<!-- <section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<li class="active">Here</li>
|
||||
</ol>
|
||||
</section> -->
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="unit4SelectDiv"></div>
|
||||
<div>
|
||||
<div class="form-group">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i>
|
||||
新增</button>
|
||||
<!-- <button type="button" class="btn btn-default" onclick="editFun();"><i class="fa fa-edit"></i> 编辑</button> -->
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i>删除</button>
|
||||
<!--<button type="button" class="btn btn-default" onclick="syncFun();"><i class="fa fa-upload"></i> 同步</button> -->
|
||||
</div>
|
||||
|
||||
<div class="form-group pull-right form-inline ">
|
||||
<!-- <div class="form-group has-feedback ">
|
||||
<input type="text" class="form-control " id="search_group" name ="search_group" placeholder="小组" onclick="showUnit4SelectFun();" style="width: 250px;height:30px">
|
||||
<a class="glyphicon glyphicon-remove form-control-feedback btn-sm" id="removea" style="padding-top:6px;pointer-events: auto"></a>
|
||||
</input>
|
||||
</div>
|
||||
<input id="search_pid" class="form-control" name="search_pid" type="hidden" /> -->
|
||||
<!-- <div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right"
|
||||
placeholder="姓名">
|
||||
<a class="glyphicon glyphicon-remove form-control-feedback btn-sm" id="removea"
|
||||
style="padding-top:6px;pointer-events: auto"></a>
|
||||
</input>
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default"
|
||||
onclick="$table.bootstrapTable('refresh');;"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include>
|
||||
<jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
155
WebRoot/jsp/question/rankTypeAdd.jsp
Normal file
155
WebRoot/jsp/question/rankTypeAdd.jsp
Normal file
@ -0,0 +1,155 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function saveRankTypeFun() {
|
||||
// console.log($("#addForm").serialize());
|
||||
|
||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/question/ranktype/saveRankType.do", $("#addForm").serialize(), function (result) {
|
||||
|
||||
if (result == 1) {
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (result == 0) {
|
||||
showAlert('d', '用户信息保存失败');
|
||||
} else {
|
||||
showAlert('d', result);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#addForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '难度名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '难度编码不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
difficultyrank: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '难易度不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '状态不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
ord: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '顺序必须为数字'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// var showUnit4SelectFun = function () {
|
||||
// $.post(ext.contextPath + '/user/showUnit4Select_Limited.do', { formId: "addForm", hiddenId: "pid", textId: "_pname" }, function (data) {
|
||||
// $("#unit4SelectDiv").html(data);
|
||||
// openModal("unit4SelectModal_Limited");
|
||||
// });
|
||||
// };
|
||||
|
||||
$(function () {
|
||||
$("#status").select2({ minimumResultsForSearch: -1 }).val($("#status").val()).trigger("change");
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增界面</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为addForm -->
|
||||
<form class="form-horizontal" id="addForm">
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" name="id" value="${rankType.id }" />
|
||||
<!-- 界面提醒div强制id为alertdiv -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*难度名称</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="难度名称" value="${rankType.name}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*难度编码</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="code" name="code" placeholder="难度编码" value="${rankType.code}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*难易度</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="difficultyrank" name="difficultyrank" placeholder="难易度" value="${rankType.difficultyrank}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*状态</label>
|
||||
<div class="col-sm-9">
|
||||
<select id="status" name="status" class="form-control select2">
|
||||
<option value="启用" selected>启用</option>
|
||||
<option value="禁用">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*顺序(数字)</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="ord" name="ord" placeholder="顺序" value="${rankType.ord}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="memo" name="memo" placeholder="备注" value="${rankType.memo}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="saveRankTypeFun()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
145
WebRoot/jsp/question/rankTypeEdit.jsp
Normal file
145
WebRoot/jsp/question/rankTypeEdit.jsp
Normal file
@ -0,0 +1,145 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doupdate() {
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/question/ranktype/updateRankType.do", $("#editForm").serialize(), function (result) {
|
||||
if (result == 1) {
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (result == 0) {
|
||||
showAlert('d', '用户信息保存失败');
|
||||
} else {
|
||||
showAlert('d', result);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#editForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '难度名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '难度编码不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
difficultyrank: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '难易度不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '状态不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
ord: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '顺序必须为数字'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
$("#status").select2({ minimumResultsForSearch: -1 }).val("${rankType.status}").trigger("change");
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑界面</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为editForm -->
|
||||
<form class="form-horizontal" id="editForm">
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" name="id" value="${rankType.id }" />
|
||||
<!-- 界面提醒div强制id为alertdiv -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*难度名称</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="难度名称" value="${rankType.name}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*难度编码</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="code" name="code" placeholder="难度编码" value="${rankType.code}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*难易度</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="difficultyrank" name="difficultyrank" placeholder="难易度" value="${rankType.difficultyrank}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*状态</label>
|
||||
<div class="col-sm-9">
|
||||
<select id="status" name="status" class="form-control select2">
|
||||
<option value="启用">启用</option>
|
||||
<option value="禁用">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*顺序(数字)</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="ord" name="ord" placeholder="顺序" value="${rankType.ord}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="memo" name="memo" placeholder="备注" value="${rankType.memo}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
348
WebRoot/jsp/question/rankTypeList.jsp
Normal file
348
WebRoot/jsp/question/rankTypeList.jsp
Normal file
@ -0,0 +1,348 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<!-- <style type="text/css">
|
||||
.input { padding: 5px; margin: 0; border: 1px solid #beceeb; }
|
||||
.clear { display: none;
|
||||
position: absolute;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin: 6px 0 0 -20px;
|
||||
background: url(../IMG/remove-icon-small.png);}
|
||||
|
||||
.input::-ms-clear { display: none; }
|
||||
.input:valid + .clear { display: inline; }
|
||||
|
||||
</style> -->
|
||||
<title>
|
||||
<%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/question/ranktype/showRankTypeAdd.do', {}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var editFun = function (id) {
|
||||
$.post(ext.contextPath + '/question/ranktype/showRankTypeEdit.do', { id: id }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var deleteFun = function (id) {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/question/ranktype/deleteRankType.do', { id: id }, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
swal({
|
||||
text: "您确定要删除这些记录吗?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/question/ranktype/deleteRankTypes.do', { ids: datas }, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var initFun = function () {
|
||||
$table = $("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/question/ranktype/getRankTypeList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
// sortName: 'id', // 要排序的字段
|
||||
// sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '难度名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'difficultyrank', // 返回json数据中的name
|
||||
title: '难易度', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'ord', // 返回json数据中的name
|
||||
title: '顺序', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: '_insertusername', // 返回json数据中的name
|
||||
title: '新增人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'insertdate', // 返回json数据中的name
|
||||
title: '新增时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 19);
|
||||
}
|
||||
},
|
||||
// {
|
||||
// field: 'insdt', // 返回json数据中的name
|
||||
// title: '注册时间', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle',
|
||||
// formatter: function (value, row, index) {
|
||||
// return value.substring(0, 19);
|
||||
// }
|
||||
// }, {
|
||||
// field: 'totaltime', // 返回json数据中的name
|
||||
// title: '在线时长', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle',
|
||||
// formatter: function (value, row, index) {
|
||||
// return value.toFixed(2);
|
||||
// }
|
||||
// }, {
|
||||
// field: 'lastlogintime', // 返回json数据中的name
|
||||
// title: '上次登录时间', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle',
|
||||
// formatter: function (value, row, index) {
|
||||
// return value.substring(0, 19);
|
||||
// }
|
||||
// }, {
|
||||
// field: 'roles', // 返回json数据中的name
|
||||
// title: '角色权限', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle',
|
||||
// formatter: function (value, row, index) {
|
||||
// var res = "";
|
||||
// for (var i = 0; i < value.length; i++) {
|
||||
// res += "<a class='linkbutton' href='javascript:void(0)' onclick='showMenu(\"" + value[i].id + "\",\"" + value[i].name + "\")'>" + value[i].name + "</a>" + ", ";
|
||||
// }
|
||||
// return res.replace(/, $/g, "");
|
||||
// }
|
||||
// }, {
|
||||
// field: 'active', // 返回json数据中的name
|
||||
// title: '状态', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle',
|
||||
// formatter: function (value, row, index) {
|
||||
// switch (value) {
|
||||
// case '0':
|
||||
// return '禁用';
|
||||
// case '1':
|
||||
// return '启用';
|
||||
// case '2':
|
||||
// return '退休';
|
||||
// case '3':
|
||||
// return '离职';
|
||||
// default:
|
||||
// return '';
|
||||
// }
|
||||
|
||||
// }
|
||||
// },
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
// width: 60, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var str = '';
|
||||
str += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i></button>';
|
||||
str += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></button>';
|
||||
str = '<div class="btn-group" >' + str + '</div>';
|
||||
return str;
|
||||
/* return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>'; */
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
};
|
||||
var $table;
|
||||
var companyId;
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
$(function () {
|
||||
initFun();
|
||||
// init();
|
||||
//简易公司combotree
|
||||
// $.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
|
||||
// $('#companySelectTree').html(data);
|
||||
// });
|
||||
|
||||
|
||||
// $('#removea').click(function () {
|
||||
// $('#search_name').val("");
|
||||
// })
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<!-- <section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<li class="active">Here</li>
|
||||
</ol>
|
||||
</section> -->
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="unit4SelectDiv"></div>
|
||||
<div>
|
||||
<div class="form-group">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i>
|
||||
新增</button>
|
||||
<!-- <button type="button" class="btn btn-default" onclick="editFun();"><i class="fa fa-edit"></i> 编辑</button> -->
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i>删除</button>
|
||||
<!--<button type="button" class="btn btn-default" onclick="syncFun();"><i class="fa fa-upload"></i> 同步</button> -->
|
||||
</div>
|
||||
|
||||
<div class="form-group pull-right form-inline ">
|
||||
<!-- <div class="form-group has-feedback ">
|
||||
<input type="text" class="form-control " id="search_group" name ="search_group" placeholder="小组" onclick="showUnit4SelectFun();" style="width: 250px;height:30px">
|
||||
<a class="glyphicon glyphicon-remove form-control-feedback btn-sm" id="removea" style="padding-top:6px;pointer-events: auto"></a>
|
||||
</input>
|
||||
</div>
|
||||
<input id="search_pid" class="form-control" name="search_pid" type="hidden" /> -->
|
||||
<!-- <div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right"
|
||||
placeholder="姓名">
|
||||
<a class="glyphicon glyphicon-remove form-control-feedback btn-sm" id="removea"
|
||||
style="padding-top:6px;pointer-events: auto"></a>
|
||||
</input>
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default"
|
||||
onclick="$table.bootstrapTable('refresh');;"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include>
|
||||
<jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
43
WebRoot/jsp/question/subjecttype4select.jsp
Normal file
43
WebRoot/jsp/question/subjecttype4select.jsp
Normal file
@ -0,0 +1,43 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
var selectMenu = function() {
|
||||
|
||||
alert('${param.hiddenId}'+'${param.textId}');
|
||||
}
|
||||
$(function() {
|
||||
$.post(ext.contextPath + '/question/subjecttype/getSubjecttypeJson.do', {ng:''} , function(data) {
|
||||
console.info(data);
|
||||
if(data.length>0){
|
||||
$('#menu_select_tree').treeview({
|
||||
data: data,
|
||||
});
|
||||
$('#menu_select_tree').on('nodeSelected', function(event, data) {
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(data.id);
|
||||
$('#${param.formId} #${param.textId}').val(data.text);
|
||||
closeModal("menu4SelectModal")
|
||||
});
|
||||
}
|
||||
},'json');
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="menu4SelectModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择问卷类型</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="menu_select_tree" style="height:430px;overflow:auto;width:100%"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<!-- <button type="button" class="btn btn-primary" onclick="selectMenu()">保存</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
186
WebRoot/jsp/question/subjecttypeAdd.jsp
Normal file
186
WebRoot/jsp/question/subjecttypeAdd.jsp
Normal file
@ -0,0 +1,186 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var showMenu4SelectFun = function () {
|
||||
$.post(ext.contextPath + '/question/subjecttype/showsubjecttype4Select.do', { formId: "subForm", hiddenId: "pid", textId: "_pname" }, function (data) {
|
||||
$("#menu4SelectDiv").html(data);
|
||||
openModal('menu4SelectModal');
|
||||
});
|
||||
};
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/question/subjecttype/saveSubjecttype.do", $("#subForm").serialize(), function (result) {
|
||||
if (result == 1) {
|
||||
initTreeView();
|
||||
//showAlert('s','保存成功');
|
||||
} else {
|
||||
showAlert('d', '保存失败');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '编码不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
// _pname: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '上级菜单不能为空'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
ord: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '顺序必须为数字'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
// function saveDefault() {
|
||||
// if($("#location").val()==''){
|
||||
// top.$.messager.alert('提示','请先填写菜单地址','info');
|
||||
// }else{
|
||||
// if ($(".form").form('validate')) {
|
||||
// $.post(ext.contextPath + "/user/saveDefaultFunc.do", $(".form").serialize(), function(result) {
|
||||
// if (result > 0) {
|
||||
// top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
// $('#grid').datagrid('reload');
|
||||
// });
|
||||
// } else {
|
||||
// top.$.messager.alert('提示', "保存失败", 'info');
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// function dodel() {
|
||||
// top.$.messager.confirm('提示', '确定删除此菜单?', function(r) {
|
||||
// if (r) {
|
||||
// $.post(ext.contextPath + "/user/deleteMenu.do", $(".form").serialize(), function(result) {
|
||||
// if (result.res > 0) {
|
||||
// top.$.messager.alert('提示', "删除成功", 'info', function() {
|
||||
// //刷新树
|
||||
// parent.reloadTree();
|
||||
// parent.$("#mainFrame").attr("src",ext.contextPath+"/user/showMenuAdd.do?pid="+$("#pid").val());
|
||||
// });
|
||||
// } else {
|
||||
// top.$.messager.alert('提示', result.msg, 'info');
|
||||
// }
|
||||
// },'json');
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
$(function () {
|
||||
//var active=$("#active").select2();
|
||||
$("#active").select2({ minimumResultsForSearch: -1 }).val("${menu.active}").trigger("change");
|
||||
});
|
||||
</script>
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">新增</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i
|
||||
class="glyphicon glyphicon-floppy-disk"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<form class="form-horizontal " id="subForm">
|
||||
<input id="id" name="id" type="hidden" value="${subjecttype.id}" />
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="名称"
|
||||
value="${subjecttype.name }">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">上级菜单</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="_pname" name="_pname" placeholder="上级菜单"
|
||||
onclick="showMenu4SelectFun();" value="${pname}">
|
||||
<input id="pid" name="pid" type="hidden" value="${param.pid}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*编号</label>
|
||||
<div class="col-sm-4">
|
||||
<c:if test="${codelength == null}">
|
||||
<input name="code" class="form-control input-inline input-medium"
|
||||
value="" placeholder="请输入2位编码">
|
||||
</c:if>
|
||||
<c:if test="${codelength == 2}">
|
||||
<input name="code" class="form-control input-inline input-medium"
|
||||
value="" placeholder="请输入3位编码(前2位是${code })">
|
||||
</c:if>
|
||||
<c:if test="${codelength == 3}">
|
||||
<input name="code" class="form-control input-inline input-medium"
|
||||
value="" placeholder="请输入4位编码(前3位是${code })">
|
||||
</c:if>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="memo" name="memo" placeholder="备注"
|
||||
value="${subjecttype.memo}">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*顺序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="ord" name="ord" placeholder="顺序"
|
||||
value="${subjecttype.ord}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">启用</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="st" name="st" class="form-control select2">
|
||||
<option value="启用">启用</option>
|
||||
<option value="禁用">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
320
WebRoot/jsp/question/subjecttypeEdit.jsp
Normal file
320
WebRoot/jsp/question/subjecttypeEdit.jsp
Normal file
@ -0,0 +1,320 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var showMenu4SelectFun = function () {
|
||||
$.post(ext.contextPath + '/question/subjecttype/showsubjecttype4Select.do', { formId: "subForm", hiddenId: "pid", textId: "_pname" }, function (data) {
|
||||
$("#menu4SelectDiv").html(data);
|
||||
openModal("menu4SelectModal")
|
||||
});
|
||||
};
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/question/subjecttype/updateSubjecttype.do", $("#subForm").serialize(), function (result) {
|
||||
if (result == 1) {
|
||||
showAlert('s', '保存成功');
|
||||
} else {
|
||||
showAlert('d', '保存失败');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '编码不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
// _pname: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '上级菜单不能为空'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
morder: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '顺序必须为数字'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function saveDefault() {
|
||||
if ($("#location").val() == '') {
|
||||
showAlert('i', '请先填写菜单地址')
|
||||
} else {
|
||||
//if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/user/saveDefaultFunc.do", $("#subForm").serialize(), function (result) {
|
||||
if (result > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '默认权限添加失败', 'alertDiv_power');
|
||||
}
|
||||
});
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
function dodel() {
|
||||
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/question/subjecttype/deleteSubjecttype.do', $("#subForm").serialize(), function (data) {
|
||||
if (data.res > 0) {
|
||||
initTreeView();
|
||||
} else {
|
||||
showAlert('d', '删除失败');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
function delPowerFun(id) {
|
||||
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/user/deleteMenu.do', { id: id }, function (data) {
|
||||
if (data.res > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'alertDiv_power');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
var addPowerFun = function () {
|
||||
$.post(ext.contextPath + '/user/showFuncAdd.do', { pid: "${menu.id}" }, function (data) {
|
||||
$("#powerDiv").html(data);
|
||||
openModal('powerModal')
|
||||
});
|
||||
};
|
||||
var editPowerFun = function (id) {
|
||||
$.post(ext.contextPath + '/user/showFuncEdit.do', { id: id }, function (data) {
|
||||
$("#powerDiv").html(data);
|
||||
openModal('powerModal')
|
||||
});
|
||||
};
|
||||
$(function () {
|
||||
$("#active").select2({ minimumResultsForSearch: -1 }).val("${menu.active}").trigger("change");
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/user/getFuncJson.do?id=${menu.id}', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order // 排序规则
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'location', // 返回json数据中的name
|
||||
title: '路径', // 表格表头显示文字
|
||||
align: 'left', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'pid', // 返回json数据中的name
|
||||
title: '所属菜单', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return row._pname;
|
||||
},
|
||||
}, {
|
||||
field: 'active', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 100, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
return '<div class="btn-group"><button class="btn btn-default btn-sm" onclick="editPowerFun(\'' + row.id + '\')"><i class="fa fa-edit"></i></button>' +
|
||||
'<button class="btn btn-default btn-sm" onclick="delPowerFun(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></button></div>';
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
$(".bs-checkbox").css({ 'text-align': 'center', 'vertical-align': 'middle' })
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">详情</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i
|
||||
class="glyphicon glyphicon-floppy-disk"></i></a>
|
||||
<a onclick="dodel()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i
|
||||
class="glyphicon glyphicon-trash"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<form class="form-horizontal " id="subForm">
|
||||
<input id="id" name="id" type="hidden" value="${subjecttype.id}" />
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="名称" value="${subjecttype.name }">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">上级菜单</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="_pname" name="_pname" placeholder="上级菜单"
|
||||
onclick="showMenu4SelectFun();" value="${subjecttype._pname}">
|
||||
<input id="pid" name="pid" type="hidden" value="${subjecttype.pid}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*编码</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="code" name="code" placeholder="编码" value="${subjecttype.code}">
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="memo" name="memo" placeholder="备注" value="${subjecttype.memo}">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">顺序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="ord" name="ord" placeholder="顺序" value="${subjecttype.ord}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">启用</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="st" name="st" class="form-control select2">
|
||||
<option value="启用">启用</option>
|
||||
<option value="禁用">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">按钮及数据权限</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body ">
|
||||
<div>
|
||||
<div id="alertDiv_power"></div>
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default" onclick="addPowerFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
<button type="button" class="btn btn-default" onclick="saveDefault();"><i class="fa fa-plus-square"></i>
|
||||
默认</button>
|
||||
|
||||
</div>
|
||||
<div id="powerDiv"></div>
|
||||
<div id="menu4SelectDiv_func"></div>
|
||||
<br>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
178
WebRoot/jsp/question/subjecttypeshowlist.jsp
Normal file
178
WebRoot/jsp/question/subjecttypeshowlist.jsp
Normal file
@ -0,0 +1,178 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var addFun = function() {
|
||||
var node=$('#tree').treeview('getSelected');
|
||||
var pid="";
|
||||
if(node!=null && node.length>0){
|
||||
pid=node[0].id;
|
||||
}
|
||||
$.post(ext.contextPath + '/question/subjecttype/showSubjecttypeAdd.do', {pid:pid} , function(data) {
|
||||
$("#menuBox").html(data);
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
$.post(ext.contextPath + '/question/subjecttype/showSubjecttypeEdit.do', {id:id} , function(data) {
|
||||
$("#menuBox").html(data);
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/group/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}else{
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/group/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var initTreeView = function() {
|
||||
$.post(ext.contextPath + '/question/subjecttype/getSubjecttypeJson.do', {ng:''} , function(data) {
|
||||
//console.info(data)
|
||||
$('#tree').treeview({data: data,
|
||||
});
|
||||
$('#tree').on('nodeSelected', function(event, data) {
|
||||
editFun(data.id);
|
||||
//var node=$('#tree').treeview('getSelected');
|
||||
});
|
||||
},'json');
|
||||
$("#menuBox").html("");
|
||||
};
|
||||
$(function() {
|
||||
initTreeView();
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id ="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">问卷类型配置</h3>
|
||||
|
||||
<div class="box-tools">
|
||||
<button type="button" class="btn btn-box-tool" onclick="addFun();"><i class="fa fa-plus"></i>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:550px;overflow:auto; "></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9" id="menuBox">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include>
|
||||
<jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user