DeskTop.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.common.DeskTop', {
  3. extend: 'Ext.app.Controller',
  4. requires: ['erp.util.FormUtil'],
  5. views: ['common.DeskTop.ViewPort', 'common.DeskTop.DeskPortal','common.DeskTop.FlowPortal',
  6. 'common.DeskTop.PortalColumn','common.DeskTop.Portlet','common.DeskTop.CommonUsePortal',
  7. 'common.DeskTop.TaskPortal','common.DeskTop.InfoPortal','common.DeskTop.CallPortal',
  8. 'common.DeskTop.KpiBillPortal'],
  9. init: function() {
  10. var me=this;
  11. this.control({
  12. 'deskportal':{
  13. drop :function(node,data,overmodel){
  14. me.modifyDesk(node);
  15. }
  16. },
  17. 'gridpanel':{
  18. itemmousedown:function(){
  19. return false;
  20. }
  21. }
  22. });
  23. },
  24. modifyDesk:function(node){
  25. var columns=node.portal.items.items,nodes=new Array();
  26. Ext.Array.each(columns,function(item,colIndex){
  27. Ext.Array.each(item.items.items,function(portal,rowIndex){
  28. nodes.push({
  29. xtype_:portal.xtype,
  30. detno_:2*(rowIndex+1)-(colIndex+1)%2
  31. })
  32. });
  33. });
  34. Ext.Ajax.request({
  35. url:basePath+'common/desktop/setDetno.action',
  36. params:{
  37. nodes:Ext.encode(nodes)
  38. }
  39. });
  40. }
  41. });