Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
e580fbb4
提交
e580fbb4
编写于
1月 13, 2022
作者:
RedPig97
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:树导航树部件
上级
226f2d45
变更
3
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
244 行增加
和
0 行删除
+244
-0
index.ts.hbs
...es}}/{{ctrls@TREEVIEW-TREEEXPBAR_TREE}}-tree/index.ts.hbs
+3
-0
{{ctrls@TREEVIEW-TREEEXPBAR_TREE}}-tree-state.ts.hbs
...tree/{{ctrls@TREEVIEW-TREEEXPBAR_TREE}}-tree-state.ts.hbs
+189
-0
{{ctrls@TREEVIEW-TREEEXPBAR_TREE}}-tree.vue.hbs
...EE}}-tree/{{ctrls@TREEVIEW-TREEEXPBAR_TREE}}-tree.vue.hbs
+52
-0
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@TREEVIEW-TREEEXPBAR_TREE}}-tree/index.ts.hbs
0 → 100644
浏览文件 @
e580fbb4
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-TREEEXPBAR_TREE}}-tree/{{ctrls@TREEVIEW-TREEEXPBAR_TREE}}-tree-state.ts.hbs
0 → 100644
浏览文件 @
e580fbb4
import { ControlVOBase, TreeControlVO, TreeNodeVO, TreeNodeRSVO, TreeService } from "@core";
import {
{{
pascalCase
ctrl
.
psAppDataEntity
.
codeName
}}
Service } from '@api/
{{
spinalCase
ctrl
.
psAppDataEntity
.
codeName
}}
/
{{
spinalCase
ctrl
.
psAppDataEntity
.
codeName
}}
-service';
export class ControlVO extends ControlVOBase implements TreeControlVO {
get rootVisible(): boolean {
return
{{
ctrl
.
rootVisible
}}
;
}
get treeNodes(): TreeNodeVO[] {
return [
{{#
each
ctrl
.
psDETreeNodes
as
|
treeNode
|
}}
{
allowDrag:
{{
treeNode
.
allowDrag
}}
,
allowDrop:
{{
treeNode
.
allowDrop
}}
,
allowEditText:
{{
treeNode
.
allowEditText
}}
,
allowOrder:
{{
treeNode
.
allowOrder
}}
,
{{#if
treeNode
.
psAppDataEntity
}}
appDataEntity: {
codeName: '
{{
treeNode
.
psAppDataEntity
.
codeName
}}
',
{{#
each
treeNode
.
psAppDataEntity
.
allPSAppDEFields
as
|
field
|
}}
{{#if
field
.
keyField
}}
keyField: '
{{
field
.
codeName
}}
',
{{/if}}
{{#if
field
.
majorField
}}
majorField: '
{{
field
.
majorField
}}
',
{{/if}}
{{/
each
}}
},
{{/if}}
{{#if
treeNode
.
psAppDEDataSet
}}
appDeDataSet: { codeName: '
{{
treeNode
.
psAppDEDataSet
.
codeName
}}
' },
{{/if}}
appendPNodeId:
{{
treeNode
.
appendPNodeId
}}
,
{{#if
treeNode
.
psCodeList
}}
codeList: {
codeName: '
{{
treeNode
.
psCodeList
.
codeName
}}
',
type: '
{{
treeNode
.
psCodeList
.
codeListType
}}
'
},
{{/if}}
counterId: '
{{
treeNode
.
counterId
}}
',
counterMode:
{{
treeNode
.
counterMode
}}
,
{{#if
treeNode
.
psSysCss
}}
cssName: '
{{
treeNode
.
psSysCss
.
cssName
}}
'
{{/if}}
{{#if
treeNode
.
psDETreeNodeDataItems
}}
deTreeNodeDataItems: [
customCode:
{{
dataItem
.
customCode
}}
,
{{#
each
treeNode
.
psDETreeNodeDataItems
as
|
dataItem
|
}}
{{#if
dataItem
.
psAppDEField
}}
fieldCodeName: '
{{
dataItem
.
psAppDEField
.
codeName
}}
',
{{/if}}
name: '
{{
dataItem
.
name
}}
',
scriptCode: `
{{
dataItem
.
scriptCode
}}
`
{{/
each
}}
],
{{/if}}
disableSelect:
{{
treeNode
.
disableSelect
}}
,
enableCheck:
{{
treeNode
.
enableCheck
}}
,
enableQuickSearch:
{{
treeNode
.
enableQuickSearch
}}
,
expandFirstOnly:
{{
treeNode
.
expandFirstOnly
}}
,
expanded:
{{
treeNode
.
expanded
}}
,
hasPSDETreeNodeRSs:
{{
treeNode
.
hasPSDETreeNodeRSs
}}
,
{{#if
treeNode
.
leafFlagPSAppDEField
}}
leafFlagPSAppDEField: { codeName: '
{{
treeNode
.
leafFlagPSAppDEField
.
codeName
}}
' },
{{/if}}
{{#if
treeNode
.
idPSAppDEField
}}
idPSAppDEField: { codeName: '
{{
treeNode
.
idPSAppDEField
.
codeName
}}
' },
{{/if}}
{{#if
treeNode
.
iconPSAppDEField
}}
iconPSAppDEField: { codeName: '
{{
treeNode
.
iconPSAppDEField
.
codeName
}}
' },
{{/if}}
{{#if
treeNode
.
psSysImage
}}
{{#if
treeNode
.
psSysImage
.
cssClass
}}
iconcls: '
{{
treeNode
.
psSysImage
.
cssClass
}}
',
{{else
if
(
treeNode
.
psSysImage
.
imagePath
)
}}
icon: '
{{
treeNode
.
psSysImage
.
imagePath
}}
',
{{/if}}
{{/if}}
id: '
{{
treeNode
.
id
}}
',
navFilter: '
{{
treeNode
.
navFilter
}}
',
{{#if
treeNode
.
psNavigateContexts
}}
navigateContext: {
{{#
each
treeNode
.
psNavigateContexts
as
|
navContext
|
}}
{{
navContext
.
key
}}
: '
{{#if
navContext
.
rawValue
}}{{
navContext
.
value
}}{{else}}
%
{{
navContext
.
value
}}
%
{{/if}}
',
{{/
each
}}
},
{{/if}}
{{#if
treeNode
.
psNavigateParams
}}
navigateParams: {
{{#
each
treeNode
.
psNavigateParams
as
|
navParam
|
}}
{{
navParam
.
key
}}
: '
{{#if
navParam
.
rawValue
}}{{
navParam
.
value
}}{{else}}
%
{{
navParam
.
value
}}
%
{{/if}}
',
{{/
each
}}
},
{{/if}}
{{#if
treeNode
.
navPSAppView
}}
navView: {
viewName: '
{{
treeNode
.
navPSAppView
.
codeName
}}
'
},
{{/if}}
{{#if
treeNode
.
nodeValue
}}
nodeValue: '
{{
treeNode
.
nodeValue
}}
',
{{/if}}
nodeType: '
{{
treeNode
.
nodeType
}}
',
rootNode:
{{
treeNode
.
rootNode
}}
,
selectFirstOnly:
{{
treeNode
.
selectFirstOnly
}}
,
selected:
{{
treeNode
.
selected
}}
,
{{#if
treeNode
.
sortDir
}}
sortDir: '
{{
treeNode
.
sortDir
}}
',
{{/if}}
{{#if
treeNode
.
sortPSAppDEField
}}
sortPSAppDEField: { codeName: '
{{
treeNode
.
sortPSAppDEField
.
codeName
}}
' },
{{/if}}
{{#if
treeNode
.
textFormat
}}
textFormat: '
{{
treeNode
.
textFormat
}}
',
{{/if}}
{{#if
treeNode
.
textPSAppDEField
}}
textPSAppDEField: { codeName: '
{{
treeNode
.
textPSAppDEField
.
codeName
}}
' },
{{/if}}
{{#if
treeNode
.
text
}}
text: '
{{
treeNode
.
text
}}
',
{{/if}}
{{#if
treeNode
.
tooltip
}}
tooltip: '
{{
treeNode
.
tooltip
}}
',
{{/if}}
treeNodeType: '
{{
treeNode
.
treeNodeType
}}
',
},
{{/
each
}}
];
}
get treeNodeRSs(): TreeNodeRSVO[] {
return [
{{#
each
ctrl
.
psDETreeNodeRSs
as
|
treeNodeRS
|
}}
{
{{#if
treeNodeRS
.
childPSDETreeNode
}}
childDeTreeNode: {
id: '
{{
treeNodeRS
.
childPSDETreeNode
.
id
}}
'
},
{{/if}}
{{#if
treeNodeRS
.
psNavigateContexts
}}
navigateContext: {
{{#
each
treeNodeRS
.
psNavigateContexts
as
|
navContext
|
}}
{{
navContext
.
key
}}
: '
{{#if
navContext
.
rawValue
}}{{
navContext
.
value
}}{{else}}
%
{{
navContext
.
value
}}
%
{{/if}}
',
{{/
each
}}
},
{{/if}}
{{#if
treeNodeRS
.
psNavigateParams
}}
navigateParams: {
{{#
each
treeNodeRS
.
psNavigateParams
as
|
navParam
|
}}
{{
navParam
.
key
}}
: '
{{#if
navParam
.
rawValue
}}{{
navParam
.
value
}}{{else}}
%
{{
navParam
.
value
}}
%
{{/if}}
',
{{/
each
}}
},
{{/if}}
{{#if
treeNodeRS
.
psDETreeNodeRSParams
}}
params: {
{{#
each
treeNodeRS
.
psDETreeNodeRSParams
as
|
param
|
}}
{{
param
.
key
}}
: { value: '
{{
param
.
value
}}
' }
{{/
each
}}
},
{{/if}}
{{#if
treeNodeRS
.
parentFilter
}}
parentFilter: '
{{
treeNodeRS
.
parentFilter
}}
',
{{/if}}
{{#if
treeNodeRS
.
parentPSDER1N
}}
parentPSDER1N: { codeName: '
{{
treeNodeRS
.
parentPSDER1N
.
codeName
}}
' },
{{/if}}
{{#if
treeNodeRS
.
parentPSAppDEField
}}
parentPSAppDEField: { codeName: '
{{
treeNodeRS
.
parentPSAppDEField
.
codeName
}}
' },
{{/if}}
{{#if
treeNodeRS
.
parentPSDETreeNode
}}
parentPSDETreeNode: { id: '
{{
treeNodeRS
.
parentPSDETreeNode
.
id
}}
' },
{{/if}}
parentValueLevel:
{{#if
treeNodeRS
.
parentValueLevel
}}{{
treeNodeRS
.
parentValueLevel
}}{{else}}
null
{{/if}}
,
searchMode:
{{
treeNodeRS
.
searchMode
}}
},
{{/
each
}}
];
}
}
export const ctrlState = {
controlCodeName: '
{{
ctrl
.
codeName
}}
',
controlName: '
{{
ctrl
.
name
}}
',
controlService: new TreeService
<ControlVO>
(ControlVO, new
{{
pascalCase
ctrl
.
psAppDataEntity
.
codeName
}}
Service() ),
currentselectedNode: {},
data: [],
selectedNodes: []
};
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@TREEVIEW-TREEEXPBAR_TREE}}-tree/{{ctrls@TREEVIEW-TREEEXPBAR_TREE}}-tree.vue.hbs
0 → 100644
浏览文件 @
e580fbb4
<script
setup
lang=
"ts"
>
import
{
Subject
}
from
'rxjs'
;
import
{
IActionParam
,
IParam
,
ControlAction
,
TreeControl
,
IContext
}
from
'@core'
;
import
{
ctrlState
}
from
'./
{{
spinalCase
ctrl
.
codeName
}}
-tree-state'
;
interface
Props
{
context
:
IContext
;
multiple
:
boolean
;
selectedData
:
IParam
[];
selectFirstDefault
:
boolean
;
isBranchAvailable
:
boolean
;
viewParams
?:
IParam
;
controlAction
:
ControlAction
;
showBusyIndicator
?:
boolean
;
viewSubject
:
Subject
<
IActionParam
>
;
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
viewSubject
:
()
=>
new
Subject
<
IActionParam
>
(),
showBusyIndicator
:
true
,
selectFirstDefault
:
false
,
isBranchAvailable
:
false
})
// emit声明
interface
CtrlEmit
{
(
name
:
"ctrlEvent"
,
value
:
IActionParam
):
void
;
}
const
emit
=
defineEmits
<
CtrlEmit
>
();
// 安装功能模块,提供状态和能力方法
const
{
state
,
load
,
treeNodeSelect
}
=
new
TreeControl
(
ctrlState
,
props
,
emit
).
moduleInstall
();
// 暴露内部状态及能力
defineExpose
({
state
,
name
:
'
{{
ctrl
.
name
}}
'
});
</script>
// TODO 树节点待支持图标和自定义绘制
<template>
<a-tree
class=
"app-tree
{{#if
ctrl
.
psSysCss
}}
{{
ctrl
.
psSysCss
.
cssName
}}{{/if}}
"
:tree-data=
"state.data"
:load-data=
"load"
:fieldNames=
"{ title: 'text', key: 'id' }"
@
select=
"treeNodeSelect"
>
<template
#
title=
"{ text, id }"
>
<div
class=
"app-tree-node"
>
<span
class=
"tree-node__title"
>
\{{ text }}
</span>
</div>
</template>
</a-tree>
</template>
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录