112 lines
4.4 KiB
HTML
112 lines
4.4 KiB
HTML
<!DOCTYPE HTML>
|
||
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
||
<meta charset="utf-8">
|
||
<head th:include="include :: header"></head>
|
||
<body class="white-bg">
|
||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||
<form class="form-horizontal m" id="form-trainCourseware-edit" th:object="${trainCourseware}">
|
||
<input id="id" name="id" th:field="*{id}" type="hidden">
|
||
<input name="trainCoursewareCategoryId" type="hidden" id="treeId" th:field="*{trainCoursewareCategoryId}"/>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">课件分类:</label>
|
||
<div class="col-sm-8">
|
||
<input class="form-control" type="text" name="treeName" th:field="*{name}" onclick="selectCategoryTree()" readonly="true" id="treeName">
|
||
</div>
|
||
</div>
|
||
<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" title="(1-文档,2-图文,3-视频,4-音频,5-图片,6-外部链接)">课件类型:</label>
|
||
<div class="col-sm-8">
|
||
<select id="type" name="type" th:with="type=${@dict.getType('train_courseware_category')}" class="form-control" >
|
||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{type}"></option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">学习时常(分钟):</label>
|
||
<div class="col-sm-8">
|
||
<input id="learnTime" name="learnTime" th:field="*{learnTime}" class="form-control" type="text">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label" title="(1-是,0-不是)">是否公开:</label>
|
||
<div class="col-sm-8">
|
||
<div class="onoffswitch">
|
||
<input type="checkbox" th:checked="${trainCourseware.state == '1' ? true : false}" class="onoffswitch-checkbox" id="state" name="state">
|
||
<label class="onoffswitch-label" for="state">
|
||
<span class="onoffswitch-inner"></span>
|
||
<span class="onoffswitch-switch"></span>
|
||
</label>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">地址:</label>
|
||
<div class="col-sm-8">
|
||
<input id="url" name="url" th:field="*{url}" class="form-control" type="text">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">正文:</label>
|
||
<div class="col-sm-8">
|
||
<input id="content" name="content" th:field="*{content}" class="form-control" type="text">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">备注:</label>
|
||
<div class="col-sm-8">
|
||
<input id="remark" name="remark" th:field="*{remark}" class="form-control" type="text">
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
<div th:include="include::footer"></div>
|
||
<script type="text/javascript">
|
||
var prefix = ctx + "train/trainCourseware"
|
||
$("#form-trainCourseware-edit").validate({
|
||
rules:{
|
||
xxxx:{
|
||
required:true,
|
||
},
|
||
}
|
||
});
|
||
|
||
function submitHandler() {
|
||
if ($.validate.form()) {
|
||
var formData=$('#form-trainCourseware-edit').serializeObject();
|
||
formData.state= $("input[name='state']").is(':checked') == true ? 1 : 2;
|
||
$.operate.save(prefix + "/edit",formData);
|
||
}
|
||
}
|
||
|
||
/*课件管理-新增-选择分类树*/
|
||
function selectCategoryTree() {
|
||
var treeId = $("#treeId").val();
|
||
var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
|
||
var url = ctx + "train/courseware/category/selectCategoryTree/" + deptId;
|
||
var options = {
|
||
title: '选择部门',
|
||
width: "380",
|
||
url: url,
|
||
callBack: doSubmit
|
||
};
|
||
$.modal.openOptions(options);
|
||
}
|
||
function doSubmit(index, layero){
|
||
var tree = layero.find("iframe")[0].contentWindow.$._tree;
|
||
if ($.tree.notAllowParents(tree)) {
|
||
var body = layer.getChildFrame('body', index);
|
||
$("#treeId").val(body.find('#treeId').val());
|
||
$("#treeName").val(body.find('#treeName').val());
|
||
layer.close(index);
|
||
}
|
||
}
|
||
</script>
|
||
</body>
|
||
</html>
|