|
|
|
@ -5,32 +5,38 @@
|
|
|
|
|
position: relative;
|
|
|
|
|
overflow: visible !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.layui-table a {
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
#addGeneral_demo .layui-form-item{
|
|
|
|
|
|
|
|
|
|
#addGeneral_demo .layui-form-item {
|
|
|
|
|
margin-bottom: 5px;
|
|
|
|
|
}
|
|
|
|
|
#addGeneral_demo .layui-table td{
|
|
|
|
|
|
|
|
|
|
#addGeneral_demo .layui-table td {
|
|
|
|
|
padding: 5px 10px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<layui:searchForm formId="searchForm" searchList="" condition="${search}">
|
|
|
|
|
<input name="businessId" type="hidden" title="课程ID" value="${courseInfoId}" />
|
|
|
|
|
<input name="businessId" type="hidden" title="课程ID" value="${courseInfoId}"/>
|
|
|
|
|
</layui:searchForm>
|
|
|
|
|
|
|
|
|
|
<div class="layui-btn-group">
|
|
|
|
|
<!-- <layui:accessButton function="courseInfo.query" id="searchFormSearch" action="search"><i class="layui-icon"></i>搜索</layui:accessButton>-->
|
|
|
|
|
<layui:accessButton function="courseInfo.add" action="add"><i class="layui-icon"></i>新增</layui:accessButton>
|
|
|
|
|
<layui:accessButton function="courseInfo.query" action="refresh"><i class="layui-icon"></i>刷新</layui:accessButton>
|
|
|
|
|
<button class="layui-btn layui-btn-primary" type="button" style="border:1px solid #afafaf" onclick="Lib.closeFrame()">返回</button>
|
|
|
|
|
<!-- <layui:accessButton function="courseInfo.query" id="searchFormSearch" action="search"><i class="layui-icon"></i>搜索</layui:accessButton>-->
|
|
|
|
|
<layui:accessButton function="courseInfo.add" action="add"><i class="layui-icon"></i>新增</layui:accessButton>
|
|
|
|
|
<layui:accessButton function="courseInfo.query" action="refresh"><i class="layui-icon"></i>刷新
|
|
|
|
|
</layui:accessButton>
|
|
|
|
|
<button class="layui-btn layui-btn-primary" type="button" style="border:1px solid #afafaf"
|
|
|
|
|
onclick="Lib.closeFrame()">返回
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<table id="courseInfoTable" lay-filter="courseInfoTable"></table>
|
|
|
|
|
<!--#} -->
|
|
|
|
|
<div id="addGeneral_demo" class="layui-form" style="display: none;padding: 20px 20px 0px 0;overflow: auto;">
|
|
|
|
|
<div id="addGeneral_view" class="layui-form-item" ></div>
|
|
|
|
|
<div id="addGeneral_view" class="layui-form-item"></div>
|
|
|
|
|
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<label class="layui-form-label">题目来源</label>
|
|
|
|
@ -43,19 +49,22 @@
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<label class="layui-form-label">考试标题</label>
|
|
|
|
|
<div class="layui-input-block">
|
|
|
|
|
<input type="text" name="generalQuestionSettingName" placeholder="请输入考证名称" value="{{d.generalQuestionSettingName ||''}}" autocomplete="off" class="layui-input">
|
|
|
|
|
<input type="text" name="generalQuestionSettingName" placeholder="请输入考证名称"
|
|
|
|
|
value="{{d.generalQuestionSettingName ||''}}" autocomplete="off" class="layui-input">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<label class="layui-form-label">考试时间</label>
|
|
|
|
|
<div class="layui-input-block">
|
|
|
|
|
<input type="text" id="examTime_" name="examTime_" placeholder="请选择时间" value="" autocomplete="off" class="layui-input">
|
|
|
|
|
<input type="text" id="examTime_" name="examTime_" placeholder="请选择时间" value="" autocomplete="off"
|
|
|
|
|
class="layui-input">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<label class="layui-form-label">作答次数</label>
|
|
|
|
|
<div class="layui-input-block">
|
|
|
|
|
<input type="text" name="generalQuestionSettingDoCount" value="{{d.generalQuestionSettingDoCount ||''}}" placeholder="请输入作答次数" autocomplete="off" class="layui-input">
|
|
|
|
|
<input type="text" name="generalQuestionSettingDoCount" value="{{d.generalQuestionSettingDoCount ||''}}"
|
|
|
|
|
placeholder="请输入作答次数" autocomplete="off" class="layui-input">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
@ -63,29 +72,37 @@
|
|
|
|
|
<div class="layui-input-block">
|
|
|
|
|
<label style="width: 50%;float:left;">
|
|
|
|
|
<span style="float: left;width: 155px;line-height: 38px;">题目乱序(同一大题)</span>
|
|
|
|
|
<input type="radio" name="generalQuestionSettingQuestionNoOrder" value="1" title="是" {{d.generalQuestionSettingQuestionNoOrder==1||d.generalQuestionSettingQuestionNoOrder==null?'checked':''}}>
|
|
|
|
|
<input type="radio" name="generalQuestionSettingQuestionNoOrder" value="2" title="否" {{d.generalQuestionSettingQuestionNoOrder==2?'checked':''}}>
|
|
|
|
|
<input type="radio" lay-filter="generalQuestionSettingQuestionNoOrder" name="generalQuestionSettingQuestionNoOrder" value="1" title="是"
|
|
|
|
|
{{d.generalQuestionSettingQuestionNoOrder==1||d.generalQuestionSettingQuestionNoOrder==null?'checked':''}}>
|
|
|
|
|
<input type="radio" lay-filter="generalQuestionSettingQuestionNoOrder" name="generalQuestionSettingQuestionNoOrder" value="2" title="否"
|
|
|
|
|
{{d.generalQuestionSettingQuestionNoOrder==2?'checked':''}}>
|
|
|
|
|
</label>
|
|
|
|
|
<label style="width: 50%;float:left;">
|
|
|
|
|
<span style="float: left;width: 155px;line-height: 38px;">选项乱序(同一大题内)</span>
|
|
|
|
|
<input type="radio" name="generalQuestionSettingOptionNoOrder" value="1" title="是" {{d.generalQuestionSettingOptionNoOrder==1||d.generalQuestionSettingOptionNoOrder==null?'checked':''}}>
|
|
|
|
|
<input type="radio" name="generalQuestionSettingOptionNoOrder" value="2" title="否" {{d.generalQuestionSettingOptionNoOrder==2?'checked':''}}>
|
|
|
|
|
<input type="radio" lay-filter="generalQuestionSettingOptionNoOrder" name="generalQuestionSettingOptionNoOrder" value="1" title="是"
|
|
|
|
|
{{d.generalQuestionSettingOptionNoOrder==1||d.generalQuestionSettingOptionNoOrder==null?'checked':''}}>
|
|
|
|
|
<input type="radio" lay-filter="generalQuestionSettingOptionNoOrder" name="generalQuestionSettingOptionNoOrder" value="2" title="否"
|
|
|
|
|
{{d.generalQuestionSettingOptionNoOrder==2?'checked':''}}>
|
|
|
|
|
</label>
|
|
|
|
|
<label style="width: 50%;float:left;">
|
|
|
|
|
<span style="float: left;width: 155px;line-height: 38px;">答卷后显示答案解析</span>
|
|
|
|
|
<input type="radio" name="generalQuestionSettingEndShowQa" value="1" title="是" {{d.generalQuestionSettingEndShowQa==1||d.generalQuestionSettingEndShowQa==null?'checked':''}}>
|
|
|
|
|
<input type="radio" name="generalQuestionSettingEndShowQa" value="2" title="否" {{d.generalQuestionSettingEndShowQa==2?'checked':''}}>
|
|
|
|
|
<input type="radio" lay-filter="generalQuestionSettingEndShowQa" name="generalQuestionSettingEndShowQa" value="1" title="是"
|
|
|
|
|
{{d.generalQuestionSettingEndShowQa==1||d.generalQuestionSettingEndShowQa==null?'checked':''}}>
|
|
|
|
|
<input type="radio" lay-filter="generalQuestionSettingEndShowQa" name="generalQuestionSettingEndShowQa" value="2" title="否"
|
|
|
|
|
{{d.generalQuestionSettingEndShowQa==2?'checked':''}}>
|
|
|
|
|
</label>
|
|
|
|
|
<label style="width: 50%;float:left;">
|
|
|
|
|
<span style="float: left;width: 155px;line-height: 38px;">答卷后显示答案对错</span>
|
|
|
|
|
<input type="radio" name="generalQuestionSettingEndShowTrueFalse" value="1" title="是" {{d.generalQuestionSettingEndShowTrueFalse==1||d.generalQuestionSettingEndShowQa==null?'checked':''}}>
|
|
|
|
|
<input type="radio" name="generalQuestionSettingEndShowTrueFalse" value="2" title="否" {{d.generalQuestionSettingEndShowTrueFalse==2?'checked':''}}>
|
|
|
|
|
<input type="radio" lay-filter="generalQuestionSettingEndShowTrueFalse" name="generalQuestionSettingEndShowTrueFalse" value="1" title="是"
|
|
|
|
|
{{d.generalQuestionSettingEndShowTrueFalse==1||d.generalQuestionSettingEndShowQa==null?'checked':''}}>
|
|
|
|
|
<input type="radio" lay-filter="generalQuestionSettingEndShowTrueFalse" name="generalQuestionSettingEndShowTrueFalse" value="2" title="否"
|
|
|
|
|
{{d.generalQuestionSettingEndShowTrueFalse==2?'checked':''}}>
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<div id="question_view" class="layui-form-item" ></div>
|
|
|
|
|
<div id="question_view" class="layui-form-item"></div>
|
|
|
|
|
<script type="text/html" id="question_demo">
|
|
|
|
|
<label class="layui-form-label">题目设置</label>
|
|
|
|
|
<div class="layui-input-block">
|
|
|
|
@ -97,7 +114,7 @@
|
|
|
|
|
<td style="width: 100px">分值</td>
|
|
|
|
|
<td>合计</td>
|
|
|
|
|
</tr>
|
|
|
|
|
{{# var i = 0,hjQNum = 0;layui.each(d.list, function(index, item){ i++;hjQNum += item.totalCount;}}
|
|
|
|
|
{{# var i = 0,hjQNum = 0;layui.each(d.list, function(index, item){ i++;hjQNum += item.totalCount;}}
|
|
|
|
|
<tr class="tjTr">
|
|
|
|
|
<td class="typeName" inName="{{item.questionType}}">{{item.questionTypeText}}</td>
|
|
|
|
|
<td class="totalCount">{{item.totalCount}}</td>
|
|
|
|
@ -118,10 +135,10 @@
|
|
|
|
|
<td><span name="hjNum">{{d.hjNum || ''}}</span></td>
|
|
|
|
|
</tr>
|
|
|
|
|
{{#}}}
|
|
|
|
|
{{# }); }}
|
|
|
|
|
{{# if(d.list.length === 0){ }}
|
|
|
|
|
{{# }); }}
|
|
|
|
|
{{# if(d.list.length === 0){ }}
|
|
|
|
|
无数据
|
|
|
|
|
{{# } }}
|
|
|
|
|
{{# } }}
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</script>
|
|
|
|
@ -129,7 +146,7 @@
|
|
|
|
|
<script type="text/javascript" src="${ctxPath}/plugins/xm-select.js?v=${jsVer}"></script>
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
layui.define([ 'form', 'laydate', 'table','laytpl' ], function(exports) {
|
|
|
|
|
layui.define(['form', 'laydate', 'table', 'laytpl'], function (exports) {
|
|
|
|
|
var form = layui.form;
|
|
|
|
|
var laydate = layui.laydate;
|
|
|
|
|
var table = layui.table;
|
|
|
|
@ -138,113 +155,121 @@
|
|
|
|
|
var courseInfoList = [];
|
|
|
|
|
var questionSettingOptions = []; //出题内容
|
|
|
|
|
var xmSeInitValue = $("#searchForm input[name='businessId']").val();
|
|
|
|
|
var generalQuestionSettingQuestionNoOrder;
|
|
|
|
|
var generalQuestionSettingOptionNoOrder;
|
|
|
|
|
var generalQuestionSettingEndShowQa;
|
|
|
|
|
var generalQuestionSettingEndShowTrueFalse;
|
|
|
|
|
|
|
|
|
|
var demo1 = xmSelect.render({
|
|
|
|
|
el: '#demo1',
|
|
|
|
|
language: 'zn',
|
|
|
|
|
name: 'sourceCourseInfoIds',
|
|
|
|
|
data: [],
|
|
|
|
|
initValue:[xmSeInitValue],
|
|
|
|
|
on: function(data){
|
|
|
|
|
getQuestionTypeGroupInfo(Common.concatBatchId(data.arr,'id'),{});
|
|
|
|
|
initValue: [xmSeInitValue],
|
|
|
|
|
on: function (data) {
|
|
|
|
|
getQuestionTypeGroupInfo(Common.concatBatchId(data.arr, 'id'), {});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var view ={
|
|
|
|
|
init:function(){
|
|
|
|
|
var view = {
|
|
|
|
|
init: function () {
|
|
|
|
|
this.initTable();
|
|
|
|
|
this.initSearchForm();
|
|
|
|
|
this.initToolBar();
|
|
|
|
|
window.dataReload = function(){
|
|
|
|
|
Lib.doSearchForm($("#searchForm"),courseInfoTable)
|
|
|
|
|
window.dataReload = function () {
|
|
|
|
|
Lib.doSearchForm($("#searchForm"), courseInfoTable)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
initTable:function(){
|
|
|
|
|
initTable: function () {
|
|
|
|
|
courseInfoTable = table.render({
|
|
|
|
|
elem : '#courseInfoTable',
|
|
|
|
|
height : Lib.getTableHeight(),
|
|
|
|
|
elem: '#courseInfoTable',
|
|
|
|
|
height: Lib.getTableHeight(),
|
|
|
|
|
cellMinWidth: 100,
|
|
|
|
|
method : 'post',
|
|
|
|
|
even:true,
|
|
|
|
|
size:"lg",
|
|
|
|
|
where:$("#searchForm").serializeJson(),
|
|
|
|
|
url : Common.ctxPath + '/api/generalQuestionSetting/getPageList.do' // 数据接口
|
|
|
|
|
,page : Lib.tablePage // 开启分页
|
|
|
|
|
,limit : 10,
|
|
|
|
|
cols : [ [ // 表头
|
|
|
|
|
method: 'post',
|
|
|
|
|
even: true,
|
|
|
|
|
size: "lg",
|
|
|
|
|
where: $("#searchForm").serializeJson(),
|
|
|
|
|
url: Common.ctxPath + '/api/generalQuestionSetting/getPageList.do' // 数据接口
|
|
|
|
|
, page: Lib.tablePage // 开启分页
|
|
|
|
|
, limit: 10,
|
|
|
|
|
cols: [[ // 表头
|
|
|
|
|
{
|
|
|
|
|
field : 'generalQuestionSettingName',
|
|
|
|
|
title : '考证名称',align:"center"
|
|
|
|
|
field: 'generalQuestionSettingName',
|
|
|
|
|
title: '考证名称', align: "center"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'generalQuestionEndTime',
|
|
|
|
|
title : '考试时间',align:"center", templet: function (d) {
|
|
|
|
|
field: 'generalQuestionEndTime',
|
|
|
|
|
title: '考试时间', align: "center", templet: function (d) {
|
|
|
|
|
return d.generalQuestionStartTime + " 至 " + d.generalQuestionEndTime;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'generalQuestionSettingDoCount',
|
|
|
|
|
title : '作答次数',align:"center"
|
|
|
|
|
field: 'generalQuestionSettingDoCount',
|
|
|
|
|
title: '作答次数', align: "center"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'generalQuestionSettingAddTime',
|
|
|
|
|
title : '创建时间',align:"center",width: 160
|
|
|
|
|
field: 'generalQuestionSettingAddTime',
|
|
|
|
|
title: '创建时间', align: "center", width: 160
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'generalQuestionSettingPushStatus',width: 100,title : '状态',align:"center", templet: function (d) {
|
|
|
|
|
if(d.generalQuestionSettingPushStatus == 'PUSH'){
|
|
|
|
|
field: 'generalQuestionSettingPushStatus',
|
|
|
|
|
width: 100,
|
|
|
|
|
title: '状态',
|
|
|
|
|
align: "center",
|
|
|
|
|
templet: function (d) {
|
|
|
|
|
if (d.generalQuestionSettingPushStatus == 'PUSH') {
|
|
|
|
|
return "<span style='color:#73a2f8; '>发布</span>";
|
|
|
|
|
}else if(d.generalQuestionSettingPushStatus == "UN_PUSH"){
|
|
|
|
|
} else if (d.generalQuestionSettingPushStatus == "UN_PUSH") {
|
|
|
|
|
return "<span style='color: red;'>未发布</span>";
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
return "-";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'userId',width:300,title : '操作',align:"center", templet: function (d) {
|
|
|
|
|
field: 'userId', width: 300, title: '操作', align: "center", templet: function (d) {
|
|
|
|
|
var htm = "";
|
|
|
|
|
if (d.generalQuestionSettingPushStatus != 'PUSH'){
|
|
|
|
|
htm += '<a class="layui-table-link" lay-event="edit">编辑</a>';
|
|
|
|
|
if (d.generalQuestionSettingPushStatus != 'PUSH') {
|
|
|
|
|
htm += '<a class="layui-table-link" lay-event="edit">编辑</a>';
|
|
|
|
|
}
|
|
|
|
|
// htm += '<a class="layui-table-link" lay-event="examInfo">考证信息</a>';
|
|
|
|
|
// var htm = '<a class="layui-table-link" lay-event="courseConfigure">课程配置</a>';
|
|
|
|
|
htm += '<a class="layui-table-link" lay-event="editStatus">'+(d.generalQuestionSettingPushStatus == 'PUSH'?"取消发布":"发布")+'</a>';
|
|
|
|
|
htm += '<a class="layui-table-link" lay-event="editStatus">' + (d.generalQuestionSettingPushStatus == 'PUSH' ? "取消发布" : "发布") + '</a>';
|
|
|
|
|
htm += '<a class="layui-table-link" lay-event="del">删除</a>';
|
|
|
|
|
return htm;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
] ]
|
|
|
|
|
]]
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
table.on('checkbox(courseInfoTable)', function(obj){
|
|
|
|
|
table.on('checkbox(courseInfoTable)', function (obj) {
|
|
|
|
|
var courseInfo = obj.data;
|
|
|
|
|
if(obj.checked){
|
|
|
|
|
if (obj.checked) {
|
|
|
|
|
//按钮逻辑Lib.buttonEnable()
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
initSearchForm:function(){
|
|
|
|
|
Lib.initSearchForm( $("#searchForm"),courseInfoTable,form);
|
|
|
|
|
initSearchForm: function () {
|
|
|
|
|
Lib.initSearchForm($("#searchForm"), courseInfoTable, form);
|
|
|
|
|
},
|
|
|
|
|
initToolBar:function(){
|
|
|
|
|
initToolBar: function () {
|
|
|
|
|
toolbar = {
|
|
|
|
|
add : function() { // 获取选中数据
|
|
|
|
|
add: function () { // 获取选中数据
|
|
|
|
|
addGeneral({});
|
|
|
|
|
},
|
|
|
|
|
refresh: function () {//刷新
|
|
|
|
|
searchForm.reset();
|
|
|
|
|
Lib.doSearchForm($("#searchForm"), courseInfoTable, 1);
|
|
|
|
|
},
|
|
|
|
|
search:function () {
|
|
|
|
|
search: function () {
|
|
|
|
|
Lib.doSearchForm($("#searchForm"), courseInfoTable, 1);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
$('.ext-toolbar').on('click', function() {
|
|
|
|
|
$('.ext-toolbar').on('click', function () {
|
|
|
|
|
var type = $(this).data('type');
|
|
|
|
|
toolbar[type] ? toolbar[type].call(this) : '';
|
|
|
|
|
});
|
|
|
|
@ -252,7 +277,7 @@
|
|
|
|
|
var data = obj.data;
|
|
|
|
|
if (obj.event === 'edit') {
|
|
|
|
|
addGeneral(data);
|
|
|
|
|
}else if(obj.event === "del"){
|
|
|
|
|
} else if (obj.event === "del") {
|
|
|
|
|
layer.confirm('是否确定删除该课程?', function (index) { //courseInfoStatus:状态(1启用 2禁用 3删除)
|
|
|
|
|
var ret = Common.postAjax("/api/generalQuestionSetting/logicDelete.do", {ids: data.generalQuestionSettingId});
|
|
|
|
|
layer.msg(ret.code == 0 ? "删除成功!" : ret.msg, {
|
|
|
|
@ -265,38 +290,38 @@
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}else if(obj.event === "courseConfigure"){ //跳转至课程配置
|
|
|
|
|
if(data.courseInfoStatus == 1){
|
|
|
|
|
} else if (obj.event === "courseConfigure") { //跳转至课程配置
|
|
|
|
|
if (data.courseInfoStatus == 1) {
|
|
|
|
|
Common.info("课程配置时,请先禁用课程。配置完成后再启用课程")
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var url = "/jlw/courseInfo/courseConfigureNew.do?courseInfoId="+data.courseInfoId;
|
|
|
|
|
Common.openDlg(url,"");
|
|
|
|
|
}else if(obj.event === "editStatus"){ //启用
|
|
|
|
|
var url = "/jlw/courseInfo/courseConfigureNew.do?courseInfoId=" + data.courseInfoId;
|
|
|
|
|
Common.openDlg(url, "");
|
|
|
|
|
} else if (obj.event === "editStatus") { //启用
|
|
|
|
|
var param = {
|
|
|
|
|
ids:data.generalQuestionSettingId,
|
|
|
|
|
pushStatus:data.generalQuestionSettingPushStatus == 'PUSH'?'UN_PUSH':'PUSH' //状态(1启用 2禁用 3删除)
|
|
|
|
|
ids: data.generalQuestionSettingId,
|
|
|
|
|
pushStatus: data.generalQuestionSettingPushStatus == 'PUSH' ? 'UN_PUSH' : 'PUSH' //状态(1启用 2禁用 3删除)
|
|
|
|
|
}
|
|
|
|
|
editCourseInfoStatus(param);
|
|
|
|
|
}else if(obj.event === "examInfo"){ //考证信息List
|
|
|
|
|
var url = "/jlw/courseInfo/examInfoList.do?courseInfoId="+data.courseInfoId;
|
|
|
|
|
Common.openDlg(url,"");
|
|
|
|
|
} else if (obj.event === "examInfo") { //考证信息List
|
|
|
|
|
var url = "/jlw/courseInfo/examInfoList.do?courseInfoId=" + data.courseInfoId;
|
|
|
|
|
Common.openDlg(url, "");
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//修改状态
|
|
|
|
|
function editCourseInfoStatus(param){
|
|
|
|
|
layer.confirm('是否确定<span style=\'color: red;\'> '+(param.pushStatus == 'PUSH'?"发布":"取消发布")+' </span>该考试?', function (index) {
|
|
|
|
|
function editCourseInfoStatus(param) {
|
|
|
|
|
layer.confirm('是否确定<span style=\'color: red;\'> ' + (param.pushStatus == 'PUSH' ? "发布" : "取消发布") + ' </span>该考试?', function (index) {
|
|
|
|
|
layer.close(index);
|
|
|
|
|
var ret = Common.postAjax("/api/generalQuestionSetting/editPushStatus.do",param);
|
|
|
|
|
layer.msg(ret.code == 0?"操作成功!":ret.msg, {
|
|
|
|
|
var ret = Common.postAjax("/api/generalQuestionSetting/editPushStatus.do", param);
|
|
|
|
|
layer.msg(ret.code == 0 ? "操作成功!" : ret.msg, {
|
|
|
|
|
offset: ['50%'],
|
|
|
|
|
icon: ret.code == 0?1:2,
|
|
|
|
|
shade:0.3,
|
|
|
|
|
icon: ret.code == 0 ? 1 : 2,
|
|
|
|
|
shade: 0.3,
|
|
|
|
|
time: 1500 //2秒关闭(如果不配置,默认是3秒)
|
|
|
|
|
},function (){
|
|
|
|
|
if(ret.code == 0){
|
|
|
|
|
}, function () {
|
|
|
|
|
if (ret.code == 0) {
|
|
|
|
|
Lib.tableRefresh();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -304,79 +329,93 @@
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//添加考试信息
|
|
|
|
|
function addGeneral(data){
|
|
|
|
|
getQuestionTypeGroupInfo($.isEmpty(data.generalQuestionSettingId)?xmSeInitValue:data.sourceCourseInfoIds,data);
|
|
|
|
|
if (courseInfoList.length <= 0){
|
|
|
|
|
var ret = Common.getAjax("/jlw/courseInfo/getValues.json",{"courseLabelType":"考证课程类","courseInfoStatus":1,courseInfoType:1});
|
|
|
|
|
if (ret.code == 0){
|
|
|
|
|
function addGeneral(data) {
|
|
|
|
|
getQuestionTypeGroupInfo($.isEmpty(data.generalQuestionSettingId) ? xmSeInitValue : data.sourceCourseInfoIds, data);
|
|
|
|
|
if (courseInfoList.length <= 0) {
|
|
|
|
|
var ret = Common.getAjax("/jlw/courseInfo/getValues.json", {
|
|
|
|
|
"courseLabelType": "考证课程类",
|
|
|
|
|
"courseInfoStatus": 1,
|
|
|
|
|
courseInfoType: 1
|
|
|
|
|
});
|
|
|
|
|
if (ret.code == 0) {
|
|
|
|
|
courseInfoList = ret.data;
|
|
|
|
|
demo1.update({
|
|
|
|
|
data: ret.data
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ($.isEmpty(data.generalQuestionSettingId)){
|
|
|
|
|
if ($.isEmpty(data.generalQuestionSettingId)) {
|
|
|
|
|
demo1.update({
|
|
|
|
|
data: courseInfoList,
|
|
|
|
|
initValue: [xmSeInitValue]
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
demo1.update({
|
|
|
|
|
data: courseInfoList,
|
|
|
|
|
initValue: $.isEmpty(data.sourceCourseInfoIds)?[]:data.sourceCourseInfoIds.split(",")
|
|
|
|
|
initValue: $.isEmpty(data.sourceCourseInfoIds) ? [] : data.sourceCourseInfoIds.split(",")
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
layer.open({
|
|
|
|
|
type: 1
|
|
|
|
|
, title: '配置考证信息'
|
|
|
|
|
,fixed:false//固定页面后,弹出框随着滚动
|
|
|
|
|
, fixed: false//固定页面后,弹出框随着滚动
|
|
|
|
|
, shadeClose: true
|
|
|
|
|
,offset:'30px'
|
|
|
|
|
,area: ['800px', '630px']
|
|
|
|
|
, offset: '30px'
|
|
|
|
|
, area: ['800px', '630px']
|
|
|
|
|
, scrollbar: true//滚动条
|
|
|
|
|
, content: $("#addGeneral_demo")
|
|
|
|
|
, btn: ['保存','关闭']
|
|
|
|
|
,success:function () {
|
|
|
|
|
, btn: ['保存', '关闭']
|
|
|
|
|
, success: function () {
|
|
|
|
|
var getTpl = addGeneral_html_demo.innerHTML
|
|
|
|
|
,view = document.getElementById('addGeneral_view');
|
|
|
|
|
laytpl(getTpl).render(data, function(html){
|
|
|
|
|
, view = document.getElementById('addGeneral_view');
|
|
|
|
|
laytpl(getTpl).render(data, function (html) {
|
|
|
|
|
view.innerHTML = html;
|
|
|
|
|
laydate.render({
|
|
|
|
|
elem: '#examTime_'
|
|
|
|
|
,range: "至" //或 range: '~' 来自定义分割字符
|
|
|
|
|
,type: 'datetime'
|
|
|
|
|
,value: $.isEmpty(data.generalQuestionStartTime)?'':(data.generalQuestionStartTime+' 至 '+data.generalQuestionEndTime)
|
|
|
|
|
,format: 'yyyy-MM-dd HH:mm:ss'
|
|
|
|
|
,
|
|
|
|
|
range: "至" //或 range: '~' 来自定义分割字符
|
|
|
|
|
,
|
|
|
|
|
type: 'datetime'
|
|
|
|
|
,
|
|
|
|
|
value: $.isEmpty(data.generalQuestionStartTime) ? '' : (data.generalQuestionStartTime + ' 至 ' + data.generalQuestionEndTime)
|
|
|
|
|
,
|
|
|
|
|
format: 'yyyy-MM-dd HH:mm:ss'
|
|
|
|
|
});
|
|
|
|
|
form.render();
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
form.render();
|
|
|
|
|
}
|
|
|
|
|
, yes: function (index, layero) {
|
|
|
|
|
var param = {generalQuestionSettingType:"EXAM",businessId:xmSeInitValue,businessType:"FROM_SYSTEM"};
|
|
|
|
|
var param = {
|
|
|
|
|
generalQuestionSettingType: "EXAM",
|
|
|
|
|
businessId: xmSeInitValue,
|
|
|
|
|
businessType: "FROM_SYSTEM"
|
|
|
|
|
};
|
|
|
|
|
var generalQuestionSettingName = $("#addGeneral_demo input[name='generalQuestionSettingName']").val();
|
|
|
|
|
if ($.isEmpty(generalQuestionSettingName)){
|
|
|
|
|
Common.info("请输入考试标题!");
|
|
|
|
|
if ($.isEmpty(generalQuestionSettingName)) {
|
|
|
|
|
Common.info("请输入考试标题!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var examTime_ = $("#examTime_").val();
|
|
|
|
|
if(!$.isEmpty(examTime_)){
|
|
|
|
|
if (!$.isEmpty(examTime_)) {
|
|
|
|
|
param.generalQuestionStartTime = examTime_.split("至")[0];
|
|
|
|
|
param.generalQuestionEndTime = examTime_.split("至")[1];
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
Common.info("请选择考试时间!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var generalQuestionSettingDoCount = $("#addGeneral_demo input[name='generalQuestionSettingDoCount']").val();
|
|
|
|
|
if ($.isEmpty(generalQuestionSettingDoCount)){
|
|
|
|
|
if ($.isEmpty(generalQuestionSettingDoCount)) {
|
|
|
|
|
Common.info("请输入作答次数!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
questionSettingOptions = [];
|
|
|
|
|
$(".tjTr").each(function (i,k){
|
|
|
|
|
$(".tjTr").each(function (i, k) {
|
|
|
|
|
var tnum = $(k).find("input[name='tnum']").val();
|
|
|
|
|
var tfnum = $(k).find("input[name='tfnum']").val();
|
|
|
|
|
if (tnum > 0 && tfnum > 0){
|
|
|
|
|
if (tnum > 0 && tfnum > 0) {
|
|
|
|
|
var questionTypeText = $(k).find(".typeName").text();
|
|
|
|
|
var questionType = $(k).find(".typeName").attr("inName");
|
|
|
|
|
var totalCount = $(k).find(".totalCount").text();
|
|
|
|
@ -390,17 +429,17 @@
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (questionSettingOptions.length <= 0){
|
|
|
|
|
if (questionSettingOptions.length <= 0) {
|
|
|
|
|
Common.info("请输入抽取题目数量!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var sourceCourseInfoIds = $("#addGeneral_demo input[name='sourceCourseInfoIds']").val(); //题目来源课程
|
|
|
|
|
param.sourceCourseInfoIds = sourceCourseInfoIds;
|
|
|
|
|
param.questionSettingOptions = questionSettingOptions;
|
|
|
|
|
var generalQuestionSettingQuestionNoOrder = $("#addGeneral_demo input[name='generalQuestionSettingQuestionNoOrder']:checked").val();
|
|
|
|
|
/*var generalQuestionSettingQuestionNoOrder = $("#addGeneral_demo input[name='generalQuestionSettingQuestionNoOrder']:checked").val();
|
|
|
|
|
var generalQuestionSettingOptionNoOrder = $("#addGeneral_demo input[name='generalQuestionSettingOptionNoOrder']:checked").val();
|
|
|
|
|
var generalQuestionSettingEndShowQa = $("#addGeneral_demo input[name='generalQuestionSettingEndShowQa']:checked").val();
|
|
|
|
|
var generalQuestionSettingEndShowTrueFalse = $("#addGeneral_demo input[name='generalQuestionSettingEndShowTrueFalse']:checked").val();
|
|
|
|
|
var generalQuestionSettingEndShowTrueFalse = $("#addGeneral_demo input[name='generalQuestionSettingEndShowTrueFalse']:checked").val();*/
|
|
|
|
|
param.generalQuestionSettingQuestionNoOrder = generalQuestionSettingQuestionNoOrder;
|
|
|
|
|
param.generalQuestionSettingOptionNoOrder = generalQuestionSettingOptionNoOrder;
|
|
|
|
|
param.generalQuestionSettingEndShowQa = generalQuestionSettingEndShowQa;
|
|
|
|
@ -408,11 +447,12 @@
|
|
|
|
|
param.generalQuestionSettingName = generalQuestionSettingName;
|
|
|
|
|
param.generalQuestionSettingDoCount = generalQuestionSettingDoCount;
|
|
|
|
|
param.generalQuestionSettingId = data.generalQuestionSettingId;
|
|
|
|
|
|
|
|
|
|
var url = "/api/generalQuestionSetting/addQuestionByType.do";
|
|
|
|
|
if (!$.isEmpty(param.generalQuestionSettingId)){
|
|
|
|
|
if (!$.isEmpty(param.generalQuestionSettingId)) {
|
|
|
|
|
url = "/jlw/generalQuestionSetting/edit.json";
|
|
|
|
|
}
|
|
|
|
|
var ret = Common.postJSON(url,JSON.stringify(param));
|
|
|
|
|
var ret = Common.postJSON(url, JSON.stringify(param));
|
|
|
|
|
layer.msg(ret.code == 0 ? "保存成功!" : ret.msg, {
|
|
|
|
|
offset: ['50%'],
|
|
|
|
|
icon: ret.code == 0 ? 1 : 2,
|
|
|
|
@ -428,23 +468,38 @@
|
|
|
|
|
layer.close(index);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
form.render();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
form.on('radio(generalQuestionSettingQuestionNoOrder)', function (data) {
|
|
|
|
|
generalQuestionSettingQuestionNoOrder = data.value;
|
|
|
|
|
});
|
|
|
|
|
form.on('radio(generalQuestionSettingOptionNoOrder)', function (data) {
|
|
|
|
|
generalQuestionSettingOptionNoOrder = data.value;
|
|
|
|
|
});
|
|
|
|
|
form.on('radio(generalQuestionSettingEndShowQa)', function (data) {
|
|
|
|
|
generalQuestionSettingEndShowQa = data.value;
|
|
|
|
|
});
|
|
|
|
|
form.on('radio(generalQuestionSettingEndShowTrueFalse)', function (data) {
|
|
|
|
|
generalQuestionSettingEndShowTrueFalse = data.value;
|
|
|
|
|
});
|
|
|
|
|
//根据课程ID获取相应的题目数量及类型
|
|
|
|
|
function getQuestionTypeGroupInfo(ids,item){
|
|
|
|
|
function getQuestionTypeGroupInfo(ids, item) {
|
|
|
|
|
var map = {};
|
|
|
|
|
if (!$.isEmpty(item.questionSettingOptions)){
|
|
|
|
|
item.questionSettingOptions.forEach(function (it,i){
|
|
|
|
|
if (!$.isEmpty(item.questionSettingOptions)) {
|
|
|
|
|
item.questionSettingOptions.forEach(function (it, i) {
|
|
|
|
|
map[it.questionType] = it;
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
var ret = Common.postAjax("/api/resourcesQuestion/questionTypeGroupInfo.do",{courseInfoIdPlural:ids,courseLabelTypePlural:"考证课程类"});
|
|
|
|
|
if(ret.code == 0){
|
|
|
|
|
var ctNum = "",hjNum = "";
|
|
|
|
|
if (!$.isEmpty(ret.data)){
|
|
|
|
|
ctNum = 0,hjNum = 0;
|
|
|
|
|
ret.data.forEach(function (it,i){
|
|
|
|
|
if (!$.isEmpty(map[it.questionType])){
|
|
|
|
|
var ret = Common.postAjax("/api/resourcesQuestion/questionTypeGroupInfo.do", {
|
|
|
|
|
courseInfoIdPlural: ids,
|
|
|
|
|
courseLabelTypePlural: "考证课程类"
|
|
|
|
|
});
|
|
|
|
|
if (ret.code == 0) {
|
|
|
|
|
var ctNum = "", hjNum = "";
|
|
|
|
|
if (!$.isEmpty(ret.data)) {
|
|
|
|
|
ctNum = 0, hjNum = 0;
|
|
|
|
|
ret.data.forEach(function (it, i) {
|
|
|
|
|
if (!$.isEmpty(map[it.questionType])) {
|
|
|
|
|
ctNum = ctNum + map[it.questionType].selectCount;
|
|
|
|
|
hjNum = hjNum + map[it.questionType].singleTypeTotalScore;
|
|
|
|
|
it.selectCount = map[it.questionType].selectCount;
|
|
|
|
@ -454,11 +509,11 @@
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
var getTpl = question_demo.innerHTML
|
|
|
|
|
,view = document.getElementById('question_view');
|
|
|
|
|
laytpl(getTpl).render({list:ret.data,ctNum:ctNum,hjNum:hjNum}, function(html){
|
|
|
|
|
, view = document.getElementById('question_view');
|
|
|
|
|
laytpl(getTpl).render({list: ret.data, ctNum: ctNum, hjNum: hjNum}, function (html) {
|
|
|
|
|
view.innerHTML = html;
|
|
|
|
|
$("input[name='tnum'],input[name='tfnum']").unbind();
|
|
|
|
|
$("input[name='tnum'],input[name='tfnum']").change(function (){
|
|
|
|
|
$("input[name='tnum'],input[name='tfnum']").change(function () {
|
|
|
|
|
changeNum();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -467,9 +522,9 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//监听统计
|
|
|
|
|
function changeNum(){
|
|
|
|
|
var zf = 0,ct = 0;
|
|
|
|
|
$(".tjTr").each(function (i,k){
|
|
|
|
|
function changeNum() {
|
|
|
|
|
var zf = 0, ct = 0;
|
|
|
|
|
$(".tjTr").each(function (i, k) {
|
|
|
|
|
var tnum = $(k).find("input[name='tnum']").val();
|
|
|
|
|
var tfnum = $(k).find("input[name='tfnum']").val();
|
|
|
|
|
$(k).find(".hjfz").text((tnum * tfnum).toFixed(2));
|
|
|
|
@ -480,7 +535,7 @@
|
|
|
|
|
$("span[name='fzNum']").text();
|
|
|
|
|
$("span[name='hjNum']").text(zf);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
form.r
|
|
|
|
|
view.init();
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|