<!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>[[#{jsp.exam.product.productPackageName}]]:</p>
|
<input type="text" name="name"/>
|
</li>
|
<li>
|
<p>[[#{jsp.exam.product.title}]]:</p>
|
<input type="text" name="content"/>
|
</li>
|
<li>
|
<p>[[#{menu.exam.level.view}]]:</p>
|
<select class="form-control" name="levelName"
|
th:with="levels=${@examLevel.selectTExamLevelList()}" required>
|
<option value="">ALL</option>
|
<option th:each="level : ${levels}" th:text="${level.levelName}"
|
th:value="${level.levelName}"></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:product: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:product:add">
|
<i class="fa fa-plus"></i> [[#{jsp.add.language}]]
|
</a>
|
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
|
shiro:hasPermission="exam:product:remove">
|
<i class="fa fa-remove"></i> [[#{basis.del}]]
|
</a>
|
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="exam:product:export">
|
<i class="fa fa-download"></i> [[#{basis.export}]]
|
</a>
|
</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('questionnaire')}" 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 class="modal inmodal fade" id="langTypSelect" name = "langTypSelect" 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">[[#{jsp.exam.demographyParam.languagetype}]]</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" id="langTypeDiv" th:fragment="langTypeDiv">
|
<select th:if="${dictDatas} != null" name="langType"
|
class="form-control m-b">
|
<option th:each="dict, iterStat : ${dictDatas}" th:text="${dict.dictLabel}"
|
th:value="${dict.dictValue}"></option>
|
</select>
|
<div class="select-must" style="color: red" hidden="true">*[[#{jsp.exam.product.pleaseSelectLangType}]]</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:product:edit')}]];
|
var removeFlag = [[${@permission.hasPermi('exam:product:remove')}]];
|
var langType = [[${@dict.getType('lang_type')}]];
|
var prefix = ctx + "exam/product";
|
|
// 多语言的uuid
|
var uuid = $("input[name='uuid']").val();
|
var levelId = $("input[name='level-id']").val();
|
var isMultiLanguage = !uuid ? false : true;
|
|
$(function () {
|
var options = {
|
url: prefix + "/list",
|
createUrl: prefix + "/add/{id}",
|
updateUrl: prefix + "/edit/{id}",
|
removeUrl: prefix + "/remove",
|
exportUrl: prefix + "/export",
|
modalName: [[#{menu.exam.product.view}]],
|
columns: [{
|
checkbox: true
|
},
|
{
|
field: 'id',
|
title: [[#{jsp.exam.product.productPackageNumber}]],
|
visible: false
|
},
|
{
|
field: 'name',
|
title: [[#{jsp.exam.product.productPackageName}]]
|
},
|
{
|
field: 'subjectId',
|
title: [[#{jsp.exam.product.questionnaireTypeCode}]],
|
},
|
{
|
field: 'subjectName',
|
title: [[#{jsp.exam.product.questionnaireTypeName}]],
|
},
|
{
|
field: 'createTime',
|
title: [[#{basis.createTime}]],
|
},
|
{
|
field: 'version',
|
title: [[#{jsp.exam.product.version}]],
|
},
|
{
|
field: 'versionId',
|
title: [[#{jsp.exam.product.versionId}]],
|
visible: false
|
},
|
{
|
field: 'langType',
|
title: [[#{jsp.exam.demographyParam.languagetype}]],
|
formatter: function (value, row, index) {
|
return $.table.selectDictLabel(langType, value);
|
},
|
visible: isMultiLanguage
|
},
|
{
|
title: [[#{jsp.exam.product.productShelves}]],
|
align: 'center',
|
formatter: function (value, row, index) {
|
if (row.deleted == 3) {
|
return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="onAndOffProduct(\''+row.id+'\',1)"></i> ';
|
} else {
|
return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="onAndOffProduct(\''+row.id+'\',3)"></i> ';
|
}
|
}
|
},
|
{
|
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-success 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);
|
$.operate.selectMust();
|
});
|
|
var onAndOffProduct = function (id, deleted) {
|
mess = "";
|
if (deleted == 0) {
|
mess = [[#{jsp.exam.product.doYouRemoveThisProduct}]];
|
}else {
|
mess = [[#{jsp.exam.product.doYouRemoveThisProduct}]];
|
}
|
$.modal.confirm(mess, function () {
|
$.operate.post(prefix + "/changeDeleted", {"id": id, "deleted":deleted});
|
});
|
};
|
|
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() {
|
$('#langTypeDiv').load(prefix + "/langType/" + $('#uuid').val());
|
$('#langTypSelect').modal('show');
|
$('.next-step').click(function () {
|
if ($('[name="langType"]').val().trim() != "") {
|
var url = prefix + "/addLang/" + uuid + "/" + $('[name="langType"]').val();
|
$.modal.openTab("添加语言题目", url);
|
$('#langTypSelect').modal('hide');
|
} else {
|
$('select').each(function () {
|
if ($(this).val() == "") {
|
$(this).nextAll('.select-must').removeAttrs('hidden');
|
return;
|
}
|
});
|
}
|
});
|
}
|
|
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>
|
</html>
|