Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
T
TrainSys
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
苏州培训方案
TrainSys
提交
5bed028b
提交
5bed028b
编写于
6月 11, 2025
作者:
Cano1997
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 分页导航支持drtab模式
上级
3103790e
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
84 行增加
和
38 行删除
+84
-38
tab-exp-view.tsx
app_Web/src/components/views/tab-exp-view/tab-exp-view.tsx
+84
-38
未找到文件。
app_Web/src/components/views/tab-exp-view/tab-exp-view.tsx
浏览文件 @
5bed028b
...
...
@@ -15,6 +15,7 @@ import {
ref
,
}
from
'vue'
;
import
'./tab-exp-view.scss'
;
import
{
DRTabModel
,
TabExpPanelModel
}
from
'@ibiz-template/model'
;
export
const
TabExpView
=
defineComponent
({
props
:
{
...
...
@@ -46,12 +47,13 @@ export const TabExpView = defineComponent({
tabExpPagesHistory
[
activeTab
.
value
]
=
fullPath
;
// 找到对应分页模型并初始化分页视图模型
const
page
=
c
.
model
.
tabExpPanel
.
tabExpPages
.
find
(
item
=>
item
.
name
===
name
,
);
const
embedView
=
c
.
getEmbedViewByName
(
name
);
if
(
!
embedView
)
{
return
;
}
// 分页面板视图延迟初始化
if
(
page
?.
embedView
.
initialized
===
false
)
{
await
page
.
embedView
.
init
();
if
(
embedView
.
initialized
===
false
)
{
await
embedView
.
init
();
}
if
(
c
.
context
.
isRouter
)
{
...
...
@@ -65,7 +67,7 @@ export const TabExpView = defineComponent({
const
tempContext
=
Object
.
assign
(
c
.
context
.
clone
(),
{
toRouteLevel
:
c
.
modal
.
level
!
+
1
,
});
ibiz
.
openView
.
root
(
page
!
.
embedView
.
source
,
tempContext
,
c
.
params
);
ibiz
.
openView
.
root
(
embedView
.
source
,
tempContext
,
c
.
params
);
}
setTimeout
(()
=>
{
deactivateAll
.
value
=
false
;
...
...
@@ -80,13 +82,13 @@ export const TabExpView = defineComponent({
// 处理默认展示分页,预置是第一个分页
c
.
nerve
.
self
.
evt
.
on
(
'created'
,
()
=>
{
const
route
=
useRoute
(
proxy
);
const
{
tabExpPages
}
=
c
.
model
.
tabExpPan
el
;
const
{
pages
}
=
c
.
mod
el
;
// 路由呈现下,处理默认打开的标签页
if
(
c
.
context
.
isRouter
)
{
const
tabLevel
=
props
.
modal
!
.
level
!
+
1
;
const
tabViewName
=
route
.
params
[
`view
${
tabLevel
}
`
];
if
(
tabViewName
)
{
const
page
=
tabExpP
ages
.
find
(
item
=>
{
const
page
=
p
ages
.
find
(
item
=>
{
return
getViewName
(
item
.
embedView
.
source
)
===
tabViewName
;
});
if
(
page
)
{
...
...
@@ -96,8 +98,8 @@ export const TabExpView = defineComponent({
}
// 路由没有打开的分页时,默认打开第一个分页
if
(
tabExpP
ages
.
length
&&
!
activeTab
.
value
)
{
const
defaultTab
=
tabExpP
ages
[
0
].
name
;
if
(
p
ages
.
length
&&
!
activeTab
.
value
)
{
const
defaultTab
=
p
ages
[
0
].
name
;
onTabClick
(
defaultTab
);
}
});
...
...
@@ -108,6 +110,74 @@ export const TabExpView = defineComponent({
const
embedViewModal
=
{
mode
:
ViewMode
.
EMBED
};
const
renderTabExpPage
=
()
=>
{
if
(
c
.
model
.
tabExpPanel
.
controlType
===
'TABEXPPANEL'
)
{
const
{
tabExpPages
=
[]
}
=
c
.
model
.
tabExpPanel
as
TabExpPanelModel
;
return
tabExpPages
.
map
(
page
=>
{
const
tabExpPage
=
c
.
tabExpPages
[
page
.
name
];
if
(
!
tabExpPage
)
{
return
;
}
return
(
<
i
-
tab
-
pane
class=
{
ns
.
e
(
'tab-item'
)
}
tab=
{
c
.
model
.
codeName
}
label=
{
page
.
source
.
caption
}
name=
{
page
.
name
}
>
{
lazyList
.
value
.
includes
(
page
.
name
)
&&
h
(
'ViewShell'
,
{
attrs
:
{
context
:
c
.
context
,
params
:
c
.
params
,
modal
:
embedViewModal
,
modelPath
:
page
.
embedView
.
source
.
modelPath
,
},
on
:
{
neuronInit
:
c
.
nerve
.
onNeuronInit
(
page
.
name
),
},
key
:
tabExpPage
.
key
,
})
}
</
i
-
tab
-
pane
>
);
});
}
};
const
renderDrTab
=
()
=>
{
if
(
c
.
model
.
tabExpPanel
.
controlType
===
'DRTAB'
)
{
const
{
pages
=
[]
}
=
c
.
model
.
tabExpPanel
as
DRTabModel
;
return
pages
.
map
(
page
=>
{
const
tabExpPage
=
c
.
tabExpPages
[
page
.
name
];
if
(
!
tabExpPage
)
{
return
;
}
return
(
<
i
-
tab
-
pane
class=
{
ns
.
e
(
'tab-item'
)
}
tab=
{
c
.
model
.
codeName
}
label=
{
page
.
source
.
caption
}
name=
{
page
.
name
}
>
{
lazyList
.
value
.
includes
(
page
.
name
)
&&
h
(
'ViewShell'
,
{
attrs
:
{
context
:
c
.
context
,
params
:
c
.
params
,
modal
:
embedViewModal
,
modelPath
:
page
.
embedView
.
source
.
modelPath
,
},
on
:
{
neuronInit
:
c
.
nerve
.
onNeuronInit
(
page
.
name
),
},
key
:
tabExpPage
.
key
,
})
}
</
i
-
tab
-
pane
>
);
});
}
};
return
{
c
,
ns
,
...
...
@@ -117,6 +187,8 @@ export const TabExpView = defineComponent({
activeTab
,
keyHistory
,
embedViewModal
,
renderDrTab
,
renderTabExpPage
,
};
},
render
()
{
...
...
@@ -133,34 +205,8 @@ export const TabExpView = defineComponent({
model
-
value=
{
this
.
activeTab
}
on
-
on
-
click=
{
this
.
onTabClick
}
>
{
this
.
c
.
model
.
tabExpPanel
.
tabExpPages
.
map
(
page
=>
{
const
tabExpPage
=
this
.
c
.
tabExpPages
[
page
.
name
];
if
(
!
tabExpPage
)
{
return
;
}
return
(
<
i
-
tab
-
pane
class=
{
this
.
ns
.
e
(
'tab-item'
)
}
tab=
{
this
.
c
.
model
.
codeName
}
label=
{
page
.
source
.
caption
}
name=
{
page
.
name
}
>
{
this
.
lazyList
.
includes
(
page
.
name
)
&&
h
(
'ViewShell'
,
{
attrs
:
{
context
:
this
.
c
.
context
,
params
:
this
.
c
.
params
,
modal
:
this
.
embedViewModal
,
modelPath
:
page
.
embedView
.
source
.
modelPath
,
},
on
:
{
neuronInit
:
this
.
c
.
nerve
.
onNeuronInit
(
page
.
name
),
},
key
:
tabExpPage
.
key
,
})
}
</
i
-
tab
-
pane
>
);
})
}
{
this
.
renderDrTab
()
}
{
this
.
renderTabExpPage
()
}
</
i
-
tabs
>,
isRouter
&&
this
.
activeTab
&&
(
<
div
class=
{
this
.
ns
.
e
(
'route-content'
)
}
>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录