Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
abd39aac
提交
abd39aac
编写于
1月 10, 2022
作者:
Mosher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add:新增树导航视图、树导航栏、树部件支持
上级
1ac02701
变更
36
隐藏空白字符变更
内嵌
并排
正在显示
36 个修改的文件
包含
645 行增加
和
3 行删除
+645
-3
CtrlModel.java
...ore/src/main/java/cn/ibizlab/codegen/model/CtrlModel.java
+18
-0
PageModel.java
...ore/src/main/java/cn/ibizlab/codegen/model/PageModel.java
+19
-0
IbizTreeExpViewLayout.vue
..._{{apps}}/src/components/layout/IbizTreeExpViewLayout.vue
+30
-0
exp-view-prop.ts
...{{apps}}/src/core/modules/views/exp-view/exp-view-prop.ts
+9
-0
exp-view-state.ts
...{apps}}/src/core/modules/views/exp-view/exp-view-state.ts
+9
-0
exp-view.ts
.../app_{{apps}}/src/core/modules/views/exp-view/exp-view.ts
+44
-0
index.ts
.../r7/app_{{apps}}/src/core/modules/views/exp-view/index.ts
+3
-0
index.ts
...ces/templ/r7/app_{{apps}}/src/core/modules/views/index.ts
+3
-1
index.ts
...pp_{{apps}}/src/core/modules/views/tree-exp-view/index.ts
+3
-0
tree-exp-view-prop.ts
...rc/core/modules/views/tree-exp-view/tree-exp-view-prop.ts
+9
-0
tree-exp-view-state.ts
...c/core/modules/views/tree-exp-view/tree-exp-view-state.ts
+9
-0
tree-exp-view.ts
...s}}/src/core/modules/views/tree-exp-view/tree-exp-view.ts
+49
-0
exp-bar-control-prop.ts
...e/modules/widgets/exp-bar-control/exp-bar-control-prop.ts
+9
-0
exp-bar-control-state.ts
.../modules/widgets/exp-bar-control/exp-bar-control-state.ts
+9
-0
exp-bar-control.ts
...c/core/modules/widgets/exp-bar-control/exp-bar-control.ts
+41
-0
index.ts
...{apps}}/src/core/modules/widgets/exp-bar-control/index.ts
+3
-0
index.ts
...s/templ/r7/app_{{apps}}/src/core/modules/widgets/index.ts
+4
-1
index.ts
...p_{{apps}}/src/core/modules/widgets/tree-control/index.ts
+3
-0
tree-control-prop.ts
...rc/core/modules/widgets/tree-control/tree-control-prop.ts
+9
-0
tree-control-state.ts
...c/core/modules/widgets/tree-control/tree-control-state.ts
+11
-0
tree-control.ts
...s}}/src/core/modules/widgets/tree-control/tree-control.ts
+50
-0
index.ts
...}}/src/core/modules/widgets/tree-exp-bar-control/index.ts
+3
-0
tree-exp-bar-control-prop.ts
...widgets/tree-exp-bar-control/tree-exp-bar-control-prop.ts
+9
-0
tree-exp-bar-control-state.ts
...idgets/tree-exp-bar-control/tree-exp-bar-control-state.ts
+16
-0
tree-exp-bar-control.ts
...ules/widgets/tree-exp-bar-control/tree-exp-bar-control.ts
+83
-0
util.ts
...in/resources/templ/r7/app_{{apps}}/src/core/utils/util.ts
+17
-0
index.ts.hbs
.../page/{{appModules}}/{{pages@DETREEEXPVIEW}}/index.ts.hbs
+3
-0
{{pages@DETREEEXPVIEW}}-config.ts.hbs
...ges@DETREEEXPVIEW}}/{{pages@DETREEEXPVIEW}}-config.ts.hbs
+3
-0
{{pages@DETREEEXPVIEW}}.vue.hbs
...}/{{pages@DETREEEXPVIEW}}/{{pages@DETREEEXPVIEW}}.vue.hbs
+58
-0
index.ts.hbs
...n/resources/templ/r7/app_{{apps}}/src/router/index.ts.hbs
+1
-1
index.ts.hbs
...Entities}}/{{ctrls@TREEEXPBAR}}-tree-exp-bar/index.ts.hbs
+3
-0
{{ctrls@TREEEXPBAR}}-tree-exp-bar-config.ts.hbs
...e-exp-bar/{{ctrls@TREEEXPBAR}}-tree-exp-bar-config.ts.hbs
+4
-0
{{ctrls@TREEEXPBAR}}-tree-exp-bar.vue.hbs
...}}-tree-exp-bar/{{ctrls@TREEEXPBAR}}-tree-exp-bar.vue.hbs
+58
-0
index.ts.hbs
...gets/{{appEntities}}/{{ctrls@TREEVIEW}}-tree/index.ts.hbs
+3
-0
{{ctrls@TREEVIEW}}-tree-config.ts.hbs
...rls@TREEVIEW}}-tree/{{ctrls@TREEVIEW}}-tree-config.ts.hbs
+4
-0
{{ctrls@TREEVIEW}}-tree.vue.hbs
...}/{{ctrls@TREEVIEW}}-tree/{{ctrls@TREEVIEW}}-tree.vue.hbs
+36
-0
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/CtrlModel.java
浏览文件 @
abd39aac
...
...
@@ -8,6 +8,10 @@ import lombok.experimental.Accessors;
import
net.ibizsys.model.control.IPSControl
;
import
net.ibizsys.model.control.layout.IPSGridLayoutPos
;
import
java.util.Collection
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
@Getter
@Setter
@NoArgsConstructor
...
...
@@ -30,12 +34,26 @@ public class CtrlModel extends BaseModel{
}
public
Map
<
String
,
CtrlModel
>
ctrlsMap
=
new
LinkedHashMap
();
private
AppModel
app
;
private
AppEntityModel
appEntity
;
private
LabelExt
folder
;
public
CtrlModel
addCtrl
(
String
codeName
,
CtrlModel
ctrlModel
)
{
if
(!
ctrlsMap
.
containsKey
(
codeName
))
ctrlsMap
.
put
(
codeName
,
ctrlModel
);
return
this
;
}
public
Collection
<
CtrlModel
>
getCtrls
()
{
return
ctrlsMap
.
values
();
}
public
IPSControl
getControl
()
{
return
(
IPSControl
)
opt
;
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/PageModel.java
浏览文件 @
abd39aac
...
...
@@ -7,6 +7,8 @@ import lombok.NoArgsConstructor;
import
lombok.Setter
;
import
lombok.experimental.Accessors
;
import
net.ibizsys.model.app.view.IPSAppView
;
import
net.ibizsys.model.control.IPSControl
;
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
;
...
...
@@ -44,6 +46,23 @@ public class PageModel extends BaseModel{
this
.
app
.
getCtrlsMap
().
put
(
ctrl
.
getId
(),
ctrl
);
this
.
ctrlsMap
.
put
(
ctrl
.
getCodeName
().
toString
(),
ctrl
);
}
if
(
"TREEEXPBAR"
.
equals
(
ctrl
.
getControl
().
getControlType
()))
{
List
<
IPSControl
>
controls
=
((
IPSExpBar
)
item
).
getPSControls
();
if
(
controls
.
size
()
>
0
)
{
for
(
IPSControl
control
:
controls
)
{
CtrlModel
ctrlModel
=
new
CtrlModel
(
appModel
,
control
);
if
(
ctrlModel
.
getControl
().
getPSAppDataEntity
()!=
null
)
{
AppEntityModel
ctrlAppEntity
=
app
.
getAppEntity
(
ctrlModel
.
getControl
().
getPSAppDataEntity
().
getCodeName
());
ctrlModel
.
setAppEntity
(
ctrlAppEntity
);
ctrlAppEntity
.
addCtrl
(
ctrlModel
.
getCodeName
().
toString
(),
ctrlModel
);
}
ctrl
.
addCtrl
(
ctrlModel
.
getCodeName
().
toString
(),
ctrlModel
);
if
(!
this
.
app
.
getCtrlsMap
().
containsKey
(
ctrl
.
getId
()))
{
this
.
app
.
getCtrlsMap
().
put
(
ctrl
.
getId
(),
ctrl
);
}
}
}
}
});
}
// 初始化工具栏数据
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/layout/IbizTreeExpViewLayout.vue
0 → 100644
浏览文件 @
abd39aac
<
script
setup
lang=
"ts"
>
</
script
>
<
template
>
<IbizViewBaseLayout>
<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"
/>
<slot
name=
"searchForm"
/>
</
template
>
<
template
v-slot:body-top
>
<slot
name=
"bodyMessage"
/>
</
template
>
<slot
/>
<
template
v-slot:footer-content
>
<slot
name=
"bottomMessage"
/>
</
template
>
</IbizViewBaseLayout>
</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/exp-view/exp-view-prop.ts
0 → 100644
浏览文件 @
abd39aac
import
{
MainViewProps
}
from
"@core"
;
/**
* @description 导航视图props
* @export
* @interface ExpViewProps
* @extends {MainViewProps}
*/
export
interface
ExpViewProps
extends
MainViewProps
{
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/exp-view/exp-view-state.ts
0 → 100644
浏览文件 @
abd39aac
import
{
MainViewState
}
from
'@core'
;
/**
* @description 导航视图基类状态
* @export
* @interface ExpViewState
* @extends {MainViewState}
*/
export
interface
ExpViewState
extends
MainViewState
{
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/exp-view/exp-view.ts
0 → 100644
浏览文件 @
abd39aac
import
{
MainView
}
from
"@core"
;
import
{
ExpViewProps
}
from
"./exp-view-prop"
;
import
{
ExpViewState
}
from
"./exp-view-state"
;
/**
* @description 导航视图基类
* @export
* @class ExpView
* @extends {MainView}
*/
export
class
ExpView
extends
MainView
{
/**
* @description 视图状态
* @type {ExpViewState}
* @memberof ExpView
*/
public
declare
viewState
:
ExpViewState
;
/**
* @description 使用加载功能模块
* @param {ExpViewProps} props 传入的props
* @memberof ExpView
*/
public
useLoad
(
props
:
ExpViewProps
)
{
const
{
viewSubject
}
=
this
.
viewState
;
}
/**
* @description 安装视图所有功能模块的方法
* @param {ExpViewProps} props 传入的Props
* @param {Function} [emit] [emit] 事件
* @return {*}
* @memberof ExpView
*/
public
moduleInstall
(
props
:
ExpViewProps
,
emit
?:
Function
)
{
const
superParams
=
super
.
moduleInstall
(
props
,
emit
);
this
.
useLoad
(
props
);
return
{
...
superParams
,
state
:
this
.
viewState
};
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/exp-view/index.ts
0 → 100644
浏览文件 @
abd39aac
export
*
from
'./exp-view-prop'
;
export
*
from
'./exp-view-state'
;
export
{
ExpView
}
from
'./exp-view'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/index.ts
浏览文件 @
abd39aac
export
*
from
'./view-base'
export
*
from
'./main-view'
export
*
from
'./exp-view'
export
*
from
'./edit-view'
export
*
from
'./index-view'
export
*
from
'./grid-view'
export
*
from
'./pickup-view'
export
*
from
'./pickup-grid-view'
\ No newline at end of file
export
*
from
'./pickup-grid-view'
export
*
from
'./tree-exp-view'
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/tree-exp-view/index.ts
0 → 100644
浏览文件 @
abd39aac
export
*
from
'./tree-exp-view-prop'
;
export
*
from
'./tree-exp-view-state'
;
export
{
TreeExpView
}
from
'./tree-exp-view'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/tree-exp-view/tree-exp-view-prop.ts
0 → 100644
浏览文件 @
abd39aac
import
{
ExpViewProps
}
from
"@core"
;
/**
* @description 树导航视图props
* @export
* @interface TreeExpViewProps
* @extends {ExpViewProps}
*/
export
interface
TreeExpViewProps
extends
ExpViewProps
{}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/tree-exp-view/tree-exp-view-state.ts
0 → 100644
浏览文件 @
abd39aac
import
{
ExpViewState
}
from
"@core"
;
/**
* @description 树导航视图状态
* @export
* @interface TreeExpViewState
* @extends {ExpViewState}
*/
export
interface
TreeExpViewState
extends
ExpViewState
{}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/tree-exp-view/tree-exp-view.ts
0 → 100644
浏览文件 @
abd39aac
import
{
ExpView
}
from
"@core"
;
import
{
TreeExpViewProps
}
from
"./tree-exp-view-prop"
;
import
{
TreeExpViewState
}
from
"./tree-exp-view-state"
;
/**
* @description 树导航视图
* @export
* @class TreeExpView
* @extends {ExpView}
*/
export
class
TreeExpView
extends
ExpView
{
/**
* @description 视图状态
* @type {TreeExpViewState}
* @memberof TreeExpView
*/
public
declare
viewState
:
TreeExpViewState
;
/**
* @description 使用加载功能模块
* @param {TreeExpViewProps} props 传入的props
* @memberof TreeExpView
*/
public
useLoad
(
props
:
TreeExpViewProps
)
{
const
{
viewSubject
}
=
this
.
viewState
;
onMounted
(()
=>
{
viewSubject
.
next
({
tag
:
'grid'
,
action
:
"load"
,
data
:
{}
})
})
}
/**
* @description 安装视图所有功能模块的方法
* @param {TreeExpViewProps} props 传入的Props
* @param {Function} [emit] [emit] 事件
* @return {*}
* @memberof TreeExpView
*/
public
moduleInstall
(
props
:
TreeExpViewProps
,
emit
?:
Function
)
{
this
.
emit
=
emit
;
const
superParams
=
super
.
moduleInstall
(
props
,
emit
);
this
.
useLoad
(
props
);
return
{
...
superParams
,
handleCtrlEvent
:
this
.
handleCtrlEvent
.
bind
(
this
),
state
:
this
.
viewState
,
};
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/exp-bar-control/exp-bar-control-prop.ts
0 → 100644
浏览文件 @
abd39aac
import
{
MainControlProps
}
from
"@core"
;
/**
* @description 导航部件props
* @export
* @interface ExpBarControlProps
* @extends {MainControlProps}
*/
export
interface
ExpBarControlProps
extends
MainControlProps
{
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/exp-bar-control/exp-bar-control-state.ts
0 → 100644
浏览文件 @
abd39aac
import
{
MainControlState
}
from
"@core"
;
/**
* @description 导航栏部件通讯对象
* @export
* @interface ExpBarControlState
* @extends {MainControlState}
*/
export
interface
ExpBarControlState
extends
MainControlState
{
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/exp-bar-control/exp-bar-control.ts
0 → 100644
浏览文件 @
abd39aac
import
{
MainControl
}
from
"@core"
;
import
{
ExpBarControlProps
}
from
"./exp-bar-control-prop"
;
import
{
ExpBarControlState
}
from
"./exp-bar-control-state"
;
/**
* @description 导航栏部件
* @export
* @class ExpBarControl
* @extends {MainControl}
*/
export
class
ExpBarControl
extends
MainControl
{
/**
* @description 部件状态
* @type {ExpBarControlState}
* @memberof ExpBarControl
*/
public
declare
controlState
:
ExpBarControlState
;
/**
* @description 使用加载功能模块
* @param {ExpBarControlProps} props 传入的props
* @memberof ExpBarControl
*/
public
useLoad
(
props
:
ExpBarControlProps
)
{
}
/**
* @description 安装部件所有功能模块的方法
* @param {ExpBarControlProps} props 传入的Props
* @param {Function} [emit]
* @return {*}
* @memberof ExpBarControl [emit] 事件
*/
public
moduleInstall
(
props
:
ExpBarControlProps
,
emit
?:
Function
)
{
const
superParams
=
super
.
moduleInstall
(
props
,
emit
);
return
{
...
superParams
,
state
:
this
.
controlState
,
};
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/exp-bar-control/index.ts
0 → 100644
浏览文件 @
abd39aac
export
*
from
'./exp-bar-control-prop'
;
export
*
from
'./exp-bar-control-state'
;
export
{
ExpBarControl
}
from
'./exp-bar-control'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/index.ts
浏览文件 @
abd39aac
export
*
from
'./control-base'
export
*
from
'./main-control'
export
*
from
'./exp-bar-control'
export
*
from
'./form-control'
export
*
from
'./menu-control'
export
*
from
'./grid-control'
export
*
from
'./pickupviewpanel-control'
\ No newline at end of file
export
*
from
'./pickupviewpanel-control'
export
*
from
'./tree-exp-bar-control'
export
*
from
'./tree-control'
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/tree-control/index.ts
0 → 100644
浏览文件 @
abd39aac
export
*
from
'./tree-control-prop'
;
export
*
from
'./tree-control-state'
;
export
{
TreeControl
}
from
'./tree-control'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/tree-control/tree-control-prop.ts
0 → 100644
浏览文件 @
abd39aac
import
{
MainControlProps
}
from
"@core"
;
/**
* @description 树部件props
* @export
* @interface TreeControlProps
* @extends {MainControlProps}
*/
export
interface
TreeControlProps
extends
MainControlProps
{}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/tree-control/tree-control-state.ts
0 → 100644
浏览文件 @
abd39aac
import
{
MainControlState
}
from
"@core"
;
/**
* @description 树部件通讯对象
* @export
* @interface TreeControlState
* @extends {MainControlState}
*/
export
interface
TreeControlState
extends
MainControlState
{
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/tree-control/tree-control.ts
0 → 100644
浏览文件 @
abd39aac
import
{
MainControl
}
from
"@core"
;
import
{
TreeControlProps
}
from
"./tree-control-prop"
;
import
{
TreeControlState
}
from
"./tree-control-state"
;
/**
* @description 树部件
* @export
* @class TreeControl
* @extends {MainControl}
*/
export
class
TreeControl
extends
MainControl
{
/**
* @description 部件状态
* @type {TreeControlState}
* @memberof TreeControl
*/
public
declare
controlState
:
TreeControlState
;
/**
* @description 使用加载功能模块
* @param {TreeControlProps} props 传入的props
* @return {*}
* @memberof TreeControl
*/
public
useLoad
(
props
:
TreeControlProps
)
{
const
{
viewSubject
,
controlName
}
=
this
.
controlState
;
const
load
=
async
(
opt
:
any
=
{})
=>
{
}
return
{
load
};
}
/**
* @description 安装部件所有功能模块的方法
* @param {TreeControlProps} props 传入的Props
* @param {Function} [emit]
* @return {*}
* @memberof TreeControl [emit] 事件
*/
public
moduleInstall
(
props
:
TreeControlProps
,
emit
?:
Function
)
{
const
superParams
=
super
.
moduleInstall
(
props
,
emit
);
const
{
load
}
=
this
.
useLoad
(
props
);
return
{
...
superParams
,
state
:
this
.
controlState
,
load
};
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/tree-exp-bar-control/index.ts
0 → 100644
浏览文件 @
abd39aac
export
*
from
'./tree-exp-bar-control-prop'
;
export
*
from
'./tree-exp-bar-control-state'
;
export
{
TreeExpBarControl
}
from
'./tree-exp-bar-control'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/tree-exp-bar-control/tree-exp-bar-control-prop.ts
0 → 100644
浏览文件 @
abd39aac
import
{
ExpBarControlProps
}
from
"@core"
;
/**
* @description 树导航栏部件props
* @export
* @interface TreeExpBarControlProps
* @extends {ExpBarControlProps}
*/
export
interface
TreeExpBarControlProps
extends
ExpBarControlProps
{
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/tree-exp-bar-control/tree-exp-bar-control-state.ts
0 → 100644
浏览文件 @
abd39aac
import
{
ExpBarControlState
}
from
"@core"
;
/**
* @description 树导航栏部件通讯对象
* @export
* @interface TreeExpBarControlState
* @extends {ExpBarControlState}
*/
export
interface
TreeExpBarControlState
extends
ExpBarControlState
{
/**
* @description 过滤属性
* @type {string}
* @memberof TreeExpBarControlState
*/
srfnodefilter
:
string
;
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/tree-exp-bar-control/tree-exp-bar-control.ts
0 → 100644
浏览文件 @
abd39aac
import
{
deepCopy
,
deepObjectMerge
,
ExpBarControl
,
IParam
}
from
"@core"
;
import
{
TreeExpBarControlProps
}
from
"./tree-exp-bar-control-prop"
;
import
{
TreeExpBarControlState
}
from
"./tree-exp-bar-control-state"
;
/**
* @description 导航栏部件
* @export
* @class TreeExpBarControl
* @extends {ExpBarControl}
*/
export
class
TreeExpBarControl
extends
ExpBarControl
{
/**
* @description 部件状态
* @type {ExpBarControlState}
* @memberof TreeExpBarControl
*/
public
declare
controlState
:
TreeExpBarControlState
;
/**
* @description 选中数据
* @private
* @type {IParam}
* @memberof TreeExpBarControl
*/
private
selection
:
IParam
=
{};
private
computecurNodeContext
(
curNode
:
any
)
{
const
{
context
}
=
this
.
controlState
;
let
tempContext
:
any
=
{};
if
(
curNode
&&
curNode
.
data
&&
curNode
.
data
.
srfappctx
)
{
tempContext
=
deepCopy
(
curNode
.
data
.
srfappctx
);
}
else
{
tempContext
=
deepCopy
(
context
);
}
return
tempContext
;
}
/**
* @description 使用加载功能模块
* @param {TreeExpBarControlProps} props 传入的props
* @memberof TreeExpBarControl
*/
public
useLoad
(
props
:
TreeExpBarControlProps
)
{
const
load
=
async
(
node
:
IParam
)
=>
{
console
.
log
(
1111
,
node
);
if
(
node
.
dataRef
.
children
)
{
return
null
;
}
const
{
controlService
,
context
,
viewParams
,
srfnodefilter
}
=
this
.
controlState
;
let
tempViewParams
:
any
=
deepCopy
(
viewParams
);
let
curNode
:
any
=
{};
curNode
=
deepObjectMerge
(
curNode
,
node
);
const
params
:
any
=
{
srfnodeid
:
node
.
data
&&
node
.
data
.
id
?
node
.
data
.
id
:
'#'
,
srfnodefilter
:
srfnodefilter
,
parentData
:
curNode
.
data
?.
curData
}
let
tempContext
:
any
=
this
.
computecurNodeContext
(
curNode
);
}
return
{
load
}
}
/**
* @description 安装部件所有功能模块的方法
* @param {TreeExpBarControlProps} props 传入的Props
* @param {Function} [emit]
* @return {*}
* @memberof TreeExpBarControl [emit] 事件
*/
public
moduleInstall
(
props
:
TreeExpBarControlProps
,
emit
?:
Function
)
{
const
superParams
=
super
.
moduleInstall
(
props
,
emit
);
const
{
load
}
=
this
.
useLoad
(
props
);
return
{
...
superParams
,
selection
:
this
.
selection
,
load
};
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/utils/util.ts
浏览文件 @
abd39aac
...
...
@@ -10,6 +10,23 @@ export function deepCopy(data: Record<any, any>): Record<any, any>{
return
clone
(
data
)
}
/**
* @description 深度合并对象
* @export
* @param {*} FirstOBJ 目标对象
* @param {*} SecondOBJ 源对象
* @return {*}
*/
export
function
deepObjectMerge
(
FirstOBJ
:
any
,
SecondOBJ
:
any
)
{
for
(
var
key
in
SecondOBJ
)
{
FirstOBJ
[
key
]
=
FirstOBJ
[
key
]
&&
FirstOBJ
[
key
].
toString
()
===
'[object Object]'
?
deepObjectMerge
(
FirstOBJ
[
key
],
SecondOBJ
[
key
])
:
(
FirstOBJ
[
key
]
=
SecondOBJ
[
key
]);
}
return
FirstOBJ
;
}
/**
* @description 日期格式化
* @export
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/page/{{appModules}}/{{pages@DETREEEXPVIEW}}/index.ts.hbs
0 → 100644
浏览文件 @
abd39aac
import
{{
page
.
codeName
}}
from "./
{{
spinalCase
page
.
codeName
}}
.vue";
export default
{{
page
.
codeName
}}
;
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/page/{{appModules}}/{{pages@DETREEEXPVIEW}}/{{pages@DETREEEXPVIEW}}-config.ts.hbs
0 → 100644
浏览文件 @
abd39aac
export const ViewConfig = {
{{>
@macro
/
front-end
/
view
/
common
/
viewBaseConfig
.
hbs
}}
};
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/page/{{appModules}}/{{pages@DETREEEXPVIEW}}/{{pages@DETREEEXPVIEW}}.vue.hbs
0 → 100644
浏览文件 @
abd39aac
<script
setup
lang=
"ts"
>
import
{
Subject
}
from
'rxjs'
;
import
{
TreeExpView
,
IActionParam
,
IParam
,
IContext
}
from
'@core'
;
import
{
ViewConfig
}
from
'./
{{
spinalCase
page
.
codeName
}}
-config'
;
{{#
page
.
ctrls
}}
{{#
eq
controlType
"TREEEXPBAR"
}}
import
{
{{
codeName
}}
TreeExpBar
}
from
'@widgets/
{{
spinalCase
appEntity
.
codeName
}}
/
{{
spinalCase
codeName
}}
-tree-exp-bar'
;
{{/
eq
}}
{{/
page
.
ctrls
}}
interface
Props
{
context
:
IContext
;
viewParams
?:
IParam
;
openType
?:
"ROUTE"
|
"MODAL"
|
"EMBED"
;
viewSubject
?:
Subject
<
IActionParam
>
;
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
openType
:
'ROUTE'
,
viewSubject
:
()
=>
new
Subject
<
IActionParam
>
()
})
interface
ViewEmit
{
(
name
:
"viewEvent"
,
value
:
IActionParam
):
void
;
}
const
emit
=
defineEmits
<
ViewEmit
>
();
// 安装功能模块
const
{
state
}
=
new
TreeExpView
(
ViewConfig
).
moduleInstall
(
props
,
emit
);
</script>
<template>
<IbizTreeExpViewLayout
class=
"ibiz-tree-exp-view"
>
<template
v-slot:caption
>
<IbizIconText
class=
"ibiz-view__caption"
size=
"large"
:text=
"state.viewCaption"
/>
</template>
{{#
page
.
ctrls
}}
{{#
eq
controlType
"TOOLBAR"
}}
<template
v-slot:toolbar
>
<IbizToolbar
mode=
"button"
name=
"
{{
lowerCase
codeName
}}
"
:actionModel=
"state.toolbar"
@
toolbarEvent=
"handleToolbarEvent"
/>
</template>
{{/
eq
}}
{{#
eq
controlType
"TREEEXPBAR"
}}
<
{{
codeName
}}
TreeExpBar
:context=
"state.context"
:showBusyIndicator=
"true"
:viewParams=
"state.viewParams"
:controlAction=
"state.controlsAction.
{{
name
}}
"
:viewSubject=
"state.viewSubject"
@
ctrlEvent=
"handleCtrlEvent"
></
{{
codeName
}}
TreeExpBar>
{{/
eq
}}
{{/
page
.
ctrls
}}
</IbizTreeExpViewLayout>
</template>
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/router/index.ts.hbs
浏览文件 @
abd39aac
...
...
@@ -17,7 +17,7 @@ const routes = [
{{#
each
app
.
appEntityResources
as
|
appEntityResource
|
}}
{{#if
appEntityResource
.
appDataEntity
.
allPSAppViews
}}
{{#
each
appEntityResource
.
appDataEntity
.
allPSAppViews
as
|
appView
|
}}
{{#if
(
or
(
eq
appView
.
viewType
'DEEDITVIEW'
)
(
eq
appView
.
viewType
'DEGRIDVIEW'
))
}}
{{#if
(
or
(
eq
appView
.
viewType
'DEEDITVIEW'
)
(
eq
appView
.
viewType
'DEGRIDVIEW'
)
(
eq
appView
.
viewType
'DETREEEXPVIEW'
)
)
}}
{
path: "
{{
appEntityResource
.
path
}}
/views/
{{
lowerCase
appView
.
codeName
}}
",
meta: {
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@TREEEXPBAR}}-tree-exp-bar/index.ts.hbs
0 → 100644
浏览文件 @
abd39aac
import
{{
ctrl
.
codeName
}}
TreeExpBar from "./
{{
spinalCase
ctrl
.
codeName
}}
-tree-exp-bar.vue";
export {
{{
ctrl
.
codeName
}}
TreeExpBar };
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@TREEEXPBAR}}-tree-exp-bar/{{ctrls@TREEEXPBAR}}-tree-exp-bar-config.ts.hbs
0 → 100644
浏览文件 @
abd39aac
export const CtrlConfig = {
controlCodeName: '
{{
ctrl
.
codeName
}}
',
controlName: '
{{
ctrl
.
name
}}
',
};
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@TREEEXPBAR}}-tree-exp-bar/{{ctrls@TREEEXPBAR}}-tree-exp-bar.vue.hbs
0 → 100644
浏览文件 @
abd39aac
<script
setup
lang=
"ts"
>
import
{
Subject
}
from
'rxjs'
;
import
{
IActionParam
,
IParam
,
ControlAction
,
TreeExpBarControl
,
IContext
}
from
'@core'
;
import
{
CtrlConfig
}
from
'./
{{
spinalCase
ctrl
.
codeName
}}
-tree-exp-bar-config'
;
{{#
ctrl
.
ctrls
}}
{{#
eq
controlType
"TREEVIEW"
}}
import
{
{{
codeName
}}
Tree
}
from
'@widgets/
{{
spinalCase
appEntity
.
codeName
}}
/
{{
spinalCase
codeName
}}
-tree'
;
{{/
eq
}}
{{/
ctrl
.
ctrls
}}
interface
Props
{
context
:
IContext
;
viewParams
?:
IParam
;
controlAction
:
ControlAction
;
showBusyIndicator
?:
boolean
;
viewMode
?:
number
;
viewSubject
:
Subject
<
IActionParam
>
;
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
viewSubject
:
()
=>
new
Subject
<
IActionParam
>
(),
viewMode
:
0
,
showBusyIndicator
:
true
,
});
interface
CtrlEmit
{
(
name
:
"ctrlEvent"
,
value
:
IActionParam
):
void
;
}
const
emit
=
defineEmits
<
CtrlEmit
>
();
// 安装功能模块,提供状态和能力方法
const
{
state
,
selection
}
=
new
TreeExpBarControl
(
CtrlConfig
).
moduleInstall
(
props
,
emit
);
</script>
<template>
<a-layout
class=
"ibiz-tree-exp-bar
{{#if
ctrl
.
psSysCss
}}
{{
ctrl
.
psSysCss
.
cssName
}}{{/if}}
"
>
<a-layout-sider>
{{#
ctrl
.
ctrls
}}
{{#
eq
controlType
"TREEVIEW"
}}
<
{{
codeName
}}
Tree>
</
{{
codeName
}}
Tree>
{{/
eq
}}
{{/
ctrl
.
ctrls
}}
</a-layout-sider>
<a-layout>
<component
v-if=
"selection.view && !Object.is(this.selection.view.viewname, '')"
:is=
"selection.view.viewname"
:viewDefaultUsage=
"false"
:viewdata=
"JSON.stringify(selection.context)"
:viewParam=
"JSON.stringify(selection.viewParam)"
>
</component>
</a-layout>
</a-layout>
</template>
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@TREEVIEW}}-tree/index.ts.hbs
0 → 100644
浏览文件 @
abd39aac
import
{{
ctrl
.
codeName
}}
Tree from "./
{{
spinalCase
ctrl
.
codeName
}}
-tree.vue";
export {
{{
ctrl
.
codeName
}}
Tree };
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@TREEVIEW}}-tree/{{ctrls@TREEVIEW}}-tree-config.ts.hbs
0 → 100644
浏览文件 @
abd39aac
export const CtrlConfig = {
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@TREEVIEW}}-tree/{{ctrls@TREEVIEW}}-tree.vue.hbs
0 → 100644
浏览文件 @
abd39aac
<script
setup
lang=
"ts"
>
import
{
Subject
}
from
'rxjs'
;
import
{
IActionParam
,
IParam
,
ControlAction
,
TreeControl
,
IContext
}
from
'@core'
;
import
{
CtrlConfig
}
from
'./
{{
spinalCase
ctrl
.
codeName
}}
-tree-config'
;
interface
Props
{
context
:
IContext
;
multiple
:
boolean
;
selectedData
:
IParam
[];
selectFirstDefault
:
boolean
;
viewParams
?:
IParam
;
controlAction
:
ControlAction
;
showBusyIndicator
?:
boolean
;
viewSubject
:
Subject
<
IActionParam
>
;
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
viewSubject
:
()
=>
new
Subject
<
IActionParam
>
(),
showBusyIndicator
:
true
,
selectFirstDefault
:
false
,
})
// emit声明
interface
CtrlEmit
{
(
name
:
"ctrlEvent"
,
value
:
IActionParam
):
void
;
}
const
emit
=
defineEmits
<
CtrlEmit
>
();
// 安装功能模块,提供状态和能力方法
const
{
state
,
load
}
=
new
TreeControl
(
CtrlConfig
).
moduleInstall
(
props
,
emit
);
</script>
<template>
<a-tree
class=
"ibiz-tree
{{#if
ctrl
.
psSysCss
}}
{{
ctrl
.
psSysCss
.
cssName
}}{{/if}}
"
:tree-data=
"state.data"
>
</a-tree>
</template>
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录