123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- Ext.define('erp.view.common.DeskTop.InfoPortal',{
- extend: 'erp.view.common.DeskTop.Portlet',
- title: '<div class="div-left">消息</div>',
- iconCls: 'main-msg',
- enableTools:true,
- alias: 'widget.infoportal',
- activeRefresh:true,
- initComponent : function(){
- var me=this;
- Ext.apply(this,{
- items:[Ext.widget('tabpanel',{
- autoShow: true,
- tabPosition:'top',
- minHeight:200,
- frame:true,
- bodyBorder: false,
- border: false,
- items:[me._inform(),me._notice(),me._news()]
- })]
- });
- this.callParent(arguments);
- },
- gridConfig:function(c){
- return Ext.apply(c,{
- autoScroll:false,
- columns:[{
- text:'主题',
- draggable:false,
- fixed:true,
- cls:'x-grid-header-simple',
- flex:1,
- dataIndex:'NO_TITLE',
- renderer: function(val, meta, record){
- return Ext.String.format('<a href="javascript:openTable({1},\'Note\',\'通知\',\'jsps/oa/info/NoteR.jsp\',\'no_id\',null' + ');" target="_blank">{0}</a>',
- record.get('NO_TITLE'),
- record.get('NO_ID'));
- }
- },{
- text:'状态',
- draggable:false,
- cls:'x-grid-header-simple',
- width:50,
- dataIndex:'STATUS',
- fixed:true,
- renderer: function readstatus(val,meta,record){
- if(val==-1)return '<span style="color:green">已读</span>';
- else return '<span style="color:red;">未读</span>';
- }
- },{
- text:'发送人',
- cls:'x-grid-header-simple',
- draggable:false,
- fixed:true,
- width:100,
- dataIndex:'NO_APPROVER'
- },{
- text:'发送时间',
- cls:'x-grid-header-simple',
- draggable:false,
- fixed:true,
- width:150,
- dataIndex:'NO_APPTIME',
- xtype:'datecolumn',
- renderer:function(value){
- return Ext.Date.format(new Date(value),'Y-m-d H:i:s');
- }
- }]
- });
- },
- _inform:function(config){
- var me=this;
- return Ext.widget('gridpanel',me.gridConfig({
- title:'内部通知',
- autoScroll:false,
- listeners:{
- activate:function(grid){
- grid.getStore().load({
- params:{
- count:grid.ownerCt.pageCount
- }
- });
- }
- },
- store:Ext.create('Ext.data.Store',{
- fields:['NO_ID','NO_TITLE','NO_APPROVER','NO_APPTIME','STATUS'],
- proxy: {
- type: 'ajax',
- url : basePath + 'common/desktop/note/inform.action',
- method : 'GET',
- extraParams:{
- count:me.pageCount
- },
- reader: {
- type: 'json',
- root: 'data'
- }
- },
- autoLoad:false
- })
- }));
- },
- _notice:function(){
- var me=this;
- return Ext.widget('gridpanel',me.gridConfig({
- title:'行政公告',
- autoScroll:false,
- listeners:{
- activate:function(grid){
- grid.getStore().load({
- params:{
- count:grid.ownerCt.pageCount
- }
- });
- }
- },
- store:Ext.create('Ext.data.Store',{
- fields:['NO_ID','NO_TITLE','NO_APPROVER','NO_APPTIME','STATUS'],
- proxy: {
- type: 'ajax',
- url : basePath + 'common/desktop/note/notice.action',
- method : 'GET',
- extraParams:{
- count:me.pageCount
- },
- reader: {
- type: 'json',
- root: 'data'
- }
- },
- autoLoad:false
- })
- }));
- },
- _news:function(){
- var me=this;
- return Ext.widget('gridpanel',{
- title:'时事新闻',
- autoScroll:false,
- columns:[{
- text:'主题',
- draggable:false,
- fixed:true,
- cls:'x-grid-header-simple',
- flex:1,
- dataIndex:'NE_THEME',
- renderer: function(val, meta, record){
- return Ext.String.format('<a href="javascript:openTable({1},null,\'新闻\',\'oa/news/view.action?ne_id={1}\',\'ne_id\',null' + ');" target="_blank">{0}</a>',
- record.get('NE_THEME'),
- record.get('NE_ID'));
- }
- },{
- text:'状态',
- draggable:false,
- cls:'x-grid-header-simple',
- width:50,
- fixed:true,
- dataIndex:'STATUS',
- renderer: function readstatus(val,meta,record){
- if(val==-1)return '<span style="color:green">已读</span>';
- else return '<span style="color:red;">未读</span>';
- }
- },{
- text:'发送人',
- draggable:false,
- cls:'x-grid-header-simple',
- width:100,
- fixed:true,
- dataIndex:'NE_RELEASER'
- },{
- text:'发送时间',
- draggable:false,
- cls:'x-grid-header-simple',
- width:150,
- fixed:true,
- dataIndex:'NE_RELEASEDATE',
- xtype:'datecolumn',
- renderer:function(value){
- return Ext.Date.format(new Date(value),'Y-m-d H:i:s');
- }
- }],
- listeners:{
- activate:function(grid){
- grid.getStore().load({
- params:{
- count:grid.ownerCt.pageCount
- }
- });
- }
- },
- store:Ext.create('Ext.data.Store',{
- fields:['NE_THEME','NE_RELEASER','NE_RELEASEDATE','NE_ID','STATUS'],
- proxy: {
- type: 'ajax',
- url : basePath + 'common/desktop/news/getNews.action',
- method : 'GET',
- extraParams:{
- count:me.pageCount
- },
- reader: {
- type: 'json',
- root: 'data'
- }
- },
- autoLoad:false
- })
- });
- },
- getMore:function(){
- openTable(null,null,'更多消息',"jsps/common/moreinfo.jsp",null,null);
- },
- _dorefresh:function(panel){
- var activeTab=panel.down('tabpanel').getActiveTab();
- if(activeTab) activeTab.fireEvent('activate',activeTab);
- }
- });
|