From c9c7ce60678c28f61718ceec98f215072e3668d6 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 19 May 2021 22:52:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E6=A0=87=E7=AD=BE=E9=A1=B5=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- safesite/static/safesite/mystatic/js/util.js | 19 ++- safesite/templates/index.html | 119 +++++++++++-------- safesite/templates/main.html | 2 +- 3 files changed, 86 insertions(+), 54 deletions(-) diff --git a/safesite/static/safesite/mystatic/js/util.js b/safesite/static/safesite/mystatic/js/util.js index 3fd55fbc..2508d228 100644 --- a/safesite/static/safesite/mystatic/js/util.js +++ b/safesite/static/safesite/mystatic/js/util.js @@ -321,13 +321,28 @@ function isIntNum(val) { // } // } function changehref(o) { - _clickTab = $(o).attr('url');// 找到链接a中的targer的值 + _title = $(o).attr('title'); _value = $(o).attr('value'); $("#main").attr('value', _value); - $("#main").panel({ href: _clickTab, title: $(o).attr('title') }); + + if ($('#tt').tabs('tabs').length > 10) { + alert('标签页过多,请先关闭') + return + } + if ($('#tt').tabs('exists', _title)) { + $('#tt').tabs('select', _title); + //var tab2 = $('#tt').tabs('getSelected'); + //tab2.panel('refresh'); + } else { + $('#tt').tabs('add', { + title: _title, + href: _clickTab, + closable: true, + }); + } // $.ajax({ // type: "get", // url: _clickTab, diff --git a/safesite/templates/index.html b/safesite/templates/index.html index b6ec6c66..1757ff77 100644 --- a/safesite/templates/index.html +++ b/safesite/templates/index.html @@ -114,7 +114,7 @@ headimgurl="{{headimgurl}}" menus="{{menus}}" style="display:none;" /> @@ -178,16 +178,11 @@ -
-
- 关闭 -
-
- 关闭全部 -
-
- 关闭其他 -
+ +
+
关闭
+
关闭其他
+
关闭所有
diff --git a/safesite/templates/main.html b/safesite/templates/main.html index aa209997..1ca4a69f 100644 --- a/safesite/templates/main.html +++ b/safesite/templates/main.html @@ -97,7 +97,7 @@ float: left;"> font-weight: 300; font-size: 11px; color: #fff; - opacity: 0.7;height: 20px;cursor: pointer;" title="在线培训" onclick="changehref(this)"> + opacity: 0.7;height: 20px;cursor: pointer;" title="线下培训" onclick="changehref(this)"> 点击查看全部