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.

260 lines
7.6 KiB

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ 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;
%>
<html>
<head>
<base href="<%=basePath%>" target="_self">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>流程设计管理</title>
<script type="text/javascript" src="<%=WDK_ROOT%>/theme/je/core/js/wdk.js"></script>
<script type="text/javascript">
var _gridcode = "wdk.module.wf.designergrid";
var _gridid = $.getUUID();
window.onload = function(){
_gridid = $.grid({
id:_gridid,
containerid:'layout_grid',
gridcode:_gridcode,
toolbar:"toolbar",
url : 'wdk?action=wdk.pub&method=call_service&ajaxparam=' + new Date().getTime(),
queryParams : {
_SRVNAME : 'service.wdk.wfrepository',
_SRVMETHOD: 'listFlowDesign',
_DATA: $.json2str({
queryConditon: {}
}),
_RSTYPE: 'grid',
_RSFIELD: 'result',
_RSPARAM: $.json2str({
pagequery: "0"
})
},
idField:'pdid',
fitColumns:true,
singleSelect:true, //是否单选
pagination:false, //分页控件
rownumbers:true //行号
});
var datas = [
{id:'0',text:'未部署'},
{id:'1',text:'已部署'}
];
$.combobox({
id:'isdeploy'
,data:datas
,editable:false
,multiple:false
,panelHeight:100
,idField:'id'
,textField:'text'
,defaultOption:'===全部==='
});
};
//新增流程
function add(){
window.open('<%=basePath%>/wdk/theme/je/module/designer/flexdesigner.jsp?pdid=');
}
//编辑流程
function edit(){
var rows = $.grid_getSelections({
id:_gridid
});
if(rows.length>1){
alert('请选择一行需要编辑的记录');
}else if(rows.length==0){
alert('请选择需要编辑的记录');
}else{
var pdid = rows[0]['id'];
window.open('<%=basePath%>/wdk/theme/je/module/designer/flexdesigner.jsp?pdid='+pdid);
}
}
//部署
function deploy(){
$.wait_open();
//获取被选择的行
var rows = $.grid_getSelections({
id:_gridid
});
if(rows.length>1){
alert('请选择一行需要部署的记录');
}else if(rows.length==0){
alert('请选择需要部署的记录');
}else{
var pdid = rows[0]['id'];
var _data ={
_SRVNAME : 'service.wdk.wfrepository',
_SRVMETHOD: 'createDeployment',
_DATA: $.json2str({
designerId: pdid
}),
};
var url = "wdk?action=wdk.pub&method=call_service";
$.cuajax({
url:url+"&ajaxparam="+new Date().getTime(),
method:"post",
timeout:WDK_Timeout,
data:_data,
success:function(result) {
var jres = $.str2json(result);
alert(jres.desc);
$.grid_reload({id:_gridid});
$.wait_close();
},
error:function(result){
alert('网络错误!result='+result);
$.wait_close();
}
});
}
}
function btn_query(){
$.grid_reload({
id:_gridid
,queryParams:{
_DATA: $.json2str({
queryConditon: {
enname:$('#enname').val()?$('#enname').val():'',
cnname:$('#cnname').val()?$('#cnname').val():'',
isdeploy:$.combobox_getValue({id:'isdeploy'})?$.combobox_getValue({id:'isdeploy'}):''
}
}),
}
});
}
//删除
function remove(){
//获取被选择的行
var rows = $.grid_getSelections({
id:_gridid
});
if(rows.length==0){
alert('请选择需要删除的记录');
}else{
if(confirm('是否确认删除?')){
var pdidarr = [];//row['pdid'];
for(var i=0;i<rows.length;i++){
pdidarr.push(rows[i]['id']);
}
var _data ={
_SRVNAME : 'service.wdk.wfrepository',
_SRVMETHOD: 'removeFlowDesign',
_DATA: $.json2str({
ids:pdidarr.join(',')
}),
};
var url = "wdk?action=wdk.pub&method=call_service";
$.cuajax({
url:url+'&ajaxparam='+new Date().getTime(),
method:"post",
timeout:WDK_Timeout,
data:_data,
success:function(result) {
var jres = $.str2json(result);
alert(jres.desc);
$.grid_reload({id:_gridid});
},
error:function(result){
alert('网络错误!result='+result);
}
});
}
}
}
function copy(){
//获取被选择的行
var rows = $.grid_getSelections({
id:_gridid
});
if(rows.length>1){
alert('请选择一行需要复制的记录');
}else if(rows.length==0){
alert('请选择需要复制的记录');
}else{
var pdid = rows[0]['pdid'];
var _data ={
pdid:pdid
,enname:rows[0]['enname']
,cnname:rows[0]['cnname']
};
$.openWin({
id:$.getUUID(),
title:'流程设计器->>流程复制',
height:top.window.document.body.clientHeight,
width:1000,
modal:true,
url:'wdk/pb/wf/designer_copy.jsp',
queryParams:_data,
maximized:false,
draggable:true,
resizable:false,
onClose:function(){
$.grid_reload({id:_gridid});
}
});
}
}
</script>
</head>
<body class="easyui-layout" data-options="fit:true">
<div data-options="region:'north',border:false,collapsed:false" class="page-title" style="overflow:hidden">
<div class="page-toolbar">
<a id="btn_add" class="easyui-linkbutton" data-options="iconCls:'fa fa-plus'" href="javascript:void(0)" onclick="add()">新建</a>
<a id="btn_edit" class="easyui-linkbutton" data-options="iconCls:'fa fa-edit'" href="javascript:void(0)" onclick="edit()">编辑</a>
<a id="btn_depoly" class="easyui-linkbutton" data-options="iconCls:'fa fa-plus'" href="javascript:void(0)" onclick="deploy()">部署</a>
<a id="btn_remove" class="easyui-linkbutton" data-options="iconCls:'fa fa-remove'" href="javascript:void(0)" onclick="remove()">删除</a>
<a id="btn_copy" class="easyui-linkbutton" data-options="iconCls:'fa fa-plus'" href="javascript:void(0)" onclick="copy()">复制</a>
</div>
</div>
<div data-options="region:'center',border:false,collapsed:false" >
<div class="easyui-layout" data-options="fit:true">
<div data-options="region:'north',border:false,collapsed:false" class="row-1" style="padding:0 10px;overflow:hidden;" >
<form id="search_form" >
<div class="h_layout">
<div>
<div class="inputgroup" >
<label for="pdname">模板名称:</label>
<div>
<input class="easyui-validatebox" style="width: 250px;" type="text" id="enname" name="enname"></input>
</div>
</div>
<div class="inputgroup">
<label for="cnname">模板中文名称:</label>
<div>
<input class="easyui-validatebox" style="width: 250px;" type="text" id="cnname" name="cnname"></input>
</div>
</div>
<div class="inputgroup">
<label for="isdeploy">是否已部署:</label>
<div>
<input class="easyui-validatebox" style="width: 150px;" type="text" id="isdeploy" name="isdeploy"></input>
</div>
</div>
</div>
<div style="width:125px;">
<a class="eapbutton" style="float:right;" onclick="btn_query()"><i class="fa fa-search" aria-hidden="true"></i><span><span>查询</span></span></a>
</div>
</div>
</form>
</div>
<div id="layout_grid" data-options="region:'center',border:false,collapsed:false" style="padding:0px 10px;" >
</div>
</div>
</div>
</body>
</html>