| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- function indexAutorTree(treeAction, treeId, clickEvent, onSuccess, onAppend) {
- var manager = "";
- $("#" + treeId).ligerTree({
- url : getProjectName() + "/" + changePath(treeAction),
- checkbox : true,
- folderCheckbox : false,
- single : true,
- childIcon : 'folder',
- idFieldName : 'id',
- parentIDFieldName : 'pid',
- openFolderEven : false,
- slide : false,
- nodeWidth : 120,
- attribute : [ 'id', 'url', 'type' ],
- onSelect : function(node) {
- var id = node.data.id;
- if (!node.data.checkbox) {
- $("input[name='author']").each(function() {
- $(this).attr("checked", false);
- });
- $("input[name='unit']").val(id);
- }
- },
- onCheck : function(node) {
- clickEvent(node);
- },
- onAppend : function(parentNode, newdata) {
- if (onAppend)
- onAppend(parentNode, newdata);
- },
- onSuccess : function() {
- if (onSuccess)
- onSuccess();
- }
- });
- manager = $("#" + treeId).ligerGetTreeManager();
- return manager;
- }
- function toSave(){
- var params=$("input[name='checkedRoleId']").val();
- if(params==""){
- addError('请选择用户');
- return;
- }
- $("input[name='indexAuthor']:checked").each(function(){
- var id=$(this).attr("id");
- params+=",";
- params+=id;
- });
- var param={'param':params};
- sendAjaxParam(param, "saveIndexAuthor.do", 'json', displayAjaxMsg);
- }
- function clickIndexRoleEvent(node){
- var id = node.data.id;
- var mc=managerTree.getChecked();
- if(mc!=null&&""!=mc){
- $("input[name='checkedRoleId']").val(id);
- }else{
- $("input[name='checkedRoleId']").val("");
- }
- var rs=$("input[name='checkedRoleId']").val();
- var type = node.data.type;
- var param = {'id':id};
- sendAjaxParam(param,'findIndexAuthor.do','json',processs);
- }
- function processs(data){
- $("input[name='indexAuthor']:checked").each(function(){
- $(this).attr("checked",false);
- });
- if(data.length==0){
- return;
- }
- for(var i=0;i<data.length;i++){
- var p = data[i]["modelId"];
- $("#"+p).attr("checked", true);
- }
- }
|