function DateAdd(n,t,i){var i;t=parseInt(t),typeof i=="string"&&(i=i.replace(/-/g,"/"),i=new Date(i)),typeof i=="object"&&(i=i);switch(n){case"y":return i.setFullYear(i.getFullYear()+t),i;case"q":return i.setMonth(i.getMonth()+t*3),i;case"m":return i.setMonth(i.getMonth()+t),i;case"w":return i.setDate(i.getDate()+t*7),i;case"d":return i.setDate(i.getDate()+t),i;case"hh":return i.setHours(i.getHours()+t),i;case"mm":return i.setMinutes(i.getMinutes()+t),i;case"ss":return i.setSeconds(i.getSeconds()+t),i;default:return i.setDate(i.getDate()+t),i}}function changevalue(n){var i="",r,u;if(n!=null){if(r=parseFloat(n),isNaN(r))return"";for(r=Math.round(n*100)/100,i=r.toString(),u=i.indexOf("."),u<0&&(u=i.length,i+=".");i.length<=u+2;)i+="0"}return i}function changeQvalue1(n){var i="",r,u;if(n!=null){if(r=parseFloat(n),isNaN(r))return"";for(r=Math.round(n*10)/10,i=r.toString(),u=i.indexOf("."),u<0&&(u=i.length,i+=".");i.length<=u+1;)i+="0"}return i}function changeQvalue(n){return rval=SaveThreeN(n,3)}function SaveThreeN(n,t){if(n==""||n==null||n=="--")return n;var r=parseFloat(n),i=r.toPrecision(t);if(i.indexOf(".")!=-1){if(i.length>t+1)return Number(i)}else if(i.length>t)return Number(i);return i}function mergeCellsByField(n,t){$("#Field").val(t);var e=t.split(","),u=$("#"+n),s=u.datagrid("getRows").length,r,h,o="",f="",c="";for(j=e.length-1;j>=0;j--)for(o="",r=1,h=0,i=0;i<=s;i++)f=i==s?"":u.datagrid("getRows")[i][e[j]],o==f?r+=1:(h+=r,u.datagrid("mergeCells",{index:i-r,field:e[j],rowspan:r,colspan:null}),u.datagrid("mergeCells",{index:i-r,field:"Ideparture",rowspan:r,colspan:null}),r=1),o=f}function pagerFilter(n){var r,f;typeof n.length=="number"&&typeof n.splice=="function"&&(n={total:n.length,rows:n});var i=$(this),t=i.datagrid("options"),u=i.datagrid("getPager");return u.pagination({onSelectPage:function(r,f){t.pageNumber=r,t.pageSize=f,u.pagination("refresh",{pageNumber:r,pageSize:f}),i.datagrid("loadData",n)}}),n.originalRows||(n.originalRows=n.rows),r=(t.pageNumber-1)*parseInt(t.pageSize),f=r+parseInt(t.pageSize),n.rows=n.originalRows.slice(r,f),n}function changesttp(n){if(n!=""&&n!=null&&n!=undefined)switch(n){case"PP":n="雨量站";break;case"DD":n="堰闸水文站";break;case"RR":n="水库水文站";break;case"ZZ":n="河道水位站";break;case"ZQ":n="河道水文站";break;case"MM":n="气象站";break;case"BB":n="蒸发站";break;case"DP":n="泵站";break;case"ZG":n="地下水站"}else n="";return n}function changewather(n){if(n!=""&&n!=null&&n!=undefined)switch(n){case"5":n="雪";break;case"6":n="雨夹雪";break;case"7":n="雨";break;case"8":n="阴";break;case"9":n="晴"}else n="";return n}function changewptn(n){if(n!=""&&n!=null&&n!=undefined)switch(n){case"4":n='<img src="/Content/images/j.gif">';break;case"5":n='<img src="/Content/images/s.gif">';break;case"6":n='<img src="/Content/images/p.gif">'}else n="缺测";return n}function changeswchrcd(n){if(n!=""&&n!=null&&n!=undefined)switch(n){case"1":n="干涸";break;case"2":n="断流";break;case"3":n="流向不定";break;case"4":n="逆流";break;case"5":n="起涨";break;case"6":n="洪峰";break;case"P":n="水电厂发电流量"}else n="";return n}function GreenCL(){return"background-color:#99FF99;"}function BlueCL(){return"background-color:#99CCFF;"}function RedCL(){return"background-color:#FFCC99;"}function JSTIME(n,t){var n=new Date(n.replace(/-/g,"/")),t=new Date(t.replace(/-/g,"/")),r=parseFloat(t.getTime())-parseFloat(n.getTime()),u=Math.floor(r/864e5),f=r%864e5,e=Math.floor(f/36e5),o=f%36e5,s=Math.floor(o/6e4),h=o%6e4,c=Math.round(h/1e3),i="统计时长为";return u!=0&&(i+=u+"天"),e!=0&&(i+=e+"小时"),s!=0&&(i+=s+"分钟"),i}function getDaysBetween(n,t){var i=new Date(n.replace(/-/g,"/")),r=new Date(t.replace(/-/g,"/")),u=parseFloat(r.getTime())-parseFloat(i.getTime());return Math.floor(u/864e5)}function getsize(){var n=0,t=0;return typeof window.innerHeight=="number"?(n=window.innerHeight,t=window.innerWidth):document.documentElement&&document.documentElement.clientHeight?(n=document.documentElement.clientHeight,t=document.documentElement.clientWidth):document.body&&document.body.clientHeight&&(n=document.body.clientHeight,t=document.body.clientWidth),{width:t,height:n}}var JSON,utils,com;JSON||(JSON={}),function(){"use strict";function i(n){return n<10?"0"+n:n}function f(n){return o.lastIndex=0,o.test(n)?'"'+n.replace(o,function(n){var t=s[n];return typeof t=="string"?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}function r(i,e){var s,l,h,a,v=n,c,o=e[i];o&&typeof o=="object"&&typeof o.toJSON=="function"&&(o=o.toJSON(i)),typeof t=="function"&&(o=t.call(e,i,o));switch(typeof o){case"string":return f(o);case"number":return isFinite(o)?String(o):"null";case"boolean":case"null":return String(o);case"object":if(!o)return"null";if(n+=u,c=[],Object.prototype.toString.apply(o)==="[object Array]"){for(a=o.length,s=0;s<a;s+=1)c[s]=r(s,o)||"null";return h=c.length===0?"[]":n?"[\n"+n+c.join(",\n"+n)+"\n"+v+"]":"["+c.join(",")+"]",n=v,h}if(t&&typeof t=="object")for(a=t.length,s=0;s<a;s+=1)typeof t[s]=="string"&&(l=t[s],h=r(l,o),h&&c.push(f(l)+(n?": ":":")+h));else for(l in o)Object.prototype.hasOwnProperty.call(o,l)&&(h=r(l,o),h&&c.push(f(l)+(n?": ":":")+h));return h=c.length===0?"{}":n?"{\n"+n+c.join(",\n"+n)+"\n"+v+"}":"{"+c.join(",")+"}",n=v,h}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+i(this.getUTCMonth()+1)+"-"+i(this.getUTCDate())+"T"+i(this.getUTCHours())+":"+i(this.getUTCMinutes())+":"+i(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,o=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,u,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},t;typeof JSON.stringify!="function"&&(JSON.stringify=function(i,f,e){var o;if(n="",u="",typeof e=="number")for(o=0;o<e;o+=1)u+=" ";else typeof e=="string"&&(u=e);if(t=f,f&&typeof f!="function"&&(typeof f!="object"||typeof f.length!="number"))throw new Error("JSON.stringify");return r("",{"":i})}),typeof JSON.parse!="function"&&(JSON.parse=function(n,t){function r(n,i){var f,e,u=n[i];if(u&&typeof u=="object")for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(e=r(u,f),e!==undefined?u[f]=e:delete u[f]);return t.call(n,i,u)}var i;if(n=String(n),e.lastIndex=0,e.test(n)&&(n=n.replace(e,function(n){return"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(n.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return i=eval("("+n+")"),typeof t=="function"?r({"":i},""):i;throw new SyntaxError("JSON.parse");})}(),utils={},utils.formatString=function(){for(var t,n=1;n<arguments.length;n++)t=new RegExp("\\{"+(n-1)+"\\}","gm"),arguments[0]=arguments[0].replace(t,arguments[n]);return arguments[0]},utils.formatDate=function(n,t){var i,r,u;if(!n)return"";i=n,typeof n=="string"&&(i=n.indexOf("/Date(")>-1?new Date(parseInt(n.replace("/Date(","").replace(")/",""),10)):new Date(Date.parse(n.replace(/-/g,"/").replace("T"," ").split(".")[0]))),r={"M+":i.getMonth()+1,"d+":i.getDate(),"h+":i.getHours(),"m+":i.getMinutes(),"s+":i.getSeconds(),"q+":Math.floor((i.getMonth()+3)/3),S:i.getMilliseconds()},/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(i.getFullYear()+"").substr(4-RegExp.$1.length)));for(u in r)new RegExp("("+u+")").test(t)&&(t=t.replace(RegExp.$1,RegExp.$1.length==1?r[u]:("00"+r[u]).substr((""+r[u]).length)));return t},utils.formatNumber=function(n,t){var c,f;if(n==null)return n;var o=n?n.toString().split("."):["0"],s=t?t.split("."):[""],i="",u=o[0],e=s[0],r=u.length-1,h=!1;for(f=e.length-1;f>=0;f--)switch(e.substr(f,1)){case"#":r>=0&&(i=u.substr(r--,1)+i);break;case"0":i=r>=0?u.substr(r--,1)+i:"0"+i;break;case",":h=!0,i=","+i}if(r>=0)if(h)for(c=u.length;r>=0;r--)i=u.substr(r,1)+i,r>0&&(c-r)%3==0&&(i=","+i);else i=u.substr(0,r+1)+i;for(i=i+".",u=o.length>1?o[1]:"",e=s.length>1?s[1]:"",r=0,f=0;f<e.length;f++)switch(e.substr(f,1)){case"#":r<u.length&&(i+=u.substr(r++,1));break;case"0":i+=r<u.length?u.substr(r++,1):"0"}return i.replace(/^,+/,"").replace(/\.$/,"")},utils.toTreeData=function(n,t,i,r){for(var s=[],h={},c=(n||[]).length,e,o,f,u=0;u<c;u++)h[n[u][t]]=n[u];for(e=0;e<c;e++)o=n[e],f=h[o[i]],f?(f[r]||(f[r]=[]),f[r].push(o)):s.push(o);return s},utils.eachTreeRow=function(n,t){for(var i in n){if(t(n[i])==!1)break;n[i].children&&utils.eachTreeRow(n[i].children,t)}},utils.isInChild=function(n,t,i){var r=!1;return utils.eachTreeRow(n,function(n){if(n.id==t)return utils.eachTreeRow([n],function(n){if(n.id==i)return r=!0,!1}),!1}),r},utils.fnValueToText=function(n,t,i){var u={},r,f;for(r in n)u[n[r][t||"value"]]=n[r][i||"text"];return f=function(n){return u[n]}},utils.compareObject=function(n,t){var r=function(n){var t=0;for(k in n)n.hasOwnProperty(k)&&t++;return t},i;if(typeof n!=typeof t)return!1;if(typeof n=="function")return n.toString()===t.toString();if(n instanceof Object&&t instanceof Object){if(r(n)!==r(t))return!1;i=!0;for(k in n)if(i=utils.compareObject(n[k],t[k]),!i)return!1;return!0}return n===t},utils.minusArray=function(n,t){var u=[],i,r,f;for(i in n){r=!0;for(f in t)if(utils.compareObject(n[i],t[f])){r=!1;break}r&&u.push(n[i])}return u},utils.diffrence=function(n,t,i,r){var e={},i=i||[],r=r||[],o={},s={},f,u;for(f in i)o[i[f]]=!0;for(f in r)s[r[f]]=!0;for(u in n)!s[u]&&(n[u]!=t[u]||o[u])&&(e[u]=n[u]);return e},utils.filterProperties=function(n,t,i){var r,o,f,u,e;if(n instanceof Array||Object.prototype.toString.call(n)==="[object Array]"){r=[];for(f in n)r.push(utils.filterProperties(n[f],t,i))}else if(typeof n=="object")if(r={},i){o={};for(f in t)o[t[f]]=!0;for(u in n)o[u]||(r[u]=n[u])}else for(u in t)e=t[u].split(" as "),r[e[1]||e[0]]=n[e[0]];else r=n;return r},utils.copyProperty=function(n,t,i,r){var f,u;if(n instanceof Array||Object.prototype.toString.call(n)==="[object Array]")for(f in n)utils.copyProperty(n[f],t,i);else if(typeof n=="object")if(t instanceof Array||Object.prototype.toString.call(t)==="[object Array]")for(u in t)utils.copyProperty(n,t[u],i[u]);else typeof t=="string"&&(n[i]&&r||!n[i])&&(n[i]=n[t]);return n},utils.clearIframe=function(n){var t=$("iframe",n).add(parent.$("iframe",n));t.length>0&&(t[0].contentWindow.document.write(""),t[0].contentWindow.close(),t.remove(),$.browser.msie&&CollectGarbage())},utils.getThisIframe=function(){var n,t,i;if(!parent||(n=parent.document.getElementsByTagName("iframe"),n.length==0))return null;for(t=0;t<n.length;++t)if(i=n[t],i.contentWindow===self)return i;return null},utils.functionComment=function(n){return n.toString().replace(/^.*\r?\n?.*\/\*|\*\/([.\r\n]*).+?$/gm,"")},utils.uuid=function(){var n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");return function(t,i){var f=n,u=[],o=Math.random,e,r;if(i=i||f.length,t)for(r=0;r<t;r++)u[r]=f[0|o()*i];else for(u[8]=u[13]=u[18]=u[23]="-",u[14]="4",r=0;r<36;r++)u[r]||(e=0|o()*16,u[r]=f[r==19?e&3|8:e&15]);return u.join("").toLowerCase()}}(),utils.getRequest=function(n,t){var t=t||window.location.href,r={},u,i;if(t.indexOf("?")!=-1)for(u=t.split("?")[1],strs=u.split("&"),i=0;i<strs.length;i++)r[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);return r[n]},com={},com.vm={},com.formatDate=function(n){return utils.formatDate(n,"yyyy-MM-dd")},com.formatTime=function(n){return utils.formatDate(n,"yyyy-MM-dd hh:mm:ss")},com.formatTimemm=function(n){return utils.formatDate(n,"yyyy-MM-dd hh:mm")},com.formatMoney=function(n){var t=n<0?"-":"";return t+utils.formatNumber(Math.abs(n),"#,##0.00")},com.formatCheckbox=function(n){var t=(n||"false").toString()=="true";return utils.formatString('<img value={0} src="/Content/images/{1}"/>',t,t?"checkmark.gif":"checknomark.gif")},com.message=function(n,t,i){switch(n){case"success":if(parent==window)return alert(t);parent.$("#notity").jnotifyAddMessage({text:t,permanent:!1});break;case"error":if(parent==window)return alert(t);parent.$.messager.alert("错误",t);break;case"warning":if(parent==window)return alert(t);parent.$("#notity").jnotifyAddMessage({text:t,permanent:!1,type:"warning"});break;case"information":parent.$.messager.show({title:"消息",msg:t});break;case"confirm":return parent.$.messager.confirm("确认",t,i)}return i&&i(),null},com.messageif=function(n,t,i,r){n&&com.message(t,i,r)},com.openTab=function(){parent.wrapper.addTab.apply(this,arguments)},com.setLocationHashId=function(n){var t=parent.location.hash.split("/");t[t.length-1]=n,parent.location.hash=t.join("/")},com.ajax=function(n){n=$.extend({showLoading:!0},n);var t={type:"POST",dataType:"json",contentType:"application/json",error:function(n){var t=n.responseText,i=t.match(/^{\"Message\":\"(.*)\",\"ExceptionMessage\":\"(.*)\",\"ExceptionType\":.*/);if(i!=null)t=(i[1]+i[2]).replace(/\\"/g,'"').replace(/\\r\\n/g,"<br/>").replace(/dbo\./g,"");else try{t=$(t).text()||t}catch(r){}com.message("error",t)}};n.showLoading&&(t.beforeSend=$.showLoading,t.complete=$.hideLoading),$.ajax($.extend(t,n))},com.query=function(n){var t=$;return $(document).find(n).length==0&&n!=document&&$(parent.document).find(n)&&(t=parent.$),t},com.formValidate=function(n){var i,t,r;return(n=n||document,i=com.query(n),i.fn.validatebox&&(t=i(".validatebox-text",n),t.length))?(t.validatebox("validate"),t.trigger("focus"),t.trigger("blur"),r=$(".validatebox-invalid:first",n).focus(),r.length==0):!0},com.formChanges=function(n,t,i){var r,u,f;n=ko.toJS(n)||{},t=ko.toJS(t)||{},i=i||[],r=utils.diffrence(n,t,i,["__ko_mapping__"]),u=0;for(f in r)u++;return r._changed=u>i.length,r},com.editGridViewModel=function(n){var t=this;this.begin=function(i,r){(i==undefined||typeof i=="object")&&(r=n.datagrid("getSelected"),i=n.datagrid("getRowIndex",r)),t.editIndex=t.ended()?i:t.editIndex,n.datagrid("selectRow",t.editIndex).datagrid("beginEdit",t.editIndex)},this.ended=function(){return t.editIndex==undefined?!0:n.datagrid("validateRow",t.editIndex)?(n.datagrid("endEdit",t.editIndex),t.editIndex=undefined,!0):(n.datagrid("selectRow",t.editIndex),!1)},this.addnew=function(i){t.ended()&&(Object.prototype.toString.call(i)!="[object Object]"&&(i={}),i=$.extend({_isnew:!0},i),n.datagrid("appendRow",i),t.editIndex=n.datagrid("getRows").length-1,n.datagrid("selectRow",t.editIndex),t.begin(t.editIndex,i))},this.deleterow=function(){var r=n.datagrid("getSelected"),i;r&&(i=n.datagrid("getRowIndex",r),i==t.editIndex&&(n.datagrid("cancelEdit",t.editIndex),t.editIndex=undefined),n.datagrid("deleteRow",i))},this.reject=function(){n.datagrid("rejectChanges")},this.accept=function(){var t,i;n.datagrid("acceptChanges"),t=n.datagrid("getRows");for(i in t)delete t[i]._isnew},this.getChanges=function(t,i){t||(t=[],i=!0);var u=utils.filterProperties(n.datagrid("getChanges","deleted"),t,i),f=utils.filterProperties(n.datagrid("getChanges","updated"),t,i),e=utils.filterProperties(n.datagrid("getChanges","inserted"),t,i),r={deleted:u,inserted:utils.minusArray(e,u),updated:utils.minusArray(f,u)};return r._changed=r.deleted.length+r.updated.length+r.inserted.length>0,r},this.isChangedAndValid=function(){return t.ended()&&t.getChanges()._changed}},com.editTreeGridViewModel=function(n){var t=this,i=n.idField;this.begin=function(r){var r=r||n.treegrid("getSelected");r&&(t.editIndex=t.ended()?r[i]:t.editIndex,n.treegrid("beginEdit",t.editIndex))},this.ended=function(){return t.editIndex==undefined?!0:n.treegrid("validateRow",t.editIndex)?(n.treegrid("endEdit",t.editIndex),t.editIndex=undefined,!0):(n.treegrid("select",t.editIndex),!1)},this.addnew=function(r,u){t.ended()&&(Object.prototype.toString.call(r)!="[object Object]"&&(r={}),r=$.extend({_isnew:!0},r),u=u||"",r[i]||(r[i]=utils.uuid()),n.treegrid("append",{parent:u,data:[r]}),n.$element().data("datagrid").insertedRows.push(r),n.treegrid("select",r[i]),t.begin(r))},this.deleterow=function(){var r=n.treegrid("getSelected");r&&(r[i]==t.editIndex&&(n.treegrid("cancelEdit",t.editIndex),t.editIndex=undefined),n.treegrid("remove",r[i]),n.$element().data("datagrid").deletedRows.push(r))},this.reject=function(){throw"未实现此方法！";},this.accept=function(){var t,i;n.treegrid("acceptChanges"),t=n.$element().datagrid("getRows");for(i in t)delete t[i]._isnew},this.getChanges=function(t,i){t||(t=[],i=!0);var u=utils.filterProperties(n.$element().datagrid("getChanges","deleted"),t,i),f=utils.filterProperties(n.$element().datagrid("getChanges","updated"),t,i),e=utils.filterProperties(n.$element().datagrid("getChanges","inserted"),t,i),r={deleted:u,inserted:utils.minusArray(e,u),updated:utils.minusArray(f,u)};return r._changed=r.deleted.length+r.updated.length+r.inserted.length>0,r},this.isChangedAndValid=function(){return t.ended()&&t.getChanges()._changed}},com.dialog=function(n){var t=parent.$,r=n.onClose,i;return n=t.extend({title:"My Dialog",width:400,height:220,closed:!1,cache:!1,modal:!0,html:"",url:"",viewModel:t.noop},n),n.onClose=function(){t.isFunction(r)&&r(),t(this).dialog("destroy")},t.isFunction(n.html)?n.html=utils.functionComment(n.html):/^\#.*\-template$/.test(n.html)&&(n.html=$(n.html).html()),i=t("<div><\/div>").appendTo("body").html(n.html),n.url&&t.ajax({async:!1,url:n.url,success:function(n){i.empty().html(n)}}),i.dialog(n),t.parser.onComplete=function(){"undefined"==typeof ko?n.viewModel(i):ko.applyBindings(new n.viewModel(i),i[0]),t.parser.onComplete=t.noop},t.parser.parse(i),i},com.auditDialog=function(){var u=parent.$,t=u("#w_audit_div"),f=arguments,n,i,e,r;t.length==0&&(n='<div id="w_audit_wrapper">',n+='    <div id="w_audit_div" class="easyui-dialog"  title="审核" data-options="modal:true,closed:true,iconCls:\'icon-user-accept\'" style="width:400px;height:210px;" buttons="#w_audit_div_button">',n+='        <div class="container_16" style="width:90%;margin:5%;">                                                                                  ',n+='            <div class="grid_3 lbl" style="font-weight: bold;color:#7e7789">审核状态<\/div>                                                       ',n+='            <div class="grid_13 val">                                                                                                            ',n+='                通过<input type="radio" name="AuditStatus" value="passed" data-bind="checked:form.status" style="margin-right:10px;" />          ',n+='                不通过<input type="radio" name="AuditStatus" value="reject" data-bind="checked:form.status" />                                   ',n+="            <\/div>                                                                                                                               ",n+='            <div class="grid_3 lbl" style="margin-top:5px;font-weight: bold;color:#7e7789" style="font-weight: bold;">审核意见<\/div>             ',n+='            <div class="grid_13 val"><textarea style="width:272px;height:60px;" class="z-text" data-bind="value:form.comment" ><\/textarea><\/div> ',n+='            <div class="clear"><\/div>                                                                                                            ',n+="        <\/div>                                                                                                                                   ",n+="    <\/div>                                                                                                                                       ",n+='    <div id="w_audit_div_button" class="audit_button">                                                                                           ',n+='        <a href="javascript:void(0)" data-bind="click:confirmClick" class="easyui-linkbutton" iconCls="icon-ok" >确定<\/a>                        ',n+='        <a href="javascript:void(0)" data-bind="click:cancelClick" class="easyui-linkbutton" iconCls="icon-cancel" >取消<\/a>                     ',n+="    <\/div>                                                                                                                                       ",n+="<\/div>",i=u(n).appendTo("body"),i.find(".easyui-linkbutton").linkbutton(),t=i.find(".easyui-dialog").dialog()),e=function(){var n=this;this.form={status:ko.observable("passed"),comment:ko.observable("")},this.confirmClick=function(){t.dialog("close"),typeof f[0]=="function"&&f[0].call(this,ko.toJS(n.form))},this.cancelClick=function(){t.dialog("close")}},r=t.parent()[0],t.dialog("open"),ko.cleanNode(r),ko.applyBindings(new e,r)},com.auditDialogForEditVM=function(){var u=parent.$,n=u("#w_audit_div"),t=arguments,f,i,e,r;n.length==0&&(f=utils.functionComment(function(){}),i=u(f).appendTo("body"),i.find(".easyui-linkbutton").linkbutton(),n=i.find(".easyui-dialog").dialog()),e=function(){var i=this;this.disabled=ko.observable(!0),this.form={status:t[0].ApproveState()=="passed"?"reject":"passed",comment:t[0].ApproveRemark()},this.confirmClick=function(){n.dialog("close"),typeof t[1]=="function"&&(t[0].ApproveState(this.form.status),t[0].ApproveRemark(this.form.comment),t[1].call(this,ko.toJS(i.form)))},this.cancelClick=function(){n.dialog("close")}},r=n.parent()[0],n.dialog("open"),ko.cleanNode(r),ko.applyBindings(new e,r)},com.readOnlyHandler=function(n){return _readOnlyHandles={},_readOnlyHandles.defaults=_readOnlyHandles.input=function(n,t){t?n.addClass("readonly").attr("readonly",!0):n.removeClass("readonly").removeAttr("readonly")},_readOnlyHandles.combo=function(n,t){var i=n.data("combo").combo;_readOnlyHandles.defaults(i.find(".combo-text"),t),t&&(i.unbind(".combo"),i.find(".combo-arrow,.combo-text").unbind(".combo"),n.data("combo").panel.unbind(".combo"))},_readOnlyHandles.spinner=function(n,t){_readOnlyHandles.defaults(n,t),t&&n.data("spinner").spinner.find(".spinner-arrow-up,.spinner-arrow-down").unbind(".spinner")},_readOnlyHandles[n||"defaults"]},com.loadCss=function(n,t,i){for(var f=t.getElementsByTagName("link"),e,u,r=0;r<f.length;r++)if(f[r].href.indexOf(n)>-1)if(i)f[r].parentNode.removeChild(f[r]);else return;e=t.getElementsByTagName("head")[0],u=t.createElement("link"),u.rel="stylesheet",u.type="text/css",u.media="screen",u.href=n,e.appendChild(u)},com.exporter=function(n){var t=this,i={action:"/home/download",dataGetter:"api",dataAction:"",dataParams:{},titles:[[]],fileType:"xls",compressType:"none"};return this.paging=function(n,i){return t.params.dataParams.page=n,t.params.dataParams.rows=i,t},this.compress=function(){return t.params.compressType="zip",t},this.title=function(n,i){return t.params.titles[n]=i,t},this.download=function(n){var f,i,r,u;if(t.params.fileType=n||"xls",t.params.dataParams=JSON.stringify(t.params.dataParams),t.params.titles=JSON.stringify(t.params.titles),f=$('<iframe style="display:none;" id="downloadHelper"><\/iframe>').appendTo("body")[0],i=f.contentWindow.document,i){i.open(),i.write(""),i.writeln(utils.formatString("<html><body><form id='downloadForm' name='downloadForm' method='post' action='{0}'>",t.params.action));for(r in t.params)i.writeln(utils.formatString("<input type='hidden' name='{0}' value='{1}'>",r,t.params[r]));i.writeln("<\/form><\/body><\/html>"),i.close(),u=i.forms[0],u&&u.submit()}},initFromGrid=function(n){var r=n.$element().datagrid("options"),f,e,u;for(n.treegrid&&(r.url=r.url||n.treegrid("options").url),f=[[]],e=Math.max(r.frozenColumns.length,r.columns.length),u=0;u<e;u++)f[u]=(r.frozenColumns[u]||[]).concat(r.columns[u]||[]);t.params=$.extend(!0,{},i,{dataAction:r.url,dataParams:r.queryParams,titles:f})},n.$element?initFromGrid(n):t.params=$.extend(!0,{},i,n),t},com.setVarible=function(n,t){parent.$(parent.document.body).data(n,t)},com.getVarible=function(n){return parent.$(parent.document.body).data(n)},com.cookie=$.cookie,com.getSetting=function(n,t){return parent.wrapper?parent.wrapper.settings[n]||t:t},com.parser=function(n){if(!n)return null;var t=n.split("-"),i=parseInt(t[0],10),r=parseInt(t[1],10),u=parseInt(t[2],10);return isNaN(i)||isNaN(r)||isNaN(u)?new Date:new Date(i,r-1,u)},jQuery.fn.showLoading=function(n){var s,t={addClass:"",beforeShow:"",afterShow:"",hPos:"center",vPos:"center",indicatorZIndex:99001,overlayZIndex:99e3,parent:"",marginTop:0,marginLeft:0,overlayWidth:null,overlayHeight:null,message:"正在加载中，请稍候"},i,r,h,c,e,o,l,a,u,f,v;return jQuery.extend(t,n),i=jQuery("<div><\/div>"),r=jQuery("<div><\/div>"),s=t.indicatorID?t.indicatorID:jQuery(this).attr("id"),jQuery(i).attr("id","loading-indicator-"+s),jQuery(i).addClass("loading-indicator"),t.addClass&&jQuery(i).addClass(t.addClass),jQuery(r).css("display","none"),jQuery(document.body).append(r),jQuery(r).attr("id","loading-indicator-"+s+"-overlay"),jQuery(r).addClass("loading-indicator-overlay"),t.addClass&&jQuery(r).addClass(t.addClass+"-overlay"),e=jQuery(this).css("border-top-width"),o=jQuery(this).css("border-left-width"),e=isNaN(parseInt(e))?0:e,o=isNaN(parseInt(o))?0:o,l=jQuery(this).offset().left+parseInt(o),a=jQuery(this).offset().top+parseInt(e),h=t.overlayWidth!==null?t.overlayWidth:parseInt(jQuery(this).width())+parseInt(jQuery(this).css("padding-right"))+parseInt(jQuery(this).css("padding-left")),c=t.overlayHeight!==null?t.overlayHeight:parseInt(jQuery(this).height())+parseInt(jQuery(this).css("padding-top"))+parseInt(jQuery(this).css("padding-bottom")),jQuery(r).css("width",h.toString()+"px"),jQuery(r).css("height",c.toString()+"px"),jQuery(r).css("left",l.toString()+"px"),jQuery(r).css("position","absolute"),jQuery(r).css("top",a.toString()+"px"),jQuery(r).css("z-index",t.overlayZIndex),t.overlayCSS&&jQuery(r).css(t.overlayCSS),jQuery(i).css("display","none").text(t.message),jQuery(document.body).append(i),jQuery(i).css("position","absolute"),jQuery(i).css("z-index",t.indicatorZIndex),u=a,t.marginTop&&(u+=parseInt(t.marginTop)),f=l,t.marginLeft&&(f+=parseInt(t.marginTop)),t.hPos.toString().toLowerCase()=="center"?jQuery(i).css("left",(f+(jQuery(r).width()-parseInt(jQuery(i).width()))/2).toString()+"px"):t.hPos.toString().toLowerCase()=="left"?jQuery(i).css("left",(f+parseInt(jQuery(r).css("margin-left"))).toString()+"px"):t.hPos.toString().toLowerCase()=="right"?jQuery(i).css("left",(f+(jQuery(r).width()-parseInt(jQuery(i).width()))).toString()+"px"):jQuery(i).css("left",(f+parseInt(t.hPos)).toString()+"px"),t.vPos.toString().toLowerCase()=="center"?jQuery(i).css("top",(u+(jQuery(r).height()-parseInt(jQuery(i).outerHeight()))/2).toString()+"px"):t.vPos.toString().toLowerCase()=="top"?jQuery(i).css("top",u.toString()+"px"):t.vPos.toString().toLowerCase()=="bottom"?jQuery(i).css("top",(u+(jQuery(r).height()-parseInt(jQuery(i).height()))).toString()+"px"):jQuery(i).css("top",(u+parseInt(t.vPos)).toString()+"px"),t.css&&jQuery(i).css(t.css),v={overlay:r,indicator:i,element:this},typeof t.beforeShow=="function"&&t.beforeShow(v),jQuery(r).show(),jQuery(i).show(),typeof t.afterShow=="function"&&t.afterShow(v),this},jQuery.fn.hideLoading=function(n){var t={};return jQuery.extend(t,n),indicatorID=t.indicatorID?t.indicatorID:jQuery(this).attr("id"),jQuery(document.body).find("#loading-indicator-"+indicatorID).fadeOut().remove(),jQuery(document.body).find("#loading-indicator-"+indicatorID+"-overlay").fadeOut().remove(),this},$.showLoading=function(){$("body").showLoading({overlayHeight:getsize().height})},$.hideLoading=function(){$("body").hideLoading()}