multiSelect.html
2.39 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
<div id="apilist4multi" class="page out" data-title="接口列表-多选">
<div class="page-content" id="apilist4multi_content">
<div id="apilist4multi-header"></div>
<div id="apilist4multi-a" ></div>
<div id="apilist4multi-b" ></div>
</div>
</div>
<script>
require(["mUtil", "NavHeader", "APIList", "Button"], function (mUtil, NavHeader, APIList, Button) {
new NavHeader({
el: "apilist4multi-header",
container: "#apilist4multi",
option: {
fixed: true,
title: "接口列表插件",
smallTitle: "apilist4multi"
}
}).render();
new APIList({
el: "apilist4multi-a",
option: {
apiConfig: {
api: {
id: "4ff3c2114b484c9b888c32554c38cc7b",
name: "文档列表"
},
request: {
params: {
query: [
{name: "categoryid", value: ""},
{name: "searchKey", value: "{search_key}"},
{name: "pageNo", value: "{page_no}"},
{name: "pageSize", value: "{page_size}"}
],
body: {}
},
path: "/X-WEV-DocList",
type: "GET"
},
response: {
type: "HTML",
formats: {
DATAS: "datas",
TOTAL_SIZE: "totalSize",
STATUS_CODE: {
key: "status",
value: 1
},
ERROR_MSG: "errMsg"
}
}
},
pageStart: 1,
pageSize: 10,
normalview: {
imgfield: "",
titlefield: "{subject}",
otherfields: [
"{owner}, {createtime}"
]
},
normalSearch: {
hide: false,
tip: ""
},
options: {
readonly: true,
selectable: true, //数据可选
showOnePage: false //显示一页
}
}
}).render();
new Button({
el:"apilist4multi-b",
container: "#apilist4multi",
option:{
layout : "relative",
items : [
{
text : "全选",
click : function(){
var flag = $(this).text().trim() === "全选";
$(this).closest(".wev-btn").children("span").html(flag ? "取消全选" : "全选");
Mobile_NS.toggleListData(flag, "apilist4multi-a");
}
},{
text : "确定",
click : function(){
Mobile_NS.setAPIBrowser4MultiSelect("apilist4multi-a");//多选赋值脚本
}
}
],
fixed: true //固定底部
}
}).render();
});
</script>