This repository has been archived on 2026-06-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
wsh5485 7e47ce238b chore: 添加多个图片和资源文件
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
2025-06-15 13:04:37 +08:00

99 lines
2.6 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
@NamelayuiAdmin iframe版主入口
@Author:贤心
@Sitehttp://www.layui.com/admin/
@LicenseLPPL
*/
layui.extend({
setter: 'config' //配置模块
,admin: 'lib/admin' //核心模块
,view: 'lib/view' //视图渲染模块
}).define(['setter', 'admin'], function(exports){
var setter = layui.setter
,element = layui.element
,admin = layui.admin
,tabsPage = admin.tabsPage
,view = layui.view
//打开标签页
,openTabsPage = function(url, text){
//遍历页签选项卡
var matchTo
,tabs = $('#LAY_app_tabsheader>li')
,path = url.replace(/(^http(s*):)|(\?[\s\S]*$)/g, '');
tabs.each(function(index){
var li = $(this)
,layid = li.attr('lay-id');
if(layid === url){
matchTo = true;
tabsPage.index = index;
}
});
text = text || '新标签页';
//style有作修改
if(setter.pageTabs){
//如果未在选项卡中匹配到,则追加选项卡
if(!matchTo){
$(APP_BODY).append([
// 2021.06.02修改,原
// '<div class="layadmin-tabsbody-item layui-show" style="overflow:scroll;-webkit-overflow-scrolling:touch;">'
// ,'<iframe src="'+ url +'" frameborder="0" class="layadmin-iframe" style="overflow-y:scroll;position:static;-webkit-overflow-scrolling:touch;"></iframe>'
'<div class="layadmin-tabsbody-item layui-show">'
,'<iframe src="'+ url +'" frameborder="0" class="layadmin-iframe"></iframe>'
,'</div>'
].join(''));
tabsPage.index = tabs.length;
element.tabAdd(FILTER_TAB_TBAS, {
title: '<span>'+ text +'</span>'
,id: url
,attr: path
});
}
} else {
var iframe = admin.tabsBody(admin.tabsPage.index).find('.layadmin-iframe');
iframe[0].contentWindow.location.href = url;
}
//定位当前tabs
element.tabChange(FILTER_TAB_TBAS, url);
admin.tabsBodyChange(tabsPage.index, {
url: url
,text: text
});
}
,APP_BODY = '#LAY_app_body', FILTER_TAB_TBAS = 'layadmin-layout-tabs'
,$ = layui.$, $win = $(window);
//初始
if(admin.screen() < 2) admin.sideFlexible();
//将模块根路径设置为 controller 目录
layui.config({
base: setter.base + 'modules/'
});
//扩展 lib 目录下的其它模块
layui.each(setter.extend, function(index, item){
var mods = {};
mods[item] = '{/}' + setter.base + 'lib/extend/' + item;
layui.extend(mods);
});
view().autoRender();
//加载公共模块
layui.use('common');
//对外输出
exports('index', {
openTabsPage: openTabsPage
});
});