arisu.js 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,130 +0,0 @@
1
- /** *
2
- *
3
- * @描述:单页JS模板
4
- * @作者:林舒涛
5
- *
6
- * 单页JS模板
7
- *
8
- * **/
9
-
10
- jQuery(function ($) {
11
- "use strict";
12
-
13
- var hash = window.location.hash;
14
- var base = new Base();
15
-
16
- // 1. 方法入口
17
- var App = {
18
- init: function() {
19
- util.batch();
20
- util.detailSearch();
21
- util.submit();
22
- util.validate();
23
- }
24
- };
25
-
26
- // 2. 数据处理
27
- var action = {
28
- // 2.1 请求后台接口,获取数据
29
- get: function(fun) {
30
- },
31
-
32
- // 2.2 添加数据
33
- add: function() {
34
- },
35
-
36
- // 2.3 编辑数据
37
- edit: function() {
38
- },
39
-
40
- // 2.4 数据删除
41
- remove: function() {
42
- $(".be-remove").unbind("click");
43
- $(".be-remove").click(function() {
44
- var id = $(this).data("id");
45
- cf("您确定要将数据删除吗?", "确定", function() {
46
- removeEvent.removeAction([id]);
47
- });
48
- })
49
- }
50
- };
51
-
52
- // 3. 工具方法
53
- var util = {
54
- // 3.1 表单提交配置
55
- submit: function() {
56
- },
57
-
58
- // 3.2 验证
59
- /** util.validate();
60
- validate[required, maxSize[50]] 最大50个字符
61
- validate[required, max[150]] 最大值为150
62
-
63
- validate[required,custom[onlyLetterNumber]]
64
- validate[required,ajax[checkWordContent]]
65
- validate[required, custom[url]]
66
- validate[custom[onlyLetterNumber2]]
67
- validate[required,custom[email]]
68
- validate[required, custom[number], min[3], max[150]]
69
- var isSuccessed = $("#be-form").validationEngine("validate");
70
- if (isSuccessed) {}
71
- **/
72
- validate: function() {
73
- $("#be-add-form, #be-edit-form").validationEngine({
74
- focusFirstField : false,
75
- promptPosition: "topRight"
76
- });
77
- },
78
-
79
- // 3.3 数据批量处理链接
80
- batch: function() {
81
-
82
-
83
- },
84
-
85
-
86
- hotkeys: function() {
87
- $(document).bind("keydown", "return", function(e) {
88
- $("#{module}-search").click();
89
- return false;
90
- });
91
- $("input").bind("keydown", "return", function(e) {
92
- $("#{module}-search").click();
93
- return false;
94
- });
95
- }
96
-
97
- };
98
-
99
- // 4. 数据添加方法
100
- var addEvent = {};
101
-
102
- // 5. 数据删除方法
103
- var removeEvent = {
104
- // 5.1 数据删除后端请求
105
- removeAction: function(ids) {
106
-
107
- $.ajax({
108
- type: "post",
109
- url: "../{module}/del{Module}.action",
110
- data: {ids: ids},
111
- dataType: "json",
112
- success: function(data){
113
- if (data.result == "200") {
114
- alert(data.message, "info", 2);
115
- $("#{module}-list").iListReload({});
116
- } else {
117
- alert(data.message, "error", 2);
118
- }
119
- },
120
- error: base.error
121
- });
122
- }
123
- };
124
-
125
- // 6. 数据编辑方法
126
- var editEvent = {};
127
-
128
-
129
- App.init();
130
- });