forked from lvjian700/formdesigner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata.js
81 lines (65 loc) · 1.29 KB
/
data.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//FormCanvas
var Form = {
id: '',// database table name
//RowsCollection
defaults: {
layout: 'fit',
label-width: '80'
},
rows: [{//Row
index: 0,
columnCount: 3,
layout: 'fit,width'
//RowCellCollection
columns: [{//RowCell
index: 0,
colspan: 1,
content: {//Field
id: '{{property}}_field',
name: '{{property}}',
label: '标题',//这个字段值的优先级高于字典
type: 'text|password|number|user|time-length|date',
value: '',
required: false,
}
}]//end columns
}]//end rows
};
var CanvasRow = function(options) {
};
var CanvasCell = function(options) {
};
var Field = function(options) {
if(typeof options === 'undefined') {
throw 'The options can not be undefined.';
}
if(typeof options[name] === 'undefined') {
throw 'The options must has [name] property';
}
var opt = {
type: 'text',
required: false,
value: '',
place-holder: 'none'
};
$.extend(opt, options);
$.extend(Field.prototype, opt);
};
//
var ToolboxGroups = [{ // ToolboxGroup
title: 'Form Tools',
items: [{//ToolboxItem
text: '输入框',
iconClass: '',
data-type: 'input-text',
getDragHelper: function() {
}
}, {
text: '选择框',
iconClass: 'drop-box-icon',
data-type: 'drop-box'
}]
}, {
title: 'Layout Tools'
items: []
}];