Skip to content

Commit

Permalink
修改布局
Browse files Browse the repository at this point in the history
  • Loading branch information
yidashi committed Feb 21, 2017
1 parent 6fea64f commit a6a46e3
Show file tree
Hide file tree
Showing 14 changed files with 83 additions and 392 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
use yii\base\Exception;
use yii\web\AssetBundle;

class HuiAsset extends AssetBundle
class IframeAsset extends AssetBundle
{
public $sourcePath = '@backend/static';

public $js = [
'js/H-ui.admin.js',
'js/iframe.js',
];
}
6 changes: 3 additions & 3 deletions backend/modules/rbac/views/route/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@

<div class="box box-primary">
<div class="box-body">
<div class="col-lg-5">
<div class="col-md-5">
<?= Yii::t('rbac', 'Avaliable') ?>:
<input id="search-avaliable">
<a href="#" id="btn-refresh"><span class="glyphicon glyphicon-refresh"></span></a><br><br>
<select id="list-avaliable" multiple size="20" style="width: 100%">
</select>
</div>
<div class="col-lg-1">
<div class="col-md-1">
<br><br>
<a href="#" id="btn-add" class="btn btn-success btn-flat">&gt;&gt;</a><br>
<a href="#" id="btn-remove" class="btn btn-danger">&lt;&lt;</a>
</div>
<div class="col-lg-5">
<div class="col-md-5">
<?= Yii::t('rbac', 'Assigned') ?>:
<input id="search-assigned"><br><br>
<select id="list-assigned" multiple size="20" style="width: 100%">
Expand Down
21 changes: 11 additions & 10 deletions backend/static/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -337,17 +337,18 @@ td{word-break: break-all}
background-repeat: no-repeat;
background-position: 0 0;
}
.Hui-tabNav-wp{position:relative; height:35px;overflow:hidden}
.Hui-tabNav,
.Hui-tabNav .acrossTab li
,.Hui-tabNav .acrossTab li em{background-image:url(../images/acrossTab-2.png)}
.Hui-tabNav{height:35px; padding-right:75px;overflow:hidden; position:relative;background-color:#efeef0; background-repeat: repeat-x; background-position: 0 -175px;}
.Hui-tabNav .acrossTab{ list-style: none; position:absolute; height:26px; line-height:26px; background:none; top:8px; left:0;padding-top:0}
.Hui-tabNav .acrossTab li{height:26px;line-height:26px;}
.Hui-tabNav .acrossTab li em{ right:-16px; height: 26px; width: 16px}
.tab-nav-wp{position:relative; height:35px;overflow:hidden}
.tab-nav, .tab-nav .acrossTab li,.tab-nav .acrossTab li em{background-image:url(../images/acrossTab-2.png)}
.tab-nav{height:35px; padding-right:75px;overflow:hidden; position:relative;background-color:#efeef0; background-repeat: repeat-x; background-position: 0 -175px;}
.tab-nav .acrossTab{ list-style: none; position:absolute; height:26px; line-height:26px; background:none; top:8px; left:0;padding-top:0}
.tab-nav .acrossTab li{height:26px;line-height:26px;}
.tab-nav .acrossTab li em{ right:-16px; height: 26px; width: 16px}
.loading {background:url(../images/loading.gif) no-repeat center; height:100px}
.Hui-tabNav-more {position: absolute;right:0px;width:70px;top:4px;display: none}
.tab-nav-more {position: absolute;right:0;top:0;display: none}
.show_iframe{ position:absolute; top:0; right:0; left:0; bottom:0;}
.show_iframe iframe {position: absolute;bottom: 0;height: 100%;width: 100%}

.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle) {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.content-iframe {position:relative;}
131 changes: 10 additions & 121 deletions backend/static/js/H-ui.admin.js → backend/static/js/iframe.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
/* -----------H-ui前端框架-------------
* H-ui.admin.js v3.0
* http:https://www.h-ui.net/
* Created & Modified by guojunhui
* Date modified 2017.02.03
* Copyright 2013-2017 北京颖杰联创科技有限公司 All rights reserved.
* Licensed under MIT license.
* http:https://opensource.org/licenses/MIT
*/
var num=0,oUl=$("#min_title_list"),hide_nav=$("#Hui-tabNav");
var num=0,oUl=$("#min_title_list"),hide_nav=$("#tab-nav");

/*获取顶部选项卡总长度*/
function tabNavallwidth(){
var taballwidth=0,
$tabNav = hide_nav.find(".acrossTab"),
$tabNavWp = hide_nav.find(".Hui-tabNav-wp"),
$tabNavWp = hide_nav.find(".tab-nav-wp"),
$tabNavitem = hide_nav.find(".acrossTab li"),
$tabNavmore =hide_nav.find(".Hui-tabNav-more");
$tabNavmore =hide_nav.find(".tab-nav-more");
if (!$tabNav[0]){return}
$tabNavitem.each(function(index, element) {
taballwidth += Number(parseFloat($(this).width()+60))
Expand All @@ -30,32 +21,18 @@ function tabNavallwidth(){
}
}

/*左侧菜单响应式*/
function Huiasidedisplay(){
if($(window).width()>=768){
$(".Hui-aside").show()
}
}

/*菜单导航*/
function Hui_admin_tab(obj){
function admin_tab(obj){
var bStop = false,
bStopIndex = 0,
href = $(obj).attr('href'),
title = $(obj).attr("title"),
topWindow = $(window.parent.document),
show_navLi = topWindow.find("#min_title_list li"),
iframe_box = topWindow.find("#iframe_box");
//console.log(topWindow);
if(!href||href==""){
alert("data-href不存在,v2.5版本之前用_href属性,升级后请改为data-href属性");
return false;
}if(!title){
alert("v2.5版本之后使用data-title属性");
return false;
}

if(title==""){
alert("data-title属性不能为空");
alert("title属性不能为空");
return false;
}
show_navLi.each(function() {
Expand Down Expand Up @@ -89,8 +66,8 @@ function creatIframe(href,titleName){
iframe_box=topWindow.find('#iframe_box'),
iframeBox=iframe_box.find('.show_iframe'),
$tabNav = topWindow.find(".acrossTab"),
$tabNavWp = topWindow.find(".Hui-tabNav-wp"),
$tabNavmore =topWindow.find(".Hui-tabNav-more");
$tabNavWp = topWindow.find(".tab-nav-wp"),
$tabNavmore =topWindow.find(".tab-nav-more");
var taballwidth=0;

show_nav.find('li').removeClass("active");
Expand Down Expand Up @@ -162,89 +139,10 @@ function removeIframeAll(){
}
}

/*弹出层*/
/*
参数解释:
title 标题
url 请求的url
id 需要操作的数据id
w 弹出层宽度(缺省调默认值)
h 弹出层高度(缺省调默认值)
*/
function layer_show(title,url,w,h){
if (title == null || title == '') {
title=false;
};
if (url == null || url == '') {
url="404.html";
};
if (w == null || w == '') {
w=800;
};
if (h == null || h == '') {
h=($(window).height() - 50);
};
layer.open({
type: 2,
area: [w+'px', h +'px'],
fix: false, //不固定
maxmin: true,
shade:0.4,
title: title,
content: url
});
}
/*关闭弹出框口*/
function layer_close(){
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}

/*时间*/
function getHTMLDate(obj) {
var d = new Date();
var weekday = new Array(7);
var _mm = "";
var _dd = "";
var _ww = "";
weekday[0] = "星期日";
weekday[1] = "星期一";
weekday[2] = "星期二";
weekday[3] = "星期三";
weekday[4] = "星期四";
weekday[5] = "星期五";
weekday[6] = "星期六";
_yy = d.getFullYear();
_mm = d.getMonth() + 1;
_dd = d.getDate();
_ww = weekday[d.getDay()];
obj.html(_yy + "年" + _mm + "月" + _dd + "日 " + _ww);
};

$(function(){
getHTMLDate($("#top_time"));
//layer.config({extend: 'extend/layer.ext.js'});
Huiasidedisplay();
var resizeID;
$(window).resize(function(){
clearTimeout(resizeID);
resizeID = setTimeout(function(){
Huiasidedisplay();
},500);
});

$(".nav-toggle").click(function(){
$(".Hui-aside").slideToggle();
});
$(".Hui-aside").on("click",".menu_dropdown dd li a",function(){
if($(window).width()<768){
$(".Hui-aside").slideToggle();
}
});

/*选项卡导航*/
$(".main-sidebar").on("click",".sidebar a[href!='#']",function(){
Hui_admin_tab(this);
admin_tab(this);
return false;
});

Expand Down Expand Up @@ -289,13 +187,4 @@ $(function(){
function toNavPos(){
oUl.stop().animate({'left':-num*100},100);
}

/*换肤*/
$("#Hui-skin .dropDown-menu a").click(function(){
var v = $(this).attr("data-val");
$.cookie("Huiskin", v);
var hrefStr=$("#skin").attr("href");
var hrefRes=hrefStr.substring(0,hrefStr.lastIndexOf('skin/'))+'skin/'+v+'/skin.css';
$(window.frames.document).contents().find("#skin").attr("href",hrefRes);
});
});
});
11 changes: 5 additions & 6 deletions backend/static/js/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ $(document).ajaxError(function(event,xhr,options,exc){
$.modal.error(message);
});
$(function () {
$(document).off('click', "[data-remote-modal]").on('click', "[data-remote-modal]", function() {
var url = $(this).data('remote-modal-url') || $(this).attr('href');
var title = $(this).data('remote-modal-title') || $(this).text();
var data = $(this).data('remote-modal-params') || {};
$.modal.load(url, title, data);
return false;
$("[data-toggle='iframe']").on('click', function () {
if (parent != window) {
parent.admin_tab(this);
return false;
}
});
})
String.prototype.addQueryParams = function(params) {
Expand Down
40 changes: 0 additions & 40 deletions backend/views/layouts/content.php

This file was deleted.

Loading

0 comments on commit a6a46e3

Please sign in to comment.