<!DOCTYPE html>
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
<head>
|
<th:block th:include="include :: header('修改报告字典')"/>
|
<th:block th:include="include :: bootstrap-fileinput-css"/>
|
</head>
|
<body class="white-bg">
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
<form class="form-horizontal m" id="form-librarycode-edit" name="form-librarycode-edit" th:object="${tLibraryCode}">
|
<input name="id" id="id" th:field="*{id}" type="hidden">
|
<div class="form-group">
|
<label class="col-sm-3 control-label">[[#{jsp.exam.template.reporttype}]]</label>
|
<div class="col-sm-8">
|
<select name="reportType" id="reportType" class="form-control m-b" th:with="type=${@dict.getType('report_type')}">
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
|
th:field="*{reportType}"></option>
|
</select>
|
</div>
|
</div>
|
<div class="form-group">
|
<label class="col-sm-3 control-label">[[#{jsp.exam.template.reportdict}]]:</label>
|
<div class="col-sm-8">
|
<input name="libraryCode" id="libraryCode" th:field="*{libraryCode}" class="form-control" type="text" required>
|
</div>
|
</div>
|
<div class="form-group">
|
<label class="col-sm-3 control-label">[[#{jsp.exam.template.ispic}]]:</label>
|
<div class="col-sm-8">
|
<input type="radio" name="dictType" value="1" th:field="*{dictType}"><label class="radio-box">[[#{dict.ic13}]]</label>
|
<input type="radio" name="dictType" value="2" th:field="*{dictType}"><label class="radio-box">[[#{dict.ic12}]]</label>
|
</div>
|
</div>
|
<div class="form-group" id="iconDiv">
|
<label class="col-sm-3 control-label">ICON:</label>
|
<div class="col-sm-4">
|
<img class="img-circle img-lg" th:src="@{*{icon}}">
|
</div>
|
<div class="col-sm-4">
|
<input name="iconFile" id="iconFile" class="form-control" type="file">
|
</div>
|
</div>
|
|
<div class="form-group" id="contextDiv">
|
<div class="form-group">
|
<label class="col-sm-3 control-label">[[#{jsp.exam.librarycode.englishdictionarycontent}]]:</label>
|
<div class="col-sm-8">
|
<textarea name="englistContent" id="englistContent" class="form-control">[[*{englistContent}]]</textarea>
|
</div>
|
</div>
|
<div class="form-group">
|
<label class="col-sm-3 control-label">[[#{jsp.exam.librarycode.chinadictionarycontent}]]:</label>
|
<div class="col-sm-8">
|
<textarea name="chineseContent" id="chineseContent" class="form-control">[[*{chineseContent}]]</textarea>
|
</div>
|
</div>
|
<div class="form-group">
|
<label class="col-sm-3 control-label">[[#{jsp.exam.librarycode.twdictionarycontent}]]:</label>
|
<div class="col-sm-8">
|
<textarea name="thaiContent" id="thaiContent" class="form-control">[[*{thaiContent}]]</textarea>
|
</div>
|
</div>
|
</div>
|
</form>
|
</div>
|
<div class="row">
|
<div class="col-sm-offset-5 col-sm-10">
|
<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>save
|
</button>
|
<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>close
|
</button>
|
</div>
|
</div>
|
<th:block th:include="include :: footer"/>
|
<th:block th:include="include :: bootstrap-fileinput-js"/>
|
<script type="text/javascript">
|
var prefix = ctx + "exam/librarycode";
|
$("#form-librarycode-edit").validate({
|
focusCleanup: true
|
});
|
|
function submitHandler() {
|
var imgStr = /\.(jpg|jpeg|png|bmp|BMP|JPG|PNG|JPEG)$/;
|
var imgFile = $("#iconFile").val();
|
if (imgFile != "" && !imgStr.test(imgFile)) {
|
$.modal.msg("文件上传只能为图片类型!");
|
return false;
|
}
|
if ($.validate.form()) {
|
$.operate.saveFileTab(prefix + "/edit", new FormData(document.forms.namedItem("form-librarycode-edit")));
|
}
|
};
|
$(document).ready(function () {
|
$("#iconFile").fileinput({
|
'theme': 'explorer-fas',
|
overwriteInitial: false,
|
initialPreviewAsData: true,
|
showUpload: false,
|
showPreview: false,
|
showBrowse: true
|
});
|
|
$(':radio').click(function () {
|
divViewCheck();
|
});
|
divViewCheck();
|
});
|
|
function divViewCheck() {
|
var checkValue = $('input:radio[name="dictType"]:checked').val();
|
if (checkValue == "2") {
|
showDiv();
|
} else {
|
hideDiv();
|
}
|
}
|
|
function showDiv() {
|
$("#iconDiv").removeAttrs("hidden");
|
$("#contextDiv").attr("hidden", "true");
|
}
|
|
function hideDiv() {
|
$("#iconDiv").attr("hidden", "true");
|
$("#contextDiv").removeAttrs("hidden");
|
}
|
</script>
|
</body>
|
</html>
|