Index: ssts-web/src/main/webapp/systemmanage/workFlow/workFlowForm.js =================================================================== diff -u -r21947 -r21953 --- ssts-web/src/main/webapp/systemmanage/workFlow/workFlowForm.js (.../workFlowForm.js) (revision 21947) +++ ssts-web/src/main/webapp/systemmanage/workFlow/workFlowForm.js (.../workFlowForm.js) (revision 21953) @@ -1,4 +1,3 @@ -var simpsonsStore; function addAndEditWorkFlow(id) { //判断是否ie和ie7 var isIE6OrIE7 = top.Ext4.isIE6 || top.Ext4.isIE7; @@ -177,26 +176,7 @@ } ] }); //节点信息store - simpsonsStore = Ext4.create( - 'Ext.data.TreeStore', - { - model : "NodeModel", - autoLoad : true, - clearOnLoad : true, - proxy : { - type : 'ajax', - extraParams : { - id : id - }, - url : WWWROOT - + '/disinfectSystem/workFlowAction!loadNodeDefinitionList.do', - reader : { - root : "rows" - } - } - }); - //simpsonsStore.load(); - /*var simpsonsStore = Ext4 + var simpsonsStore = Ext4 .create( 'Ext.data.Store', { @@ -213,16 +193,16 @@ root : "rows" } } - });*/ + }); var newSignal = 'normal';//判断是增加还是修改 //定义rowEditing var rowEditing = Ext4.create('Ext.grid.plugin.RowEditing', { pluginId : 'rowEditing', - /*saveBtnText : '修改', - cancelBtnText : "取消",*/ - autoCancel: false, - clicksToEdit : 1,// 单击进行修改 + saveBtnText : '修改', + cancelBtnText : "取消", + // autoCancel: false, + clicksToEdit : 2,// 单击进行修改 cancelEdit : function() { var me = this; if (me.editing) { @@ -264,39 +244,12 @@ if (n != -1) { var rec = simpsonsStore.getAt(n); rec.set('roleId', data.roleId); - /* var returnvalue = ""; - var index = RoleStore.find(roleCombo.valueField, - data.roleId); - var ehrRecord = RoleStore.getAt(index); - if (ehrRecord) { - returnvalue = ehrRecord.data.name; - } rec.set('roleName', returnvalue);*/ rec.set('roleName', roleName); rec.set('allowRollback', data.allowRollback); rec.set('allowDisagree', data.allowDisagree); rec.set('userName', data.userName); rec.set('userId', data.userId); - /* var reNum = /^[1-9]+[0-9]*]*$/; - if (reNum.test(data.userId)) { - Ext4.Ajax.request({ - url : WWWROOT - + '/disinfectSystem/workFlowAction!getUser.do?id=' - + data.userId, - success : function(response, options) { - var result = Ext4.decode(response.responseText); - if (result.success) { - returnvalue=result.data; - if(returnvalue==""||typeof(value)=="undefined"){ - returnvalue=ready(result.data); - } - } - }, - failure : function(response, options) { - } - }); - } - rec.set('userName', result.data["fullName"]);*/ rec.commit(); simpsonsStore.sync();// 同步? } @@ -318,11 +271,6 @@ return false; } - /*if (!status) { - showResult('请选择状态!'); - return false; - }*/ - var items = []; var count = store.getCount(); if (count > 0) { @@ -338,21 +286,6 @@ item.data.roleId = ehrRecord.data.value; } } - /*var reNum1 = /^[0-9]+[0-9]*]*$/; - if(!reNum1.test(item.data.allowRollback)){ - if(item.data.allowRollback=='是'){ - item.data.allowRollback=1; - }else{ - item.data.allowRollback=0; - } - } - if(!reNum1.test(item.data.allowDisagree)){ - if(item.data.allowDisagree=='是'){ - item.data.allowDisagree=1; - }else{ - item.data.allowDisagree=0; - } - }*/ if(item.data.allowRollback=='是'||item.data.allowDisagree==true){ item.data.allowRollback=1; }else{ @@ -434,207 +367,8 @@ } }); } - //异步回调函数 -/* function ready(obj){ - return obj; - }*/ - /* - function findUser(value){ - Ext4.Ajax.request({ - async:false, - url : WWWROOT - + '/disinfectSystem/workFlowAction!getUser.do?id=' - + value, - success : function(response, options) { - var result = Ext4.decode(response.responseText); - if (result.success) { - ready(result.data); - } - }, - failure : function(response, options) { - } - }); - }*/ - Ext4.define('nodeDefinitionGrid', { - extend: 'Ext4.tree.Panel', - xtype: 'tree-grid', - useArrows: true, - rootVisible: false, - multiSelect: false, - columnLines: true, - rowLines: true, - cls: 'no-leaf-icons', - store : simpsonsStore, - columns : [{ - dataIndex: 'nodeDefinitionId', hidden: true - },{ - dataIndex: 'nodeApprovalId', hidden: true - },{ - header: '节点名称',dataIndex: 'name', width: 200 - },{ - header: '顺序号', dataIndex: 'sequenceNumber', width: 70 - },{ - header: '角色', dataIndex : 'roleName', width: 100, align: 'center', sortable: false, - editor: { - displayField : 'name', - valueField : 'value', - xtype : 'combobox', - mode : 'local', - //editable : false, - triggerAction : 'all', - selectOnFocus : true, - store : RoleStore, - listeners: { - specialkey: function(field, event, eOpts) { - if (event.getKey() === event.TAB) { - //阻止按Tab,因为这里的CellEditing按了tab会有bug - event.stopEvent(); - } - } - } - } - },{ - header: '用户', dataIndex : 'userName', width: 100, align: 'center', sortable: false, - editor: { - displayField : 'name', - valueField : 'value', - xtype : 'combobox', - queryParam : 'spell', - minChars : 0, - typeAhead : false, - triggerAction : 'all', - store :userJsonStore, - forceSelection : false, - lazyInit : true, - pageSize : 100, - matchFieldWidth: false, - listConfig: {width: 300}, - allowBlank : true, - listeners:{ - select:function(combo, records, index){//当选中的时候,会跳到这里 - var record1 = transformRecords(records); - - var deptName = record1.data.name; - var deptCoding = record1.data.id; - - /*combo.name = record1.data.name; - combo.value= record1.data.id;*/ - combo.name = record1.data.name; - combo.value= record1.data.name; - }, - specialkey: function(field, event, eOpts) { - if (event.getKey() === event.TAB) { - //阻止按Tab,因为这里的CellEditing按了tab会有bug - event.stopEvent(); - } - } - } - } - },{ - header: '支持回退', dataIndex : 'allowRollback', width: 100, align: 'center', sortable: false, - editor: { - inputId: 'allowRollback', - displayField : 'name', - valueField : 'value', - xtype : 'combobox', - mode : 'local', - editable : false, - triggerAction : 'all', - selectOnFocus : true, - forceSelection : true, - store : allowRollbackStore, - listeners: { - specialkey: function(field, event, eOpts) { - if (event.getKey() === event.TAB) { - //阻止按Tab,因为这里的CellEditing按了tab会有bug - event.stopEvent(); - } - } - } - } - },{ - header: '支持不同意', dataIndex : 'allowDisagree', width: 100, align: 'center', sortable: false, - editor: { - inputId: 'allowDisagree', - displayField : 'name', - valueField : 'value', - xtype : 'combobox', - mode : 'local', - editable : false, - triggerAction : 'all', - selectOnFocus : true, - forceSelection : true, - store : allowDisagreeStore, - listeners: { - specialkey: function(field, event, eOpts) { - if (event.getKey() === event.TAB) { - //阻止按Tab,因为这里的CellEditing按了tab会有bug - event.stopEvent(); - } - } - } - } - }], - tbar : [ { - text : '新增节点', - width : 100, - iconCls : 'btn_ext_add', - handler : function() { - var workFlowName = Ext4.getCmp('workFlowName').getValue(); - if (workFlowName != "") { - // rowEditing.cancelEdit();//添加此行导致保存和取消按钮未显示 - var r = Ext4.ModelManager.create({ - nodeDefinitionId : '', - name : '审批', - sequenceNumber : 0, - nodeApprovalId : '', - //roleId : '', - roleName: '', - userName: '', - //userId : '', - allowRollback:'', - allowDisagree:'' - }, 'NodeModel'); - simpsonsStore.getRootNode().appendChild(node); - //simpsonsStore.insert(0, r); - //rowEditing.startEdit(0, 0); - //newSignal = 'newing'; - } else { - showResult("请先填好流程名字再添加节点定义!"); - } - } - }, { - text : '删除', - width : 100, - iconCls : 'btn_ext_dalete', - handler : function() { - deleteNodeDefinitions(nodeDefinitionGrid); - } - } ], - viewConfig : { - toggleOnDblClick: false, - markDirty:false - }, - initComponent: function() { - this.cellEditing = new Ext4.grid.plugin.CellEditing({ - clicksToEdit: 2, - listeners: { - beforeedit: function(editor, context, eOpts){ - var record = context.record; - }, - edit:function(editor, context, eOpts){ - } - } - }); - Ext4.apply(this, { - plugins: [this.cellEditing] - }); - this.superclass.initComponent.call(this); - } - }); - //节点定义grid - var nodeDefinitionGrid1 = Ext4.create('Ext.grid.Panel', { + var nodeDefinitionGrid = Ext4.create('Ext.grid.Panel', { title : '节点定义', store : simpsonsStore, height : 500, @@ -651,7 +385,6 @@ direction : 'ASC' }, // selType: 'rowmodel', - //clicksToEdit : 1, selType : "checkboxmodel", columns : [ { id : 'nodeDefinitionId', @@ -747,9 +480,6 @@ var deptName = record1.data.name; var deptCoding = record1.data.id; - - /*combo.name = record1.data.name; - combo.value= record1.data.id;*/ combo.name = record1.data.name; combo.value= record1.data.name; } @@ -770,14 +500,7 @@ triggerAction : 'all', selectOnFocus : true, forceSelection : true, - store : allowRollbackStore//, - /*listeners:{ - select:function(combo, records, index){ - var record1 = transformRecords(records); - combo.name = record1.data.name; - combo.value= record1.data.value; - } - }*/ + store : allowRollbackStore } } , { header : "支持不同意", @@ -794,14 +517,7 @@ triggerAction : 'all', selectOnFocus : true, forceSelection : true, - store : allowDisagreeStore//, - /*listeners:{ - select:function(combo, records, index){ - var record1 = transformRecords(records); - combo.name = record1.data.name; - combo.value= record1.data.value; - } - }*/ + store : allowDisagreeStore } } ], plugins : [ rowEditing ], @@ -826,7 +542,6 @@ allowDisagree:'' }, 'NodeModel'); simpsonsStore.insert(0, r); - // var rowEditing = Ext4.getCmp('nodeDefinitionGrid').editingPlugin; rowEditing.startEdit(0, 0); newSignal = 'newing'; } else {