Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
e226fb12
提交
e226fb12
编写于
1月 24, 2022
作者:
LUCIFER-ZHU
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update: 更新应用看板视图
上级
a1a28061
变更
27
显示空白字符变更
内嵌
并排
正在显示
27 个修改的文件
包含
556 行增加
和
3 行删除
+556
-3
PageModel.java
...ore/src/main/java/cn/ibizlab/codegen/model/PageModel.java
+12
-2
include-dashboard.hbs
.../front-end/widgets/dashboard-detail/include-dashboard.hbs
+1
-0
portlet.hbs
.../r7/@macro/front-end/widgets/dashboard-detail/portlet.hbs
+27
-0
app-portal-view-layout.vue
...{{apps}}/src/components/layout/app-portal-view-layout.vue
+29
-0
index.ts
...ces/templ/r7/app_{{apps}}/src/core/modules/views/index.ts
+2
-1
index.ts
.../app_{{apps}}/src/core/modules/views/portal-view/index.ts
+3
-0
portal-view-prop.ts
...}}/src/core/modules/views/portal-view/portal-view-prop.ts
+11
-0
portal-view-state.ts
...}/src/core/modules/views/portal-view/portal-view-state.ts
+11
-0
portal-view.ts
...{apps}}/src/core/modules/views/portal-view/portal-view.ts
+68
-0
dashboard-control-prop.ts
...dules/widgets/dashboard-control/dashboard-control-prop.ts
+11
-0
dashboard-control-state.ts
...ules/widgets/dashboard-control/dashboard-control-state.ts
+11
-0
dashboard-control.ts
...re/modules/widgets/dashboard-control/dashboard-control.ts
+53
-0
index.ts
...pps}}/src/core/modules/widgets/dashboard-control/index.ts
+3
-0
index.ts
...s/templ/r7/app_{{apps}}/src/core/modules/widgets/index.ts
+2
-0
index.ts
...{apps}}/src/core/modules/widgets/portlet-control/index.ts
+3
-0
portlet-control-prop.ts
...e/modules/widgets/portlet-control/portlet-control-prop.ts
+11
-0
portlet-control-state.ts
.../modules/widgets/portlet-control/portlet-control-state.ts
+11
-0
portlet-control.ts
...c/core/modules/widgets/portlet-control/portlet-control.ts
+66
-0
index.ts.hbs
...views/{{appModules}}/{{pages@APPPORTALVIEW}}/index.ts.hbs
+3
-0
{{pages@APPPORTALVIEW}}-state.ts.hbs
...ages@APPPORTALVIEW}}/{{pages@APPPORTALVIEW}}-state.ts.hbs
+3
-0
{{pages@APPPORTALVIEW}}.vue.hbs
...}/{{pages@APPPORTALVIEW}}/{{pages@APPPORTALVIEW}}.vue.hbs
+64
-0
index.ts.hbs
...{appEntities}}/{{ctrls@DASHBOARD}}-dashboard/index.ts.hbs
+3
-0
{{ctrls@DASHBOARD}}-dashboard-state.ts.hbs
...RD}}-dashboard/{{ctrls@DASHBOARD}}-dashboard-state.ts.hbs
+6
-0
{{ctrls@DASHBOARD}}-dashboard.vue.hbs
...SHBOARD}}-dashboard/{{ctrls@DASHBOARD}}-dashboard.vue.hbs
+100
-0
index.ts.hbs
...ts/{{appEntities}}/{{ctrls@PORTLET}}-portlet/index.ts.hbs
+3
-0
{{ctrls@PORTLET}}-portlet-state.ts.hbs
...@PORTLET}}-portlet/{{ctrls@PORTLET}}-portlet-state.ts.hbs
+5
-0
{{ctrls@PORTLET}}-portlet.vue.hbs
...ctrls@PORTLET}}-portlet/{{ctrls@PORTLET}}-portlet.vue.hbs
+34
-0
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/PageModel.java
浏览文件 @
e226fb12
...
...
@@ -12,6 +12,7 @@ import net.ibizsys.model.control.expbar.IPSExpBar;
import
net.ibizsys.model.control.toolbar.IPSDETBUIActionItem
;
import
net.ibizsys.model.control.toolbar.IPSDEToolbar
;
import
net.ibizsys.model.view.IPSUIAction
;
import
net.ibizsys.model.control.dashboard.IPSDashboard
;
import
java.util.*
;
...
...
@@ -48,9 +49,18 @@ public class PageModel extends BaseModel{
if
(!
this
.
ctrlsMap
.
containsKey
(
ctrl
.
getId
())){
this
.
ctrlsMap
.
put
(
ctrl
.
getId
(),
ctrl
);
}
String
ctrlType
=
ctrl
.
getControl
().
getControlType
();
// 树导航栏获取数据部件
if
(
"TREEEXPBAR"
.
equals
(
ctrl
.
getControl
().
getControlType
()))
{
List
<
IPSControl
>
controls
=
((
IPSExpBar
)
item
).
getPSControls
();
if
(
"TREEEXPBAR"
.
equals
(
ctrlType
)
||
"DASHBOARD"
.
equals
(
ctrlType
))
{
List
<
IPSControl
>
controls
=
new
ArrayList
<>();
switch
(
ctrlType
)
{
case
"TREEEXPBAR"
:
controls
=
((
IPSExpBar
)
item
).
getPSControls
();
break
;
case
"DASHBOARD"
:
controls
=
((
IPSDashboard
)
item
).
getPSControls
();
break
;
}
if
(
controls
.
size
()
>
0
)
{
for
(
IPSControl
control
:
controls
)
{
CtrlModel
ctrlModel
=
new
CtrlModel
(
appModel
,
control
);
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/dashboard-detail/include-dashboard.hbs
0 → 100644
浏览文件 @
e226fb12
{{#
*
inline
"PORTLET"
}}{{>
@macro
/
front-end
/
widgets
/
dashboard-detail
/
portlet
.
hbs
}}{{/
inline
}}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/dashboard-detail/portlet.hbs
0 → 100644
浏览文件 @
e226fb12
{{#
eq
ctrl
.
psLayout
.
layout
"FLEX"
}}
<div
class=
"app-dashboard-layout-flex"
style=
"
{{#if
ctrl
.
psLayout
.
dir
}}
flex-direction:
{{
ctrl
.
psLayout
.
dir
}}
;
{{/if}}{{#if
ctrl
.
psLayout
.
align
}}
justify-content:
{{
ctrl
.
psLayout
.
align
}}
;
{{/if}}{{#if
ctrl
.
psLayout
.
vAlign
}}
align-items:
{{
ctrl
.
psLayout
.
vAlign
}}
;
{{/if}}
"
>
</div>
{{else}}
<a-row
class=
"app-dashboard-layout-table"
>
{{#
each
ctrl
.
PSControls
as
|
portlet
|
}}
<a-col
{{>
@macro
/
front-end
/
widgets
/
common
/
layout-pos
.
hbs
item
=
portlet
.
psLayoutPos
}}
>
{{#
eq
portlet
.
portletType
'CONTAINER'
}}
{{#if
portlet
.
PSControls
}}
<div
class=
"portlet-card"
:bordered=
"false"
dis-hover
:padding=
"0"
>
{{else}}
<div
class=
"portlet-card custom-card"
:bordered=
"false"
dis-hover
:padding=
"10"
>
{{/if}}
{{#if
(
and
portlet
.
showTitleBar
portlet
.
title
)
}}
<div
class=
"portlet-card-title"
>
\{{portlet.title}}
</div>
{{/if}}
</div>
{{/if}}
</div>
{{/
eq
}}
</a-col>
{{/
each
}}
</a-row>
{{/
eq
}}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/layout/app-portal-view-layout.vue
0 → 100644
浏览文件 @
e226fb12
<
script
setup
lang=
"ts"
>
</
script
>
<
template
>
<AppViewBaseLayout>
<template
v-slot:header-left
>
<slot
name=
"caption"
/>
</
template
>
<
template
v-slot:header-right
>
<slot
name=
"toolbar"
/>
</
template
>
<
template
v-slot:header-bottom
>
<slot
name=
"topMessage"
/>
</
template
>
<
template
v-slot:body-top
>
<slot
name=
"bodyMessage"
/>
</
template
>
<slot
/>
<
template
v-slot:footer-content
>
<slot
name=
"bottomMessage"
/>
</
template
>
</AppViewBaseLayout>
</template>
<
style
lang=
"scss"
>
</
style
>
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/index.ts
浏览文件 @
e226fb12
...
...
@@ -10,3 +10,4 @@ export * from './mpickup-view'
export
*
from
'./pickup-grid-view'
export
*
from
'./tree-exp-view'
export
*
from
'./tree-view'
export
*
from
'./portal-view'
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/portal-view/index.ts
0 → 100644
浏览文件 @
e226fb12
export
*
from
'./portal-view-prop'
export
*
from
'./portal-view-state'
export
*
from
'./portal-view'
\ 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-prop.ts
0 → 100644
浏览文件 @
e226fb12
import
{
ViewPropsBase
}
from
"@core"
;
/**
* @description 应用看板(门户)视图props
* @export
* @interface PortalViewProps
* @extends {ViewPropsBase}
*/
export
interface
PortalViewProps
extends
ViewPropsBase
{
}
\ 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-state.ts
0 → 100644
浏览文件 @
e226fb12
import
{
ViewStateBase
}
from
"@core"
;
/**
* @description 应用看板(门户)视图state
* @export
* @interface PortalViewState
* @extends {ViewStateBase}
*/
export
interface
PortalViewState
extends
ViewStateBase
{
}
\ 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
0 → 100644
浏览文件 @
e226fb12
import
{
PortalViewState
,
IParam
,
ViewBase
}
from
'@core'
;
/**
* @description 应用看板(门户)视图
* @export
* @class PortalView
* @extends {PortalView}
*/
export
class
PortalView
extends
ViewBase
{
/**
* 视图状态
*
* @type {PortalViewState}
* @memberof PortalView
*/
public
declare
state
:
PortalViewState
;
/**
* 当前视图数据看板
*
* @type {IParam}
* @memberof PortalView
*/
public
declare
dashboard
:
IParam
;
/**
* @description 处理视图初始化
*
* @memberof PortalView
*/
public
useViewInit
()
{
// 初始化数据看板引用
this
.
dashboard
=
ref
(
null
);
const
{
viewSubject
}
=
this
.
state
;
onMounted
(()
=>
{
const
{
viewParams
}
=
this
.
state
;
viewSubject
.
next
({
tag
:
this
.
getDashboard
().
name
,
action
:
"load"
,
data
:
viewParams
});
})
}
/**
* 获取数据看板部件
*
* @return {*} {*}
* @memberof PortalView
*/
public
getDashboard
():
any
{
if
(
this
.
dashboard
.
value
)
{
return
this
.
dashboard
.
value
;
}
else
{
return
null
;
}
}
/**
* @description 安装视图所有功能模块的方法
*
* @memberof PortalView
*/
public
moduleInstall
()
{
const
superParams
=
super
.
moduleInstall
();
return
{
...
superParams
,
dashboard
:
this
.
dashboard
};
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/dashboard-control/dashboard-control-prop.ts
0 → 100644
浏览文件 @
e226fb12
import
{
IParam
,
MainControlProps
}
from
"@core"
;
/**
* @description 数据看板部件的props
* @export
* @interface DashboardControlProps
* @extends {MainControlProps}
*/
export
interface
DashboardControlProps
extends
MainControlProps
{
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/dashboard-control/dashboard-control-state.ts
0 → 100644
浏览文件 @
e226fb12
import
{
IParam
,
MainControlState
}
from
'@core'
;
/**
* @description 数据看板部件状态
* @export
* @interface DashboardControlState
* @extends {MainControlState}
*/
export
interface
DashboardControlState
extends
MainControlState
{
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/dashboard-control/dashboard-control.ts
0 → 100644
浏览文件 @
e226fb12
import
{
IActionParam
,
MainControl
}
from
'@core'
;
import
{
DashboardControlProps
}
from
'./dashboard-control-prop'
;
import
{
DashboardControlState
}
from
'./dashboard-control-state'
;
/**
* @description 选择视图面板部件
* @export
* @class DashboardControl
* @extends {MainControl}
*/
export
class
DashboardControl
extends
MainControl
{
/**
* @description 部件状态
* @type {DashboardControlState}
* @memberof DashboardControl
*/
public
declare
state
:
DashboardControlState
;
/**
* @description
* @param {DashboardControlProps} props
* @memberof DashboardControl
*/
public
useLoad
(
props
:
DashboardControlProps
)
{
const
{
viewSubject
,
controlName
,
context
,
viewParams
}
=
this
.
state
;
// 订阅viewSubject,监听load行为
if
(
viewSubject
)
{
let
subscription
=
viewSubject
.
subscribe
(({
tag
,
action
,
data
}:
IActionParam
)
=>
{
if
(
Object
.
is
(
controlName
,
tag
)
&&
Object
.
is
(
"load"
,
action
))
{
viewSubject
.
next
({
tag
:
tag
,
action
:
"load"
,
data
:
data
});
}
})
// 部件卸载时退订viewSubject
onUnmounted
(()
=>
{
subscription
.
unsubscribe
();
})
}
}
/**
* @description 安装部件所有功能模块的方法
* @return {*}
* @memberof DashboardControl
*/
public
moduleInstall
()
{
const
superParams
=
super
.
moduleInstall
();
return
{
...
superParams
,
load
:
this
.
useLoad
.
bind
(
this
),
};
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/dashboard-control/index.ts
0 → 100644
浏览文件 @
e226fb12
export
*
from
'./dashboard-control-prop'
export
*
from
'./dashboard-control-state'
export
*
from
'./dashboard-control'
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/index.ts
浏览文件 @
e226fb12
...
...
@@ -11,3 +11,5 @@ export * from './tree-control'
export
*
from
'./search-form-control'
export
*
from
'./quick-search-form-control'
export
*
from
'./searchbar-control'
export
*
from
'./dashboard-control'
export
*
from
'./portlet-control'
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/portlet-control/index.ts
0 → 100644
浏览文件 @
e226fb12
export
*
from
'./portlet-control-prop'
export
*
from
'./portlet-control-state'
export
*
from
'./portlet-control'
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/portlet-control/portlet-control-prop.ts
0 → 100644
浏览文件 @
e226fb12
import
{
MainControlProps
}
from
"@core"
;
/**
* @description 门户部件参数
* @export
* @interface PortletControlProps
* @extends {MainControlProps}
*/
export
interface
PortletControlProps
extends
MainControlProps
{
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/portlet-control/portlet-control-state.ts
0 → 100644
浏览文件 @
e226fb12
import
{
IParam
,
MainControlState
}
from
'@core'
;
/**
* @description 门户部件状态
* @export
* @interface PortletControlState
* @extends {MainControlState}
*/
export
interface
PortletControlState
extends
MainControlState
{
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/portlet-control/portlet-control.ts
0 → 100644
浏览文件 @
e226fb12
import
{
IActionParam
,
MainControl
}
from
'@core'
;
import
{
PortletControlProps
}
from
'./portlet-control-prop'
;
import
{
PortletControlState
}
from
'./portlet-control-state'
;
/**
* @description 门户部件
* @export
* @class PortletControl
* @extends {MainControl}
*/
export
class
PortletControl
extends
MainControl
{
/**
* @description 部件状态
* @type {PortletControlState}
* @memberof PortletControl
*/
public
declare
state
:
PortletControlState
;
/**
* @description 加载
* @param {PortletControlProps} props
* @memberof PortletControl
*/
public
useLoad
(
props
:
PortletControlProps
)
{
const
{
viewSubject
,
controlName
,
context
,
viewParams
}
=
this
.
state
;
// 订阅viewSubject,监听load行为
if
(
viewSubject
)
{
let
subscription
=
viewSubject
.
subscribe
(({
tag
,
action
,
data
}:
IActionParam
)
=>
{
if
(
Object
.
is
(
controlName
,
tag
)
&&
Object
.
is
(
"load"
,
action
))
{
viewSubject
.
next
({
tag
:
tag
,
action
:
"load"
,
data
:
data
});
}
})
// 部件卸载时退订viewSubject
onUnmounted
(()
=>
{
subscription
.
unsubscribe
();
})
}
}
/**
* 部件事件
*
* @param {IActionParam} actionParam
* @memberof PortletControl
*/
public
onViewEvent
(
actionParam
:
IActionParam
)
{
const
{
tag
,
action
,
data
}
=
actionParam
;
const
{
controlName
}
=
this
.
state
;
}
/**
* @description 安装部件所有功能模块的方法
* @return {*}
* @memberof PortletControl
*/
public
moduleInstall
()
{
const
superParams
=
super
.
moduleInstall
();
return
{
...
superParams
,
load
:
this
.
useLoad
.
bind
(
this
),
onViewEvent
:
this
.
onViewEvent
.
bind
(
this
)
};
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/views/{{appModules}}/{{pages@APPPORTALVIEW}}/index.ts.hbs
0 → 100644
浏览文件 @
e226fb12
import
{{
page
.
codeName
}}
from "./
{{
spinalCase
page
.
codeName
}}
.vue";
export default
{{
page
.
codeName
}}
;
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/views/{{appModules}}/{{pages@APPPORTALVIEW}}/{{pages@APPPORTALVIEW}}-state.ts.hbs
0 → 100644
浏览文件 @
e226fb12
export const viewState = {
{{>
@macro
/
front-end
/
views
/
view-base-config
.
hbs
}}
};
\ 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
0 → 100644
浏览文件 @
e226fb12
<script
setup
lang=
"ts"
>
import
{
Subject
}
from
'rxjs'
;
import
{
PortalView
,
IActionParam
,
IParam
,
IContext
}
from
'@core'
;
import
{
viewState
}
from
'./
{{
spinalCase
page
.
codeName
}}
-state'
;
{{#
page
.
ctrls
}}
{{#
eq
controlType
"DASHBOARD"
}}
import
{
{{
codeName
}}
Dashboard
}
from
'@widgets/app/
{{
spinalCase
codeName
}}
-dashboard'
;
{{/
eq
}}
{{/
page
.
ctrls
}}
// props声明和默认值处理
interface
Props
{
context
?:
IContext
;
viewParams
?:
IParam
;
openType
?:
"ROUTE"
|
"MODAL"
|
"EMBED"
;
viewSubject
?:
Subject
<
IActionParam
>
;
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
openType
:
'ROUTE'
,
viewSubject
:
()
=>
new
Subject
<
IActionParam
>
()
})
// emit声明
interface
ViewEmit
{
(
name
:
"onViewEvent"
,
value
:
IActionParam
):
void
;
}
const
emit
=
defineEmits
<
ViewEmit
>
();
// 安装功能模块,提供状态和能力方法
const
{
state
}
=
new
PortalView
(
viewState
,
props
,
emit
).
moduleInstall
();
</script>
<template>
<AppPortalViewLayout
:class=
"['app-edit-view', state.viewSysCss]"
>
<template
v-slot:caption
>
<AppIconText
class=
"app-view__caption"
size=
"large"
:subCaption=
"state.subCaption"
:showCaptionBar=
"state.showCaptionBar"
:text=
"state.viewCaption"
/>
</template>
{{#
page
.
ctrls
}}
{{#
eq
controlType
"DASHBOARD"
}}
<
{{
codeName
}}
Dashboard
ref=
"dashboard"
name=
"
{{
name
}}
"
:context=
"state.context"
:viewParams=
"state.viewParams"
:controlAction=
"state.
{{
name
}}
.action"
:viewSubject=
"state.viewSubject"
@
ctrlEvent=
"onCtrlEvent"
></
{{
codeName
}}
Dashboard>
{{/
eq
}}
{{/
page
.
ctrls
}}
</AppPortalViewLayout>
</template>
<style
lang=
"scss"
>
</style>
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@DASHBOARD}}-dashboard/index.ts.hbs
0 → 100644
浏览文件 @
e226fb12
import
{{
ctrl
.
codeName
}}
Dashboard from "./
{{
spinalCase
ctrl
.
codeName
}}
-dashboard.vue";
export {
{{
ctrl
.
codeName
}}
Dashboard };
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@DASHBOARD}}-dashboard/{{ctrls@DASHBOARD}}-dashboard-state.ts.hbs
0 → 100644
浏览文件 @
e226fb12
// 部件配置对象
export const ctrlState = {
controlCodeName: '
{{
ctrl
.
codeName
}}
',
controlName: '
{{
ctrl
.
name
}}
',
isEnableCustomized:
{{
ctrl
.
enableCustomized
}}
,
};
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@DASHBOARD}}-dashboard/{{ctrls@DASHBOARD}}-dashboard.vue.hbs
0 → 100644
浏览文件 @
e226fb12
<script
setup
lang=
"ts"
>
import
{
Subject
}
from
'rxjs'
;
import
{
ctrlState
}
from
'./
{{
spinalCase
ctrl
.
codeName
}}
-dashboard-state'
;
import
{
DashboardControl
,
IActionParam
,
IParam
,
IContext
}
from
'@core'
;
{{#
each
ctrl
.
psControls
as
|
control
|
}}
{{#
neq
portletType
"CONTAINER"
}}
{{#if
control
.
psAppDataEntity
}}
import
{
{{
codeName
}}
Portlet
}
from
'@widgets/
{{
spinalCase
control
.
psAppDataEntity
.
codeName
}}
/
{{
spinalCase
codeName
}}
-portlet'
;
{{else}}
import
{
{{
codeName
}}
Portlet
}
from
'@widgets/app/
{{
spinalCase
codeName
}}
-portlet'
;
{{/if}}
{{/
neq
}}
{{/
each
}}
interface
Props
{
name
:
string
,
context
:
IContext
;
viewParams
?:
IParam
;
viewSubject
:
Subject
<
IActionParam
>
;
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
viewSubject
:
()
=>
new
Subject
<
IActionParam
>
(),
})
// emit声明
interface
CtrlEmit
{
(
name
:
"ctrlEvent"
,
value
:
IActionParam
):
void
;
}
const
emit
=
defineEmits
<
CtrlEmit
>
();
// 安装功能模块,提供状态和能力方法
const
{
state
}
=
new
DashboardControl
(
ctrlState
,
props
,
emit
).
moduleInstall
();
// 暴露内部状态及能力
defineExpose
({
state
,
name
:
'
{{
ctrl
.
name
}}
'
});
</script>
<template>
<div
class=
"app-dashboard
{{#if
ctrl
.
psSysCss
}}
{{
ctrl
.
psSysCss
.
cssName
}}{{/if}}
"
>
{{#if
(
eq
ctrl
.
enableCustomized
false
)
}}
{{#
eq
ctrl
.
psLayout
.
layout
"FLEX"
}}
<div
class=
"app-dashboard-layout-flex"
style=
"
{{#if
ctrl
.
psLayout
.
dir
}}
flex-direction:
{{
ctrl
.
psLayout
.
dir
}}
;
{{/if}}{{#if
ctrl
.
psLayout
.
align
}}
justify-content:
{{
ctrl
.
psLayout
.
align
}}
;
{{/if}}{{#if
ctrl
.
psLayout
.
vAlign
}}
align-items:
{{
ctrl
.
psLayout
.
vAlign
}}
;
{{/if}}
"
>
</div>
{{else}}
<a-row
class=
"app-dashboard-layout-table"
>
{{#
each
ctrl
.
psPortlets
as
|
portlet
|
}}
<a-col
{{>
@macro
/
front-end
/
widgets
/
common
/
layout-pos
.
hbs
item
=
portlet
.
psLayoutPos
}}
>
{{#
eq
portlet
.
portletType
'CONTAINER'
}}
{{#if
portlet
.
psPortlets
}}
<div
class=
"portlet-card"
:bordered=
"false"
dis-hover
:padding=
"0"
>
{{else}}
<div
class=
"portlet-card custom-card"
:bordered=
"false"
dis-hover
:padding=
"10"
>
{{/if}}
{{#if
(
and
portlet
.
showTitleBar
portlet
.
title
)
}}
<div
class=
"portlet-card-title"
>
{{
portlet
.
title
}}
</div>
{{/if}}
{{#
each
portlet
.
psPortlets
as
|
item
|
}}
{{#
eq
item
.
psLayout
.
layout
"FLEX"
}}
<div
class=
"app-dashboard-layout-flex"
style=
"
{{#if
item
.
psLayout
.
dir
}}
flex-direction:
{{
item
.
psLayout
.
dir
}}
;
{{/if}}{{#if
item
.
psLayout
.
align
}}
justify-content:
{{
item
.
psLayout
.
align
}}
;
{{/if}}{{#if
item
.
psLayout
.
vAlign
}}
align-items:
{{
item
.
psLayout
.
vAlign
}}
;
{{/if}}
"
>
</div>
{{else}}
<a-row
class=
"app-dashboard-layout-table"
>
<a-col
{{>
@macro
/
front-end
/
widgets
/
common
/
layout-pos
.
hbs
item
=
item
.
psLayoutPos
}}
>
<
{{
codeName
}}
Portlet
ref=
"portlet"
name=
"
{{
item
.
name
}}
"
:context=
"state.context"
:viewParams=
"state.viewParams"
:viewSubject=
"state.viewSubject"
@
ctrlEvent=
"onCtrlEvent"
></
{{
codeName
}}
Portlet>
</a-col>
</a-row>
{{/
eq
}}
{{/
each
}}
</div>
{{else}}
<
{{
codeName
}}
Portlet
ref=
"portlet"
name=
"
{{
name
}}
"
:context=
"state.context"
:viewParams=
"state.viewParams"
:viewSubject=
"state.viewSubject"
@
ctrlEvent=
"onCtrlEvent"
></
{{
codeName
}}
Portlet>
{{/
eq
}}
</a-col>
{{/
each
}}
</a-row>
{{/
eq
}}
{{/if}}
</div>
</template>
<style
lang=
"scss"
>
</style>
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@PORTLET}}-portlet/index.ts.hbs
0 → 100644
浏览文件 @
e226fb12
import
{{
ctrl
.
codeName
}}
Portlet from "./
{{
spinalCase
ctrl
.
codeName
}}
-portlet.vue";
export {
{{
ctrl
.
codeName
}}
Portlet };
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@PORTLET}}-portlet/{{ctrls@PORTLET}}-portlet-state.ts.hbs
0 → 100644
浏览文件 @
e226fb12
// 部件配置对象
export const ctrlState = {
controlCodeName: '
{{
ctrl
.
codeName
}}
',
controlName: '
{{
ctrl
.
name
}}
',
};
\ 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
0 → 100644
浏览文件 @
e226fb12
<script
setup
lang=
"ts"
>
import
{
Subject
}
from
'rxjs'
;
import
{
ctrlState
}
from
'./
{{
spinalCase
ctrl
.
codeName
}}
-portlet-state'
;
import
{
PortletControl
,
IActionParam
,
IParam
,
IContext
}
from
'@core'
;
interface
Props
{
name
:
string
,
context
:
IContext
;
viewParams
?:
IParam
;
viewSubject
:
Subject
<
IActionParam
>
;
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
viewSubject
:
()
=>
new
Subject
<
IActionParam
>
(),
})
// emit声明
interface
CtrlEmit
{
(
name
:
"ctrlEvent"
,
value
:
IActionParam
):
void
;
}
const
emit
=
defineEmits
<
CtrlEmit
>
();
// 安装功能模块,提供状态和能力方法
const
{
state
}
=
new
PortletControl
(
ctrlState
,
props
,
emit
).
moduleInstall
();
// 暴露内部状态及能力
defineExpose
({
state
,
name
:
'
{{
ctrl
.
name
}}
'
});
</script>
<template>
<div>
portlet
</div>
</template>
<style
lang=
"scss"
>
</style>
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录