Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
f235a4be
提交
f235a4be
编写于
1月 26, 2022
作者:
LUCIFER-ZHU
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update: 更新门户部件绘制菜单、操作栏
上级
1f7541e2
变更
9
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
277 行增加
和
12 行删除
+277
-12
app-action-bar.vue
.../r7/app_{{apps}}/src/components/common/app-action-bar.vue
+123
-0
portal-view.ts
...{apps}}/src/core/modules/views/portal-view/portal-view.ts
+12
-1
dashboard-control.ts
...re/modules/widgets/dashboard-control/dashboard-control.ts
+13
-1
main-control.ts
...s}}/src/core/modules/widgets/main-control/main-control.ts
+25
-0
portlet-control.ts
...c/core/modules/widgets/portlet-control/portlet-control.ts
+41
-3
{{pages@APPPORTALVIEW}}.vue.hbs
...}/{{pages@APPPORTALVIEW}}/{{pages@APPPORTALVIEW}}.vue.hbs
+1
-1
{{ctrls@DASHBOARD}}-dashboard.vue.hbs
...SHBOARD}}-dashboard/{{ctrls@DASHBOARD}}-dashboard.vue.hbs
+1
-1
{{ctrls@PORTLET}}-portlet-state.ts.hbs
...@PORTLET}}-portlet/{{ctrls@PORTLET}}-portlet-state.ts.hbs
+25
-1
{{ctrls@PORTLET}}-portlet.vue.hbs
...ctrls@PORTLET}}-portlet/{{ctrls@PORTLET}}-portlet.vue.hbs
+36
-4
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/common/app-action-bar.vue
0 → 100644
浏览文件 @
f235a4be
<
script
setup
lang=
"ts"
>
import
{
IActionParam
,
IParam
,
IContext
,
UIUtil
}
from
'@core'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
interface
Props
{
uiService
:
any
;
items
:
IParam
;
viewSubject
?:
Subject
<
IActionParam
>
;
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{});
interface
appActionBarEmit
{
(
name
:
'itemClick'
,
value
:
IParam
):
void
;
}
const
emit
=
defineEmits
<
appActionBarEmit
>
();
/**
* 视图状态事件
*/
let
viewStateEvent
:
Subscription
|
undefined
=
undefined
;
/**
* 数据
*/
let
value
:
any
=
null
;
/**
* Vue生命周期mounted
*/
onMounted
(()
=>
{
if
(
props
.
viewSubject
)
{
viewStateEvent
=
props
.
viewSubject
.
subscribe
(({
tag
,
action
,
data
})
=>
{
if
(
!
Object
.
is
(
tag
,
'all-portlet'
))
{
return
;
}
if
(
Object
.
is
(
action
,
'loadmodel'
))
{
value
=
data
UIUtil
.
calcActionItemAuthState
(
data
,
props
.
items
,
props
.
uiService
);
}
});
}
});
/**
* Vue生命周期unmounted
*/
onUnmounted
(()
=>
{
if
(
viewStateEvent
)
{
viewStateEvent
.
unsubscribe
();
}
});
/**
* 处理点击事件
*/
const
handleClick
=
(
item
:
any
,
$event
:
any
)
=>
{
let
_data
=
{
tag
:
item
.
viewlogicname
,
params
:
value
,
event
:
$event
,
data
:
item
};
emit
(
"itemClick"
,
_data
);
};
</
script
>
<
template
>
<div
class=
"app-actionbar"
>
<div
class=
"app-actionbar-item"
v-for=
"(item,index) in Object.values(items)"
:key=
"index"
>
<a-badge
v-if=
"item.counterService&&item.counterService.counterData"
v-show=
"item.visabled"
:count=
"item.counterService.counterData[item.counterId]"
type=
"primary"
>
<a-button
:disabled=
"item.disabled"
@
click=
"handleClick(item, $event)"
>
<i
v-if=
"item.icon"
style=
"margin-right: 5px;"
:class=
"item.icon"
></i>
{{
item
.
actionName
}}
</a-button>
</a-badge>
<a-button
v-show=
"item.visabled"
:disabled=
"item.disabled"
v-else
@
click=
"handleClick(item, $event)"
>
<i
v-if=
"item.icon"
style=
"margin-right: 5px;"
:class=
"item.icon"
></i>
{{
item
.
actionName
}}
</a-button>
</div>
</div>
</
template
>
<
style
lang=
"scss"
scoped
>
.app-actionbar
{
padding
:
12px
;
display
:
flex
;
justify-content
:
flex-start
;
align-items
:
center
;
flex-wrap
:
wrap
;
.app-actionbar-item
{
margin-right
:
10px
;
margin-bottom
:
10px
;
}
}
</
style
>
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/portal-view/portal-view.ts
浏览文件 @
f235a4be
import
{
PortalViewState
,
IParam
,
ViewBase
}
from
'@core'
;
import
{
PortalViewState
,
IParam
,
ViewBase
,
IActionParam
}
from
'@core'
;
/**
/**
* @description 应用看板(门户)视图
* @description 应用看板(门户)视图
...
@@ -52,6 +52,17 @@ export class PortalView extends ViewBase {
...
@@ -52,6 +52,17 @@ export class PortalView extends ViewBase {
}
}
}
}
/**
* 处理部件事件
*
* @param {IActionParam} actionParam
* @memberof PortalView
*/
public
onCtrlEvent
(
actionParam
:
IActionParam
)
{
const
{
tag
,
action
,
data
}
=
actionParam
;
// TODO
}
/**
/**
* @description 安装视图所有功能模块的方法
* @description 安装视图所有功能模块的方法
*
*
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/dashboard-control/dashboard-control.ts
浏览文件 @
f235a4be
...
@@ -38,6 +38,17 @@ export class DashboardControl extends MainControl {
...
@@ -38,6 +38,17 @@ export class DashboardControl extends MainControl {
}
}
}
}
/**
* 处理部件事件
*
* @param {IActionParam} actionParam
* @memberof PortletControl
*/
public
onCtrlEvent
(
actionParam
:
IActionParam
)
{
const
{
tag
,
action
,
data
}
=
actionParam
;
const
{
controlName
}
=
this
.
state
;
}
/**
/**
* @description 安装部件所有功能模块的方法
* @description 安装部件所有功能模块的方法
* @return {*}
* @return {*}
...
@@ -48,6 +59,7 @@ export class DashboardControl extends MainControl {
...
@@ -48,6 +59,7 @@ export class DashboardControl extends MainControl {
return
{
return
{
...
superParams
,
...
superParams
,
load
:
this
.
useLoad
.
bind
(
this
),
load
:
this
.
useLoad
.
bind
(
this
),
onCtrlEvent
:
this
.
onCtrlEvent
.
bind
(
this
),
};
};
}
}
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/main-control/main-control.ts
浏览文件 @
f235a4be
...
@@ -15,6 +15,14 @@ export class MainControl extends ControlBase {
...
@@ -15,6 +15,14 @@ export class MainControl extends ControlBase {
*/
*/
public
declare
state
:
MainControlState
;
public
declare
state
:
MainControlState
;
/**
* 界面行为服务
*
* @type {(IParam | undefined)}
* @memberof MainControl
*/
public
appUIService
:
IParam
|
undefined
;
/**
/**
* @memberof MainControl
* @memberof MainControl
*/
*/
...
@@ -38,6 +46,21 @@ export class MainControl extends ControlBase {
...
@@ -38,6 +46,21 @@ export class MainControl extends ControlBase {
return
actionModel
;
return
actionModel
;
}
}
/**
*@description 使用UI服务
*
* @memberof MainControl
*/
public
useUIService
()
{
const
{
context
,
appEntityCodeName
}
=
this
.
state
;
if
(
appEntityCodeName
)
{
App
.
getUIService
(
appEntityCodeName
.
toLowerCase
(),
context
).
then
((
service
:
IParam
)
=>
{
this
.
appUIService
=
service
;
this
.
state
.
UIService
=
this
.
appUIService
;
})
}
}
/**
/**
* @description 安装部件所有功能模块的方法
* @description 安装部件所有功能模块的方法
* @return {*}
* @return {*}
...
@@ -45,6 +68,8 @@ export class MainControl extends ControlBase {
...
@@ -45,6 +68,8 @@ export class MainControl extends ControlBase {
*/
*/
public
moduleInstall
()
{
public
moduleInstall
()
{
const
superParams
=
super
.
moduleInstall
();
const
superParams
=
super
.
moduleInstall
();
// 使用UI服务
this
.
useUIService
();
return
{
return
{
...
superParams
...
superParams
};
};
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/portlet-control/portlet-control.ts
浏览文件 @
f235a4be
...
@@ -40,7 +40,7 @@ export class PortletControl extends MainControl {
...
@@ -40,7 +40,7 @@ export class PortletControl extends MainControl {
/**
/**
*
部件
事件
*
处理视图
事件
*
*
* @param {IActionParam} actionParam
* @param {IActionParam} actionParam
* @memberof PortletControl
* @memberof PortletControl
...
@@ -50,6 +50,42 @@ export class PortletControl extends MainControl {
...
@@ -50,6 +50,42 @@ export class PortletControl extends MainControl {
const
{
controlName
}
=
this
.
state
;
const
{
controlName
}
=
this
.
state
;
}
}
/**
* 处理部件事件
*
* @param {IActionParam} actionParam
* @memberof PortletControl
*/
public
onCtrlEvent
(
actionParam
:
IActionParam
)
{
const
{
tag
,
action
,
data
}
=
actionParam
;
const
{
controlName
}
=
this
.
state
;
}
/**
* 触发界面行为
*
* @memberof PortletControl
*/
public
handleItemClick
(
actionParam
:
any
):
void
{
console
.
log
(
'视图逻辑'
,
actionParam
);
const
{
data
:
uIAction
}
=
actionParam
;
if
(
!
uIAction
)
{
console
.
warn
(
"执行参数不足"
);
return
;
}
// 准备参数
const
inputParam
=
{
context
:
this
.
state
.
context
,
viewParams
:
this
.
state
.
viewParams
,
data
:
[],
event
:
actionParam
.
event
,
actionEnvironment
:
this
};
// 执行行为
App
.
getAppActionService
().
execute
(
uIAction
,
inputParam
);
}
/**
/**
* @description 安装部件所有功能模块的方法
* @description 安装部件所有功能模块的方法
* @return {*}
* @return {*}
...
@@ -59,8 +95,10 @@ export class PortletControl extends MainControl {
...
@@ -59,8 +95,10 @@ export class PortletControl extends MainControl {
const
superParams
=
super
.
moduleInstall
();
const
superParams
=
super
.
moduleInstall
();
return
{
return
{
...
superParams
,
...
superParams
,
load
:
this
.
useLoad
.
bind
(
this
),
load
:
this
.
useLoad
.
bind
(
this
),
onViewEvent
:
this
.
onViewEvent
.
bind
(
this
)
onViewEvent
:
this
.
onViewEvent
.
bind
(
this
),
onCtrlEvent
:
this
.
onCtrlEvent
.
bind
(
this
),
handleItemClick
:
this
.
handleItemClick
.
bind
(
this
),
};
};
}
}
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/views/{{appModules}}/{{pages@APPPORTALVIEW}}/{{pages@APPPORTALVIEW}}.vue.hbs
浏览文件 @
f235a4be
...
@@ -29,7 +29,7 @@ interface ViewEmit {
...
@@ -29,7 +29,7 @@ interface ViewEmit {
const
emit
=
defineEmits
<
ViewEmit
>
();
const
emit
=
defineEmits
<
ViewEmit
>
();
// 安装功能模块,提供状态和能力方法
// 安装功能模块,提供状态和能力方法
const
{
state
}
=
new
PortalView
(
viewState
,
props
,
emit
).
moduleInstall
();
const
{
state
,
dashboard
,
onCtrlEvent
}
=
new
PortalView
(
viewState
,
props
,
emit
).
moduleInstall
();
</script>
</script>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@DASHBOARD}}-dashboard/{{ctrls@DASHBOARD}}-dashboard.vue.hbs
浏览文件 @
f235a4be
...
@@ -42,7 +42,7 @@ interface CtrlEmit {
...
@@ -42,7 +42,7 @@ interface CtrlEmit {
const
emit
=
defineEmits
<
CtrlEmit
>
();
const
emit
=
defineEmits
<
CtrlEmit
>
();
// 安装功能模块,提供状态和能力方法
// 安装功能模块,提供状态和能力方法
const
{
name
,
state
}
=
new
DashboardControl
(
ctrlState
,
props
,
emit
).
moduleInstall
();
const
{
name
,
state
,
onCtrlEvent
}
=
new
DashboardControl
(
ctrlState
,
props
,
emit
).
moduleInstall
();
// 暴露内部状态及能力
// 暴露内部状态及能力
defineExpose
({
name
,
state
});
defineExpose
({
name
,
state
});
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@PORTLET}}-portlet/{{ctrls@PORTLET}}-portlet-state.ts.hbs
浏览文件 @
f235a4be
...
@@ -12,5 +12,29 @@ export const ctrlState = {
...
@@ -12,5 +12,29 @@ export const ctrlState = {
imagePath: '
{{
ctrl
.
psSysImage
.
imagePath
}}
',
imagePath: '
{{
ctrl
.
psSysImage
.
imagePath
}}
',
{{/if}}
{{/if}}
{{/if}}
{{/if}}
{{#if
ctrl
.
psAppDataEntity
}}
// 实体名称
appEntityName: '
{{
ctrl
.
psAppDataEntity
.
codeName
}}
',
appEntityCodeName: '
{{
ctrl
.
psAppDataEntity
.
codeName
}}
',
{{/if}}
{{#if
ctrl
.
psUIActionGroup
.
psUIActionGroupDetails
}}
// 操作栏模型
actionBarModelData: {
{{#
each
ctrl
.
psUIActionGroup
.
psUIActionGroupDetails
as
|
groupDetail
|
}}
{{
groupDetail
.
psUIAction
.
uIActionTag
}}
: {
viewlogicname: '
{{
groupDetail
.
name
}}
',
actionName: '
{{
groupDetail
.
psUIAction
.
caption
}}
',
icon: '
{{
groupDetail
.
psUIAction
.
psSysImage
.
cssClass
}}
',
disabled: false, visabled: true,
dataAccessAction:
{{#if
groupDetail
.
psUIAction
.
dataAccessAction
}}
false
{{else}}
true
{{/if}}
,
getNoPrivDisplayMode:
{{#if
groupDetail
.
psUIAction
.
noPrivDisplayMode
}}
groupDetail.psUIAction.noPrivDisplayMode
{{else}}
6
{{/if}}
,
codeName:'
{{
groupDetail
.
psUIAction
.
codeName
}}
',
fullCodeName:'
{{
groupDetail
.
psUIAction
.
fullCodeName
}}
',
uIActionMode:'
{{
groupDetail
.
psUIAction
.
uIActionMode
}}
',
uIActionTag:'
{{
groupDetail
.
psUIAction
.
uIActionTag
}}
',
uIActionType:'
{{
groupDetail
.
psUIAction
.
uIActionType
}}
',
},
{{/
each
}}
},
{{/if}}
};
};
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@PORTLET}}-portlet/{{ctrls@PORTLET}}-portlet.vue.hbs
浏览文件 @
f235a4be
...
@@ -2,10 +2,23 @@
...
@@ -2,10 +2,23 @@
import
{
Subject
}
from
'rxjs'
;
import
{
Subject
}
from
'rxjs'
;
import
{
ctrlState
}
from
'./
{{
spinalCase
ctrl
.
codeName
}}
-portlet-state'
;
import
{
ctrlState
}
from
'./
{{
spinalCase
ctrl
.
codeName
}}
-portlet-state'
;
import
{
PortletControl
,
IActionParam
,
IParam
,
IContext
}
from
'@core'
;
import
{
PortletControl
,
IActionParam
,
IParam
,
IContext
}
from
'@core'
;
// 引入视图start
{{#if
(
eq
ctrl
.
portletType
"VIEW"
)
}}
{{#if
ctrl
.
portletPSAppView
}}
{{#if
ctrl
.
portletPSAppView
}}
import
{{
ctrl
.
portletPSAppView
.
codeName
}}
from
'@views/
{{
spinalCase
ctrl
.
portletPSAppView
.
psAppModule
.
codeName
}}
/
{{
spinalCase
ctrl
.
portletPSAppView
.
codeName
}}
'
;
import
{{
ctrl
.
portletPSAppView
.
codeName
}}
from
'@views/
{{
spinalCase
ctrl
.
portletPSAppView
.
psAppModule
.
codeName
}}
/
{{
spinalCase
ctrl
.
portletPSAppView
.
codeName
}}
'
;
{{/if}}
{{/if}}
{{/if}}
// 引入视图end
// 引入菜单start
{{#if
(
eq
ctrl
.
portletType
"APPMENU"
)
}}
{{#
each
ctrl
.
psControls
as
|
control
|
}}
{{#
eq
control
.
controlType
"APPMENU"
}}
import
{
{{
control
.
codeName
}}
Menu
}
from
'@widgets/app/
{{
spinalCase
control
.
codeName
}}
-menu'
;
{{/
eq
}}
{{/
each
}}
{{/if}}
// 引入菜单end
interface
Props
{
interface
Props
{
name
:
string
,
name
:
string
,
...
@@ -26,7 +39,7 @@ interface CtrlEmit {
...
@@ -26,7 +39,7 @@ interface CtrlEmit {
const
emit
=
defineEmits
<
CtrlEmit
>
();
const
emit
=
defineEmits
<
CtrlEmit
>
();
// 安装功能模块,提供状态和能力方法
// 安装功能模块,提供状态和能力方法
const
{
name
,
state
,
onViewEvent
}
=
new
PortletControl
(
ctrlState
,
props
,
emit
).
moduleInstall
();
const
{
name
,
state
,
onViewEvent
,
onCtrlEvent
,
handleItemClick
}
=
new
PortletControl
(
ctrlState
,
props
,
emit
).
moduleInstall
();
// 暴露内部状态及能力
// 暴露内部状态及能力
defineExpose
({
name
,
state
});
defineExpose
({
name
,
state
});
...
@@ -34,13 +47,13 @@ defineExpose({ name, state });
...
@@ -34,13 +47,13 @@ defineExpose({ name, state });
<template>
<template>
<div
class=
"app-portlet
{{#if
ctrl
.
psSysCss
}}
{{
ctrl
.
psSysCss
.
cssName
}}{{/if}}
"
>
<div
class=
"app-portlet
{{#if
ctrl
.
psSysCss
}}
{{
ctrl
.
psSysCss
.
cssName
}}{{/if}}
"
>
<template
v-if=
"state.showTitleBar && state.title"
>
<template
v-if=
"state.showTitleBar && state.title"
>
<
p
class=
'portlet-title'
>
<
div
class=
'portlet-title'
>
<span>
<span>
<i
v-if=
"state.iconcls"
:class=
"state.iconcls"
/>
<i
v-if=
"state.iconcls"
:class=
"state.iconcls"
/>
<img
v-if=
"state.imagePath"
:src=
"state.imagePath"
/>
<img
v-if=
"state.imagePath"
:src=
"state.imagePath"
/>
\{{state.title}}
\{{state.title}}
</span>
</span>
</
p
>
</
div
>
</template>
</template>
<div
:class=
"{'portlet-with-title': state.showTitleBar, 'portlet-without-title': !state.showTitleBar}"
>
<div
:class=
"{'portlet-with-title': state.showTitleBar, 'portlet-without-title': !state.showTitleBar}"
>
{{#if
(
eq
ctrl
.
portletType
'VIEW'
)
}}
{{#if
(
eq
ctrl
.
portletType
'VIEW'
)
}}
...
@@ -51,8 +64,27 @@ defineExpose({ name, state });
...
@@ -51,8 +64,27 @@ defineExpose({ name, state });
@
viewEvent=
"onViewEvent"
@
viewEvent=
"onViewEvent"
/>
/>
{{else
if
(
eq
ctrl
.
portletType
'APPMENU'
)
}}
{{else
if
(
eq
ctrl
.
portletType
'APPMENU'
)
}}
{{#
each
ctrl
.
psControls
as
|
control
|
}}
<
{{
control
.
codeName
}}
Menu
ref=
"menu"
name=
"
{{
name
}}
"
:context=
"state.context"
:viewParams=
"state.viewParams"
:viewSubject=
"state.viewSubject"
menuAlign=
"LEFT"
:collapsed=
"false"
@
ctrlEvent=
"onCtrlEvent"
></
{{
control
.
codeName
}}
Menu>
{{/
each
}}
{{else
if
(
eq
ctrl
.
portletType
'CUSTOM'
)
}}
{{else
if
(
eq
ctrl
.
portletType
'CUSTOM'
)
}}
<div>
暂未支持自定义绘制
</div>
{{else
if
(
eq
ctrl
.
portletType
'ACTIONBAR'
)
}}
{{else
if
(
eq
ctrl
.
portletType
'ACTIONBAR'
)
}}
<app-action-bar
:viewSubject=
"state.viewSubject"
:uiService=
"state.UIService"
:items=
"state.actionBarModelData"
@
itemClick=
"handleItemClick"
></app-action-bar>
{{else
if
(
eq
ctrl
.
portletType
'TOOLBAR'
)
}}
{{else
if
(
eq
ctrl
.
portletType
'TOOLBAR'
)
}}
{{else
if
(
eq
ctrl
.
portletType
'HTML'
)
}}
{{else
if
(
eq
ctrl
.
portletType
'HTML'
)
}}
{{else
if
(
eq
ctrl
.
portletType
'RAWITEM'
)
}}
{{else
if
(
eq
ctrl
.
portletType
'RAWITEM'
)
}}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录