text: !function(e){e.fn.droptree=function(a){var t=e.extend({},e.fn.droptree.defaults,a);return this.each(function(){e.fn.droptree.generate(this,t)})},e.fn.droptree.generate=function(a,t){var n=e(document.createElement("DIV")).addClass("tree-handle").append(e(document.createElement("I")).addClass("iconfont icon-xiangxia2")),i=e(document.createElement("DIV")).addClass("selected-label");t.initialLabelContainer&&e(i).text(e(t.initialLabelContainer).val());var r=e(document.createElement("UL")).addClass("tree-container ztree").attr("id",t.treeId);e(a).append(n).append(i).append(r).addClass("drop-tree"),e.fn.droptree.loadTree(a,t),t.width&&e(a).css({width:t.width}),e(r).css({left:"-1px",width:e(a).width()-10+"px",zIndex:t.zIndex}),e(a).click(function(a){e(r).css({visibility:"visible"}),e(n).find("i").removeClass("icon-xiangxia2").addClass("icon-xiangshang3"),a.stopPropagation()}),e(document).click(function(){e(r).css({visibility:"hidden"}),e(n).find("i").addClass("icon-xiangxia2").removeClass("icon-xiangshang3")})},e.fn.droptree.loadTree=function(a,t){require(["http://cdn08.ttpaicdn.com/ttpai/js/util/ztree/js/jquery.ztree.core-3.5.js","http://cdn15.ttpaicdn.com/ttpai/js/util/ztree/js/jquery.ztree.excheck-3.5.js"],function(){var n={treeId:t.treeId,check:{enable:t.multiSelect,chkStyle:"checkbox"},data:{simpleData:{enable:!0,pIdKey:"partentId"}},view:{showIcon:!1},callback:{}};t.multiSelect?n.callback.onCheck=function(n,i,r){var l=e(a).find(".selected-label").text(),d=l?l.split(t.separator):new Array,o=e(t.dataSaveInto).val(),c=o?o.split(t.separator):new Array;if(r.checked)-1===e.inArray(r.name,d)&&d.push(r.name),-1===e.inArray(r.id,c)&&c.push(r.id),e(a).find(".selected-label").text(d.join(t.separator)),e(t.initialLabelContainer).val(d.join(t.separator)),e(t.dataSaveInto).val(c.join(t.separator));else if(-1!==e.inArray(r.name,d)){var s=new Array,p=new Array;e.each(d,function(e,a){a!==r.name&&s.push(a)}),e(a).find(".selected-label").text(s.join(t.separator)),e(t.initialLabelContainer).val(s.join(t.separator)),e.each(c,function(e,a){a.toString()!==r.id.toString()&&p.push(a)}),e(t.dataSaveInto).val(p.join(t.separator))}}:n.callback.onClick=function(n,i,r){t.multiSelect||r.isParent!==!0&&(e(a).find(".selected-label").text(r.name),e(t.initialLabelContainer).val(r.name),e(t.dataSaveInto).val(r.id),e(a).find(".tree-container").css({visibility:"hidden"}),e(a).find(".tree-handle").find("i").addClass("icon-xiangxia2").removeClass("icon-xiangshang3"),n.stopPropagation())},e.fn.zTree.init(e(a).find(".tree-container"),n,t.sourceData)})},e.fn.droptree.defaults={width:"100%",initialLabelContainer:null,multiSelect:!1,sourceData:null,dataSaveInto:null,separator:",",treeId:"",zIndex:1e3}}(jQuery);