selectFromMECHandlerPool.jsp
5 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="com.weaver.formmodel.util.StringHelper"%>
<%@ include file="/mobilemode/admin/init.jsp"%>
<%
String id = StringHelper.null2String(request.getParameter("id"),"");
%>
<HTML><HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link type="text/css" rel="stylesheet" href="/mobilemode/css/mec/mec_design_wev8.css" />
<link type="text/css" rel="stylesheet" href="/font/mobilemode/plugin/iconfont.css" />
<link type="text/css" rel="stylesheet" href="/mobilemode/admin/src/common/css/common.css" />
<style>
*{
font: 12px Microsoft YaHei;
}
html,body{
height: 100%;
margin: 0px;
padding: 0px;
overflow: hidden;
}
.mec_item {
display: block;
border: 1px solid #fff;
width: calc(100% - 12px);
height: 36px;
margin: 4px;
}
.mec_items:after {
content: " ";
clear: both;
display: table;
}
.item_sel:after {
content: "\e66f";
position: relative;
float: right;
top: 6px;
right: 6px;
font-size: 16px;
color: #108EE9;
}
.mec_node {
width: 100%;
height: 36px;
display: block;
font-family: iconfont;
font-size: 16px;
}
.mec_node:hover {
color: #108EE9;
transition: .3 all ease;
}
.mec_node em{
margin: 0;
background: none;
font-size: 20px;
line-height: 1;
vertical-align: middle;
}
.mec_node span{
margin: 2px 0 0 2px;
display: inline-block;
width: 78%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font: 16px Microsoft YaHei;
}
.mec_item,
.mec_node,
.mec_node em,
.mec_node span{
cursor: pointer;
text-align: left;
}
#mecSearchInput {
position: fixed;
width: calc(100% - 24px);
}
#mecHandlerContainer {
margin-top: 40px;
height: calc(100% - 40px);
overflow-y: auto;
overflow-x: hidden;
}
/**
页面加载后没有数据的提示样式
*/
#noDataMes {
text-align: center;
color: #666;
padding-right: 10px;
padding-top: 15px;
font-size: 12px;
}
#openCreateTabDialog{
cursor: pointer;
color: #0aa7ee;
text-decoration-line: underline;
}
</style>
<script>
define('mec_handlerpool', ['jquery'], function(){
var mecHandlerids = [];
var isCreate = false;
$(document).ready(function () {
var htm = top.MEC_Tab_BeChoose_Html_<%=id%>;
htm = htm.length == 0 ? "<div id='noDataMes'><%=SystemEnv.getHtmlNoteName(6249, user.getLanguage())%>,<span id='openCreateTabDialog'><%=SystemEnv.getHtmlNoteName(4362, user.getLanguage())%></span></div>" : htm;
var $mecHandlerContainer = $("#mecHandlerContainer");
$mecHandlerContainer.append(htm);
$(".mec_node").click(function(){
var $this = $(this);
var id = $this.attr('id');
if(!$this.hasClass("item_sel")){
$this.addClass("item_sel");
!~mecHandlerids.indexOf(id) && mecHandlerids.push($(this).attr('id'));
}else{
$this.removeClass("item_sel");
~mecHandlerids.indexOf(id) && mecHandlerids.splice(mecHandlerids.indexOf(id), 1);
}
});
$('#mecSearchInput input').on('input', function(){
var inputEl = $(this),
val = (inputEl.val() || '').toLowerCase(),
keyEls = $('#mecHandlerContainer .mec_item span'),
ismatch = false;
if(keyEls.length == 0) return;
keyEls.each(function(index, keyEl){
keyEl = $(keyEl);
ismatch = (keyEl.text() || '').toLowerCase().indexOf(val) != -1;
keyEl.parents('.mec_item').toggle(ismatch);
});
});
//点击新建
$("#openCreateTabDialog").click(function () {
//关闭从页面添加的弹出框
isCreate = true;
onOK();
})
});
return {
returnResult: function(){
var id = '<%=id%>';
var mecHandleridJsons = []
mecHandlerids.forEach(function(item){
var mecHandlerid = {};
mecHandlerid['mecHandlerid'] = item;
mecHandleridJsons.push(mecHandlerid);
});
if(top && top.callTopDlgHookFn){
var result = {
"mecHandlerIDs" : $.isEmptyObject(mecHandleridJsons) ? "" : JSON.stringify(mecHandleridJsons),
"tabID" : id,
"isCreate" : isCreate
};
top.callTopDlgHookFn(result);
}
if (!isCreate) onClose();
}
}
});
require(['mec_handlerpool']);
function onOK(){
require(['mec_handlerpool'], function (mec_handlerpool) {
mec_handlerpool.returnResult();
});
}
function onClose(){
top.closeTopDialog();
}
</script>
</HEAD>
<body>
<div style="padding: 10px 0px 10px 12px;height: 100%;">
<div id="mecSearchInput">
<input class="form-control" placeholder="<%=SystemEnv.getHtmlNoteName(4748, user.getLanguage())%>">
</div>
<div id="mecHandlerContainer"></div>
</div>
</body>
</html>