| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- /**
- * 右下角消息提示类型2
- */
- Ext.define('erp.view.core.window.Msg', {
- extend: 'Ext.window.Window',
- alias: 'widget.msg',
- frame: true,
- closable: false,
- bodyStyle: 'background: #E0EEEE',
- width: 400,
- height: 320,
- clientY: 465,
- renderTo: Ext.getBody(),
- x: screen.width - 400 -10,
- y: screen.height - 465 - 10,
- tools: [{
- type: 'close',
- handler: function(btn){
- var me = arguments[2].ownerCt;
- me.fireEvent('close', me);
- me.destroy();
- }
- }],
- autoClose: true,//自动关闭
- closeAction: 'destroy',
- autoCloseTime: 8000,
- isError: true,//是否为出错提示
- initComponent: function() {
- this.autoCloseTime = this.autoCloseTime || 8000;
- this.addEvents({
- 'close': true
- });
- if(!this.isError){
- this.buttons = null;
- this.clientY = 430;
- }
- if (this.autoCloseTime <= 3000) {// fast slide in and out
- this.width = 300;
- this.height = 150;
- this.x = screen.width - 300 -10;
- this.y = screen.height - 150 - 10;
- this.clientY = 300;
- this.context = '<font size=4 color=blue>' + this.context + '</font>';
- }
- this.title = '<div style="height:25;padding-top:5px;color:#FF6A6A;background: #E0EEEE url(' + basePath +
- 'resource/ext/resources/themes/images/default/grid/grid-blue-hd.gif) repeat center center"> ' + this.title + '</div>';
- this.callParent(arguments);
- this.updatePosition();
- this.insertMsg(this.context);
- var me = this;
- if(me.autoClose){//自动关闭
- setTimeout(function(){
- me.destroy();
- }, me.autoCloseTime);
- }
- },
- buttons: [{
- width: 100,
- style: {
- marginLeft: '3px'
- },
- text: '发送错误报告',
- cls: 'x-btn-blue',
- handler: function(btn){
- var me = btn.ownerCt.ownerCt;
- me.sendError();
- me.close();
- }
- },{
- width: 60,
- style: {
- marginLeft: '3px'
- },
- text: '帮助',
- cls: 'x-btn-blue',
- handler: function(btn){
- var me = btn.ownerCt.ownerCt;
- me.help();
- me.close();
- }
- },{
- width: 60,
- style: {
- marginLeft: '3px'
- },
- text: '关 闭',
- cls: 'x-btn-blue',
- handler: function(btn){
- var me = btn.ownerCt.ownerCt;
- me.fireEvent('close', me);
- me.destroy();
- }
- }],
- updatePosition: function(){
- var count = Ext.ComponentQuery.query('msg').length;
- this.setPosition(screen.width - this.width - count*30 - 10, screen.height - this.clientY - 10);
- this.show();
- this.el.slideIn('r', { duration: 500 });
- },
- insertMsg: function(msg){
- this.insert(0, {
- xtype: 'panel',
- height: '100%',
- autoScroll: true,
- html: '<div style="font-size:14px;">' + msg + '</div>'
- });
- },
- sendError: function(){
-
- },
- help: function(){
-
- }
- });
|