153 lines
4.3 KiB
Plaintext
153 lines
4.3 KiB
Plaintext
|
|
@section scripts{
|
|
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
$("#layout1").ligerLayout({ leftWidth: 200 });
|
|
$("#tree1").ligerTree({ url: '@Url.Action("TjxmlxTreeJsonResult")', ajaxType: 'get', checkbox: false, onSelect: onSelect, isExpand: false });
|
|
});
|
|
|
|
function onSelect(note)
|
|
{
|
|
if (note.data.type == 1)
|
|
{
|
|
$("#TjxmFrame").attr("src", '@Url.Action("TjxmwhJsonResult")?id=' + note.data.id);
|
|
}
|
|
else
|
|
{
|
|
$("#TjxmFrame").attr("src", '@Url.Action("TjxmwhJsonResult")?groupid=' + note.data.id);
|
|
}
|
|
}
|
|
|
|
function reload()
|
|
{
|
|
liger.get("tree1").reload();
|
|
}
|
|
|
|
function UpdateTreeItem(not) {
|
|
|
|
var manager = null;
|
|
|
|
//根据class获取元素对象
|
|
$("#tree1").ligerTree({ checkbox: false });
|
|
|
|
//获取tree对象
|
|
manager = $("#tree1").ligerGetTreeManager();
|
|
|
|
var node = manager.getSelected();
|
|
|
|
manager.getSelected().target.innerHTML = manager.getSelected().target.innerHTML.replace("<span>" + node.data.text + "</span>", "<span>" + not[0] + "</span>");
|
|
|
|
manager.getSelected().data.text = not[0];
|
|
}
|
|
|
|
function removeTreeItem() {
|
|
|
|
var manager = null;
|
|
|
|
//根据class获取元素对象
|
|
$("#tree1").ligerTree({ checkbox: false });
|
|
|
|
//获取tree对象
|
|
manager = $("#tree1").ligerGetTreeManager();
|
|
|
|
var node = manager.getSelected();
|
|
|
|
if (node)
|
|
manager.remove(node.target);
|
|
else
|
|
alert('请先选择节点');
|
|
}
|
|
|
|
function addTreeItem(not) {
|
|
|
|
var manager = null;
|
|
|
|
//根据class获取元素对象
|
|
$("#tree1").ligerTree({ checkbox: false });
|
|
|
|
//获取tree对象
|
|
manager = $("#tree1").ligerGetTreeManager();
|
|
|
|
//根据tree对象获取选中的结点
|
|
var node = manager.getSelected();
|
|
|
|
var data = [];
|
|
if (node == null)
|
|
{
|
|
data.push({ id: not[0], text: not[1],type:"0" });
|
|
}
|
|
else
|
|
{
|
|
data.push({ id: not[0], text: not[1],type:"1" });
|
|
}
|
|
if (node)
|
|
manager.append(node.target, data);
|
|
else
|
|
manager.append(null, data);
|
|
}
|
|
function keyup_submit(event) {
|
|
var keynum
|
|
var keychar
|
|
var numcheck
|
|
|
|
if (window.event) // IE
|
|
{
|
|
keynum = event.keyCode
|
|
}
|
|
else if (event.which) // Netscape/Firefox/Opera
|
|
{
|
|
keynum = event.which
|
|
}
|
|
if (keynum == 13) {
|
|
search();
|
|
}
|
|
}
|
|
function search() {
|
|
var name = $("#searchTxt").val();
|
|
$.ajax({
|
|
url:'@Url.Action("TjxmlxTreeJsonResultByName")',
|
|
data: { name: name },
|
|
type: 'post',
|
|
cache: false,
|
|
dataType: 'json',
|
|
success: function (data) {
|
|
liger.get("tree1").setData(data);
|
|
liger.get("tree1").expandAll();
|
|
}
|
|
});
|
|
}
|
|
|
|
</script>
|
|
<style type="text/css">
|
|
body {
|
|
padding: 5px;
|
|
margin: 0;
|
|
//padding-bottom: 15px;
|
|
}
|
|
|
|
#layout1 {
|
|
width: 100%;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
.l-page-top {
|
|
height: 80px;
|
|
background: #f8f8f8;
|
|
margin-bottom: 3px;
|
|
}
|
|
|
|
h4 {
|
|
margin: 20px;
|
|
}
|
|
</style>
|
|
}
|
|
<div id="layout1">
|
|
<div position="left" title="体检小组" style="height:632px;overflow:scroll">
|
|
<input id="searchTxt" type="text" onkeydown="keyup_submit(event);"/><button onclick="search()">查询</button>
|
|
<ul id="tree1"></ul></div>
|
|
<div position="center" title="体检项目" id="TjxmDivID">
|
|
<iframe id="TjxmFrame" src="about:blank" style="width:100%;height:100%" frameborder="0" ></iframe>
|
|
</div>
|
|
</div> |