fastui 0.1.4 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +8 -8
  2. data/app/assets/javascripts/fastui/app/view/DataFieldFactory.js +1 -1
  3. data/app/assets/javascripts/fastui/app/view/GridColumnFactory.js +2 -2
  4. data/app/assets/javascripts/fastui/app/view/VCustomForm.js +9 -4
  5. data/app/assets/javascripts/fastui/app/view/VForm.js +1 -1
  6. data/app/assets/javascripts/fastui/app/view/VGrid.js +6 -0
  7. data/app/assets/javascripts/fastui/app/view/VMenu.js +3 -2
  8. data/app/assets/javascripts/fastui/app/view/VTab.js +12 -6
  9. data/app/assets/javascripts/fastui/app/view/VTreeGrid.js +5 -1
  10. data/app/assets/javascripts/fastui/app/view/Viewport.js +3 -2
  11. data/app/assets/javascripts/fastui/app/view/vfield/VBoolean.js +4 -2
  12. data/app/assets/javascripts/fastui/app/view/vfield/VDate.js +5 -3
  13. data/app/assets/javascripts/fastui/app/view/vfield/VFieldFactory.js +4 -4
  14. data/app/assets/javascripts/fastui/app/view/vfield/VHtml.js +3 -2
  15. data/app/assets/javascripts/fastui/app/view/vfield/VInteger.js +3 -2
  16. data/app/assets/javascripts/fastui/app/view/vfield/VList.js +4 -2
  17. data/app/assets/javascripts/fastui/app/view/vfield/VLookup.js +4 -2
  18. data/app/assets/javascripts/fastui/app/view/vfield/VNumber.js +3 -2
  19. data/app/assets/javascripts/fastui/app/view/vfield/VRadio.js +4 -2
  20. data/app/assets/javascripts/fastui/app/view/vfield/VString.js +3 -2
  21. data/app/assets/javascripts/fastui/app/view/vfield/VTable.js +4 -2
  22. data/app/assets/javascripts/fastui/app/view/vfield/VText.js +3 -2
  23. data/app/assets/javascripts/fastui/app/view/vfield/VTree.js +66 -5
  24. data/app/assets/javascripts/fastui/app/view/vfield/VTreeText.js +19 -0
  25. data/app/assets/javascripts/fastui/application.js +1 -1
  26. data/app/assets/javascripts/fastui/extjs4/locale/ext-lang-zh_CN.js +25 -3
  27. data/app/controllers/fastui/m_menu_items_controller.rb +1 -1
  28. data/lib/fastui/version.rb +1 -1
  29. data/lib/generators/fastui/templates/fastui_config.erb +69 -68
  30. metadata +3 -4
  31. data/app/assets/javascripts/fastui/app/view/vfield/VLongComboBox.js +0 -19
  32. data/app/assets/javascripts/fastui/app/view/vfield/VTreeCombobox.js +0 -78
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODhjZmNmMWJiNjM0OWQ3ZjlhMjllYzIyMjQ5MGFmM2NmODQ0NDZhMw==
4
+ N2I3ZWJjNDA0NTUwYWFhMjNmMzg4ZjMwNGM5YTA5YzVjMGVkM2E5NA==
5
5
  data.tar.gz: !binary |-
6
- NTU2OWI1NjkyOGQwNDI3MThkZWI1NTc3ODNkNzJkYWNmYzllOTUwZA==
6
+ YWVkNTA3OWI4Yzk5ZTg2MTkwNTY0ZTcwN2E4NDUxOWQyYjMxYWQzZQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MTAzODgzYWZjODc4ZmM1ODhkNDFlODQwY2FlMDY2M2VlY2QwYTcyNjM4ODJk
10
- NGYyOGQ2MDcxODk0Yzg3ZmE0ZGRkYmYyZWU5MWM0ODVkZjJmNWFkNjI0N2Vj
11
- NTM1ZTE4YTlkMTY0MzliNmMzNTcyYWVlZDAxYzFlYTk5Y2EwZTQ=
9
+ NTM1MmZkOTQwNzc1NDZkYWRjYmI2ZjI1ZTM0NDZlMWQyOWNhNjU4NTczYTcw
10
+ Njc4MmViY2YzOGJjZTU2MDA3MTZjMGY5YTcwYzMyYzk0NzhkMWI4ZThiZTY2
11
+ MWIzOTcwMGZjNDdkYTg5YzRhNmIyY2VlMjJjNmE1MzcxMzgzM2Q=
12
12
  data.tar.gz: !binary |-
