function Cmd(CmdStr){var a;try{eval("a = "+CmdStr+";")}catch(e){a=0,alert("表达式错误: "+CmdStr+"\n请在组态程序中修正后重新发布!")}return a}function getDateString(e){var t=e.getDate(),a=e.getMonth()+1;return e.getFullYear()+"/"+a+"/"+t+" "+e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()}function GetDital(e,t){var a=e;if(null==a||void 0==a)return 0;var o=a.toString().split("."),n=o.length<2?0:o[1].length;return"number"==typeof a?isNaN(a)?0:t<0?n<=7?a:a.toFixed(7):(t>7&&(t=7),n<=t?a:a.toFixed(t)):"string"==typeof a?isNaN(a)?0:(a=parseFloat(a),t<0?n<=7?a:a.toFixed(7):(t>7&&(t=7),n<=t?a:a.toFixed(t))):!0===a?1:0}function submitAddSingle(e,t,a,o,n,i){isdowncontrol()&&("True"==isAuthEnable&&i>=0?getAuthInfoByGroupId(i,function(r){r&&sendRequest(e,t,a,o,n,i)}):"True"==isAuthEnable&&-1==i?sendRequest(e,t,a,o,n,i):sendRequest(e,t,a,o,n,i,!1))}function sendRequest(e,t,a,o,n,i,r){r=void 0===r||r;var l={TagName:e,Time:a,Value:t,Quality:o};""===l.Time&&(l.Time="1900-01-01 00:00:00");var s=JSON.stringify(l);$.ajax({url:"http://"+webServiceIP+":"+webServicePort+"/api/Snapshot/?isSingleData=True",type:"POST",data:s,contentType:"application/json; charset=utf-8",success:function(a){if((a||"True"==a)&&r&&addOpera(e,e.split(".")[0],t,i,n,o,function(e){}),"string"==typeof a&&a.constructor==String)"True"!==a&&GD.createErrorDialog(300,160,a);else{var l=a.ErrorList;null!=l&&l.length>0&&GD.createErrorDialog(300,160,l[0].ErrorMsg)}},error:function(e){""===e.responseText?GD.createErrorDialog(300,160,"网络链接错误"):GD.createErrorDialog(300,160,e.responseText)},complete:function(e,t){null}})}function getHisTrendData(e,t,a,o,n){var i=t.split("&");str="http://"+webServiceIP+":"+webServicePort+"/api/HistoryInterval?tagName=",str=str+encodeURIComponent(i[0])+"&"+i[1]+"&"+i[2]+"&"+i[3]+"&"+i[4],$.ajax({url:str,type:"GET",dataType:"json",cache:!1,success:function(t){if(null===t){var i=0,r={};for(tag in a){r[tag]=[],e.series[i]={},e.series[i].name=a[tag],e.series[i].type="line",e.series[i].showSymbol=!1,e.series[i].sampling="average",e.series[i].symbol="none",e.series[i].animation=!1,e.yAxis&&e.yAxis.length>1&&a[tag+"index"]&&(e.series[i].yAxisIndex=a[tag+"index"]),n&&(e.series[i].areaStyle={normal:{}});for(c=0;c<1;c++){var l=Date.now();r[tag][c]={name:l,value:[l,null]}}e.series[i].data=r[tag],i++}}else{var s=t,i=0,r={};if(null!=s)for(tag in s){r[tag]=[],e.series[i]={},e.series[i].name=a[tag],e.series[i].type="line",e.series[i].showSymbol=!1,e.series[i].sampling="average",e.series[i].symbol="none",e.series[i].animation=!1,e.yAxis&&e.yAxis.length>1&&a[tag+"index"]&&(e.series[i].yAxisIndex=a[tag+"index"]),n&&(e.series[i].areaStyle={normal:{}}),e.legend&&e.lengend[0]&&e.lengend[0].data.push(a[tag]);for(var c=0;c=e){r=f[a].data[c],l=f[a].data[c-1];break}return!(!r||!l)&&(i=(r[1]-l[1])/(r[0]-l[0])*(e-l[0])+l[1],(s=Math.abs(t/i))<=n&&s>=o)}function u(e){if(f[e])return{name:e,data:f[e].data,type:"line",symbolSize:5,smooth:!0,itemStyle:{normal:{color:f[e].color}},lineStyle:{normal:{width:2,type:"solid"}},zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,clipOverflow:!0,label:{normal:{position:"top"},emphasis:{position:"top"}},step:!1,smoothMonotone:null,symbol:"emptyCircle",symbolRotate:null,showSymbol:!0,showAllSymbol:!1,connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:null}}var h=a.split("&");str="http://"+webServiceIP+":"+webServicePort+"/api/HistoryInterval?tagName=",h[0]=encodeURIComponent(h[0]),str+=h.join("&");h[h.length-1].split("=")[1];var g={"UP1500-70":[[3,3.12],[3.5,21.87],[4,46.99],[4.5,76.41],[5,111.05],[5.5,153.66],[6,206.11],[6.5,268.91],[7,342.59],[7.5,427.81],[8,525.33],[8.5,638.43],[9,755.38],[9.5,880.36],[10,1007.83],[10.5,1136.81],[11,1259.98],[11.5,1375.27],[12,1477.2],[12.5,1500],[13,1500],[13.5,1500],[14,1500],[14.5,1500],[15,1500],[15.5,1500],[16,1500],[16.5,1500],[17,1500],[17.5,1500],[18,1500],[18.5,1500],[19,1500],[19.5,1500],[20,1500],[20.5,1500],[21,1500],[21.5,1500],[22,1500],[22.5,1500],[23,1500],[23.5,1500],[24,1500],[24.5,1500],[25,1500]],"UP1500-77":[[3,9.61],[3.5,32.66],[4,62.2],[4.5,98.55],[5,141.4],[5.5,194.47],[6,260.73],[6.5,338.4],[7,428.8],[7.5,535.47],[8,658.98],[8.5,794.86],[9,941.5],[9.5,1097.29],[10,1253.7],[10.5,1405.08],[11,1500],[11.5,1500],[12,1500],[12.5,1500],[13,1500],[13.5,1500],[14,1500],[14.5,1500],[15,1500],[15.5,1500],[16,1500],[16.5,1500],[17,1500],[17.5,1500],[18,1500],[18.5,1500],[19,1500],[19.5,1500],[20,1500],[20.5,1500],[21,1500],[21.5,1500],[22,1500],[22.5,1500],[23,1500],[23.5,1500],[24,1500],[24.5,1500],[25,1500]],"UP1500-82":[[3,13.45],[3.5,40.61],[4,75.35],[4.5,117.73],[5,167.55],[5.5,231.09],[6,305.77],[6.5,398.23],[7,506.15],[7.5,631.44],[8,775.54],[8.5,933.21],[9,1101.82],[9.5,1274.34],[10,1451.66],[10.5,1500],[11,1500],[11.5,1500],[12,1500],[12.5,1500],[13,1500],[13.5,1500],[14,1500],[14.5,1500],[15,1500],[15.5,1500],[16,1500],[16.5,1500],[17,1500],[17.5,1500],[18,1500],[18.5,1500],[19,1500],[19.5,1500],[20,1500],[20.5,1500],[21,1500],[21.5,1500],[22,1500],[22.5,1500],[23,1500],[23.5,1500],[24,1500],[24.5,1500],[25,1500]],"UP1500-86":[[3,15.25],[3.5,45.21],[4,82.31],[4.5,130.21],[5,185.47],[5.5,255.27],[6,337.94],[6.5,439.39],[7,558.02],[7.5,695.24],[8,852.84],[8.5,1022.71],[9,1200.46],[9.5,1384.56],[10,1500],[10.5,1500],[11,1500],[11.5,1500],[12,1500],[12.5,1500],[13,1500],[13.5,1500],[14,1500],[14.5,1500],[15,1500],[15.5,1500],[16,1500],[16.5,1500],[17,1500],[17.5,1500],[18,1500],[18.5,1500],[19,1500],[19.5,1500],[20,1500],[20.5,1500],[21,1500],[21.5,1500],[22,1500],[22.5,1500],[23,1500],[23.5,1500],[24,1500],[24.5,1500],[25,1500]],"UP1500-97":[[3,35.99],[3.5,70.24],[4,118.45],[4.5,189.36],[5,271.06],[5.5,373.13],[6,485.66],[6.5,618.62],[7,773.69],[7.5,938.57],[8,1134],[8.5,1325],[9,1500],[9.5,1500],[10,1500],[10.5,1500],[11,1500],[11.5,1500],[12,1500],[12.5,1500],[13,1500],[13.5,1500],[14,1500],[14.5,1500],[15,1500],[15.5,1500],[16,1500],[16.5,1500],[17,1500],[17.5,1500],[18,1500],[18.5,1500],[19,1500],[19.5,1500],[20,1500],[20.5,1500],[21,1500],[21.5,1500],[22,1500],[22.5,1500],[23,1500],[23.5,1500],[24,1500],[24.5,1500],[25,1500]],"UP2000-87":[[3,39.13],[3.5,69.2],[4,115.97],[4.5,169.56],[5,237.72],[5.5,322.17],[6,424.52],[6.5,543.48],[7,681.04],[7.5,839.33],[8,1017.78],[8.5,1218.45],[9,1434.4],[9.5,1664.34],[10,1901.03],[10.5,2e3],[11,2e3],[11.5,2e3],[12,2e3],[12.5,2e3],[13,2e3],[13.5,2e3],[14,2e3],[14.5,2e3],[15,2e3],[15.5,2e3],[16,2e3],[16.5,2e3],[17,2e3],[17.5,2e3],[18,2e3],[18.5,2e3],[19,2e3],[19.5,2e3],[20,2e3],[20.5,2e3],[21,2e3],[21.5,2e3],[22,2e3],[22.5,2e3],[23,2e3],[23.5,2e3],[24,2e3],[24.5,2e3],[25,2e3]],"UP2000-96":[[3,21.9],[3.5,50.77],[4,93.07],[4.5,152.92],[5,224.24],[5.5,313.3],[6,421.61],[6.5,549.9],[7,700.66],[7.5,873.8],[8,1072.22],[8.5,1296.27],[9,1535.54],[9.5,1776.91],[10,2e3],[10.5,2e3],[11,2e3],[11.5,2e3],[12,2e3],[12.5,2e3],[13,2e3],[13.5,2e3],[14,2e3],[14.5,2e3],[15,2e3],[15.5,2e3],[16,2e3],[16.5,2e3],[17,2e3],[17.5,2e3],[18,2e3],[18.5,2e3],[19,2e3],[19.5,2e3],[20,2e3],[20.5,2e3],[21,2e3],[21.5,2e3],[22,2e3],[22.5,2e3],[23,2e3],[23.5,2e3],[24,2e3],[24.5,2e3],[25,2e3]],"UP2000-103":[[3,25.84],[3.5,59.25],[4,110.59],[4.5,176.41],[5,256.57],[5.5,358.22],[6,480.73],[6.5,625.08],[7,793.84],[7.5,989.98],[8,1212.58],[8.5,1458.06],[9,1705.04],[9.5,1961.65],[10,2e3],[10.5,2e3],[11,2e3],[11.5,2e3],[12,2e3],[12.5,2e3],[13,2e3],[13.5,2e3],[14,2e3],[14.5,2e3],[15,2e3],[15.5,2e3],[16,2e3],[16.5,2e3],[17,2e3],[17.5,2e3],[18,2e3],[18.5,2e3],[19,2e3],[19.5,2e3],[20,2e3],[20.5,2e3],[21,2e3],[21.5,2e3],[22,2e3],[22.5,2e3],[23,2e3],[23.5,2e3],[24,2e3],[24.5,2e3],[25,2e3]],"UP2000-105":[[3,31.9],[3.5,67.13],[4,123.02],[4.5,190.82],[5,276.72],[5.5,384.98],[6,515.37],[6.5,669.48],[7,850.74],[7.5,1058.97],[8,1289.89],[8.5,1536.96],[9,1787.9],[9.5,2e3],[10,2e3],[10.5,2e3],[11,2e3],[11.5,2e3],[12,2e3],[12.5,2e3],[13,2e3],[13.5,2e3],[14,2e3],[14.5,2e3],[15,2e3],[15.5,2e3],[16,2e3],[16.5,2e3],[17,2e3],[17.5,2e3],[18,2e3],[18.5,2e3],[19,2e3],[19.5,2e3],[20,2e3],[20.5,2e3],[21,2e3],[21.5,2e3],[22,2e3],[22.5,2e3],[23,2e3],[23.5,2e3],[24,2e3],[24.5,2e3],[25,2e3]],"UP2000-111":[[3,41.47],[3.5,81.58],[4,140.27],[4.5,214.03],[5,309.1],[5.5,428.09],[6,571.28],[6.5,739.81],[7,937.01],[7.5,1165.17],[8,1408.25],[8.5,1645.76],[9,1882.77],[9.5,2e3],[10,2e3],[10.5,2e3],[11,2e3],[11.5,2e3],[12,2e3],[12.5,2e3],[13,2e3],[13.5,2e3],[14,2e3],[14.5,2e3],[15,2e3],[15.5,2e3],[16,2e3],[16.5,2e3],[17,2e3],[17.5,2e3],[18,2e3],[18.5,2e3],[19,2e3],[19.5,2e3],[20,2e3],[20.5,2e3],[21,2e3],[21.5,2e3],[22,2e3],[22.5,2e3],[23,2e3],[23.5,2e3],[24,2e3],[24.5,2e3],[25,2e3]],"UP2000-115":[[3,20.62],[3.5,86.52],[4,159.21],[4.5,245.16],[5,346.11],[5.5,463.73],[6,619.51],[6.5,786.99],[7,985.67],[7.5,1229],[8,1510],[8.5,1862],[9,2e3],[9.5,2e3],[10,2e3],[10.5,2e3],[11,2e3],[11.5,2e3],[12,2e3],[12.5,2e3],[13,2e3],[13.5,2e3],[14,2e3],[14.5,2e3],[15,2e3],[15.5,2e3],[16,2e3],[16.5,2e3],[17,2e3],[17.5,2e3],[18,2e3],[18.5,2e3],[19,2e3],[19.5,2e3],[20,2e3],[20.5,2e3],[21,2e3],[21.5,2e3],[22,2e3],[22.5,2e3],[23,2e3],[23.5,2e3],[24,2e3],[24.5,2e3],[25,2e3]],"UP2000-121":[[3,32.728],[3.5,102.384],[4,186.87],[4.5,290.566],[5,415.484],[5.5,550.916],[6,711.338],[6.5,893.586],[7,1068.206],[7.5,1249.736],[8,1462.6],[8.5,1731.828],[9,1911.05],[9.5,2e3],[10,2e3],[10.5,2e3],[11,2e3],[11.5,2e3],[12,2e3],[12.5,2e3],[13,2e3],[13.5,2e3],[14,2e3],[14.5,2e3],[15,2e3],[15.5,2e3],[16,2e3],[16.5,2e3],[17,2e3],[17.5,2e3],[18,2e3],[18.5,2e3],[19,2e3],[19.5,2e3],[20,2e3]],"UP2100-121":[[3,19.99],[3.5,52.61],[4,139.07],[4.5,245.15],[5,367.82],[5.5,515.07],[6,691.68],[6.5,900.32],[7,1144],[7.5,1424],[8,1745],[8.5,2100],[9,2100],[9.5,2100],[10,2100],[10.5,2100],[11,2100],[11.5,2100],[12,2100],[12.5,2100],[13,2100],[13.5,2100],[14,2100],[14.5,2100],[15,2100],[15.5,2100],[16,2100],[16.5,2100],[17,2100],[17.5,2100],[18,2100],[18.5,2100],[19,2100],[19.5,2100],[20,2100],[20.5,2100],[21,2100],[21.5,2100],[22,2100],[22.5,2100],[23,2100],[23.5,2100],[24,2100],[24.5,2100],[25,2100]],"UP3000-108":[[3,112.73],[3.5,192.94],[4,286.15],[4.5,397.02],[5,528.27],[5.5,683],[6,865.06],[6.5,1073.3],[7,1310.46],[7.5,1573.22],[8,1855.97],[8.5,2147.44],[9,2437.76],[9.5,2735.59],[10,2997.89],[10.5,2997.89],[11,2997.89],[11.5,2997.89],[12,2997.89],[12.5,2997.89],[13,2997.89],[13.5,2997.89],[14,2997.89],[14.5,2997.89],[15,2997.89],[15.5,2997.89],[16,2997.89],[16.5,2997.89],[17,2997.89],[17.5,2997.89],[18,2997.89],[18.5,2997.89],[19,2997.89],[19.5,2997.89],[20,2997.89],[20.5,2997.89],[21,2997.89],[21.5,2997.89],[22,2997.89],[22.5,2997.89],[23,2997.89],[23.5,2997.89],[24,2997.89],[24.5,2997.89],[25,2997.89]],"UP2000-129":[[3,39.46343239],[3.5,125.6432788],[4,219.4714609],[4.5,329.5487529],[5,457.4521127],[5.5,607.3637197],[6,787.3911529],[6.5,997.9767531],[7,1233.68128],[7.5,1463.094124],[8,1689.342548],[8.5,1895.26058],[9,2e3],[9.5,2e3],[10,2e3],[10.5,2e3],[11,2e3],[11.5,2e3],[12,2e3],[12.5,2e3],[13,2e3],[13.5,2e3],[14,2e3],[14.5,2e3],[15,2e3],[15.5,2e3],[16,2e3],[16.5,2e3],[17,2e3],[17.5,2e3],[18,2e3],[18.5,2e3],[19,2e3],[19.5,2e3],[20,2e3]],"UP3000-146":[[3,77.147],[3.5,185.877636],[4,293.9956907],[4.5,428.4692409],[5,594.4768116],[5.5,785.2404187],[6,1007.887492],[6.5,1258.856802],[7,1525.997884],[7.5,1808.595136],[8,2096.963],[8.5,2438.74932],[9,2667.47688],[9.5,2828],[10,2929.1],[10.5,2985],[11,3e3],[11.5,3e3],[12,3e3],[12.5,3e3],[13,3e3],[13.5,3e3],[14,3e3],[14.5,3e3],[15,3e3],[15.5,3e3],[16,3e3],[16.5,3e3],[17,3e3],[17.5,3e3],[18,3e3],[18.5,3e3],[19,3e3],[19.5,3e3],[20,3e3]],"UPT300-16":[[.7,0],[.8,3.21709],[.9,12.2613],[1,23.3403],[1.1,36.9281],[1.2,53.3618],[1.3,72.7074],[1.4,95.261],[1.5,121.28],[1.6,151.017],[1.7,184.635],[1.8,220.949],[1.9,259.063],[2,298.231],[3,300.023],[4,300.023]],ErrorData:[[.7,0],[.8,2.944],[.9,11.232],[1,20.324],[1.1,34.9281],[1.2,50.3618],[1.3,68.7074],[1.4,86.261],[1.5,113.28],[1.6,131.017],[1.7,166.635],[1.8,203.949],[1.9,235.063],[2,268.231],[2.1,268.231],[2.2,268.231],[2.3,268.231],[2.4,268.231],[2.5,268.231],[2.6,268.231],[2.7,268.231],[2.8,268.231],[2.9,268.231],[3,272.023],[3.1,272.023],[3.2,272.023],[3.3,272.023],[3.4,272.023],[3.5,272.023],[3.6,272.023],[3.7,272.023],[3.8,272.023],[3.9,272.023],[4,272.023]]},f=e._standerdData;$.ajax({url:str,type:"GET",dataType:"json",cache:!1,success:function(e){if(null===e);else{var a,o=e,u=0;!function(){var e;for(var t in f)if(f.hasOwnProperty(t)){e=t;break}"UPT"===e.substr(0,3)&&(a=e)}(),!a||"1"!==i[0]&&"0"!==i[0]||function(){var e;for(var t in f)if(f.hasOwnProperty(t)){e=t;break}var a,i=e?f[e].data||g.ErrorData:g.ErrorData,r=[],l=[];o={},a=moment(Date.now()).format("YYYY-MM-DD HH-mm-ss");for(var s=0,c=i.length;s=l&&w[C].Value<=s&&y[C].Value<=s&&y[C].Value>=l&&(T.push(GetDital(parseFloat(w[C].Value),r)),T.push(GetDital(parseFloat(y[C].Value),r)),v.push(T))}else{var w=o[n[p][0]+"purveX"],y=o[n[p][1]+"purveY"];c[n[p][0]];if(t.series[u].type="scatter",t.series[p].symbol="circle",void 0===w||"undifined"==typeof y)continue;if(w.length==y.length)for(var C=0;Ct)&&e[n];return a}function getPointsSelect(e,t,a,o,n,i){var r=(e-1)*t;str="http://"+webServiceIP+":"+webServicePort+"/api/Point?start="+r+"&count="+t+"&filter="+o+"&tabfilter="+a,str=encodeURI(str),$.ajax({url:str,type:"GET",dataType:"json",cache:!1,success:function(e){if(null!=e)if(pointpros=e.PointsPros,null!=pointpros){var a=Math.ceil(e.Count/t);i.v("pagecount",a.toString());for(var o=pointpros.length,r=0;r=0&&index2e4&&newOption.series[index].data.splice(0,newOption.series[index].data.length-2e4)}}}dataChanged&&chart.setOption(newOption)}}},complete:function(e,t){null}})}function getDivText(e){return $(e).text()}function creatTree(e,t,a){var o=new ht.Data;if(o.setName(e.name),t.add(o),void 0!==a&&o.setParent(a),void 0!==e.child)for(var n=0;nlength&&(length=hisValues[key].length);var tagInfos=getTagInfos(columns,rows),tagInfosArr=tagInfos.split(","),rowArr,rowCount,columnsArr,columnsCount;""==columns?(rowArr=rows.split(","),columnsArr=rowArr,rowCount=1,columnsCount=columnsArr.length):(rowArr=rows.split(","),rowCount=rowArr.length,columnsArr=columns.split(","),columnsCount=columnsArr.length);for(var i=0;i0)for(var index=0,data=new ht.Data,rowIndex=0,j=0;j'+e+VarValue[o]+a+"":""+e+VarValue[o]+a+""}try{return alarmColorData[t.toLowerCase()]?''+e+VarValue[o].toFixed(2)+a+"":""+e+VarValue[o].toFixed(2)+a+""}catch(e){return 0}}return t?(varList.push(t),VarValue.push(0),""+e+"0"+a+""):void 0}function checkNumber(e){return/^(-)?\d+(\.\d+)?$/.test(e)}function getControlValue(e,t){var a;return e.getSelectedItem&&(a=e.getSelectedItem()),e.getValue&&(a=e.getValue()),t?checkNumber(a)?a:0:a}function setShapeOpacity(e,t,a){var o,n,i,r,l,s;if(isTextComps(e)){if(!e.a("node.background"))return;(o=(l=e.a("node.background")||"").split(",")).length>=3&&(n=l.replace(o[3]||1,t+")"),e.a("node.background",n)),(i=(s=e.a("node.gradientcolor")||"").split(",")).length>=3&&(r=s.replace(i[3]||1,t+")"),e.a("node.gradientcolor",r))}else(o=(l=e.s("shape.background")||"").split(",")).length>=3&&(n=e.getStyle("shape.background").replace(o[3]||1,t+")"),e.s({"shape.background":n})),(i=(s=e.s("shape.gradient.color")||"").split(",")).length>=3&&(r=e.getStyle("shape.gradient.color").replace(i[3]||1,t+")"),e.s({"shape.gradient.color":r}))}function setBorderOpacity(e,t,a){var o,n;if(isTextComps(e)){if(!e.a("node.color"))return;(o=e.a("node.color").split(",")).length>=3&&(n=e.a("node.color").replace(o[3],t+")"),e.a("node.color",n))}else(o=e.s("shape.border.color").split(",")).length>=3&&(n=e.getStyle("shape.border.color").replace(o[3],t+")"),e.s({"shape.border.color":n}))}function setDashStyle(e,t,a,o){o&&(isTextComps(e)?getDashStyle(a).length>0?(e.a("node.borderwidth",o),e.a("node.borderPattern",getDashStyle(a))):e.a("node.borderwidth",0):getDashStyle(a).length>0?(e.s({"shape.border.width":o}),e.s({"shape.border.pattern":getDashStyle(a)})):e.s({"shape.border.width":0}))}function setColor(e,t,a,o){isTextComps(e)?"textBackColor"==o?e.a("node.background",a):"textForeColor"==o?e.a("node.gradientcolor",a):"textColor"==o?e.a("node.color",a):"backColor"==o?e.a("node.background",a):"foreColor"==o?e.a("node.gradientcolor",a):"lineColor"==o&&e.a("node.color",a):"backColor"==o?e.s("shape.background",a):"foreColor"==o?e.s("shape.gradient.color",a):"lineColor"==o&&e.s("shape.border.color",a)}function getDashStyle(e){return"Solid"===e?[0,0]:"LinePoint"===e?[3,3]:"LineSegment"===e?[8,8]:[]}function toScreenPosition(e){var t=graphView.tx(),a=graphView.ty(),o=graphview.getZoom();return{x:e.x*o+t,y:e.y*o+a}}function addNodeToContainer(e,t,a,o){if(!(o.length<=0)){for(var n,i,r,l,s=a.getDataModel(),c=[],d=!!t._allowChildScale,u=0;u
  • '+o.value+'
  • '+n.value+"
"),e.s("2d.visible",!0),e.tip=null,i.toLowerCase()){case"up":t-=e.getWidth()/2,a-=e.getHeight();break;case"down":t-=e.getWidth()/2,a+=e.getHeight()/2;break;case"left":t-=e.getWidth(),a-=e.getHeight()/2;break;case"right":t+=e.getWidth()/2,a-=e.getHeight()/2;break;case"leftup":t-=e.getWidth(),a-=e.getHeight();break;case"leftdown":t-=e.getWidth();break;case"rightup":a-=e.getHeight()}createDomToolTip(e,t,a)}function changeToolTipContent(e,t,a){if(void 0!==e&&!0===e.s("2d.visible")){var o='
  • '+t.value+'
  • '+a.value+"
";e.setHtml('
'+o+"
"),"function"==typeof e.getStyle&&e.getStyle("2d.visible")&&createDomToolTip(e,0,0,o)}}function changeToolTipContentColor(e,t,a){if(void 0!==e&&!0===e.s("2d.visible")){var o='
  • '+t.value+'
  • '+a.value+"
";e.setHtml('
'+o+"
"),"function"==typeof e.getStyle&&e.getStyle("2d.visible")&&createDomToolTip(e,0,0,o)}}function getAlarmDataColor(){null!=window.socket&&""!=window.socket&&socket.alarmPost("/alarm/GetTagState",varList,function(e){if(e&&e.success){var t=e.data;alarmColorData={};for(var a=0;ai&&(t-=l),a+s>r&&(a-=s),n.width("auto"),n.height("auto"),n.css({position:"absolute",top:a,left:t}),$("body").append(n),e.tip=n}}function destoryDomToolTip(){$(".tooltip").remove()}function canvasTextAutoLine(e,t,a,o,n,i,r,l,s,c,d){d.fillStyle=l,d.font=s,d.textAlign=r;var u=d;"number"==typeof e&&(e=e.toString()),"center"==r&&(t+=.5*o),"right"==r&&(t+=o);var h=u.measureText(e).width;a=(n-(Math.floor(h/o)+c-1)*i)/2;u.textBaseLine="top";var g=u.measureText("口").width,f=Math.floor(o/g),p=Math.ceil(e.length/f)*i;a=p>n?0:.5*(n-p),u.wrapFillText(e,t,a+i,o,i),d.closePath()}function drawRoundRect(e,t,a,o,n,i,r,l,s){var c=t,d=a,u=o,h=n;i<=0&&(i=1),r<=0&&(r=1),r*=2,(i*=2)>u&&(i=u),r>h&&(r=h),e.beginPath(),e.strokeStyle=l,e.lineWidth=s||1,e.ellipse(c+.5*i,d+.5*r,.5*i,.5*r,0,Math.PI,1.5*Math.PI),e.lineTo(c+u-.5*i,d),e.ellipse(c+u-.5*i,d+.5*r,.5*i,.5*r,0,1.5*Math.PI,2*Math.PI),e.lineTo(c+u,d+h-.5*r),e.ellipse(c+u-.5*i,d+h-.5*r,.5*i,.5*r,0,0,.5*Math.PI),e.lineTo(c+.5*i,d+h),e.ellipse(c+.5*i,d+h-.5*r,.5*i,.5*r,0,.5*Math.PI,Math.PI),e.closePath(),e.stroke()}function drawRect(e,t,a,o,n,i){e.beginPath(),e.moveTo(t,a),e.lineTo(o,a),e.lineTo(o,n),e.lineTo(t,n),e.closePath(),i&&(e.strokeStyle=i,e.stroke())}function getArrMatch(e,t){if(!(e.length<=0))for(var a=0;a0)return e[a]}function setSnapshotValue(e){for(var t=e._datas._as,a=0;a0){var t=(e=parseInt(e,10)).toString(16);t.length<6&&(t+="00")}return"#"+t}function exportInterExcel(e,t,a,o,n){n||(n="");var i="beginTime="+e;i+="&endTime="+t,i+="&interval="+a,i+="&tagName="+encodeURIComponent(n),i+="&valueType="+o;var r=document.createElement("a");r.download="exportExcel",r.href="http://"+webServiceIP+":"+webServicePort+"/api/ExportToExcelInterpo?"+encodeURI(i),r.click()}function getPercentValue(e,t,a){return jQuery.isNumeric(Number(e))&&jQuery.isNumeric(Number(t))&&jQuery.isNumeric(Number(a))?(Number(e)-Number(t))/(Number(a)-Number(t))*100:0}function resizeAllNodes(e,t,a){t&&a&&(e.each(function(e){resizeOneNodes(e,t,a)}),e===dataModel&&_libModel.each(function(e){resizeOneNodes(e,t,a)}))}function resizeOneNodes(e,t,a,o){var n,i,r,l,s,c,d,u,h,g;(!1!==e.scalable&&!e.__parentLib&&!e.__blockChild||o)&&(t=t||graphView.ratioX,a=a||graphView.ratioY,g=e&&"function"==typeof e.getRotation?180*e.getRotation()/Math.PI:0,h=GD.getRatioWithRotation(g*Math.PI/180,t,a),e._zoomBy?"False"===e._zoomBy||"false"===e._zoomBy?(d=1,u=1):"Default"===e._zoomBy?(d=h.ratioX,u=h.ratioY):"X"===e._zoomBy?(d=h.ratioX,u=h.ratioX):"Y"===e._zoomBy&&(d=h.ratioY,u=h.ratioY):(d=h.ratioX,u=h.ratioY),n=e.getWidth(),i=e.getHeight(),r=(s=e.getPosition()).x+5,l=s.y+5,e.originWidth=e.originWidth||n,e.originHeight=e.originHeight||i,e.originPosition=e.originPosition||s,n*=d,i*=u,e.isEqualRatio&&(e.lastWidth=e.lastWidth||e.originWidth,e.lastHeight=e.lastHeight||e.originHeight,e.lastWidth*=d,e.lastHeight*=u,i=n=e.lastWidth>e.lastHeight?e.lastHeight:e.lastWidth),e.setWidth(n),e.setHeight(i),e.setPosition(r*t,l*a),e.originPositionAndSize&&((c=e.originPositionAndSize).x*=t,c.y*=a,c.w*=d,c.h*=u))}function drawEllipse(e,t,a,o,n){var i=o/2*.5522848,r=n/2*.5522848,l=t+o,s=a+n,c=t+o/2,d=a+n/2;e.beginPath(),e.moveTo(t,d),e.bezierCurveTo(t,d-r,c-i,a,c,a),e.bezierCurveTo(c+i,a,l,d-r,l,d),e.bezierCurveTo(l,d+r,c+i,s,c,s),e.bezierCurveTo(c-i,s,t,d+r,t,d),e.closePath()}function showPage(){graphView.tx(0),graphView.ty(0),graphView.setZoom(1),document.body.appendChild(view),setTimeout(function(){window.refreshAlarmInfoWindow&&refreshAlarmInfoWindow()},500)}function batchOpertation(e,t,a,o,n,i){if(!(e.length<=0)){var r=e.split(";");if(!(r.length<=0)){for(var l=[],i=i||0,s=0;s=0?getAuthInfoByGroupId(i,function(e){e&&submitBatch(l,n)}):(isAuthEnable,submitBatch(l,n))}}}function submitBatch(e,t){if(t=t||"",isdowncontrol()){var a=JSON.stringify(e);$.ajax({url:"http://"+webServiceIP+":"+webServicePort+"/api/Snapshot/",type:"POST",data:a,contentType:"application/json; charset=utf-8",success:function(a){if("string"==typeof a&&a.constructor==String)"True"!==a&&GD.createErrorDialog(360,160,a);else{var o=a.ErrorList;null!=o&&o.length>0?GD.createErrorDialog(360,160,o[0].ErrorMsg):function(){var a,o,n,i,r;n=GD.getParams("userGroup")||0;for(var l=0,s=e.length;l10项"),n.$dialogTitle=l.find("span>strong");var h=$("");return h.click(function(e){e.stopPropagation(),"—"===h.text()?(l.siblings().css("display","none"),h.text("+"),r.css({top:d+c-u,height:"auto"})):(r.css({top:d,height:c}),l.siblings().css("display",""),h.text("—"))}),l.find(".dialog-title-controls").html(h),setTimeout(function(){r.css("opacity",.3),r.off("mouseenter").on("mouseenter",function(e){e.stopPropagation(),r.css("opacity",1)}).off("mouseleave").on("mouseleave",function(e){e.stopPropagation(),r.css("opacity",.3)})},3e3),a&&setInterval(function(){var e=s?o.paneTitleChangeBackColor:o.paneTitleBackColor;l.css("backgroundColor",e),r.css("backgroundColor",e),s=!s},1e3),n}function createDialogAlarm(e,t,a,o,n){var i;(i=void 0===e?new ht.widget.Dialog:e).setConfig(t);var r=$(i.getView()).find(".dialog-container"),l=r.find(".dialog-container-title"),s=!1,c=r.height(),d=parseInt(r.css("top")),u=l.height()||28,h=parseInt(o.paneBtnWidth)||50,g=parseInt(o.paneBtnHeight)||26,f=r.find(".dialog-container-buttons");f.css("padding-bottom","10px"),f.css("padding-right",h/2+"px");var p=f.find(".dialog-button"),m=$("
");m.css({position:"absolute",width:h,height:g,lineHeight:g+"px",backgroundColor:o.paneBtnBackColor,textAlign:"center",fontSize:o.paneBtnFontSize+"px",color:o.paneBtnFontColor,fontFamily:o.paneBtnFontFamily,cursor:"pointer"}),m.text("确 认"),p.prepend(m).find("canvas").css({visibility:"hidden"}),r.css({zIndex:99,top:"",left:"",right:"5px",bottom:"28px"}),l.find("span").html(n),l.find("span").css("color",o.paneTitleFontColor),l.find("span").css("font",o.paneTitleFontSize+"px "+o.paneTitleFontFamily),i.$dialogTitle=l.find("span>strong");var v=$("");return v.click(function(e){e.stopPropagation(),"—"===v.text()?(l.siblings().css("display","none"),v.text("+"),r.css({top:d+c-u,height:"auto"})):(r.css({top:d,height:c}),l.siblings().css("display",""),v.text("—"))}),l.find(".dialog-title-controls").html(v),setTimeout(function(){r.css("opacity",.78),r.off("mouseenter").on("mouseenter",function(e){e.stopPropagation(),r.css("opacity",1)}).off("mouseleave").on("mouseleave",function(e){e.stopPropagation(),r.css("opacity",.78)})},3e3),a&&setInterval(function(){var e=s?o.paneTitleChangeBackColor:o.paneTitleBackColor;l.css("backgroundColor",e),r.css("backgroundColor",e),s=!s},1e3),i}function loadScript(e,t){t=t||function(){};var a=document.createElement("script");a.type="text/javascript",a.readyState?a.onreadystatechange=function(){"loaded"!=a.readyState&&"complete"!=a.readyState||(a.onreadystatechange=null,t())}:(a.onload=function(){t()},a.onerror=function(e){GD.createErrorDialog(420,160,"页面不存在或路径设置有误,请查正后重新发布!")}),a.src=e,document.body.appendChild(a)}function loadScripts(e,t){t=t||function(){};var a=function(e,a){var o=document.createElement("script");o.type="text/javascript",o.src=e,o.onload=function(){o.onload=null,o.onerror=null,a()},o.onerror=function(){o.onload=null,o.onerror=null,t({message:e+"依赖未加载成功!"})},(document.getElementsByTagName("head")[0]||document.body).appendChild(o)};!function o(){e.length>0?a(e.shift(),o):t()}()}function clearDataModel(e){if(e.getHtml&&"function"==typeof e.getHtml){var t=e.getHtml();if(t._chart&&"function"==typeof t._chart.setOption&&(t._chart.setOption({},!0),t._chart.clear&&t._chart.clear(),t._chart=null),"function"==typeof t.getDataModel){var a=t.getDataModel();a.each(clearDataModel),a.clear()}}e.setHtml&&"function"==typeof e.setHtml&&e.setHtml(document.createElement("div")),e.__parent&&(e.__parent.childNodes&&(e.__parent.childNodes.length=0),e.__parentLib=null,e.__parent=null),e.localDynamicVar=null,e.hasOwnProperty("setImage")&&e.setImage(null),e._attrObj=null,e.setWidth=null,e.setHeight=null,e.refresh&&(e.refresh=null),e.refreshText&&(e.refreshText=null),e.setOption&&(e.setOption=null),e._initSize&&(e._initSize=null)}function destoryScript(){for(var e=0,t=intervalTimers.length;e'),h.push('   '),h.push(''),h.push('
x1'),h.push(''),h.push(''),h.push(''),h.push(''),h.push(""),u=$(h.join(""))[0],dialog.setConfig({title:"历史回放",closable:!0,draggable:!0,width:530,height:100,contentPadding:5,titleBackground:"#8DB6CD",content:u,buttons:[],buttonsAlign:"right"}),dialog.setModal(!1),dialog.show(),$("#palyTime").click(function(){if("播放"==$("#palyTime").val()){g=$("#beginDate").val().replace("T"," ");var e=$("#endDate").val().replace("T"," "),a=new Date(g).getTime(),o=new Date(e).getTime();0==t&&(clearInterval(intervalTimers[0]),intervalTimers.shift(intervalTimers[0]),t++),$("#palyTime").val("暂停");var n=setInterval(function(){if(a>o)clearInterval(f[0]),f.shift(f[0]),$("#palyTime").val("播放");else{if($("#showTime").val(moment(g).format("YYYY/MM/DD h:mm:ss")),varList.length<=0)return;for(var e="",t={},n="GET",i="http://"+webServiceIP+":"+webServicePort+"/api/History?tagName=",r=0;r2e3&&(para=encodeURIComponent(e),i="http://"+webServiceIP+":"+webServicePort+"/api/History",t={tagname:e,time:g},n="POST"),$.ajax({url:i,type:n,dataType:"json",data:t,cache:!1,success:function(e){if(null!==e){var t=e;if(null!=t)for(var o in t)moment(g).format("YYYY-MM-DD h:mm:ss")==moment(t[o].Time).format("YYYY-MM-DD h:mm:ss")&&(parseFloat(t[o].Value).toString()==t[o].Value?(varListObj[o.toLowerCase()]=parseFloat(t[o].Value),VarSnapshotTime[o.toLowerCase()]=t[o].Time):(varListObj[o.toLowerCase()]=t[o].Value,VarSnapshotTime[o.toLowerCase()]=t[o].Time));g=getDateString(new Date(a+1e3*d)),a=new Date(g).getTime()}}})}},1e3);f.push(n)}else clearInterval(f[0]),f.shift(f[0]),$("#palyTime").val("播放")}),$("#addSpeed").click(function(){d>=128?d=128:d*=2,$("#nowspeed").html(d)}),$("#slowSpeed").click(function(){d<=1?d=1:d/=2,$("#nowspeed").html(d)}),$("#closeBtn").click(function(){clearInterval(f[0]),f.shift(f[0]),intervalTimers.unshift(setInterval(e,1e3)),dialog.hide()})}function savehtmlToJpg(){html2canvas(document.getElementsByClassName("main")[0]).then(function(e){document.body.appendChild(e)});var e=document.createElement("canvas");let t=document.getElementsByClassName("main")[0];var a=parseInt(window.getComputedStyle(t).width),o=parseInt(window.getComputedStyle(t).height);e.width=2*a,e.height=2*o,e.style.width=a+"px",e.style.height=o+"px",e.getContext("2d").scale(2,2),html2canvas(document.getElementsByClassName("main")[0],{canvas:e}).then(function(e){document.body.appendChild(e);var t=document.createElement("a"),a=base64Img2Blob(e.toDataURL("image/png")),o=document.createEvent("HTMLEvents");o.initEvent("click",!1,!1),t.download="下载图片.png",t.href=URL.createObjectURL(a),t.dispatchEvent(o),t.click()})}function base64Img2Blob(e){for(var t=e.split(";base64,"),a=t[0].split(":")[1],o=window.atob(t[1]),n=o.length,i=new Uint8Array(n),r=0;r0){for(d=t[0],e.moveTo(d.x,d.y),u=1;ut?t:e1&&(t=1),t<0&&(t=0);var s=e.getWidth(),c=e.getHeight(),d=0,u=0,h=[0,0,0,0],g=[0,0,0,0];"fromBottomToTop"===r?(h=[0,d=c*(1-t),s,u=c*t],g=[0,0,s,d]):"fromLeftToRight"===r?(h=[0,0,u=s*t,c],g=[u,0,d=s*(1-t),c]):"fromTopToBottom"===r?(h=[0,0,s,u=c*t],g=[0,u,s,d=c*(1-t)]):"fromRightToLeft"===r&&(h=[d=s*(1-t),0,u=s*t,c],g=[0,0,d,c]),null!=e.a("node.original")&&e.a("node.original",g),null!=e.a("node.fillrect")&&e.a("node.fillrect",h),"NoFill"==o?(e.a("node.fillbackcolor",""),e.a("node.fillgradient",""),e.a("node.fillgradientcolor","")):e.a("node.fillgradient",o),e.a("node.fillbackcolor",n),e.a("node.fillgradientcolor",i)},GraphPaneContainer=function(e,t,a,o,n,i){this._graphView=new ht.graph.GraphView(e);this._view=this._graphView.getView();var r=this._view.style;r.width=o+"px",r.height=n+"px",this.invalidate()};ht.Default.def(GraphPaneContainer,Object,{getView:function(){return this._view},getGraphView:function(){return this._graphView},invalidate:function(){},validate:function(){}}),function(e,t){t&&(t.HtNodeOverlay=function(e){this._htNode=e},t.HtNodeOverlay.prototype=new t.Overlay,t.HtNodeOverlay.prototype.initialize=function(e){var t,a,o,n,i,r,l,s;return t=e.getPanes().markerPane,this._map=e,s=this,a=new ht.DataModel,o=new ht.graph.GraphView(a),i=o.getView(),n=this._htNode,this._graphView=o,this._dataModel=a,this._view=i,r=n.getWidth(),l=n.getHeight(),n.setPosition(r/2+1,l/2+1),i.style.width=r+2+"px",i.style.height=l+2+"px",i.style.postion="absolute",i.style.overflow="visible",o.setEditable=function(e){this.setInteractors([])},o.setEditable(!1),t.appendChild(i),a.add(n),setTimeout(function(){s.resetPosition()},200),i},t.HtNodeOverlay.prototype.draw=function(){this.resetPosition()},t.HtNodeOverlay.prototype.resetPosition=function(){var e=this._htNode,t=this._map.pointToOverlayPixel(e.lonLat),a=e.getWidth(),o=e.getHeight(),n=(this._graphView,this._view);n.style.left=t.x-a/2+"px",n.style.top=t.y-o/2+"px"},t.HtNodeOverlay.prototype.show=function(){this._view.style.display=""},t.HtNodeOverlay.prototype.hide=function(){this._view.style.display="none"})}(window,window.BMap),void 0==CanvasRenderingContext2D.prototype.ellipse&&(CanvasRenderingContext2D.prototype.ellipse=function(e,t,a,o,n,i,r,l){this.save(),this.translate(e,t),this.rotate(n),this.scale(a,o),this.arc(0,0,1,i,r,l),this.restore()}),CanvasRenderingContext2D.prototype.wrapFillText||(CanvasRenderingContext2D.prototype.wrapFillText=function(e,t,a,o,n){var i=this,r=this.font,l=(ht&&ht.Default&&ht.Default.getTextSize||function(e,t){return{width:i.measureText(t).width+20,height:i.measureText("口").width+4}})(r,e)||{};if(l.widtho&&(u.length<=1&&(s=c),i.fillText(s,t,a+h*n),u=u.substr(s.length),len=0,h++);u.length&&i.fillText(u,t,a+h*n)}}),function(e,t,a){a&&(a.widget=a.widget||{},a.widget.FrozenTable=function(e){e=e||new a.DataModel,this._borderPane=new a.widget.BorderPane,this._frozenTablePane=new a.widget.TablePane(e),this._normalTablePane=new a.widget.TablePane(e),this._frozenTableHeader=this._frozenTablePane.getTableHeader(),this._frozenTableView=this._frozenTablePane.getTableView(),this._normalTableHeader=this._normalTablePane.getTableHeader(),this._normalTableView=this._normalTablePane.getTableView(),this._dm=e,this._selectionModel=e.getSelectionModel(),this.init()},a.Default.def("ht.widget.FrozenTable",Object,{init:function(){var e=this.getFrozenTableView(),t=this.getNormalTableView();e.setScrollBarSize(0),this._borderPane.setLeftView(this._frozenTablePane,200),this._borderPane.setCenterView(this._normalTablePane),e.mp(function(e){"translateY"===e.property&&t.ty(e.newValue)}),t.mp(function(t){"translateY"===t.property&&e.ty(t.newValue)}),this._setColumnClickEvent(),this._setDrawColumnFunc(),this.setAutoHideScrollBar(!1)},getFrozenTableView:function(){return this._frozenTableView},getFrozenTableHeader:function(){return this._frozenTableHeader},setFrozentableScrollBarColor:function(e){this._normalTableView.setScrollBarColor(e)},getFrozentableScrollBarColor:function(){return this._normalTableView.getScrollBarColor()},setFrozentableScrollBarSize:function(e){this._normalTableView.setScrollBarSize(e)},getFrozentableScrollBarSize:function(){return this._normalTableView.getScrollBarSize()},getNormalTableView:function(){return this._normalTableView},getNormalTableHeader:function(){return this._normalTableHeader},getDataModel:function(){return this._normalTableView.getDataModel()},getSelectionModel:function(){return this._dm.getSelectionModel()},calcColumnWidthByDisplayName:function(e,t){t=t||12,t*=.5;var a=GD.getStrLength(e);return Math.ceil((a+4)*t)},addColumns:function(e){function t(e,t){return e.sortId>t.sortId?1:e.sortId0){for(var y=0,C=b.length;y=sk.min&&"max"===sk.max){w=sk;break}if(pt>=sk.min&&ptn.getWidth()&&(n.setWidth(T),this.resetLeftPaneWidth()),a.Default.drawText(e,p,v,m,i,r,l,s,"center")},refresh:function(e){var t,a=this.getFrozenTableView(),o=this.getNormalTableView(),n=a.getColumnModel(),i=o.getColumnModel();e&&e.each(function(e){(t=n.getDataByTag(e.a("name"))||i.getDataByTag(e.a("name"))).setVisible(e.a("visible"))}),a.redraw(),o.redraw()},redraw:function(){var e=this.getFrozenTableView(),t=this.getNormalTableView();e.redraw(),t.redraw()},addRowData:function(){var e=this.getCustomDM("columnDM"),t=this.getCustomDM("rowDM"),o=this.getDataModel();t.each(function(t){var n=t.a("name"),i=t.a("displayName"),r=new a.Data;e.each(function(e){var t=e.a("name"),a=""+n+t;r.a(t,getVarValue(a)),"device"===t&&r.a(t,i)}),r.setName(n),r.setTag(n),r.a("displayName",i),r.a("visible",t.a("visible")),r.a("name",n),o.add(r)})},refreshRowData:function(){var e,t;this.getDataModel().each(function(a){e=a.getAttrObject(),t=a.getName();for(var o in e)if(e.hasOwnProperty(o)){if("visible"===o||"device"===o||"displayName"===o||"name"===o)continue;a.a(o,getVarValue(t+o))}}),this.getFrozenTableView().invalidateModel(),this.getNormalTableView().invalidateModel()},refreshStyleRowData:function(e){var t,a,o=e;this.getDataModel().each(function(e){t=e.getAttrObject(),a=e.getName();for(var n=0;nn&&(r=i[l]);return this._dm.remove(r),r},_copyDM2DataModel:function(e,t){e&&((t=t||this.getDataModel()).clear(),t.deserialize(e.serialize()))},_setColumnClickEvent:function(){function e(e,a){var o=e.getName()||e.a("name")||e.getDisplayName()||e.a("displayName")||"",n=e.getSortOrder()||"asc";t.sort(o,n),t._clearColumnIcon(),"asc"===n?e.setSortOrder("desc"):"desc"===n?e.setSortOrder("default"):"default"===n&&e.setSortOrder("asc"),e._isCustomSortColumn=!0}var t=this;this.onColumnClicked=e,this._frozenTableView.onColumnClicked=e,this._normalTableView.onColumnClicked=e},_clearColumnIcon:function(){var e=this._frozenTableView.getColumnModel(),t=this._normalTableView.getColumnModel();e.each(function(e){e._isCustomSortColumn=!1,e.setSortOrder("asc")}),t.each(function(e){e._isCustomSortColumn=!1,e.setSortOrder("asc")})},_setDrawColumnFunc:function(e){var t=this;e=e||function(e,o,n,i,r,l){var s,c=o.getDisplayName()||o.a("displayName")||o.getName(),d=o.getColor()||o.a("color")||"black",u=t.getHeaderLabelFont()||null;if(o===t._frozenTableView.getCheckColumn())return s="uncheck"===t._frozenTableHeader._checkIcon?t._unSelData:t._selData,void a.Default.drawImage(e,s,n+.5*(r-s.width),i+.5*(l-s.height),s.width,s.height,o,t._normalTableView);a.Default.drawText(e,c,u,d,n,i,r,l,"center"),t._selectAllBtn&&t._selectAllBtn.setLabelFont(t.getHeaderLabelFont()),t._selectInvertBtn&&t._selectInvertBtn.setLabelFont(t.getHeaderLabelFont());var h;switch(o.hasOwnProperty("_sortOrder")?o._sortOrder:""){case"desc":h=t._normalTableHeader.getSortAscIcon();break;case"default":h=t._normalTableHeader.getSortDescIcon();break;case"asc":default:h=null}o._isCustomSortColumn||(h=null),a.Default.drawImage(e,h,n+r-14,i+.5*(l-16),16,16,o,t._normalTableView)},this._frozenTableHeader.drawColumn=e,this._normalTableHeader.drawColumn=e},validate:function(){this._frozenTableView.validate(),this._normalTableView.validate()}}))}(window,jQuery,ht),function(e,t,a){a&&(e.pageContainerFactory=function(e,o,n,i,r,l){var s,c=new a.HtmlNode;return s=t(''),c.setScalable(!1),c.setPadding(0),c.setHtml(s[0]),c.setWidth(n),c.setHeight(i),c.setPosition(e,o),c.setRotation(r*Math.PI/180),c.s({"2d.selectable":!0,"2d.movable":!1}),c.__clickable=!1,c.changeSrc=function(e){e&&s.attr("src",e)},c.changeWidth=function(e){s.attr("width",e),c.setWidth(e)},c.changeHeight=function(e){s.attr("height",e),c.setHeight(e)},c.changeAttr=function(e,t,a){this.changeSrc(e),this.changeWidth(t),this.changeHeight(a)},c.refresh=function(){s.attr("src",s.attr("src"))},c.resizeContent=function(e,t,a){s.on("load",function(){s[0].contentWindow.postMessage({action:"resizeNodes",args:{ratioX:e,ratioY:t,zoom:a}},"*")})},c})}(window,jQuery,ht),function(e,t,a){a&&t&&(e.paginationFactory=function(e,a,o){var n=t('
    ');return t.jqPaginator(n,{totalPages:e,visiblePages:a||5,currentPage:o||1,prev:'',next:'',page:'
  • {{page}}
  • ',onPageChange:function(e,t){"function"==typeof n.onPageChange&&n.onPageChange(e,t)}}),n})}(window,jQuery,ht),Object.prototype.watch||Object.defineProperty(Object.prototype,"watch",{enumerable:!1,configurable:!0,writable:!1,value:function(e,t){var a=this[e],o=a;delete this[e]&&Object.defineProperty(this,e,{get:function(){return o},set:function(n){return a=o,o=t.call(this,e,a,n)},enumerable:!0,configurable:!0})}}),Object.prototype.unwatch||Object.defineProperty(Object.prototype,"unwatch",{enumerable:!1,configurable:!0,writable:!1,value:function(e){var t=this[e];delete this[e],this[e]=t}});var getIndicatorAndSheBeiArr=function(e,t){for(var a,o={},n=[],i=[],r=[],l={},s=[],c=0;c100)return _exchangeCount=0,this.location.reload();loadPage()};var LibModel=function(){this.libModelMap={},this.libModelArray=[]};LibModel.prototype={add:function(e,t){return t._baseClass&&t._baseClass.match("ht.lib.")&&(this.libModelMap[e]=t,this.libModelArray.push(t)),this},clear:function(){for(var e=0,t=this.libModelArray.length;ea&&py+h2>o&&py-h2100)},GD.getFreeVisitPage=function(){return window.__FVPAGE?__FVPAGE[0]:""},GD.isFreeVisitPage=function(e){return e=e||location.hash.substr(1),e=decodeURIComponent(e),!(!window.__FVPAGE||__FVPAGE[0]!==e)},GD.getParams=a,GD.useParams=function(e){var t=a(e=e||n);for(var i in t)t.hasOwnProperty(i)&&void 0!==window[i]&&(window[i]=t[i]);o(e)},GD.removeParams=o}(window,localStorage),function(e){function t(e,t){var a,o,n=Math.abs,i=Math.cos,r=Math.sin,l=Array.prototype.slice.call(arguments,0);if(2===l.length){if(!t)return{ratioX:1,ratioY:1};a=t.ratioX,o=t.ratioY}else l.length>=3&&(a=l[1],o=l[2]);if(0===e||!a||!o)return{ratioX:a,ratioY:o};e<0&&(e=e%(2*Math.PI)+2*Math.PI);var s,c,d=e%Math.PI;return s=n(i(e=d<.25*Math.PI?0:d<=.75*Math.PI?90*Math.PI/180:Math.PI)*a-r(e)*o),c=n(r(e)*a+i(e)*o),{ratioX:s,ratioY:c}}function a(e,t,n,i){if(o(),!($("div.tooltip div.tooltop").length>0)){var r=t&&t.toLowerCase&&t.toLowerCase(),l=$('
    '),s=$window.width(),c=$window.height(),d=e[r]||e[t];if(d){var u,h;u=n+300>=s-10?n-300:n+8,h=i+350>=c-10?i-350:i+8,l.css({minWidth:100,minHeight:100,maxWidth:300,maxHeight:350,top:h,left:u,position:"absolute",zIndex:99});var g=d.Desc,f=(d.LowLimit,d.HighLimit,"
      "+("
    • 标签名称:"+t+"
    • ")+("
    • 描述:"+g+"
    • ")+("
    • 单位:"+d.Unit+"
    • ")+('
    • 快照值:'+getVarValue(r)+"
    • ")+('
    • 快照时间:'+moment(VarSnapshotTime[r]).format("YYYY/MM/DD HH:mm:ss")+"
    • ")+"
    ");l.html(f),$(document.body).append(l);var p=l.outerWidth(),m=l.outerHeight();u=n+p>=s-10?n-p-8:n+8,h=i+m>=c-10?i-m-8:i+8,l.css({top:h,left:u});var v=l.find(".snapshot"),b=l.find(".snapshottime");a.timer&&clearInterval(a.timer),a.timer=setInterval(function(){v.text(getVarValue(r)),b.text(moment(VarSnapshotTime[r]).format("YYYY/MM/DD HH:mm:ss"))},1e3)}}}function o(){$("div.tag-info").remove(),a.timer&&clearInterval(a.timer)}function n(){var e=$window.innerWidth(),t=$window.innerHeight();graphView.setScrollBarVisible(!1),backSize.width*ratio.ratioX>e+1?(graphView.setScrollBarVisible(!0),graphView.adjustTranslateX=function(t){var a=e-backSize.width*ratio.ratioX;return t>0&&(t=0),tt+1?(graphView.setScrollBarVisible(!0),graphView.adjustTranslateY=function(e){var a=t-backSize.height*ratio.ratioY;return e>0&&(e=0),e'),o=e.getView();o.className="uploadbutton",e.setWidth(80),e.setBackground("rgba(0,0,0,0)"),e.setSelectBackground("rgba(0,0,0,0)"),e.setLabelColor(V),e.setLabelSelectColor(V),e.setBorderColor("rgba(0,0,0,0)"),$(o).css({overflow:"hidden",cursor:"pointer",backgroundColor:k}).off("click").on("click",function(){(t=t||function(){})()}).off("mousedown").on("mousedown",function(){$(this).css({backgroundColor:M})}).off("mouseup").on("mouseup",function(){$(this).css({backgroundColor:k})}).hover(function(){$(this).prepend(a).css({borderBottom:"1px solid "+V})},function(){a.remove(),$(this).css({border:"none"})})}function l(e){var t=$(e.getView()),a=e.getDropDownIcon();a.comps[0].borderColor=C,e.setDropDownIcon(a),t.css({borderColor:v}),e.setBackground(w),e.setLabelColor(b),e.setSelectBackground(y)}function s(e){var t=$(e.getElement());e.setBackground(_),t.css({border:"none",color:S,borderBottom:"1px solid "+D}),B===e&&t.css({textAlign:"center"}),R!==e&&A!==e||t.css({border:"none"})}function c(e){e.css({color:T,fontSize:x,fontFamily:P,fontWeight:400})}function d(e){e=e||function(){},socket.alarmPost("/alarm/GetFilesList",{},function(t){var a;t.success&&((a=t.data&&t.data.data||[]).length?(N.setValues(a),N.setValue(a[0])):R.setValue("您还没有上传过声音文件,请先上传!")),e(t.success)})}function u(e){e=e||function(){};var t={method:"GetLevels",param:{}};socket.alarmPost("/alarm/doservice?level",t,e)}function h(e,t){var a,o=e.length,n=0,i={method:"UpdateLevel"};t=t||function(){};for(var r=0;r=o&&t()})}function g(e,t){setTimeout(function(){t.setValue("")},1e3*e)}function f(){u(function(e){e.success?(J=e.data&&e.data.data||[]).length?B.setValue(J[0].duration):R.setValue("请先配置报警级别!"):J=[]})}var p=(i=i||{}).comboboxValues||[],m=i.comboboxValue||"",v=i.comboboxBorderColor||"black",b=i.comboboxFontColor||"black",w=i.comboboxBackgroundColor||"white",y=i.comboboxSelectBackgroundColor||"gray",C=i.comboboxIconColor||"gray",T=i.labelColor||"black",x=i.labelFontSize||10,P=i.labelFontFamily||"Microsoft Yahei",D=i.inputBorderColor||"black",_=i.inputBackgroundColor||"rgba(0,0,0,0)",S=i.inputFontColor||"black",V=i.buttonLabelColor||"black",k=i.buttonBackgroundColor||"rgba(0,0,0,0)",M=i.buttonSelectBackgroundColor||"rgba(0,0,0,0)",F=i.paneBackgroundColor||"rgba(0,0,0,0)",H=document.createElement("input");H.type="file",H.style.display="none",H.accept=".mp3, .wav, .ogg",document.body.appendChild(H);var I=new ht.widget.BorderPane,L=new ht.widget.FormPane,N=new ht.widget.ComboBox;N.setValues(p),N.setValue(m);var z=new ht.widget.TextField,O=new ht.widget.TextField,R=new ht.widget.TextField,A=new ht.widget.TextField,B=new ht.widget.TextField,Y=new ht.widget.Button,E=new ht.widget.Button,G=new ht.widget.Button,W=$("声音:"),j=$("支持格式: mp3,wav或其它支持的格式"),X=$("播放时长:"),U=$("S/次"),J=[];Y.setLabel("上传"),E.setLabel("删除"),G.setLabel("保存"),d(),f(),L.addRow([N,null],[.85,.15]),L.addRow([R],[1]),L.addRow([W[0],z,null,Y,E],[50,.5,.1,40,40,.22]),L.addRow([null],[1]),L.addRow([j[0],null,null,"",""],[50,.5,.1,.05,.05,.22]),L.addRow([null],[1]),L.addRow([X[0],B,U[0],null,null],[60,60,.1,.4,40,.22]),L.addRow([A],[1]),L.addRow([null],[1]),L.addRow([null,G,null],[.5,40,.5]),r(Y,function(){H.click()}),r(E,function(){var e=z.getValue();e&&confirm("您确定要删除这个声音文件吗?")&&socket.alarmPost("/alarm/deletefile",{name:e},function(e){e.success&&e.data&&e.data.data?(R.setValue("删除文件成功!"),g(3,g),d()):(R.setValue("删除文件失败,请重试!"),g(3,g))})}),r(G,function(){var e,t=B.getValue(),a=z.getValue();if(!J.length)return A.setValue("请先设置完报警级别再配置报警声音!"),void g(3,A);if(!t)return A.setValue("请设置播放时长!"),void g(3,A);if(!$.isNumeric(t))return A.setValue("播放时长只能设置为整数!"),void g(3,A);if(t<=0)return A.setValue("播放时长只能设置为大于0的整数!"),void g(3,A);if(!a)return A.setValue("请选择或上传报警声音!"),void g(3,A);for(var o=0,n=J.length;o2097152)return R.setValue("您选择的声音文件太大了,请更换声音文件!"),void g(3,R);if(-1===o.indexOf(t)||confirm("您选择的文件名在服务器已保存的文件名冲突,继续上传将会覆盖原有的文件,是否继续?")){var n=new FileReader;n.onload=function(e){var a=this.result;socket.alarmPost("/alarm/UploadFile",{data:a,name:t},function(e){e.success?e.data&&e.data.data&&(R.setValue("上传成功!"),g(3,R),d(function(e){e&&N.setValue(t)})):(R.setValue("上传是发生错误,请重新上传!"),g(3,R))},20)},n.readAsDataURL(e)}}}),I.setCenterView(L);var q=new ht.HtmlNode;return I.setWidth(e),I.setHeight(t),q.setHtml(I),q.setPosition(a,o),q.setSize(e,t),q.setPadding(0),q.setScalable(!1),q.s({"2d.selectable":!0,"2d.moveable":!1}),q.setComboboxValues=function(e){N.setValues(e)},q.setComboboxValue=function(e){N.setValue(e)},dataModel.add(q),q},l.resetNodeBorderWidth=function(e,t){for(var a,o,n,i,r,l=0,s=(e=e||zoomNodeList).length;l(c=u/a.height)?s=c:c=s),$.isNumeric(e)?(t.ratioX=t.originRatioX*e,t.ratioY=t.originRatioY*e,l.resizePage(t.ratioX*o,t.ratioY*r)):(t.ratioX=s,t.ratioY=c,t.originRatioX=s,t.originRatioY=c,l.resizePage(o*s,r*c)),i(),n(),setTimeout(function(){graphView.tx(0),graphView.ty(0),graphView.redraw()},0),l.setParams({value:e},"pageSizeRatioValue"))},l.autoToggleScrollBar=n,l.setPageToCenterOrLeftTop=i,l.resizePage=function(e,t){var a=window.innerHeight,o=window.innerWidth;e=e||o/browserSize.width,t=t||a/browserSize.height,browserSize.width=o,browserSize.height=a,$window.trigger("beforeResize"),resizeAllNodes(dataModel,e,t);for(var n=graphView&&graphView.graphViewList||[],i=0,r=n.length;i0?Math.PI:0===r&&l<0?0:r>0&&0===l?.5*Math.PI:r<0&&0===l?.5*-Math.PI:r>0&&l>0?Math.PI-c(r/l):r>0&&l<0?c(r/-l):r<0&&l<0?-1*c(r/l):r<0&&l>0?c(-r/l)-Math.PI:void 0},e.GD=l}(window),function(e){function t(e,o,n,i,r,l,s,c,d,u){var h,g=t._messageDialog||new ht.widget.Dialog,n='

    '+n+"

    ";l=l||"rgb(47, 131, 217)",c=c||"提示",s=s||[{label:"确认",className:"dialog-button-confirm"},{label:"取消",className:"dialog-button-cancel"}],g.isShowing()&&g.hide(),h=d&&u?{x:d,y:u}:"center",g.setConfig({title:c,titleAlign:"left",closable:!0,draggable:!0,position:h,width:e,height:o,content:n,contentPadding:20,buttons:s,buttonsAlign:"center",action:function(e,t){"确认"==e.label||"确定"===e.label?(i(),g.hide()):(r(),g.hide())}}),g.setModal(!1),t._messageDialog=g,a($(g.getView()),l,e,o),g.show()}function a(e,t,a,o){e.css({zIndex:100}).find(".dialog-container").css({border:"5px solid "+t,padding:0,borderRadius:5,minWidth:a,minHeight:o,boxShadow:"3px 3px 8px rgb(50,50,50)"}).find(".dialog-container-title").css({backgroundColor:t,height:30,boxShadow:"0 2px 6px rgb(50,50,50)",left:-5,top:-5,width:a,position:"absolute",padding:"0 20px 0 20px",borderRadius:5,lineHeight:"30px"}).find(".dialog-title-control").css({marginTop:2}).end().end().find(".dialog-container-buttons").css({bottom:5}).find(".dialog-button-confirm").css({background:t,marginRight:20})}var o=e.GD||{};o.getRectJSON=function(){var e={width:{value:100,func:"attr@node.width"},height:{value:100,func:"attr@node.height"},clip:function(e,t,a,o){drawRect(e,0,0,o.getWidth(),o.getHeight()),e.clip()},comps:[{type:{value:"rect",func:"attr@node.type"},rect:{value:[0,0,"",""],func:"attr@node.rect"},background:{value:"",func:"attr@node.background"},gradientColor:{value:"",func:"attr@node.gradientcolor"},gradient:{value:"",func:"attr@node.gradient"}},{type:"rect",rect:{value:[0,0,0,0],func:"attr@node.fillrect"},background:{value:"",func:"attr@node.fillbackcolor"},gradientColor:{value:"",func:"attr@node.fillgradientcolor"},gradient:{value:"",func:"attr@node.fillgradient"}},{type:{value:"rect",func:"attr@node.type"},rect:{value:[0,0,0,0],func:"attr@node.rect"},borderWidth:{value:2,func:"attr@node.borderwidth"},borderColor:{value:"",func:"attr@node.color"},borderPattern:{value:[0,0],func:"attr@node.borderPattern"}}]},t={width:{value:100,func:"attr@node.width"},height:{value:100,func:"attr@node.height"},clip:function(e,t,a,o){drawEllipse(e,0,0,o.getWidth(),o.getHeight()),e.clip()},comps:[{type:{value:"rect",func:"attr@node.type"},rect:{value:[0,0,0,0],func:"attr@node.rect"},background:{value:"",func:"attr@node.background"},gradientColor:{value:"",func:"attr@node.gradientcolor"},gradient:{value:"",func:"attr@node.gradient"},arcFrom:{value:0,func:"attr@node.arcFrom"},arcTo:{value:0,func:"attr@node.arcTo"},arcClose:{value:!1,func:"attr@node.arcClose"}},{type:"rect",rect:{value:[0,0,0,0],func:"attr@node.fillrect"},background:{value:"",func:"attr@node.fillbackcolor"},gradientColor:{value:"",func:"attr@node.fillgradientcolor"},gradient:{value:"",func:"attr@node.fillgradient"}},{type:{value:"rect",func:"attr@node.type"},rect:{value:[0,0,"",""],func:"attr@node.rect"},borderWidth:{value:2,func:"attr@node.borderwidth"},borderColor:{value:"",func:"attr@node.color"},borderPattern:{value:[0,0],func:"attr@node.borderPattern"},arcFrom:{value:0,func:"attr@node.arcFrom"},arcTo:{value:0,func:"attr@node.arcTo"},arcClose:{value:!1,func:"attr@node.arcClose"}}]},a={width:{value:100,func:"attr@node.width"},height:{value:100,func:"attr@node.height"},clip:function(e,t,a,o){},comps:[{type:{value:"rect",func:"attr@node.type"},rect:{value:[0,0,0,0],func:"attr@node.rect"},background:{value:"",func:"attr@node.background"},gradientColor:{value:"",func:"attr@node.gradientcolor"},gradient:{value:"",func:"attr@node.gradient"},arcFrom:{value:0,func:"attr@node.arcFrom"},arcTo:{value:0,func:"attr@node.arcTo"},arcClose:{value:!1,func:"attr@node.arcClose"},arcOval:{value:!0,func:"attr@node.arcOval"}},{type:"rect",rect:{value:[0,0,0,0],func:"attr@node.fillrect"},background:{value:"",func:"attr@node.fillbackcolor"},gradientColor:{value:"",func:"attr@node.fillgradientcolor"},gradient:{value:"",func:"attr@node.fillgradient"}},{type:{value:"rect",func:"attr@node.type"},rect:{value:[0,0,"",""],func:"attr@node.rect"},borderWidth:{value:2,func:"attr@node.borderwidth"},borderColor:{value:"",func:"attr@node.color"},borderPattern:{value:[0,0],func:"attr@node.borderPattern"},arcFrom:{value:0,func:"attr@node.arcFrom"},arcTo:{value:0,func:"attr@node.arcTo"},arcClose:{value:!1,func:"attr@node.arcClose"},arcOval:{value:!0,func:"attr@node.arcOval"}}]};return function(o,n,i,r,l,s){var c;return"oval"===i?c=t:"rect"===i?c=e:"arc"===i&&(c=a),c}}(),o.getTextJSON=function(){var e={width:{value:100,func:"attr@node.width"},height:{value:100,func:"attr@node.height"},comps:[{type:"rect",rect:{value:[0,0,0,0],func:"attr@node.rect"},borderWidth:{value:0,func:"attr@node.borderwidth"},borderColor:{value:"",func:"attr@node.bordercolor"},gradient:{value:"",func:"attr@node.gradient"},background:{value:"",func:"attr@node.background"},gradientColor:{value:"",func:"attr@node.gradientcolor"}},{type:"text",text:{value:"",func:"attr@node.text"},align:{value:"",func:"attr@node.textalign"},vAlign:{value:"",func:"attr@node.textvAlign"},rect:{value:[0,0,0,0],func:"attr@node.textrect"},color:{value:"",func:"attr@node.color"},font:{value:"",func:"attr@node.font"},visible:{value:!0,func:"attr@node.textvisible"}},{type:{value:function(){},func:"attr@node.textfunc"},visible:{value:!0,func:"attr@node.linefeed"}},{type:"shape",borderWidth:{value:1,func:"attr@node.underlineBorderWidth"},borderColor:{value:"",func:"attr@node.color"},points:{value:"",func:"attr@node.underlinepoints"},segments:[1,2],visible:{value:!0,func:"attr@node.underlinevisible"}}]};return function(t,a,o,n,i,r){return e}}(),o.getPolyLineJSON=function(){var e;return function(){return e=e||{width:{value:1,func:"attr@node.width"},height:{value:1,func:"attr@node.height"},comps:[{type:"shape",points:{value:[],func:"attr@node.points"},segments:{value:[],func:"attr@node.segments"},borderWidth:{value:1,func:"attr@node.borderwidth"},borderColor:{value:"rgb(0,0,0)",func:"attr@node.color"},closePath:!1,dash:!1,borderPattern:{value:getDashStyle(""),func:"attr@node.borderPattern"}},{type:"triangle",background:{value:"rgb(0,0,0)",func:"attr@node.background"},gradient:{value:"rgb(0,0,0)",func:"attr@node.gradient"},gradientColor:{value:"rgb(0,0,0)",func:"attr@node.gradientcolor"},rect:{value:[],func:"attr@node.endCompspts"},rotation:{value:0,func:"attr@node.endRotation"},offsetX:{value:0,func:"attr@node.offsetEndX"},offsetY:{value:0,func:"attr@node.offsetEndY"}},{type:"triangle",background:{value:"@backcolor@",func:"attr@node.background"},gradient:{value:"rgb(0,0,0)",func:"attr@node.gradient"},gradientColor:{value:"rgb(0,0,0)",func:"attr@node.gradientcolor"},rect:{value:[],func:"attr@node.startCompspts"},rotation:{value:0,func:"attr@node.startRotation"},offsetY:{value:0,func:"attr@node.offsetStartY"},offsetX:{value:0,func:"attr@node.offsetStartX"}}]}}}(),o.getPolyGonJSON=function(){var e;return function(){return e=e||{width:{value:10,func:"attr@node.width"},height:{value:10,func:"attr@node.height"},clip:{value:function(){},func:"attr@node.clip"},comps:[{type:{value:"rect",func:"attr@node.type"},points:{value:[],func:"attr@node.comsPoints"},segments:{value:[],func:"attr@node.segments"},closePath:{value:!0,func:"attr@node.closePath"},borderWidth:{value:1,func:"attr@node.borderwidth"},borderColor:{value:"rgb(0,0,0)",func:"attr@node.color"},background:{value:"rgb(0,0,0)",func:"attr@node.background"},gradient:{value:"",func:"attr@node.gradient"},gradientColor:{value:"rgb(0,0,0)",func:"attr@node.gradientcolor"},isFill:{value:"false",func:"attr@node.isFill"}},{type:"rect",rect:{value:[0,0,0,0],func:"attr@node.original"},background:{value:"rgb(0,0,0)",func:"attr@node.background"},gradient:{value:"",func:"attr@node.gradient"},gradientColor:{value:"rgb(0,0,0)",func:"attr@node.gradientcolor"}},{type:"rect",rect:{value:[0,0,0,0],func:"attr@node.fillrect"},background:{value:"rgb(0,0,0)",func:"attr@node.fillbackcolor"},gradient:{value:"",func:"attr@node.fillgradient"},gradientColor:{value:"rgb(0,0,0)",func:"attr@node.fillgradientcolor"}},{type:{value:"rect",func:"attr@node.type"},points:{value:[],func:"attr@node.comsPoints"},segments:{value:[],func:"attr@node.segments"},closePath:{value:!0,func:"attr@node.closePath"},borderWidth:{value:1,func:"attr@node.borderwidth"},borderColor:{value:"rgb(0,0,0)",func:"attr@node.color"},borderJoin:"miter",borderPattern:{value:"",func:"attr@node.borderPattern"}}]}}}(),o.getBowJSON=function(){var e;return function(){return e=e||{width:{value:10,func:"attr@node.width"},height:{value:10,func:"attr@node.height"},comps:[{type:"arc",rect:{value:[0,0,100,100],func:"attr@node.rect"},arcFrom:{value:0,func:"attr@node.arcFrom"},arcTo:{value:0,func:"attr@node.arcTo"},arcClose:!1,arcOval:!0,borderWidth:{value:1,func:"attr@node.borderwidth"},borderColor:{value:"rgb(0,0,0)",func:"attr@node.color"},background:{value:"rgb(0,0,0)",func:"attr@node.background"},dash:!1,gradient:{value:"",func:"attr@node.gradient"},gradientColor:{value:"rgb(0,0,0)",func:"attr@node.gradientcolor"},borderPattern:{value:"",func:"attr@node.borderPattern"}},{type:"shape",borderWidth:{value:1,func:"attr@node.borderwidth"},borderColor:{value:"rgb(0,0,0)",func:"attr@node.borderColor"},points:{value:[],func:"attr@node.points"},borderPattern:{value:getDashStyle("@borderPattern@"),func:"attr@node.borderPattern"},segments:[1,2]}]}}}(),function(e){var t={};o.createAlarmWindow=function(e){function a(e,t,a,o){return'
  • '+a+"
  • "}function o(e,t,a){var o=[];return o.push('
  • '),o.push('
      '),o.push('
    • 设备编号:

      '+a.alarmAreaName+"

    • "),o.push('
    • 故障名称:

      '+a.alarmDesc+"

    • "),o.push('
    • '),o.push("故障时间:"),o.push("

      "),o.push(''+a.alarmTime.split(" ")[0]+""),o.push(''+a.alarmTime.split(" ")[1]+""),o.push("

  • "),o.join("")}function n(e){if(e){var n,i=t._$dom||$(t._dom),r=i.find(".alarm-window-tab-title-container"),l=i.find(".alarm-window-body-content-container"),s=t._$count||i.find(".alarm-count"),c=0;t.alarmData=e,r.children().remove(),l.children().remove();for(var d in e)if("count"!==d&&e.hasOwnProperty(d)){if(!(n=e[d]))continue;r.append($(a(c,!!n.isCurrent,n.systemName,d))),l.append($(o(c,!!n.isCurrent,n))),n.isCurrent&&(t.currentData=n),c++}s.text(e.count||0)}}function i(){var e=t._$dom||$(t._dom);t._isHide=!0,e.stop().hide()}return e=e||function(){},t._dom=t._dom||function(){var e=[];return e.push('
    '),e.push('
    '),e.push('

    待确认故障3

    '),e.push('
    -
    '),e.push("
    "),e.push('
    '),e.push('
    '),e.push('
      '),e.push("
    "),e.push("
    "),e.push('
    '),e.push('
    '),e.push('
      '),e.push("
    "),e.push("
    "),e.push('
    '),e.push('
    确认
    '),e.push("
    "),$(e.join(""))[0]}(),t.refreshData=function(e){e&&e.count?(n(e),t.isHide()&&t.alarmWindowShow()):t.alarmWindowHide()},t.alarmWindowMinify=function(){var e=t._$dom||$(t._dom);e.addClass("alarm-window-minify"),e.css({left:"auto",top:"auto"})},t.alarmWindowReduction=function(){(t._$dom||$(t._dom)).removeClass("alarm-window-minify")},t.alarmWindowDragable=function(e){if(e){var a,o,n=t._$dom||$(t._dom),i=n.find(".alarm-window-head"),r=i.find("h3"),l=$(document.body),s=$(window),c=function(e){var t=e.clientX,i=e.clientY,r=t-a,l=i-o,c=s.width(),d=s.height(),u=c-n.width(),h=d-n.height();r=r<=0?0:r,l=l<=0?0:l,r=r>=u?u:r,l=l>=h?h:l,n.css({left:r,top:l})};r.on("mousedown",function(e){e.stopPropagation()}),i.on("mousedown",function(e){e.stopPropagation(),a=e.offsetX,o=e.offsetY,l.on("mousemove",c)}),l.on("mouseup",function(e){l.off("mousemove",c)}).on("mouseleave",function(){l.off("mousemove",c)})}},t.alarmWindowShow=function(){var e=t._$dom||$(t._dom);t._isHide=!1,e.stop().show()},t.alarmWindowHide=i,t.addEventToDom=function(a){var o=$(a),n=o.find(".alarm-window-body-tab"),i=o.find(".alarm-window-body-content"),r=n.find("li"),l=i.find("li"),s=o.find(".alarm-window-confirmbtn"),c=o.find(".alarm-window-head-btns-toggle");r.off("click").on("click",function(){var e=$(this),a="."+e.data("target"),o=e.data("index");r.removeClass("current"),e.addClass("current"),l.removeClass("current").parent().find(a).addClass("current"),t.currentData=t.alarmData&&t.alarmData[o]}),c.off("click").on("click",function(){"max"===c.data("state")?(c.text("+"),c.data("state","min"),t.alarmWindowMinify()):(c.text("-"),c.data("state","max"),t.alarmWindowReduction())}).off("mousedown").on("mousedown",function(e){e.stopPropagation()}),s.off("click").on("click",function(){e()}),o.off("mouseenter").on("mouseenter",function(e){e.stopPropagation(),t.isHide()||o.stop().fadeTo(300,1)}).off("mouseleave").on("mouseleave",function(e){e.stopPropagation(),t.isHide()||o.stop().fadeTo(1e3,.3)})},t.isHide=function(){return t._isHide},t.delayFade=function(e){var a=t._$dom||$(t._dom);setTimeout(function(){t.isHide()||a.stop().fadeTo(500,.3)},e)},t.setFlagShaly=function(){var e=(t._$dom||$(t._dom)).find(".alarm-window-body-flag");t._timer&&clearInterval(t._timer),t._timer=setInterval(function(){"flag1"===e.data("flag")?(e.data("flag","flag2"),e.css({backgroundPosition:"right center"})):(e.data("flag","flag1"),e.css({backgroundPosition:"left center"}))},500)},t.delayFade(3e3),i(),t}}(),o.testSearchTime=function(e,t){return e&&t?!(+new Date(e)>=+new Date(t)&&(o.createErrorDialog(360,240,"开始时间应小于结束时间!"),1)):(o.createErrorDialog(360,240,"请先选择查询时间段!"),!1)},o.createPagenation=function(){new ht.widget.Tollbar,pageinputHis,width},o.setFrozentableStyle=function(e,t){var a=t.rowHeight||20,o=t.rowLineVisible,n=t.columnLineVisible,i=t.isRowAlter,r=t.rowAlterColor||"rgba(0,0,0,0)",l=t.selectedRowColor||"rgba(0,0,0,0)",s=t.backColor||"rgb(255,255,255)",c=t.headColor||"rgb(125, 125, 125)",d=t.headGradientColor||"rgb(125, 125, 125)",u=t.fontColor||"black",h=t.fontSize||12,g=t.fontFamily||'"Microsoft YaHei"',f=t.headerFontSize||14,p=t.headerFontFamily||'"Microsoft Yahei"',m=t.headerFontStyle||"normal",v=t.headerHeight||26,b=t.headerBackImage,w=t.bodyFontStyle||"normal",y=t.scrollBarColor||"rgba(100, 100, 100, 0.3)",C=t.lineColor;if(e.setRowHeight(a),e.setRowLineVisible(o),e.setColumnLineVisible(n),e.drawRowBackground("rgba(0,0,0,0)",i,r,l),e.setBackground(s),e.setHeaderGradientColor(c,d),e.getLabelColor(u),e.getLabelFont(h,g),e.setBodyLabelFont(h,g,w),e.setHeaderLabelFont(f,p,m),e.setHeaderHeight(v),e.setRowLineColor(C),e.setColumnLineColor(C),e.setFrozentableScrollBarColor(y),b){var T=$("
    ");T.css({height:v,left:0,right:0,top:0,position:"absolute",backgroundImage:"url("+PAGEROOTDIR+b+")",backgroundSize:"100% 100%",backgroundRepeat:"no-repeat",backgroundPosition:"center center"}),$(e.getBorderPane().getView()).css({overflow:"visible"}).prepend(T)}},o.setupDatePicker=function(e,t){var a,o=$(e);o.on("click",function(e){o.focus()}).on("keyup",function(e){t.hint(o.val()),13===e.keyCode&&(a=o.val(),$("span.laydate-btns-clear").trigger("click"),t.config.value=a,o.val(a),o.blur(),t._instance&&t._instance.checkDate())}).on("blur",function(e){o.val(a)}).on("focus",function(e){a=o.val()})},o.setDialogStyle=a,o.createMessageDialog=t,o.createErrorDialog=function(e,a,o,n,i){t(e,a,o,n=n||function(){},i=i||function(){},"rgb(207,145,38)",[{label:"确定",className:"dialog-button-confirm"}])},o.createButton=function(e,t,a,n,i,r){var l=new ht.HtmlNode,s=$(''),c=r.text||"Text",d=!!r.visible,u=r.backColor||"rgba(220,220,220,1)",h=r.fontSize||12,g=r.fontFamily||'"Microsoft YaHei"',f=r.fontColor||"rgba(255, 255, 255, 1)",p=r.textAlign||"center",m=r.borderRaidus||"2px",v=r.borderColor||"#ccc",b=r.shadowColor||"#333",w=r.hoverShadowColor||"#eee",y=!!r.bold,C=!!r.italic,T=(r.underline,r.deleteline,r.icon),x=r.backImage,P=(r.clickFunc,h*ratio.ratioY+"px "+g),D=$('
    ');o.getRatioWithRotation(i,ratio);y&&(P="bold "+P),C&&(P="italic "+P);l.setWidth,l.setHeight;var _=new ht.widget.Button;return _.setLabel(c),_.setBackground("rgba(0,0,0,0)"),_.setSelectBackground("rgba(0,0,0,0)"),_.setBorderColor("rgba(0,0,0,0)"),_.setLabelFont(P),_.setLabelColor(f),T&&_.setIcon(PAGEROOTDIR+T),s=$(_.getView()),x?(x.match(/^http:|^https:/)||(x=PAGEROOTDIR+x),s.css({backgroundImage:"url("+x+")",backgroundPosition:"center center",backgroundRepeat:"no-repeat",backgroundSize:"100% 100%"})):s.css({background:u}),l._$btnView=s,l.setHtml(_),l.setScalable(!1),l.setPadding(0),l.setWidth(e),l.setHeight(t),l.setPosition(a,n),l.setRotation(i),l._btn=_,l.s({"2d.selectable":!1,"2d.movable":!1,"2d.visible":d}),l.setLabelColor=function(e){this._$btnView.css({color:e})},l.setLabel=function(e){this._btn.setLabel(e)},l.setLabelFont=function(e){this._btn.setLabelFont(e)},l.getLabelFont=function(){return this._btn.getLabelFont()},l.setBackground=function(e){this._$btnView.css({backgroundColor:e})},l.addEvent=function(e,t){s=l._$btnView,t="function"==typeof t?t:function(){},s.on(e,function(e){t.call(l,e)})},function(e,t,a,o){e.css({borderRadius:m,overflow:"hidden",padding:0,margin:0,textAlign:p,cursor:"pointer",borderColor:v,boxShadow:"0 0 5px "+b}).hover(function(){e.append(t).css({boxShadow:"0 0 5px "+w})},function(){t.remove(),e.css({boxShadow:"0 0 5px "+b})}).on("mousedown",function(){e.parent().css({padding:"1px 0 0 1px"})}).on("mouseup",function(){e.parent().css({padding:0})}).find("canvas").css({top:0,left:0}),r.clickFunc&&a.addEvent("click",r.clickFunc);var n=a.setHeight;a.setHeight=function(e){var t=h*ratio.ratioY+"px "+g;y&&(t="bold "+t),C&&(t="italic "+t),_.setLabelFont(t),n.call(a,e)}}(s,D,l),dataModel.add(l),l},e.GD=o}(window),function(e){var t=e.GD||{};t.getHisTrendData=function(e,t){var a,o=e.split("&");str="http://"+webServiceIP+":"+webServicePort+"/api/HistoryInterval?tagName=",str=str+encodeURIComponent(o[0])+"&"+o[1]+"&"+o[2]+"&"+o[3]+"&"+o[4],$.ajax({url:str,type:"GET",dataType:"json",cache:!1,success:function(e){a=e},complete:function(e,o){t(a)},error:function(e){a=null}})},e.GD=t}(window),function(e,t){function a(e,a){this._url=e,this._params=a,this.socketio=t(e,a),this._alarmPostCount=0,this._callbackDic={},this.init()}var o=e.GD||{};if(t){var n={success:!1,error:{code:408,detail:"请求超时",status:"Request Timeout"},api:""},i={success:!1,error:{code:401,detail:"用户未登录",status:"User Logout"},api:""};a.prototype={init:function(){var e,t=this;t.socketio.on("message",function(a){var o,n=(a=JSON.parse(a)).api;"alarmservice.call"==n?(o=a.body&&a.body.json&&a.body.json.split("{")[0],t._callbackDic["alarmservice.call"]&&"function"==typeof t._callbackDic[n][o]&&(t._callbackDic[n][o](t._depackAlarmData(a)),t._callbackDic[n][o]=null)):"alarmservice.sub"===n?(e=t._callbackDic["alarmservice.sub"]||function(){})(t._depackAlarmData(a)):"function"==typeof t._callbackDic[n]&&(t._callbackDic[n](a),t._callbackDic[n]=null),e=null})},on:function(e,t){t=t||function(){},this.socketio.on(e,function(a){var o;try{o=JSON.parse(a)}catch(t){o={success:!1,error:{code:"417",detail:"返回参数格式错误",status:"format error"},api:e}}t(o)})},alarmOn:function(e,t){var a=this;t=t||{},a.on(eventName,function(o){var n={};(n=o&&o.success?a._depackAlarmData(o):o).api=e,t(n)})},post:function(e,t,a,o){var r,l=this;if(!l.socketio.connected){if(!1===l.socketio.reconnection)return;return r=Array.prototype.slice.call(arguments,0),void function(e,t){setTimeout(function(){t.post.apply(t,e)},100)}(r,l)}o=o||8,"function"==typeof t?(a=t,t={}):(t=t||{},a=a||function(){});var s={},c={};if("auth.authenticate"!=e){var d=localStorage.getItem("token");if(!d)return i.api=e,void a(i);d=d.replace(/^\s+/g,"").replace(/\s+$/g,"").replace(/^"/g,"").replace(/"$/g,""),s.token=d,c.header=s}c.api=e,c.request=t,c=JSON.stringify(c),l._callbackDic[e]=a,l.socketio.emit("message",c,function(){});setTimeout(function(){n.api=e;var t;"function"==typeof(t=l._callbackDic[e])&&(t(n),l._callbackDic[e]=null)},1e3*o)},alarmPost:function(e,t,a,o){var n,r=this,l={};if(!r.socketio.connected){if(!1===r.socketio.reconnection)return;return n=Array.prototype.slice.call(arguments,0),void function(e,t){setTimeout(function(){t.alarmPost.apply(t,e)},100)}(n,r)}o=o||10,"function"==typeof t?(a=t,t={}):(t=t||{},a=a||function(){});var s,l={},c=e.split("?")[0],d="_";r._alarmPostCount+=1,r._alarmPostCount>100&&(r._alarmPostCount=1),d+=r._alarmPostCount,"/alarm/SubscribeNotify"===c?(l.json=d+JSON.stringify({data:t}),s="alarmservice.sub",r._callbackDic[s]=a):(l.json=d+JSON.stringify({data:t,url:c}),s="alarmservice.call",r._callbackDic[s]=r._callbackDic[s]||{},r._callbackDic[s][d]=a);var u=localStorage.getItem("token"),h={},g={};if(!u)return i.api=s,void a(i);u=u.replace(/^\s+/g,"").replace(/\s+$/g,"").replace(/^"/g,"").replace(/"$/g,""),h.token=u,g.header=h,g.api=s,g.request=l,g=JSON.stringify(g),r.socketio.send(g)},reconnect:function(e){e=e||function(){},this.socketio.reconnect(e)},disconnect:function(e){e=e||function(){},this.socketio.disconnect(e)},getNewToken:function(){},_depackAlarmData:function(e){var t,a,n={};try{"alarmservice.call"==e.api?(a=e.body.json.split("{")[0],"}"!=(t=o.deEscape(e.body.json.substring(e.body.json.indexOf("{"))))[t.length-1]&&(t+="}"),(n=JSON.parse(t)).flagnum=a):"alarmservice.sub"==e.api&&(t=o.deEscape(e.body.json),n=JSON.parse(t)),n.success=!0}catch(e){n.success=!1,n.data={},n.error={code:"",status:"",detail:e.message}}return n},_packAlarmData:function(){}},o.io=function(e,t){return new a(e,t)},e.GD=o}}(window,_io),function(e){var t=e.GD||{};t.exportElectricIndicates=function(e,t,a,o){var n="tags="+(a=a.join(","))+"&";n+="beginTime="+e+"&",n+="endTime="+t+"&",n+="valueType="+o.join(",");var i=document.createElement("a");i.download="exportExcel",i.href="http://"+webServiceIP+":"+webServicePort+"/api/ExportToExcelInterpo?"+encodeURIComponent(n),i.click()},t.exportArrToCsv=function(e,t){if(t=t||"data",e){for(var a,o=[],n=0,i=e.length;nn?o:n,min=o