You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
339 lines
13 KiB
Plaintext
339 lines
13 KiB
Plaintext
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Hello MUI</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
|
|
<!--标准mui.css-->
|
|
<!--标准mui.css-->
|
|
<link href="../js/mui/css/mui.min.css" rel="stylesheet" type="text/css" />
|
|
<link href="../js/mui/css/mui.indexedlist.css" rel="stylesheet" type="text/css" />
|
|
<script src="../js/mui/js/mui.min.js" type="text/javascript"></script>
|
|
<script src="../js/mui/js/mui.view.js" type="text/javascript"></script>
|
|
<link href="../js/mui/css/mui.picker.min.css" rel="stylesheet" type="text/css" />
|
|
<link href="../js/mui/css/mui.dtpicker.css" rel="stylesheet" />
|
|
<script src="../js/mui/js/mui.picker.min.js" type="text/javascript"></script>
|
|
<script src="../js/mui/js/mui.dtpicker.js"></script>
|
|
<script src="../js/jquery.js" type="text/javascript"></script>
|
|
|
|
<!-- 引入通用基础JS -->
|
|
<script src="../Scripts/QueryString.js" type="text/javascript"></script>
|
|
<script src="../Scripts/config.js" type="text/javascript"></script>
|
|
<script src="../Comm/Gener.js" type="text/javascript"></script>
|
|
<script src="../Comm/JScript.js" type="text/javascript"></script>
|
|
<script src="Search.js" type="text/javascript"></script>
|
|
<script src="../../DataUser/JSLibData/SearchAndEn.js"></script>
|
|
|
|
<style type="text/css">
|
|
.congDao {
|
|
width: 30% !important;
|
|
float: left !important;
|
|
display: inline !important;
|
|
border: 1px solid rgba(0,0,0,.2) !important;
|
|
height: 90% !important;
|
|
margin-top: 2px !important;
|
|
}
|
|
|
|
#toToolBarPover {
|
|
width: 0px;
|
|
height: 0px;
|
|
position: fixed;
|
|
top: 50px !important;
|
|
left: 15px !important;
|
|
width: calc(100% - 35px) !important;
|
|
}
|
|
/*移除底部或顶部三角,需要在删除此代码*/
|
|
.mui-popover .mui-popover-arrow:after {
|
|
width: 0px;
|
|
}
|
|
|
|
.mui-col-xs-12, .mui-col-sm-12 {
|
|
font-size: 14px !important;
|
|
color: #333333eb !important;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
}
|
|
|
|
li .mui-table-view-cell {
|
|
padding-right: 20px !important
|
|
}
|
|
</style>
|
|
<script type="text/javascript">
|
|
var ensName = GetQueryString("EnsName");
|
|
|
|
//定义公共个变量.
|
|
var webUser = new WebUser();
|
|
var fields = [];
|
|
|
|
//页面设置信息
|
|
var cfg = new Entity("BP.Sys.EnCfg");
|
|
cfg.No = ensName;
|
|
cfg.RetrieveFromDBSources();
|
|
var drillFields = cfg.Drill || "";
|
|
drillFields += ",";
|
|
|
|
var mobileShowModel = cfg.MobileFieldShowModel || 0;
|
|
var mobileShowContent = cfg.MobileShowContent || "";
|
|
//当前用户查询信息.
|
|
var ur = new Entity("BP.Sys.UserRegedit");
|
|
ur.MyPK = webUser.No + "_" + ensName + "_SearchAttrs";
|
|
ur.RetrieveFromDBSources();
|
|
|
|
//获取Url传的查询Key值
|
|
var key = GetQueryString("Key");
|
|
if (key != null && key != undefined) {
|
|
ur.SearchKey = key;
|
|
ur.Update();
|
|
}
|
|
var mapBase;
|
|
var pageIdx = 1;//当前页
|
|
var pageSize = 10;
|
|
var pages = 1;//总页数
|
|
|
|
|
|
//列表显示的字段
|
|
var showField = [];
|
|
var pkFiled = "";
|
|
|
|
var mapAttrs = [];
|
|
|
|
|
|
//初始化数据
|
|
$(function () {
|
|
InitToolBar();
|
|
pageIdx = GetQueryString("PageIdx");//当前页
|
|
if (pageIdx == null || pageIdx == undefined || pageIdx == 0)
|
|
pageIdx = 1;
|
|
|
|
pageSize = cfg.GetPara("PageSize");
|
|
//pageSize = 3;
|
|
if (pageSize == null || pageSize == undefined || pageSize == 0)
|
|
pageSize = 10;//一页显示的行数
|
|
|
|
ShowPageInfo();
|
|
|
|
//var lis = $(".mui-table-view-cell");
|
|
//lis.each(function (i, dtm) {
|
|
// var id = this.getAttribute('id');
|
|
// dtm.addEventListener('dbclick', function () {
|
|
// url = cfg.UrlExt;
|
|
// var urlOpenType = cfg.GetPara("SearchUrlOpenType");
|
|
|
|
// if (urlOpenType == 0 || urlOpenType == undefined)
|
|
// url = "./RefFunc/En.htm?EnName=" + ensName.substr(0, ensName.length - 1) + "&PKVal=" + id;
|
|
|
|
// if (urlOpenType == 1)
|
|
// url = "./RefFunc/EnOnly.htm?EnName=" + ensName.substr(0, ensName.length - 1) + "&PKVal=" + id;
|
|
|
|
// if (urlOpenType == 2)
|
|
// url = "../FrmViw.htm?FK_MapData=" + GetQueryString("EnsName") + "&PKVal=" + id;
|
|
|
|
// if (urlOpenType == 3)
|
|
// url = "../FrmViw.htm?FK_MapData=" + GetQueryString("EnsName") + "&PKVal=" + id;
|
|
|
|
// if (urlOpenType == 9) {
|
|
// if (url.indexOf('?') == -1)
|
|
// url = url + "?1=1";
|
|
// if (url.indexOf('FrmID') != -1)
|
|
// url = url + "&WorkID=" + id + "&OID=" + id;
|
|
// else
|
|
// url = url + "&EnsName=" + ensName + "&EnName=" + enName + "&PKVal=" + pk;
|
|
// }
|
|
|
|
// window.parent.location.href = url;
|
|
// });
|
|
|
|
//});
|
|
|
|
})
|
|
|
|
function Search() {
|
|
SearchCondition();
|
|
$(".mui-table-view").html("");
|
|
mui('#toToolBarPover').popover('hide');
|
|
Reload();
|
|
}
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
<header class="mui-bar mui-bar-nav">
|
|
<a id="back" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
|
|
<a id="search" class="mui-action-menu mui-icon mui-icon-search mui-pull-right" href="#toToolBarPover"></a>
|
|
<h1 id="title" class="mui-title">查询</h1>
|
|
</header>
|
|
<!--查询结果显示-->
|
|
<div class="mui-content">
|
|
<!--下拉刷新容器-->
|
|
<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
|
|
<div class="mui-scroll">
|
|
<!--数据列表-->
|
|
<ul class="mui-table-view mui-table-view-chevron" style="margin-top:50px">
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!--查询条件-->
|
|
<div id="toToolBarPover" class="mui-popover">
|
|
<div class="mui-scroll-wrapper" style="height: 300px; background-color: #fff">
|
|
<div class="mui-scroll">
|
|
<form class="mui-input-group" id="toolBar" style="padding-top:10px;">
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
mui('.mui-scroll-wrapper').scroll();
|
|
mui.init({
|
|
pullRefresh: {
|
|
container: '#pullrefresh',
|
|
down: {
|
|
callback: pulldownRefresh
|
|
},
|
|
up: {
|
|
contentrefresh: '正在加载...',
|
|
callback: pullupRefresh
|
|
}
|
|
}
|
|
});
|
|
/**
|
|
* 下拉刷新具体业务实现
|
|
*/
|
|
function pulldownRefresh() {
|
|
setTimeout(function () {
|
|
var table = document.body.querySelector('.mui-table-view');
|
|
var cells = document.body.querySelectorAll('.mui-table-view-cell');
|
|
//获取data数据
|
|
pageIdx = pageIdx - 1;
|
|
if (pageIdx == 0)
|
|
pageIdx = 1;
|
|
else {
|
|
table.innerHTML = "";
|
|
var pageData = InitData();
|
|
for (var i = 0; i < pageSize && i < pageData.length; i++) {
|
|
var item = pageData[i];
|
|
var li = document.createElement('li');
|
|
|
|
li.className = 'mui-table-view-cell mui-collapse';
|
|
li.id = item[pkFiled];
|
|
_html = "";
|
|
_html = '<a class="mui-navigate-right" href="#">';
|
|
_html += '<div class="mui-row">';
|
|
_html += GetRowInfo(item);
|
|
_html += '</div>';
|
|
_html += '</a>';
|
|
_html += '<ul class="mui-table-view mui-table-view-chevron">';
|
|
_html += '<li class="mui-table-view-cell">';
|
|
_html += '<form class="mui-input-group">';
|
|
_html += ShowInfoByMapAttr(mapAttrs, item);
|
|
_html += '</form>';
|
|
_html += '</li>';
|
|
_html += '</ul>';
|
|
li.innerHTML = _html;
|
|
//下拉刷新,新纪录插到最前面;
|
|
table.appendChild(li, table.firstChild);
|
|
}
|
|
}
|
|
|
|
mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed
|
|
}, 1500);
|
|
}
|
|
var refcount = 0;
|
|
/**
|
|
* 上拉加载具体业务实现
|
|
*/
|
|
function pullupRefresh() {
|
|
setTimeout(function () {
|
|
mui('#pullrefresh').pullRefresh().endPullupToRefresh((++refcount > 2)); //参数为true代表没有更多数据了。
|
|
var table = document.body.querySelector('.mui-table-view');
|
|
var cells = document.body.querySelectorAll('.mui-table-view-cell');
|
|
//获取data数据
|
|
pageIdx = pageIdx + 1;
|
|
if (pageIdx > pages)
|
|
pageIdx = pages;
|
|
else {
|
|
|
|
var pageData = InitData();
|
|
for (var i = 0; i < pageSize && i < pageData.length; i++) {
|
|
var item = pageData[i];
|
|
var li = document.createElement('li');
|
|
li.className = 'mui-table-view-cell mui-collapse';
|
|
li.id = item[pkFiled];
|
|
_html = "";
|
|
_html = '<a class="mui-navigate-right" href="#">';
|
|
_html += '<div class="mui-row">';
|
|
_html += GetRowInfo(item);
|
|
_html += '</div>';
|
|
_html += '</a>';
|
|
_html += '<ul class="mui-table-view mui-table-view-chevron">';
|
|
_html += '<li class="mui-table-view-cell">';
|
|
_html += '<form class="mui-input-group">';
|
|
_html += ShowInfoByMapAttr(mapAttrs, item);
|
|
_html += '</form>';
|
|
_html += '</li>';
|
|
_html += '</ul>';
|
|
li.innerHTML = _html;
|
|
table.appendChild(li);
|
|
}
|
|
}
|
|
|
|
//var lis = $(".mui-table-view-cell");
|
|
//lis.each(function (i, dtm) {
|
|
// var id = this.getAttribute('id');
|
|
// dtm.addEventListener('dbclick', function () {
|
|
// url = cfg.UrlExt;
|
|
// var urlOpenType = cfg.GetPara("SearchUrlOpenType");
|
|
|
|
// if (urlOpenType == 0 || urlOpenType == undefined)
|
|
// url = "./RefFunc/En.htm?EnName=" + ensName.substr(0, ensName.length - 1) + "&PKVal=" + id;
|
|
|
|
// if (urlOpenType == 1)
|
|
// url = "./RefFunc/EnOnly.htm?EnName=" + ensName.substr(0, ensName.length - 1) + "&PKVal=" + id;
|
|
|
|
// if (urlOpenType == 2)
|
|
// url = "../FrmViw.htm?FK_MapData=" + GetQueryString("EnsName") + "&PKVal=" + id;
|
|
|
|
// if (urlOpenType == 3)
|
|
// url = "../FrmViw.htm?FK_MapData=" + GetQueryString("EnsName") + "&PKVal=" + id;
|
|
|
|
// if (urlOpenType == 9) {
|
|
// if (url.indexOf('?') == -1)
|
|
// url = url + "?1=1";
|
|
// if (url.indexOf('FrmID') != -1)
|
|
// url = url + "&WorkID=" + id + "&OID=" + id;
|
|
// else
|
|
// url = url + "&EnsName=" + ensName + "&EnName=" + enName + "&PKVal=" + pk;
|
|
// }
|
|
|
|
// window.parent.location.href = url;
|
|
// });
|
|
|
|
//});
|
|
|
|
}, 1500);
|
|
}
|
|
$(window).keydown(function (e) {
|
|
|
|
var key = window.event ? e.keyCode : e.which;
|
|
|
|
if (key.toString() == "13") {
|
|
Search();
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
|
</script>
|
|
</body>
|
|
|
|
</html> |