You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.1 KiB
71 lines
2.1 KiB
4 weeks ago
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<%@include file="/wdk/theme/je/module/public/common.jsp"%>
|
||
|
<title>弹出树</title>
|
||
|
<script type="text/javascript">
|
||
|
var _treeid = "layout_tree";
|
||
|
var strparam = $.urlparam_decode($.getURLParam('param'));
|
||
|
var jparam = $.str2json(strparam);
|
||
|
var _idField = jparam.idField?jparam.idField:'id';
|
||
|
var _textField = jparam.textField?jparam.textField:'text';
|
||
|
var _valueField = jparam.valueField?jparam.valueField:_idField;
|
||
|
var _queryParams = jparam.queryParams?jparam.queryParams:{};
|
||
|
|
||
|
var _dataurl = $.decode(jparam.dataurl);
|
||
|
|
||
|
var _checkbox = (('true'==jparam.checkbox) || jparam.checkbox)?true:false;
|
||
|
var _asyn = (('true'==jparam.asyn) || jparam.asyn)?true:false;
|
||
|
window.onload = function(){
|
||
|
$.tree({
|
||
|
id:_treeid,
|
||
|
asyn:_asyn,
|
||
|
expandall:jparam.expandall,
|
||
|
parentField:jparam.parentField,
|
||
|
childrenField:jparam.childrenField,
|
||
|
checkbox:_checkbox,
|
||
|
url:_dataurl,
|
||
|
queryParams:_queryParams,
|
||
|
method:"get",
|
||
|
onLoadSuccess:function(){
|
||
|
var value_id = jparam.value_id;
|
||
|
$.tree_setChecked({id:_treeid,ids:value_id});
|
||
|
}
|
||
|
});
|
||
|
};
|
||
|
|
||
|
function inputpop_getValue(){
|
||
|
var jres = jparam;
|
||
|
var nodes = $.tree_getCheckedNode({id:_treeid});
|
||
|
var idarr = [];
|
||
|
var valuearr = [];
|
||
|
var textarr = [];
|
||
|
for(var i=0;i<nodes.length;i++){
|
||
|
var node = nodes[i];
|
||
|
|
||
|
var _id = eval('node.'+_idField);
|
||
|
var _text = eval('node.'+_textField);
|
||
|
var _value = _id;
|
||
|
if(_valueField!=_idField){
|
||
|
_value = eval('node.attributes.'+_valueField);
|
||
|
}
|
||
|
idarr.push(_id);
|
||
|
textarr.push(_text);
|
||
|
valuearr.push(_value);
|
||
|
}
|
||
|
jres.value_id = idarr.join(',');
|
||
|
jres.value_text = textarr.join(',');
|
||
|
jres.value_value = valuearr.join(',');
|
||
|
jres.value_rows = nodes;
|
||
|
return jres;
|
||
|
|
||
|
}
|
||
|
</script>
|
||
|
</head>
|
||
|
<body class="easyui-layout" style="padding:0px;margin:0px;background-color:#FFFFFF;">
|
||
|
<div id="layout_content" data-options="region:'center',border:false,collapsed:false" style="overflow:hidden;" >
|
||
|
<div id="layout_tree" style="width:100%;height:100%;overflow:auto;"></div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|