Viewport.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. Ext.define('erp.view.oa.info.Viewport',{
  2. extend: 'Ext.Viewport',
  3. layout: 'border',
  4. hideBorders: true,
  5. initComponent : function(){
  6. var me = this;
  7. Ext.apply(me, {
  8. items:[{
  9. xtype:'toolbar',
  10. region:'north',
  11. //ui: 'footer',
  12. defaults:{
  13. cls: 'x-btn-gray'
  14. },
  15. items: ['->',{
  16. text: '发送',
  17. itemId:'send',
  18. iconCls:'x-button-icon-save'
  19. },{
  20. text:'刷新',
  21. itemId:'refresh',
  22. style:'margin-right:20px;margin-left:5px',
  23. iconCls:'tree-refresh'
  24. }]
  25. },{
  26. xtype:'tabpanel',
  27. region:'center',
  28. items:[{
  29. title:'在线人员',
  30. xtype:'grid',
  31. id:'on-line',
  32. dockedItems: [{
  33. xtype: 'toolbar',
  34. dock: 'top',
  35. displayInfo: true,
  36. height:30,
  37. items:[{
  38. xtype:'checkbox',
  39. name:'only_online',
  40. boxLabel:'仅在线',
  41. labelAlign:'left',
  42. inputValue:1,
  43. padding:'0 0 0 30'
  44. }]
  45. }],
  46. columns:[{
  47. dataIndex:'EM_NAME',
  48. text:'姓名',
  49. cls:'x-grid-header-1',
  50. filter: {xtype:"textfield", filterName:"EM_NAME"},
  51. renderer:function(val,meta,record){
  52. var _online=record.get('ISONLINE'),_sex=record.get('EM_SEX'),iconName;
  53. iconName=_sex=='男'?'qman':'qwoman';
  54. iconName+=_online==0?'1':'';
  55. return '<img src="'+basePath+'resource/images/icon/'+iconName+'.gif" border="0" align="center">'+'<span style="padding-left:2px">' + val + '</span>';
  56. }
  57. },{
  58. dataIndex:'EM_POSITION',
  59. text:'岗位',
  60. cls:'x-grid-header-1',
  61. filter: {xtype:"textfield", filterName:"EM_POSITION"},
  62. flex:1
  63. },{
  64. dataIndex:'EM_DEFAULTORNAME',
  65. cls:'x-grid-header-1',
  66. text:'所属组织',
  67. filter: {xtype:"textfield", filterName:"EM_DEFAULTORNAME"},
  68. flex:1
  69. },{
  70. dataIndex:'ISONLINE',
  71. width:0,
  72. filter: {xtype:"textfield", filterName:"ISONLINE"}
  73. },{
  74. text: '发送消息',
  75. dataIndex: 'send',
  76. xtype:'actioncolumn',
  77. cls: 'x-grid-header-1',
  78. sortable:false,
  79. flex: 0.5,
  80. align:'left',
  81. icon:basePath+'resource/images/icon/reply.gif',
  82. tooltip: '发送消息',
  83. handler: function(grid, rowIndex, colIndex) {
  84. var record = grid.getStore().getAt(rowIndex);
  85. grid.fireEvent('itemclick',grid,record);
  86. }
  87. }],
  88. columnLines:true,
  89. plugins: [Ext.create('erp.view.core.grid.HeaderFilter')],
  90. selModel: Ext.create('Ext.selection.CheckboxModel',{
  91. checkOnly : true,
  92. ignoreRightMouseSelection : false
  93. }),
  94. necessaryFields:['EM_ID','EM_NAME'],
  95. keyField:'EM_ID',
  96. manidField:'EM_ID',
  97. manField:'EM_NAME',
  98. store:Ext.create('Ext.data.Store',{
  99. fields:['EM_ID','EM_NAME',{name:'ISONLINE'},'EM_SEX','EM_DEFAULTORNAME','EM_DEPART','EM_POSITION'],
  100. proxy: {
  101. type: 'ajax',
  102. url : basePath + 'oa/info/getUsersIsOnline.action',
  103. reader: {
  104. type: 'json',
  105. root: 'emps'
  106. }
  107. },
  108. sorters:[{
  109. property : 'ISONLINE',
  110. direction: 'DESC'
  111. }]
  112. })
  113. },{
  114. title:'发件箱',
  115. id:'send-grid',
  116. xtype: 'erpDatalistGridPanel',
  117. _noc:1,
  118. anchor:'100% 100%',
  119. caller:'PagingRelease!Send',
  120. plugins: [Ext.create('erp.view.core.grid.HeaderFilter')],
  121. showRowNum:false,
  122. defaultCondition:'Pr_Releaserid='+em_uu,
  123. selModel: Ext.create('Ext.selection.CheckboxModel',{
  124. checkOnly : true,
  125. ignoreRightMouseSelection : false
  126. }),
  127. dockedItems: [{
  128. id : 'pagingtoolbar1',
  129. xtype: 'erpDatalistToolbar',
  130. dock: 'bottom',
  131. displayInfo: true,
  132. items:[]
  133. }]
  134. },{
  135. title:'收件箱',
  136. xtype: 'erpDatalistGridPanel',
  137. _noc:1,
  138. id:'receive-grid',
  139. caller:'PagingRelease',
  140. anchor:'100% 100%',
  141. plugins: [Ext.create('erp.view.core.grid.HeaderFilter')],
  142. showRowNum:false,
  143. defaultCondition:'prd_recipientid='+em_uu,
  144. selModel: Ext.create('Ext.selection.CheckboxModel',{
  145. checkOnly : true,
  146. ignoreRightMouseSelection : false
  147. }),
  148. dockedItems: [{
  149. id : 'pagingtoolbar12',
  150. xtype: 'erpDatalistToolbar',
  151. dock: 'bottom',
  152. displayInfo: true,
  153. items:[]
  154. }]
  155. }]
  156. }]
  157. });
  158. me.callParent(arguments);
  159. }
  160. });