demo.html
2.45 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<div id="fhandwriting_page" class="page out" data-title="批注">
<div class="page-content" id="fhandwriting_content">
<div id="fhandwriting-header"></div>
<div id="fhandwriting-form"></div>
<div id="fhandwriting"></div>
<div id="fhandwriting-fbutton"></div>
</div>
</div>
<script>
require(["NavHeader", "Form", "FHandwriting", "FButton", "mUtil"], function(NavHeader, Form, FHandwriting, FButton, mUtil) {
var _u = require("mUtil");
var hasClsPicker = typeof clsPicker !== "undefined";
if(!hasClsPicker) {
new NavHeader({
el: "fhandwriting-header",
option: {
title:"表单-批注",
smallTitle:"fhandwriting"
}
}).render();
new Form({
el: "fhandwriting-form",
option: {
submit : {
action : "/mobilemode/mobile/demo/plugin/Form/formAction.jsp",//提交地址
validate : function(){
//表单提交前验证脚本
}
}
}
}).render();
}
new FHandwriting({
el: "fhandwriting",
option: {
form : "fhandwriting-form",
field : {
label : "签字意见",//显示名
name : "f1", //字段名
value : ""//字段值
},
hint : "点击输入",
height: 150,
required : true,
readonly : false
}
}).render().then(function() {
if (!hasClsPicker) return;
_u.vetically("#fhandwriting");
clsPicker.golalSetting({
container: ".wev-comp-FHandwriting",
type: "FHandwriting"
});
new clsPicker({
selector: ".wev-handwriting-label",
text: ".wev-handwriting-label",
lineYSkew: 20,
skew: [8, ""],
position: "top right"
});
new clsPicker({
selector: ".wev-field.vertical>div:nth-child(2)",
text: " ",
lineYSkew: 50,
skew: [1.2, ""],
position: "top left"
});
new clsPicker({
selector: ".wev-handwriting-wrap.wev-handwriting-empty",
text: ".wev-handwriting-wrap",
skew: [8, ""],
lineYSkew: 20
});
new clsPicker({
selector: ".wev-handwriting-wrap div",
text: " ",
skew: [1, ""],
lineYSkew: 20,
position: "bottom left"
});
});
if(!hasClsPicker) {
new FButton({
el: "fhandwriting-fbutton",
container: "#fhandwriting_page",
option: {
form : "fhandwriting-form",
btns : [
{
text : "重置",
action : "reset"
},
{
text : "提交",
action : "submit",
callback : function(billid) {
console.log(billid);
},
remindMsg : "操作成功"
}
],
fixed : true
}
}).render();
}
mUtil.trigger('load');//页面渲染完成回调
});
</script>