Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
bfc30869
提交
bfc30869
编写于
12月 23, 2021
作者:
Shine-zwj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:更新
上级
da19e89b
变更
27
隐藏空白字符变更
内嵌
并排
正在显示
27 个修改的文件
包含
592 行增加
和
155 行删除
+592
-155
include-ctrls.hbs
...in/resources/templ/r7/@macro/components/include-ctrls.hbs
+0
-9
dropdownList.hbs
...in/resources/templ/r7/@macro/form-detail/dropdownList.hbs
+26
-0
form-group.hbs
...main/resources/templ/r7/@macro/form-detail/form-group.hbs
+0
-0
form-item.hbs
.../main/resources/templ/r7/@macro/form-detail/form-item.hbs
+0
-0
form-page.hbs
.../main/resources/templ/r7/@macro/form-detail/form-page.hbs
+0
-0
include-form.hbs
...in/resources/templ/r7/@macro/form-detail/include-form.hbs
+9
-0
input.hbs
.../src/main/resources/templ/r7/@macro/form-detail/input.hbs
+36
-0
span.hbs
...e/src/main/resources/templ/r7/@macro/form-detail/span.hbs
+28
-0
include-menu.hbs
...in/resources/templ/r7/@macro/menu-detail/include-menu.hbs
+1
-0
menu-item.hbs
.../main/resources/templ/r7/@macro/menu-detail/menu-item.hbs
+34
-0
App.vue
...core/src/main/resources/templ/r7/app_{{apps}}/src/App.vue
+2
-2
MenuItem.vue
.../app_{{apps}}/src/components/render/MenuItem/MenuItem.vue
+5
-5
index-view-prop.ts
...src/ibiz-core/modules/views/index-view/index-view-prop.ts
+11
-0
index-view-state.ts
...rc/ibiz-core/modules/views/index-view/index-view-state.ts
+11
-0
index-view.ts
...ps}}/src/ibiz-core/modules/views/index-view/index-view.ts
+39
-0
index.ts
..._{{apps}}/src/ibiz-core/modules/views/index-view/index.ts
+3
-0
index.ts
...empl/r7/app_{{apps}}/src/ibiz-core/modules/views/index.ts
+2
-1
index.ts
...pl/r7/app_{{apps}}/src/ibiz-core/modules/widgets/index.ts
+2
-1
index.ts
...pps}}/src/ibiz-core/modules/widgets/menu-control/index.ts
+3
-0
menu-control-prop.ts
...iz-core/modules/widgets/menu-control/menu-control-prop.ts
+31
-0
menu-control-state.ts
...z-core/modules/widgets/menu-control/menu-control-state.ts
+59
-0
menu-control.ts
...rc/ibiz-core/modules/widgets/menu-control/menu-control.ts
+240
-0
{{pages@APPINDEXVIEW}}.vue.hbs
...e/{{appModules}}/{{pages}}/{{pages@APPINDEXVIEW}}.vue.hbs
+15
-14
{{ctrls@APPMENU}}-menu-config.ts.hbs
...ctrls@APPMENU}}-menu/{{ctrls@APPMENU}}-menu-config.ts.hbs
+11
-3
{{ctrls@APPMENU}}-menu.vue.hbs
...s}}/{{ctrls@APPMENU}}-menu/{{ctrls@APPMENU}}-menu.vue.hbs
+20
-115
{{ctrls@FORM}}-form-config.ts.hbs
...s}}/{{ctrls@FORM}}-form/{{ctrls@FORM}}-form-config.ts.hbs
+2
-3
{{ctrls@FORM}}-form.vue.hbs
...ntities}}/{{ctrls@FORM}}-form/{{ctrls@FORM}}-form.vue.hbs
+2
-2
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/components/include-ctrls.hbs
已删除
100644 → 0
浏览文件 @
da19e89b
{{#
*
inline
"FORMPAGE"
}}{{>
@macro
/
components
/
form-page
.
hbs
}}{{/
inline
}}
{{#
*
inline
"GROUPPANEL"
}}{{>
@macro
/
components
/
form-group
.
hbs
}}{{/
inline
}}
{{#
*
inline
"FORMITEM"
}}{{>
@macro
/
components
/
form-item
.
hbs
}}{{/
inline
}}
{{#
*
inline
"TEXTBOX"
}}{{>
@macro
/
components
/
input
.
hbs
}}{{/
inline
}}
{{#
*
inline
"NUMBER"
}}{{>
@macro
/
components
/
input
.
hbs
}}{{/
inline
}}
{{#
*
inline
"PASSWORD"
}}{{>
@macro
/
components
/
input
.
hbs
}}{{/
inline
}}
{{#
*
inline
"TEXTAREA"
}}{{>
@macro
/
components
/
input
.
hbs
}}{{/
inline
}}
{{#
*
inline
"SPAN"
}}{{>
@macro
/
components
/
span
.
hbs
}}{{/
inline
}}
{{#
*
inline
"DROPDOWNLIST"
}}{{>
@macro
/
components
/
dropdownList
.
hbs
}}{{/
inline
}}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/form-detail/dropdownList.hbs
0 → 100644
浏览文件 @
bfc30869
<AppDropdownList
name=
"
{{
item
.
codeName
}}
"
{{!-- :value="data.{{item.psEditor.name}}" --}}
:data=
"data"
{{#if
item
.
psEditor
.
codeList
}}
codeListTag=
"
{{
item
.
psEditor
.
codeList
.
codeListTag
}}
"
codeListType=
"
{{
item
.
psEditor
.
codeList
.
codeListType
}}
"
valueSeparator=
"
{{
item
.
psEditor
.
codeList
.
valueSeparator
}}
"
{{/if}}
{{#if
item
.
psEditor
.
getPlaceHolder
}}
placeholder=
"
{{
item
.
psEditor
.
getPlaceHolder
}}
"
{{/if}}
{{#if
item
.
psEditor
.
disabled
}}
disabled=
"
{{
item
.
psEditor
.
disabled
}}
"
{{/if}}
{{#if
item
.
psEditor
.
getEditorParams
.
multiple
}}
:multiple=
"
{{
item
.
psEditor
.
getEditorParams
.
multiple
}}
"
{{/if}}
{{#if
item
.
psEditor
.
getPSNavigateContexts
}}
localContext=
"
{{
item
.
psEditor
.
getPSNavigateContexts
}}
"
{{/if}}
{{#if
item
.
psEditor
.
getPSNavigateParams
}}
localParam=
"
{{
item
.
psEditor
.
getPSNavigateParams
}}
"
{{/if}}
:contextProp=
"state.context"
:viewParamsProp=
"state.viewParams"
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/
components
/form-group.hbs
→
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/
form-detail
/form-group.hbs
浏览文件 @
bfc30869
文件已移动
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/
components
/form-item.hbs
→
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/
form-detail
/form-item.hbs
浏览文件 @
bfc30869
文件已移动
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/
components
/form-page.hbs
→
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/
form-detail
/form-page.hbs
浏览文件 @
bfc30869
文件已移动
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/form-detail/include-form.hbs
0 → 100644
浏览文件 @
bfc30869
{{#
*
inline
"FORMPAGE"
}}{{>
@macro
/
form-detail
/
form-page
.
hbs
}}{{/
inline
}}
{{#
*
inline
"GROUPPANEL"
}}{{>
@macro
/
form-detail
/
form-group
.
hbs
}}{{/
inline
}}
{{#
*
inline
"FORMITEM"
}}{{>
@macro
/
form-detail
/
form-item
.
hbs
}}{{/
inline
}}
{{#
*
inline
"TEXTBOX"
}}{{>
@macro
/
form-detail
/
input
.
hbs
}}{{/
inline
}}
{{#
*
inline
"NUMBER"
}}{{>
@macro
/
form-detail
/
input
.
hbs
}}{{/
inline
}}
{{#
*
inline
"PASSWORD"
}}{{>
@macro
/
form-detail
/
input
.
hbs
}}{{/
inline
}}
{{#
*
inline
"TEXTAREA"
}}{{>
@macro
/
form-detail
/
input
.
hbs
}}{{/
inline
}}
{{#
*
inline
"SPAN"
}}{{>
@macro
/
form-detail
/
span
.
hbs
}}{{/
inline
}}
{{#
*
inline
"DROPDOWNLIST"
}}{{>
@macro
/
form-detail
/
dropdownList
.
hbs
}}{{/
inline
}}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/form-detail/input.hbs
0 → 100644
浏览文件 @
bfc30869
<AppInput
{{#if
item
.
psEditor
.
getPlaceHolder
}}
placeholder=
"
{{
item
.
psEditor
.
getPlaceHolder
}}
"
{{/if}}
{{#if
item
.
psEditor
.
disabled
}}
disabled=
"
{{
item
.
psEditor
.
disabled
}}
"
{{/if}}
{{#if
item
.
psEditor
.
isReadOnly
}}
:readonly=
"
{{
item
.
psEditor
.
isReadOnly
}}
"
{{/if}}
{{#if
item
.
psEditor
.
getEditorParams
.
max
}}
:max=
"
{{
item
.
psEditor
.
getEditorParams
.
max
}}
"
{{/if}}
{{#if
item
.
psEditor
.
getEditorParams
.
min
}}
:max=
"
{{
item
.
psEditor
.
getEditorParams
.
min
}}
"
{{/if}}
{{#if
item
.
psEditor
.
getEditorParams
.
precision
}}
:precision=
"
{{
item
.
psEditor
.
getEditorParams
.
precision
}}
"
{{/if}}
{{#if
item
.
psEditor
.
getEditorParams
.
maxLength
}}
:maxLength=
"
{{
item
.
psEditor
.
maxLength
}}
"
{{/if}}
{{#
eq
item
.
psEditor
.
editorType
"TEXTBOX"
}}
type=
"text"
{{/
eq
}}
{{#
eq
item
.
psEditor
.
editorType
"NUMBER"
}}
type=
"number"
{{/
eq
}}
{{#
eq
item
.
psEditor
.
editorType
"PASSWORD"
}}
type=
"password"
{{/
eq
}}
{{#
eq
item
.
psEditor
.
editorType
"TEXTAREA"
}}
type=
"textarea"
{{/
eq
}}
{{!-- :value="data.{{item.psEditor.name}}" --}}
name=
"
{{
item
.
codeName
}}
"
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/form-detail/span.hbs
0 → 100644
浏览文件 @
bfc30869
<AppSpan
name=
"
{{
item
.
codeName
}}
"
{{!-- :value="data.{{item.psEditor.name}}" --}}
value=
"标签测试"
{{#if
item
.
psEditor
.
codeList
}}
codeListTag=
"
{{
item
.
psEditor
.
codeList
.
codeListTag
}}
"
codeListType=
"
{{
item
.
psEditor
.
codeList
.
codeListType
}}
"
{{/if}}
{{#if
item
.
getDataType
}}
dataType=
"
{{
item
.
getDataType
}}
"
{{/if}}
{{#if
item
.
psEditor
.
getEditorParams
.
unitName
}}
unitName=
"
{{
item
.
psEditor
.
getEditorParams
.
unitName
}}
"
{{/if}}
{{#if
item
.
psEditor
.
getEditorParams
.
valueFormat
}}
valueFormat=
"
{{
item
.
psEditor
.
getEditorParams
.
valueFormat
}}
"
{{/if}}
{{#if
item
.
psEditor
.
getPrecision
}}
:precision=
"
{{
item
.
psEditor
.
getPrecision
}}
"
{{/if}}
{{#if
item
.
psEditor
.
getPSNavigateContexts
}}
localContext=
"
{{
item
.
psEditor
.
getPSNavigateContexts
}}
"
{{/if}}
{{#if
item
.
psEditor
.
getPSNavigateParams
}}
localParam=
"
{{
item
.
psEditor
.
getPSNavigateParams
}}
"
{{/if}}
:contextProp=
"state.context"
:viewParamsProp=
"state.viewParams"
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/menu-detail/include-menu.hbs
0 → 100644
浏览文件 @
bfc30869
{{#
*
inline
"MENUITEM"
}}{{>
@macro
/
menu-detail
/
menu-item
.
hbs
}}{{/
inline
}}
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/menu-detail/menu-item.hbs
0 → 100644
浏览文件 @
bfc30869
{
name:
{{
item
.
name
}}
,
caption:
{{
item
.
caption
}}
,
itemType:
{{
item
.
itemType
}}
,
expanded:
{{
item
.
expanded
}}
,
tooltip:
{{
item
.
tooltip
}}
,
funcTag:
{{#if
item
.
pSAppFunc
}}{{
item
.
pSAppFunc
.
id
}}{{else}}
''
{{/if}}
,
hidden:
{{#if
item
.
hidden
}}
true
{{else}}
false
{{/if}}
,
disableClose:
{{#if
item
.
disableClose
}}
true
{{else}}
false
{{/if}}
,
{{#if
item
.
counterId
}}
counterId:
{{
item
.
counterId
}}
,
{{/if}}
{{#if
item
.
accessKey
}}
resourceTag:
{{
item
.
accessKey
}}
,
{{/if}}
{{#if
item
.
pSSysImage
}}
{{#if
item
.
pSSysImage
.
cssClass
}}
iconCls:
{{
item
.
pSSysImage
.
cssClass
}}
,
{{/if}}
{{#if
item
.
pSSysImage
.
imagePath
}}
icon:
{{
item
.
pSSysImage
.
imagePath
}}
,
{{/if}}
{{/if}}
{{#if
item
.
pSNavigateContexts
}}
navContext:
{{
item
.
pSNavigateContexts
}}
,
{{/if}}
{{#if
item
.
pSAppMenuItems
}}
items: [
{{#
each
item
.
pSAppMenuItems
as
|
item
|
}}
{{>
(
lookup
.
'MENUITEM'
)
item
=
item
}}
{{/
each
}}
],
{{/if}}
},
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/App.vue
浏览文件 @
bfc30869
<
script
setup
lang=
"ts"
>
// This starter template is using Vue 3
<
script
setup
>
SFCs
// Check out https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup
import
{
JobsInfoEditView
}
from
'@page/jobs-info/jobs-info-edit
-view'
;
import
{
PlatformIndexView
}
from
'@page/default/platform-index
-view'
;
</
script
>
<
template
>
<
JobsInfoEdit
View
:context=
"
{}"/>
<
PlatformIndex
View
:context=
"
{}"/>
</
template
>
<
style
>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/render/MenuItem/MenuItem.vue
浏览文件 @
bfc30869
...
...
@@ -10,21 +10,21 @@ const props = withDefaults(defineProps<MenuItemProps>(), {});
</
script
>
<
template
>
<template
v-for=
"item in items"
:key=
"item.
id
"
>
<template
v-for=
"item in items"
:key=
"item.
name
"
>
<template
v-if=
"!item.items"
>
<a-menu-item
v-if=
"!item.hidden"
:key=
"item.
id
"
>
<a-menu-item
v-if=
"!item.hidden"
:key=
"item.
name
"
>
<template
#
icon
>
<UserOutlined
/>
</
template
>
{{ item.
title
}}
{{ item.
caption
}}
</a-menu-item>
</template>
<
template
v-else
>
<a-sub-menu
v-if=
"!item.hidden"
:key=
"item.
id
"
>
<a-sub-menu
v-if=
"!item.hidden"
:key=
"item.
name
"
>
<template
#
icon
>
<UserOutlined
/>
</
template
>
<
template
#
title
>
{{
item
.
title
}}
</
template
>
<
template
#
title
>
{{
item
.
caption
}}
</
template
>
<app-menu-item
:items=
"item.items"
/>
</a-sub-menu>
</template>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/modules/views/index-view/index-view-prop.ts
0 → 100644
浏览文件 @
bfc30869
import
{
ViewPropsBase
}
from
"@ibiz-core"
;
/**
* @description 首页视图props
* @export
* @interface IndexViewProps
* @extends {ViewPropsBase}
*/
export
interface
IndexViewProps
extends
ViewPropsBase
{
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/modules/views/index-view/index-view-state.ts
0 → 100644
浏览文件 @
bfc30869
import
{
ViewStateBase
}
from
"@ibiz-core"
;
/**
* @description 首页视图state
* @export
* @interface IndexViewState
* @extends {ViewStateBase}
*/
export
interface
IndexViewState
extends
ViewStateBase
{
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/modules/views/index-view/index-view.ts
0 → 100644
浏览文件 @
bfc30869
import
{
IndexViewProps
,
IndexViewState
,
ViewBase
}
from
'@ibiz-core'
;
/**
* @description 首页视图
* @export
* @class IndexView
* @extends {ViewBase}
*/
export
class
IndexView
extends
ViewBase
{
/**
* 视图状态
*/
public
declare
viewState
:
IndexViewState
;
/**
* 使用加载功能模块
* @param props 传入的props
*/
public
useLoad
(
props
:
IndexViewProps
){
const
{
viewSubject
}
=
this
.
viewState
;
onMounted
(()
=>
{
viewSubject
.
next
({
tag
:
'menu'
,
action
:
"load"
,
data
:
{}})
})
}
/**
* 安装视图所有功能模块的方法
* @param props 传入的Props
* @param [emit] 事件
*/
public
moduleInstall
(
props
:
IndexViewProps
,
emit
?:
Function
)
{
const
superParams
=
super
.
moduleInstall
(
props
,
emit
);
this
.
useLoad
(
props
);
return
{
...
superParams
,
state
:
this
.
viewState
,
};
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/modules/views/index-view/index.ts
0 → 100644
浏览文件 @
bfc30869
export
*
from
'./index-view-prop'
export
*
from
'./index-view-state'
export
*
from
'./index-view'
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/modules/views/index.ts
浏览文件 @
bfc30869
export
*
from
'./view-base'
export
*
from
'./main-view'
export
*
from
'./edit-view'
\ No newline at end of file
export
*
from
'./edit-view'
export
*
from
'./index-view'
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/modules/widgets/index.ts
浏览文件 @
bfc30869
export
*
from
'./control-base'
export
*
from
'./main-control'
export
*
from
'./form-control'
\ No newline at end of file
export
*
from
'./form-control'
export
*
from
'./menu-control'
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/modules/widgets/menu-control/index.ts
0 → 100644
浏览文件 @
bfc30869
export
*
from
'./menu-control-prop'
export
*
from
'./menu-control-state'
export
*
from
'./menu-control'
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/modules/widgets/menu-control/menu-control-prop.ts
0 → 100644
浏览文件 @
bfc30869
import
{
ControlPropsBase
,
IParam
}
from
"@ibiz-core"
;
/**
* @description 菜单部件props
* @export
* @interface MenuControlProps
* @extends {ControlPropsBase}
*/
export
interface
MenuControlProps
extends
ControlPropsBase
{
/**
* @description 菜单方向
* @type {("LEFT" | "TOP" | "CENTER" | "TABEXP_LEFT" | "TABEXP_TOP" | "TABEXP_RIGHT" | "TABEXP_BOTTOM" | "NONE")}
* @memberof MenuControlProps
*/
menuAlign
:
"LEFT"
|
"TOP"
|
"CENTER"
|
"TABEXP_LEFT"
|
"TABEXP_TOP"
|
"TABEXP_RIGHT"
|
"TABEXP_BOTTOM"
|
"NONE"
;
/**
* @description 默认视图
* @type {string}
* @memberof MenuControlProps
*/
defaultView
:
string
;
/**
* @description 菜单收缩状态
* @type {boolean}
* @memberof MenuControlProps
*/
collapsed
:
boolean
;
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/modules/widgets/menu-control/menu-control-state.ts
0 → 100644
浏览文件 @
bfc30869
import
{
IParam
,
ControlStateBase
}
from
'@ibiz-core'
;
/**
* @description 菜单部件state
* @export
* @interface MenuControlState
* @extends {ControlStateBase}
*/
export
interface
MenuControlState
extends
ControlStateBase
{
/**
* @description 菜单集合
* @type {IParam[]}
* @memberof MenuControlState
*/
menus
:
IParam
[];
/**
* @description 应用功能集合
* @type {IParam[]}
* @memberof MenuControlState
*/
funcs
:
IParam
[];
/**
* @description 菜单默认展开集合
* @type {string[]}
* @memberof MenuControlState
*/
defaultOpens
:
string
[];
/**
* @description 菜单默认选中集合
* @type {string[]}
* @memberof MenuControlState
*/
defaultSelect
:
string
[];
/**
* @description 权限服务
* @type {IParam}
* @memberof MenuControlState
*/
authService
:
IParam
;
/**
* @description 默认打开视图
* @type {string}
* @memberof MenuControlState
*/
defaultView
:
string
;
/**
* @description 菜单方向
* @type {("LEFT" | "TOP" | "CENTER" | "TABEXP_LEFT" | "TABEXP_TOP" | "TABEXP_RIGHT" | "TABEXP_BOTTOM" | "NONE")}
* @memberof MenuControlState
*/
menuAlign
:
"LEFT"
|
"TOP"
|
"CENTER"
|
"TABEXP_LEFT"
|
"TABEXP_TOP"
|
"TABEXP_RIGHT"
|
"TABEXP_BOTTOM"
|
"NONE"
;
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/modules/widgets/menu-control/menu-control.ts
0 → 100644
浏览文件 @
bfc30869
import
{
MenuControlProps
,
MenuControlState
,
IActionParam
,
ControlBase
,
IParam
}
from
'@ibiz-core'
;
/**
* @description 菜单部件
* @export
* @class MenuControl
* @extends {ControlBase}
*/
export
class
MenuControl
extends
ControlBase
{
/**
* 部件状态
*/
public
declare
controlState
:
MenuControlState
;
/**
* @description 根据props调整设置部分部件基类
* @param {MenuControlProps} props
* @memberof MenuControl
*/
public
setState
(
props
:
MenuControlProps
)
{
super
.
setState
(
props
);
this
.
controlState
.
defaultView
=
toRef
(
props
,
'defaultView'
)
as
any
;
this
.
controlState
.
menuAlign
=
toRef
(
props
,
'menuAlign'
)
as
any
;
}
/**
* 修改表单的数据对象的某一属性的值。
* 可通过模块扩展增加一系列相关后续操作。
* @param name 属性名称
* @param value 属性值
*/
public
async
formDataChange
(
name
:
string
,
value
:
any
){
this
.
controlState
.
data
[
name
]
=
value
;
}
/**
* @description 计算有效菜单项
* @param {IParam[]} items 菜单项集合
* @memberof MenuControl
*/
public
computedEffectiveMenus
(
items
:
IParam
[])
{
items
.
forEach
((
item
:
IParam
)
=>
{
const
{
authService
}
=
this
.
controlState
;
if
(
!
authService
?.
getMenusPermission
?.(
item
))
{
item
.
hidden
=
true
;
}
if
(
item
.
items
?.
length
>
0
)
{
this
.
computedEffectiveMenus
(
item
.
items
);
}
})
}
/**
* @description 处理默认展开项
* @param {IParam[]} items
* @memberof MenuControl
*/
public
handleDefaultOpens
(
items
:
IParam
[],
defaultOpens
:
string
[])
{
items
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
expanded
)
{
defaultOpens
=
[...
defaultOpens
,
item
.
id
];
}
if
(
item
.
items
?.
length
>
0
)
{
this
.
handleDefaultOpens
(
item
.
items
,
defaultOpens
);
}
});
}
/**
* @description 处理菜单默认选中
* @memberof MenuControl
*/
public
handleDefaultSelect
()
{
const
{
route
,
funcs
,
defaultView
,
menuAlign
}
=
this
.
controlState
;
const
defaultSelectRef
=
toRef
(
this
.
controlState
,
'defaultSelect'
);
const
dataRef
=
toRef
(
this
.
controlState
,
'menus'
);
if
(
route
?.
matched
?.
length
==
2
)
{
const
[{
},
matched
]
=
route
.
matched
;
const
appFunc
:
any
=
funcs
.
find
((
func
:
any
)
=>
Object
.
is
(
func
.
routePath
,
matched
.
path
)
&&
Object
.
is
(
func
.
funcType
,
'APPVIEW'
));
if
(
appFunc
)
{
this
.
computeMenuSelect
(
dataRef
.
value
,
appFunc
.
funcTag
);
}
return
;
}
else
if
(
defaultView
)
{
const
appFunc
:
any
=
funcs
.
find
((
func
:
any
)
=>
Object
.
is
(
func
.
appView
,
defaultView
)
&&
Object
.
is
(
func
.
funcType
,
'APPVIEW'
));
if
(
appFunc
)
{
this
.
computeMenuSelect
(
dataRef
.
value
,
appFunc
.
funcTag
);
}
if
(
!
defaultSelectRef
.
value
[
0
]
&&
Object
.
is
(
menuAlign
,
"NONE"
))
{
// TODO
return
;
}
}
else
{
this
.
computeMenuSelect
(
dataRef
.
value
,
''
);
}
let
item
=
this
.
compute
(
dataRef
.
value
,
defaultSelectRef
.
value
[
0
]);
if
(
Object
.
keys
(
item
).
length
>
0
&&
!
item
.
hidden
)
{
this
.
menuClick
(
item
);
}
}
/**
* @description 计算菜单选中项
* @param {IParam[]} menus 菜单及he
* @param {string} funcTag 应用标识
* @return {*}
* @memberof MenuControl
*/
public
computeMenuSelect
(
menus
:
IParam
[],
funcTag
:
string
)
{
const
{
funcs
}
=
this
.
controlState
;
const
defaultSelectRef
=
toRef
(
this
.
controlState
,
'defaultSelect'
);
const
defaultOpensRef
=
toRef
(
this
.
controlState
,
'defaultOpens'
);
return
menus
.
some
((
item
:
any
)
=>
{
if
(
Object
.
is
(
funcTag
,
''
)
&&
item
.
funcTag
&&
item
.
openDefault
&&
!
item
.
hidden
)
{
const
appFunc
=
funcs
?.
find
((
func
:
any
)
=>
Object
.
is
(
func
.
funcTag
,
item
.
funcTag
));
if
(
appFunc
)
{
defaultSelectRef
.
value
=
[
item
.
id
];
return
true
;
}
}
if
(
item
.
funcTag
&&
Object
.
is
(
item
.
funcTag
,
funcTag
))
{
defaultSelectRef
.
value
=
[
item
.
id
];
return
true
;
}
if
(
item
.
items
?.
length
>
0
)
{
const
state
=
this
.
computeMenuSelect
(
item
.
items
,
funcTag
);
if
(
state
)
{
const
defaultOpen
=
defaultOpensRef
.
value
?.
find
((
open
:
string
)
=>
Object
.
is
(
item
.
id
,
open
));
if
(
!
defaultOpen
)
{
defaultOpensRef
.
value
=
[...
defaultOpensRef
.
value
,
item
.
id
];
}
return
true
;
}
}
return
false
;
});
}
/**
* @description 获取指定菜单项数据
* @param {IParam[]} menus 菜单集合
* @param {string} id 指定菜单标识
* @return {*}
* @memberof MenuControl
*/
public
compute
(
menus
:
IParam
[],
id
:
string
)
{
const
item
:
any
=
{};
menus
.
some
((
_item
:
any
)
=>
{
if
(
Object
.
is
(
_item
.
id
,
id
))
{
Object
.
assign
(
item
,
_item
);
return
true
;
}
if
(
_item
.
items
?.
length
>
0
)
{
const
subItem
=
this
.
compute
(
_item
.
items
,
id
);
if
(
Object
.
keys
(
subItem
).
length
>
0
)
{
Object
.
assign
(
item
,
subItem
);
return
true
;
}
}
return
false
;
});
return
item
;
}
/**
* @description 菜单项点击
* @param {IParam} item 菜单项数据
* @memberof MenuControl
*/
public
menuClick
(
item
:
IParam
)
{
console
.
log
(
item
);
}
/**
* 使用加载功能模块
* @param props 传入的props
*/
public
useLoad
(
props
:
MenuControlProps
){
const
{
viewSubject
,
controlName
}
=
this
.
controlState
;
/**
* 加载方法
* @param [opt={}]
*/
const
load
=
async
(
opt
:
any
=
{})
=>
{
const
dataRef
=
toRef
(
this
.
controlState
,
'menus'
);
const
defaultOpensRef
=
toRef
(
this
.
controlState
,
'defaultOpens'
);
this
.
computedEffectiveMenus
(
dataRef
.
value
);
this
.
handleDefaultOpens
(
dataRef
.
value
,
defaultOpensRef
.
value
);
this
.
handleDefaultSelect
();
}
// 订阅viewSubject,监听load行为
if
(
viewSubject
){
let
subscription
=
viewSubject
.
subscribe
(({
tag
,
action
,
data
}:
IActionParam
)
=>
{
if
(
Object
.
is
(
controlName
,
tag
)
&&
Object
.
is
(
"load"
,
action
)
){
load
(
data
);
}
})
// 部件卸载时退订viewSubject
onUnmounted
(()
=>
{
subscription
.
unsubscribe
();
})
}
return
{
load
:
load
}
}
public
menuSelect
(
$event
:
any
)
{
console
.
log
(
$event
);
const
dataRef
=
toRef
(
this
.
controlState
,
'menus'
);
let
item
=
this
.
compute
(
dataRef
.
value
,
''
);
if
(
Object
.
keys
(
item
).
length
>
0
)
{
this
.
menuClick
(
item
);
}
}
/**
* 安装部件所有功能模块的方法
* @param props 传入的Props
* @param [emit] 事件
*/
public
moduleInstall
(
props
:
MenuControlProps
,
emit
?:
Function
)
{
const
superParams
=
super
.
moduleInstall
(
props
,
emit
);
const
{
load
}
=
this
.
useLoad
(
props
)
const
menuSelect
=
this
.
menuSelect
.
bind
(
this
);
this
.
menuSelect
=
(
$event
:
any
)
=>
{
menuSelect
(
$event
)
}
return
{
...
superParams
,
state
:
this
.
controlState
,
load
,
menuSelect
:
this
.
menuSelect
,
};
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/page/{{appModules}}/{{pages}}/{{pages@APPINDEXVIEW}}.vue.hbs
浏览文件 @
bfc30869
<script
setup
lang=
"ts"
>
import
{
Subject
}
from
'rxjs'
import
{
EditView
,
IActionParam
,
IParam
}
from
'@ibiz-core'
import
{
ViewConfig
}
from
'./
{{
page
.
codeName
.
spinalCase
}}
-config'
import
{
Ref
}
from
'vue'
;
import
{
IndexView
,
IActionParam
,
IParam
}
from
'@ibiz-core'
;
import
{
ViewConfig
}
from
'./
{{
page
.
codeName
.
spinalCase
}}
-config'
;
import
{
IbizDefaultIndexViewLayout
}
from
'@components'
;
{{#
page
.
ctrls
}}
{{#
eq
controlType
"APPMENU"
}}
...
...
@@ -17,11 +18,9 @@ interface Props {
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
// 设定默认值,可选属性可以在这初始化
viewSubject
:
()
=>
new
Subject
<
IActionParam
>
()
})
// emit声明
interface
ViewEmit
{
(
name
:
"CLOSE"
,
value
:
IActionParam
):
void
;
(
name
:
"VIEWCHANGE"
,
value
:
IActionParam
):
void
;
...
...
@@ -30,15 +29,17 @@ interface ViewEmit {
const
emit
=
defineEmits
<
ViewEmit
>
();
// 安装功能模块,提供状态和能力方法
//const { state } = new EditView(ViewConfig).moduleInstall(props
);
const
{
state
}
=
new
IndexView
(
ViewConfig
).
moduleInstall
(
props
,
emit
);
const
collapsed
:
Ref
<
boolean
>
=
ref
(
false
);
</script>
<template>
<IbizDefaultIndexViewLayout
class=
"ibiz-index-view"
menuAlign=
"LEFT
"
:collapsed=
"collapsed"
>
<IbizDefaultIndexViewLayout
class=
"ibiz-index-view"
:menuAlign=
"state.menuAlign
"
:collapsed=
"collapsed"
>
<template
#
header
>
<div
class=
"index-view-header"
>
{{{
{
raw-loud
}}}
}
{{
state
.
viewCaption
}}
{{{
{
/
raw-loud
}}}
}
<MenuUnfoldOutlined
v-if=
"collapsed"
class=
"trigger"
...
...
@@ -52,13 +53,13 @@ const collapsed: Ref<boolean> = ref(false);
</template>
<template
#
menu
>
<
{{#
page
.
ctrls
}}{{#
eq
controlType
"APPMENU"
}}{{
codeName
}}
Menu
{{/
eq
}}{{/
page
.
ctrls
}}
ref=
"menu
"
name=
"menu
"
menuAlign=
"LEFT
"
:
viewState=
"viewState
"
:
contextProp=
"context
"
:view
ParamsProp=
"viewParams"
>
</
{{#
page
.
ctrls
}}{{#
eq
controlType
"APPMENU"
}}{{
codeName
}}
Menu
{{/
eq
}}{{/
page
.
ctrls
}}
>
:context=
"state.context
"
:collapsed=
"collapsed
"
:menuAlign=
"state.menuAlign
"
:
defaultView=
"state.defaultView
"
:
viewParams=
"state.viewParams
"
:view
Subject=
"state.viewSubject"
>
</
{{#
page
.
ctrls
}}{{#
eq
controlType
"APPMENU"
}}{{
codeName
}}
Menu
{{/
eq
}}{{/
page
.
ctrls
}}
>
</template>
<template
#
content
>
<router-view
/>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@APPMENU}}-menu/{{ctrls@APPMENU}}-menu-config.ts.hbs
浏览文件 @
bfc30869
{{>
@macro
/
menu-detail
/
include-menu
.
hbs
}}
export const CtrlConfig = {
ctrlCodeName: '
{{
ctrl
.
codeName
}}
',
ctrlName: '
{{
ctrl
.
name
}}
',
ctrlCaption: '
{{
ctrl
.
caption
}}
',
controlCodeName: '
{{
ctrl
.
codeName
}}
',
controlName: '
{{
ctrl
.
name
}}
',
menus: [
{{#
each
ctrl
.
pSAppMenuItems
as
|
item
|
}}
{{>
(
lookup
.
'MENUITEM'
)
item
=
item
}}
,
{{/
each
}}
],
funcs: [
],
};
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@APPMENU}}-menu/{{ctrls@APPMENU}}-menu.vue.hbs
浏览文件 @
bfc30869
<script
setup
lang=
"ts"
>
import
{
getCurrentInstance
,
onBeforeMount
,
onUnmounted
,
Ref
,
ref
}
from
"vue"
;
import
{
Subject
,
Subscription
}
from
"rxjs"
;
import
{
CtrlConfig
}
from
'./
{{
ctrl
.
codeName
.
spinalCase
}}
-menu-config'
;
import
{
useContextParams
,
handleMenusResource
,
menuSelect
}
from
"@core"
;
import
{
IParam
,
IActionParam
}
from
"@ibiz-core"
;
import
{
Subject
}
from
"rxjs"
;
import
{
CtrlConfig
}
from
"./
{{
ctrl
.
codeName
.
spinalCase
}}
-menu-config"
;
import
{
IParam
,
IActionParam
,
MenuControl
}
from
"@ibiz-core"
;
import
{
IbizMenuItem
}
from
"@components"
;
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
interface
MenuProps
{
/**
* @description 部件名称
*/
name
:
string
;
/**
* @description 传入上下文
*/
contextProp
:
IParam
;
/**
* @description 传入视图参数
*/
viewParamsProp
?:
IParam
;
/**
* @description 视图状态
*/
viewState
:
Subject
<
IActionParam
>
;
/**
* @description 菜单方向
*/
menuAlign
:
"LEFT"
|
"TOP"
|
"CENTER"
|
"TABEXP_LEFT"
|
"TABEXP_TOP"
|
"TABEXP_RIGHT"
|
"TABEXP_BOTTOM"
|
"NONE"
;
/**
* @description 默认视图
*/
interface
Props
{
context
:
IParam
;
defaultView
:
string
;
collapsed
:
boolean
;
menuAlign
:
"LEFT"
|
"TOP"
|
"CENTER"
|
"TABEXP_LEFT"
|
"TABEXP_TOP"
|
"TABEXP_RIGHT"
|
"TABEXP_BOTTOM"
|
"NONE"
;
viewParams
?:
IParam
;
viewSubject
:
Subject
<
IActionParam
>
;
}
const
props
=
withDefaults
(
defineProps
<
Menu
Props
>
(),
{
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
menuAlign
:
"LEFT"
,
collapsed
:
false
,
});
const
{
context
,
viewParams
}
=
useContextParams
(
props
);
let
viewStateEvent
:
Subscription
|
undefined
;
const
menu
=
getCurrentInstance
()?.
vnode
;
defineExpose
({
menu
})
/**
* @description 菜单项集合
*/
const
menus
:
Ref
<
IParam
[]
>
=
ref
([
{
id
:
"1"
,
title
:
"菜单项1"
,
expanded
:
true
,
items
:
[
{
id
:
"3"
,
title
:
"菜单项3"
,
},
{
id
:
"4"
,
title
:
"编辑视图"
,
openDefault
:
true
,
funcTag
:
"1"
,
},
]
},
{
id
:
"2"
,
title
:
"菜单项2"
,
}
]);
const
defaultOpens
:
Ref
<
string
[]
>
=
ref
([]);
const
defaultSelect
:
Ref
<
string
[]
>=
ref
([]);
const
router
=
useRouter
();
const
route
=
useRoute
();
/**
* @description 应用功能集合
*/
const
funcs
:
IParam
[]
=
[{
funcTag
:
"1"
,
}];
const
modelParam
=
{
funcs
:
funcs
,
interface
CtrlEmit
{
(
name
:
"Ctrl"
,
value
:
IActionParam
):
void
;
}
const
emit
=
defineEmits
<
CtrlEmit
>
();
const
runtimeParam
=
{
menus
:
menus
,
context
:
context
,
defaultView
:
props
.
defaultView
,
authService
:
{},
defaultOpens
:
defaultOpens
,
defaultSelect
:
defaultSelect
,
viewParams
:
viewParams
,
mode
:
props
.
menuAlign
,
router
:
router
,
route
:
route
,
}
const
onSelect
=
(
item
:
any
,
key
:
any
,
selectedKeys
:
any
)
=>
{
menuSelect
(
modelParam
,
runtimeParam
);
}
onBeforeMount
(()
=>
{
if
(
props
.
viewState
)
{
viewStateEvent
=
props
.
viewState
.
subscribe
(({
tag
,
action
,
data
}:
IActionParam
)
=>
{
if
(
Object
.
is
(
tag
,
props
.
name
))
{
switch
(
action
)
{
case
'load'
:
handleMenusResource
(
modelParam
,
runtimeParam
);
break
;
}
}
});
}
})
onUnmounted
(()
=>
{
if
(
viewStateEvent
)
{
viewStateEvent
.
unsubscribe
();
}
})
const
{
state
,
menuSelect
}
=
new
MenuControl
(
CtrlConfig
).
moduleInstall
(
props
,
emit
);
</script>
<template>
<a-menu
v-model:openKeys=
"defaultOpens"
v-model:selectedKeys=
"defaultSelect"
:mode=
"Object.is('LEFT', menuAlign) ? 'inline' : 'horizontal'"
@
select=
"
on
Select"
>
<IbizMenuItem
:items=
"menus"
/>
v-model:openKeys=
"
state.
defaultOpens"
v-model:selectedKeys=
"
state.
defaultSelect"
:mode=
"Object.is('LEFT',
state.
menuAlign) ? 'inline' : 'horizontal'"
@
select=
"
menu
Select"
>
<IbizMenuItem
:items=
"
state.
menus"
/>
</a-menu>
</template>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@FORM}}-form/{{ctrls@FORM}}-form-config.ts.hbs
浏览文件 @
bfc30869
export const CtrlConfig = {
ctrlCodeName: '
{{
ctrl
.
codeName
}}
',
ctrlName: '
{{
ctrl
.
name
}}
',
ctrlCaption: '
{{
ctrl
.
caption
}}
',
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@FORM}}-form/{{ctrls@FORM}}-form.vue.hbs
浏览文件 @
bfc30869
{{>
@macro
/
components
/
include-ctrls
.
hbs
}}
{{>
@macro
/
form-detail
/
include-form
.
hbs
}}
<script
setup
lang=
"ts"
>
import
{
Subject
}
from
'rxjs'
;
import
{
CtrlConfig
}
from
'./
{{
ctrl
.
codeName
.
spinalCase
}}
-form-config'
;
...
...
@@ -10,7 +10,7 @@ interface Props {
viewParams
?:
IParam
;
controlAction
:
ControlAction
;
showBusyIndicator
?:
boolean
;
viewSubject
?
:
Subject
<
IActionParam
>
;
viewSubject
:
Subject
<
IActionParam
>
;
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录