LimitForm.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. Ext.define('erp.view.ma.datalimit.LimitForm',{
  2. extend: 'Ext.form.Panel',
  3. alias: 'widget.limitform',
  4. hideBorders: true,
  5. id:'limitform',
  6. frame:true,
  7. autoScroll:true,
  8. dockedItems: [{
  9. xtype: 'toolbar',
  10. dock: 'top',
  11. ui: 'footer',
  12. items: [{
  13. text: '保存权限',
  14. itemId:'save',
  15. iconCls:'x-button-icon-save',
  16. cls: 'x-btn-gray',
  17. formBind: true
  18. },'-',{
  19. text:'复制权限',
  20. itemId:'copy',
  21. cls: 'x-btn-gray',
  22. iconCls:'x-button-icon-copy'
  23. },'-',{
  24. text:'删除权限',
  25. itemId:'delete',
  26. cls:'x-btn-gray',
  27. iconCls:'x-button-icon-deletedetail'
  28. }]
  29. }],
  30. items:[{
  31. xtype: 'container',
  32. layout: 'hbox',
  33. margin:'0 0 10',
  34. items: [{
  35. xtype: 'fieldset',
  36. flex: 1,
  37. layout: 'anchor',
  38. defaults: {
  39. anchor: '100%',
  40. hideEmptyLabel: false
  41. },
  42. items: [{
  43. xtype: 'radiogroup',
  44. fieldLabel:'用户类型',
  45. defaults: {
  46. name: 'type_',
  47. margins: '0 15 0 0'
  48. },
  49. items: [{
  50. inputValue: 'employee',
  51. boxLabel: '人员',
  52. checked: true
  53. }, {
  54. inputValue: 'job',
  55. boxLabel: '岗位',
  56. disabled:true
  57. }]
  58. },{
  59. xtype:'multifield',
  60. fieldLabel:'当前用户',
  61. allowBlank:false,
  62. name:'emcode_',
  63. id:'emcode_',
  64. secondname:'emname_'
  65. },{
  66. xtype:'hidden',
  67. name:'empid_',
  68. id:'empid_'
  69. },{
  70. xtype:'hidden',
  71. name:'instanceid_',
  72. id:'instanceid_',
  73. value:0
  74. }]
  75. }, {
  76. xtype: 'component',
  77. width: 10
  78. },{
  79. xtype:'checkbox',
  80. flex:1,
  81. name:'nolimit_',
  82. id:'nolimit_',
  83. inputValue:1,
  84. boxLabel:'拥有当前数据类型的全部数据权限',
  85. checked:true,
  86. disabled:true
  87. }]
  88. },{
  89. xtype: 'container',
  90. layout: 'column',
  91. margin:'0 0 10',
  92. items:[{
  93. xtype: 'fieldset',
  94. flex: 1,
  95. columnWidth:0.5,
  96. layout: 'anchor',
  97. defaults: {
  98. anchor: '100%',
  99. hideEmptyLabel: false
  100. },
  101. items:[{
  102. xtype:'fieldcontainer',
  103. layout:'hbox',
  104. hideLabel:true,
  105. items:[{
  106. xtype:'combo',
  107. flex:1,
  108. margin: '5 0 0 0',
  109. fieldLabel:'数据类型',
  110. allowBlank:false,
  111. name:'limit_id_',
  112. id:'limit_id_',
  113. listConfig:{
  114. maxHeight:180
  115. },
  116. store: {
  117. fields: ['desc_', 'id_','table_'],
  118. data :[]
  119. },
  120. displayField: 'desc_',
  121. valueField: 'id_',
  122. queryMode: 'local',
  123. editable:false,
  124. onTriggerClick:function(trigger){
  125. var me=this,store=this.getStore();
  126. if(store.totalCount<1){
  127. var limitstore=Ext.data.StoreManager.lookup('ma.DataLimitStore'),arr=new Array();
  128. Ext.Array.each(limitstore.data.items,function(item){
  129. arr.push(item.data);
  130. });;
  131. store.loadData(arr);
  132. }
  133. if (!me.readOnly && !me.disabled) {
  134. if (me.isExpanded) {
  135. me.collapse();
  136. } else {
  137. me.expand();
  138. }
  139. me.inputEl.focus();
  140. }
  141. }
  142. },{
  143. xtype:'button',
  144. iconCls: 'x-button-icon-data',
  145. margin: '5 0 0 5',
  146. padding:'0 0 2 0',
  147. width:22,
  148. tooltip:'选择数据',
  149. cls: 'x-btn-gray',
  150. disabled:true,
  151. itemId:'select'
  152. }]
  153. },{
  154. xtype:'radiogroup',
  155. fieldLabel:'授权类型',
  156. id:'limittype_',
  157. defaults: {
  158. name: 'limittype_',
  159. margins: '0 15 0 0'
  160. },
  161. items:[{
  162. inputValue: 'detail',
  163. boxLabel: '按明细数据授权',
  164. checked: true
  165. },{
  166. inputValue: 'condition',
  167. boxLabel:'按条件语句授权'
  168. }/*{
  169. inputValue: 'parent',
  170. boxLabel:'按上级组授权',
  171. disabled:true
  172. }*/]
  173. },{
  174. xtype:'textareafield',
  175. fieldLabel:'条件语句',
  176. name:'condition_',
  177. id:'condition_',
  178. hidden:true,
  179. readOnly:true
  180. }]
  181. },{
  182. flex:1,
  183. columnWidth:0.5,
  184. margin: '0 0 0 10',
  185. xtype:'checkbox',
  186. name:'noaddlimit_',
  187. id:'noaddlimit_',
  188. inputValue:1,
  189. boxLabel:'自动具有新增加数据的全部权限',
  190. disabled:true
  191. },{
  192. xtype:'checkbox',
  193. flex:1,
  194. margin: '0 0 0 10',
  195. columnWidth:0.5,
  196. name:'usereport_',
  197. id:'usereport_',
  198. inputValue:1,
  199. boxLabel:'报表查询进行数据检查',
  200. disabled:true
  201. }]
  202. }],
  203. initComponent : function(){
  204. var me = this;
  205. me.callParent(arguments);
  206. }
  207. });