fastui 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +3 -3
- data/app/assets/javascripts/fastui/app/view/FormFactory.js +1 -1
- data/app/assets/javascripts/fastui/app/view/VCustomForm.js +46 -18
- data/app/assets/javascripts/fastui/app/view/VForm.js +12 -12
- data/app/assets/javascripts/fastui/app/view/VGrid.js +119 -75
- data/app/assets/javascripts/fastui/app/view/VTab.js +1 -1
- data/app/assets/javascripts/fastui/app/view/vfield/{VCheckBox.js → VBool.js} +7 -6
- data/app/assets/javascripts/fastui/app/view/vfield/VFieldFactory.js +52 -21
- data/app/assets/javascripts/fastui/app/view/vfield/VHtmlEditor.js +3 -2
- data/app/assets/javascripts/fastui/app/view/vfield/VLookup.js +1 -0
- data/app/assets/javascripts/fastui/app/view/vfield/VRadio.js +34 -0
- data/app/assets/javascripts/fastui/app/view/vfield/VSexSelect.js +6 -13
- data/app/assets/javascripts/fastui/app/view/vfield/VType.js +7 -0
- data/app/assets/stylesheets/fastui/admin.css +0 -1
- data/lib/fastui/version.rb +1 -1
- metadata +5 -4
- data/app/assets/javascripts/fastui/app/view/vfield/VCheckboxGroup.js +0 -19
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmUzNDQwZjI2M2FmOWI2MzFjY2E4Y2IxOGY5NWFkMDIxYTNiYzM0Nw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZDdmNGJlYzE1YzAyZjIwMTRhZmI3OWE4YmM3MzU4MWFkZmQ5ZDRlNQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzM4OWQ4NTIzNGRkNmUwM2RiNTRiMTBiNTBmNmRmY2ViYzAwODk5ZjY4MmEx
|
10
|
+
ZDdiZDI1ZDE4ZmVmM2IwNTJlYzUyYTdiZDE3NzQ3NDQyZjE1ODJiMTdhMDY0
|
11
|
+
ZmJhODgwNGU0YmFmOTQ3ZWY0OWIzMDM1ZGIyNDZjMmY1OTMwOGM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTBjMTFkY2MxOWRiY2VmODExNmFkYzk1ZTE0YWZlOGFjN2Y3NDU2M2YyY2Mz
|
14
|
+
YWU4NTU1NGM3MTUzNWI3NzEzMDUwZDZlNWQxMTM0NjZiODdhZDdkNzYzYzdm
|
15
|
+
MDk0MTBmODBhM2M1N2Q1ZGM2ZjViZjEyZmFhZjc4YzkxMjdjNTE=
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# FastUI
|
2
2
|
|
3
|
-
FastUI is a framework for
|
4
|
-
|
3
|
+
FastUI is a Ajax Ruby framework for Rapid Development enterprise-level Web application style interfaces.
|
4
|
+
In Fastui you only have to write the domain classes in plain Ruby to get a web application ready for production.
|
5
5
|
|
6
|
-
|
6
|
+
This project rocks and uses MIT-LICENSE.
|
7
7
|
|
8
8
|
## Configuration
|
9
9
|
|
@@ -5,7 +5,7 @@ Ext.define('FastUI.view.FormFactory', {
|
|
5
5
|
if (form_kind == '') {
|
6
6
|
return Ext.create('FastUI.view.VForm', {tab: tab});
|
7
7
|
} else {
|
8
|
-
return Ext.create('FastUI.view.' +
|
8
|
+
return Ext.create('FastUI.view.' + form_kind, {tab: tab});
|
9
9
|
}
|
10
10
|
}
|
11
11
|
});
|
@@ -1,34 +1,62 @@
|
|
1
1
|
Ext.define('FastUI.view.VCustomForm', {
|
2
|
-
extend:'Ext.
|
3
|
-
requires: ['FastUI.view.vfield.VFieldFactory'],
|
2
|
+
extend:'Ext.Panel',
|
4
3
|
tab:{},
|
5
|
-
|
4
|
+
url: 'fastui',
|
5
|
+
method: 'POST',
|
6
|
+
autoEl: {tag: 'form'},
|
7
|
+
title:'Custom Form',
|
6
8
|
bodyPadding:5,
|
7
9
|
layout:'anchor',
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
anchor: '60%'
|
12
|
-
},
|
13
|
-
defaultType:'textfield',
|
14
|
-
border:true,
|
10
|
+
border:false,
|
11
|
+
html:'<input name="s11" /> <input name="g22" />',
|
12
|
+
|
15
13
|
initComponent:function () {
|
16
14
|
this.title = this.getValue('title');
|
17
|
-
this.items = this.getFFields();
|
18
15
|
this.callParent();
|
19
16
|
},
|
20
17
|
getValue:function(key){
|
21
18
|
return this.tab.valueObject[key];
|
22
19
|
},
|
23
20
|
getMEntity:function(){
|
24
|
-
return this.tab.valueObject.
|
21
|
+
return this.tab.valueObject.entity;
|
22
|
+
},
|
23
|
+
cmdEdit: function () {
|
24
|
+
var id = this.tab.getVGrid().selectedId();
|
25
|
+
this.url = this.tab.rest.updatePath(id);
|
26
|
+
this.method = 'PUT';
|
27
|
+
Ext.Ajax.request({
|
28
|
+
url: this.tab.rest.editPath(id),
|
29
|
+
success: function (response) {
|
30
|
+
var data = Ext.decode(response.responseText);
|
31
|
+
this.setValues(data);
|
32
|
+
},
|
33
|
+
failure: function () {
|
34
|
+
Ext.MessageBox.alert("提示", "操作失败!")
|
35
|
+
},
|
36
|
+
scope: this
|
37
|
+
});
|
25
38
|
},
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
39
|
+
cmdCreate:function(){
|
40
|
+
this.url = this.tab.rest.createPath();
|
41
|
+
this.method = 'POST';
|
42
|
+
this.getEl().dom.reset();
|
43
|
+
},
|
44
|
+
cmdSave:function(){
|
45
|
+
Ext.Ajax.request( {
|
46
|
+
url : this.url,
|
47
|
+
method : this.method,
|
48
|
+
form : this.id,
|
49
|
+
success: function () {
|
50
|
+
Ext.MessageBox.alert("提示", "操作成功!")
|
51
|
+
},
|
52
|
+
failure: function () {
|
53
|
+
Ext.MessageBox.alert("提示", "操作失败!")
|
54
|
+
},
|
55
|
+
scope: this
|
56
|
+
});
|
57
|
+
},
|
58
|
+
setValues: function (opt) {
|
59
|
+
|
32
60
|
}
|
33
61
|
|
34
62
|
});
|
@@ -2,20 +2,20 @@ Ext.define('FastUI.view.VForm', {
|
|
2
2
|
extend:'Ext.form.Panel',
|
3
3
|
requires: ['FastUI.view.vfield.VFieldFactory'],
|
4
4
|
tab:{},
|
5
|
-
title:'Simple Form',
|
6
5
|
bodyPadding:5,
|
7
6
|
layout:'anchor',
|
7
|
+
|
8
8
|
fieldDefaults: {
|
9
|
-
labelAlign: '
|
10
|
-
labelWidth:
|
11
|
-
anchor: '60%'
|
9
|
+
labelAlign: 'right',
|
10
|
+
labelWidth: 100,
|
11
|
+
//anchor: '60%'
|
12
|
+
width: 650
|
12
13
|
},
|
13
14
|
defaultType:'textfield',
|
14
15
|
border:false,
|
15
16
|
initComponent:function () {
|
16
17
|
this.title = this.getValue('title');
|
17
18
|
this.items = this.getFFields();
|
18
|
-
this.rest = Ext.create('FastUI.view.Rest', this.getMEntity());
|
19
19
|
this.callParent();
|
20
20
|
},
|
21
21
|
getValue:function(key){
|
@@ -37,7 +37,7 @@ Ext.define('FastUI.view.VForm', {
|
|
37
37
|
},
|
38
38
|
cmdCreate: function () {
|
39
39
|
var form = this.getForm();
|
40
|
-
form.url = this.rest.createPath();
|
40
|
+
form.url = this.tab.rest.createPath();
|
41
41
|
form.method = 'POST';
|
42
42
|
form.reset();
|
43
43
|
this.setAutoFields(form); // 有数据时要进行测试
|
@@ -48,7 +48,7 @@ Ext.define('FastUI.view.VForm', {
|
|
48
48
|
Ext.each(this.getValue('m_fields'), function (mfield) {
|
49
49
|
if (mfield.default_logic && mfield.default_logic.length > 0) {
|
50
50
|
logic = this.winCtx.parseCtx(this.winId, mfield.default_logic);
|
51
|
-
temp[this.rest.getTableName() + '[' + mfield.m_property.name + ']'] = Ext.decode(logic);
|
51
|
+
temp[this.tab.rest.getTableName() + '[' + mfield.m_property.name + ']'] = Ext.decode(logic);
|
52
52
|
}
|
53
53
|
}, this);
|
54
54
|
form.setValues(temp);
|
@@ -56,13 +56,13 @@ Ext.define('FastUI.view.VForm', {
|
|
56
56
|
cmdEdit: function () {
|
57
57
|
var id = this.tab.getVGrid().selectedId();
|
58
58
|
var form = this.getForm();
|
59
|
-
form.url = this.rest.updatePath(id);
|
59
|
+
form.url = this.tab.rest.updatePath(id);
|
60
60
|
form.method = 'PUT';
|
61
61
|
this.setEditValues(id, form);
|
62
62
|
},
|
63
63
|
setEditValues: function (id, form) {
|
64
64
|
Ext.Ajax.request({
|
65
|
-
url: this.rest.editPath(id),
|
65
|
+
url: this.tab.rest.editPath(id),
|
66
66
|
success: function (response) {
|
67
67
|
var data = Ext.decode(response.responseText);
|
68
68
|
var k, o = {};
|
@@ -73,12 +73,12 @@ Ext.define('FastUI.view.VForm', {
|
|
73
73
|
if (attr && attr.title) {
|
74
74
|
title = attr.title
|
75
75
|
}
|
76
|
-
o[this.rest.getTableName() + '[' + k + ']'] = {id: data[k], title: title};
|
76
|
+
o[this.tab.rest.getTableName() + '[' + k + ']'] = {id: data[k], title: title};
|
77
77
|
} else if (k.match(/_ids$/)) {
|
78
|
-
o[this.rest.getTableName() + '[' + k + '][]'] = data[k];
|
78
|
+
o[this.tab.rest.getTableName() + '[' + k + '][]'] = data[k];
|
79
79
|
}
|
80
80
|
else {
|
81
|
-
o[this.rest.getTableName() + '[' + k + ']'] = data[k];
|
81
|
+
o[this.tab.rest.getTableName() + '[' + k + ']'] = data[k];
|
82
82
|
}
|
83
83
|
}
|
84
84
|
// alert(Ext.encode(o));
|
@@ -79,94 +79,138 @@ Ext.define('FastUI.view.VGrid', {
|
|
79
79
|
getMColumns: function () {
|
80
80
|
return this.tab.valueObject.members || [];
|
81
81
|
},
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
82
|
+
buildField:function(fields, field){
|
83
|
+
field.datatype = field.datatype || '';
|
84
|
+
switch (field.datatype) {
|
85
|
+
case 'VLookup':
|
86
|
+
fields.push({
|
87
|
+
name: field.name.replace('_id', ''),
|
88
|
+
type: 'auto'
|
89
|
+
});
|
90
|
+
break;
|
89
91
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
92
|
+
case 'VSingleChoice':
|
93
|
+
fields.push({
|
94
|
+
name: field.name.replace('_id', ''),
|
95
|
+
type: 'auto'
|
96
|
+
});
|
97
|
+
break;
|
98
|
+
|
99
|
+
case 'VGroup':
|
100
|
+
Ext.each(field.members, function(member){
|
101
|
+
this.buildField(fields,member);
|
102
|
+
},this);
|
103
|
+
break;
|
97
104
|
|
98
|
-
|
105
|
+
default:
|
106
|
+
if(Array.isArray(field)){
|
107
|
+
Ext.each(field, function(f){
|
108
|
+
this.buildField(fields,f);
|
109
|
+
},this);
|
110
|
+
}else{
|
99
111
|
fields.push({
|
100
|
-
name:
|
112
|
+
name: field.name,
|
101
113
|
type: 'auto'
|
102
114
|
});
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
115
|
+
}
|
116
|
+
}
|
117
|
+
},
|
118
|
+
getGFields: function () {
|
119
|
+
var fields = [];
|
120
|
+
Ext.each(this.getMColumns(), function (column) {
|
121
|
+
this.buildField(fields, column);
|
108
122
|
}, this);
|
109
123
|
return fields;
|
110
124
|
},
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
125
|
+
buildColumn: function(columns, column){
|
126
|
+
column.datatype = column.datatype || '';
|
127
|
+
switch (column.datatype) {
|
128
|
+
case 'VLookup':
|
129
|
+
var entity = column.name.replace('_id', '');
|
130
|
+
columns.push({
|
117
131
|
text: column.title,
|
118
|
-
dataIndex: column.name
|
119
|
-
|
120
|
-
|
121
|
-
|
132
|
+
dataIndex: column.name,
|
133
|
+
display: column.display || 'all',
|
134
|
+
xtype: 'templatecolumn',
|
135
|
+
tpl: new Ext.XTemplate('<tpl for="' + entity + '">', '{title}', '</tpl>')
|
136
|
+
});
|
137
|
+
break;
|
122
138
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
);
|
141
|
-
break;
|
142
|
-
case 'VSingleChoice':
|
139
|
+
case 'MultipleChoice':
|
140
|
+
var plur_entity = column.name.replace('_ids', '').pluralize();
|
141
|
+
columns.push({
|
142
|
+
text: column.title,
|
143
|
+
dataIndex: column.name,
|
144
|
+
display: column.display || 'all',
|
145
|
+
xtype: 'templatecolumn',
|
146
|
+
tpl: new Ext.XTemplate('<tpl for="' + plur_entity + '">', '{title}', '</tpl>')
|
147
|
+
});
|
148
|
+
break;
|
149
|
+
|
150
|
+
case 'VSingleChoice':
|
151
|
+
columns.push({
|
152
|
+
text: column.title,
|
153
|
+
dataIndex: column.name,
|
154
|
+
display: column.display || 'all',
|
155
|
+
renderer: function(val) {
|
143
156
|
var list_store = FastUI.store.MListMgr.getStore(column.name);
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
157
|
+
var index = list_store.findExact('name', val);
|
158
|
+
if (index > -1) {
|
159
|
+
var rs = list_store.getAt(index).data;
|
160
|
+
return rs.title;
|
161
|
+
}
|
162
|
+
return "";
|
163
|
+
}
|
164
|
+
});
|
165
|
+
break;
|
166
|
+
|
167
|
+
case 'VSexSelect':
|
168
|
+
columns.push({
|
169
|
+
text: column.title,
|
170
|
+
dataIndex: column.name,
|
171
|
+
display: column.display || 'all',
|
172
|
+
renderer: function (val) {
|
173
|
+
return val ? '男' : '女'
|
174
|
+
}
|
175
|
+
});
|
176
|
+
break;
|
177
|
+
|
178
|
+
case 'VYesOrNo':
|
179
|
+
columns.push({
|
180
|
+
text: column.title,
|
181
|
+
dataIndex: column.name,
|
182
|
+
display: column.display || 'all',
|
183
|
+
renderer: function (val) {
|
184
|
+
return val ? '是' : '否';
|
185
|
+
}
|
186
|
+
});
|
187
|
+
break;
|
188
|
+
|
189
|
+
case 'VGroup':
|
190
|
+
Ext.each(column.members, function (member) {
|
191
|
+
this.buildColumn(columns, member);
|
192
|
+
},this);
|
193
|
+
break;
|
194
|
+
|
195
|
+
default:
|
196
|
+
if(Array.isArray(column)){
|
197
|
+
Ext.each(column, function(c){
|
198
|
+
this.buildColumn(columns, c);
|
199
|
+
},this);
|
200
|
+
}else{
|
201
|
+
columns.push({
|
202
|
+
text: column.title,
|
203
|
+
dataIndex: column.name,
|
204
|
+
display: column.display || 'all'
|
205
|
+
});
|
165
206
|
}
|
166
|
-
|
167
|
-
|
207
|
+
}
|
208
|
+
},
|
209
|
+
getGColumns: function () {
|
210
|
+
var columns = [];
|
211
|
+
Ext.each(this.getMColumns(), function (column) {
|
212
|
+
this.buildColumn(columns,column);
|
168
213
|
}, this);
|
169
|
-
|
170
214
|
return columns;
|
171
215
|
}
|
172
216
|
});
|
@@ -157,7 +157,7 @@ Ext.define('FastUI.view.VTab', {
|
|
157
157
|
this.vform = FastUI.view.FormFactory.createForm(this.form_kind, this);
|
158
158
|
this.add(this.vform);
|
159
159
|
}
|
160
|
-
return this.vform
|
160
|
+
return this.vform;
|
161
161
|
// if (this.form_kind == '') {
|
162
162
|
// if (!this.vform) {
|
163
163
|
// this.vform = Ext.create('FastUI.view.VForm', {tab: this});
|
@@ -1,19 +1,20 @@
|
|
1
|
-
Ext.define('FastUI.view.vfield.
|
2
|
-
extend: 'Ext.form.field.
|
3
|
-
|
1
|
+
Ext.define('FastUI.view.vfield.VBool',{
|
2
|
+
extend: 'Ext.form.field.Checkbox',
|
4
3
|
valueObject: {},
|
5
4
|
winCtx:{},
|
6
5
|
winId:0,
|
7
6
|
rest:{},
|
8
7
|
|
8
|
+
inputValue: 'true',
|
9
|
+
uncheckedValue: 'false',
|
9
10
|
initComponent:function(){
|
10
11
|
this.fieldLabel = this.getFValue('title');
|
11
|
-
this.name = this.rest.getTableName() + '[' + this.getFValue('
|
12
|
-
this.disabled = this.getFValue('
|
12
|
+
this.name = this.rest.getTableName() + '[' + this.getFValue('name') + ']';
|
13
|
+
this.disabled = this.getFValue('readonly');
|
13
14
|
this.allowBlank = true;
|
14
15
|
this.callParent();
|
15
16
|
},
|
16
17
|
getFValue:function (key) {
|
17
|
-
return this.valueObject[key];
|
18
|
+
return this.valueObject[key] || '';
|
18
19
|
}
|
19
20
|
});
|
@@ -22,56 +22,87 @@ Ext.define('FastUI.view.vfield.VFieldFactory', {
|
|
22
22
|
},
|
23
23
|
|
24
24
|
buildField: function (field, winCtx, winId, rest) {
|
25
|
-
|
25
|
+
field.datatype = field.datatype || '';
|
26
26
|
switch (field.datatype) {
|
27
27
|
case 'VText':
|
28
28
|
return Ext.create('FastUI.view.vfield.VText', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
|
29
|
-
|
29
|
+
|
30
30
|
case 'VTree':
|
31
31
|
return Ext.create('FastUI.view.vfield.VTree', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
|
32
|
-
|
32
|
+
|
33
33
|
case 'VDate':
|
34
34
|
return Ext.create('FastUI.view.vfield.VDate', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
|
35
|
-
|
35
|
+
|
36
36
|
case 'VHtmlEditor':
|
37
37
|
return Ext.create('FastUI.view.vfield.VHtmlEditor', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
|
38
|
-
|
38
|
+
|
39
39
|
case 'VSingleChoice':
|
40
40
|
return Ext.create('FastUI.view.vfield.VSingleChoice', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
|
41
|
-
|
41
|
+
|
42
42
|
case 'VMultipleChoice':
|
43
43
|
return Ext.create('FastUI.view.vfield.VMultipleChoice', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
|
44
|
-
|
45
|
-
case
|
46
|
-
return Ext.create('FastUI.view.vfield.
|
47
|
-
|
44
|
+
|
45
|
+
case 'VRadio':
|
46
|
+
return Ext.create('FastUI.view.vfield.VRadio', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
|
47
|
+
|
48
48
|
case 'VTextArea':
|
49
49
|
return Ext.create('FastUI.view.vfield.VTextArea', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
|
50
|
-
|
50
|
+
|
51
51
|
case 'VNumber':
|
52
52
|
return Ext.create('FastUI.view.vfield.VNumber', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
|
53
|
-
|
53
|
+
|
54
|
+
case 'VBool':
|
55
|
+
return Ext.create('FastUI.view.vfield.VBool', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
|
56
|
+
|
54
57
|
case 'VCheckbox':
|
55
58
|
return Ext.create('FastUI.view.vfield.VCheckbox', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
|
56
|
-
|
57
|
-
case 'VCheckboxGroup':
|
58
|
-
return Ext.create('FastUI.view.vfield.VCheckboxGroup', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
|
59
|
-
break;
|
59
|
+
|
60
60
|
case 'VSexSelect':
|
61
61
|
return Ext.create('FastUI.view.vfield.VSexSelect', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
|
62
|
-
|
62
|
+
|
63
63
|
case 'VFile':
|
64
64
|
return Ext.create('FastUI.view.vfield.VFile', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
|
65
|
-
|
65
|
+
|
66
66
|
case 'VYesOrNo':
|
67
67
|
return Ext.create('FastUI.view.vfield.VYesOrNo', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
|
68
|
-
|
68
|
+
|
69
69
|
case 'VList':
|
70
70
|
return Ext.create('FastUI.view.vfield.VCombobox', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
|
71
|
-
|
71
|
+
|
72
72
|
case 'VLookup':
|
73
73
|
return Ext.create('FastUI.view.vfield.VLookup', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
|
74
|
-
|
74
|
+
|
75
|
+
case 'VGroup':
|
76
|
+
var box = Ext.create('Ext.form.FieldSet',{
|
77
|
+
title: field.title,
|
78
|
+
collapsible: true,
|
79
|
+
defaults: {
|
80
|
+
labelWidth: 89,
|
81
|
+
layout: {
|
82
|
+
type: 'hbox',
|
83
|
+
defaultMargins: {top: 0, right: 0, bottom: 5, left: 0}
|
84
|
+
}
|
85
|
+
},
|
86
|
+
defaultType: 'textfield'
|
87
|
+
});
|
88
|
+
Ext.each(field.members, function(member){
|
89
|
+
box.add(this.buildField(member, winCtx, winId, rest));
|
90
|
+
},this);
|
91
|
+
return box;
|
92
|
+
|
93
|
+
default:
|
94
|
+
if(Array.isArray(field)){
|
95
|
+
var line = Ext.create('Ext.container.Container', {
|
96
|
+
layout: 'hbox',
|
97
|
+
margin: '0 0 5 0',
|
98
|
+
defaultType: 'textfield'
|
99
|
+
});
|
100
|
+
Ext.each(field, function(f){
|
101
|
+
line.add(this.buildField(f, winCtx, winId, rest));
|
102
|
+
},this);
|
103
|
+
return line;
|
104
|
+
}
|
105
|
+
|
75
106
|
}
|
76
107
|
}
|
77
108
|
});
|
@@ -5,11 +5,12 @@ Ext.define('FastUI.view.vfield.VHtmlEditor',{
|
|
5
5
|
winCtx:{},
|
6
6
|
winId:0,
|
7
7
|
rest:{},
|
8
|
+
width:650,
|
8
9
|
|
9
10
|
initComponent:function(){
|
10
11
|
this.fieldLabel = this.getFValue('title');
|
11
|
-
this.name = this.rest.getTableName() + '[' + this.getFValue('
|
12
|
-
this.disabled = this.getFValue('
|
12
|
+
this.name = this.rest.getTableName() + '[' + this.getFValue('name') + ']';
|
13
|
+
this.disabled = this.getFValue('readonly');
|
13
14
|
this.allowBlank = true;
|
14
15
|
this.callParent();
|
15
16
|
},
|
@@ -0,0 +1,34 @@
|
|
1
|
+
Ext.define('FastUI.view.vfield.VRadio',{
|
2
|
+
extend: 'Ext.form.RadioGroup',
|
3
|
+
valueObject: {},
|
4
|
+
winCtx:{},
|
5
|
+
winId:0,
|
6
|
+
rest:{},
|
7
|
+
width:300,
|
8
|
+
|
9
|
+
initComponent:function(){
|
10
|
+
this.fieldLabel = this.getFValue('title');
|
11
|
+
this.disabled = this.getFValue('readonly');
|
12
|
+
this.allowBlank = true;
|
13
|
+
this.items = this.getFFields();
|
14
|
+
this.callParent();
|
15
|
+
},
|
16
|
+
getFValue:function (key) {
|
17
|
+
return this.valueObject[key] || '';
|
18
|
+
},
|
19
|
+
getFFields:function(){
|
20
|
+
var fields = [];
|
21
|
+
var store = FastUI.store.MListMgr.getStore(this.getFValue('name'));
|
22
|
+
store.each(function(item, index, count) {
|
23
|
+
fields.push({
|
24
|
+
name: this.rest.getTableName() + '[' + this.getFValue('name') + ']',
|
25
|
+
boxLabel: item.data.title,
|
26
|
+
inputValue: item.data.name,
|
27
|
+
width:100
|
28
|
+
});
|
29
|
+
},this);
|
30
|
+
return fields;
|
31
|
+
}
|
32
|
+
|
33
|
+
});
|
34
|
+
|
@@ -1,27 +1,20 @@
|
|
1
1
|
Ext.define('FastUI.view.vfield.VSexSelect',{
|
2
|
-
extend: 'Ext.form.
|
2
|
+
extend: 'Ext.form.RadioGroup',
|
3
3
|
valueObject: {},
|
4
4
|
winCtx:{},
|
5
5
|
winId:0,
|
6
6
|
rest:{},
|
7
7
|
|
8
|
-
|
9
|
-
displayField:"name",
|
10
|
-
forceSelection: true,
|
11
|
-
triggerAction: 'all',
|
12
|
-
selectOnFocus:true,
|
13
|
-
queryMode:"local",
|
14
|
-
hiddenName:this.name,
|
8
|
+
width:300,
|
15
9
|
|
16
10
|
initComponent:function(){
|
17
11
|
this.fieldLabel = this.getFValue('title');
|
18
|
-
this.name = this.rest.getTableName() + '[' + this.getFValue('m_property').name + ']';
|
19
12
|
this.disabled = this.getFValue('readonly');
|
20
13
|
this.allowBlank = true;
|
21
|
-
this.
|
22
|
-
|
23
|
-
|
24
|
-
|
14
|
+
this.items = [
|
15
|
+
{ boxLabel: '男', name: this.rest.getTableName() + '[' + this.getFValue('name') + ']', inputValue: 'true', width:100 },
|
16
|
+
{ boxLabel: '女', name: this.rest.getTableName() + '[' + this.getFValue('name') + ']', inputValue: 'false', width:100 }
|
17
|
+
];
|
25
18
|
this.callParent();
|
26
19
|
},
|
27
20
|
getFValue:function (key) {
|
data/lib/fastui/version.rb
CHANGED
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
|
+
version: 0.1.3
|
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-
|
11
|
+
date: 2013-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -159,8 +159,7 @@ files:
|
|
159
159
|
- app/assets/javascripts/fastui/app/view/VCriteria.js
|
160
160
|
- app/assets/javascripts/fastui/app/view/VCustomForm.js
|
161
161
|
- app/assets/javascripts/fastui/app/view/VCustomTab.js
|
162
|
-
- app/assets/javascripts/fastui/app/view/vfield/
|
163
|
-
- app/assets/javascripts/fastui/app/view/vfield/VCheckboxGroup.js
|
162
|
+
- app/assets/javascripts/fastui/app/view/vfield/VBool.js
|
164
163
|
- app/assets/javascripts/fastui/app/view/vfield/VDate.js
|
165
164
|
- app/assets/javascripts/fastui/app/view/vfield/VFieldFactory.js
|
166
165
|
- app/assets/javascripts/fastui/app/view/vfield/VFile.js
|
@@ -169,11 +168,13 @@ files:
|
|
169
168
|
- app/assets/javascripts/fastui/app/view/vfield/VLookup.js
|
170
169
|
- app/assets/javascripts/fastui/app/view/vfield/VMultipleChoice.js
|
171
170
|
- app/assets/javascripts/fastui/app/view/vfield/VNumber.js
|
171
|
+
- app/assets/javascripts/fastui/app/view/vfield/VRadio.js
|
172
172
|
- app/assets/javascripts/fastui/app/view/vfield/VSexSelect.js
|
173
173
|
- app/assets/javascripts/fastui/app/view/vfield/VSingleChoice.js
|
174
174
|
- app/assets/javascripts/fastui/app/view/vfield/VText.js
|
175
175
|
- app/assets/javascripts/fastui/app/view/vfield/VTextArea.js
|
176
176
|
- app/assets/javascripts/fastui/app/view/vfield/VTree.js
|
177
|
+
- app/assets/javascripts/fastui/app/view/vfield/VType.js
|
177
178
|
- app/assets/javascripts/fastui/app/view/vfield/VYesOrNo.js
|
178
179
|
- app/assets/javascripts/fastui/app/view/VForm.js
|
179
180
|
- app/assets/javascripts/fastui/app/view/VGrid.js
|
@@ -1,19 +0,0 @@
|
|
1
|
-
Ext.define('FastUI.view.vfield.VCheckboxGroup',{
|
2
|
-
extend: 'Ext.form.VCheckboxGroup',
|
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
|
-
});
|