(function(){var f=window.Zving,c=f.DataCollection,a=f.CONTEXTPATH,b=f.String.encodeURL,e=f.String.htmlEncode,d={};d.ContextPath=f.CONTEXTPATH;d.RequestMap={};d.MainServletURL="ajax/invoke";d.Pool=[];d.getXMLHttpRequest=function(){var h;for(h=0;h1;h--){try{if(h===2){j=new ActiveXObject("Microsoft.XMLHTTP")}else{j=new ActiveXObject("Msxml2.XMLHTTP."+h+".0")}}catch(g){}}}}d.Pool.push([j,"1"]);return j};d.loadURL=function(h,m,j,n){var k=d.getXMLHttpRequest();var o;k.open("GET",a+h,true);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.onreadystatechange=function(){if(k.readyState==4){clearTimeout(o);if(k.status>=200&&k.status<300){if(m){m(k.responseText)}}else{if(j){j(k.status)}}for(var p=0;p=200&&n.status<300){var p=n.responseText.trim();if(p.indexOf("<")==0){var o=n.responseXML;if(o){if(g.parseXML(o)){g.Status=g.get("_ZVING_STATUS");g.Message=g.get("_ZVING_MESSAGE");if(g.get("_ZVING_SCRIPT")){window["eval"](g.get("_ZVING_SCRIPT"))}}d._ResponseDC=g;o=null}}else{if(p.indexOf("{")==0||p.indexOf("[")==0){g=JSON.parse(p);if(g._ZVING_SCRIPT){window["eval"](g._ZVING_SCRIPT)}for(var h in g){if(g[h]!=null&&typeof g[h]["@type"]=="string"){g[h]=new f[g[h]["@type"]](g[h])}}if(g._ZVING_STATUS!==undefined){g.Status=g._ZVING_STATUS}if(g._ZVING_MESSAGE!==undefined){g.Message=g._ZVING_MESSAGE}d._ResponseDC=g}else{g.Message="后台程序发生异常,未获取到正确的数据!"}}}else{if(n.status==0){g.Message=undefined}else{g.Message="服务器发生"+n.status+"异常,未获取到数据!"}}if(m){m(g)}for(var j=0;jnull")}else{if(value===undefined){result.push("undefined")}else{if(vtype==="regexp"){result.push(""+value+"")}else{if(vtype==="date"){result.push("'"+value+"'")}else{if(vtype==="number"){result.push(""+value+"")}else{if(vtype==="boolean"){result.push(""+value+"")}else{if(vtype==="function"){if(inObject||inArray){result.push("function()")}else{result.push(""+value.toString().substring(0,100)+(value.toString().length>100?" ...":"")+"")}}else{result.push(""+(!inObject&&!inArray?value:'"'+value.substring(0,100)+(value.length>100?" ...":"")+'"').replace(/\n/g,"\\n").replace(/\s/g," ").replace(/>/g,">").replace(/")}}}}}}}}else{if(isElement){if(value.nodeType===3){result.push(Console.constr(value.nodeValue))}else{if(inObject){result.push(""+value.nodeName.toLowerCase()+"")}else{result.push("");if(inArray){result.push(value.nodeName.toLowerCase());if(value.getAttribute){if(value.getAttribute&&value.getAttribute("id")){result.push("#"+value.getAttribute("id")+"")}var elClass=value.getAttribute(document.all?"className":"class")||"";result.push(!elClass?"":"."+elClass.split(" ")[0]+"")}result.push("")}else{result.push("<"+value.nodeName.toLowerCase());if(value.attributes){for(i=0,len=value.attributes.length;i"+item.nodeName+"=\""+item.nodeValue+'"')}}}result.push(">")}}}}else{if(isArray||isHash){if(isArray){if(inObject){result.push("["+value.length+"]")}else{result.push("[ ");for(i=0,len=value.length;i3){result.push(", "+(len-4)+" More...");break}result.push((i>0?", ":"")+Console.constr(value[i],false,true,true))}result.push(" ]")}}else{if(inObject){result.push("Object")}else{result.push("Object");i=0;for(var key in value){var val=value[key];if((inObject||inArray)&&i>3){result.push(" More...");break}result.push(" "+key+"="+Console.constr(val,true));i++}result.push("")}}}else{result.push([""+value+""])}}}}catch(e){result.push(""+e.message+"")}return result.join("")};Console.inputKeydown=function(evt){evt=window.event||evt;var consoleInput=z.getDom("_ConsoleInput");if(evt.keyCode===13){Console.evaluate(consoleInput.value.replace(/(^\s*)|(\s*$)/g,""))}else{if(evt.keyCode===40){if(Console.history[Console.historyIndex+1]){Console.historyIndex+=1;consoleInput.value=Console.history[Console.historyIndex]}}else{if(evt.keyCode===38){if(Console.history[Console.historyIndex-1]){Console.historyIndex-=1;consoleInput.value=Console.history[Console.historyIndex]}}}}};Console.evaluate=function(cmd){var result;if(cmd.length===0){return}z.getDom("_ConsoleInput").value="";Console.historyIndex=Console.history.push(cmd);try{result=eval.call(window,cmd);if(cmd.substr(0,7)!=="Console"){Console.log(">> "+cmd);Console.log(result)}}catch(e){Console.log(e)}};Console.getConsoleDiv=function(){var consoleWrapDiv=z.getDom("_Console");if(!consoleWrapDiv){consoleWrapDiv=document.createElement("div");consoleWrapDiv.id="_Console";consoleWrapDiv.className="console-warp";consoleWrapDiv.style.cssText="position:absolute; z-index:9999; left:0%;top:"+Math.max(document.documentElement.scrollTop,document.body.scrollTop)+"px; width:62%; background-color:#fff; border:1px solid #359; opacity:0.9; filter:alpha(opacity=90); padding:4px;";consoleWrapDiv.innerHTML='
>>
';document.body.appendChild(consoleWrapDiv);var consoleDivHead=z.getDom("_ConsoleHead");var consoleDivBody=z.getDom("_ConsoleBody");if(z.isIE6){consoleDivBody.style.height="200px"}var consoleDivFoot=z.getDom("_ConsoleFoot");if(z.SimpleDrag){new z.SimpleDrag({dragEl:consoleWrapDiv,handleEl:consoleDivHead})}z.getDom("_ConsoleInput").onkeydown=Console.inputKeydown;Console.consoleDiv=consoleWrapDiv;Console.consoleDivBody=consoleDivBody}return Console.consoleDiv};Console.formatArgs=function(){var content=[];for(var i=0,len=arguments.length;iConsole.max){consoleDivBody.removeChild(firstChild)}consoleDivBody.appendChild(newItem);return newItem};Console.scroll=function(){if(!Console.debug){return false}var consoleWrapDiv=Console.getConsoleDiv();consoleWrapDiv.style.display="";var ConsoleDivTop=parseInt(consoleWrapDiv.style.top.replace(/\D/gi,""),10)||0;if(ConsoleDivTopMath.max(document.documentElement.scrollTop,document.body.scrollTop)+(document.compatMode==="BackCompat"?document.body.clientHeight:document.documentElement.clientHeight)){consoleWrapDiv.style.top=Math.max(document.documentElement.scrollTop,document.body.scrollTop)+"px"}var consoleDivBody=Console.consoleDivBody;consoleDivBody.scrollTop=9999};Console.stack=function(level,agrs){if(Console.queue.length>=Console.max){Console.queue.splice(0,Console.queue.length-3*Math.floor(Console.max/4))}Console.queue.push({level:level,agrs:agrs});++Console.counters[level]};Console.log=function(){if(!Console.debug){return}if(Console.silence||!document.body||Console.getConsoleDiv().style.display==="none"){Console.stack("log",arguments)}else{var html=Console.formatArgs.apply(window,arguments);var newItem=Console.addLine(html);Console.scroll()}};Console.warn=function(){if(!Console.debug){return}if(Console.silence||!document.body||Console.getConsoleDiv().style.display==="none"){Console.stack("warn",arguments)}else{var html=Console.formatArgs.apply(window,arguments);var newItem=Console.addLine(html);newItem.style.backgroundColor="#DDFFFF";Console.scroll()}};Console.error=function(){if(!Console.debug){return}if(Console.silence||!document.body||Console.getConsoleDiv().style.display==="none"){Console.stack("error",arguments)}else{var html=Console.formatArgs.apply(window,arguments);var newItem=Console.addLine(html);newItem.style.backgroundColor="#FFFFDD";Console.scroll()}};Console.info=function(){if(!Console.debug){return}if(Console.silence||!document.body||Console.getConsoleDiv().style.display==="none"){Console.stack("info",arguments)}else{var html=Console.formatArgs.apply(window,arguments);var newItem=Console.addLine(html);Console.scroll()}};Console.show=function(){Console.silence=false;var consoleWrapDiv=Console.getConsoleDiv();consoleWrapDiv.style.display="";while(Console.queue.length>0){Console[Console.queue[0].level].apply(window,Console.queue[0].agrs);Console.queue.shift()}Console.queue.length=0;var consoleInput=z.getDom("_ConsoleInput");consoleInput.focus()};Console.hide=function(){Console.silence=true;z.getDom("_Console").style.display="none"};Console.clear=function(){z.getDom("_ConsoleBody").innerHTML="";Console.cache.length=0;Console.queue.length=0};Console.switchDebugMode=function(status){if(status===undefined){Console.debug=!Console.debug}else{Console.debug=status}if(Console.debug){Cookie.set("console_debug","true");Console.log("调试模式开启。")}else{Cookie.set("console_debug","false");Console.addLine("调试模式关闭。");Console.scroll();window.setTimeout(function(){Console.hide();Console.clear()},1000)}return Console.debug};Console.toggleVisible=function(){if(z.getDom("_Console")&&z.getDom("_Console").style.display!=="none"){Console.hide()}else{Console.show()}};Console.attachOnkeyup=function(event){if(event.altKey&&event.shiftKey&&event.ctrlKey){if(event.keyCode===68){Console.toggleVisible()}}};Console.notify=function(){var counters=Console.counters;if(counters.error+counters.warn+counters.info+counters.log){var msg=["Logged Errors:",counters.error,"Warnings:",counters.warn,"Info:",counters.info,"Log:",counters.log].join(" ");if(counters.error){msg="*** "+msg}Zving.rootWin.status=msg}if(Console.status===false&&timer){window.clearInterval(timer);timer=null}};timer=window.setInterval(Console.notify,1000);if(window.console&&window.console.log&&Console.useBrowerConsole===true){Console=window.console}else{if(Console.debug&&Console.debugWindowError){window.onerror=function(message,file,line){if(z.getDom("_Console")&&z.getDom("_Console").style.display==="none"){return}Console.error("脚本错误:行:"+line+" 错误:"+message+" 文件:"+file)}}$document.on("keyup",Console.attachOnkeyup);$window.on("unload",function(){$document.off("keyup",Console.attachOnkeyup)})}z.Console=Console})();(function(){var c=window.Zving,a={};a.Supported="en,zh-cn,zh-tw";a.DefaultLanguage="zh-cn";a.Map={};a.get=function(d){return a.Map[d]};a.getCurrentLang=function(){var d=c.Cookie.get("_ZVING_LANGUAGE");if(d){return d}d=navigator.language?navigator.language:navigator.browserLanguage;d=d?d:navigator.systemLanguage;if(d){d=d.replace("_","-").toLowerCase();if(d.startsWith("en-")){d="en"}if(d.startsWith("ar-")){d="ar"}if(d.startsWith("de-")){d="de"}if(d.startsWith("es-")){d="es"}if(d.startsWith("fr-")){d="fr"}if(d.startsWith("pt-")){d="pt"}if(d.startsWith("ru-")){d="ru"}if(d.startsWith("ja-")){d="ja"}if(d.startsWith("ko-")){d="ko"}if(d.startsWith("it-")){d="it"}if(d.startsWith("zh-")){if(d!="zh-cn"){d="zh-tw"}else{d="zh-cn"}}return d}return a.DefaultLanguage};a.onLangButtonClick=function(f){var e=new Dialog({title:a.get("LangDialog.Title"),url:c.CONTEXTPATH+"framework/resources/langEditDialog.zhtml?ID="+f,width:710,height:200,onOk:function(){c.Node.setValue(f+"_I18N",$DW.getLangString());c.Node.setValue(f,$DW.getCurrentLangValue());$D.close()}});e.show()};a.setCurrentLang=function(g,e){var f=c.Cookie.get("_ZVING_LANGUAGE");if(f==g){return g}var d=new DataCollection();d.add("Language","en");Server.sendRequest("Application.changeLanguage",d,function(h){if(e){window.location.reload()}})};var b=a.getCurrentLang();if((","+a.Supported+",").indexOf(","+b+",")<0){c.Console.log("Zving Frmaework can't support language:"+b);b=a.DefaultLanguage}c.Lang=a;c.importCss("lang/"+b+".css");if(window==c.rootWin){c.importJs("lang/"+b+".js")}else{c.Lang.Map=c.rootWin.Zving.Lang.Map}})();(function(){var f=window.Zving,a=f.elCache,b={},e;b.idSeed={};e=new f.DataCollection();b.add=b.register=function(h,g){if(g&&typeof(h)=="string"){e.add(h,g)}else{e.add(h.id,h)}};b.remove=b.unregister=function(g){e.remove(g)};b.getById=b.get=function(g){return e.get(g)};b.getByDom=function(j,g){var h,k=g?(g.tagName?g:g.el):document.body;while(j!==k){if(j.compId){h=b.get(j.compId);if(h&&!h.delegated){if(g){if(h.container===g){return h}}else{return h}}}j=j.parentNode}return null};b._unload=function(){var h,g;for(h in e.map){g=e.map[h];if(g&&g.destroy&&!g.isDestroyed){g.destroy()}e.remove(h)}};b.initComponent=function(h,g){g=g||h.getAttribute("ztype");if(!g){return}switch(g.toLowerCase()){case"input":if(f.UI){f.UI.initCtrl(h)}break;case"verify":if(f.Verify){f.Verify.initCtrl(h)}break;case"date":case"time":case"datetime":if(f.DatePicker){new f.DatePicker(h)}break;default:}};b.initChildren=function(n){n=f.getDom(n);var j=[],h=[],k,m;if(n.canHaveChildren){j=n.getElementsByTagName("input");h=n.getElementsByTagName("textarea")}else{if(n.tagName=="INPUT"){j=[n]}else{if(n.tagName=="TEXTAREA"){h=[n]}else{return}}}var o;for(k=0,len=j.length;k',tpl:null,ctCls:null,baseCls:null,cmpCls:null,statable:false,defaultAlign:"rb",initPlugin:function(b){if(b.ptype&&!a.isFunction(b.init)){b=a.PluginManager.createPlugin(b)}else{if(a.isString(b)){b=a.PluginManager.createPlugin({ptype:b})}}b.init(this);return b},initComponent:function(){if(this.listeners){this.on(this.listeners);delete this.listeners}if(this.bubbleEvents){this.enableBubble(this.bubbleEvents);delete this.bubbleEvents}},htmlParser:function(b){return{el:b}},beforerender:function(){},render:function(c,b){c=a.getDom(c);var d=this;this.beforerender();if(this.rendered||this.fireEvent("beforerender",this)===false){return this}if(!c){if(this.el){c=(this.outerEl||this.el).parentNode}else{c=this.container||this.parentEl||document.body}}this.ownerDocument=c.ownerDocument;this.ownerWindow=c.ownerDocument.parentWindow;this.container=this.ownerWindow.Zving.getDom(c);if(this.ctCls){a.Node.addClass(this.container,this.ctCls);delete this.ctCls}this.onRender(this.container,b);this.rendered=true;if(this.autoShow){a.Node.removeClass(this.outerEl,this.hiddenClass)}if(this.cls){a.Node.addClass(this.outerEl,this.cls);delete this.cls}if(this.overCls){a.Node.hover(this.outerEl,function(e){if(!e.disabled){a.Node.addClass(e,this.overCls)}},function(e){a.Node.removeClass(e,this.overCls)})}this.fireEvent("render",this);this.initContent();this.afterRender(this.container);this.fireEvent("afterrender",this);if(this.hidden){a.Node.addClass(this.outerEl,this.hiddenClass)}if(this.disabled){this.disable(true)}return this},updateContent:function(c,e,b){var d=this.getContentEl();if(this.tpl&&typeof c!=="string"){d.innerHTML=a.String.tmpl(this.tpl,c||{})}else{var f=a.isObject(c)?a.Dom.createHtml(c):c;a.Node.update(d,f,e,b)}},applyToMarkup:function(b){this.el=a.getDom(b);this.container=(this.outerEl||this.el).parentNode;this.ownerDocument=this.container.ownerDocument;this.ownerWindow=this.ownerDocument.parentWindow;this.$el=this.ownerWindow.$(this.el);this.render(this.container)},onRender:function(d,b){var h,e;if(!d){d=this.container||document.body}else{this.ownerDocument=d.ownerDocument;this.ownerWindow=d.ownerDocument.parentWindow}var g=this.ownerDocument,f=this.ownerWindow;if(b!==undefined&&b!==null){if(a.isNumber(b)){b=d.childNodes[b]}else{b=this.ownerWindow.Zving.getDom(b)}}if(!this.el&&this.outerElAttrs){if(this.outerElAttrs){if(typeof this.outerElAttrs=="string"&&!/<|&#?\w+;/.test(this.outerElAttrs)){this.outerEl=g.createElement(this.outerElAttrs)}else{h=g.createElement("div");e=this.initRenderData();var c=typeof this.outerElAttrs=="string"?this.outerElAttrs:a.Dom.createHtml(this.outerElAttrs);h.innerHTML=a.String.tmpl(c,e);this.outerEl=h.firstChild}}}if(this.outerEl){if(b){d.insertBefore(this.outerEl,b)}else{d.appendChild(this.outerEl)}if(h){a.Dom.removeNode(h);h=null}}if(this.renderTpl){e=this.initRenderData();this.outerEl.innerHTML=a.String.tmpl(this.renderTpl,e)}this.el=this.ownerWindow.Zving.getDom(this.getId());if(this.el&&!this.outerEl){this.outerEl=this.el}else{if(!this.el&&this.outerEl){this.el=this.outerEl}}if(this.el!=this.outerEl){if(this.outerElIdPostfix){this.outerEl.id=this.getId()+this.outerElIdPostfix}}if(!this.el.id){this.el.compId=this.el.id=this.getId()}this.$el=this.ownerWindow.$(this.el);if(this.baseCls){a.Node.addClass(this.outerEl,this.baseCls)}if(this.cmpCls){a.Node.addClass(this.outerEl,this.cmpCls);delete this.cmpCls}if(this.style){if(typeof this.style=="string"){this.outerEl.style.cssText=this.style}else{a.extra(this.outerEl.style,this.style)}delete this.style}},initContent:function(){var b=this.getContentEl();if(this.html){b.innerHTML=this.html;delete this.html}if(this.contentEl){var c=a.getDom(this.contentEl);a.Node.removeClass(this.hiddenClass);b.appendChild(c)}if(this.tpl){b.innerHTML=a.String.tmpl(this.tpl,this.data||{});delete this.data}},afterRender:function(b){if(this.height||this.width){this.setSize(this.width,this.height)}if(this.x!==undefined||this.y!==undefined){this.setPosition(this.x,this.y)}this.initDom()},applyRenderSelectors:function(){var d=this.domSelectors||{},c=this.outerEl,b;for(b in d){if(!d.hasOwnProperty(b)){continue}this[b]=$.find(d[b],c)}},initDom:function(){this.applyRenderSelectors()},onResize:function(){},setSize:function(c,b){if(this.minWidth&&cthis.maxWidth){c=this.maxWidth}if(this.minHeight&&bthis.maxHeight){b=this.maxHeight}if(!this.rendered){this.width=(c!==undefined)?c:this.width;this.height=(b!==undefined)?b:this.height;return this}a.Node.setSize(this.outerEl,c,b);this.onResize(c,b);this.width=c;this.height=b;this.fireEvent("resize",this,c,b);return this},setPosition:function(b,c){if(!this.rendered){this.x=(b!==undefined)?b:this.x;this.y=(c!==undefined)?c:this.y;return this}a.Node.setPosition(this.outerEl,b,c);this.onPosition(b,c);this.x=b;this.y=c;this.fireEvent("move",this,b,c);return this},onPosition:function(){},getSize:function(){return a.Node.getSize(this.outerEl)},getId:function(){if(!this.id){var c=this.ctype.toLocaleLowerCase().replace(/\./g,"_"),b=a.rootWin.Zving.ComponentManager.idSeed;if(b[c]===undefined){b[c]=0}this.id="z-"+c+"-"+(++b[c])}return this.id},getItemId:function(){return this.itemId||this.getId()},getEl:function(){if(!this.el){this.el=(this.ownerWindow||window).Zving.getDom(this.id)}return this.el},getOuterEl:function(){return this.outerEl||this.el},getTargetEl:function(){return this.target||this.el},getContentEl:function(){return this.ownerWindow.Zving.getDom(this.id+"_body")||this.el},getBodyEl:function(){return this.ownerWindow.Zving.getDom(this.id+"_body")||this.el},getContainerEl:function(){return this.container||this.parentEl||(this.outerEl||this.el).parentNode},getOwnerCt:function(){return this.ownerCt},initRenderData:function(){this.renderData=this.renderData||{};return a.extraIf(this.renderData,{id:this.id,baseCls:this.baseCls,cmpCls:this.cmpCls,cls:this.cls})},focus:function(d,c){if(c){this.focusTask=new a.Util.DelayedTask(this.focus,this,[d,false]);this.focusTask.delay(a.isNumber(c)?c:16);return}if(this.rendered&&!this.isDestroyed){var b=this.getFocusEl?this.getFocusEl():this.el;b.focus();if(d===true){b.select()}}return this},blur:function(){if(this.rendered){var b=this.getFocusEl?this.getFocusEl():this.el;b.blur()}return this},disable:function(b){if(this.rendered){a.Node.addClass(this.outerEl,this.disabledClass);a.Node.disable(this.outerEl,this.maskOnDisable?true:false);this.outerEl.disabled=true}this.disabled=true;if(b!==true){this.fireEvent("disable",this)}return this},enable:function(b){if(this.rendered){a.Node.removeClass(this.outerEl,this.disabledClass);this.outerEl.disabled=false}this.disabled=false;if(b!==true){this.fireEvent("enable",this)}return this},isDisabled:function(){return this.disabled},setDisabled:function(b){return this[b?"disable":"enable"]()},show:function(){if(this.fireEvent("beforeshow",this)===false){return this}this.hidden=false;if(this.autoRender){this.render(a.isBoolean(this.autoRender)?(document.body||document.documentElement):this.autoRender)}if(this.rendered){a.Node.removeClass(this.outerEl,this.hiddenClass);if(this.outerEl.currentStyle.display=="none"){a.Node.show(this.outerEl)}if(this.outerEl.currentStyle.visibility=="hidden"){this.outerEl.style.visibility=""}}this.fireEvent("show",this);return this},hide:function(){if(this.fireEvent("beforehide",this)===false){return this}this.hidden=true;if(this.rendered){a.Node.addClass(this.outerEl,this.hiddenClass);if(this.outerEl.currentStyle.display!="none"){a.Node.hide(this.outerEl)}}this.fireEvent("hide",this);return this},setVisible:function(b){return this[b?"show":"hide"]()},isHidden:function(){return this.hidden},isVisible:function(){return this.rendered&&a.Node.isVisible(this.outerEl)},addClass:function(b){if(this.outerEl){a.Node.addClass(this.outerEl,b)}else{this.cls=this.cls?this.cls+" "+b:b}},removeClass:function(b){if(this.outerEl){a.Node.removeClass(this.outerEl,b)}else{if(this.cls){this.cls=this.cls.split(" ").remove(b).join(" ")}}return this},cloneConfig:function(c){c=c||{};var d=c.id||a.id();var b=a.extra(c,this.initialConfig);b.id=d;return b},findParentBy:function(b){var c=this.ownerCt;while(c&&!b(c,this)){c=c.ownerCt}return c||null},findParentByType:function(b){return a.isFunction(b)?this.findParentBy(function(c){return c.constructor===ctype}):this.findParentBy(function(c){return c.constructor.ctype===ctype})},clearListeners:function(){var c=this.events,d;for(var b in c){if(c.hasOwnProperty(b)){d=c[b];if(d.isEvent){d.clearListeners()}}}},getBubbleTarget:function(){return this.ownerCt},isFloating:function(){return this.floating},isDraggable:function(){return!!this.draggable},isDroppable:function(){return!!this.droppable},destroy:function(c){if(this.isDestroyed===true){return}if(this.fireEvent("beforedestroy",this)===false){return}this.destroying=true;if(this.beforeDestroy){this.beforeDestroy()}if(this.ownerCt&&this.ownerCt.remove){this.ownerCt.remove(this,false);delete this.ownerCt}if(this.rendered&&this.el){var b=this.el.ownerDocument.parentWindow.Zving;if(c||this.removeDomOnDestroy){b.Dom.removeNode(this.outerEl)}}if(this.focusTask&&this.focusTask.cancel){this.focusTask.cancel()}if(this.onDestroy){this.onDestroy()}a.ComponentManager.unregister(this.id);this.fireEvent("destroy",this);if(this.clearListeners){this.clearListeners()}if(this.deleteMembers){this.deleteMembers("container","defaultConfig","dom","el","$el","events","initialConfig","ownerDocument","ownerWindow")}this.destroying=false;this.isDestroyed=true},deleteMembers:function(){var c=arguments;for(var d=0,b=c.length;d{text}';f.Class.extend(e,f.UICompBase,{id:null,ctype:"Dialog",baseCls:"z-dialog",url:"",title:"",width:null,height:null,minWidth:200,minHeight:60,top:"50%",left:"50%",onOk:null,onCancel:null,okText:d.get("Common.OK"),cancelText:d.get("Common.Cancel"),OKClass:"z-dialog-okbutton",cancelClass:"z-dialog-cancelbutton",onInit:null,onReady:null,onLoad:null,onClose:null,icon:null,message:"",showButtonRow:true,animator:true,resizable:false,modal:true,animateTarget:null,follow:null,closable:true,draggable:true,esc:true,autoClose:null,closeTip:"? 秒后自动关闭",padding:"20px 25px",html:'
loading..
',autoRender:f.rootDoc.body,zIndex:10100,fixed:!f.isMobile&&!f.isIE6,renderTpl:e.htmlTemplate,bottonTpl:e.buttonTemplate,highlightButtonCls:c+"_state_highlight",hidden:true,removeDomOnDestroy:true,autoShow:false,contentElClass:c+"_content",initComponent:function(){this.addEvents("move","beforeresize","activate","deactivate","beforeclose","close");e.superclass.initComponent.apply(this);this.buttons=this.buttons||[];if(this.hidden===false){this.hidden=true;this.show()}this.opener=window;if(this.url){window.$D=this}},onRender:function(q,n){this.beforeRender();e.superclass.onRender.call(this,q,n);this.$el.css("position",this.fixed?"fixed":"absolute");var r=this.ownerWindow.Zving.getDom("z-dialog-proxy");if(!r){r=f.Dom.createNode({id:"z-dialog-proxy",className:"z-dlg-proxy"},this.ownerDocument).appendTo(this.ownerDocument.body)}this.proxy=this.ownerWindow.Zving.getDom(r);this.$proxy=this.ownerWindow.$(r);if(this.modal){var p=this.ownerWindow.Zving.getDom("_DialogShim");if(!p){p=this.ownerWindow.Zving.Dom.createNode({id:"_DialogShim",cls:"z-dlg-shim "+c+"_state_lock"},this.ownerDocument).appendTo(this.ownerDocument.body);if(f.isIE6){var o="Math.max(document.documentElement.scrollLeft, document.body.scrollLeft)",m="Math.max(document.documentElement.scrollTop, document.body.scrollTop)",k="(document.documentElement)";p.style.position="absolute";p.style.setExpression("left","eval("+o+') + "px"');p.style.setExpression("top","eval("+m+') + "px"')}else{p.style.position="fixed"}p.style.position=this.fixed?"fixed":"absolute"}this.shim=this.ownerWindow.Zving.getDom(p);this.$shim=this.ownerWindow.$(p)}},beforeRender:function(){},initContent:function(){var k=this.getContentEl();if(this.html){k.innerHTML=this.html;delete this.html}if(this.contentEl){this.updateContent()}if(this.tpl){k.innerHTML=f.String.tmpl(this.tpl,this.data||{});delete this.data}},updateContent:function(k,p,o){var s=this.getContentEl();if(k&&k.nodeType==1){this.contentEl=k;var m=this.ownerWindow.Zving.getDom(this.contentEl);var t=m.style.display,n=m.previousSibling,r=m.nextSibling,w=m.parentNode;var u=this;this._elemBack=function(){if(n&&n.parentNode){n.parentNode.insertBefore(m,n.nextSibling)}else{if(r&&r.parentNode){r.parentNode.insertBefore(m,r)}else{if(w){w.appendChild(m)}}}m.style.display=t;u._elemBack=null};f.Node.removeClass(m,this.hiddenClass);s.innerHTML="";s.appendChild(m)}else{if(this.tpl&&typeof k!=="string"){s.innerHTML=f.String.tmpl(this.tpl,k||{})}else{var q=f.isObject(k)?f.Dom.createHtml(k):k;f.Node.update(s,q,p,o)}}},afterRender:function(){this.dom={wrap:this.el,header:true,title:true,main:true,icon:true,iconBg:true,content:true,footer:true,buttons:true,close:true};var n=this.el.getElementsByTagName("*"),k=n.length;for(var m=0;mm){f.Node.setSize(this.shim,undefined,k)}if(n){f.Node.hide(this.shim);this.$shim.css("visibility","visible")}}},onWindowResize:function(){this.setShimSize();this.doConstrain()},beforeShow:function(){},show:function(m,n,k){if(!this.rendered){this.render(this.autoRender)}if(this.hidden===false){this.toFront();return this}if(this.fireEvent("beforeshow",this)===false){return this}this.hidden=false;this.beforeShow();this.animateTarget=m||this.animateTarget;if(this.animateTarget){this.animShow()}else{this.afterShow()}if(this.modal){if(!f.Node.isVisible(this.shim)){this.setShimSize();if(this.animator){f.rootWin.Node.setOpacity(this.shim,3);this.$shim.show();this.$shim.fadeIn()}else{this.$shim.show()}}}return this},afterShow:function(k){this.$proxy.hide();this.$el.show();if(this.monitorResize||this.modal||this.constrain){f.rootWin.Zving.EventManager.onWindowResize(this.onWindowResize,this)}this.doConstrain();this.doLayout();this.toFront();this.onShow();this.fireEvent("show",this)},animShow:function(){this.$proxy.show();f.Node.setBox(this.proxy,f.Node.getBox(this.animateTarget));f.Node.setOpacity(this.proxy,0);var k=this.getBox();this.$el.css("display","none");this.$proxy.animate(f.extra(k,{opacity:0.5}),this.afterShow)},onShow:f.noopFn,toFront:function(k){if(this.manager.bringToFront(this)){if(!k||!k.getTarget().focus){this.focus()}}return this},toBack:function(){this.manager.sendToBack(this);return this},setActive:function(n){if(n){var k=f.rootWin.Zving.Dialog.front,m=f.rootWin.Zving.Dialog.front.lastZIndex;this.setZIndex(m);if(this.modal&&this.shim){this.$shim.show()}this.addClass(c+"_state_focus");this.fireEvent("activate",this)}else{this.removeClass(c+"_state_focus");this.fireEvent("deactivate",this)}},hide:function(n,k,m){if(this.hidden||this.fireEvent("beforehide",this)===false){return this}if(k){this.on("hide",k,m)}this.hidden=true;if(this.modal){}this.animateTarget=n||this.animateTarget;if(this.animateTarget){this.animHide()}else{this.$el.hide();this.afterHide()}return this},afterHide:function(){this.$proxy.hide();if(this.monitorResize||this.modal||this.constrain){f.rootWin.Zving.EventManager.removeResizeListener(this.onWindowResize,this)}this.onHide();this.fireEvent("hide",this)},animHide:function(){f.Node.setOpacity(this.proxy,0.5);this.$proxy.show();var k=this.getBox(false);f.Node.setBox(this.proxy,k);this.$el.hide();this.$proxy.animate(f.extra(f.Node.getBox(this.animateTarget),{opacity:0}),this.afterHide)},onHide:f.noopFn,doConstrain:function(){if(this.container.nodeName=="BODY"){return}var o;if(this.constrain){var n=this.getSize();o={right:-(n.width-50),bottom:-(n.height-25)}}var r=f.Node.getConstrainToXY(this.el,this.container,true,o);if(r){var q=f.isIE6?false:this.fixed;if(q){var p=f.rootWin.document,k=Math.max(p.documentElement.scrollLeft,p.body.scrollLeft),m=Math.max(p.documentElement.scrollTop,p.body.scrollTop);r[0]=r[0]-k;r[1]=r[1]-m}this.setPosition(r[0],r[1])}},doLayout:f.noopFn,close:function(){if(this.isDestroyed===true){return}if(this.fireEvent("beforeclose",this)!==false){if(this.hidden){this.doClose()}else{this.hide(null,this.doClose,this)}}},doClose:function(){if(this.onClose){this.onClose.call(this,this.innerWin);this.onClose=null}this.fireEvent("close",this);this.destroy()},beforeDestroy:function(){this.destroyIframe();if(this.dd&&this.dd.proxyEl){f.rootWin.Zving.Dom.removeNode(this.dd.proxyEl)}if(this._elemBack){this._elemBack()}},destroyIframe:function(){var k=this;if(!k.dom.iframe){return}window.$DW=null;k.innerDoc=null;k.innerWin=null;if(!f.isGecko){$(k.innerFrame).off("load.dialog")}else{k.innerFrame.onload=null}k.innerFrame.src="about:blank";f.Dom.removeNode(k.dom.iframe);k.innerFrame=null},onDestroy:function(){if(this.dd){this.dd.destroy();delete this.dd}if(this.manager){this.manager.unregister(this)}e.superclass.onDestroy.call(this)},setZIndex:function(k){if(k===undefined){k=this.zIndex}if(this.modal){this.$shim.css("z-index",k)}this.el.style.zIndex=(++k);this.zIndex=k;k+=5;this.lastZIndex=k;return this},setSize:function(k,m){this.onSetSize(k,m)},onSetSize:function(k,m){if(this.url){k=k||"61.8%";m=m||"61.8%"}this.dom.$main.css("min-width",this.minWidth+"px");if(k){this._width=k.toString().indexOf("%")!==-1?k:null;var o=f.Dom.getViewport(f.rootWin).width-this.el.offsetWidth+this.dom.main.offsetWidth;k=this._toNumber(k,o);if(typeof k=="number"){this.$el.css("width","auto");this.dom.$main.css("width",Math.max(this.minWidth,k)+"px");this.$el.css("width",this.el.offsetWidth+"px")}else{if(typeof k=="string"){this.dom.main.style.width=k;if(k=="auto"){this.$el.css("width","auto")}}}}if(m){this._height=m.toString().indexOf("%")!==-1?m:null;var n=f.Dom.getViewport(f.rootWin).height-this.el.offsetHeight+this.dom.main.offsetHeight;m=this._toNumber(m,n);if(typeof m=="number"){this.dom.$main.css("height",Math.max(this.minHeight,m)+"px")}else{if(typeof m=="string"){this.dom.$main.css("height",m)}}}this.fireEvent("resize",this);return this},dragstart:function(k){k.proxy=this.proxy}});f.extra(e.prototype,{shake:function(){var k=this.el.style,n=[4,8,4,0,-4,-8,-4,0],m=function(){k.marginLeft=n.shift()+"px";if(n.length<=0){k.marginLeft=0;clearInterval(timerId)}};n=n.concat(n.concat(n));timerId=setInterval(m,13);return this}});f.extra(e,{alert:function(n,m,k){if(k===false){return e.warn(n,m)}return new e({autoShow:true,icon:"icon_info",html:""+n,cancelText:d.get("Common.OK"),onCancel:function(){if(m){m()}}})},warn:function(m,k){return new e({autoShow:true,icon:"icon_warn",html:""+m,cancelText:d.get("Common.OK"),onCancel:function(){if(k){k()}}})},confirm:function(n,m,k){return new e({autoShow:true,icon:"icon_query",html:n,onOk:function(){if(!m){return this.close()}if(m.call(this,window)!==false){this.close()}},onCancel:k||f.noopFn})},prompt:function(o,n,k){k=k||"";var m;return new e({autoShow:true,html:['
',o,"
","
",'',"
"].join(""),onShow:function(){m=this.dom.$content.find("input")[0];m.select();m.focus()},onOk:function(p){return n&&n.call(this,m.value,p)}})},tips:function(k,m){return new e({autoShow:true,title:false,modal:false,html:'
'+k+"
",time:m||2})},WaitID:null,wait:function(m){var p=0,n;var o=new e({autoShow:true,html:m,onCancel:function(){return false}});var k=function(){if(!o||o.destroying===true){if(n){clearTimeout(n)}return}p++;o.cancelButton.innerText=d.get("Dialog.WaitMessage")+"("+p+")...";o.waitTimer=n=setTimeout(k,1000)};o.waitTimer=n=setTimeout(k,1000);o.on("beforeclose",function(){clearTimeout(n)});return o},getInstance:function(k){return e.Manager.get(k)}});e.list={};e.accessList=[];e.front=null;if(window!=f.rootWin){e.list=f.rootWin.Zving.Dialog.list;e.accessList=f.rootWin.Zving.Dialog.accessList;e.front=f.rootWin.Zving.Dialog.front}e.Manager=function(){var q=function(s){if(e.accessList.length==1){e.front=f.rootWin.Zving.Dialog.front=s}};var r=function(u){if(e.isHideScrollbar){var t=f.rootDoc.getElementsByTagName(f.rootDoc.compatMode=="BackCompat"?"BODY":"HTML")[0];t._styleOverflow=t.style.overflow;if(!b){var s=t.scrollTop;t.style.overflow="hidden";t.scrollTop=s}else{t.style.overflow="hidden"}}};var k=function(u){if(e.accessList.length<2){if(f.rootWin.Zving.getDom("_DialogShim")){f.rootWin.$("#_DialogShim").hide()}if(e.isHideScrollbar){var t=f.rootDoc.getElementsByTagName(f.rootDoc.compatMode=="BackCompat"?"BODY":"HTML")[0];if(t._styleOverflow!==undefined){if(!b){var s=t.scrollTop;t.style.overflow=t._styleOverflow;t.scrollTop=s}else{t.style.overflow=t._styleOverflow}}}}};var n=function(t,s){return(!t._lastAccess||t._lastAccess0){u.sort(n);var t=u[0].manager.zseed;for(var w=0;w=0;--s){if(!e.accessList[s].hidden){o(e.accessList[s]);return}}o(null)};return{zseed:10100,listenKeydown:function(s,u){s=f.getEvent(s);var t=s.target;if(s.keyCode==27){if(u&&u.ctype=="dialog"){if(t.nodeName&&/^textarea$/i.test(t.nodeName)&&t.defaultValue!=t.value&&t.value.length>2&&!confirm("侦测文本框中的内容已经被修改,你确定要放弃修改吗?")){return}u.onEsc(s)}else{if(f.rootWin.Zving.Dialog.front&&f.rootWin.Zving.Dialog.front.esc){f.rootWin.Zving.Dialog.front.onEsc(s)}}}},closeAll:function(s){if(e.accessList.length>0){e.accessList.each(function(t){if(s){if(t.opener==window){t.close()}}else{t.close()}});return true}return false},register:function(s){e.list[s.id]=s;e.accessList.push(s);s.on("hide",m);s.on("show",r);s.on("close",k)},unregister:function(s){delete e.list[s.id];s.un("hide",m);s.un("show",r);s.un("close",k);e.accessList.remove(s)},get:function(s){return typeof s==="object"?s:e.list[s]},bringToFront:function(s){s=this.get(s);if(s!=f.rootWin.Zving.Dialog.front){s._lastAccess=new Date().getTime();p();q(s);return true}return false},sendToBack:function(s){s=this.get(s);s._lastAccess=-(new Date().getTime());p();return s},getActive:function(){return f.rootWin.Zving.Dialog.front}}}();j.onReady(function(){if(f.restricted||!window.frameElement){return}var k;try{k=window.frameElement.getAttribute("ownerdialogid")}catch(n){f.Console.error("没有权限:可能因为跨域,对话框不能与父窗口交互。")}if(!k){return}if(f.Misc.inputFocus){f.Misc.inputFocus()}var m;if(f.Config.namespace=="window"){m=f.rootWin.Dialog.list[k]}else{m=f.rootWin.Zving.Dialog.list[k]}if(!m){return}window.ownerDialog=m;window.dialogOpener=m.opener;if(m.getTitle()===""&&document.title){m.setTitle(document.title)}m.onIframeReady(window)},4);$document.on("keydown",e.Manager.listenKeydown);$window.on("unload",function(){$document.off("keydown",e.Manager.listenKeydown);e.Manager.closeAll(true)});f.Dialog=e})();(function(){var f=window.Zving,c=f.isIE,a=f.isGecko,b=f.Page,d=f.Lang;var e=function(o,k,q,h,g){if(!(this instanceof e)){return new e(o,k,q,h,g)}if(!o){return}var p=f.rootWin;var j="Pop"+(p.Zving.MsgPop?p.Zving.MsgPop._Array.length:"");var m=o.length;var n=this;n.id=j;n.width=h?h:(m<100?240:250+Math.floor(m/3));n.height=q?q:100;n.top=0;n.parentWindow=null;n.onLoad=null;n.title="";n.url=k?k:null;n.message=o?o:null;n.icon=null;n.timeout=g||3;n.autoShow=true;setTimeout(function(){if(n.autoShow){n.show()}},10)};e._Array=[];e.TOP=0;e.prototype.show=function(){var m=f.rootWin;var n=m.document;if(!this.parentWindow){this.parentWindow=window}var h=[];h.push(" ");h.push(" ");h.push(" ");h.push(' ");h.push(" ");h.push(" ");h.push("
');h.push(' ");h.push('
');if(this.url){if(this.url.indexOf(":")==-1){h.push('')}else{h.push(this.message)}h.push("
");h.push("
");this.Html=h.join("");this.TopWindow=m;var g=m.Zving.$G("_MsgPopBoxDiv");if(!g){g=m.document.createElement("div");g.id="_MsgPopBoxDiv";g.style.cssText="position:fixed; left:0; top:0; width:100%; height:1px; overflow:visible; z-index:10200;";if(isIE6){g.style.position="absolute"}m.document.body.appendChild(g)}if(e.TOP){g.style.top=e.TOP+"px"}this.MsgPopBoxDiv=g;var j=m.document.createElement("div");j.id=this.id;j.innerHTML=this.Html;j.className="squares msgpop";g.appendChild(j);j.MsgPopInstance=this;m.MsgPop._Array.push(this.id);var k={height:Node.getDimensions(j).height};j.style.height="1px";$(j).animate(k);j.style.visibility="";if(this.timeout&&this.timeout>0){e.autoClose(this.id,this.timeout)}};e.getInstance=function(j){var h=f.rootWin;var g=h.Zving.$G(j);if(!g){return null}return g.MsgPopInstance};e.autoClose=function(j,h){var g=f.rootWin;if(!g.Zving.$G(j)){return}h-=1;if(e.countdown){g.Zving.$G(j+"CloseTip").innerHTML=d.get("MsgPop.Countdown").format(h)}if(h<=0){e.close(j,true)}else{e._closeHand=setTimeout(function(){e.autoClose(j,h)},1000)}};e.prototype.close=function(){var g=f.rootWin;this.MsgPopBoxDiv.outerHTML="";g.MsgPop._Array.remove(this.id)};e.close=function(j,h){var g=f.rootWin;g["eval"]('window._OpacityPopFunc = function(){Zving.$G("'+j+'").outerHTML = "";Zving.rootWin.Zving.MsgPop._Array.remove("'+j+'");}');if(h){g.$("#"+j).fadeOut("slow",g._OpacityPopFunc)}else{g._OpacityPopFunc()}};e.closeSelf=function(){if(window!=window.parent){var g=window.frameElement.getAttribute("boxId");if(g){parent.MsgPop.close(g)}}else{if(e._Array.length>0){var h=e._Array[e._Array.length-1];e.close(h)}}};if(f.rootWin!=window){e=f.rootWin.MsgPop}f.importCss("resources/msgpop.css");f.MsgPop=e})();(function(){var e=window.Zving,c=e.Node,d,a,b;d=function(f){this.defaultConfig={_childCals:[]};if(!(this instanceof d)){return e.ComponentManager.get(e.getDom(f).compId)}d.superclass.constructor.call(this,f)};e.Class.extend(d,e.UICompBase,{ctype:"Calendar",container:e.rootDoc.body,date:new Date(),selectedDate:null,startDay:0,pages:1,rangeSelect:false,minDate:false,maxDate:false,multiSelect:false,multi:null,navigator:true,popup:true,closable:true,showTime:false,triggerType:"click",disabled:null,range:null,rangeLinkage:true,notLimited:false,removeDomOnDestroy:true,zIndex:10800,_handleDate:function(){var g=this,f=g.date;g.weekday=f.getDay();g.day=f.getDate();g.month=f.getMonth();g.year=f.getFullYear();return this},initComponent:function(){var f=this;if(typeof this.target=="string"){this.target=e.g(this.target)}if(typeof this.trigger=="string"){this.trigger=e.g(this.trigger)}if(this.target&&this.target.value&&/\d/.test(this.target.value)){this.date=this._time=this.selectedDate=e.DateTime.parseDate(this.target.value)}this._handleDate();d.superclass.initComponent.call(this);if(f.popup&&f.target){$(f.target).on("click",function(){f.expand()});if(f.trigger&&f.target!=f.trigger){$(f.trigger).on(this.triggerType,function(){f.toggle()})}}},onRender:function(g,f){var h=this;if(!g){g=this.parentEl||document.body}this.ownerDocument=g.ownerDocument;this.ownerWindow=g.ownerDocument.parentWindow;if(this.ownerWindow==e.rootWin){this.showOnRootWindow=true}else{this.showOnRootWindow=false}this.layer=new e.Layer({cls:"z-cal-call",parentEl:g,zIndex:this.zIndex});if(!h.popup){this.layer.el.style.position="relative"}this.outerEl=this.el=this.layer.el;this.$el=this.layer.$el;this.el.calendarId=e.pageId+h.id;h._parseParam();h._childCals=h._childCals||[];h._childCals.length=h.pages;for(i=0;i8?(h+1):"0"+(h+1))+"-"+(f>9?f:"0"+f)},_handleString2Date:function(g){var f=g.toString().split("-");if(f.length==3){date=new Date(parseInt(f[0],10),(parseInt(f[1],10)-1),parseInt(f[2],10));if(date instanceof Date&&(date!="Invalid Date")&&!isNaN(date)){return date}}},_getHeadStr:function(f,g){return f.toString()+"年"+(Number(g)+1).toString()+"月"},_monthAdd:function(){var f=this;if(f.month==11){f.year++;f.month=0}else{f.month++}f.date=new Date(f.year.toString()+"/"+(f.month+1).toString()+"/1");return this},_monthMinus:function(){var f=this;if(f.month===0){f.year--;f.month=11}else{f.month--}f.date=new Date(f.year.toString()+"/"+(f.month+1).toString()+"/1");return this},_yearAdd:function(){var f=this;f.year++;f.date=new Date(f.year.toString()+"/"+(f.month+1).toString()+"/1");return this},_yearMinus:function(){var f=this;f.year--;f.date=new Date(f.year.toString()+"/"+(f.month+1).toString()+"/1");return this},_computeNextMonth:function(f){var h=f[0],g=f[1];if(g==11){h++;g=0}else{g++}return[h,g]},_handleOffset:function(){var j=this,k=["日","一","二","三","四","五","六"],g="{day}",n=j.startDay,m="",f=[];for(var h=0;h<7;h++){f[h]=e.String.tmpl(g,{day:k[(h+n)%7]})}m=f.join("");return{day_html:m}},_handleRange:function(h){var g=this,f;g.range=g.range||{start:null,end:null};if((g.range.start===null&&g.range.end===null)||(g.range.start!==null&&g.range.end!==null)){g.range.start=h;g.range.end=null;g.update()}else{if(g.range.start!==null&&g.range.end===null){g.range.end=h;if(g.range.start.getTime()>g.range.end.getTime()){f=g.range.start;g.range.start=g.range.end;g.range.end=f}g.fireEvent("rangeSelect",g.range);g.update();if(g.popup&&g.closable){g.hide()}}}return this},beforeDestroy:function(){var g=this;$(g.target).off("click");$(g.trigger).off();e.AllDocumentsEvent.un("mousedown.calendar");if(e.rootWin!=window){e.rootWin.$(e.rootDoc).off("mousewheel.calendar")}$document.off("mousewheel.calendar");for(var f=0;f','<<','{title}','>>',"",'
','
',"{day}","
",'
',"{ds}",'
',"
","
",'",'','
','
','
',"时间:00:00:00","
","
",'"].join(""),nav_html:["

","月",'","

","

","年",'',"

","

",'',"

"].join(""),initComponent:function(){if(typeof this.target=="string"){this.target=e.g(this.target)}if(typeof this.trigger=="string"){this.trigger=e.g(this.trigger)}d.Page.superclass.initComponent.call(this)},initRenderData:function(){this.renderData=this.renderData||{};var h=this,g={},f;h.HTML="";g.prev="";g.next="";g.title="";g.ds="";g.notlimited="";g.notlimitedClass="";if(!h.prevArrow){g.prev="hidden"}if(!h.nextArrow){g.next="hidden"}if(!h._parent.showTime){g.showtime="hidden"}if(!h._parent.notLimited){g.notlimited="hidden"}if(!h._parent.multiSelect){g.multiSelect="hidden"}if(h._parent.showTime&&h._parent.notLimited){g.notlimitedCls="z-cal-notLimited-showTime"}if(h._parent.notLimited&&!h._parent.selectedDate){g.notlimitedCls+=" z-cal-notLimited-selected"}g.id=h.id="z-cal-"+Math.random().toString().replace(/.\./i,"");g.title=h._parent._getHeadStr(h.year,h.month);h.createDS();g.ds=h.ds;g.day=h._parent._handleOffset().day_html;return e.extra(this.renderData,g)},update:function(h){var g=this;g._parseParam(h);renderData=this.initRenderData();var f=g.dom.foot.innerHTML;this.outerEl.innerHTML=e.String.tmpl(this.renderTpl,renderData);g.dom.foot=this.ownerWindow.$(".z-cal-ft",g.node)[0];if(g._parent.showTime){g.dom.foot.innerHTML=f;g.timmer.resume()}},_parseParam:function(h){var g=this,f;if(h===undefined||h===null){h={}}for(f in h){g[f]=h[f]}return this},initDom:function(){var f=this;f.node=this.ownerWindow.Zving.getDom(f.id);f.dom.foot=this.ownerWindow.$(".z-cal-ft",f.node)[0];if(f._parent.showTime){f.timmer=new a({container:f.dom.foot,_parent:f._parent});f.timmer.render()}this.initEvents()},initEvents:function(){var g=this,f=g.$el;if(!g._parent.multiSelect){f.on("click","div.z-dbd a",function(h){g._dbd_onClick(h)})}f.on("click","a.z-prev-month",function(h){g._prevMonth_onClick(h)});f.on("click","a.z-next-month",function(h){g._nextMonth_onClick(h)});f.on("click","a.z-prev-year",function(h){g._prevYear_onClick(h)});f.on("click","a.z-next-year",function(h){g._nextYear_onClick(h)});if(g._parent.navigator){f.on("click","a.z-title",function(h){g._title_onClick(h)})}f.on("click",".z-setime",function(h){g._setime_onClick(h)});if(g._parent.notLimited){f.on("click",".z-cal-notLimited",function(h){g._notLimited_onClick(h)})}if(g._parent.multiSelect){f.on("mousedown","div.z-dbd a",function(h){g._dbd_onMouseDown(h)});f.on("mouseup","div.z-dbd a",function(h){g._dbd_onMouseUp(h)});f.on("click",".z-multi-select-btn",function(h){g._multiSelectBtn_onClick(h)})}},_dbd_onClick:function(h){var f=this;h.preventDefault();var g=h.currentTarget;if(g.tagName!="A"){return}if(c.hasClass(g,"z-null")){return}if(c.hasClass(g,"z-disabled")){return}var j=new Date(f.year,f.month,Number(g.innerHTML));f._parent.dt_date=j;f._parent.fireEvent("select",{date:j});if(f._parent.popup&&f._parent.closable&&!f._parent.showTime&&!f._parent.rangeSelect){f._parent.hide()}if(f._parent.rangeSelect){f._parent._handleRange(j)}f._parent.update({selectedDate:j})},_prevMonth_onClick:function(g){var f=this;g.preventDefault();if(!f._parent.rangeLinkage){f._monthMinus()}f._parent._monthMinus().update();f._parent.fireEvent("monthChange",{date:new Date(f._parent.year+"/"+(f._parent.month+1)+"/01")})},_nextMonth_onClick:function(g){var f=this;g.preventDefault();if(!f._parent.rangeLinkage){f._monthAdd()}f._parent._monthAdd().update();f._parent.fireEvent("monthChange",{date:new Date(f._parent.year+"/"+(f._parent.month+1)+"/01")})},_prevYear_onClick:function(g){var f=this;g.preventDefault();if(!f._parent.rangeLinkage){f._yearMinus()}f._parent._yearMinus().update();f._parent.fireEvent("monthChange",{date:new Date(f._parent.year+"/"+(f._parent.month+1)+"/01")})},_nextYear_onClick:function(g){var f=this;g.preventDefault();if(!f._parent.rangeLinkage){f._yearAdd()}f._parent._yearAdd().update();f._parent.fireEvent("monthChange",{date:new Date(f._parent.year+"/"+(f._parent.month+1)+"/01")})},_title_onClick:function(m){var j=this,g=j.el;try{j.timmer.hidePopup();m.preventDefault()}catch(f){}var k=m.currentTarget;var n=$(".z-setime",g)[0];n.innerHTML="";var h=e.String.tmpl(j.nav_html,{the_month:j.month+1,the_year:j.year});n.innerHTML=h;c.removeClass(n,"hidden");g.getElementsByTagName("input").onkeydown=function(q){q=q||window.event;input=this;if(q.keyCode==38){input.value=Number(q.target.val())+1;input.select()}if(q.keyCode==40){input.value=Number(q.target.val())-1;input.select()}if(q.keyCode==13){var p=$(".z-setime select",g).val();var o=$(".z-setime input",g).val();$(".z-setime",g).addClass("hidden");if(!j.Verify().isYear(o)){return}if(!j.Verify().isMonth(p)){return}j._parent.update({date:new Date(o+"/"+p+"/01")});j._parent.fireEvent("monthChange",{date:new Date(o+"/"+p+"/01")})}}},_setime_onClick:function(m){var j=this;m.preventDefault();var k=m.target;var h=m.currentTarget;if(c.hasClass(k,"ok")){var g=$("select",h).val(),f=$("input",h).val();$(h).addClass("hidden");if(!j.Verify().isYear(f)){return}if(!j.Verify().isMonth(g)){return}j._parent.update({date:new Date(f+"/"+g+"/01")});j._parent.fireEvent("monthChange",{date:new Date(f+"/"+g+"/01")})}else{if(c.hasClass(k,"cancel")){$(h).addClass("hidden")}}},_notLimited_onClick:function(g){var f=this;g.preventDefault();f._parent.range={start:null,end:null};f._parent.fireEvent("select",{date:null});if(f._parent.popup&&f._parent.closable){f._parent.hide()}f._parent.update({selectedDate:null})},_dbd_onMouseDown:function(h){var f=this;h.preventDefault();var g=h.currentTarget;if(g.tagName!="A"){return}if(c.hasClass(g,"z-null")){return}if(c.hasClass(g,"z-disabled")){return}var j=new Date(f.year,f.month,Number(h.target.innerHTML))},_dbd_onMouseUp:function(h){var f=this;h.preventDefault();var g=h.currentTarget;if(g.tagName!="A"){return}if(c.hasClass(g,"z-null")){return}if(c.hasClass(g,"z-disabled")){return}var j=new Date(f.year,f.month,Number(h.target.innerHTML))},_multiSelectBtn_onClick:function(g){var f=this;g.preventDefault()},_monthAdd:function(){var f=this;if(f.month==11){f.year++;f.month=0}else{f.month++}},_monthMinus:function(){var f=this;if(f.month===0){f.year--;f.month=11}else{f.month--}},_yearAdd:function(){var f=this;f.year++},_yearMinus:function(){var f=this;f.year--},_getNode:function(){return this.node},_getNumOfDays:function(f,g){return 32-new Date(f,g-1,32).getDate()},_isDisabled:function(f,g){if(f&&f.length>0){for(var h=0;h0){for(var h=0;h0'}for(h=1;h<=o;h++){var p="";var g=new Date(m.year,m.month,h);if((m._parent.minDate&&new Date(m.year,m.month,h+1)m._parent.maxDate)||m._isDisabled(m._parent.disabled,g)){p="z-disabled"}else{if(m._parent.range&&g>=m._parent.range.start&&g<=m._parent.range.end){p="z-range"}else{if((j&&j.getFullYear()==m.year&&j.getMonth()==m.month&&j.getDate()==h)||m.isInMulit(m._parent.multi,g)){p="z-selected"}}}if(n.getFullYear()==m.year&&n.getMonth()==m.month&&n.getDate()==h){p+=" z-today"}q+="'+h+""}m.ds=q;return q},Verify:function(){var g=function(j){if(!/^\d+$/i.test(j)){return false}j=Number(j);return!(j<1||j>31)},f=function(j){if(!/^\d+$/i.test(j)){return false}j=Number(j);return!(j<100||j>10000)},h=function(j){if(!/^\d+$/i.test(j)){return false}j=Number(j);return!(j<1||j>12)};return{isDay:g,isYear:f,isMonth:h}},beforeDestroy:function(f){this.$el.off()}});a=function(f){this.container=f.container;this._parent=f._parent;this.ownerWindow=this._parent.ownerWindow;this.ownerDocument=this._parent.ownerDocument;this.$calendarWrap=$(this.container).closest(".z-cal-box");if(typeof this._parent._time=="undefined"){this._parent._time=new Date()}this.time=this._parent._time;this.status="s";this.ctime=Dom.createNodeByHtml('
时间:h:m:s
',this._parent.ownerDocument);this.button=Dom.createNodeByHtml('',this._parent.ownerDocument);this.h_a=["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"];this.m_a=["00","10","20","30","40","50"];this.s_a=["00","10","20","30","40","50"];a.superclass.constructor.call(this,f)};e.Class.extend(a,e.UICompBase,{ctype:"TimeSelector",initComponent:function(){if(typeof this.target=="string"){this.target=e.g(this.target)}if(typeof this.trigger=="string"){this.trigger=e.g(this.trigger)}a.superclass.initComponent.call(this)},onRender:function(){var f=this;f.container.innerHTML="";f.container.appendChild(f.ctime);f.container.appendChild(f.button);f.$ctime=f.ownerWindow.$(f.ctime);f.$button=f.ownerWindow.$(f.button);f.update()},initDom:function(){this.initEvents()},initEvents:function(){var f=this;var g=this.$calendarWrap;g.on("click.timeselector","div.z-selectime a.x",function(h){f.hidePopup()});g.on("click.timeselector","div.z-selectime a.item",function(k){var j=k.currentTarget;var h=Number(j.innerHTML);f.set(f.status,h);f.hidePopup()});g.on("click.timeselector","div.z-cal-ft button.ct-ok",function(){var h=typeof f._parent.dt_date=="undefined"?f._parent.date:f._parent.dt_date;h.setHours(f.get("h"));h.setMinutes(f.get("m"));h.setSeconds(f.get("s"));f._parent.fireEvent("timeSelect",{date:h});if(f._parent.popup&&f._parent.closable){f._parent.hide()}});g.on("click.timeselector","div.z-cal-time button.u",function(){f.hidePopup();f.add()});g.on("click.timeselector","div.z-cal-time button.d",function(){f.hidePopup();f.minus()});g.on("click.timeselector","div.z-cal-time span.h",function(){var h=f.parseSubHtml(f.h_a);f.status="h";f.showPopup(h)});g.on("click.timeselector","div.z-cal-time span.m",function(){var h=f.parseSubHtml(f.m_a);f.status="m";f.showPopup(h)});g.on("click.timeselector","div.z-cal-time span.s",function(){var h=f.parseSubHtml(f.s_a);f.status="s";f.showPopup(h)})},resume:function(){var f=this.$calendarWrap;this.$ctime=f.find("div.z-cal-time");this.$button=f.find("button.ct-ok");this.ctime=this.$ctime[0];this.button=this.$button[0]},parseSubHtml:function(f){var h="";for(var g=0;g'+f[g]+""}h+='x';return h},showPopup:function(g){var h=this;this._getPopupannel().innerHTML=g;c.removeClass(this._getPopupannel(),"hidden");var f=h.status;h.$ctime.find("span").removeClass("on");switch(f){case"h":h.$ctime.find(".h").addClass("on");break;case"m":h.$ctime.find(".m").addClass("on");break;case"s":h.$ctime.find(".s").addClass("on");break}},_getPopupannel:function(){return this.$calendarWrap.find("div.z-selectime")[0]},hidePopup:function(){c.addClass(this._getPopupannel(),"hidden")},update:function(){var k=this;var j=k.get("h");var f=k.get("m");var g=k.get("s");k._parent._time=k.time;k.$ctime.find(".h").html(j);k.$ctime.find(".m").html(f);k.$ctime.find(".s").html(g);return k},set:function(f,g){var h=this;g=Number(g);switch(f){case"h":h.time.setHours(g);break;case"m":h.time.setMinutes(g);break;case"s":h.time.setSeconds(g);break}h.update()},get:function(f){var g=this;var h=g.time;switch(f){case"h":return h.getHours();case"m":return h.getMinutes();case"s":return h.getSeconds()}},add:function(){var h=this;var f=h.status;var g=h.get(f);g++;h.set(f,g)},minus:function(){var h=this;var f=h.status;var g=h.get(f);g--;h.set(f,g)},beforeDestroy:function(f){this.$calendarWrap.off("click.timeselector")}});b=function(j,h){if(!(this instanceof b)){return e.ComponentManager.get(e.getDom(j).compId)}var k=this.el=j=e.g(j);k.compId=this.id="z-datepicker"+(++e.idSeed._seed);e.ComponentManager.add(this);var g;if(j.type!="text"){k=c.prevElement(j);g=j}var f={date:"framework/images/Calendar.gif",time:"framework/images/TimeSelector.gif",datetime:"framework/images/DateTime.gif"};ztype=h||k.getAttribute("ztype");ztype=ztype.toLowerCase();if(!g){if(!k.nextSibling||k.nextSibling.tagName!=="IMG"||k.nextSibling.src.indexOf(f[ztype])==-1){k.insertAdjacentHTML("afterEnd",'')}g=k.nextSibling}this.trigger=g;if(ztype=="date"){this.picker=new d({target:k,trigger:g});this.picker.on("select",function(n){var m=e.Date.format(n.date);if(k.value!=m){k.value=m;$(k).change()}})}else{if(ztype=="datetime"){this.picker=new d({target:k,trigger:g,showTime:true});this.picker.on("timeSelect",function(n){var m=e.Date.format(n.date,"yyyy-MM-dd hh:mm:ss");if(k.value!=m){k.value=m;$(k).change()}})}else{if(ztype=="time"){this.picker=new d({target:k,trigger:g,showTime:true});this.picker.on("timeSelect",function(n){var m=e.Date.format(n.date,"yyyy-MM-dd hh:mm:ss");if(k.value!=m){k.value=m;$(k).change()}})}}}this.initEvents()};b.prototype={initEvents:function(){var f=this;if(f.el.watch){f.initSynchro4Gecko()}else{if(!e.isIE&&f.el.addEventListener){f.isWebKit=true;f.initSynchro4WebKit()}else{if(f.el.attachEvent){f.initSynchro4IE()}}}},initSynchro4IE:function(){var f=this;f.el.attachEvent("onpropertychange",function(j){var h=j.srcElement;var g=h[j.propertyName];if(j.propertyName.toLowerCase()=="disabled"){f.syncDisabled(g)}})},initSynchro4WebKit:function(){var f=this;f.el.__defineSetter__("disabled",function(g){this._disabled=f.syncDisabled(g)});f.el.__defineGetter__("disabled",function(g){return this._disabled})},initSynchro4Gecko:function(){var f=this;if(f.el.watch){f.el.watch("disabled",function(g,h,j){f.syncDisabled(j);return j})}},syncDisabled:function(f){if(this.ignoreNextDisabledSync){this.ignoreNextDisabledSync=false;return}console.log("syncDisabled",f);this.setDisabled(f);return f},setDisabled:function(f){return this[f?"disable":"enable"]()},disable:function(){if(this.trigger){this.trigger.src=this.trigger.src.replace(/\.gif$/i,"_dsb.gif")}this.picker.disable();this.disabled=true},enable:function(){if(this.trigger){this.trigger.src=this.trigger.src.replace(/_dsb\.gif$/i,".gif")}this.picker.enable();this.disabled=false}};e.Calendar=d;e.TimeSelector=a;e.DatePicker=b;e.importCss("resources/calendar.css")})();(function(){var c=window.Zving,b=c.Page;function a(j,e){var h,d,f,g;if(typeof e=="object"){f=e.clock;d=e.autoClose;g=e.theme;h=e.msg}else{h=e}this.message=h;this.autoClose=d||false;this.clock=f||9;this.theme=g||"";this.targetEl=c.getDom(j);this.$targetEl=$(this.targetEl);this.$targetEl.data("Tip",this);this.initHtml()}a.AutoCloseTips=[];a.prototype.initHtml=function(){var d=[];d.push('');d.push(' ');d.push(' ');d.push(' ");d.push(' ');d.push(' ');d.push(' ');d.push("
'+this.message+"
");d.push('
');this.html=d.join("")};a.prototype.setMessage=function(d){this.message=d;if(this.el){$(".bodycontent",this.el).html(d)}};a.prototype.show=function(){var n=this;var j;if(!this.el||!this.el.parentNode){var d=document.createElement("div");d.id="comp_tip"+(++c.idSeed._seed);d.style.position="absolute";d.style.left="0px";d.style.top="0px";var h=[document.body];j=this.targetEl.parentNode;while(j&&j.tagName){if(j.tagName=="DIV"&&j.currentStyle.position!="static"&&(j.currentStyle.overflowY=="auto"||j.currentStyle.overflow=="auto")){h.push(j)}if(j.tagName=="BODY"){break}j=j.parentNode}j=h[h.length-1];j.appendChild(d);d.className="tooltip"+(this.theme?" tip_"+this.theme:"")+" callout"+this.clock;d.innerHTML=this.html;this.el=d}else{j=this.el.parentNode}var g=$(j).offset();var e=this.$targetEl.offset();e.left=e.left-g.left+(j.tagName=='BODY'?0:j.scrollLeft);e.top=e.top-g.top+(j.tagName=='BODY'?0:j.scrollTop);var f=c.Node.getSize(this.targetEl);if(this.targetEl.getAttribute("ztype")&&/date|time/i.test(this.targetEl.getAttribute("ztype"))){var k=c.Node.getSize(this.targetEl.nextSibling);f.width+=k.width}c.Node.show(this.el);var r=c.Node.getSize(this.el);var q=$window.width();if(q-e.left-f.width<100){this.clock=3;if(e.left<50){this.clock=6}}var m=this.clock;var p,o;if(m==2||m==3||m==4){p=e.left-r.width}if(m==8||m==9||m==10){p=e.left+f.width}if(m==6||m==7||m==11||m==12){p=e.left}if(m==11||m==12||m==1){o=e.top+f.height}if(m==5||m==6||m==7){o=e.top-r.height}if(m==9||m==3){o=e.top+f.height/2-r.height/2}this.el.className="tooltip"+(this.theme?" tip_"+this.theme:"")+" callout"+this.clock;this.el.style.left=Math.round(p)+"px";this.el.style.top=Math.round(o)+"px";this.el.style.zIndex=850;if(c.isFirefox){c.Node.hide(n.el);setTimeout(function(){c.Node.show(n.el)},100)}if(this.autoClose){a.AutoCloseTips.push(this)}};a.prototype.hide=function(){if(this.el){c.Node.hide(this.el)}};a.prototype.close=function(){if(this.el){this.el.outerHTML="";this.el=null}};a.show=function(h,e){h=c.getDom(h);if(!h){return}var m,d,f,j;if(typeof e=="object"){f=e.clock;d=e.autoClose;j=e.theme;m=e.msg}else{m=e}var k=$(h);if(!c.Node.isVisible(h)){c.Console.log((h.id?"id为"+h.id:"")+(h.name?" name为"+h.name:"")+"的页面元素处于隐藏状态,Tip无法显示");return}var g;if(k.data("Tip")){g=k.data("Tip")}else{g=new a(h,m)}g.autoClose=d;if(f){g.clock=f}g.show();if(g.el.style.left=="0px"){setTimeout(function(){g.close();g.show()},200)}if(!g.autoClose){if(!h._Tips){h._Tips=[]}h._Tips.push(g)}return g};a.getTipCount=function(d){d=c.getDom(d);if(!d._Tips){return 0}return d._Tips.length};a.close=function(e){e=c.getDom(e);if(e._Tips){for(var d=0;d0;e--){d[e-1].close();d.splice(e-1,1)}};$document.on("mousedown.tip",a.closeAll);$window.on("unload",function(){$document.off("mousedown.tip")});c.Tip=a;c.importCss("resources/tip.css")})();(function(){var z=window.Zving,$V=z.Node.getValue,Tip=z.Tip,Lang=z.Lang,Verify={};Verify.autoCloseOther=function(evt,ele){if(!ele){evt=z.getEvent(evt);ele=evt.target||evt.srcElement}if(ele._verifyFor){ele=ele._verifyFor}};Verify.checkOne=function(evt,ele){if(!ele){evt=z.getEvent(evt);ele=evt.target||evt.srcElement}if(ele._verifyFor){ele=ele._verifyFor}var $ele=$(ele);var v=ele.getAttribute("verify");if(!v){Verify.closeTip(null,ele);return}var condition=ele.getAttribute("condition");if(condition&&!eval(condition)){Verify.closeTip(null,ele);return}var msg=[];var anyFlag=false;var features=v.split("&&");var value=$V(ele);if(ele.type=="radio"||ele.type=="checkbox"){if(ele.name){value=$NV(ele.name)}}if(value){value=(""+value).trim()}for(var i=0;i")>0){op=">"}else{if(rule.indexOf("<")>0){op="<"}}}else{if(rule.charAt(rule.indexOf("=")-1)==">"){op=">="}else{if(rule.charAt(rule.indexOf("=")-1)=="<"){op="<="}}}var fName=null;var fValue=null;var pattern;if(rule.indexOf(op)>0){fName=rule.substring(0,rule.indexOf(op));fValue=rule.substring(rule.indexOf(op)+op.length)}else{fName=rule}if(fName=="Any"){anyFlag=true}else{if(fName=="Regex"){fValue=rule.substring(6);if(value===null||value===""||!fValue){continue}var reg=fValue;if(!reg.startWith("^")){reg="^"+reg}if(!reg.endWith("$")){reg+="$"}if(!new RegExp(reg).test(value)){msg.push(name)}}else{if(fName=="Script"){if(!fValue){continue}if(!eval(fValue)){msg.push(name)}}else{if(fName=="NotNull"){if(value===null||value===""){if(ele.getAttribute("ztype")&&ele.getAttribute("ztype").toLowerCase()=="select"){if(ele.value.length===0){msg.push(Lang.get("Verify.MustChoose")+name)}}else{msg.push(name+Lang.get("Verify.NotNull"))}}}else{if(fName=="Number"){if(value===null||value===""){continue}if(!z.String.isNumber(value)){msg.push(name+Lang.get("Verify.MustBe")+Lang.get("Verify.Number"))}}else{if(fName=="Time"){if(value===null||value===""){continue}if(!z.String.isTime(value)){msg.push(value+Lang.get("Verify.NotRight")+Lang.get("Verify.Time"))}}else{if(fName=="Int"){if(value===null||value===""){continue}if(!z.String.isInt(value)){msg.push(name+Lang.get("Verify.MustBe")+Lang.get("Verify.Int"))}}else{if(fName=="Date"){if(value===null||value===""){continue}if(!z.String.isDate(value)){msg.push(name+Lang.get("Verify.MustBeRight")+Lang.get("Verify.Date"))}}else{if(fName=="Time"){if(value===null||value===""){continue}if(!z.String.isTime(value)){msg.push(name+Lang.get("Verify.MustBeRight")+Lang.get("Verify.Time"))}}else{if(fName=="DateTime"){if(value===null||value===""){continue}if(!z.String.isDateTime(value)){msg.push(name+Lang.get("Verify.MustBeRight")+Lang.get("Verify.DateTime"))}}else{if(fName=="Email"){if(value===null||value===""){continue}pattern=/^\w+([\-+.]\w+)*@\w+([\-.]\w+)*\.\w+([\-.]\w+)*$/;if(value&&value.match(pattern)==null){msg.push(name+Lang.get("Verify.NotRight")+Lang.get("Verify.Email"))}}else{if(fName=="ZipCode"){if(value===null||value===""){continue}pattern=/^[0-9]\d{5}(?!\d)$/;if(value&&value.match(pattern)==null){msg.push(name+Lang.get("Verify.NotRight")+Lang.get("Verify.Zip"))}}else{if(fName=="CnTel"){if(value===null||value===""){continue}pattern=/^\d{3}-\d{8}|\d{4}-\d{7}$/;if(value&&value.match(pattern)==null){msg.push(name+Lang.get("Verify.NotRight")+Lang.get("Verify.FixedTelNumber"))}}else{if(fName=="CnPhone"){if(value===null||value===""){continue}pattern1=/^\d{3,4}-\d{7,8}$/;pattern2=/^\d{11}$/;if(value&&value.match(pattern1)==null&&value.match(pattern2)==null){msg.push(name+Lang.get("Verify.NotRight")+Lang.get("Verify.TelNumber"))}}else{if(fName=="CnMobile"){if(value===null||value===""){continue}pattern=/^\d{11}$/;if(value&&value.match(pattern)==null){msg.push(name+Lang.get("Verify.NotRight")+Lang.get("Verify.MobileNumber"))}}else{if(fName=="IDCardNo"){if(value===null||value===""){continue}if(!Verify.isIDCardNo(value)){msg.push(name+Lang.get("Verify.NotRight")+Lang.get("Verify.IDNumber"))}}else{if(fName=="Length"){if(value===null||value===""){continue}if(isNaN(fValue)){msg.push(Lang.get("Verify.RuleError")+Lang.get("Verify.BackOfLength")+Lang.get("Verify.Number"))}else{try{var len=parseInt(fValue,10);if(op=="="&&value.length!=len){msg.push(name+Lang.get("Verify.Length")+Lang.get("Verify.MustBe")+len+Lang.get("Verify.char"))}else{if(op==">"&&value.length<=len){msg.push(name+Lang.get("Verify.Length")+Lang.get("Verify.MustGreaterThan")+len+Lang.get("Verify.char"))}else{if(op==">="&&value.length=len){msg.push(name+Lang.get("Verify.Length")+Lang.get("Verify.MustLessThan")+len+Lang.get("Verify.char"))}else{if(op=="<="&&value.length>len){msg.push(name+Lang.get("Verify.Length")+Lang.get("Verify.MustEqualOrLessThan")+len+Lang.get("Verify.char"))}}}}}}catch(ex){msg.push(Lang.get("Verify.RuleError")+Lang.get("Verify.BackOfLength")+Lang.get("Verify.Int")+ex.message)}}}}}}}}}}}}}}}}}}}}if(!anyFlag&&ele.getAttribute("ztype")&&ele.getAttribute("ztype").toLowerCase()=="select"&&ele.parentNode.input){if(!ele.parentNode.getAttribute("listURL")&&!z.Selector.verifyInput(ele)){msg.push(Lang.get("Verify.InputValue")+Lang.get("Verify.NotAnOption"))}}if(msg.length>0){var txt=msg.join("
");Verify.closeTip(null,ele);var tip;ele._VerifyMsg=txt;ele._VerifyHasErr=true;if(z.Node.isVisible(ele)){if(!$ele.data("Tip")){var afterEle=$(ele).data("showTipAfter");if(afterEle){tip=new z.Tip(z.getDom(afterEle),{msg:txt,theme:"notice"})}else{tip=new z.Tip(ele,{msg:txt,theme:"notice"})}tip.AutoClose=true;$ele.data("Tip",tip)}$ele.data("Tip").setMessage(txt);$ele.data("Tip").show()}else{var $page=$(ele).closest("div.ui-page");var $tabs=$("a.z-tab");var pageurl=$page.attr("data-url");if($page.length&&$tabs.length&&pageurl){$tabs.each(function(){if(this.getAttribute("data-href")){var a=this,$a=$(a);if(pageurl.indexOf(a.getAttribute("data-href").replace(/^(\.\.\/)+/,""))!=-1){if(!$a.data("Tip")){var tip=new z.Tip(a,{msg:Lang.get("Verify.TabPageHasError"),theme:"notice"});tip.AutoClose=true;tip.Clock=9;$a.data("Tip",tip)}setTimeout(function(){$a.data("Tip").setMessage(txt);$a.data("Tip").show()},200);return}}})}if(!$tabs.length){MsgPop(Lang.get("Verify.HiddenElemHasError"))}}}else{if((ele.type=="radio"||ele.type=="checkbox")&&ele.name){$N(ele.name).each(function(el){Verify.closeTip(null,el)})}else{Verify.closeTip(null,ele)}}};Verify.closeTip=function(evt,ele){if(!ele){evt=z.getEvent(evt);ele=evt.target||evt.srcElement}if(ele.type=="blur"){ele=ele.target||ele.srcElement}if(ele._verifyFor){ele=ele._verifyFor}if($(ele).data("Tip")){$(ele).data("Tip").hide();ele._VerifyMsg=null;ele._VerifyHasErr=null}};Verify.hasError=function(noCheckSelector,ele,nodDialog){var $inputs;ele=z.getDom(ele||document.body);$inputs=$("input,textarea",ele);if(noCheckSelector){if(typeof noCheckSelector!="string"){z.Console.error("传入Verify.hasError的第一个参数应该为一个元素选择器字符串");return}$inputs=$inputs.not(noCheckSelector);$(noCheckSelector).each(function(){Verify.closeTip(null,this)})}var firstEle=false;for(var i=0;i<$inputs.length;i++){var el=$inputs[i];Verify.checkOne(null,el);if(!firstEle&&el._VerifyHasErr){firstEle=el}}console.log(firstEle);if(firstEle){if(nodDialog===true){try{firstEle.focus()}catch(e){}}else{Dialog.alert(Lang.get("Verify.HasError"),function(){try{firstEle.focus()}catch(e){}})}return true}return false};Verify.check=function(ele){return Verify.hasError(null,ele,true)};Verify._cache={};Verify.initCtrl=function(elem){ele=z.getDom(typeof elem=="string"?elem:elem.id||elem);var v=ele.getAttribute("verify");if(v){var ztype=ele.getAttribute("ztype");if(ztype){ztype=ztype.toLowerCase()}var eventTarget;if(ztype&&ztype=="select"){eventTarget=ele.nextSibling;eventTarget._verifyFor=ele}else{eventTarget=ele}eventTarget.attachEvent("onfocus",Verify.checkOne);eventTarget.attachEvent("onfocus",Verify.autoCloseOther);ele.attachEvent("onkeyup",Verify.checkOne);ele.attachEvent("onchange",Verify.checkOne);eventTarget.attachEvent("onblur",Verify.closeTip);if(!z.isIE){ele.addEventListener("input",Verify.checkOne,false)}var condition=ele.getAttribute("condition");if(v.indexOf("NotNull")>=0){var ztype=ele.getAttribute("ztype");if(ztype){ztype=ztype.toLowerCase()}if(ztype=="select"){ele=$(ele).closest("div")[0]}if(/^date|time$/i.test(ztype)){ele=z.getDom(ele.id).nextSibling}if(ele.type=="radio"||ele.type=="checkbox"){if(ele.name){var sameNameEls=z.$N(ele.name);ele=sameNameEls[sameNameEls.length-1];sameNameEls.each(function(el){$(el).data("showTipAfter",ele)})}return}if(ele.getAttribute("showtipafter")){$(ele).data("showTipAfter",$(ele.getAttribute("showtipafter"))[0])}if(!ele.nextSibling||!ele.nextSibling.getAttribute||ele.nextSibling.getAttribute("ztype")!="Verify"){var display="";if(!z.Node.isVisible(ele)&&z.Node.isVisible(ele.parentNode)){display="display:none"}ele.insertAdjacentHTML("afterEnd","*")}}}};Verify.getBirthDateFromIDCardNo=function(id){if(id==null){return null}if(id.length==15){return"19"+id.substring(6,8)+"-"+id.substring(8,10)+"-"+id.substring(10,12)}if(id.length==18){return id.substring(6,10)+"-"+id.substring(10,12)+"-"+id.substring(12,14)}return null};Verify.getGenderFromIDCardNo=function(id){if(id==null){return null}if(id.length==15){return"13579".indexOf(id.substring(14,15))!=-1?"M":"F"}if(id.length==18){return"13579".indexOf(id.substring(16,17))!=-1?"M":"F"}return null};Verify.isIDCardNo=function(id){if(!id){return false}id=id.toLowerCase();if(id.length!=15&&id.length!=18){return false}var y,m,d;if(id.length==15){y=parseInt("19"+id.substring(6,8),10);m=parseInt(id.substring(8,10),10);d=parseInt(id.substring(10,12),10)}else{if(id.length==18){if(id.indexOf("x")>=0&&id.indexOf("x")!=17){return false}var verifyBit;var sum=id.charAt(0)*7+id.charAt(1)*9+id.charAt(2)*10+id.charAt(3)*5+id.charAt(4)*8+id.charAt(5)*4+id.charAt(6)*2+id.charAt(7)*1+id.charAt(8)*6+id.charAt(9)*3+id.charAt(10)*7+id.charAt(11)*9+id.charAt(12)*10+id.charAt(13)*5+id.charAt(14)*8+id.charAt(15)*4+id.charAt(16)*2;sum=sum%11;switch(sum){case 0:verifyBit="1";break;case 1:verifyBit="0";break;case 2:verifyBit="X";break;case 3:verifyBit="9";break;case 4:verifyBit="8";break;case 5:verifyBit="7";break;case 6:verifyBit="6";break;case 7:verifyBit="5";break;case 8:verifyBit="4";break;case 9:verifyBit="3";break;case 10:verifyBit="2";break}if(id.charAt(17)!=verifyBit){return false}y=parseInt(id.substring(6,10),10);m=parseInt(id.substring(10,12),10);d=parseInt(id.substring(12,14),10)}}var currentY=new Date().getYear();if(z.isGecko){currentY+=1900}if(!y||y>currentY||y<1870){return false}if(!m||m<1||m>12){return false}if(!d||d<1||d>31){return false}return true};z.Verify=Verify})();(function(){var m=window.Zving,f=m.getDom,k=m.Node,j=m.Server,c=m.Constant,h=m.Lang,n=m.CONTEXTPATH,e=m.Misc,d;d=function(g){this.defaultConfig={_rows:[]};if(!(this instanceof d)){return m.ComponentManager.get(m.getDom(g).compId)}this.params={};d.superclass.constructor.apply(this,arguments)};d.BackendMethod="com.zving.framework.ui.control.DataListUI.doWork";m.Class.extend(d,m.UICompBase,{ctype:"DataList",cls:"z-datalist",outerElAttrs:"ul",renderTpl:"
  • {content}
  • ",initComponent:function(){var g=this;m.Statable(this);this.addEvents("beforeupdate","update","insertRow","removerow");d.superclass.initComponent.apply(this);if(this.el){this.initDom()}},htmlParser:function(p){var o=this;var g=f(p);this.setParemFormEl(g);return{el:g}},setParam:function(p,o,g){this.params[p]=o;if(g!==undefined){this[p]=g}},getParam:function(g){return this.params[g]},setParemFormEl:function(g){if(g.getAttribute("method")){this.setParam(c.Method,g.getAttribute("method"))}if(g.getAttribute("size")){this.setParam(c.Size,Number(g.getAttribute("size")))}if(g.getAttribute("sortend")){this.sortable=true}if(g.getAttribute("dragclass")){this.$dragHandle=g.getAttribute("dragclass")}if(g.getAttribute("autopagesize")=="true"){this.autoPageSize=true}if(g.getAttribute("autofill")=="true"){this.setParam(c.AutoFill,"true")}if(g.getAttribute("page")=="true"){this.setParam(c.Page,"true")}},initDom:function(){var o=this;var g=o.el;var p=g.id;o.dom={};o.initEvents();o.initPagebar();if(this.autoPageSize){m.Page.onLayout(function(){if(!o.el.parentNode||o.el.parentNode.clientWidth==0){return}o.computePageSize();o.resumePagebar()})}o.sortableInit()},initEvents:function(){},restore:function(){},gotoPage:function(g){var o=this;o.setParam(c.PageIndex,g);o.loadData()},previousPage:function(){this.gotoPage(this.getParam(c.PageIndex)-1)},nextPage:function(){this.gotoPage(this.getParam(c.PageIndex)+1)},firstPage:function(){this.gotoPage(0)},lastPage:function(){var q=this;var p=q.getParam(c.PageTotal);var o=q.getParam(c.Size);var g=Math.ceil(Number(p)/Number(o));this.gotoPage(g-1)},clear:function(){var g=this.getListNodes();g.length&&g.remove()},getTotalCount:function(){return this.getParam(c.Total)},getTotalPage:function(){var o=this;var g=o.getParam(c.Size);return m.isNumber(g)?Math.ceil(o.getTotalCount()/g):o.getParam(c.PageIndex)},getCurrentPage:function(){return this.getParam(c.PageIndex)},initPagebar:function(){var o=this.el;var s=o.id;var g=m.getDom("_PageBar_"+s);if(g){var p=$(g);var q=p.find(".pageSizeGroup");if(q.length){var r=q.find("ul");q.hover(function(){r.show()},function(){r.hide()})}}},resumePagebar:function(){var F=this;var p=F.el;if(!p){console.log(location.pathname);console.log(F.id,F.el);return}var z=p.id;var q=f("_PageBar_"+z);if(!q){return}var r=$(q);var w=r.find(".pagebar");var x=Number(F.getParam(c.PageIndex));var s=Number(F.getParam(c.PageTotal));var D=Number(F.getParam(c.Size));var C=Math.floor(s/D);if(s%D===0){C--}var o=r.find(".first")[0];var E=r.find(".previous")[0];var A=r.find(".next")[0];var B=r.find(".last")[0];r.find(".js_total").html(s);r.find(".js_pageSize").html(Math.min(s,D));r.find(".js_totalPages").html(1+C);r.find(".js_pageIndex").html(1+x);var y=r.find("input.gotopage");if(y.length){y.val(1+x).width(Math.max(String(1+x).length*7+1,15))}if(r.attr("pagebartype")!="2"){var u=r.find(".tfoot-fl");if(u.length){var t=u.find(".pageInfo");var g=u.find(".pageInfo_trigger");if(!t[0]._inited){if(t[0].offsetWidth+w[0].offsetWidth>u[0].parentNode.clientWidth){t.show();t[0]._width=t[0].clientWidth;t.hide();u.hoverIntent(function(){t.show().width(1).animate({width:t[0]._width},function(){g.hide()})},function(){t.animate({width:1},function(){t.hide();g.show()})});t[0]._inited=true;g.show()}}}}o._innerHTML_bak=o._innerHTML_bak||o.innerHTML;E._innerHTML_bak=E._innerHTML_bak||E.innerHTML;A._innerHTML_bak=A._innerHTML_bak||A.innerHTML;B._innerHTML_bak=B._innerHTML_bak||B.innerHTML;if(!/^<.*>$/.test(o._innerHTML_bak)){o._innerHTML_bak="'+h.get("DataList.FirstPage")+"";E._innerHTML_bak="'+h.get("DataList.PrevPage")+""}if(!/^<.*>$/.test(B._innerHTML_bak)){A._innerHTML_bak="'+h.get("DataList.NextPage")+"";B._innerHTML_bak="'+h.get("DataList.LastPage")+""}if(x<=0){o.innerHTML=o.innerText;E.innerHTML=E.innerText}else{if(o.innerHTML.trim()==o.innerText.trim()){o.innerHTML=o._innerHTML_bak;E.innerHTML=E._innerHTML_bak}}if(x>=C){A.innerHTML=A.innerText;B.innerHTML=B.innerText}else{if(A.innerHTML.trim()==A.innerText.trim()){A.innerHTML=A._innerHTML_bak;B.innerHTML=B._innerHTML_bak}}},computePageSize:function(){var p=this.el;if(!p||!p.parentNode){p=null;return}var o=p.id;if(p.getAttribute("autopagesize")=="false"){return false}var s,z,C,B,y,w;y=this.getListNodes();if(!y.length){return}s=y.length;w=y[0];if(/^(th|td|tr|tb|tf)/i.test(w.nodeName)){B=k.getParent(w,"table");C=true}else{B=w.parentNode}z=B.parentNode;var r=B.offsetHeight;var q=z.clientHeight;var g=r/s;var D;D=Math.floor(q/g);var t=this.getParam(c.Size);var x=this.getParam(c.PageTotal);var A=Math.min(t,x);var u;if(/^(block|table|list)/.test($(w).css("display"))&&$(w).css("float")=="none"){u=s;if(u<=D){this.setParam(c.Size,D);return}while(u>D){if(C){B.deleteRow(u-1);u=B.rows.length}else{m.Dom.removeNode(B.children[u-1]);u=B.children.length}A--}this.setParam(c.Size,A)}},sortableInit:function(){var o=this.el;if(this.sortable){var g=window["eval"](o.getAttribute("sortend"));var q=this.$dragHandle;var p=o.getAttribute("listNodes");if(!p){p=this.getListNodes()}if(p.length){this._sortable(q,p,g)}}},getListNodes:function(){var p=this.el;var o=$(p),g,q,r;if(o.attr("listnodes")){o.data("listNodes",$(o.attr("listnodes")))}else{if(!p.nextSibling||m.isIE&&p.parentNode.nodeType==1&&!p.parentNode.nodeName){g=m.Node.nextElement(p.parentNode)}else{if(p.nextSibling.nodeType==8&&p.nextSibling.nodeValue.startsWith("_ZVING_DATALIST_END")){return[]}g=m.Node.nextElement(p)}if(g){if(/^(th|td|tr|tb|tf)/i.test(g.nodeName)){r=m.Node.getParent(g,"table");q=r.rows}else{r=g.parentNode;q=r.children}}o.data("listNodes",$(q))}return o.data("listNodes")},getRowIndex:function(p){var o=this.getListNodes();var g=$(o).index(p);return g},getListContainer:function(){var o=this.el;var g=$(o),p,r,q;if(!g.data("listContainer")){if(g.attr("listcontainer")){g.data("listContainer",$(g.attr("listcontainer")))}else{p=this.getListNodes();if(p.length){listNodes_firstNode=p[0];r=listNodes_firstNode.parentNode}else{r=o.parentNode}g.data("listContainer",r)}}return g.data("listContainer")},_sortable:function(t,r,g){var p=this;var o=p.el;var s=p.getListContainer(o);var q={};if(t){q.handle=t}if(r){q.items=r}if(g){q.start=function(u,w){w.item.data("originalIndex",p.getRowIndex(w.item))};q.stop=function(){g.apply(this,Array.prototype.slice.call(arguments).concat(o))}}q.helper=function(u,x){var w=x[0].outerHTML;w=w.replace(/^(<\w+)([^>]*)>/igm,'$1 style="background-color:#ffe; border: 1px solid #ddd">').replace(/ id=[^ >]/igm,"");return w};q.axis="y";$(s).sortable(q)},showLoading:function(){var s=this;var g=s.el;var q=s.getListContainer();var t=f("#_LoadingBGDiv");var y=f("#_LoadingIconDiv");if(!t){t=document.createElement("div");t.id="_LoadingBGDiv";k.hide(t);t.style.cssText="background-color:#FCFCFC;position:absolute;z-index:800;opacity:0.2;filter:alpha(opacity=20);";document.body.appendChild(t);t=$(t);y=document.createElement("div");y.id="_LoadingIconDiv";k.hide(y);y.innerHTML=" 页面正在加载中,请稍候......";y.style.cssText="padding-top:5px;background-color:#ffc;position:absolute;z-index:801;height:20px;";document.body.appendChild(y)}var r=$(t);var p=$(y);if(/^(tbody)/i.test(q.nodeName)){q=q.parentNode}if(!k.isVisible(q)){return}var u=$(q).offset();var x=q.offsetWidth,o=q.offsetHeight;if(u.top||u.left){r.css({top:u.top+"px",left:u.left+"px",width:x+"px",height:o+"px"});p.css({top:u.top+(m.isIE?2:0)+"px",left:u.left+(m.isIE?2:0)+"px"});r.show();p.show()}},hideLoading:function(){$("#_LoadingBGDiv").hide();$("#_LoadingIconDiv").hide()},changePageSize:function(g){this.setParam(c.Size,g);this.loadData()},loadData:function(q,g){var p=this;var o=p.el;var r=o.id;if(p.isDataLoading){return}p.isDataLoading=true;if(!g){g={}}else{if(g instanceof m.DataCollection){g=m.extra({},g.map)}}m.extra(g,p.params);p.showLoading();(function(){var a=m.getDom(p.id+'_AllCheck');if(a&&a.checked){a.checked=false;}}());m.Server.sendRequest(d.BackendMethod,g,function(t){if(t._ZVING_STATUS===0&&t._ZVING_MESSAGE){Dialog.alert(t._ZVING_MESSAGE);return}var u=t.HTML;if(!u||u.length<10){m.Console.error("用于渲染数据列表的数据错误:",t);p.isDataLoading=false;return}if(m.isIE){var A=p.getListContainer();if($(A).data("sortable")){$(A).sortable("destroy")}}var z=o.parentNode;while(z){if(z.tagName&&z.tagName!=="TR"&&z.tagName!=="TABLE"&&z.tagName!=="TBODY"){var x=z.innerHTML;var y=x.indexOf("");var w=x.indexOf("");w=x.indexOf("-->",w)+3;x=x.substring(0,y)+u+x.substring(w);$(z).empty();z.innerHTML=x;break}z=z.parentNode}o=null;p.el=o=f(r);o.compId=p.id;z=o.parentNode;while(z){if(z.tagName){break}z=z.parentNode}m.ComponentManager.initChildren(z);p.isDataLoading=false;var s=z.getElementsByTagName("script");for(i=0;ij+c){k=j-m-b;f=true}if((g+e)>d+o){g=d-e-b;f=true}if(k=p){g=p-e-5}}q=[k,g];this.storeXY(q);a.Node.setPosition(this.el,q)}}return this},alignTo:function(c,g,e){var d=this;var f=a.Node.anchorPos(this.el,c,g||this.defaultAlign,this.reAlign,this.defaultOffsets,true);if(this.ownerWindow!=window){var b=a.Dom.getFrameOffset();f.x+=b.left;f.y+=b.top}a.Node.setPosition(this.el,f)},setSize:function(c,b){this.width=(c!==undefined)?c:this.width;this.height=(b!==undefined)?b:this.height;a.Node.setSize(this.el,c,b);this.width=c;this.height=b},show:function(){this.hidden=false;if(this.el.currentStyle.display=="none"){this.el.style.display="block"}if(this.el.currentStyle.visibility=="hidden"){this.el.style.visibility=""}},hide:function(){this.hidden=true;if(this.el.currentStyle.display!="none"){this.el.style.display="none"}},isVisible:function(){return a.Node.isVisible(this.el)},storeXY:function(b){delete this.lastLT;this.lastXY=b}}})();(function(){var z=window.Zving,Uploader;Uploader=function(config){if(!(this instanceof Uploader)){return z.ComponentManager.get(z.getDom(config).compId)}if(typeof config=="string"){this.id=config;var el=document[config];if(!el){z.Console.error("不存在id为 "+config+" 的uploader控件,请核对id!");return}if(!z.isIE&&el.tagName=="OBJECT"){var embed=el.getElementsByTagName("EMBED")[0];if(embed){el=embed}}this.ele=el}else{if(!config||typeof config=="object"){z.extra(this,config,{ctype:"Uploader",id:"comp_uploader"+(++z.idSeed._seed),width:250,height:25,allowType:"gif,jpg,png,bmp,psd,ai,jpeg,tif,tiff,avi,mpg,flv,mpeg,rm,rmvb,mov,wmv,wmp,mp4,mp3,wma,wav,zip,rar,tar,gz,z,iso,cab,jar,doc,docx,xls,xlsx,ppt,pptx,pdf,fla,swf,js,css,shtml,html,htm,txt"});if(config&&config.sessionId){_ZUploaderSessionID=config.sessionId}else{_ZUploaderSessionID=z.Cookie.get(idName)}if(this.renderTo){this.render(this.renderTo);delete this.renderTo}}}};Uploader.BackendMethod_Sumbit="com.zving.framework.ui.control.UploadUI.submit";Uploader.BackendMethod_GetTaskStatus="com.zving.framework.ui.control.UploadUI.getTaskStatus";Uploader.swfPath=z.JSLIBPATH+"components/ZUploader2.swf";Uploader.prototype={getString:function(){var flashVars="";if(this.allowType){flashVars+="fileType="+this.allowType}if(this.fileCount){flashVars+="&fileCount="+this.fileCount}if(this.fileMaxSize){flashVars+="&fileMaxSize="+this.fileMaxSize}if(this.barColor){flashVars+="&barColor="+this.barColor}var html=' ';return html},render:function(container){container=z.getDom(container);$(container).append(this.getString());this.ele=document[this.id];Zving.Uploader.checkVersion();return this},sendRequest:function(method,dc,func,id,noSession,resultDataFormat){if(!Uploader.CallbackList){Uploader.CallbackList={}}Uploader.CallbackList[this.id]=func;if(this.hasFile()){if(dc&&typeof(dc)=="object"&&dc.map){this.ele.addPostParam(dc.toQueryString())}else{if(dc&&typeof(dc)=="object"&&!dc.map){this.ele.addPostParam($.param(dc))}}this.ele.setMethod(method);this.ele.doUpload()}else{if(dc&&typeof(dc)=="object"&&dc.map){dc.add("_ZVING_METHOD",method)}else{if(dc&&typeof(dc)=="object"&&!dc.map){dc._ZVING_METHOD=method}}z.Server.sendRequest(Uploader.BackendMethod_Sumbit,dc,function(response){if(func){try{func(response)}catch(ex){z.Console.error(location.pathname+" Uploader.onRequestComplete:"+ex.message+"\t"+ex.lineNumber)}}},id,noSession,resultDataFormat)}},hasFile:function(){return this.ele.hasFile()},hasError:function(){return this.ele.hasError()},getFileNames:function(){return this.ele.getFileNames()},setFileNames:function(arr){return this.ele.setFileNames(arr)},onFileSelect:function(func){this.ele._OnFileSelect=func}};Uploader.onRequestComplete=function(id,xml){if(!Uploader.CallbackList){return}var func=Uploader.CallbackList[id];if(!func){return}var dc=new z.DataCollection();dc.parseXML(z.toXMLDOM(xml));dc.Status=dc.get("_ZVING_STATUS");dc.Message=dc.get("_ZVING_MESSAGE");if(dc.get("_ZVING_SCRIPT")){eval(dc.get("_ZVING_SCRIPT"))}dc=dc.map;if(dc._ZVING_STATUS!==undefined){dc.Status=dc._ZVING_STATUS}if(dc._ZVING_MESSAGE!==undefined){dc.Message=dc._ZVING_MESSAGE}if(func){func(dc)}};Uploader.getTaskStatus=function(taskID,id){var dc=new z.DataCollection();dc.add("TaskID",taskID);z.Server.sendRequest(Uploader.BackendMethod_GetTaskStatus,dc,function(response){if(document[id]){document[id].setStatusStr(response.get("Status"))}})};Uploader.resize=function(id,fileCount){var h=24;if(fileCount>1){fileCount=fileCount>10?10:fileCount;h=28+24*fileCount}document[id].height=h};Uploader.afterFileSelect=function(id,fileNames){var func=document[id]._OnFileSelect;if(func){func(""+fileNames)}};Uploader.getAction=function(){return z.Server.ContextPath+"ZUploader.zhtml"};Uploader.getSessionID=function(){return _ZUploaderSessionID||z.Cookie.get(idName)};Uploader.checkVersion=function(){var _FlashVersionOK=false;var _FlashVersion=(function(){var f="",n=navigator,ii;if(n.plugins&&n.plugins.length){for(ii=0;ii=2;ii--){try{var fl=eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash."+ii+"');");if(fl){f=ii+".0";break}}catch(e){}}}}return f})();if(_FlashVersion){_FlashVersion=_FlashVersion.substr(0,_FlashVersion.indexOf("."));if(_FlashVersion>=10){_FlashVersionOK=true}}if(!_FlashVersionOK){var alertNoFlashPlugin=Lang.get("Uploader.NoFlashPlugin");document.write(alertNoFlashPlugin)}};var MultiUploader=function(){this.Uploaders=[]};MultiUploader.prototype.addUploader=function(uploader){if(typeof uploader=="string"){uploader=new Uploader(uploader)}this.Uploaders.push(uploader)};MultiUploader.prototype.hasError=function(uploader){for(var i=0;i';a.itemTpl='?';function b(m){for(var g=0;g0){if(m.selectedIndex==-1||m.selectedIndex>m.data.length){this.el.selectedIndex=this.el._selectedIndex=this.selectedIndex=0}g.value=g._value=m.value=m.data[m.selectedIndex][0];m.text=m.dom.textField.value=m.data[m.selectedIndex][1]}}}if(m.autoWidth){m.contractWidth()}if(m.disabled){m.disable()}m.initEvents()},initEvents:function(){var g=this;g.dom.$textField.on("selectstart mousedown contextmenu",function(m){if(!g.editable){m.preventDefault()}});g.dom.$textField.on("focus",function(m){if(!g.disabled){g.onFocus();g.expand()}if(!g.editable){m.preventDefault()}});g.dom.$textField.on("blur",function(m){if(!g.disabled){g.onBlur()}});g.dom.$textField.on("keydown",function(m){if(!g.disabled){g.textField_onKeyDown(m)}});g.dom.$textField.on("keyup",function(m){if(!g.disabled){g.textField_onKeyUp(m)}});g.dom.$textField.on("click",function(m){if(!g.disabled){this.focus();g.textField_onClick(m)}});$(g.dom.arrow).on("click",function(m){g.onTriggerClick(m)});if(g.editable){g.dom.textField.readOnly=false}else{g.dom.textField.readOnly=true}if(g.disabled){g.dom.textField.tabIndex=-1}else{g.dom.textField.tabIndex=undefined}if(g.el.watch){g.initSynchro4Gecko()}else{if(!j.isIE&&g.el.addEventListener){g.isWebKit=true;g.initSynchro4WebKit()}else{if(g.el.attachEvent){g.initSynchro4IE()}}}},initSynchro4IE:function(){var g=this;g.el.attachEvent("onpropertychange",function(o){var n=o.srcElement;var m=n[o.propertyName];switch(o.propertyName.toLowerCase()){case"disabled":g.syncDisabled(m);break;case"selectedindex":g.syncSelectedIndex(m);break;case"value":g.syncValue(m);break}})},initSynchro4WebKit:function(){var g=this;g.el.__defineSetter__("disabled",function(m){this._disabled=g.syncDisabled(m)});g.el.__defineGetter__("disabled",function(m){return this._disabled});g.el.__defineSetter__("selectedIndex",function(m){this._selectedIndex=g.syncSelectedIndex(m)});g.el.__defineGetter__("selectedIndex",function(m){return this._selectedIndex});g.el.__defineSetter__("value",function(m){this._value=g.syncValue(m)});g.el.__defineGetter__("value",function(m){return this._value})},initSynchro4Gecko:function(){var g=this;if(g.el.watch){g.el.watch("disabled",function(m,n,o){g.syncDisabled(o);return o});g.el.watch("selectedIndex",function(m,n,o){g.syncSelectedIndex(o);return o});g.el.watch("value",function(m,n,o){g.syncValue(o);return o})}},setInput:function(g){this.editable=g;if(!g){me.dom.textField.style.MozUserSelect="none";this.removeClass("z-combox-editable")}else{me.dom.textField.style.MozUserSelect="";this.addClass("z-combox-editable")}},initList:function(){var m=this;if(m.list){return}m.list=new j.Layer({id:j.pageId+"_"+m.id+"_list",cls:"z-menu",shadow:m.shadow,parentEl:j.rootDoc.body,zIndex:m.zIndex});var p=m.listWidth||Math.max(m.dom.textField.offsetWidth,m.minListWidth);m.list.setSize(p);var o=m.list.el;o.style.left="-999px";o.style.top="-999px";if(m.syncFont!==false){o.style.fontSize=$(m.getInput()).css("font-size")}if(m.url){o.innerHTML=m.getListString();var n=m.dom.iframe=o.getElementsByTagName("IFRAME")[0];var g=function(){var q=j.rootWin.$(".z_loading",o);if(q.length){q.hide()}if(m.onLoad){m.onLoad.call(m,n.contentWindow);m.onLoad=null}m.innerWin=n.contentWindow;n.contentWindow.ownerCombox=m;n.contentWindow.comboxOpener=window;n.contentWindow.SelectedText=m.text=m.dom.textField.value;n.contentWindow.SelectedValue=m.value=m.el.value;n.contentWindow.SelectorID=m.id;if(m._ScrollTop){n.contentWindow.document.body.scrollTop=m._ScrollTop}m.resetListSize()};if(!j.isGecko){j.rootWin.$(n).on("load.select",function(){g()})}else{n.onload=function(){g()}}}else{o.innerHTML=m.getListString();m.el.options=o.getElementsByTagName("A");m.el.length=m.el.options.length;b(m.el.options);j.rootWin.$(this.list.el).on("click","a",function(q){m.onItemClick(q)})}},resetListSize:function(){},updateList:function(g){if(!this.list){this.initList()}g=g||this.data;this.list.el.innerHTML=this.getListString(g)},resumeList:function(){var g=this;if(!g.url){g.el.options=this.list.el.getElementsByTagName("A");g.el.length=g.el.options.length;b(g.el.options)}},getListString:function(o){var n=this;if(n.url){return'
    loading..
    '}o=o||this.data;var g=[];g.push('
    ');for(var m=0;m");return g.join("")},textField_onKeyDown:function(m){var n=this,g=n.dom.textField;var o=m.keyCode;var p=false;n.pressingCount=0;if(o==35||o==36){if(!g.value){m.preventDefault();return}}if(o===27||o==9){n.collapse()}else{if(o>32&&o<41){if(o===40||o===38){if(n.pressingCount++===0){p=true;if(o===40){if(n.innerWin&&n.innerWin.nextItem){n.innerWin.nextItem()}else{n.selectNext()}}else{if(n.innerWin&&n.innerWin.previousItem){n.innerWin.previousItem()}else{n.selectPrev()}}}else{if(n.pressingCount==3){n.pressingCount=0}}m.preventDefault()}}else{if(o===13){g.blur();n.collapse()}else{m.preventDefault();p=false}}}if(j.isChrome){if(n._keyTimer){clearTimeout(n._keyTimer)}n._keyTimer=setTimeout(function(){n._keyTimer=undefined},500)}},textField_onKeyUp:function(g){var m=this;if(!m.editable){this.pressingCount=0}else{if(!m.url){if(g.keyCode===13){m.list.$el.find("a").eq(0).click()}else{m.updateList(m.filterData(m.dom.textField.value,m.data))}m.list.show()}else{this.ignoreNextValueSync=true;m.el.value=m.value=m.dom.textField.value}}},getInput:function(){return f(this.id+"_textField")},getArrow:function(){return f(this.id+("_arrow"))},onItemClick:function(m){var p=this;var g=m.currentTarget;var n=g.getAttribute("value"),o=g.innerText;$(m.currentTarget).addClass("selected").siblings().removeClass("selected");p.setValue(n,o);if(p.fireEvent("onitemclick",this,n)!==false){this.collapse()}m.preventDefault()},loadData:function(n,g){var m=this;if(!g){g={}}else{if(g instanceof j.DataCollection){g=j.extra({},g.map)}}j.extra(g,m.params);Server.sendRequest(a.BackendMethod,g,function(p){var o=p.DataTable;m.clear();if(o){var x=o.Values;var s=x.length;var q=[];if(m.el.getAttribute("defaultblank")!="false"){q.push(["",""])}var t="true"==m.el.getAttribute("showvalue");for(var r=0;r=this.data.length){j.Console.error("can't remove the item that index="+g+"!");return}this.data.splice(g,1);if(this.selectedIndex>g){this.selectedIndex=this.el.selectedIndex=this.selectedIndex-1}this.updateList();this.resumeList()},add:function(g,n,m){if(j.isArray(g)){n=g[1]||n;g=g[0]}this.addBatch([g,n],m)},addBatch:function(g,m){m=m===undefined?this.data.length:m;this.data.splice(m,0,g);if(this.selectedIndex>m){this.selectedIndex=this.el.selectedIndex=this.selectedIndex+g.length}this.updateList();this.resumeList()},setValue:function(g,n,m){var o=this;if(g==o.value&&n==o.text){return}if(!o.list){o.initList()}if(j.isArray(g)){n=g[1]||n;g=g[0]}o.ignoreNextValueSync=false;o.syncValue(g,n);o.ignoreNextValueSync=true;o.startValue=o.value;o.el.value=o.value=g;if(!m&&o.startValue!=o.value){o.evalOnChange()}o._selectUI()},syncValue:function(m,n){if(this.ignoreNextValueSync){this.ignoreNextValueSync=false;return m}if(n===undefined){n=this.findTextByValue(m)}this.ignoreNextSelectedIndexSync=true;var g=this.selectedIndex=this.findIndexByValue(m);this.el.selectedIndex=g;if(!this.url){if(g==-1){m="";n=""}this.setText(n)}return m},evalOnChange:function(g){g=g||this.el;var m=g.onchange;if(typeof m=="function"){setTimeout(function(){m.call(g)},1)}},setText:function(g){this.text=this.dom.textField.value=g},syncSelectedIndex:function(m){var o=this;if(o.ignoreNextSelectedIndexSync){o.ignoreNextSelectedIndexSync=false;return m}if(!j.isNumber(m)){m=parseInt(m,10)}if(isNaN(m)){m=-1}var g,n;if(m==-1||m>o.data.length){g="";n=""}else{g=o.findValueByIndex(m);n=o.findTextByIndex(m)}o.selectedIndex=m;o.ignoreNextValueSync=true;o.el.value=o.value=g;o.setText(n);return m},setSelectedIndex:function(n,m){if(n==this.selectedIndex){return}this.ignoreNextSelectedIndexSync=false;this.syncSelectedIndex(n);this.ignoreNextSelectedIndexSync=true;this.startSelectedIndex=this.selectedIndex;var g=this.selectedIndex=n;this.el.selectedIndex=g;if(!m&&this.startSelectedIndex!=this.selectedIndex){this.evalOnChange()}this._selectUI()},setSelectedIndexEx:function(g){this.ignoreNextSelectedIndexSync=true;this.el.selectedIndex=this.selectedIndex=g},setValueEx:function(g,m){var n=this;this.ignoreNextValueSync=true;n.el.value=n.value=g;setTimeout(function(){n.text=n.dom.textField.value=m;n.contractWidth()},1)},setUrl:function(g){this.url=g;this.el.setAttribute("listurl",g)},syncDisabled:function(g){if(this.ignoreNextDisabledSync){this.ignoreNextDisabledSync=false;return}this.setDisabled(g);return g},disable:function(){h.addClass(this.dom.outer,this.disabledClass);this.dom.textField.tabIndex=-1;this.disabled=true},enable:function(){h.removeClass(this.dom.outer,this.disabledClass);this.dom.textField.disabled=false;this.dom.textField.tabIndex=undefined;this.disabled=false},findTextByValue:function(g){g=String(g);var n=this.data;for(var m=0;m-1&&g-1&&gthis.maxListHeight){this.list.el.style.height=this.maxListHeight}else{if(this.list.el.style.height!="auto"){this.list.el.style.height="auto"}}}},isExpanded:function(){return this.list&&this.list.isVisible()},selectByValue:function(m){if(!j.isEmpty(m,true)){var g=this.findIndexByValue(m);if(g!=-1){this.select(g);return true}}return false},select:function(g){this.setSelectedIndex(g,true)},_selectUI:function(g){g=g||this.selectedIndex;if(this.list&&!this.url){var m=this.list.$el.find("a").eq(g);if(m.length){m.addClass("selected").siblings().removeClass("selected");if(!this.list.hidden){}}}},selectNext:function(){var g=this.data.length;if(g>0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex>0){this.select(this.selectedIndex-1)}}}},filter:function(r,p){var m=me.dom.menuWrap.getElementsByTagName("a");var g=m.length;r=String(r).toLowerCase().trim();for(var o=0;o=0){n.style.display=""}else{n.style.display="none"}n=null}doc=m=null},filterData:function(n,m){n=String(n).trim();var g=[];Array.each(m||this.data,function(o){var p=String(o[1]).indexOf(n);if(p>=0){g.push(o)}});return g},verifyInput:function(){var m=this;var g=m.dom.textField.value.trim();return m.filterData(g).length>0},clearFilter:function(){var m=me.dom.menuWrap.getElementsByTagName("a");var g=m.length;for(var n=0;n'+this.dom.textField.value+"
    ");m.appendTo(this.dom.outer);var g=m.offsetWidth;this.el.style.width=g+20+"px";this.dom.textField.style.width=g+20+"px";j.Dom.removeNode(m)},setLinkAge:function(n,m){if(this.DataSource){if(this.selectedIndex<0){h.setValue(m,null)}else{var g=this.DataSource.Rows[this.selectedIndex-(this.data[0][1]===""?1:0)];if(g){h.setValue(m,g.get(n))}}}},onChange:function(){},beforeDestroy:function(){var g=this;if(this.list){j.rootWin.$(this.list.el).off("click")}if(g.url){if(g.dom.iframe){j.rootWin.$(g.dom.iframe).off("load")}}else{g.dom.$textField.off();$(g.dom.arrow).off()}j.AllDocumentsEvent.un("mousedown.combox");if(j.rootWin!=window){j.rootWin.$(j.rootDoc).off("mousewheel.combox")}$document.off("mousewheel.combox");this.list&&this.list.destroy()}});a.getInstance=function(g){return j.ComponentManager.getById(typeof g=="string"?g:g.compId?g.compId:g.id)};var e="add,clear,disable,enable,getParam,setParam,loadData,filter,setValue,setValueEx,setSelectedIndex,setSelectedIndexEx,setLinkAge,verifyInput";e=e.split(",");for(i=0;i32&&w<41){if(!s.value){s.blur()}else{if(w===40||w===38){if(u.pressingCount++===0){if(u._isRunning){u.stop()}x=true;u._selectItem(w===40)}else{if(u.pressingCount==3){u.pressingCount=0}}k.preventEvent(t)}}}else{if(w===13){s.blur();if(x){if(s.value==u._getSelectedItemKey()){if(u.fireEvent("itemSelect")===false){return}}}u._submitForm()}else{if(!u._isRunning){u.start()}x=false}}}if(k.isChrome){if(u._keyTimer){clearTimeout(u._keyTimer)}u._keyTimer=setTimeout(function(){u._keyTimer=undefined},500)}},textInput_onKeyUp:function(r){this.pressingCount=0},textInput_onBlur:function(r){var s=this;s.stop();setTimeout(function(){if(!s._focusing){s.hide()}},0)},_initContainer:function(){$(this.el).css({position:"absolute",background:"none repeat scroll 0 0 white",border:"1px solid #999999","z-index":"990"})},_setContainerRegion:function(){var t=this,r=t.textInput,u=$(r).offsetEx(),s=t.el;k.Node.setPosition(s,{x:u.left,y:u.top+r.offsetHeight});$(s).width(t.containerWidth||r.offsetWidth-2)},_initContainerEvent:function(){var u=this,t=$(u.el),s=$(u.dom.content),r=$(u.dom.footer);t.on("mousedown",$.proxy(u.container_onMouseDown,u));t.on("mouseleave",$.proxy(u.container_onMouseLeave,u));s.on("mousemove",$.proxy(u.content_onMouseMove,u));s.on("mousedown",$.proxy(u.content_onMouseDown,u));s.on("mouseup",$.proxy(u.content_onMouseUp,u));r.on("focusin",$.proxy(u.footer_onFocusIn,u));r.on("focusout",$.proxy(u.footer_onFocusOut,u));r.on("click",$.proxy(u.footer_onClick,u))},container_onMouseDown:function(r){var t=this;var s=k.getEvent(r);var u=s.target||s.srcElement;if(!/^(?:input|button|a)$/i.test(u.nodeName)){t.textInput.onbeforedeactivate=function(){t.textInput.ownerDocument.parentWindow.event.returnValue=false;t.textInput.onbeforedeactivate=null};k.preventEvent(s)}},content_onMouseMove:function(r){var u=this,t=u.dom.content;var s=k.getEvent(r);var w=s.target||s.srcElement;if(u._keyTimer){return}if(w.nodeName!=="LI"){w=$(w).parent("li")}if(w.ownerDocument==t.ownerDocument&&$.contains(t,w)){if(w!=u.selectedItem){u._removeSelectedItem();u._setSelectedItem(w)}}},content_onMouseDown:function(r){var t=this;var s=k.getEvent(r);var u=s.target||s.srcElement;if(u.nodeName!=="LI"){u=$(u).parent("li")}t.mouseDownItem=u},content_onMouseUp:function(r){var u=this,t=u.dom.content;var s=k.getEvent(r);var x=s.target||s.srcElement;if(s.button>2){return}if(x.nodeName!=="LI"){x=$(x).parent("li")}if(x!=u.mouseDownItem){return}if($.contains(t,x)){u._updateInputFromSelectItem(x);if(u.fireEvent("itemSelect")===false){return}try{input.blur()}catch(w){}u._submitForm()}},footer_onFocusIn:function(r){var s=this;s._focusing=true;s._removeSelectedItem();s.mouseLeaveFooter=false},footer_onFocusOut:function(r){var s=this;s._focusing=false;setTimeout(function(){if(s.mouseLeaveFooter){s.hide()}else{if(!s._focusing){s.textInput.focus()}}},0)},container_onMouseLeave:function(r){this.mouseLeaveFooter=true},footer_onClick:function(r){var t=this;var s=k.getEvent(r);var u=s.target||s.srcElement;if(/close/.test(u.className)){t.hide()}},_submitForm:function(){var t=this;if(this.submitOnSelect){var s=t.textInput.form;if(!s){return}if(this.fireEvent("beforeSubmit")===false){return}if(document.createEvent){var r=document.createEvent("MouseEvents");r.initEvent("submit",true,false);s.dispatchEvent(r)}else{if(document.createEventObject){s.fireEvent("onsubmit")}}s.submit()}},_initShim:function(){var r=this.ownerDocument.createElement("iframe");r.src="about:blank";r.className="z-shim";r.style.cssText="position:absolute;visibility:hidden;border:none";this.dom.shim=r;this.ownerDocument.body.appendChild(r)},_setShimRegion:function(){var t=this,s=t.el,r=s.style,u=t.dom.shim;if(u){k.Node.css(u,{left:parseInt(r.left,10)-2,top:r.top,width:parseInt(r.width,10)+2,height:s.offsetHeight-2})}},initEvent:function(){k.EventManager.onWindowResize(this.onWindowResize,this)},onWindowResize:function(){this._setContainerRegion()},start:function(){var r=this;if(this.fireEvent("beforeStart")===false){return}p.focusInstance=this;r._timer=r._timer||new k.Util.DelayedTask(function(){r._updateContent();r._timer.delay(r.delay)},r);r._timer.delay(r.delay);r._isRunning=true},stop:function(){var r=this;p.focusInstance=undefined;if(r._timer){r._timer.cancel()}r._isRunning=false},show:function(){var r=this,s=r.dom.shim;if(r.isVisible()){return}r._setContainerRegion();p.superclass.show.apply(this);if(s){r._setShimRegion();k.Node.show(s)}},hide:function(){var r=this,s=r.dom.shim;if(!r.isVisible()){return}if(s){k.Node.hide(s)}p.superclass.hide.apply(this)},_updateContent:function(){var s=this,r=s.textInput,t;if(!s.el){s.render()}if(r.value==s.query){return}t=s.query=r.value;if(!k.String.trim(t)){s._fillContainer();s.hide();return}switch(s.dataType){case 0:if(s._dataCache[t]!==undefined){s._fillContainer(s._dataCache[t]);s._displayContainer()}else{s._requestData()}break;case 1:s._requestData();break;case 2:s._handleResponse(s.dataSource[t]);break}},_requestData:function(){if(this.getDataByAJAX){this._requestDataByAJAX()}else{this._requestDataByScript()}},_requestDataByScript:function(){var u=this,r;if(!k.ie||k.ie9){u.dataScript=undefined}if(!u.dataScript){r=document.createElement("script");r.charset=u.charset;r.async=true;document.head.insertBefore(r,document.head.firstChild);u.dataScript=r;if(!k.ie||k.ie9){var s=+new Date();u._latestScriptTime=s;r.setAttribute("data-time",s);r.onload=function(){u._scriptDataIsOut=r.getAttribute("data-time")!=u._latestScriptTime}}}u.queryParams=u.queryName+"="+encodeURIComponent(u.query);if(u.fireEvent("beforeDataRequest")===false){return}u.dataScript.src=u.dataSource+"&"+u.queryParams},_requestDataByAJAX:function(){var s=this,r=new DataCollection();r.add(s.callbackName,s.callbackFn);r.add(s.queryName,s.query);if(s.fireEvent("beforeDataRequest")===false){return}Server.sendRequest(s.dataSource,r,function(t){r=null},s.id)},_handleResponse:function(s){var z=this,u,y="",t,w,x,B,A,r;if(z._scriptDataIsOut){return}z.returnedData=s;if(z.fireEvent("dataReturn")===false){return}if(!z.contentRenderer){y=z._renderContent(s)}else{y=z.contentRenderer(s)}z._fillContainer(y);if(z.fireEvent("beforeShow")===false){return}if(!z.dataType){z._dataCache[z.query]=z.dom.content.innerHTML}z._displayContainer()},_renderContent:function(s){var z=this,u,y="",t,w,x,B,A,r;u=z._formatData(z.returnedData);if((w=u.length)>0){x=document.createElement("ol");x.style.padding="0";x.style.margin="0";for(t=0;t1){s[t++]={key:w[0],result:w[1]}}}}return s},_formatItem:function(u,s){var r=document.createElement("li"),w,t;t=''+u+"";if(s){w=this.resultFormat.replace("%result%",s);if(k.String.trim(w)){t+=''+w+""}}r.innerHTML=t;return r},_fillContainer:function(s,t){var r=this;r._fillContent(s||"");r._fillFooter(t||"")},_fillContent:function(r){g(this.dom.content,r);this.selectedItem=undefined},_fillFooter:function(s){var t=this,w=t.dom.footer,u;g(w,s);if(t.closeBtn){var r=t.ownerDocument.createElement("a");r.href="javascript: void(0)";r.className=m;r.innerHTML=t.closeBtnText;w.appendChild(r)}t.fireEvent("updateFooter");$(w).css("display",w.innerText.trim()===""?"none":"")},_displayContainer:function(){var r=this;if(k.String.trim(r.dom.content.innerText)){r.show()}else{r.hide()}},_selectItem:function(u){var t=this,s=t.dom.content.getElementsByTagName("LI"),r;s=k.toArray(s);if(s.length<1){return}if(!t.isVisible()){t.show();return}if(!t.selectedItem){r=s[u?0:s.length-1]}else{r=s[k.Array.indexOf(s,t.selectedItem)+(u?1:-1)];if(!r){t.textInput.value=t.query}}t._removeSelectedItem();if(r){t._setSelectedItem(r);t._updateInputFromSelectItem()}},_removeSelectedItem:function(){if(this.selectedItem){k.Node.removeClass(this.selectedItem,"z-selected");this.selectedItem.style.backgroundColor="#ffffff"}this.selectedItem=undefined},_setSelectedItem:function(r){k.Node.addClass(r,"z-selected");r.style.backgroundColor="#3399FF";this.selectedItem=r;this.textInput.focus()},_getSelectedItemKey:function(){var r=this;if(!r.selectedItem){return""}return r.selectedItem.getAttribute(e)},_updateInputFromSelectItem:function(){var r=this;r.textInput.value=r._getSelectedItemKey(r.selectedItem)||r.query},beforeDestroy:function(){var u=this,t=$(u.el),s=$(u.dom.content),r=$(u.dom.footer);t.off("mousedown");t.off("mouseleave");s.off("mousemove");s.off("mousedown");s.off("mouseup");s.off("focusin");s.off("focusout");s.off("click")}});function g(s,r){if(r.nodeType==1){s.innerHTML="";if(k.isIE&&s.ownerDocument!=r.ownerDocument){s.innerHTML=r.outerHTML}else{s.appendChild(r)}}else{s.innerHTML=r}}function a(s){var t=s.split("."),r=t.length,u;if(r>1){s=s.replace(/^(.*)\..+$/,"$1");u=k.namespace(s,true);u[t[r-1]]=o}else{window[s]=o}}function o(r){if(!p.focusInstance){return}setTimeout(function(){p.focusInstance._handleResponse(r)},0)}p.callback=o;k.Suggest=p})();(function(){var e=window.Zving,b=e.getDom,a,c,d;a=function(f){this.outerElAttrs={tag:"label",cls:"Field",ztype:"Field"};a.superclass.constructor.call(this,f)};e.Class.extend(a,e.UICompBase,{ctype:"Field",checked:null,name:false,value:undefined,disabledClass:"z-label-disabled",afterRender:function(f){this.fieldEl=this.el.getElementsByTagName("input")[0];if(this.checkable||this.checked||this.type=="checkbox"){this.setChecked(this.checked)}if(this.disabled){this.disable(true)}},setValue:function(f){this.fieldEl.value=v;this.value=v;return this},getValue:function(){return this.fieldEl.value},setText:function(g){var f=this.el.getElementsByTagName("LABLE")[0];f.innerHTML=g;return this},getChecked:function(){if(this.fieldEl.checked===true){this.checked=true;return true}else{this.checked=false;return false}},setChecked:function(j){var g=this,h=g.fieldEl,f=g.labelEl;if(j){g.checked=true;h.checked=true}else{g.checked=false;h.checked=false}this.fireEvent("checkchange",this)},_sync:function(f){this._syncChecked(null,f);this._syncDisabled()},_syncChecked:function(g,k){var h=this,f=h.labelEl,j=h.fieldEl.checked;if(g!==undefined&&g!==null){j=g}if(j){h.checked=true;$(f).addClass("z-label-checked")}else{h.checked=false;$(f).removeClass("z-label-checked")}},_syncDisabled:function(g){var h=this,f=h.labelEl,j=h.fieldEl.disabled;if(g!==undefined&&g!==null){j=g}if(j){h.disabled=true;$(f).addClass("z-label-disabled")}else{h.disabled=false;$(f).removeClass("z-label-disabled")}},disable:function(f){var g=this.labelEl,h=this.fieldEl;if(this.rendered){$(g).addClass(this.disabledClass);h.disabled=true}this.disabled=true;if(f!==true){this.fireEvent("disable",this)}return this},enable:function(f){var g=this.labelEl,h=this.fieldEl;if(this.rendered){$(g).removeClass(this.disabledClass);h.disabled=false}this.disabled=false;if(f!==true){this.fireEvent("enable",this)}return this}});c=function(f){this.outerElAttrs={tag:"sapn",cls:"z-checkbox",ztype:"Checkbox"};if(!(this instanceof c)){return e.ComponentManager.get(e.getDom(f).compId)}c.superclass.constructor.call(this,f)};e.Class.extend(c,a,{ctype:"Checkbox",htmlParser:function(f){f=b(f);if(!f){return}this.el=f;this.initDom();return{el:f}},initDom:function(){var h=this,j,g;if(h.el.type=="checkbox"||h.el.type=="radio"){j=h.fieldEl=h.el}else{j=h.fieldEl=h.el.getElementsByTagName("INPUT")[0]}var f=$(j).next();if(f[0]&&f[0].nodeName=="LABEL"&&(f.attr("for")==h.fieldEl.id||!f.attr("for"))){g=h.labelEl=f[0]}h.value=j.value;if(j||!j._syncChecked){if(j.watch){j.watch("checked",function(k,m,n){h._syncChecked(n);return n});j.watch("disabled",function(k,m,n){h._syncDisabled(n);return n})}if(j.addEventListener){j.addEventListener("change",function(k){h._syncChecked()},false)}else{if(j.attachEvent){j.attachEvent("onpropertychange",function(k){h._sync()})}}j._sync=function(){h._sync()};j._sync()}}});d=function(f){this.outerElAttrs={tag:"sapn",cls:"z-radio",ztype:"Radio"};if(!(this instanceof d)){return e.ComponentManager.get(e.getDom(f).compId)}d.superclass.constructor.call(this,f)};e.Class.extend(d,a,{ctype:"Radio",htmlParser:function(f){f=b(f);if(!f){return}this.el=f;this.initDom();return{el:f}},initDom:function(){var h=this,j,g;if(h.el.type=="checkbox"||h.el.type=="radio"){j=h.fieldEl=h.el}else{j=h.fieldEl=h.el.getElementsByTagName("INPUT")[0]}var f=$(j).next();if(f[0]&&f[0].nodeName=="LABEL"&&(f.attr("for")==h.fieldEl.id||!f.attr("for"))){g=h.labelEl=f[0]}h.value=j.value;if(j||!j._syncChecked){if(j.watch){j.watch("checked",function(k,m,n){h._syncChecked(n);return n});j.watch("disabled",function(k,m,n){h._syncDisabled(n);return n})}if(j.addEventListener){j.addEventListener("change",function(k){h._syncChecked()},false)}else{if(j.attachEvent){j.attachEvent("onpropertychange",function(k){h._sync()})}}j._sync=function(){h._sync()};j._sync()}},_syncChecked:function(h,f){var j=this,g=j.labelEl,k=j.fieldEl.checked;if(h!==undefined&&h!==null){k=h}if(k){j.checked=true;$(g).addClass("z-label-checked");if(!f){j._syncRadioGroup()}}else{j.checked=false;$(g).removeClass("z-label-checked")}},_syncRadioGroup:function(){var j=this,g=j.labelEl,k=j.fieldEl,f=k.name;var h=$(k).parent("form")[0];if(!h){h=g.ownerDocument.body}var m=$(h).find("input[name="+f+"]").not(k);m.each(function(){if(this._sync){this._sync(null,true)}else{$(this).next().removeClass("z-label-checked")}})}});e.Checkbox=c;e.Radio=d})();(function(){var c=window.Zving,a,b;a=function(d){this.defaultConfig={items:[]};if(!(this instanceof a)){return c.ComponentManager.get(c.getDom(d).compId)}this.outerElAttrs={tag:"a",cls:"z-btn",ztype:"button",onselectstart:"return false"};a.superclass.constructor.call(this,d);if(this.icon&&(!this.iconCls||!/icon/.test(this.iconCls))){if(/.*\.(gif|png|jpg)$/i.test(this.icon)){this.iconHtml=c.String.format('',this.icon)}else{if(/-?\d+ -?\d+/i.test(this.icon)){var f=this.icon.match(/\d+/g)[0];var e=this.icon.match(/\d+/g)[1];this.iconHtml=c.String.format('',c.JSLIBPATH,f,e)}}}else{if(this.iconCls){this.iconHtml=c.String.format('',this.iconCls,c.JSLIBPATH)}else{this.iconHtml=""}}if(this.href&&!/^(#|javascript:void)/.test(this.href)){this.type="link";this.outerElAttrs.href=this.href;this.outerElAttrs.onclick="{onclickAttributeValue};";if(this.target){this.outerElAttrs.target=this.target}}else{this.outerElAttrs.href="javascript:void(0);";this.outerElAttrs.onclick="{onclickAttributeValue};return false;"}if(this.menu){this.outerElAttrs.menu=this.menu.getId()}if(this.initFromExistEl){this.afterRender()}this.addEvents("click","checkchange","menushow","menuhide","menuitemclick","arrowclick","change");if(this.changeHandler){this.on("change",this.changeHandler,this.scope||this);delete this.changeHandler}if(this.menu&&(this.type=="split"||this.type=="select")){this.on("menuitemclick",function(h,g){this.setActiveItem(g)})}if(this.initFromExistEl){this.attachMethod2Dom()}};a.htmlTemplate="{iconHtml}{text}";c.Class.extend(a,c.UICompBase,{ctype:"Button",type:"push",text:"按钮",onclickAttributeValue:"",handler:null,changeHandler:null,checkHandler:null,menu:null,renderTpl:a.htmlTemplate,hidden:false,checkable:false,checked:null,disabledClass:"z-btn-disabled",htmlParser:function(g){g=c.getDom(g);if(!g){return}var n={el:g,type:g.getAttribute("buttontype"),text:g.innerText,cls:g.className};var k=g.getAttributeNode("onclick");if(k&&k.value){n.onclickAttributeValue=k.value;n.handler=function(){g.fireEvent("onclick")}}var f=g.href;var o=g.getAttributeNode("href");var d=g.getAttribute("target");if(f&&o){n.href=f;if(!/^(#|javascript:)/.test(o.value)){if(d){n.target=d}n.type="link"}}var h=g.getAttribute("checked");var j=g.getAttribute("onchecked");if(h||j){n.onchecked=j;this.checkable=true;if(h===true||h==="true"){n.checked=true;n.cls+=" z-btn-checked";this.checked=true}else{n.checked=false;this.checked=false}n.type="checkbox"}var e=g.getAttribute("menu");if(e){n.menu=c.DropMenuManager.get(e);n.cls+=" z-btn-menu";n.type="menu";if(g.getAttribute("buttontype")=="split"){n.type="split"}if(g.getAttribute("buttontype")=="select"){n.type="select";if(g.getAttribute("prependText")){n.prependText=g.getAttribute("prependText")}else{}}}if(g._disabled===true||g.disabled==="true"){n.disabled=true;n.cls+=" z-btn-disabled"}var m=g.getElementsByTagName("IMG");if(m.length){if(!/icon000.png|blank.png/.test(m[0].src)){n.icon=m[0].src}if(m[0].className){n.iconCls=m[0].className}}this.initFromExistEl=true;this.ownerDocument=g.ownerDocument;this.ownerWindow=g.ownerDocument.parentWindow;return n},beforerender:function(){if(typeof this.onclick=="string"){this.onclickAttributeValue=this.onclick;this.onclick=null}},initRenderData:function(){return c.extraIf(this.renderData,{id:this.id,cls:this.cls,text:this.text,onclickAttributeValue:this.onclickAttributeValue,iconHtml:this.iconHtml})},setText:function(f){var d=this.el.getElementsByTagName("B")[0];var e=d.innerText.trim();d.innerHTML=d.innerHTML.replace(e,f);return this},setIcon:function(d){if(/.*\.(gif|png|jpg)$/i.test(d)){var e=this.el.getElementsByTagName("IMG");if(e.length){e[0].src=d}else{this.iconHtml=c.String.format('',d);this.el.insertAdjacentHTML("afterbegin",this.iconHtml)}}return this},getChecked:function(){if(this.$el.attr("checked")==="checked"||this.checked===true){this.checked=true;this.$el.attr("checked","checked");return true}else{this.checked=false;this.$el.removeAttr("checked");return false}},setChecked:function(d){if(this.type=="checkbox"||this.type=="radio"){if(d){this.addClass("z-btn-checked");this.checked=true;this.$el.attr("checked","checked")}else{this.removeClass("z-btn-checked");this.checked=false;this.$el.removeAttr("checked")}this.fireEvent("checkchange",this)}},afterRender:function(d){if(this.type!="link"){this.$el.on("click.button",$.proxy(this.onClick,this))}if(this.menu){this.$el.hover($.proxy(this.onMouseEnter,this),$.proxy(this.onMouseLeave,this));this.menu.on("show",this.onMenuShow,this);this.menu.on("hide",this.onMenuHide,this);this.menu.on("itemclick",this.onMenuItemClick,this)}if(this.checkable||this.checked||this.type=="checkbox"){this.setChecked(this.checked)}if(this.disabled){this.disable(true)}this.attachMethod2Dom()},attachMethod2Dom:function(){},showMenu:function(){if(this.rendered&&this.menu){if(this.menu.isVisible()){this.menu.hide()}this.menu.ownerCt=this;this.menu.show(this.el)}return this},hideMenu:function(){if(this.hasVisibleMenu()){this.menu.hide()}return this},hasVisibleMenu:function(){return this.menu&&this.menu.ownerCt==this&&this.menu.isVisible()},onMouseEnter:function(d){var e=this;if(e.autoHideMenuTimer){clearTimeout(e.autoHideMenuTimer)}e.autoHideMenuTimer=setTimeout(function(){e.showMenu()},200);e.menu.autoHideTimer=e.autoHideMenuTimer},onMouseLeave:function(d){var e=this;e.autoHideMenuTimer=setTimeout(function(){e.hideMenu()},100);e.menu.autoHideTimer=e.autoHideMenuTimer},onClick:function(f){var g=this.ownerWindow.Zving.getEvent(f);if(g){c.preventEvent(g)}if(g&&g.button!==undefined&&g.button!==0){return}var d=false;if(g&&g.srcElement&&g.srcElement.tagName=="I"){d=true}if(!this.disabled){if(this.menu&&!this.hasVisibleMenu()&&!this.ignoreNextClick){if(this.type=="menu"||d){this.showMenu()}else{if(d||this.type=="select"){var h=this.getActiveItem();if(h&&h.handler){h.handler()}}}}if(d){this.fireEvent("arrowclick",this,g)}if(this.type=="checkbox"){this.setChecked(!this.checked)}if(this.handler&&!this.onclickAttributeValue){if(this.fireEvent("click",this,g)!==false){if(this.parentMenu&&this.parentMenu.fireEvent("itemclick",this,g)===false){return}this.handler.call(this.scope||this,this,g)}}}else{c.stopEvent(g)}},onMenuShow:function(d){if(this.menu.ownerCt==this){this.menu.ownerCt=this;this.ignoreNextClick=0;this.fireEvent("menushow",this,this.menu)}},onMenuItemClick:function(d){this.fireEvent("menuitemclick",this,d)},onMenuHide:function(f){if(this.menu.ownerCt==this){var d=this;this.ignoreNextClick=setTimeout(function(){d.restoreClick()},250);this.fireEvent("menuhide",this,this.menu);delete this.menu.ownerCt}},restoreClick:function(){this.ignoreNextClick=0},disable:function(d){var f=this.el,e=this.$el;if(this.rendered){e.addClass(this.disabledClass);if(f.onclick){f._onclick_bak=f.onclick;f.onclick=null}f.disabled=true}this.disabled=true;if(d!==true){this.fireEvent("disable",this)}return this},enable:function(d){var f=this.el,e=this.$el;if(this.rendered){e.removeClass(this.disabledClass);if(f._onclick_bak){f.onclick=f._onclick_bak}f.disabled=null}this.disabled=false;if(d!==true){this.fireEvent("enable",this)}return this},setActiveItemById:function(e,d){return this.setActiveItem(e,d)},setActiveItem:function(f,h,e){if(!this.menu.rendered){this.showMenu();this.hideMenu()}if(!c.isObject(f)){f="proxy"+this.menu.timeStamp+"_"+f.replace(/^proxy\d+_/,"");f=this.menu.getItemComponent(f)}if(!f){return Console.error("按钮("+this.id+")的子项"+f+"不存在")}var g=this.prependText||"";g+=f.text;if(this.type=="select"){if(!this.rendered){this.text=f.text;this.iconCls=f.iconCls}else{this.setText(g);var d=f.icon;if(d){this.setIcon(d)}}}this.activeItem=f;if(!f.checked){f.setChecked(true,e)}if(h&&this.type=="select"){this.getActiveItem().handler()}if(!e){this.fireEvent("change",this,f)}},getActiveItem:function(){if(this.activeItem){return this.activeItem}if(this.menu.items.length>0){return this.menu.items[0]}if(this.menu.itemsConfig.length>0){return this.menu.itemsConfig[0]}},getActiveItemId:function(){return this.getActiveItem().id.split(/proxy\d+_/)[1]},beforeDestroy:function(){var d=this;if(d.menu&&d.destroyMenu!==false){d.menu.destroy()}d.el.onclick=null;this.$el.off("click.button")}});b=function(){var d={};return{add:function(e){d[e.id]=e},get:function(e){return d[e]},remove:function(e){if(e){d[buttonId].destory()}delete d[buttonId]},removeAll:function(e){c.iterate(d,function(f){this.remove(f.remove(e))})}}};c.Button=a;c.ButtonGroup=b})();(function(){var c=window.Zving,a,b;a=function(d){this.defaultConfig={itemsConfig:[],items:[]};if(c.isArray(d.items)){d.itemsConfig=d.items;delete d.items}a.superclass.constructor.call(this,d)};c.Class.extend(a,c.UICompBase,{ctype:"Menu",minWidth:120,shadow:"sides",defaultAlign:"lb",reAlign:"hr",defaultOffsets:[0,0],hidden:true,floating:true,zIndex:10200,hideParent:false,parentEl:c.rootDoc.body,showOnRootWindow:true,removeDomOnDestroy:true,defaultItemType:"Button",defaultItemConfig:{cmpCls:"z-btn-inmenu"},initComponent:function(){this.addEvents("itemclick");b.register(this);if(this.floating){c.EventManager.onWindowResize(this.hide,this)}a.superclass.initComponent.call(this)},htmlParser:function(m){if(!m){return}m=c.getDom(m);var f=[],k=m.children,j,g,e;this.timeStamp=+new Date;for(var h=0,d=k.length;h0){this.addComponentsFromArray(this.itemsConfig)}else{this.add(new c.UICompBase({html:'
    '}))}},afterRender:function(){},onMouseEnter:function(d){if(this.autoHideTimer){clearTimeout(this.autoHideTimer)}},onMouseLeave:function(d){var e=this;this.autoHideTimer=setTimeout(function(){e.hide()},100)},onClick:function(d){d=this.ownerWindow.Zving.getEvent(d);var e=d.target||d.srcElement;e=c.Node.getParent(e,"A");if(e){if(c.Node.hasClass(e,"z-btn")){if(c.Node.hasClass(e,"z-btn-haschildmenu")&&this.ignoreParentClicks){e.expandMenu();d.preventDefault()}else{if(c.Node.hasClass(e,"z-btn-inmenu")){this.hide()}}}}},show:function(f,j,e){var g;this.parentMenu=e;if(!this.el){this.render();this.doLayout(false,true)}var h=c.Node.anchorPos(this.el,f,j||this.defaultAlign,this.reAlign,this.defaultOffsets,true);if(this.showOnRootWindow){var d=c.Dom.getFrameOffset();h.x+=d.left;h.y+=d.top}this.showAt(h,e)},showAt:function(e,d){if(this.fireEvent("beforeshow",this)!==false){this.parentMenu=d;if(!this.el){this.render()}c.Node.setPosition(this.el,e);this.$el.show();this.hidden=false;this.fireEvent("show",this)}},doLayout:function(e,d){if(this.rendered){this.onLayout(e,d)}this.hasLayout=true},onLayout:function(d,e){this.doAutoSize()},doAutoSize:function(){},hide:function(d){if(!this.isDestroyed){this.deepHide=d;if(this.fireEvent("beforehide",this)!==false){this.doHide();this.fireEvent("hide",this)}delete this.deepHide}},doHide:function(){this.hidden=true;if(this.rendered){this.onHide()}},onHide:function(){if(this.el&&this.floating){this.$el.hide()}var d=this.parentMenu;if(this.deepHide===true&&d){if(d.floating){d.hide(true)}}},getVisibilityEl:function(){return this.hideParent?this.container:this.el},isVisible:function(){return this.rendered&&c.Node.isVisible(this.getVisibilityEl())},remove:function(d,e){this.initItems();var f=this.getItemComponent(d);if(f){this.doRemove(f,e)}return f},onRemove:function(d){},doRemove:function(e,d){this.items.remove(e);if(e.onRemoved){e.onRemoved()}this.onRemove(e);if(d===true||(d!==false&&this.autoDestroy)){e.destroy(true)}},removeAll:function(f){this.initItems();var h,j=[],e=[];this.items.each(function(k){j.push(k)});for(var g=0,d=j.length;g0){g.each(function(r){r.hide()});return true}return false}function h(r){var s=this;g.remove(r);if(g.length<1){if(this.showOnRootWindow){c.AllDocumentsEvent.un("mousedown",p,s)}else{$document.off("mousedown.menu")}d=false}}function n(r){var s=this;var t=g[g.length-1];o=new Date();g.push(r);if(!d){if(this.showOnRootWindow){c.AllDocumentsEvent.on("mousedown",p,s);$window.on("unload",function(){if(c.AllDocumentsEvent){c.AllDocumentsEvent.un("mousedown",p,s)}})}else{$document.on("mousedown.menu",$.proxy(p,s))}d=true}if(r.parentMenu){r.el.style.zIndex=parseInt(r.parentMenu.el.style.zIndex,10)+3;r.parentMenu.activeChild=r}else{if(t&&!t.isDestroyed&&t.isVisible()){r.el.style.zIndex=parseInt(t.el.style.zIndex,10)+3}}}function e(r){if(r.activeChild){r.activeChild.hide()}if(r.autoHideTimer){clearTimeout(r.autoHideTimer);delete r.autoHideTimer}}function k(r){var s=r.parentMenu;if(!s&&!r.allowOtherMenus){m()}else{if(s&&s.activeChild){s.activeChild.hide()}}}function p(r){if(new Date().getTime()-o.getTime()>50&&g.length>0){r=c.getEvent(r);var s=r.target||r.srcElement;if(s.ownerDocument!=this.ownerDocument&&s.ownerDocument!=c.rootDoc){return m()}while(s){if(c.Node.hasClass(s,"z-menu")){return}s=s.parentNode}m()}}return{hideAll:function(){return m()},destroyAll:function(){c.iterate(j,function(s,r){r.destroy()})},register:function(r){if(!j){q()}j[r.id]=r;r.on({beforehide:e,hide:h,beforeshow:k,show:n})},get:function(r){return j[r]},unregister:function(r){delete j[r.id];r.un("beforehide",e);r.un("hide",h);r.un("beforeshow",k);r.un("show",n)}}}();$window.on("unload",b.destroyAll);c.DropMenu=a;c.DropMenuManager=b})();(function(){var c=window.Zving,a=c.Node,b;b=function(d){b.superclass.constructor.apply(this,arguments);c.Page.onLayout(this.fitToSize,this);c.EventManager.onWindowResize(this.fitToSize,this)};c.Class.extend(b,c.UICompBase,{ctype:"Toolbar",contentElClass:"z-toolbar-nowrap",buttonElClass:"z-btn-flat",enableOverflow:true,triggerWidth:22,initComponent:function(){var d=this;this.hiddenItems=[];this.addEvents("overflowchange");this.frameBody=$("."+this.contentElClass,this.el)[0];if(!this.frameBody){c.Console.error("toolbar.js - 初始化错误,找不到参数对应的页面元素")}var e=c.toArray(this.frameBody.children);this.items=[];e.each(function(g){if(a.hasClass(g,d.buttonElClass)){var f;if(g.compId){f=c.ComponentManager.get(g.compId)}else{f=new c.Button(g)}f.ownerCt=d;f.parentToolbar=d;this.items.push(f)}},this)},hideItem:function(d){this.hiddenItems.push(d);d.xtbHidden=true;d.xtbWidth=d.el.offsetWidth;a.addClass(d.el,"z-hidden")},unhideItem:function(d){a.removeClass(d.el,"z-hidden");d.xtbHidden=false;this.hiddenItems.remove(d)},getItemWidth:function(d){return d.xtbHidden?(d.xtbWidth||0):d.el.offsetWidth},fitToSize:function(){var o=this;if(!o.el||o.el.clientWidth==0&&o.el.parentNode.clientWidth==0){return}if(this.enableOverflow===false){return}var e=this.frameBody.offsetWidth,p=e-this.triggerWidth,d=this.lastWidth||0,m=0,f=this.hiddenItems,h=f.length!==0,q=e>d;this.lastWidth=e;if(e==d){return}var n=this.items,k=n.length,g=0,r;for(var j=0;jp){if(!(r.hidden||r.xtbHidden)){this.hideItem(r)}}else{if(r.xtbHidden){this.unhideItem(r)}m+=this.getItemWidth(r)}}}h=f.length!==0;if(h){this.initMore();this.more.el.style.marginLeft=p-m+"px";if(!this.lastOverflow){this.fireEvent("overflowchange",this.el,true);this.lastOverflow=true}}else{if(this.more){this.clearMenu();this.more.destroy(true);delete this.more;if(this.lastOverflow){this.fireEvent("overflowchange",this.el,false);this.lastOverflow=false}}}},initMore:function(){if(!this.more){this.moreMenu=new c.DropMenu({ownerCt:this,listeners:{beforeshow:this.beforeMoreShow,scope:this}});this.more=new c.Button({text:" ",type:"menu",cls:"z-toolbar-more",menu:this.moreMenu,ownerCt:this});this.more.render(this.frameBody)}},beforeMoreShow:function(h){var e=this.items,d=e.length,g;this.clearMenu();h.removeAll(true);for(var f=0;f(None)'}))}},addComponentToMenu:function(g,e){if(e.ctype=="Button"){var d="z-btn-inmenu";if(e.el&&(e.el.disabled===true||e.el.disabled==="true")){d+=" z-btn-disabled"}var f=c.extraIf({el:null,cls:d,onclick:""},e.initialConfig);g.add(new c.Button(f))}},clearMenu:function(){var d=this.moreMenu;if(d&&d.items){d.items.each(function(e){delete e.menu})}}});b.pageOnReady=function(){var e=$("div.z-toolbar");var d={};if(e.length){e.each(function(){d[c.id(this)]=new b(this)})}};c.Toolbar=b})();(function(){if(!(Zving.isIE6||Zving.isIE7)){return}var L=window.Zving,t=L.isIE,W=L.isIE6;if(location.toString().indexOf("file:///")===0){return}if(document.compatMode!="CSS1Compat"){return}var n=document;var B=n.documentElement;var Y=w();var A;var X=[];var D=0;var d=true;var N="z";var b=/(\/\*[^*]*\*+([^\/][^*]*\*+)*\/)\s*/g;var r=/@import\s*(?:(?:(?:url\(\s*(['"]?)(.*)\1)\s*\))|(?:(['"])(.*)\3))[^;]*;/g;var F=/\burl\(\s*(["']?)(?!data:)([^"')]+)\1\s*\)/g;var G=/^:(empty|(first|last|only|nth(-last)?)-(child|of-type))$/;var U=/:(:first-(?:line|letter))/g;var H=/(^|\})\s*([^\{]*?[\[:][^{]+)/g;var E=/([ +~>])|(:[a-z\-]+(?:\(.*?\)+)?)|(\[.*?\])/g;var M=/(:not\()?:(hover|enabled|disabled|focus|checked|target|active|visited|first-line|first-letter)\)?/g;var aa=/[^\w\-]/g;var s=/^(INPUT|SELECT|TEXTAREA|BUTTON)$/;var q=/^(checkbox|radio)$/;var y=L.ieVersion>6?/[\$\^*]=(['"])\1/:null;var f=/([(\[+~])\s+/g;var O=/\s+([)\]+~])/g;var u=/\s+/g;var c=/^\s*((?:[\S\s]*\S)?)\s*$/;var x="";var p=" ";var Z="$1";function V(z){return z.replace(U,Z).replace(H,function(ac,ah,ag){var ad=ag.split(",");for(var ai=0,af=ad.length;ai0){R(ab.substring(0,aj),ae);ae=[]}return am}else{var ao=(an)?C(an):T(al);if(ao){ae.push(ao);return"."+ao.className}return ak}})}return ah+ad.join(",")})}function T(z){return(!y||y.test(z))?{className:I(z),applyClass:true}:null}function C(af){var ae=true;var ad=I(af.slice(1));var ac=af.substring(0,5)==":not(";var ab;var ag;if(ac){af=af.slice(5,-1)}var z=af.indexOf("(");if(z>-1){af=af.substring(0,z)}if(af.charAt(0)==":"){switch(af.slice(1)){case"root":ae=function(ah){return ac?ah!=document.documentElement:ah==document.documentElement};break;case"checked":ae=function(ah){if(q.test(ah.type)){o(ah,"propertychange",function(){if(event.propertyName=="checked"){J(ah,ad,ah.checked!==ac)}})}return ah.checked!==ac};break;case"disabled":ac=!ac;case"enabled":ae=function(ah){if(s.test(ah.tagName)){o(ah,"propertychange",function(){if(event.propertyName=="$disabled"){J(ah,ad,ah.$disabled===ac)}});X.push(ah);ah.$disabled=ah.disabled;return ah.disabled===ac}return af==":enabled"?ac:!ac};break;case"focus":ab="focus";ag="blur";case"hover":if(!ab){ab="mouseenter";ag="mouseleave"}ae=function(ah){o(ah,ac?ag:ab,function(){J(ah,ad,true)});o(ah,ac?ab:ag,function(){J(ah,ad,false)});return ac};break;default:if(!G.test(af)){return false}break}}return{className:ad,applyClass:ae}}function R(z,ab){var ad;var ai=z.replace(M,x);if(ai==x||ai.charAt(ai.length-1)==p){ai+="*"}try{ad=A(ai)}catch(ak){Console.error("Selector '"+z+"' threw exception '"+ak+"'")}if(ad){for(var aj=0,ae=ad.length;aj0)?ac[0].href:document.location.href;for(var af=0;af0){setInterval(function(){for(var ai=0,ag=X.length;ai-1&&g[k].onfocus===null&&g[k].offsetWidth>0&&g[k].offsetHeight>0){try{g[k].focus()}catch(j){}m=g[k];break}}}if(m){document.documentElement.scrollTop=0;document.body.scrollTop=0}else{h=document.createElement("A");h.href="#";if(document.body.firstChild){document.body.insertBefore(h,document.body.firstChild)}else{document.body.insertAdjacentElement("afterBegin",h)}try{h.focus()}catch(n){}m=h}g=h=m=null};if(d.restricted){return}if(window.frameElement&&d.isIE6&&!d.isQuirks){var c=document.getElementsByTagName("HTML")[0];if(c.style.overflow===""){if(c.style.overflow===""){c.style.overflow="auto"}if(c.style.overflowY===""){c.style.overflowY="auto"}if(c.style.overflowX===""){c.style.overflowX="hidden"}}else{window._noScrollFix=true}}d.Misc.scrollFixOnresize=false;d.Misc.ie6ScrollFix=function(){if(d.isIE6&&!d.isQuirks){if(window._noScrollFix){return}var g=document.getElementsByTagName("HTML")[0];var e=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);if((window.frameElement&&ewindow.frameElement.offsetHeight)||(!window.frameElement&&f>document.documentElement.clientHeight)){g.style.overflowY="scroll";g.style.overflowX="hidden"}else{g.style.overflowY="auto"}}};var b=null;var a=0;d.Misc.runIe6ScrollFix=function(){if(d.isIE6){if(a>9){clearTimeout(b)}else{b=setTimeout(d.Misc.ie6ScrollFix,100);a++}}};if(d.isIE6){d.Page.onLoad(function(){d.Misc.ie6ScrollFix();d.Misc.runIe6ScrollFix()},1)}})();(function(){var e=window.Zving,c=e.getDom,a=e.Node,b=e.Lang,d;d=function(f){if(!(this instanceof d)){return e.ComponentManager.get(e.getDom(f).compId)}d.superclass.constructor.apply(this,arguments)};e.Class.extend(d,e.UICompBase,{ctype:"PageBar",cls:"z-pagebar",outerElAttrs:"div",renderTpl:'
    {items}
    ',itemTpl:'{label}',hrefTpl:"#{page}",labelTpl:"[{page}]",currentLabelTpl:"{page}",specialLabelMap:{first:"首页",last:"尾页",previous:"上一页",next:"下一页"},pageSize:undefined,beginPage:1,endPage:100,currentPage:undefined,rowHeight:23,itemCount:10,leftItemCount:4,initComponent:function(){this.addEvents("beforeupdate","update","ongotopage");d.superclass.initComponent.apply(this)},htmlParser:function(g){var f=c(g);return{el:f}},update:function(f){var g=this;f=f||{};if(g.checkOptions(f)){if(f.hasOwnProperty("currentPage")&&f.currentPage!=g.currentPage){if(!g._notifyGotoPage(f.currentPage,false)){delete f.currentPage}}g._updateNoCheck(f);return true}return false},_updateNoCheck:function(f){var g=this;e.extra(g,f);if(g.getBodyEl()){g._refresh()}},checkOptions:function(g){var j=this;var h=g.beginPage||j.beginPage;var f=g.endPage||j.endPage;if(f<=h){return false}if(g.hasOwnProperty("beginPage")&&j.currentPage=f){j.currentPage=f-1}var k=g.currentPage||j.currentPage;if(k=f){return false}return true},_genItem:function(h,f){var g=this;return e.String.tmpl(g.itemTpl,{cls:f?f:"",page:h,href:e.String.tmpl(g.hrefTpl,{page:h}),label:function(){return(f?(f=="current"?e.String.tmpl(g.currentLabelTpl,{page:h}):g.specialLabelMap[f]):e.String.tmpl(g.labelTpl,{page:h}))}})},_genBody:function(){var f=this,g=f.initRenderData();return e.String.tmpl(f.renderTpl,f.renderData)},initRenderData:function(){var o=this,f=o.beginPage,h=o.endPage,m=o.currentPage,q=Math.min(Math.max(h-f+1,1),o.itemCount),p=Math.min(m-f,o.leftItemCount);p=Math.max(q-(h+1-m),p);var k=m-p,g={first:f,last:h,previous:m-1,next:m+1},r={};o.renderData=o.renderData||{};e.iterate(g,function(t,u){r[t]=o._genItem(u,t);console.log(u,t,r[t])});r.previous=g.previoush?"":r.next;r.first=k==f?"":r.first;r.last=k+q>h?"":r.last;var s=[];for(var j=0;j 全选排序字段: 创建时间降序';n.bodyTpl='
    ';n.footTpl=" ";k.Class.extend(n,k.UICompBase,{ctype:"DataGrid",cls:"z-datagrid",outerElAttrs:"div",renderTpl:'{head}
    {rows}
    ',titleTpl:'
    {titleCol}
    ',rowHeight:23,disabledResize:false,initComponent:function(){var g=this;k.Statable(this);this.addEvents("beforeupdate","update","insertRow","removerow","rowclick","rowselect","rowunselect");n.superclass.initComponent.apply(this);if(this.el){this.initDom()}},htmlParser:function(s){var r=this,q=e(s);r._rows=[];for(var p=0,g=q.rows.length;pg){s._rows.pop()}return s._rows},setParam:function(q,p,g){this.params[q]=p;if(g!==undefined){this[q]=g}},getParam:function(g){return this.params[g]},setParemFormEl:function(g){if(g.getAttribute("method")){this.setParam(c.Method,g.getAttribute("method"))}if(g.getAttribute("sortend")){this.sortable=true}if(g.getAttribute("autopagesize")=="true"){this.autoPageSize=true}if(g.getAttribute("autofill")=="true"){this.setParam(c.AutoFill,"true");this.autoFill=true}if(g.getAttribute("page")=="true"){this.setParam(c.Page,"true")}if(g.getAttribute("size")){this.setParam(c.Size,Number(g.getAttribute("size")))}if(g.getAttribute("multiSelect")=="true"){this.setParam(c.Multiselect,"true")}else{if(g.getAttribute("multiSelect")=="false"){this.setParam(c.Multiselect,"false");this.multiSelect=false}}if(g.getAttribute("scroll")=="true"){this.setParam(c.Scroll,"true")}if(g.getAttribute("editinrow")=="true"){this.editInRow=true}},initDom:function(){var p=this;var g=this.el;var q=g.id;p.dom={};p.dom.wrapper=e(q+"_wrap");p.dom.head=e(q+"_wrap_head");p.dom.headTable=e(q+"_head");p.dom.body=e(q+"_wrap_body");p.dom.$body=$(p.dom.body);p.dom.dock=e(q+"_dock");if(p.dom.dock){p.dom.$dock=$(p.dom.dock);p.dom.$dock_trigger=p.dom.$dock.find(".dock_trigger");p.dom.$dock_station=p.dom.$dock.find(".dock_station")}p.initEvents();p.initPagebar();if(p.autoFill){k.Page.onLayout(function(){if(!p.el.parentNode||p.el.parentNode.clientWidth==0&&p.dom.wrapper.clientWidth==0){return}p.layout();p.computePageSize();p.initScroll();p.resumePagebar()})}p.sortableInit()},initEvents:function(){var g=this;g.dom.$body.on("mousedown","tr.dg_row",function(p){if(p&&p.button!=2){g.onRowClick(p)}});g.dom.$body.on("mousedown","td.selector",function(p){if(p&&p.button!=2){g.onSelectorClick(p)}p.stopPropagation()});g.dom.$body.on("click","td.selector input",function(p){p.preventDefault()});g.dom.$body.on("contextmenu","tr.dg_row",function(p){g.onContextMenu(p)});if(g.editInRow){g.dom.$body.on("dblclick","tr.dg_row",function(p){g.onRowDblClick(p)})}if(!g.disabledResize){$("th:last",g.dom.headTable).attr("disabledresize","true");$(g.dom.headTable).on("mousemove","th",function(p){g.onHDMouseMove(p)});$(g.dom.headTable).on("mousedown","th",function(p){g.onHDMouseDown(p)})}if(g.dom.dock){g.dom.$dock.hoverIntent(function(){if(g.selectedDataCollection.size()===0){return}g.dom.$dock_trigger.hide();g.dom.$dock_station.show("slide",{direction:"right"})},function(){if(g.selectedDataCollection.size()===0){return}g.dom.$dock_station.hide("slide",{direction:"right"},function(){g.dom.$dock_trigger.show("fade")})});g.highlight_dock=new k.Util.DelayedTask(function(){var p=g.selectedDataCollection.size();g.dom.$dock_trigger.html(g.selectedDataCollection.size()).effect("highlight");g.dom.$dock_station.html("已选中 "+p+" 条记录。取消选中")})}},onContextMenu:function(g){me=this;var q=g.currentTarget;if(!me.getSelectedRows().length){me.onRowClick(g)}var p=me.el;if(p.onContextMenu){p.onContextMenu(g,q)}else{var s=p.id;if(!me.contextMenu){var r=me.contextMenu=new Menu();r.Width=150;r.addItem(f.get("DataGrid.CopyToClipboard"),function(){var t=r.Event.srcElement.innerText;d.copyToClipboard(t)},"icons/icon003a2.png");r.addItem(f.get("DataGrid.SelectedRowToExcel"),function(){me.selectedRowToExcel(s)},"icons/icon003a2.png");r.addItem(f.get("DataGrid.ToExcel"),function(){n.toExcel(s)},"icons/icon003a4.png");r.addItem(f.get("DataGrid.AllToExcel"),function(){n.toExcel(s,true)},"icons/icon003a3.png")}me.contextMenu.setEvent(g);me.contextMenu.show()}g.preventDefault()},selectedRowToExcel:function(q){var q=e(q);var r=me.getSelectedRows();var g=[];var p;for(p=0;p",q===undefined?"":q,"")});return k.String.tmpl(p.titleTpl,{id:p.getId(),cls:p.cls,titleCol:g.join("")})},getHeadTable:function(){if(!this.dom.headTable){this.dom.headTable=e(this.id+"_head")}return this.dom.headTable},initRenderData:function(){var g=this;g.renderData=g.renderData||{};k.extraIf(g.renderData,{id:g.getId(),cls:g.cls,rows:g._getRowsString()});if(g.title){k.extraIf(g.renderData,{head:g._getHeadString()});g.on("afterrender",function(){g.getTableEl().style.tableLayout="fixed";g.getHeadTable().style.width=g.getTableEl().offsetWidth+"px";g.getHeadTable().style.tableLayout="fixed"})}return g.renderData},_getRowsString:function(){var r=this,p=0,g=r.data.length,q=[],s;for(;pr.data.length){r._rows.pop()}return q.join("")},afterRender:function(){this.initDom();this.resizeColumn()},update:function(g){var p=this;g=g||{};k.extra(p,g);p.fireEvent("beforeupdate");p.updateContent(p.getString());p.resizeColumn();p.fireEvent("update")},getContentEl:function(){return e(this.id+"_wrap")||this.el},restore:function(){this.restoreData();this.restoreRows()},restoreData:function(p){var g=this;p=p||g.DataSource;g.data=[];if(!p){return}for(i=0,l=p.Values.length;is.Rows.length){w=s.Rows.length}var q=new DataTable();var u;q.Columns=s.Columns;q.Rows=[];q.Values=[];q.insertRow(0,new Array(q.Columns.length));for(u=0;uq.dom.body.offsetHeight){q.scrollpanelId=new k.ScrollPanel({target:q.dom.body}).getId()}}else{var g=k.ComponentManager.get(q.scrollpanelId);if(g){g.resume({target:q.dom.body})}}}},resumeScrollPanel:function(){var q=this;var p=q.getTableEl();var r=p.id;q.headLayout();if(this.scrollpanelId){var g=k.ComponentManager.get(this.scrollpanelId);if(g){g.resume({target:q.dom.body})}}},computePageSize:function(){var s=this;var r=s.getTableEl();if(!r||!r.parentNode){r=null;return}if(!s.autoPageSize||!s.autoFill){return false}if(r.style.height=="100%"){return}var p=r.parentNode.clientHeight;s.rowHeight=Math.max(s.rowHeight,r.clientHeight/r.rows.length);var q=Math.floor(p/s.rowHeight);var g=r.rows.length;if(g<=q+1){return}while(g>q+1){r.deleteRow(g-1);if(k.isIE6){g--}else{g=r.rows.length}}s.setParam(c.Size,q);s.lastTh.style.borderRightWidth="0";s.resumePagebar()},headLayout:function(){var r=this;var q=this.getTableEl();var p=r.lastTh;if(!p){var g=r.dom.headTable.rows[0].cells;p=r.lastTh=g[g.length-1]}if(q.offsetHeight-27>r.dom.body.offsetHeight){p.style.borderRight="15px solid #EEEEEE"}else{p.style.borderRightWidth="0"}return p},initPagebar:function(){var p=this.getTableEl();var t=p.id;var g=k.getDom("_PageBar_"+t);if(g){var q=$(g);var r=q.find(".pageSizeGroup");if(r.length){var s=r.find("ul");r.hover(function(){s.show()},function(){s.hide()})}}},resumePagebar:function(){var G=this;var q=this.getTableEl();var A=q.id;var r=e("_PageBar_"+A);if(!r){return}var s=$(r);var x=s.find(".pagebar");var y=Number(G.getParam(c.PageIndex));var t=Number(G.getParam(c.PageTotal));var E=Number(G.getParam(c.Size));var D=Math.floor(t/E);if(t%E===0){D--}var p=s.find(".first")[0];var F=s.find(".previous")[0];var B=s.find(".next")[0];var C=s.find(".last")[0];s.find(".js_total").html(t);s.find(".js_pageSize").html(E);s.find(".js_totalPages").html(1+D);s.find(".js_pageIndex").html(1+y);var z=s.find("input.gotopage");if(z.length){z.val(1+y).width(Math.max(String(1+y).length*7+1,15))}if(s.attr("pagebartype")!="2"){var w=s.find(".tfoot-fl");if(w.length){var u=w.find(".pageInfo");var g=w.find(".pageInfo_trigger");if(!u[0]._inited){if(u[0].offsetWidth+x[0].offsetWidth>w[0].parentNode.clientWidth){u.show();u[0]._width=u[0].clientWidth;u.hide();w.hoverIntent(function(){u.show().width(1).animate({width:u[0]._width},function(){g.hide()})},function(){u.animate({width:1},function(){u.hide();g.show()})});u[0]._inited=true;g.show()}}}}p._innerHTML_bak=p._innerHTML_bak||p.innerHTML;F._innerHTML_bak=F._innerHTML_bak||F.innerHTML;B._innerHTML_bak=B._innerHTML_bak||B.innerHTML;C._innerHTML_bak=C._innerHTML_bak||C.innerHTML;if(!/^<.*>$/.test(p._innerHTML_bak)){p._innerHTML_bak="'+f.get("DataGrid.FirstPage")+"";F._innerHTML_bak="'+f.get("DataGrid.PrevPage")+""}if(!/^<.*>$/.test(C._innerHTML_bak)){B._innerHTML_bak="'+f.get("DataGrid.NextPage")+"";C._innerHTML_bak="'+f.get("DataGrid.LastPage")+""}if(y<=0){p.innerHTML=p.innerText;F.innerHTML=F.innerText}else{if(p.innerHTML.trim()==p.innerText.trim()){p.innerHTML=p._innerHTML_bak;F.innerHTML=F._innerHTML_bak}}if(y>=D){B.innerHTML=B.innerText;C.innerHTML=C.innerText}else{if(B.innerHTML.trim()==B.innerText.trim()){B.innerHTML=B._innerHTML_bak;C.innerHTML=C._innerHTML_bak}}},sortableInit:function(){var q=this.el;if(this.sortable){var p=window["eval"](q.getAttribute("sortend"));var g="> .z-draggable";this._sortable(g,p)}},_sortable:function(g,p){var r=this;var t=r.getRowsContainer();var q=this.getTableEl();var s={};if(g){s.handle=g}if(p){s.start=function(u,w){w.item.data("originalIndex",r.getRowIndex(w.item))};s.stop=function(){p.apply(this,Array.prototype.slice.call(arguments).concat(q))}}s.helper=function(u,x){var w=x[0].outerHTML;w=w.replace(/^(<\w+)([^>]*)>/igm,'$1 style="background-color:#ffe; border: 1px solid #ddd">').replace(/ id=[^ >]/igm,"");w=$(w);x.children().each(function(y){w.children().eq(y).width($(this).width())});return w};s.axis="y";$(t).sortable(s)},getRowsContainer:function(){var g=this.getTableEl();if(g.getElementsByTagName("tbody").length==1){return g.getElementsByTagName("tbody")[0]}return g},getRowIndex:function(g){return $(g).prop("rowIndex")-1},showLoading:function(){var t=this;var g=this.getTableEl();var r=t.dom.body;var u=e("#_LoadingBGDiv");var z=e("#_LoadingIconDiv");if(!u){u=document.createElement("div");u.id="_LoadingBGDiv";j.hide(u);u.style.cssText="background-color:#FCFCFC;position:absolute;z-index:800;opacity:0.2;filter:alpha(opacity=20);";document.body.appendChild(u);u=$(u);z=document.createElement("div");z.id="_LoadingIconDiv";j.hide(z);z.innerHTML="  "+f.get("DataGrid.Loading")+" ";z.style.cssText="padding-top:5px;background-color:#ffc;position:absolute;z-index:801;height:20px;width:120px";document.body.appendChild(z)}var s=$(u);var q=$(z);var x=$(r).offset();var y=t.dom.body.offsetWidth,p=t.dom.body.offsetHeight;s.css({top:x.top+"px",left:x.left+"px",width:y+"px",height:p+"px"});q.css({top:x.top+(k.isIE?2:0)+"px",left:x.left+(k.isIE?2:0)+"px"});s.show();q.show()},hideLoading:function(){$("#_LoadingBGDiv").hide();$("#_LoadingIconDiv").hide()},changePageSize:function(g){this.setParam(c.Size,g);this.loadData()},loadData:function(u,q,p){var t=this;var s=t.getTableEl();var w=s.id;var g=t.dom.body;if(t.isDataLoading){return}t.isDataLoading=true;var r=t.getSelectedValue();if(r&&r.length){n.currentSelected=r}if(!p||t.getParam(c.Multiselect)=="false"){t.clearAllSelected()}if(!q){q={}}else{if(q instanceof k.DataCollection){q=k.extra({},q.map)}}k.extra(q,t.params);t.showLoading();(function(){var a=k.getDom(t.id+'_AllCheck');if(a&&a.checked){a.checked=false;}}());h.sendRequest(n.BackendMethod,q,function(z){if(z.Status===0&&z.Message){Dialog.alert(z.Message);return}if(z._ZVING_STATUS===0&&z._ZVING_MESSAGE){Dialog.alert(z._ZVING_MESSAGE);return}var B=z.HTML;if(!B||B.length<10){k.Console.error("用于渲染数据表格的数据错误:"+z);t.isDataLoading=false;return}var y;t.afterEdit=t.afterEdit||s.afterEdit;t.cancelEdit=t.cancelEdit||s.cancelEdit;t.beforeEdit=t.beforeEdit||s.beforeEdit;if(t.getParam(c.Scroll)=="true"){t.dom.body.innerHTML=B}else{y=document.createElement("div");y.setAttribute("ztype","_DataGrid");y.innerHTML=B;s.parentNode.replaceChild(y,s)}s=null;t.el=s=e(w);s.compId=t.id;k.ComponentManager.initChildren(s);t.isDataLoading=false;var x=t.dom.body.getElementsByTagName("script");for(var A=0;A').appendTo(document.body).hide()}var g=t.dom.body.clientHeight;var w=t.dom.head.clientHeight;y.height(g+w)}var x=$(q).offset(),s=q.offsetWidth;var r=q.cellIndex;var p=t.dom.headTable.rows[0].cells[r+1];y._left=x.left+s-1;y.css({left:y._left,top:x.top}).show();t.dd.minRz=(this.resizerBarLen||15)-s;t.dd.maxRz=p?p.offsetWidth-(this.resizerBarLen||15):0;t.dd.initMx=u.pageX;t.dd.initLeft=y._left},endResizeSpliter:function(g){this.hdRzLi.hide()},onHDResize:function(g){var p=this;var q=g.pageX-p.dd.initMx;if(q<0&&qp.dd.maxRz){q=p.dd.maxRz}}this.hdRzLi.css("left",p.dd.initLeft+q);this.hdRzLi._left=p.dd.initLeft+q},onHDMouseUp:function(g){var q=this;this.endResizeSpliter();$document.off("mouseup.colresize");$document.off("mousemove.colresize");var p=this.hdRzLi._left-q.dd.initLeft;if(p!==0){this.setColumnWidth(q.dd.resizingEl,p,true)}this.fireEvent("colresizeend");this.resizing=false},setColumnWidth:function(r,p,u){var t=this;if(this.disabledResize){return this}var s=100*p/this.tableWidth;var q=r.cellIndex;var x=t.dom.headTable.rows[0].cells[q+1];if(r.width){if(r.width.indexOf("%")>0){r.width=parseFloat(r.width)+s+"%";if(u&&x){t.setColumnWidth(x,-p)}}else{r.width=parseFloat(r.width)+p}}else{var g=r.style.width;if(g=="auto"||g===""){$(r).width($(r).width()+p)}else{g=parseInt(g,10);r.style.width=g+p+"px"}}this.syncColumnWidth(r,x);this.fireEvent("colresize");return this},syncColumnWidth:function(p,s){var g=p.cellIndex;var r=this.getTableEl();var t=r.rows[0].cells[g];var q=r.rows[0].cells[g+1];if(p.width){t.width=p.width}if(p.style.width){t.style.width=p.style.width}if(s&&q){this.syncColumnWidth(s)}},syncAllColumnWidth:function(){var p=this.dom.headTable.rows[0].cells;for(var g=0;g=0){continue}s.push(t[r])}p=s.join();if(!p){p=c.Null}var y;if(u.hasClass("dg_headTable")){y=u.parent().find("div.dg_body > table.z-datagrid");if(!y.length){y=u.parent().next().find("table")}}n.setParam(y[0].id,c.SortString,p);n.loadData(y[0].id);g.attr("direction",x.trim());g.find("img.fr")[0].className="fr icon_sort"+x.trim()};n.onAllCheckClick=function(g,p){g=e(g);var q=g.id;p=p||e(q+"_AllCheck");if(p.checked){n.selectAll(g)}else{n.unselectAll(g)}};n.init=function(g){g=e(g);var p=$(g).getComponent();p.htmlParser(g)};n.getColumnInfo=function(s){s=e(s);var t=s.rows[0];var p=[];var r;for(r=0;r0){q=k.Node.getSize(s).width*parseInt(q.replace(/\D/gi,""),10)/100}else{if(q.indexOf("px")!==-1){q=q.replace("px","")}else{if(q==="auto"){q=0}}}p.push([u.innerText,r,q])}}return p};n.toExcel=function(p,g,q){p=e(p);var r=new k.Dialog(f.get("DataGrid.SelectCol"),k.JSLIBPATH+"resources/dataGridToExcelDialog.html?DataGridID="+p.id,500,150);r.onOk=function(){var w=r.innerWin.Zving.getByName("Column");var s=[],t=[],u;for(u=0;u0){t.src=""+o+"framework/images/butCollapse.gif";u=true}else{t.src=""+o+"framework/images/butExpand.gif"}var z=y.rows;var q=parseInt(x.getAttribute("level"),10);for(i=0;iq){if(u){if(j.isVisible(g)){g.setAttribute("_TreeHideLevel",q);j.hide(g)}}else{if(parseInt(g.getAttribute("_TreeHideLevel"),10)===q){j.show(g);g.setAttribute("_TreeHideLevel",null)}}}else{break}}break}}};n.onDocBodyMouseDown=function(g){var p=g.target;if(n.EditingRow!==null){if($.contains(n.EditingRow,p)){g.stopPropagation();return}k.ComponentManager.get(n.EditingRow.compId).changeStatus()}};n.Row=function(g){this.defaultConfig={_cells:{}};if(!(this instanceof n.Row)){return k.ComponentManager.get(k.getDom(g).compId)}n.Row.superclass.constructor.apply(this,arguments)};k.Class.extend(n.Row,k.UICompBase,{ctype:"DataGrid.Row",cls:"dg_row",outerElAttrs:"tr",autoElTpl:'{cells}',renderTpl:"{cells}",initComponent:function(){this.addEvents("beforeupdate","update","addcell","removecell","click","select","unselect");n.Row.superclass.initComponent.apply(this)},htmlParser:function(s){var r=this,q=e(s);r._cells=[];for(var p=0,g=q.cells;pg){r._cells.pop()}return r._cells},getString:function(){var g=this,p=this.initRenderData();return k.String.tmpl(this.autoElTpl,p)},initRenderData:function(){var g=this,p=[];this.renderData=this.renderData||{};k.each(g.content,function(r,q){p.push("",r===undefined?"":r,"")});return k.extraIf(this.renderData,{id:this.id,cls:this.cls,cells:p.join("")})},update:function(g){var p=this,q=p.getEl().children;g=g||{};k.extra(p,g);k.each(q,function(s,r){s.innerHTML=p.content[r]});p.fireEvent("update")},insertTo:function(p){var r=this,s,g;if(!r.getEl()){var q=r.getParent().getTableEl();if(q.rows[0].getAttribute("ztype")=="head"||q.rows[0].className=="dg_headTr"){++p}s=q.insertRow(p);j.setAttr(s,{id:r.getId(),"class":r.cls});r.setStateHandler(s);k.each(r.content,function(u,t){g=s.insertCell(t);g.innerHTML=u===undefined?"":u});r.el=s;s.compId=r.id}},setStateHandler:function(){},getParent:function(){return this._parent},_getCols:function(){return this.el.children},_getColsString:function(p,g){return colsArr.join("")},select:function(g){if(this.rendered){this.el.selected=true;$(this.el).addClass(b)}this.selected=true;if(g!==true){this.fireEvent("select",this)}return this},onSelect:function(){this.select()},unselect:function(g){if(this.rendered){this.el.selected=false;$(this.el).removeClass(b)}this.selected=false;if(g!==true){this.fireEvent("unselect",this)}return this},onUnselect:function(){this.unselect()},isSelected:function(){return this.selected},remove:function(){var g=this;g.getParent().getTableEl().deleteRow(g.el.rowIndex);g.destroy()},toggle:function(){var g=this;if(g.isSelected()){g.unselect()}else{g.select()}},getCell:function(p){var q=this,r=q._getCols()[p],g;if(r){if(r.id){g=q._cells[r.id]}else{g=new n.Cell({target:r});g._initialize(q);q._cells[g.getId()]=g}}r=null;return g},changeStatus:function(x){trEL=this.el;var S=this.getParent();var I=S.DataSource;var H=trEL.rowIndex-1;if(n.EditingRow&&trEL!=n.EditingRow){k.ComponentManager.get(n.EditingRow.compId).changeStatus()}var L,R,K,O;for(O=0;O")}if(g ")}else{p.push(" ")}}else{p.push(" ")}}var E=unescape(trEL.EditStatus?S.EditArray[O]:S.TemplateArray[O]);var z=/\$\{(\w+?)\}/gi;var D=0;p.push(E.replace(z,function(V,U){if(G){if(G[I.ColMap[U.toLowerCase()]]!=J.get(U)){A=true}}var W=J.get(U);if((W===""||W===null)&&!trEL.EditStatus){W=" "}return W}));trEL.cells[O].innerHTML=p.join("")}}}}if(A){trEL.cells[O].style.backgroundColor="#FEB34E"}else{trEL.cells[O].style.backgroundColor=""}if(!trEL.ModifyFlag&&A){trEL.ModifyFlag=true}}var T=trEL.getElementsByTagName("DIV");var P=T.length;var N;for(O=P;O>0;O--){var y=T[O-1];F=y.getAttribute("ztype");if(F&&F.toLowerCase()==="select"){Selector.initCtrl(y)}}if(k.isIE){trEL.onselectstart=trEL.EditStatus?null:k.stopEvent}else{for(N=0;Nthis.fixY)){if(isIE6){this.el.style.position="absolute";this.el.style.top=this.pos==="bottom"?e+this.viewportH-this.fixHeight+"px":e+"px"}else{this.el.style.position="fixed";this.el.style[this.pos]="0"}this.el.style.width=this.fixWidth+"px"}else{this.el.style.position="static";this.el.style.width=this._width}}};c.Afloat=d})();(function(){var d=window.Zving,b=d.isIE,a=d.Page;var c=function(){this.X=null;this.Y=null;this.Param=null;this.Items=[];this.Event=null};c.prototype.setEvent=function(e){var f=d.Event.getEventPosition(e);this.X=f.x;this.Y=f.y;this.Event=e};c.prototype.setPosition=function(e,f){this.X=e;this.Y=f};c.prototype.setParam=function(e){this.Param=e};c.prototype.addItem=function(h,g,f,e){this.Items.push([h,g,f,e])};c.prototype.onClick=function(e){if(!this.Items[e][3]){var f=this.Items[e][1];c.close();f.apply(this,[this.Param])}};c.prototype.getHtmlString=function(){var f=[];f.push("");f.push("
    ");for(var e=0;e
    ");continue}if(true===this.Items[e][3]){f.push("");if(this.Items[e][2]){f.push("")}else{f.push("")}f.push("");f.push("")}else{f.push("
    "+this.Items[e][0]+" 
    ");if(this.Items[e][2]){f.push("")}else{f.push("")}f.push("");f.push("")}f.push("
    "+this.Items[e][0]+" 
    ")}f.push("");f.push("