<!DOCTYPE html>
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
<head>
|
<th:block th:include="include :: header('题目列表列表')"/>
|
</head>
|
<body class="gray-bg">
|
<div class="container-div">
|
<div class="row">
|
<div class="col-sm-12 search-collapse">
|
<form id="formId">
|
<input type="hidden" value="" name="uuid" id="uuid" th:value="${param.uuid}"/>
|
<input type="hidden" value="" name="level-id" id='level-id' th:value="${param.levelId}"/>
|
<div class="select-list">
|
<ul>
|
<li>
|
<p>[[#{menu.exam.level.view}]]:</p>
|
<select class="form-control" name="questionTemplateId"
|
th:with="levels=${@examLevel.selectTExamLevelList()}" required>
|
<option value="">ALL</option>
|
<option th:each="level : ${levels}" th:text="${level.levelName}"
|
th:value="${level.questionTemplateId}"></option>
|
</select>
|
</li>
|
<li>
|
<p>[[#{jsp.exam.question.questionStem}]]:</p>
|
<input type="text" name="title"/>
|
</li>
|
<li>
|
<p>[[#{jsp.exam.demographyParam.languagetype}]]:</p>
|
<select name="langType" class="form-control m-b"
|
th:with="type=${@dict.getType('lang_type')}">
|
<option value="">ALL</option>
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
|
th:value="${dict.dictValue}"></option>
|
</select>
|
</li>
|
<li>
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
|
class="fa fa-search"></i> [[#{basis.search}]]</a>
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
|
class="fa fa-refresh"></i> [[#{basis.reset}]]</a>
|
</li>
|
</ul>
|
</div>
|
</form>
|
</div>
|
|
<div class="btn-group-sm" id="toolbar" role="group">
|
<a class="btn btn-success" th:if="${param.uuid==null}" onclick="addTab()"
|
shiro:hasPermission="exam:question:add">
|
<i class="fa fa-plus"></i> [[#{basis.add}]]
|
</a>
|
<a class="btn btn-success" th:if="${param.uuid!=null}" onclick="addlan()"
|
shiro:hasPermission="exam:question:add">
|
<i class="fa fa-plus"></i> [[#{jsp.add.language}]]
|
</a>
|
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
|
shiro:hasPermission="exam:question:remove">
|
<i class="fa fa-remove"></i> [[#{basis.del}]]
|
</a>
|
<!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="exam:question:export">-->
|
<!--<i class="fa fa-download"></i> 导出-->
|
<!--</a>-->
|
<!--<a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="exam:question:export">-->
|
<!--<i class="fa fa-download"></i> 批量导入-->
|
<!--</a>-->
|
</div>
|
|
<div style="display: none" id="choice">
|
<button type="button" class="btn btn-outline btn-primary">[[#{jsp.exam.question.singleChoice}]]</button>
|
<button type="button" class="btn btn-outline btn-primary">[[#{jsp.exam.question.multipleChoice}]]</button>
|
<button type="button" class="btn btn-outline btn-primary">[[#{jsp.exam.question.judgment}]]</button>
|
<button type="button" class="btn btn-outline btn-primary">[[#{jsp.exam.question.fillInTheBlank}]]</button>
|
</div>
|
|
<div class="col-sm-12 select-table table-striped">
|
<table id="bootstrap-table" data-mobile-responsive="true"></table>
|
</div>
|
</div>
|
|
<div class="modal inmodal fade" id="leveltype" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="false">
|
<div class="modal-dialog modal-lg">
|
<div class="modal-content">
|
<div class="modal-header">
|
<button type="button" class="close" data-dismiss="modal"><span
|
aria-hidden="true">×</span><span class="sr-only">Close</span>
|
</button>
|
<h4 class="modal-title">[[#{menu.exam.level.view}]]</h4>
|
</div>
|
<div class="modal-body">
|
<div class="form-group">
|
<label class="col-sm-3 control-label">[[#{jsp.exam.product.questionnaireType}]]:</label>
|
<div class="col-sm-8">
|
<select class="form-control" name="levelId" id="levelId"
|
th:with="levels=${@examLevel.selectTExamLevelListByType('question')}" required>
|
<option value="">--[[#{jsp.exam.product.questionnaireType}]]--</option>
|
<option th:each="level : ${levels}" th:text="${level.levelName}"
|
th:value="${level.id}"></option>
|
</select>
|
<div class="select-must" style="color: red" hidden="true">
|
*[[#{jsp.exam.product.pleaseSelectADimension}]]
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="modal-footer">
|
<button type="button" class="btn btn-white" data-dismiss="modal">close</button>
|
<button type="button" class="btn btn-primary next-step">next</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
</div>
|
<th:block th:include="include :: footer"/>
|
<script th:inline="javascript">
|
var editFlag = [[${@permission.hasPermi('exam:question:edit')}]];
|
var removeFlag = [[${@permission.hasPermi('exam:question:remove')}]];
|
var langType = [[${@dict.getType('lang_type')}]];
|
var prefix = ctx + "exam/question";
|
var uuid = $("input[name='uuid']").val();
|
var isMultiLanguage = !uuid ? false : true;
|
|
// 多语言的uuid
|
var uuid = $("input[name='uuid']").val();
|
|
$(function () {
|
var options = {
|
url: prefix + "/list",
|
createUrl: prefix + "/add/{id}",
|
updateUrl: prefix + "/edit/{id}",
|
removeUrl: prefix + "/remove",
|
exportUrl: prefix + "/export",
|
modalName: [[#{menu.exam.question.view}]],
|
importUrl: prefix + "/importData",
|
importTemplateUrl: prefix + "/importTemplate",
|
modalName: "question",
|
columns: [{
|
checkbox: true
|
},
|
{
|
field: 'id',
|
title: [[#{jsp.exam.product.titleCode}]],
|
visible: false
|
},
|
{
|
field: 'title',
|
title: [[#{jsp.exam.product.questionStem}]]
|
},
|
{
|
field: 'levelId',
|
title: [[#{jsp.exam.level.questionnaireCoding}]],
|
visible: false
|
},
|
{
|
field: 'levelName',
|
title: [[#{menu.exam.level.view}]]
|
},
|
// {
|
// field: 'score',
|
// title: [[#{jsp.exam.question.totalScore}]]
|
// },
|
{
|
field: 'permanentId',
|
title: [[#{jsp.exam.question.questionNumberPermanent}]]
|
},
|
{
|
field: 'langType',
|
title: [[#{jsp.exam.demographyParam.languagetype}]],
|
formatter: function (value, row, index) {
|
return $.table.selectDictLabel(langType, value);
|
},
|
visible: isMultiLanguage
|
},
|
{
|
title: [[#{basis.operate}]],
|
align: 'center',
|
formatter: function (value, row, index) {
|
var actions = [];
|
if (!uuid) {
|
actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="detail(\'' + row.id + '\',\'' + row.levelId + '\')" ><i class="fa fa-edit"></i>[[#{jsp.main.031}]]</a> ');
|
}
|
if (uuid) {
|
actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="editlan(\''+ row.langType + '\')"><i class="fa fa-edit"></i>' + [[#{basis.edit}]] + '</a> ');
|
// actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="deletelan(\'' + row.langType + '\')"><i class="fa fa-remove"></i>' + [[#{basis.del}]] + '</a>');
|
} else {
|
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.id + '\')"><i class="fa fa-edit"></i>' + [[#{basis.edit}]] + '</a> ');
|
// actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>' + [[#{basis.del}]] + '</a>');
|
}
|
return actions.join('');
|
}
|
}]
|
};
|
$.table.init(options);
|
|
popoverOptions = {
|
content: function () {
|
// Get the content from the hidden sibling.
|
return $("#choice").html();
|
},
|
trigger: 'click',
|
animation: false,
|
placement: 'bottom',
|
html: true,
|
container: 'body'
|
};
|
$("#popover").popover(popoverOptions);
|
|
//无第二次点击
|
$('body').on('click', function (e) {
|
$("#popover").each(function () {
|
var popover = $(this).data('bs.popover');
|
if (!popover.$element.is(e.target)) {
|
popover.inState.click = false;
|
popover.hide();
|
}
|
});
|
});
|
|
});
|
|
function addTab() {
|
$('#leveltype').modal('show');
|
$('.next-step').click(function () {
|
if ($('#levelId').val().trim() != "") {
|
$.operate.addTab($('#levelId').val());
|
$('#leveltype').modal('hide');
|
} else {
|
$('select').each(function () {
|
if ($(this).val() == "") {
|
$(this).nextAll('.select-must').removeAttrs('hidden');
|
return;
|
}
|
});
|
}
|
});
|
}
|
|
// 添加多语言的支持
|
function detail(uuid, levelId) {
|
var url = prefix + "?uuid=" + uuid + "&levelId=" + levelId;
|
$.modal.openTab("多语言", url);
|
}
|
|
function addlan() {
|
var url = prefix + "/addLang/" + uuid;
|
$.modal.openTab("添加语言题目", url);
|
}
|
|
function editlan(langType) {
|
var url = prefix + "/editLang/" + uuid + "/" + langType;
|
$.modal.openTab("添加语言题目", url);
|
}
|
|
function deletelan(langType) {
|
if ($('[name="btSelectItem"]').length == 1){
|
$.modal.alert("需要保留一种语言");
|
return;
|
}
|
|
$.modal.confirm("确实要删除此语言类型吗?", function() {
|
var url = prefix + "/deleteLang/" + uuid + "/" + langType;
|
$.operate.get(url);
|
});
|
}
|
</script>
|
</body>
|
<!-- 导入区域 -->
|
<script id="importTpl" type="text/template">
|
<form enctype="multipart/form-data" class="mt20 mb10">
|
<div class="col-xs-offset-1">
|
<input type="file" id="file" name="file"/>
|
<div class="mt10 pt5">
|
<!--<input type="checkbox" id="updateSupport" name="updateSupport" title="如果登录账户已经存在,更新这条数据。"> 是否更新已经存在的用户数据 -->
|
<a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i
|
class="fa fa-file-excel-o"></i> template</a>
|
</div>
|
<font color="red" class="pull-left mt10">
|
[[#{prompt.information}]]
|
</font>
|
</div>
|
</form>
|
</script>
|
</html>
|