170 lines
4.7 KiB
HTML
Executable File
170 lines
4.7 KiB
HTML
Executable File
<!Doctype html>
|
|
<html style="background:none;">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<title>Project_Create</title>
|
|
<!--coe css -->
|
|
<link rel="stylesheet" href="../commons/css/awsui.css">
|
|
<link rel="stylesheet" type="text/css" href="../<I18N#COEPATH>/css/public.css">
|
|
|
|
<script type="text/javascript" src="../commons/js/jquery/scripts/jquery.js"></script>
|
|
<script type="text/javascript" src="../commons/js/awsui.js"></script>
|
|
<script type="text/javascript" src="../commons/js/public.js"></script>
|
|
<!-- <script type="text/javascript" src="../apps/com.actionsoft.apps.coe.pal/js/pal.ws.userlist.js"></script> -->
|
|
|
|
<style>
|
|
.table_content tr{
|
|
text-align: center;
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
var data = <#userList>;
|
|
var checkedArr = {};
|
|
function getSelectList() {
|
|
var selectList = "";
|
|
var selectIdList = "";
|
|
var i = 0;
|
|
for(var id in checkedArr){
|
|
if (i == 0) {
|
|
selectList += checkedArr[id];
|
|
selectIdList += id;
|
|
} else {
|
|
selectList += " " + checkedArr[id];
|
|
selectIdList += "," + id;
|
|
}
|
|
i++;
|
|
}
|
|
var data = {
|
|
selectList : selectList,
|
|
selectIdList : selectIdList
|
|
};
|
|
return data;
|
|
}
|
|
|
|
$(document).ready(function(){
|
|
// 初始化数据列表
|
|
if(data.length > 0) {
|
|
for (var i = 0; i < data.length; i++) {
|
|
data[i].alignName = data[i].name.replace(/>/g, ">").replace(/</g, "<");
|
|
if (data[i].isChecked == "checked") {
|
|
checkedArr[data[i].id] = data[i].alignName;
|
|
}
|
|
}
|
|
initData(data);
|
|
}
|
|
var flag = true;
|
|
$('#user_list').find('input').each(function (){
|
|
if ($(this).prop("checked") == false) {
|
|
flag = false;
|
|
return;
|
|
}
|
|
});
|
|
if(flag){
|
|
$("#selectAll").check("check");
|
|
}
|
|
//快速查询
|
|
// quickSearch();
|
|
});
|
|
|
|
// 初始化列表数据
|
|
function initData(data) {
|
|
$('#user_list').html("");
|
|
var html = "";
|
|
for(var i = 0; i < data.length; i++) {
|
|
var user = data[i];
|
|
html += "<tr>";
|
|
html += "<td style='padding:0px;'>";
|
|
html += "<input group='all1' class='awsui-checkbox' type='checkbox' name='checkinput' alignName='" + user.alignName + "' id='" + user.id + "' userName='" + user.userName + "'" + user.isChecked + "/>";
|
|
html += "</td>";
|
|
html += "<td>";
|
|
html += user.name;
|
|
html += "</td>";
|
|
html += "<td>";
|
|
html += user.isAdmin;
|
|
html += "</td>";
|
|
html += "</tr>";
|
|
}
|
|
$('#user_list').html(html);
|
|
$('#user_list').check();
|
|
$("input[name='checkinput']").on("ifChanged",function(){
|
|
if($(this).prop("checked")){
|
|
checkedArr[$(this).attr("id")] = $(this).attr("alignName");
|
|
} else {
|
|
delete checkedArr[$(this).attr("id")];
|
|
}
|
|
});
|
|
}
|
|
|
|
// 快速搜索
|
|
function quickSearch() {
|
|
$("#searchEdit").bind("keypress",function(event){
|
|
if(event.keyCode == "13"){
|
|
searchEdit();
|
|
}
|
|
});
|
|
}
|
|
|
|
function searchEdit() {
|
|
var resultArr = [];
|
|
if($("#searchEdit").val().trim().length > 0) {
|
|
var copyArr = $.extend(true, [], data);
|
|
var text = $("#searchEdit").val().trim().toUpperCase();
|
|
for(var i = 0; i < copyArr.length; i++) {
|
|
var obj = copyArr[i];
|
|
if (obj.name.replace(/>/g, "").replace(/</g, "").toUpperCase().indexOf(text) != -1) {// 查询到
|
|
resultArr.push(obj);
|
|
}
|
|
}
|
|
} else {
|
|
resultArr = $.extend(true, [], data);
|
|
}
|
|
for(var i in resultArr) {
|
|
if (checkedArr[resultArr[i].id] != undefined) {
|
|
resultArr[i].isChecked = "checked";
|
|
} else {
|
|
resultArr[i].isChecked = "";
|
|
}
|
|
}
|
|
initData(resultArr);
|
|
}
|
|
|
|
</script>
|
|
</head>
|
|
|
|
<body style="background:none;overflow:hidden;">
|
|
<div style="margin-left:20px;margin-right:25px;margin-bottom:7px;">
|
|
<div style="position:relative;top:5px;">
|
|
<!-- <input id="searchEdit" type="text" class="awsui-input" style="width:710px;" placeholder="快速查询" value=""/> -->
|
|
<span class="awsui-input-wrapper">
|
|
<input id="searchEdit" type="text" style="width:100%;" class="awsui-input" oninput="searchEdit();" onpropertychange="searchEdit();" placeholder="快速查询" value="" autocomplete="off"/>
|
|
<span style="cursor:pointer;" class="awsui-input-suffix">
|
|
<i style="cursor:pointer;" class="awsui-iconfont" onclick="searchEdit();"></i>
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div style="overflow:auto;height:320px;">
|
|
<table class="awsui-ux">
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
<table class="table table-thin table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th class="selectall"><input group="all1" id="selectAll" type="checkbox" class="awsui-checkbox check-all" ></th>
|
|
<th>用户名</th>
|
|
<th>管理员</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="user_list" class="table_content">
|
|
</tbody>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</body>
|
|
|
|
</html> |