13
- MDM2NGZiOWJlYzk2YmYyNmFkMzU4OGRhMGEyY2NmNTlkMjMyMDk5NTk3ZGMx
14
- NjJjMzFlMWYxZWQxZDBkNGY2NDM0NzdiNThiZDM0ZmVmYTE1MjM3MWEzZGJl
15
- N2MxOWJmNzQ5NjNjMWUzMTAwMzkyYjkxODFlNGM3ODdjMzQ1MjI=
13
+ ODAxNzdhMGI5Zjg2Yjc1MTViOWJkMGIwNmVmZDQ0YzBhYTZlM2E2NmU4YmI3
14
+ ZDZjNTMxNmZjNjY1ZWMzNTQ2M2NkNDIwYmEzYzk1NTdlOGFlNmUyZTM4NmJi
15
+ ZjEyMTNlNDI2NTY2NDA2NmNjYTY0YTkzNTNhODAxOTczMzlhMTQ=
@@ -3,7 +3,7 @@ Ext.define('FastUI.view.DataFieldFactory', {
3
3
 
4
4
  buildField:function(fields, field){
5
5
  switch (field.datatype) {
6
- case 'VTreeCombobox':
6
+ case 'VTree':
7
7
  fields.push({
8
8
  name: field.name.replace('_id', ''),
9
9
  type: 'auto'
@@ -4,7 +4,7 @@ Ext.define('FastUI.view.GridColumnFactory', {
4
4
  buildColumn: function(columns, column){
5
5
  column.datatype = column.datatype || '';
6
6
  switch (column.datatype) {
7
- case 'VTree':
7
+ case 'VTreeText':
8
8
  columns.push({
9
9
  text: column.title,
10
10
  dataIndex: column.name,
@@ -13,7 +13,7 @@ Ext.define('FastUI.view.GridColumnFactory', {
13
13
  });
14
14
  break;
15
15
 
16
- case 'VTreeCombobox':
16
+ case 'VTree':
17
17
  var entity = column.name.replace('_id', '');
18
18
  columns.push({
19
19
  text: column.title,
@@ -1,5 +1,10 @@
1
1
  Ext.define('FastUI.view.VCustomForm', {
2
2
  extend:'Ext.Panel',
3
+
4
+ successText:'Success',
5
+ failureText:'Failed',
6
+ invalidText:'Invalid',
7
+
3
8
  tab:{},
4
9
  url: 'fastui',
5
10
  method: 'POST',
@@ -31,7 +36,7 @@ Ext.define('FastUI.view.VCustomForm', {
31
36
  this.setValues(data);
32
37
  },
33
38
  failure: function () {
34
- Ext.MessageBox.alert("提示", "操作失败!")
39
+ Ext.MessageBox.alert(this.failureText, "操作失败!")
35
40
  },
36
41
  scope: this
37
42
  });
@@ -47,11 +52,11 @@ Ext.define('FastUI.view.VCustomForm', {
47
52
  method : this.method,
48
53
  form : this.id,
49
54
  success: function () {
50
- this.tab.vgrid.store.reload();
51
- Ext.MessageBox.alert("提示", "操作成功!")
55
+ this.tab.vgrid.refresh();
56
+ Ext.MessageBox.alert(this.successText, "操作成功!")
52
57
  },
53
58
  failure: function () {
54
- Ext.MessageBox.alert("提示", "操作失败!")
59
+ Ext.MessageBox.alert(this.failureText, "操作失败!")
55
60
  },
56
61
  scope: this
57
62
  });
@@ -96,7 +96,7 @@ Ext.define('FastUI.view.VForm', {
96
96
  if (form.isValid()) { // make sure the form contains valid data before submitting
97
97
  form.submit({
98
98
  success: function (form, action) {
99
- this.tab.vgrid.store.reload();
99
+ this.tab.vgrid.refresh();
100
100
  Ext.Msg.alert(this.successText, action.result.msg);
101
101
  },
102
102
  failure: function (form, action) {
@@ -99,5 +99,11 @@ Ext.define('FastUI.view.VGrid', {
99
99
  //columns.push(FastUI.view.vfield.VFieldFactory.buildField(column, this.tab.winCtx, this.tab.winId, this.tab.rest).column());
100
100
  }, this);
101
101
  return columns;
102
+ },
103
+
104
+ refresh:function(){
105
+ this.store.reload();
102
106
  }
107
+
108
+
103
109
  });
@@ -2,7 +2,7 @@ Ext.define('FastUI.view.VMenu', {
2
2
  extend:'Ext.tree.Panel',
3
3
  requires:['FastUI.store.MWindowMgr'],
4
4
  alias: 'widget.vMenu',
5
- title:'菜单',
5
+ title:'Menu',
6
6
  animate:false,
7
7
  collapseMode:"mini",
8
8
  collapsible:true,
@@ -30,7 +30,8 @@ Ext.define('FastUI.view.VMenu', {
30
30
  }
31
31
  },
32
32
  root:{
33
- name:'菜单',
33
+ name:this.title,
34
+ id:'',
34
35
  expanded:true
35
36
  }
36
37
  });
@@ -7,6 +7,12 @@ Ext.define('FastUI.view.VTab', {
7
7
  winCtx: {},
8
8
  layout: "card",
9
9
  border: false,
10
+ newText: 'New',
11
+ editText: 'Edit',
12
+ listText: 'List',
13
+ saveText: 'Save',
14
+ deleteText: 'Delete',
15
+ helpText: 'Help',
10
16
  initComponent: function () {
11
17
  this.id = 'tab-' + this.getValue('name');
12
18
  this.grid_kind = this.getValue('grid_kind');
@@ -21,7 +27,7 @@ Ext.define('FastUI.view.VTab', {
21
27
  items: [
22
28
  {
23
29
  id: this.id + 'new',
24
- text: '新建',
30
+ text: this.newText,
25
31
  iconCls: 'fastui-btn-new',
26
32
  handler: function () {
27
33
  // this.cmdCreate();
@@ -36,7 +42,7 @@ Ext.define('FastUI.view.VTab', {
36
42
  },
37
43
  {
38
44
  id: this.id + 'edit',
39
- text: '编辑',
45
+ text: this.editText,
40
46
  disabled: true,
41
47
  iconCls: 'fastui-btn-edit',
42
48
  handler: function () {
@@ -51,7 +57,7 @@ Ext.define('FastUI.view.VTab', {
51
57
  },
52
58
  {
53
59
  id: this.id + 'list',
54
- text: '列表',
60
+ text: this.listText,
55
61
  iconCls: 'fastui-btn-list',
56
62
  handler: function () {
57
63
  this.cmdList();
@@ -63,7 +69,7 @@ Ext.define('FastUI.view.VTab', {
63
69
  },
64
70
  {
65
71
  id: this.id + 'save',
66
- text: '保存',
72
+ text: this.saveText,
67
73
  disabled: true,
68
74
  iconCls: 'fastui-btn-save',
69
75
  handler: function () {
@@ -78,7 +84,7 @@ Ext.define('FastUI.view.VTab', {
78
84
  },
79
85
  {
80
86
  id: this.id + 'del',
81
- text: '删除',
87
+ text: this.deleteText,
82
88
  disabled: true,
83
89
  iconCls: 'fastui-btn-del',
84
90
  handler: function () {
@@ -89,7 +95,7 @@ Ext.define('FastUI.view.VTab', {
89
95
  },
90
96
  {
91
97
  id: this.id + 'help',
92
- text: '帮助',
98
+ text: this.helpText,
93
99
  iconCls: 'fastui-btn-help',
94
100
  handler: function () {
95
101
  this.cmdHelp();
@@ -38,7 +38,7 @@ Ext.define('FastUI.view.VTreeGrid', {
38
38
 
39
39
  getTreeGStore: function () {
40
40
  return new Ext.data.TreeStore({
41
- autoLoad: true,
41
+ //autoLoad: true,
42
42
  //autoSync: true,
43
43
  proxy:{
44
44
  type: 'ajax',
@@ -74,6 +74,10 @@ Ext.define('FastUI.view.VTreeGrid', {
74
74
  FastUI.view.GridColumnFactory.buildColumn(columns,column);
75
75
  }, this);
76
76
  return columns;
77
+ },
78
+
79
+ refresh: function(){
80
+ this.store.load();
77
81
  }
78
82
  });
79
83
 
@@ -2,6 +2,7 @@ Ext.define('FastUI.view.Viewport', {
2
2
  extend:'Ext.container.Viewport',
3
3
  id:'port',
4
4
  layout:'border',
5
+
5
6
  items:[
6
7
  {
7
8
  height:43,
@@ -18,7 +19,7 @@ Ext.define('FastUI.view.Viewport', {
18
19
  split:true,
19
20
  width:295,
20
21
  defaults:{border:false},
21
- items:[Ext.create('FastUI.view.VMenu'),{title:'帮助',iconCls:'fastui-btn-help'}],
22
+ items:[Ext.create('FastUI.view.VMenu'),{title:'Help',iconCls:'fastui-btn-help'}],
22
23
  xtype:"tabpanel"
23
24
  },
24
25
  {
@@ -36,7 +37,7 @@ Ext.define('FastUI.view.Viewport', {
36
37
  //maskOnDisable: false,
37
38
 
38
39
  items: [{
39
- title: '首页',
40
+ title: 'Home',
40
41
  iconCls:'fastui-home',
41
42
  border:false,
42
43
 
@@ -10,8 +10,10 @@ Ext.define('FastUI.view.vfield.VBoolean',{
10
10
  initComponent:function(){
11
11
  this.fieldLabel = this.getFValue('title');
12
12
  this.name = this.rest.getTableName() + '[' + this.getFValue('name') + ']';
13
- this.disabled = this.getFValue('readonly');
14
- this.allowBlank = true;
13
+ this.disabled = this.getFValue('readonly') || false;
14
+ this.allowBlank = this.getFValue('required') || true;
15
+ this.width = this.getFValue('width') || 650;
16
+ this.vtype = this.getFValue('vtype');
15
17
  this.callParent();
16
18
  },
17
19
  getFValue:function (key) {
@@ -8,9 +8,11 @@ Ext.define('FastUI.view.vfield.VDate',{
8
8
 
9
9
  initComponent:function(){
10
10
  this.fieldLabel = this.getFValue('title');
11
- this.name = this.rest.getTableName() + '[' + this.getFValue('m_property').name + ']';
12
- this.disabled = this.getFValue('is_readonly');
13
- this.allowBlank = true;
11
+ this.name = this.rest.getTableName() + '[' + this.getFValue('name') + ']';
12
+ this.disabled = this.getFValue('readonly') || false;
13
+ this.allowBlank = this.getFValue('required') || true;
14
+ this.width = this.getFValue('width') || 650;
15
+ this.vtype = this.getFValue('vtype');
14
16
  this.callParent();
15
17
  },
16
18
  getFValue:function (key) {
@@ -28,8 +28,8 @@ Ext.define('FastUI.view.vfield.VFieldFactory', {
28
28
  case 'VString':
29
29
  return Ext.create('FastUI.view.vfield.VString', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
30
30
 
31
- case 'VTree':
32
- return Ext.create('FastUI.view.vfield.VTree', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
31
+ case 'VTreeText':
32
+ return Ext.create('FastUI.view.vfield.VTreeText', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
33
33
 
34
34
  case 'VDate':
35
35
  return Ext.create('FastUI.view.vfield.VDate', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
@@ -79,8 +79,8 @@ Ext.define('FastUI.view.vfield.VFieldFactory', {
79
79
  case 'VTable':
80
80
  return Ext.create('FastUI.view.vfield.VTable', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
81
81
 
82
- case 'VTreeCombobox':
83
- return Ext.create('FastUI.view.vfield.VTreeCombobox', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
82
+ case 'VTree':
83
+ return Ext.create('FastUI.view.vfield.VTree', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
84
84
 
85
85
  case 'VGroup':
86
86
  var box = Ext.create('Ext.form.FieldSet',{
@@ -10,8 +10,9 @@ Ext.define('FastUI.view.vfield.VHtml',{
10
10
  initComponent:function(){
11
11
  this.fieldLabel = this.getFValue('title');
12
12
  this.name = this.rest.getTableName() + '[' + this.getFValue('name') + ']';
13
- this.disabled = this.getFValue('readonly');
14
- this.allowBlank = true;
13
+ this.disabled = this.getFValue('readonly') || false;
14
+ this.allowBlank = this.getFValue('required') || true;
15
+ this.width = this.getFValue('width') || 650;
15
16
  this.vtype = this.getFValue('vtype');
16
17
  this.callParent();
17
18
  },
@@ -9,8 +9,9 @@ Ext.define('FastUI.view.vfield.VInteger',{
9
9
  initComponent:function(){
10
10
  this.fieldLabel = this.getFValue('title');
11
11
  this.name = this.rest.getTableName() + '[' + this.getFValue('name') + ']';
12
- this.disabled = this.getFValue('readonly');
13
- this.allowBlank = true;
12
+ this.disabled = this.getFValue('readonly') || false;
13
+ this.allowBlank = this.getFValue('required') || true;
14
+ this.width = this.getFValue('width') || 650;
14
15
  this.vtype = this.getFValue('vtype');
15
16
  this.callParent();
16
17
  },
@@ -16,8 +16,10 @@ Ext.define('FastUI.view.vfield.VList', {
16
16
  initComponent:function () {
17
17
  this.fieldLabel = this.getFValue('title');
18
18
  this.name = this.rest.getTableName() + '[' + this.getFValue('name') + ']';
19
- this.disabled = this.getFValue('readonly');
20
- this.allowBlank = true;
19
+ this.disabled = this.getFValue('readonly') || false;
20
+ this.allowBlank = this.getFValue('required') || true;
21
+ this.width = this.getFValue('width') || 650;
22
+ this.vtype = this.getFValue('vtype');
21
23
  this.store = FastUI.store.MListMgr.getStore(this.getFValue('name'));
22
24
  this.callParent();
23
25
  },
@@ -13,8 +13,10 @@ Ext.define('FastUI.view.vfield.VLookup', {
13
13
  initComponent:function () {
14
14
  this.fieldLabel = this.getFValue('title');
15
15
  this.name = this.rest.getTableName() + '[' + this.getFValue('name') + ']';
16
- this.disabled = this.getFValue('readonly');
17
- this.allowBlank = true;
16
+ this.disabled = this.getFValue('readonly') || false;
17
+ this.allowBlank = this.getFValue('required') || true;
18
+ this.width = this.getFValue('width') || 650;
19
+ this.vtype = this.getFValue('vtype');
18
20
  this.store = Ext.create('Ext.data.ArrayStore', {
19
21
  fields:['id', 'title'],
20
22
  data:[]
@@ -8,8 +8,9 @@ Ext.define('FastUI.view.vfield.VNumber',{
8
8
  initComponent:function(){
9
9
  this.fieldLabel = this.getFValue('title');
10
10
  this.name = this.rest.getTableName() + '[' + this.getFValue('name') + ']';
11
- this.disabled = this.getFValue('readonly');
12
- this.allowBlank = true;
11
+ this.disabled = this.getFValue('readonly') || false;
12
+ this.allowBlank = this.getFValue('required') || true;
13
+ this.width = this.getFValue('width') || 650;
13
14
  this.vtype = this.getFValue('vtype');
14
15
  this.callParent();
15
16
  },
@@ -8,8 +8,10 @@ Ext.define('FastUI.view.vfield.VRadio',{
8
8
 
9
9
  initComponent:function(){
10
10
  this.fieldLabel = this.getFValue('title');
11
- this.disabled = this.getFValue('readonly');
12
- this.allowBlank = true;
11
+ this.disabled = this.getFValue('readonly') || false;
12
+ this.allowBlank = this.getFValue('required') || true;
13
+ this.width = this.getFValue('width') || 650;
14
+ this.vtype = this.getFValue('vtype');
13
15
  this.items = this.getFFields();
14
16
  this.callParent();
15
17
  },
@@ -7,8 +7,9 @@ Ext.define('FastUI.view.vfield.VString',{
7
7
  initComponent:function(){
8
8
  this.fieldLabel = this.getFValue('title');
9
9
  this.name = this.rest.getTableName() + '[' + this.getFValue('name') + ']';
10
- this.disabled = this.getFValue('readonly');
11
- this.allowBlank = true;
10
+ this.disabled = this.getFValue('readonly') || false;
11
+ this.allowBlank = this.getFValue('required') || true;
12
+ this.width = this.getFValue('width') || 650;
12
13
  this.vtype = this.getFValue('vtype');
13
14
  this.callParent();
14
15
  },
@@ -16,8 +16,10 @@ Ext.define('FastUI.view.vfield.VTable', {
16
16
  initComponent:function () {
17
17
  this.fieldLabel = this.getFValue('title');
18
18
  this.name = this.rest.getTableName() + '[' + this.getFValue('name') + ']';
19
- this.disabled = this.getFValue('readonly');
20
- this.allowBlank = true;
19
+ this.disabled = this.getFValue('readonly') || false;
20
+ this.allowBlank = this.getFValue('required') || true;
21
+ this.width = this.getFValue('width') || 650;
22
+ this.vtype = this.getFValue('vtype');
21
23
  this.store = this.getStore();
22
24
  this.callParent();
23
25
  },
@@ -9,8 +9,9 @@ Ext.define('FastUI.view.vfield.VText',{
9
9
  initComponent:function(){
10
10
  this.fieldLabel = this.getFValue('title');
11
11
  this.name = this.rest.getTableName() + '[' + this.getFValue('name') + ']';
12
- this.disabled = this.getFValue('readonly');
13
- this.allowBlank = true;
12
+ this.disabled = this.getFValue('readonly') || false;
13
+ this.allowBlank = this.getFValue('required') || true;
14
+ this.width = this.getFValue('width') || 650;
14
15
  this.vtype = this.getFValue('vtype');
15
16
  this.callParent();
16
17
  },
@@ -1,17 +1,78 @@
1
- Ext.define('FastUI.view.vfield.VTree',{
2
- extend: 'Ext.form.field.Text',
1
+ Ext.define('FastUI.view.vfield.VTree', {
2
+ extend:'Ext.form.field.ComboBox',
3
+ alias:'widget.vtreetable',
3
4
  valueObject: {},
4
5
  winCtx:{},
5
6
  winId:0,
6
7
  rest:{},
7
- initComponent:function(){
8
+
9
+ editable: false,
10
+ displayField:'title',
11
+ valueField:'id',
12
+ initComponent:function () {
8
13
  this.fieldLabel = this.getFValue('title');
9
14
  this.name = this.rest.getTableName() + '[' + this.getFValue('name') + ']';
10
- this.disabled = this.getFValue('readonly');
11
- this.allowBlank = true;
15
+ this.disabled = this.getFValue('readonly') || false;
16
+ this.allowBlank = this.getFValue('required') || true;
17
+ this.width = this.getFValue('width') || 650;
18
+ this.vtype = this.getFValue('vtype');
19
+ this.store = Ext.create('Ext.data.ArrayStore', {
20
+ fields:['id', 'title'],
21
+ data:[]
22
+ });
12
23
  this.callParent();
13
24
  },
25
+ createPicker: function() {
26
+ var rest = Ext.create('FastUI.view.Rest', this.getMEntity());
27
+ return Ext.create('Ext.tree.Panel', {
28
+ hidden: true,
29
+ floating: true,
30
+ minHeight: 300,
31
+ autoScroll: true,
32
+ store: Ext.create('Ext.data.TreeStore', {
33
+ fields:['id', {name:'text', mapping:'title'}],
34
+ autoLoad: true,
35
+ proxy:{
36
+ type: 'ajax',
37
+ url: rest.indexPath(),
38
+ reader:{
39
+ type:'json',
40
+ root:'',
41
+ record:''
42
+ //successProperty:''
43
+ }
44
+ },
45
+ root: {
46
+ text:'Root',
47
+ id:'',
48
+ expanded: true
49
+ }
50
+ }),
51
+ listeners: {
52
+ itemclick: function (view, record) {
53
+ var id = record.get('id');
54
+ if (!this.store.getById(id)){
55
+ this.store.add({id:id,title:record.get('text')});
56
+ }
57
+ this.setValue(id);
58
+ this.collapse();
59
+ },
60
+ scope:this
61
+ }
62
+ });
63
+ },
64
+ getMEntity:function(){
65
+ return this.valueObject.ref.entity;
66
+ },
14
67
  getFValue:function (key) {
15
68
  return this.valueObject[key];
69
+ },
70
+ setValue:function(value){
71
+ if(value && value.id && value.title){
72
+ this.store.add(value);
73
+ this.setValue(value.id);
74
+ }else{
75
+ this.callParent(arguments);
76
+ }
16
77
  }
17
78
  });
@@ -0,0 +1,19 @@
1
+ Ext.define('FastUI.view.vfield.VTreeText',{
2
+ extend: 'Ext.form.field.Text',
3
+ valueObject: {},
4
+ winCtx:{},
5
+ winId:0,
6
+ rest:{},
7
+ initComponent:function(){
8
+ this.fieldLabel = this.getFValue('title');
9
+ this.name = this.rest.getTableName() + '[' + this.getFValue('name') + ']';
10
+ this.disabled = this.getFValue('readonly') || false;
11
+ this.allowBlank = this.getFValue('required') || true;
12
+ this.width = this.getFValue('width') || 650;
13
+ this.vtype = this.getFValue('vtype');
14
+ this.callParent();
15
+ },
16
+ getFValue:function (key) {
17
+ return this.valueObject[key];
18
+ }
19
+ });
@@ -12,7 +12,7 @@
12
12
  //
13
13
  // require ./extjs4/ext-all
14
14
  //= require ./app/view/vfield/VType
15
- //= require ./extjs4/locale/ext-lang-zh_CN
15
+ // require ./extjs4/locale/ext-lang-zh_CN
16
16
  //= require ./app/inflection
17
17
  //= require ./fastui
18
18
 
@@ -277,8 +277,30 @@ Ext.define("Ext.locale.zh_CN.VForm", {
277
277
  invalidText:'无效'
278
278
  });
279
279
 
280
- // This is needed until we can refactor all of the locales into individual files
281
- Ext.define("Ext.locale.zh_CN.Component", {
282
- override: "Ext.Component"
280
+ Ext.define("Ext.locale.zh_CN.VCustomForm", {
281
+ override: "FastUI.view.VCustomForm",
282
+ successText:'成功',
283
+ failureText:'失败',
284
+ invalidText:'无效'
285
+ });
286
+
287
+ Ext.define("Ext.locale.zh_CN.VMenu", {
288
+ override: "FastUI.view.VMenu",
289
+ title:'菜单'
290
+ });
291
+
292
+ Ext.define("Ext.locale.zh_CN.VTab", {
293
+ override: "FastUI.view.VTab",
294
+ newText: '新建',
295
+ editText: '编缉',
296
+ listText: '列表',
297
+ saveText: '保存',
298
+ deleteText: '删除',
299
+ helpText: '帮助'
283
300
  });
284
301
 
302
+ // This is needed until we can refactor all of the locales into individual files
303
+ //Ext.define("Ext.locale.zh_CN.Component", {
304
+ // override: "Ext.Component"
305
+ //});
306
+
@@ -6,7 +6,7 @@ module Fastui
6
6
  respond_to :html, :xml, :json
7
7
 
8
8
  def index
9
- @m_menu_items = params[:node] == 'root' ? MMenuItem.roots : MMenuItem.where({
9
+ @m_menu_items = params[:node] == '' ? MMenuItem.roots : MMenuItem.where({
10
10
  :parent_id => params[:node]
11
11
  }.delete_if { |k, v| v.blank? })
12
12
 
@@ -1,3 +1,3 @@
1
1
  module Fastui
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -1,77 +1,78 @@
1
1
  # encoding: utf-8
2
2
  Fastui::View.instance.config do |conf|
3
+ conf.project = 'Fastui Rapid Development Framework'
4
+ conf.version = "version #{Fastui::VERSION} built on ExtJS 4.2.0"
5
+ conf.copyright = 'Copyright 2007-2013 ChunTeng Co., Ltd.'
3
6
 
4
- #conf.project = 'Fastui Rapid Development Framework1111'
5
- #conf.version = 'version 0.1.0 built on ExtJS 4.2.0'
6
- #conf.copyright = 'Copyright 2007-2013 ChunTeng Co., Ltd.'
7
+ default = [
8
+ {name: 'entity_kind', title: 'Entity Kind', datatype: 'VRadio'},
9
+ {name: 'seq', title: 'Order by', datatype: 'VInteger'},
10
+ {name: 'is_active', title: 'Actived', datatype: 'VBoolean'},
11
+ {name: 'note', title: 'Memo', datatype: 'VText'},
12
+ {name: 'help', title: 'Help', datatype: 'VHtml', display: 'form'},
13
+ {name: 'createdbyorg_id', title: 'Created By Org', datatype: 'VTable', ref: {entity: 'Fastui::MOrg'}, display: 'grid'},
14
+ {name: 'createdby_id', title: 'Creator', datatype: 'VLookup', ref: {entity: 'Fastui::MPerson'}, display: 'grid'},
15
+ {name: 'updatedby_id', title: 'Visitor', datatype: 'VLookup', ref: {entity: 'Fastui::MPerson'}, display: 'grid'}
16
+ ]
7
17
 
8
- default = [
9
- {name: 'entity_kind', title: '实体种类', datatype: 'VSingleChoice'},
10
- {name: 'seq', title: '排序', datatype: 'VNumber'},
11
- {name: 'is_active', title: '是否激活', datatype: 'VYesOrNo'},
12
- {name: 'note', title: '备注', datatype: 'VTextArea'},
13
- {name: 'help', title: '帮助', datatype: 'VTextArea', display: 'form'},
14
- {name: 'createdbyorg_id', title: '创建组织', datatype: 'VLookup', ref: {entity: 'Fastui::MOrg'}, display: 'grid'},
15
- {name: 'createdby_id', title: '创建人', datatype: 'VLookup', ref: {entity: 'Fastui::MPerson'}, display: 'grid'},
16
- {name: 'updatedby_id', title: '更新人', datatype: 'VLookup', ref: {entity: 'Fastui::MPerson'}, display: 'grid'}
17
- ]
18
+ conf.win :m_menu, title: 'Menu', window_kind: 'maintain' do |w|
19
+ w.tab :m_menu, title: 'Menu', entity: 'Fastui::MMenu', readonly: true, members: [
20
+ {name: 'id', title: 'ID', datatype: 'VInter', readonly: true},
21
+ {name: 'title', title: 'Title', datatype: 'VString'},
22
+ {name: 'print_text', title: 'Print Text', datatype: 'VString'},
23
+ {name: 'name', title: 'Code', datatype: 'VString'}
24
+ ] + default
25
+ w.tab :m_menu_item, title: 'Menu Item', entity: 'Fastui::MMenuItem', included_tab: 'm_menu', grid_kind: 'VTreeGrid', members: [
26
+ {name: 'id', title: 'ID', datatype: 'VInter', readonly: true},
27
+ {name: 'title', title: 'Title', datatype: 'VTreeText'},
28
+ {name: 'print_text', title: 'Print Text', datatype: 'VString'},
29
+ {name: 'name', title: 'Code', datatype: 'VString'},
30
+ {name: 'm_menu_id', title: 'Menu', datatype: 'VLookup', ref: {entity: 'Fastui::MMenu'}, default_logic: "{id:${m_menu_id},title:'${m_menu_title}'}"},
31
+ {name: 'window', title: 'Window', datatype: 'VString'},
32
+ {name: 'parent_id', title: 'Parent', datatype: 'VTree', ref: {entity: 'Fastui::MMenuItem'}}
33
+ ] + default
34
+ end
18
35
 
19
- conf.win :m_menu, title: '菜单', window_kind: 'maintain' do |w|
20
- w.tab :m_menu, title: '菜单', entity: 'Fastui::MMenu', readonly: true, members: [
21
- {name: 'id', title: 'ID', datatype: 'VNumber', readonly: true},
22
- {name: 'title', title: '标题', datatype: 'VText'},
23
- {name: 'print_text', title: '打印文本', datatype: 'VText'},
24
- {name: 'name', title: '标识', datatype: 'VText'}
25
- ] + default
26
- w.tab :m_menu_item, title: '菜单项', entity: 'Fastui::MMenuItem', included_tab: 'm_menu', members: [
27
- {name: 'id', title: 'ID', datatype: 'VNumber', readonly: true},
28
- {name: 'title', title: '标题', datatype: 'VText'},
29
- {name: 'print_text', title: '打印文本', datatype: 'VText'},
30
- {name: 'name', title: '标识', datatype: 'VText'},
31
- {name: 'm_menu_id', title: '对应菜单', datatype: 'VLookup', ref: {entity: 'Fastui::MMenu'}, default_logic: "{id:${m_menu_id},title:'${m_menu_title}'}"},
32
- {name: 'window', title: '对应窗口', datatype: 'VText'}
33
- ] + default
34
- end
36
+ conf.win :m_org, title: 'Org', window_kind: 'maintain' do |w|
37
+ w.tab :m_org, title: 'Org', entity: 'Fastui::MOrg', grid_kind: 'VTreeGrid', members: [
38
+ {name: 'id', title: 'ID', datatype: 'VInteger', readonly: true, },
39
+ {name: 'title', title: 'Name', datatype: 'VTreeText'},
40
+ {name: 'print_text', title: 'Print Text', datatype: 'VString'},
41
+ {name: 'name', title: 'Code', datatype: 'VString'},
42
+ {name: 'parent_id', title: 'Parent', datatype: 'VTree', ref: {entity: 'Fastui::MOrg'}, default_logic: "{id:${m_org_id},title:'${m_org_title}'}"}
43
+ ] + default
44
+ end
35
45
 
36
- conf.win :m_org, title: '组织', window_kind: 'maintain' do |w|
37
- w.tab :m_org, title: '组织', entity: 'Fastui::MOrg', grid_kind: 'VTreeGrid', members: [
38
- {name: 'id', title: 'ID', datatype: 'VNumber', readonly: true},
39
- {name: 'title', title: '名称', datatype: 'VTree'},
40
- {name: 'print_text', title: '打印文本', datatype: 'VText'},
41
- {name: 'name', title: '标识', datatype: 'VText'},
42
- {name: 'parent_id', title: '上级组织', datatype: 'VLookup', ref: {entity: 'Fastui::MOrg'}}
43
- ] + default
44
- end
46
+ conf.win :m_person, title: 'Person', window_kind: 'maintain' do |w|
47
+ w.tab :m_person, title: 'Person', entity: 'Fastui::MPerson', members: [
48
+ {name: 'id', title: 'ID', datatype: 'VInteger', readonly: true},
49
+ {name: 'title', title: 'Name', datatype: 'VString'},
50
+ {name: 'print_text', title: 'Print Text', datatype: 'VString', vtype: 'url'},
51
+ {name: 'name', title: 'Code', datatype: 'VString'},
52
+ {name: 'access_level', title: 'Access Level', datatype: 'VList'}
53
+ ] + default
54
+ w.tab :m_role, title: 'Role', entity: 'Fastui::MRole', included_tab: 'm_person', members: [
55
+ {name: 'id', title: 'ID', datatype: 'VInteger', readonly: true},
56
+ {name: 'title', title: 'Name', datatype: 'VString'},
57
+ {name: 'print_text', title: 'Print Text', datatype: 'VString'},
58
+ {name: 'name', title: 'Code', datatype: 'VString'}
59
+ ] + default
60
+ end
45
61
 
46
- conf.win :m_person, title: '人员', window_kind: 'maintain' do |w|
47
- w.tab :m_person, title: '人员', entity: 'Fastui::MPerson', members: [
48
- {name: 'id', title: 'ID', datatype: 'VNumber', readonly: true},
49
- {name: 'title', title: '标题', datatype: 'VText'},
50
- {name: 'print_text', title: '打印文本', datatype: 'VText'},
51
- {name: 'name', title: '标识', datatype: 'VText'},
52
- {name: 'access_level', title: '访问级别', datatype: 'VSingleChoice'}
53
- ] + default
54
- w.tab :m_role, title: '角色', entity: 'Fastui::MRole', included_tab: 'm_person', members: [
55
- {name: 'id', title: 'ID', datatype: 'VNumber', readonly: true},
56
- {name: 'title', title: '标题', datatype: 'VText'},
57
- {name: 'print_text', title: '打印文本', datatype: 'VText'},
58
- {name: 'name', title: '标识', datatype: 'VText'}
59
- ] + default
60
- end
61
-
62
- conf.win :m_list, title: '数据字典', window_kind: 'maintain' do |w|
63
- w.tab :m_list, title: '枚举', entity: 'Fastui::MList', members: [
64
- {name: 'id', title: 'ID', datatype: 'VNumber', readonly: true},
65
- {name: 'title', title: '标题', datatype: 'VText'},
66
- {name: 'print_text', title: '打印文本', datatype: 'VText'},
67
- {name: 'name', title: '标识', datatype: 'VText'}
68
- ] + default
69
- w.tab :m_list_item, title: '枚举项', entity: 'Fastui::MListItem', included_tab: 'm_list', members: [
70
- {name: 'id', title: 'ID', datatype: 'VNumber', readonly: true},
71
- {name: 'title', title: '标题', datatype: 'VText'},
72
- {name: 'print_text', title: '打印文本', datatype: 'VText'},
73
- {name: 'name', title: '标识', datatype: 'VText'}
74
- ] + default
75
- end
62
+ conf.win :m_list, title: 'Enumerate', window_kind: 'maintain' do |w|
63
+ w.tab :m_list, title: 'Enumerate', entity: 'Fastui::MList', members: [
64
+ {name: 'id', title: 'ID', datatype: 'VInteger', readonly: true},
65
+ {name: 'title', title: 'Name', datatype: 'VString'},
66
+ {name: 'print_text', title: 'Print Text', datatype: 'VString'},
67
+ {name: 'name', title: 'Code', datatype: 'VString'}
68
+ ] + default
69
+ w.tab :m_list_item, title: 'Enumerate Item', entity: 'Fastui::MListItem', included_tab: 'm_list', members: [
70
+ {name: 'id', title: 'ID', datatype: 'VInteger', readonly: true},
71
+ {name: 'title', title: 'Name', datatype: 'VString'},
72
+ {name: 'print_text', title: 'Print Text', datatype: 'VString'},
73
+ {name: 'name', title: 'Code', datatype: 'VString'},
74
+ {name: 'm_list_id', title: 'Enumerate', datatype: 'VLookup', ref: {entity: 'Fastui::MList'}}
75
+ ] + default
76
+ end
76
77
 
77
78
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - sgzhe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-21 00:00:00.000000000 Z
11
+ date: 2013-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -168,7 +168,6 @@ files:
168
168
  - app/assets/javascripts/fastui/app/view/vfield/VHtml.js
169
169
  - app/assets/javascripts/fastui/app/view/vfield/VInteger.js
170
170
  - app/assets/javascripts/fastui/app/view/vfield/VList.js
171
- - app/assets/javascripts/fastui/app/view/vfield/VLongComboBox.js
172
171
  - app/assets/javascripts/fastui/app/view/vfield/VLookup.js
173
172
  - app/assets/javascripts/fastui/app/view/vfield/VMultipleChoice.js
174
173
  - app/assets/javascripts/fastui/app/view/vfield/VNumber.js
@@ -179,7 +178,7 @@ files:
179
178
  - app/assets/javascripts/fastui/app/view/vfield/VTable.js
180
179
  - app/assets/javascripts/fastui/app/view/vfield/VText.js
181
180
  - app/assets/javascripts/fastui/app/view/vfield/VTree.js
182
- - app/assets/javascripts/fastui/app/view/vfield/VTreeCombobox.js
181
+ - app/assets/javascripts/fastui/app/view/vfield/VTreeText.js
183
182
  - app/assets/javascripts/fastui/app/view/vfield/VType.js
184
183
  - app/assets/javascripts/fastui/app/view/vfield/VYesOrNo.js
185
184
  - app/assets/javascripts/fastui/app/view/VForm.js
@@ -1,19 +0,0 @@
1
- Ext.define('FastUI.view.vfield.VLongCombobox',{
2
- extend: 'Ext.form.field.ComboBox',
3
-
4
- valueObject: {},
5
- winCtx:{},
6
- winId:0,
7
- rest:{},
8
-
9
- initComponent:function(){
10
- this.fieldLabel = this.getFValue('title');
11
- this.name = this.rest.getTableName() + '[' + this.getFValue('m_property').name + ']';
12
- this.disabled = this.getFValue('is_readonly');
13
- this.allowBlank = true;
14
- this.callParent();
15
- },
16
- getFValue:function (key) {
17
- return this.valueObject[key];
18
- }
19
- });
@@ -1,78 +0,0 @@
1
- Ext.define('FastUI.view.vfield.VTreeCombobox', {
2
- extend:'Ext.form.field.ComboBox',
3
- alias:'widget.vtreecombobox',
4
- valueObject: {},
5
- winCtx:{},
6
- winId:0,
7
- rest:{},
8
-
9
- editable: false,
10
- // queryMode: 'local',
11
- // select: Ext.emptyFn,
12
- displayField:'title',
13
- valueField:'id',
14
- initComponent:function () {
15
- this.fieldLabel = this.getFValue('title');
16
- this.name = this.rest.getTableName() + '[' + this.getFValue('name') + ']';
17
- this.disabled = this.getFValue('readonly');
18
- this.allowBlank = true;
19
- this.store = Ext.create('Ext.data.ArrayStore', {
20
- fields:['id', 'title'],
21
- data:[]
22
- });
23
- this.callParent();
24
- },
25
- createPicker: function() {
26
- var rest = Ext.create('FastUI.view.Rest', this.getMEntity());
27
- return Ext.create('Ext.tree.Panel', {
28
- hidden: true,
29
- floating: true,
30
- minHeight: 300,
31
- autoScroll: true,
32
- store: Ext.create('Ext.data.TreeStore', {
33
- fields:['id', {name:'text', mapping:'title'}],
34
- autoLoad: true,
35
- proxy:{
36
- type: 'ajax',
37
- url: rest.indexPath(),
38
- reader:{
39
- type:'json',
40
- root:'',
41
- record:''
42
- //successProperty:''
43
- }
44
- },
45
- root: {
46
- text:'Root',
47
- id:'',
48
- expanded: true
49
- }
50
- }),
51
- listeners: {
52
- itemclick: function (view, record) {
53
- var id = record.get('id');
54
- if (!this.store.getById(id)){
55
- this.store.add({id:id,title:record.get('text')});
56
- }
57
- this.setValue(id);
58
- this.collapse();
59
- },
60
- scope:this
61
- }
62
- });
63
- },
64
- getMEntity:function(){
65
- return this.valueObject.ref.entity;
66
- },
67
- getFValue:function (key) {
68
- return this.valueObject[key];
69
- },
70
- setValue:function(value){
71
- if(value && value.id && value.title){
72
- this.store.add(value);
73
- this.setValue(value.id);
74
- }else{
75
- this.callParent(arguments);
76
- }
77
- }
78
- });