练习,考试页面增加课程选择
This commit is contained in:
parent
3a458e0c4e
commit
cbdac15354
|
|
@ -23,6 +23,8 @@ private static final long serialVersionUID = 1L;
|
|||
private Integer deptId;
|
||||
/** 试卷代码 */
|
||||
private Integer examPaperId;
|
||||
/** 课程代码 */
|
||||
private Integer trainCourseId;
|
||||
/** 试卷名称 */
|
||||
private String name;
|
||||
/**
|
||||
|
|
@ -73,7 +75,16 @@ private static final long serialVersionUID = 1L;
|
|||
{
|
||||
return id;
|
||||
}
|
||||
/** 设置部门ID */
|
||||
|
||||
public Integer getTrainCourseId() {
|
||||
return trainCourseId;
|
||||
}
|
||||
|
||||
public void setTrainCourseId(Integer trainCourseId) {
|
||||
this.trainCourseId = trainCourseId;
|
||||
}
|
||||
|
||||
/** 设置部门ID */
|
||||
public void setDeptId(Integer deptId)
|
||||
{
|
||||
this.deptId = deptId;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ private static final long serialVersionUID = 1L;
|
|||
private Integer deptId;
|
||||
/** 练习名称 */
|
||||
private String name;
|
||||
/** 课程代码 */
|
||||
private Integer trainCourseId;
|
||||
/** 是否控制开始结束时间(0-不控制,1-控制) */
|
||||
private String enableControlTime;
|
||||
/** 开始时间 */
|
||||
|
|
@ -46,6 +48,14 @@ private static final long serialVersionUID = 1L;
|
|||
private String delFlag;
|
||||
|
||||
|
||||
public Integer getTrainCourseId() {
|
||||
return trainCourseId;
|
||||
}
|
||||
|
||||
public void setTrainCourseId(Integer trainCourseId) {
|
||||
this.trainCourseId = trainCourseId;
|
||||
}
|
||||
|
||||
/** 设置练习ID */
|
||||
public void setId(Integer id)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.ruoyi.exam.mapper;
|
|||
|
||||
import com.ruoyi.exam.domain.ExamExamination;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ruoyi.framework.web.base.MyMapper;
|
||||
|
||||
/**
|
||||
|
|
@ -20,5 +22,6 @@ public interface ExamExaminationMapper extends MyMapper<ExamExamination>
|
|||
* @return 考试集合
|
||||
*/
|
||||
public List<ExamExamination> selectExamExaminationList(ExamExamination examExamination);
|
||||
|
||||
|
||||
List<ExamExamination> selectListFromWeb(Map<String, Object> map);
|
||||
}
|
||||
|
|
@ -2,6 +2,8 @@ package com.ruoyi.exam.service;
|
|||
|
||||
import com.ruoyi.exam.domain.ExamExamination;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ruoyi.framework.web.base.AbstractBaseService;
|
||||
/**
|
||||
* 考试 服务层
|
||||
|
|
@ -26,5 +28,10 @@ public interface IExamExaminationService extends AbstractBaseService<ExamExamina
|
|||
*/
|
||||
public List<ExamExamination> selectExamExaminationList(ExamExamination examExamination);
|
||||
|
||||
|
||||
/**
|
||||
* web查询考试列表
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
List<ExamExamination> selectListFromWeb(Map<String, Object> map);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.ruoyi.exam.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.exam.mapper.ExamExaminationMapper;
|
||||
|
|
@ -32,6 +34,13 @@ public class ExamExaminationServiceImpl extends AbstractBaseServiceImpl<ExamExam
|
|||
{
|
||||
return examExaminationMapper.selectExamExaminationList(examExamination);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExamExamination> selectListFromWeb(Map<String, Object> map) {
|
||||
startPage();
|
||||
return examExaminationMapper.selectListFromWeb(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询考试分页列表
|
||||
*
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="id" column="id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="examPaperId" column="exam_paper_id" />
|
||||
<result property="trainCourseId" column="train_course_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="enableControlTime" column="enable_control_time" />
|
||||
|
|
@ -29,35 +30,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectExamExaminationVo">
|
||||
id, dept_id, exam_paper_id, name,type, enable_control_time, start_time, end_time, time_length, exam_number, pass_mark, question_disorder, finished_paper, exam_end, examination_user_limit, create_by, create_date, update_by, update_date, remarks, del_flag </sql>
|
||||
id, dept_id, exam_paper_id,train_course_id, name,type, enable_control_time, start_time, end_time, time_length, exam_number, pass_mark, question_disorder, finished_paper, exam_end, examination_user_limit, create_by, create_date, update_by, update_date, remarks, del_flag </sql>
|
||||
|
||||
<select id="selectExamExaminationList" parameterType="ExamExamination" resultMap="ExamExaminationResult">
|
||||
select
|
||||
<include refid="selectExamExaminationVo"/>
|
||||
from exam_examination
|
||||
<where>
|
||||
<if test="id != null "> and id = #{id}</if>
|
||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||
<if test="examPaperId != null "> and exam_paper_id = #{examPaperId}</if>
|
||||
<if test="name != null and name != '' "> and name = #{name}</if>
|
||||
<if test="enableControlTime != null and enableControlTime != '' "> and enable_control_time = #{enableControlTime}</if>
|
||||
<if test="startTime != null "> and start_time = #{startTime}</if>
|
||||
<if test="endTime != null "> and end_time = #{endTime}</if>
|
||||
<if test="timeLength != null "> and time_length = #{timeLength}</if>
|
||||
<if test="examNumber != null "> and exam_number = #{examNumber}</if>
|
||||
<if test="passMark != null "> and pass_mark = #{passMark}</if>
|
||||
<if test="questionDisorder != null and questionDisorder != '' "> and question_disorder = #{questionDisorder}</if>
|
||||
<if test="finishedPaper != null and finishedPaper != '' "> and finished_paper = #{finishedPaper}</if>
|
||||
<if test="examEnd != null and examEnd != '' "> and exam_end = #{examEnd}</if>
|
||||
<if test="examinationUserLimit != null and examinationUserLimit != '' "> and examination_user_limit = #{examinationUserLimit}</if>
|
||||
<if test="createBy != null and createBy != '' "> and create_by = #{createBy}</if>
|
||||
<if test="createDate != null "> and create_date = #{createDate}</if>
|
||||
<if test="updateBy != null and updateBy != '' "> and update_by = #{updateBy}</if>
|
||||
<if test="updateDate != null "> and update_date = #{updateDate}</if>
|
||||
<if test="remarks != null and remarks != '' "> and remarks = #{remarks}</if>
|
||||
<if test="delFlag != null and delFlag != '' "> and del_flag = #{delFlag}</if>
|
||||
<where>
|
||||
<if test="id != null "> and exam_examination.id = #{ination.id}</if>
|
||||
<if test="deptId != null "> and exam_examination.dept_id = #{ination.deptId}</if>
|
||||
<if test="examPaperId != null "> and exam_examination.exam_paper_id = #{ination.examPaperId}</if>
|
||||
<if test="trainCourseId != null "> and exam_examination.train_course_id = #{ination.trainCourseId}</if>
|
||||
<if test="name != null and name != '' "> and exam_examination.name = #{ination.name}</if>
|
||||
<if test="type != null and type != '' "> and exam_examination.type = #{ination.type}</if>
|
||||
<if test="enableControlTime != null and enableControlTime != '' "> and exam_examination.enable_control_time = #{ination.enableControlTime}</if>
|
||||
<if test="startTime != null "> and exam_examination.start_time = #{ination.startTime}</if>
|
||||
<if test="endTime != null "> and exam_examination.end_time = #{ination.endTime}</if>
|
||||
<if test="timeLength != null "> and exam_examination.time_length = #{ination.timeLength}</if>
|
||||
<if test="examNumber != null "> and exam_examination.exam_number = #{ination.examNumber}</if>
|
||||
<if test="passMark != null "> and exam_examination.pass_mark = #{ination.passMark}</if>
|
||||
<if test="questionDisorder != null and questionDisorder != '' "> and exam_examination.question_disorder = #{ination.questionDisorder}</if>
|
||||
<if test="finishedPaper != null and finishedPaper != '' "> and exam_examination.finished_paper = #{ination.finishedPaper}</if>
|
||||
<if test="examEnd != null and examEnd != '' "> and exam_examination.exam_end = #{ination.examEnd}</if>
|
||||
<if test="examinationUserLimit != null and examinationUserLimit != '' "> and exam_examination.examination_user_limit = #{ination.examinationUserLimit}</if>
|
||||
<if test="createBy != null and createBy != '' "> and exam_examination.create_by = #{ination.createBy}</if>
|
||||
<if test="createDate != null "> and exam_examination.create_date = #{ination.createDate}</if>
|
||||
<if test="updateBy != null and updateBy != '' "> and exam_examination.update_by = #{ination.updateBy}</if>
|
||||
<if test="updateDate != null "> and exam_examination.update_date = #{ination.updateDate}</if>
|
||||
<if test="remarks != null and remarks != '' "> and exam_examination.remarks = #{ination.remarks}</if>
|
||||
<if test="delFlag != null and delFlag != '' "> and exam_examination.del_flag = #{ination.delFlag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectListFromWeb" resultMap="ExamExaminationResult">
|
||||
select
|
||||
*
|
||||
from exam_examination exam_examination
|
||||
LEFT JOIN exam_examination_user eeu ON eeu.exam_examination_id = exam_examination.id
|
||||
<where>
|
||||
(exam_examination.type = '1' or eeu.vip_user_id = #{userId})
|
||||
<if test="id != null "> and exam_examination.id = #{ination.id}</if>
|
||||
<if test="deptId != null "> and exam_examination.dept_id = #{ination.deptId}</if>
|
||||
<if test="examPaperId != null "> and exam_examination.exam_paper_id = #{ination.examPaperId}</if>
|
||||
<if test="name != null and name != '' "> and exam_examination.name = #{ination.name}</if>
|
||||
<if test="type != null and type != '' "> and exam_examination.type = #{ination.type}</if>
|
||||
<if test="enableControlTime != null and enableControlTime != '' "> and exam_examination.enable_control_time = #{ination.enableControlTime}</if>
|
||||
<if test="startTime != null "> and exam_examination.start_time = #{ination.startTime}</if>
|
||||
<if test="endTime != null "> and exam_examination.end_time = #{ination.endTime}</if>
|
||||
<if test="timeLength != null "> and exam_examination.time_length = #{ination.timeLength}</if>
|
||||
<if test="examNumber != null "> and exam_examination.exam_number = #{ination.examNumber}</if>
|
||||
<if test="passMark != null "> and exam_examination.pass_mark = #{ination.passMark}</if>
|
||||
<if test="questionDisorder != null and questionDisorder != '' "> and exam_examination.question_disorder = #{ination.questionDisorder}</if>
|
||||
<if test="finishedPaper != null and finishedPaper != '' "> and exam_examination.finished_paper = #{ination.finishedPaper}</if>
|
||||
<if test="examEnd != null and examEnd != '' "> and exam_examination.exam_end = #{ination.examEnd}</if>
|
||||
<if test="examinationUserLimit != null and examinationUserLimit != '' "> and exam_examination.examination_user_limit = #{ination.examinationUserLimit}</if>
|
||||
<if test="createBy != null and createBy != '' "> and exam_examination.create_by = #{ination.createBy}</if>
|
||||
<if test="createDate != null "> and exam_examination.create_date = #{ination.createDate}</if>
|
||||
<if test="updateBy != null and updateBy != '' "> and exam_examination.update_by = #{ination.updateBy}</if>
|
||||
<if test="updateDate != null "> and exam_examination.update_date = #{ination.updateDate}</if>
|
||||
<if test="remarks != null and remarks != '' "> and exam_examination.remarks = #{ination.remarks}</if>
|
||||
<if test="delFlag != null and delFlag != '' "> and exam_examination.del_flag = #{ination.delFlag}</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="id" column="id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="trainCourseId" column="train_course_id" />
|
||||
<result property="enableControlTime" column="enable_control_time" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
|
|
@ -21,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectExamPracticeVo">
|
||||
id, dept_id, name,enable_control_time, start_time, end_time, practice_user_limit, create_by, create_date, update_by, update_date, remarks, del_flag </sql>
|
||||
id, dept_id, name,train_course_id,enable_control_time, start_time, end_time, practice_user_limit, create_by, create_date, update_by, update_date, remarks, del_flag </sql>
|
||||
|
||||
<select id="selectExamPracticeList" parameterType="ExamPractice" resultMap="ExamPracticeResult">
|
||||
select
|
||||
|
|
@ -31,7 +32,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="id != null "> and id = #{id}</if>
|
||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||
<if test="name != null and name != '' "> and name = #{name}</if>
|
||||
<if test="enableControlTime != null and enableControlTime != '' "> and enable_control_time = #{enableControlTime}</if>
|
||||
<if test="trainCourseId != null "> and exam_examination.train_course_id = #{ination.trainCourseId}</if>
|
||||
<if test="enableControlTime != null and enableControlTime != '' "> and enable_control_time = #{enableControlTime}</if>
|
||||
<if test="startTime != null "> and start_time = #{startTime}</if>
|
||||
<if test="endTime != null "> and end_time = #{endTime}</if>
|
||||
<if test="practiceUserLimit != null and practiceUserLimit != '' "> and practice_user_limit = #{practiceUserLimit}</if>
|
||||
|
|
@ -52,6 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
or enable_control_time = '0') ]]>
|
||||
<if test="id != null "> and id = #{id}</if>
|
||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||
<if test="trainCourseId != null "> and exam_examination.train_course_id = #{ination.trainCourseId}</if>
|
||||
<if test="name != null and name != '' "> and name = #{name}</if>
|
||||
<if test="enableControlTime != null and enableControlTime != '' "> and enable_control_time = #{enableControlTime}</if>
|
||||
<if test="startTime != null "> and start_time = #{startTime}</if>
|
||||
|
|
|
|||
|
|
@ -31,6 +31,18 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">课程选择:</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="trainCateGoryName" name="trainCateGoryName" value="课程分类" onclick="selectTrainCategoryTree()" class="form-control" type="text" readonly="true">
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<select id="trainCourseId" name="trainCourseId" class="form-control m-b" >
|
||||
<option>---请选择---</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">考试类型</label>
|
||||
|
||||
|
|
@ -140,7 +152,23 @@
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
var config2 = {
|
||||
url: ctx + "train/trainCourse"+ "/list",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {trainCourseCategoryId:100},
|
||||
// contentType:"application/json",
|
||||
success: function(result) {
|
||||
$("#trainCourseId").html("<option>---请选择---</option>");
|
||||
var rows =result.rows;
|
||||
for(var i in rows){
|
||||
$("#trainCourseId").append("<option value='"+rows[i].id+"'>"+rows[i].name+"</option>");
|
||||
}
|
||||
}
|
||||
};
|
||||
$.ajax(config)
|
||||
$.ajax(config2)
|
||||
})
|
||||
|
||||
|
||||
|
|
@ -178,7 +206,7 @@
|
|||
var id = 1;
|
||||
function selectExamPaperCategoryTree() {
|
||||
var options = {
|
||||
title: '分类选择',
|
||||
title: '试卷分类选择',
|
||||
width: "380",
|
||||
url: ctx + "exam/examPaperCategory" + "/selectExamPaperCategoryTree/"+id,
|
||||
callBack: doSubmit
|
||||
|
|
@ -187,6 +215,8 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function doSubmit(index, layero){
|
||||
var body = layer.getChildFrame('body', index);
|
||||
id = body.find('#treeId').val()
|
||||
|
|
@ -209,6 +239,42 @@
|
|||
};
|
||||
$.ajax(config)
|
||||
}
|
||||
|
||||
|
||||
|
||||
var trainCategoryId = 100;
|
||||
function selectTrainCategoryTree(){
|
||||
var options = {
|
||||
title: '课程分类选择',
|
||||
width: "380",
|
||||
url: ctx + "train/course/category" + "/selectCategoryTree/"+trainCategoryId,
|
||||
callBack: doSubmitForTrainCategory
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
function doSubmitForTrainCategory(index, layero){
|
||||
var body = layer.getChildFrame('body', index);
|
||||
trainCategoryId = body.find('#treeId').val()
|
||||
$("#trainCateGoryName").val(body.find('#treeName').val());
|
||||
layer.close(index);
|
||||
|
||||
var config = {
|
||||
url: ctx + "train/trainCourse"+ "/list",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {trainCourseCategoryId:trainCategoryId},
|
||||
// contentType:"application/json",
|
||||
success: function(result) {
|
||||
$("#trainCourseId").html("<option>---请选择---</option>");
|
||||
var rows =result.rows;
|
||||
for(var i in rows){
|
||||
$("#trainCourseId").append("<option value='"+rows[i].id+"'>"+rows[i].name+"</option>");
|
||||
}
|
||||
}
|
||||
};
|
||||
$.ajax(config)
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
<form class="form-horizontal m" id="form-examExamination-edit" th:object="${examExamination}">
|
||||
<input id="id" name="id" th:field="*{id}" type="hidden">
|
||||
<input id="paperId" name="paperId" th:value="${examExamination.examPaperId}" type="hidden">
|
||||
<input id="trainId" name="trainId" th:value="${examExamination.trainCourseId}" type="hidden">
|
||||
<div class="form-group">
|
||||
|
||||
<div class="form-group">
|
||||
|
|
@ -29,6 +30,18 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">课程选择:</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="trainCateGoryName" name="trainCateGoryName" value="课程分类" onclick="selectTrainCategoryTree()" class="form-control" type="text" readonly="true">
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<select id="trainCourseId" name="trainCourseId" class="form-control m-b" >
|
||||
<option>---请选择---</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">考试类型</label>
|
||||
|
||||
|
|
@ -150,6 +163,24 @@
|
|||
$("#examPaperId").val(id);
|
||||
}
|
||||
};
|
||||
|
||||
var config2 = {
|
||||
url: ctx + "train/trainCourse"+ "/list",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {trainCourseCategoryId:100},
|
||||
// contentType:"application/json",
|
||||
success: function(result) {
|
||||
$("#trainCourseId").html("<option>---请选择---</option>");
|
||||
var id = $("#trainId").val();
|
||||
var rows =result.rows;
|
||||
for(var i in rows){
|
||||
$("#trainCourseId").append("<option value='"+rows[i].id+"'>"+rows[i].name+"</option>");
|
||||
}
|
||||
$("#trainCourseId").val(id);
|
||||
}
|
||||
};
|
||||
$.ajax(config2)
|
||||
$.ajax(config)
|
||||
})
|
||||
|
||||
|
|
@ -218,6 +249,40 @@
|
|||
};
|
||||
$.ajax(config)
|
||||
}
|
||||
|
||||
var trainCategoryId = 100;
|
||||
function selectTrainCategoryTree(){
|
||||
var options = {
|
||||
title: '课程分类选择',
|
||||
width: "380",
|
||||
url: ctx + "train/course/category" + "/selectCategoryTree/"+trainCategoryId,
|
||||
callBack: doSubmitForTrainCategory
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
function doSubmitForTrainCategory(index, layero){
|
||||
var body = layer.getChildFrame('body', index);
|
||||
trainCategoryId = body.find('#treeId').val()
|
||||
$("#trainCateGoryName").val(body.find('#treeName').val());
|
||||
layer.close(index);
|
||||
|
||||
var config = {
|
||||
url: ctx + "train/trainCourse"+ "/list",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {trainCourseCategoryId:trainCategoryId},
|
||||
// contentType:"application/json",
|
||||
success: function(result) {
|
||||
$("#trainCourseId").html("<option>---请选择---</option>");
|
||||
var rows =result.rows;
|
||||
for(var i in rows){
|
||||
$("#trainCourseId").append("<option value='"+rows[i].id+"'>"+rows[i].name+"</option>");
|
||||
}
|
||||
}
|
||||
};
|
||||
$.ajax(config)
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,20 @@
|
|||
<input id="name" name="name" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">课程选择:</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="trainCateGoryName" name="trainCateGoryName" value="课程分类" onclick="selectTrainCategoryTree()" class="form-control" type="text" readonly="true">
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<select id="trainCourseId" name="trainCourseId" class="form-control m-b" >
|
||||
<option>---请选择---</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">是否控制开始结束时间:</label>
|
||||
|
||||
|
|
@ -55,6 +69,24 @@
|
|||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "exam/examPractice"
|
||||
$(function () {
|
||||
var config = {
|
||||
url: ctx + "train/trainCourse"+ "/list",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {trainCourseCategoryId:100},
|
||||
// contentType:"application/json",
|
||||
success: function(result) {
|
||||
$("#trainCourseId").html("<option>---请选择---</option>");
|
||||
var rows =result.rows;
|
||||
for(var i in rows){
|
||||
$("#trainCourseId").append("<option value='"+rows[i].id+"'>"+rows[i].name+"</option>");
|
||||
}
|
||||
}
|
||||
};
|
||||
$.ajax(config)
|
||||
})
|
||||
|
||||
$("#form-examPractice-add").validate({
|
||||
rules:{
|
||||
xxxx:{
|
||||
|
|
@ -68,6 +100,40 @@
|
|||
$.operate.save(prefix + "/add", $('#form-examPractice-add').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
var trainCategoryId = 100;
|
||||
function selectTrainCategoryTree(){
|
||||
var options = {
|
||||
title: '课程分类选择',
|
||||
width: "380",
|
||||
url: ctx + "train/course/category" + "/selectCategoryTree/"+trainCategoryId,
|
||||
callBack: doSubmitForTrainCategory
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
function doSubmitForTrainCategory(index, layero){
|
||||
var body = layer.getChildFrame('body', index);
|
||||
trainCategoryId = body.find('#treeId').val()
|
||||
$("#trainCateGoryName").val(body.find('#treeName').val());
|
||||
layer.close(index);
|
||||
|
||||
var config = {
|
||||
url: ctx + "train/trainCourse"+ "/list",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {trainCourseCategoryId:trainCategoryId},
|
||||
// contentType:"application/json",
|
||||
success: function(result) {
|
||||
$("#trainCourseId").html("<option>---请选择---</option>");
|
||||
var rows =result.rows;
|
||||
for(var i in rows){
|
||||
$("#trainCourseId").append("<option value='"+rows[i].id+"'>"+rows[i].name+"</option>");
|
||||
}
|
||||
}
|
||||
};
|
||||
$.ajax(config)
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -6,13 +6,26 @@
|
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-examPractice-edit" th:object="${examPractice}">
|
||||
<input id="id" name="id" th:field="*{id}" type="hidden">
|
||||
|
||||
<input id="trainId" name="trainId" th:value="${examPractice.trainCourseId}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">练习名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="name" name="name" th:field="*{name}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">课程选择:</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="trainCateGoryName" name="trainCateGoryName" value="课程分类" onclick="selectTrainCategoryTree()" class="form-control" type="text" readonly="true">
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<select id="trainCourseId" name="trainCourseId" class="form-control m-b" >
|
||||
<option>---请选择---</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">是否控制开始结束时间:</label>
|
||||
|
||||
|
|
@ -55,6 +68,27 @@
|
|||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "exam/examPractice"
|
||||
|
||||
$(function(){
|
||||
var config = {
|
||||
url: ctx + "train/trainCourse"+ "/list",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {trainCourseCategoryId:100},
|
||||
// contentType:"application/json",
|
||||
success: function(result) {
|
||||
$("#trainCourseId").html("<option>---请选择---</option>");
|
||||
var id = $("#trainId").val();
|
||||
var rows =result.rows;
|
||||
for(var i in rows){
|
||||
$("#trainCourseId").append("<option value='"+rows[i].id+"'>"+rows[i].name+"</option>");
|
||||
}
|
||||
$("#trainCourseId").val(id);
|
||||
}
|
||||
};
|
||||
$.ajax(config)
|
||||
})
|
||||
|
||||
$("#form-examPractice-edit").validate({
|
||||
rules:{
|
||||
xxxx:{
|
||||
|
|
@ -68,6 +102,40 @@
|
|||
$.operate.save(prefix + "/edit", $('#form-examPractice-edit').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
var trainCategoryId = 100;
|
||||
function selectTrainCategoryTree(){
|
||||
var options = {
|
||||
title: '课程分类选择',
|
||||
width: "380",
|
||||
url: ctx + "train/course/category" + "/selectCategoryTree/"+trainCategoryId,
|
||||
callBack: doSubmitForTrainCategory
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
function doSubmitForTrainCategory(index, layero){
|
||||
var body = layer.getChildFrame('body', index);
|
||||
trainCategoryId = body.find('#treeId').val()
|
||||
$("#trainCateGoryName").val(body.find('#treeName').val());
|
||||
layer.close(index);
|
||||
|
||||
var config = {
|
||||
url: ctx + "train/trainCourse"+ "/list",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {trainCourseCategoryId:trainCategoryId},
|
||||
// contentType:"application/json",
|
||||
success: function(result) {
|
||||
$("#trainCourseId").html("<option>---请选择---</option>");
|
||||
var rows =result.rows;
|
||||
for(var i in rows){
|
||||
$("#trainCourseId").append("<option value='"+rows[i].id+"'>"+rows[i].name+"</option>");
|
||||
}
|
||||
}
|
||||
};
|
||||
$.ajax(config)
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Reference in New Issue