Ext.ns('App');
App = {
webforms: {},
init: function() {
Ext.QuickTips.init();
this.propertyManager = new App.property.PropertyManager();
this.workbenchWindow = new Gef.ui.support.DefaultWorkbenchWindow();
var viewport = new Ext.Viewport({
id:'viewport',
layout: 'border',
items: [
this.createNorth(),
this.createSouth(),
this.createWest(),
this.createEast(),
this.createCenter()
],
listeners: {
click: {
element: 'el', //bind to the underlying el property on the panel
fn: function(){ console.log('click el'); }
},
dblclick: {
element: 'body', //bind to the underlying body property on the panel
fn: function(){ console.log('dblclick body'); }
}
}
});
this.initEditor();
setTimeout(function() {
Ext.get('loading').remove();
Ext.get('loading-mask').fadeOut({remove:true});
}, 100);
},
initEditor: function() {
var xml = "",me=this,data = {};;
var editor = new Gef.jbs.ExtEditor();
var input = new Gef.jbs.JBSEditorInput();
var formCondition=getUrlParam('formCondition');
if(formCondition){
var jdId=formCondition.split('IS')[1];
Ext.Ajax.request({
url: basePath + 'common/getJProcessDeployInfo.action',
params: {
jdId: jdId,
type: 'sysnavigation'
},
success: function(response){
var text = new Ext.decode(response.responseText);
xmlInfo = text.xmlInfo;
xml = xmlInfo;
data.pr_defname = text.processDefName;
data.pr_caller = text.caller;
data.pr_enabled = text.enabled;
data.pr_descn = text.processDescription;
input.readXml(xml);
me.workbenchWindow.getActivePage().openEditor(editor, input);
me.workbenchWindow.render();
Gef.activeEditor = editor;
me.propertyManager.initSelectionListener2(Gef.activeEditor,data);
}
});
}else {
xml = " "+
""+
""+
"";
input.readXml(xml);
me.workbenchWindow.getActivePage().openEditor(editor, input);
me.workbenchWindow.render();
Gef.activeEditor = editor;
me.propertyManager.initSelectionListener(Gef.activeEditor);
}
},
getProcessModel: function() {
var viewer = Gef.activeEditor.getGraphicalViewer();
var processEditPart = viewer.getContents();
return processEditPart.model;
},
createNorth: function() {
var p = null;
if (Gef.MODE_DEMO === true) {
p = new Ext.Panel({
region: 'north'
});
} else {
p = new Ext.Panel({
region: 'north'
//height: 60,
/* html: '
';
} else {
html = '
';
}
for (var i = 0; i < array.length; i++) {
var item = array[i];
html += '
![](' + imageRoot + item.image + '.png)
'
+ item.title + '
';
}
html += '
';
return html;
},
/**
* this.layout = 'accordion';
*/
configLayout: function(type) {
if (!type || type == 'plain') {
//
} else if (type && type == 'accordion') {
this.layout = 'accordion';
}
},
configItems: function(type) {
if (type && type == 'accordion') {
this.createItemsForAccordion();
} else if (!type || type == 'plain') {
this.createItemsForHtml();
}
},
createItemsForAccordion: function() {
this.id = '__gef_jbs_palette__';
this.items = [{
title: '所有活动',
iconCls: 'tb-activity',
autoScroll: true,
html: this.createHtml([
{name: 'select', image: 'select32', title: '选择'},
{name: 'transition', image: '32/flow_sequence', title: '连线'},
{name: 'custom', image: '32/task_empty', title: '组件'},
])
}];
},
createItemsForHtml: function() {
this.autoScroll = true;
this.html = this.createHtml([
{name: 'select', image: 'select32', title: '选择'},
{name: 'transition', image: '32/flow_sequence', title: '连线'},
{name: 'start', image: '32/start_event_empty', title: '开始'},
{name: 'end', image: '32/end_event_terminate', title: '结束'},
{name: 'cancel', image: '32/end_event_cancel', title: '取消'},
{name: 'error', image: '32/end_event_error', title: '错误'},
{name: 'state', image: '32/task_wait', title: '等待'},
{name: 'task', image: '32/task_empty', title: '任务'},
{name: 'decision', image: '32/gateway_exclusive', title: '决策'},
{name: 'fork', image: '32/gateway_parallel', title: '并行'},
{name: 'join', image: '32/gateway_parallel', title: '汇聚'},
{name: 'java', image: '32/task_java', title: 'JAVA'},
{name: 'script', image: '32/task_java', title: '脚本'},
{name: 'hql', image: '32/task_hql', title: 'HQL'},
{name: 'sql', image: '32/task_sql', title: 'SQL'},
{name: 'mail', image: '32/task_empty', title: '邮件'},
{name: 'custom', image: '32/task_empty', title: '自定义'},
{name: 'subProcess', image: '32/task_empty', title: '子流程'},
{name: 'jms', image: '32/task_empty', title: 'JMS'},
{name: 'ruleDecision', image: '32/gateway_exclusive', title: '规则决策'},
{name: 'rules', image: '32/task_empty', title: '规则'},
{name: 'human', image: '32/task_empty', title: '人工节点'},
{name: 'auto', image: '32/task_empty', title: '自动节点'},
{name: 'counter-sign', image: '32/task_empty', title: '会签节点'}
], '__gef_jbs_palette__');
}
});
Ext.ux.TwoCombo = Ext.extend(Ext.form.ComboBox, {
initComponent: function() {
this.readOnly = true;
this.displayField = 'text';
this.valueField = 'value';
this.triggerAction = 'all';
this.mode = 'local';
this.emptyText = 'Please Select...';
this.store = new Ext.data.SimpleStore({
fields: ['value', 'text']
});
this.store.loadData(this.data);
Ext.ux.TwoCombo.superclass.initComponent.call(this);
}
});
Ext.reg('twocombo', Ext.ux.TwoCombo);