Ext.define('erp.view.oa.doc.PowerWindow', { extend: 'Ext.window.Window', alias: 'widget.powerwindow', id:'powerwindow', requires:['erp.view.oa.doc.ItemSelector'], height: 600, width: 700, closeAction: 'destroy', title:'
设置权限
', layout:'border', items:[{ region:'center', layout:'border', items:[{ region:'north', xtype:'form', bodyPadding: 10, layout:'column', bodyStyle:'background:#fafafa;', items:[{ columnWidth:1, xtype: 'checkboxgroup', id:'checkboxgroup', padding:'0 0 0 20', fieldStyle : "background:#FFFAFA;color:#515151;", items: [{ boxLabel: '管理', name: 'DP_CONTROL', inputValue: '1'}, { boxLabel: '浏览', name: 'DP_SEE', inputValue: '1' }, { boxLabel: '创建', name: 'DP_SAVE', inputValue: '1' }, { boxLabel: '阅读', name: 'DP_READ', inputValue: '1' }, { boxLabel: '删除', name: 'DP_DELETE', inputValue: '1' }, { boxLabel: '打印', name: 'DP_PRINT', inputValue: '1' }, { boxLabel: '下载', name: 'DP_DOWNLOAD', inputValue: '1'}] },{ xtype:'textfield', margin:'0 0 0 20', fieldLabel:'快速搜索', labelStyle:'font-weight:bold;', columnWidth:0.8 },{ xtype:'button', id:'search', text:'搜索', cls:'button1 pill', style:'margin-left:5px;', width:60 }] },{ region:'center', xtype: 'itemselector', anchor: '100%', id: 'itemselector-field', displayField: 'text', valueField: 'value', allowBlank: false, msgTarget: 'side' }], buttonAlign:'center', buttons:['->',{ cls:'button1 pill', style:'margin-left:5px;', text:'保存', scope:this, handler:function(btn){ btn.ownerCt.ownerCt.ownerCt.savePower(btn); } },{ cls:'button1 pill', style:'margin-left:5px;', text:'关闭', handler:function(btn){ btn.ownerCt.ownerCt.ownerCt.close(btn); } },'->'] },{ region:'west', width:'40%', xtype:'erpOrgTreePanel', bodyStyle:'background:#fafafa;' }], initComponent: function() { this.callParent(arguments); }, savePower:function(btn){ var checkboxgroup=Ext.getCmp('checkboxgroup'); var selectorvalue=Ext.getCmp('itemselector-field').getModelData(); var values=checkboxgroup.getValue(); var keys=Ext.Object.getKeys(values); if(keys.length>0 && selectorvalue.length>0){ Ext.Ajax.request({//拿到form的items url : basePath + 'doc/docmentPowerSet.action', params: { folderId:CurrentFolderId, powers: unescape(escape(Ext.JSON.encode(values))), objects:unescape(selectorvalue.toString()) }, method : 'post', callback : function(options, success, response){ btn.ownerCt.ownerCt.ownerCt.close(btn); var activetab=Ext.getCmp('doctab').getActiveTab(); activetab.items.items[0].loadNewStore(); } }); }else { showResult('提示','未选择设置角色或权限!',btn); } } });