File tree Expand file tree Collapse file tree
file_classification_webapi/static Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,6 +79,21 @@ function initTabs() {
7979 // 存储已打开的标签页
8080 const openedTabs = new Set ( ) ;
8181
82+ // 页面加载时只显示首页内容
83+ const homeTab = document . getElementById ( 'home' ) ;
84+ if ( homeTab ) {
85+ homeTab . style . display = 'block' ;
86+ // 主页也需要执行一次搜索以显示默认数据
87+ autoSearch ( 'home' ) ;
88+ }
89+
90+ // 隐藏除主页外的所有标签页内容
91+ tabContents . forEach ( content => {
92+ if ( content . id !== 'home' ) {
93+ content . style . display = 'none' ;
94+ }
95+ } ) ;
96+
8297 navLinks . forEach ( link => {
8398 link . addEventListener ( 'click' , function ( e ) {
8499 e . preventDefault ( ) ;
@@ -123,6 +138,9 @@ function initTabs() {
123138// 根据当前tab自动执行搜索
124139function autoSearch ( tabName ) {
125140 switch ( tabName ) {
141+ case 'home' :
142+ // 主页可能需要执行某些初始化操作
143+ break ;
126144 case 'files' :
127145 if ( typeof listFilesByFilter === 'function' ) {
128146 listFilesByFilter ( ) ;
Original file line number Diff line number Diff line change 11<!-- 系统主页 -->
2- < section class ="tab-content " id ="home " style =" display: none; " >
2+ < section class ="tab-content " id ="home ">
33 < h2 > 文件分类系统说明</ h2 >
44
55 < div class ="documentation ">
You can’t perform that action at this time.
0 commit comments