You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

190 lines
5.9 KiB

<%@page import="org.wdk.core.base.BaseSessionUser"%>
<%@ page language="java" contentType="text/html; charset=gbk" pageEncoding="gbk"%>
<%@ page import="org.wdk.WDKConstant"%>
<%@ page import="org.wdk.WDKCore"%>
<%@ page import="org.wdk.WDK"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String WDK_ROOT = WDKCore.WDK_ROOT;
BaseSessionUser su = (BaseSessionUser) WDK.getSessionUser(request, response);
WDK.writeSessionUser(out, su);
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>流程设计器</title>
<script type="text/javascript" src="<%=WDK_ROOT%>/theme/je/core/js/wdk.js"></script>
<style>
body { margin: 0px; overflow:hidden }
</style>
<script type="text/javascript">
var flexflow = null;
var _runtype = 0; //运行模式 0-正常 1-监控
var _monitortype = 0; //监控模式 0-普通不闪烁 1-普通闪烁
var _show = 0; //特送线条是否显示 0-不显示 1-显示;
var _endpoint = '<%=basePath%>/wdk?action=wf.console';
var _pdid = '';
var _piid = '';
var _mid = '';
var _scope = '';
var _ip = '<%=request.getServerName()%>';
var _port = '<%=request.getServerPort()%>';
var _appname = '<%=path.startsWith("/")?path.substring(1,path.length()):path%>';
var _servername = document.location.href;
var _hostname = document.location.hostname;
if(isIP(_servername) == false && "localhost"!=_hostname && "LOCALHOST"!=_hostname){
//如果是域名,则替换
/*_ip = '127.0.0.1';*/
}else{
//如果没有找到域名,则是数字域名,则不变
// if(-1!=_servername.indexOf('localhost')){
<%-- _ip = '<%=request.getServerName()%>'; --%>
<%-- _port = '<%=request.getServerPort()%>'; --%>
// }else if(-1!=_servername.indexOf('127.0.0.1')){
<%-- _ip = '<%=request.getServerName()%>'; --%>
<%-- _port = '<%=request.getServerPort()%>'; --%>
// }
}
function isIP(strIP) {
if(strIP==null||''==strIP){
return false;
}
var re=/(\d+)\.(\d+)\.(\d+)\.(\d+)/g;
if(re.test(strIP)){
if( RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256);
return true;
}
return false;
}
function init(){
//取pdid
var vars = [];
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++){
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
_pdid = vars['pdid'];
_piid = vars['piid'];
_runtype = vars['runtype'];
_mid = vars['mid'];
_monitortype = vars['monitortype'];
_scope = vars['scope'];
if('0'!=_runtype&&'1'!=_runtype){
_runtype = '0';
}
if('0'!=_monitortype&&'1'!=_monitortype){
_monitortype = '0';
}
if(!_scope){
_scope = '0';
}
var arr = [];
arr.push('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
arr.push(' id="flexflow" width="100%" height="100%"');
arr.push(' codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">');
arr.push(' <param name="movie" value="flexflow.swf" />');
arr.push(' <param name="quality" value="high" />');
arr.push(' <param name="bgcolor" value="#ffffff" />');
arr.push(' <param name="allowScriptAccess" value="always" />');
arr.push(' <param name="flashvars" value="ip='+_ip+'&port='+_port+'&appname='+_appname+'&callback=flex_callback&runtype='+_runtype+'&monitortype='+_monitortype+'&pdid='+_pdid+'&piid='+_piid+'&scope='+_scope+'&isshow='+_show+'">');
arr.push(' <embed src="flexflow.swf" quality="high" bgcolor="#ffffff"');
arr.push(' width="100%" height="100%" name="flexflow" align="middle"');
arr.push(' play="true"');
arr.push(' loop="false"');
arr.push(' quality="high"');
arr.push(' flashvars="ip='+_ip+'&port='+_port+'&appname='+_appname+'&callback=flex_callback&runtype='+_runtype+'&monitortype='+_monitortype+'&pdid='+_pdid+'&piid='+_piid+'&scope='+_scope+'&isshow='+_show+'"');
arr.push(' wmode="opaque"');
arr.push(' allowScriptAccess="always"');
arr.push(' type="application/x-shockwave-flash"');
arr.push(' pluginspage="http://www.adobe.com/go/getflashplayer">');
arr.push('</embed>');
arr.push('</object>');
document.getElementById('flv').innerHTML = arr.join('');
}
function flex_callback(res){
var jres = eval('('+res+')');
var type = jres.type;
var jparam = jres.param;
var flexflow = getSWFObject('flexflow');
switch(type){
case 'oninitcomplete':
// alert('初始化完成');
var strParam = "";
strParam += '{';
strParam += '"endpoint":"'+_endpoint+'"';
strParam += ',"reload":"1"';
strParam += '}';
flexflow.init(strParam);
break;
case 'onloadsuccess':
//alert('加载成功');
break;
case 'onloaderror':
alert('加载失败');
break;
case 'onnodeclick':
var nodename = jparam.nodename;
//构建回传参数
var evtobj = new Object();
var clickpdid = _pdid;
var clickpiid = _piid;
if(jparam.pdid){
clickpdid = jparam.pdid;
}
if(jparam.piid){
clickpiid = jparam.piid;
}
evtobj.pdid = clickpdid;
evtobj.piid = clickpiid;
evtobj.nodename = nodename;
var _top = window.parent;
while(_top!=_top.parent){
_top = _top.parent;
}
var _method = _top._METHOD;
if(_method[_mid]){
var _fun = _method[_mid].method;
if('string'==typeof(_fun)){
_fun = _method[_mid].win[_method[_mid].method];
}
var _v = _fun(evtobj,_method[_mid].jparam);
}
break;
default:
alert('不知名的方法');
break;
}
}
function getSWFObject(movieName){
if(document[movieName]){
return document[movieName];
}else if(window[movieName]){
return window[movieName];
}else if(document.embeds && document.embeds[movieName]){
return document.embeds[movieName];
}else{
return document.getElementById(movieName);
}
}
</script>
</head>
<body onload="init()">
<div id="flv" style="width:100%;height:100%;border:0px solid #FF0000;"></div>
</body>
</html>