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