6 changed files with 115 additions and 144 deletions
@ -1,149 +1,114 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="zdxtInclude :: header('新增关联')" /> |
|||
<th:block th:include="zdxtInclude :: select2-css" /> |
|||
<th:block th:include="include :: header('修改节点')" /> |
|||
<th:block th:include="include :: select2-css" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-linkage-add"> |
|||
<!--<input id="treeId" name="parentId" type="hidden"/>--> |
|||
<input id="treeId" name="parentId" type="hidden" th:value="${linkage.id}" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">上级节点:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="input-group"> |
|||
<!--<input class="form-control" type="text" onclick="selectDeptTree()" id="treeName" readonly="true">--> |
|||
<input class="form-control" type="text" onclick="selectItemTree()" id="treeName" readonly="true" th:value="${linkage.title}"> |
|||
<span class="input-group-addon"><i class="fa fa-search"></i></span> |
|||
</div> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-dept-edit"> |
|||
<input id="treeId" name="parentId" type="hidden" th:value="${linkage.id}" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">上级部门:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="input-group"> |
|||
<input class="form-control" type="text" id="treeName" onclick="selectItemTree()" readonly="true"> |
|||
<span class="input-group-addon"><i class="fa fa-search"></i></span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">名称:</label> |
|||
<div class="col-sm-6"> |
|||
<input class="form-control" type="text" placeholder="请输入名称" name="title" id="title" required> |
|||
</div> |
|||
<div class="col-sm-2"> |
|||
<input class="form-control" type="text" name="srot" placeholder="请输入排序" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">值:</label> |
|||
<div class="col-sm-8"> |
|||
<input class="form-control" type="text" placeholder="请输入值" name="value" id="value" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">领域:</label> |
|||
<div class="col-sm-8"> |
|||
<input class="form-control" type="text" placeholder="请输入领域" name="domain" id="domain"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">节点名称:</label> |
|||
|
|||
<div class="col-sm-6"> |
|||
<input class="form-control" type="text" name="deptName" id="title" required> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">部门:</label> |
|||
<div class="col-sm-8"> |
|||
<input class="form-control" type="text" placeholder="请输入部门" name="dept" id="dept"> |
|||
</div> |
|||
<div class="col-sm-2"> |
|||
<input class="form-control" type="text" name="srot" required> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">要求:</label> |
|||
<div class="col-sm-8"> |
|||
<input class="form-control" type="text" placeholder="请输入要求" name="demand" id="demand"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">依据:</label> |
|||
<div class="col-sm-8"> |
|||
<input class="form-control" type="text" placeholder="请输入依据" name="basis" id="basis"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">值:</label> |
|||
<div class="col-sm-8"> |
|||
<input class="form-control" type="text" placeholder="请输入值" name="value" id="value" required> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">状态:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}"> |
|||
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}"> |
|||
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="zdxtInclude :: footer" /> |
|||
<th:block th:include="zdxtInclude :: select2-js" /> |
|||
<script type="text/javascript"> |
|||
var prefix = ctx + "code/linkage"; |
|||
|
|||
$("#form-linkage-add").validate({ |
|||
onkeyup: false, |
|||
rules:{ |
|||
deptName:{ |
|||
remote: { |
|||
url: prefix + "/checkItemNameUnique", |
|||
type: "post", |
|||
dataType: "json", |
|||
data: { |
|||
"parentId": function() { |
|||
return $("input[name='parentId']").val(); |
|||
}, |
|||
"title" : function() { |
|||
return $.common.trim($("#title").val()); |
|||
} |
|||
}, |
|||
dataFilter: function(data, type) { |
|||
return $.validate.unique(data); |
|||
} |
|||
} |
|||
}, |
|||
orderNum:{ |
|||
digits:true |
|||
}, |
|||
email:{ |
|||
email:true, |
|||
}, |
|||
phone:{ |
|||
isPhone:true, |
|||
}, |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: select2-js" /> |
|||
<script type="text/javascript"> |
|||
var prefix = ctx + "code/linkage"; |
|||
|
|||
$("#form-dept-edit").validate({ |
|||
onkeyup: false, |
|||
rules:{ |
|||
deptName:{ |
|||
remote: { |
|||
url: prefix + "/checkItemNameUnique", |
|||
type: "post", |
|||
dataType: "json", |
|||
data: { |
|||
"deptId": function() { |
|||
return $("#id").val(); |
|||
}, |
|||
"parentId": function() { |
|||
return $("input[name='parentId']").val(); |
|||
}, |
|||
"deptName": function() { |
|||
return $.common.trim($("#title").val()); |
|||
} |
|||
}, |
|||
dataFilter: function(data, type) { |
|||
return $.validate.unique(data); |
|||
} |
|||
} |
|||
}, |
|||
messages: { |
|||
"deptName": { |
|||
remote: "节点已经存在" |
|||
} |
|||
}, |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/add", $('#form-linkage-add').serialize()); |
|||
} |
|||
} |
|||
|
|||
/*部门管理-新增-选择父部门树*/ |
|||
function selectItemTree() { |
|||
var options = { |
|||
title: '部门选择', |
|||
width: "380", |
|||
url: prefix + "/selectItemTree/" + $("#treeId").val(), |
|||
// url: prefix + "/selectDeptTree/123", |
|||
callBack: doSubmit |
|||
}; |
|||
$.modal.openOptions(options); |
|||
srot:{ |
|||
digits:true |
|||
}, |
|||
}, |
|||
messages: { |
|||
"deptName": { |
|||
remote: "部门已经存在" |
|||
} |
|||
}, |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/edit", $('#form-dept-edit').serialize()); |
|||
} |
|||
|
|||
function doSubmit(index, layero){ |
|||
} |
|||
|
|||
/*部门管理-修改-选择部门树*/ |
|||
function selectItemTree() { |
|||
var id = $("#treeId").val(); |
|||
var options = { |
|||
title: '节点选择', |
|||
width: "380", |
|||
url: prefix + "/selectItemTree/" + $("#treeId").val(), |
|||
callBack: doSubmit |
|||
}; |
|||
$.modal.openOptions(options); |
|||
} |
|||
|
|||
function doSubmit(index, layero){ |
|||
var tree = layero.find("iframe")[0].contentWindow.$._tree; |
|||
if ($.tree.notAllowLastLevel(tree)) { |
|||
var body = layer.getChildFrame('body', index); |
|||
$("#treeId").val(body.find('#treeId').val()); |
|||
$("#treeName").val(body.find('#treeName').val()); |
|||
layer.close(index); |
|||
$("#treeId").val(body.find('#treeId').val()); |
|||
$("#treeName").val(body.find('#treeName').val()); |
|||
layer.close(index); |
|||
} |
|||
|
|||
$(function() { |
|||
$('#deptType').select2({ |
|||
placeholder: "请选择类型", |
|||
allowClear: true |
|||
}); |
|||
}) |
|||
</script> |
|||
} |
|||
$(function() { |
|||
$('#deptType').select2({ |
|||
placeholder: "请选择类型", |
|||
allowClear: true |
|||
}); |
|||
}) |
|||
</script> |
|||
</body> |
|||
</html> |
|||
|
|||
Loading…
Reference in new issue