erp系统所涉及到的主要框架 ace admin 地址:http://ace.jeka.by/
- 右侧隐藏按钮
.net 控件 控制一行显示4个,每个label属性display : inline-block 设置成固定宽度 80,外侧div设置min-width:140px 高度随label个数自动增加。注意:设置成table样式的话 checkbox 与 label文本产生高度差 不在同一个水平线上
<div class="ace-settings-box clearfix" id="ace-settings-box">
<div class="widget-header widget-header-small">
<asp:UpdatePanel ID="UpdatePanelColall" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<label>表格列显示/隐藏</label>
<asp:CheckBox runat="server" AutoPostBack="false" ID="colall" onclick="SltChkAlled('colall', '_GridViewLayout_ChkGridViewColumnList'); document.getElementById('btnGridViewLayout').click();" />
<label class="lbl" for="ace-settings-highlight">全选</label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="_GridViewLayout" />
</Triggers>
</asp:UpdatePanel>
</div>
<div class="ace-settings-item">
<uc:GridViewLayout ID="_GridViewLayout" runat="server" />
</div>
</div>
2.图标部分
图标用的font awesome 4.5版本 地址 http://fontawesome.dashgame.com/
ui-icon ace-icon 产生放大效果
<div class="ui-pg-div">
<span class="ui-icon ace-icon fa fa-refresh green" onclick="document.getElementById('btnFsh').click();"></span>
</div>
图标背景widget-header 样式background-image: linear-gradient(to bottom,#FFF 0,#EEE 100%);
3.表格部分:通过头部调用样式<%@ page language="C#" autoeventwireup="true" inherits="Customer_ScreenCusList, DHERP.Web" theme="Themes" enableEventValidation="false" %>
html:
<table class="tbData" cellspacing="0" rules="all" border="1" id="gvcus" style="border-collapse:collapse;">
css:
.tbData
{
border:solid 1px #ddd;
/*border:solid 1px #ddd*/
background:#ffffff;
border-top:none;
/*table-layout:fixed;
behavior: url(../../Public/Script/dragtable.htc);*/
}
.tdHead1 th
{
font-weight:normal;
border:solid 1px #ddd
background: rgb(255,255,255); /* Old browsers */
background: -moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(231,235,251,1) 0%, rgba(204,214,248,1) 53%, rgba(239,242,253,1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(231,235,251,1) 0%,rgba(204,214,248,1) 53%,rgba(239,242,253,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(231,235,251,1) 0%,rgba(204,214,248,1) 53%,rgba(239,242,253,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
text-align:center;
height:22px;
line-height:22px;
border-top:none;
padding-left:5px;
padding-right:5px;
white-space:nowrap;
/*overflow:hidden;
text-overflow:ellipsis; /* for IE */
/*-o-text-overflow: ellipsis; for Opera */
}
.tdRow1 td
{
padding-left:5px;
padding-right:15px;
border:solid 1px #ddd
height:20px;
line-height:20px;
white-space:nowrap;
/*overflow:hidden;
text-overflow:ellipsis; /* for IE */
/*-o-text-overflow: ellipsis; for Opera */
}
/*隔行换色 */
table tr:nth-child(2n)
{
/*浅紫色*/
background-color: #EFEDF5;
}
/*悬停变色*/
.tbData>tbody>tr:hover
{
background-color: #dddfff;
}
4.复选框样式重写
新写一个复选框覆盖原来的样式(参考ace admin的复选框)。
/*//checkBox样式设置*/
input[type=checkbox],
input[type=radio] {
position: relative;
display: inline-block;
margin-right: 5px;
line-height: 20px;
/* min-height: 14px;
*/ min-width: 14px;
font-weight: 400;
cursor: pointer
}
input[type=checkbox]::before {
cursor: pointer;
font-family: fontAwesome;
font-weight: 400;
font-size: 12px;
color: #FFF;
content: "\a0";
background-color: #FAFAFA;
border: 1px solid #C8C8C8;
border-radius: 0;
display: inline-block;
text-align: center;
height: 14px;
line-height: 14px;
min-width: 14px;
position: relative;
top: -2px
}
input[type=checkbox]:checked::before {
display: inline-block;
content: '\f00c';
background-color: #F9A021;
border-color: #F9A021;
color: #FFF
}
input[type=checkbox]:hover::before {
border-color: #FF893C
}
input[type=checkbox]:focus::before {
border-color: #F59942
}
input[type=checkbox]:active::before {
box-shadow: 0 1px 2px rgba(0, 0, 0, .05), inset 0 1px 3px rgba(0, 0, 0, .1)
}
input[type=checkbox]:disabled::before {
background-color: #DDD!important;
border-color: #CCC!important;
box-shadow: none!important;
color: #BBB
}
input[type=checkbox]:checked::after {
font-family: FontAwesome;
font-size: 14px;
line-height: 14px;
content: "\a0";
top: -1px;
text-shadow: none;
padding: 0;
text-align: center;
color: #BBB;
letter-spacing: 0
}
input[type=checkbox]#cball:checked::before {
display: inline-block;
content: '\f00c';
background-color: #fff;
border-color: #2283C5;
color: #2283C5
}
input[type=checkbox]#cball:hover::before {
border-color: #2283C5;
}
.tdRow1>td>input[type=checkbox]:checked::before {
display: inline-block;
content: '\f00c';
background-color: #fff;
border-color: #2283C5;
color: #2283C5
}
.tdRow1>td>input[type=checkbox]:hover::before {
border-color: #2283C5;
}
此处需要引用<link rel="stylesheet" href="../Public/css/fonts.googleapis.com.css" />
- 选项卡左右调节按钮
思路: 将 包含选项卡的div 设置成绝对定位 position:absolute ;left:0; 固定宽度 800px; 当选卡超过宽度时隐藏 overflow:hidden; 为按钮附加点击事件每点击向右或向左移动100px。
JS:位置 …/Public/h-ui.admin/js/H-ui.admin.js
//横向移动选项卡标题
$('#js-tabNav-next').click(function(){
num==oUl.find('li').length-1?num=oUl.find('li').length-1:num++;
toNavPos();
});
$('#js-tabNav-prev').click(function(){
num==0?num=0:num--;
toNavPos();
});
//横向移动tab下部分选项卡标题
$('#js-tabNav-next1').click(function(){
num==$("#recent-tab").find('li').length-1?num=$("#recent-tab").find('li').length-1:num++;
toNavPos1();
});
$('#js-tabNav-prev1').click(function(){
num==0?num=0:num--;
toNavPos1();
});
function toNavPos(){
oUl.stop().animate({'left':-num*100},100);
}
function toNavPos1(){
$("#recent-tab").stop().animate({'left':-num*100},100);
}
HTML:
<div id="win-btn" class="ace-settings-container">
<div class="Hui-tabNav-more btn-group" id="tab_btn">
<a id="js-tabNav-prev1" class="btn btn-sm btn-info " href="javascript:;">
<i class="ui-icon ace-icon fa fa-arrow-left"></i></a>
<a id="js-tabNav-next1" class="btn btn-sm btn-info" href="javascript:;">
<i class="ui-icon ace-icon fa fa-arrow-right"></i></a>
</div>
<span class="changwin">
<i class=" ui-icon ace-icon glyphicon glyphicon-minus blue" id="min" onclick="changmin();" style="display: inline;"></i>
<i class=" ui-icon ace-icon glyphicon glyphicon-modal-window blue" id="res" onclick="changred();" style="display: none;"></i>
<i class=" ui-icon ace-icon glyphicon glyphicon-unchecked blue" id="max" onclick="changmax();" style="display: inline;"></i>
</span>
</div>
6:最小化,最大化按钮部分 以及左,右上,右下三栏高度控制:
JS:将table 表格高度设为定高, 获取浏览器高度,通过一系列 计算 算出右下框的高度 使得和左边边框始终对齐。
//三栏高度控制
//调整窗口为默认大小
function changred() {
var winHeight = 0;
if(window.innerHeight) winHeight = window.innerHeight;
else if((document.body) && (document.body.clientHeight)) winHeight = document.body.clientHeight;
//通过深入Document内部对body进行检测,获取浏览器窗口高度
if(document.documentElement && document.documentElement.clientHeight) winHeight = document.documentElement.clientHeight;
var treeheight = winHeight - 6;
document.getElementById("tree-style").style.height = treeheight - 60 + "px";
document.getElementById("tree-box").style.height = treeheight + "px";
document.getElementById("max-box").style.height = treeheight + "px";
document.getElementById("widget-body-tab").style.display = "block";
document.getElementById("widget-body-table").style.display = "block";
document.getElementById("page1").style.display = "block";
document.getElementById("widget-body-table").style.height = "460px";
var tabheight = treeheight - 578;
if(tabheight > 0) {
document.getElementById("widget-body-tab").style.height = treeheight - 578 + "px";
} else {
document.getElementById("widget-body-tab").style.display = "none";
}
document.getElementById("res").style.display = "none";
document.getElementById("max").style.display = "inline";
document.getElementById("min").style.display = "inline";
var h = document.getElementsByClassName("tab-table");
for(var i = 0; i < h.length; i++) {
h[i].style.height = "230px";
}
document.getElementById("tab-box").style.border = 1;
document.getElementById("hfListSize1").value = "17";
document.getElementById("hfListSize2").value = "6";
document.getElementById("btnClr").click();
}
//点击最大化按钮
function changmax() {
var winHeight = 0;
if(window.innerHeight) winHeight = window.innerHeight;
else if((document.body) && (document.body.clientHeight)) winHeight = document.body.clientHeight;
//通过深入Document内部对body进行检测,获取浏览器窗口高度
if(document.documentElement && document.documentElement.clientHeight) winHeight = document.documentElement.clientHeight;
document.getElementById("widget-body-tab").style.display = "block";
document.getElementById("page1").style.display = "none";
document.getElementById("widget-body-table").style.display = "none";
document.getElementById("widget-body-tab").style.height = winHeight - 84 + "px";
document.getElementById("res").style.display = "inline";
document.getElementById("max").style.display = "none";
document.getElementById("min").style.display = "inline";
var h = document.getElementsByClassName("tab-table");
for(var i = 0; i < h.length; i++) {
h[i].style.height = "100%";
}
document.getElementById("hfListSize1").value = "0";
document.getElementById("hfListSize2").value = "33";
document.getElementById("btnClr").click();
}
//点击最小化按钮
function changmin() {
var winHeight = 0;
if(window.innerHeight) winHeight = window.innerHeight;
else if((document.body) && (document.body.clientHeight)) winHeight = document.body.clientHeight;
//通过深入Document内部对body进行检测,获取浏览器窗口高度
if(document.documentElement && document.documentElement.clientHeight) winHeight = document.documentElement.clientHeight;
document.getElementById("widget-body-table").style.display = "block";
document.getElementById("widget-body-tab").style.display = "none";
document.getElementById("page1").style.display = "block";
document.getElementById("widget-body-table").style.height = winHeight - 126 + "px";
document.getElementById("res").style.display = "inline";
document.getElementById("max").style.display = "inline";
document.getElementById("min").style.display = "none";
var listnum = parseInt((winHeight -170) / 24);
document.getElementById("hfListSize1").value = listnum;
document.getElementById("hfListSize2").value = "0";
document.getElementById("btnClr").click();
}
HTML:
<span class="changwin">
<i class=" ui-icon ace-icon glyphicon glyphicon-minus blue" id="min" onclick="changmin();" style="display: inline;"></i>
<i class=" ui-icon ace-icon glyphicon glyphicon-modal-window blue" id="res" onclick="changred();" style="display: none;"></i>
<i class=" ui-icon ace-icon glyphicon glyphicon-unchecked blue" id="max" onclick="changmax();" style="display: inline;"></i>
</span>
7: ace选项卡部分:基于bootstrap 框架 所以需要引用bootstrap.min.js
HTML:
<div class="widget-box no-border ui-sortable-handle" id="recent-box">
<div class="widget-header widget-header-small">
<div class="widget-toolbar no-border">
<ul class="nav nav-tabs" id="recent-tab">
<li class="active" id="jqxx">
<a data-toggle="tab" href="#jqxx-tab" aria-expanded="false">机器信息</a>
</li>
<li class="" id="fwxx">
<a data-toggle="tab" href="#fwxx-tab" aria-expanded="false">服务信息</a>
</li>
<li class="" id="gmxx">
<a data-toggle="tab" href="#gmxx-tab" aria-expanded="false">购买信息</a>
</li>
<li class="" id="xsxx">
<a data-toggle="tab" href="#xsxx-tab" aria-expanded="false">销售信息</a>
</li>
<li class="" id="zjyw">
<a data-toggle="tab" href="#zjyw-tab" aria-expanded="false">中间业务</a>
</li>
</ul>
</div>
<div class="widget-right">
<input type="checkbox" name="check" id="grewshow" checked="checked" />显示
<!--<input type="checkbox" name="check" id="grewhidden" />隐藏-->
</div>
</div>
<div class="tab-content" style="border-top: 0;">
<div id="fwxx-tab" class="tab-pane"></div>
<div id="xsxx-tab" class="tab-pane"></div>
<div id="jqxx-tab" class="tab-pane active"></div>
<div id="gmxx-tab" class="tab-pane"></div>
</div>
CSS:引用 ace.min.css 以及bootstrap.min.css
8:手风琴部分:
HTML:
<div class="accordion-style1 panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#khxx">
<i data-icon-show="ace-icon fa fa-angle-right" data-icon-hide="ace-icon fa fa-angle-down" class="bigger-110 ace-icon fa fa-angle-right">
</i>客户信息</a> </h4>
</div>
<div id="khxx" class="panel-collapse collapse in">
<div class="panel-body" style="height: 400px;overflow-y: scroll;">
</div>
</div>
</div>
</div>
JS:调用 ace.min.js 以及 bootstrap.min.js ;
暂时写到这以后待补充。。。
1.(补充部分)选项卡插件:
<div class="widget-box ui-sortable-handle" id="recent-box">
<div class="widget-header widget-header-small">
<div class="widget-toolbar no-border">
<ul class="nav nav-tabs" id="recent-tab">
<li class="active">
<a data-toggle="tab" href="#jbxx-tab" aria-expanded="false">基本信息</a></li>
<li class="">
<a data-toggle="tab" href="#jqpz-tab" aria-expanded="false">机器配置</a></li>
<li class="">
<a data-toggle="tab" href="#fwpj-tab" aria-expanded="false">服务/配件</a></li>
<li class="">
<a data-toggle="tab" href="#sfjs-tab" aria-expanded="false">收费结算</a></li>
<li class="">
</ul>
</div>
</div>
</div>
<div class="tab-content">
<div id="jbxx-tab" class="tab-pane active">
</div>
</div>
<div class="tab-content">
<div id="jqpz-tab" class="tab-pane active">
</div>
</div>
<div class="tab-content">
<div id="fwpj-tab" class="tab-pane active">
</div>
</div>
<div class="tab-content">
<div id="sfjs-tab" class="tab-pane active">
</div>
</div>
选项卡在左侧
<div class="tabable tabs-left">
<ul class="nav nav-tabs" id="recent-tab" >
<li class="active" >
<a data-toggle="tab" href="#jbxx-tab" aria-expanded="false" style="width: 38px; font-size: 14px;" >基本信息</a></li>
<li class="">
<a data-toggle="tab" href="#jqpz-tab" aria-expanded="false" style="width: 38px; font-size: 14px;">机器配置</a></li>
<li class="" >
<a data-toggle="tab" href="#fwpj-tab" aria-expanded="false" style="width: 38px; font-size: 14px;">服务配件</a></li>
<li class="" >
<a data-toggle="tab" href="#sfjs-tab" aria-expanded="false" style="width: 38px; font-size: 14px;">收费结算</a></li>
选项卡在右侧
<div class="tabable tabs-right">
<ul class="nav nav-tabs" id="recent-tab" style="margin-right: 5px;">
<li class="active" >
<a data-toggle="tab" href="#jbxx-tab" aria-expanded="false" style="width: 38px; font-size: 14px;" >基本信息</a></li>
<li class="">
<a data-toggle="tab" href="#jqpz-tab" aria-expanded="false" style="width: 38px; font-size: 14px;">机器配置</a></li>
<li class="" >
<a data-toggle="tab" href="#fwpj-tab" aria-expanded="false" style="width: 38px; font-size: 14px;">服务配件</a></li>
<li class="" >
<a data-toggle="tab" href="#sfjs-tab" aria-expanded="false" style="width: 38px; font-size: 14px;">收费结算</a></li>
手风琴插件代码
<div class="accordion-style1 panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#khxx">
<i data-icon-show="ace-icon fa fa-angle-right" data-icon-hide="ace-icon fa fa-angle-down" class="bigger-110 ace-icon fa fa-angle-right"></i>客户信息</a>
</h4>
</div>
<div id="khxx" class="panel-collapse collapse in">
<div class="panel-body" style="height: 300px;overflow-y: scroll;">
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#fwxx">
<i data-icon-show="ace-icon fa fa-angle-right" data-icon-hide="ace-icon fa fa-angle-down" class="bigger-110 ace-icon fa fa-angle-right"></i>服务信息</a>
</h4>
</div>
<div id="fwxx" class="panel-collapse collapse">
<div class="panel-body" style="height: 300px;overflow-y: scroll;">
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#ywxx">
<i data-icon-show="ace-icon fa fa-angle-right" data-icon-hide="ace-icon fa fa-angle-down" class="bigger-110 ace-icon fa fa-angle-right"></i>业务信息</a>
</h4>
</div>
<div id="ywxx" class="panel-collapse collapse">
<div class="panel-body" style="height: 300px;overflow-y: scroll;">
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#jqxx">
<i data-icon-show="ace-icon fa fa-angle-right" data-icon-hide="ace-icon fa fa-angle-down" class="bigger-110 ace-icon fa fa-angle-right"></i>机器信息</a>
</h4>
</div>
<div id="jqxx" class="panel-collapse collapse">
<div class="panel-body" style="height: 300px;overflow-y: scroll;">
</div>
</div>
</div>
ace admin 框架真的很不错 喜欢的可以去下载源码,网上也有文档虽然不是很易读。