Index: ssts-web/src/main/webapp/common/common.css =================================================================== diff -u -r31260 -r31384 --- ssts-web/src/main/webapp/common/common.css (.../common.css) (revision 31260) +++ ssts-web/src/main/webapp/common/common.css (.../common.css) (revision 31384) @@ -214,4 +214,14 @@ /* GDSZYY-91:灰色 */ .gridRowColor td{ background: #eee !important; +} +/* ZSRY-16:新增的颜色 */ +.materialsPanelClass:hover { + background: #f1faf0!important; +} +.materialsPanelClass .x-grid3-td-isImplant,.materialsPanelClass .x-grid3-td-sequence{ + cursor: move !important; +} +.materialsPanelClass .x-grid3-td-name,.materialsPanelClass .x-grid3-td-countShow { + cursor: default !important; } \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js =================================================================== diff -u -r29584 -r31384 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js (.../tousseForm.js) (revision 29584) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js (.../tousseForm.js) (revision 31384) @@ -787,64 +787,19 @@ { id:'isImplant', header:"是否植入物", - width : 35, + width : 50, dataIndex:'isImplant' },{ id : 'sequence', header : "排序", width : 30, dataIndex : 'sequence' -// editor : new top.Ext.form.NumberField( { -// allowBlank : false, -// minValue:1, -// listeners:{ -// specialKey : function(field,event){ -// var eventKey = event.getKey(); -// if(eventKey == 13){ -// field.getValue(); -// } -// }, -// focus : function(field){ -// -// }, -// change : function(field,newV,oldV){ -// var ncount = parseInt(newV); -// if(ncount > 0){ -// field.setValue(newV); -// }else{ -// field.setValue(oldV); -// } -//// alert(oldV+','+newV) -// },blur : function (field){ -// field.getValue(); -// } -// } -// }) },{ - id : 'moveItem', - header:'移动', - width : 100, - renderer: function(v,p,record){ - var str = "" - + "" - + "" - + ""; - return str; - }, - menuDisabled : true, - dataIndex:'id' - },{ id : 'type', header : "类型", dataIndex : 'type', hidden : true - }/* ,{ - id : 'cost', - header : "成本", - dataIndex : 'cost', - menuDisabled : true, - hidden : true - } */]); + }]); materialDefinitionConfig = Ext.data.Record.create([ {name : 'id'}, @@ -874,21 +829,28 @@ ]); materialsPanel = new top.Ext.grid.EditorGridPanel({ - id : 'configGrid', - name : 'configGrid', - store : configStore, - cm : materialCm, - height:440, - // width : 358, - frame : false, - bodyStyle : 'border:1px solid #afd7af', - autoExpandColumn : 'count', - viewConfig: {forceFit:true}, - clicksToEdit : 1,//设置点击几次才可编辑 - selModel : new top.Ext.grid.RowSelectionModel({ - singleSelect : false - }), - tbar : [{ + id : 'configGrid', + name : 'configGrid', + store : configStore, + cm : materialCm, + height:440, + frame : false, + bodyStyle : 'border:1px solid #afd7af', + autoExpandColumn : 'count', + viewConfig: { + forceFit:true, + getRowClass : function(record,rowIndex,rowParams,store){ + return 'materialsPanelClass'; + } + }, + clicksToEdit : 1,//设置点击几次才可编辑 + enableDragDrop:true,//激活行拖动 + ddGroup: 'gridDD', + dropConfig: {appendOnly:false}, + selModel : new top.Ext.grid.RowSelectionModel({ + singleSelect : false + }), + tbar : [{ text : '新增材料', iconCls : 'btn_ext_add', handler : function() { @@ -2842,7 +2804,7 @@ layout : 'fit', title: '标识牌', items:[signBoardForm] - }] + }] }); } @@ -2863,11 +2825,45 @@ columnWidth: 0.4, layout : 'fit', items:[materialsPanel] - }] - }] + }] + }] }); tousseWin.show(); - + //ZSRY-16:拖动排序 + new top.Ext.dd.DropTarget(materialsPanel.getEl(), { + ddGroup: 'gridDD', + copy : false, + notifyDrop: function (dd, e, data) { + //选择行 + var rows = materialsPanel.getSelectionModel().getSelections(); + //选择行数 + var count = rows.length; + //拖动到几行 + var dropIndex = dd.getDragData(e).rowIndex; + var array=[]; + if(dropIndex == undefined){ + return; + } + if(data.rowIndex < dropIndex){ + for(var i=0;i