html跨页参数接收
function getRequest() {
var url = decodeURI(location.search);
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(1);
strs = str.split("&");
for (let i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = strs[i].split("=")[1];
}
}
return theRequest;
}
var arr = getRequest();
html跨页传递参数
{
title: '查看明細', field: '_', width: '2%',
formatter: function (value, row) {
var builder = new BtnBuilder();
builder.AddBtn({ icon: 'glyphicon-list', name: "明細", function: 'openForm', param: [row['Id'], row['leibie'], row['jizhong'], row['zhuangTai']] });
return builder.build();
}
function openForm(id, leibie,jizhong,zhuangTai,title) {
dialogOpen({
id: 'form',
title: '明細',
btn: ['關閉'],
//height: '80%',
height: '100%',
url: '/ProjectManage/MoJuBaoYangMX/Index?id={0}&leibie={1}&jizhong={2}&zhuangTai={3}'.format(id || '', leibie, jizhong, zhuangTai),
yes: function (window, body) {
window.submitForm();
}
});
}
bootstrap重新加载
$(function () {
initTable();
bindEvent();
$('#dataTable').bootstrapTable('resetView', { height: 680 });
});
bootstrap CSS样式
<style>
/*定義類名為.thead-blue的樣式*/
.table .thead-blue th {
color: #FFFFFF;
background-color: #003366;
/*border-color: #C4E1FF;*/
font-size: larger;
font-style: normal;
}
/*定義類名為.table-hover的鼠標移動時高亮顯示*/
.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
background-color: #DCB5FF;
}
/*class="btn btn-default btn-sm"*/
.glyphicon-list:before {
/*content: "\e001";*/
color: #33CC00;
font-size: 10px;
}
.glyphicon-align-left:before {
color: #3399FF;
font-size: 10px;
}
/* 自定義tooltip的背景及字體顏色 */
.define-tooltip-inner {
background: #FFCC99;
color: #000;
font-Size: 15px;
height: 160px;
width: 2000px;
text-align: left;
/*top: 5px;*/
}
/* 自定義tooltip四個不同方向箭頭樣式 */
.tooltip.bs-tooltip-top .define-tooltip-arrow::before {
top: 0px;
border-width: 0.4rem 0.4rem 0;
border-top-color: #ccc;
}
.tooltip.bs-tooltip-right .define-tooltip-arrow::before {
right: 0;
border-width: 0.4rem 0.4rem 0.4rem 0;
border-right-color: #ccc;
}
.tooltip.bs-tooltip-left .define-tooltip-arrow::before {
left: 0;
border-width: 0.4rem 0 0.4rem 0.4rem;
border-left-color: #ccc;
}
.tooltip.bs-tooltip-bottom .define-tooltip-arrow::before {
bottom: 0;
border-width: 0 0.4rem 0.4rem;
border-bottom-color: #ccc;
}
.glyphicon-edit {
color: #00CCFF;
}
.glyphicon-download-alt {
color: #00FF33;
}
</style>
switch case用法(linq int查询,日期查询)
switch (condition)
{
case "zhuangTai1": int i = Convert.ToInt32(keyword); q = q.Where(x => x.zhuangTai1 == i);
break;
case "zhuangTai2": int i1 = Convert.ToInt32(keyword); q = q.Where(x => x.zhuangTai2 == i1);
break;
case "zhuangTai3": int i11 = Convert.ToInt32(keyword); q = q.Where(x => x.zhuangTai3 == i11);
break;
case "zhuangTai4": int i111 = Convert.ToInt32(keyword); q = q.Where(x => x.zhuangTai4 == i111);
break;
case "Total":int t = Convert.ToInt32(keyword);q = q.Where(x => x.Total == t);
break;
case "SaveDate":q = q.Where(x => SqlFunctions.DateDiff("mi",x.SaveDate,keyword)==0);
break;
default: q = q.Where($@"{condition}.Contains(@0)", keyword);
break;
}