Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
1b4f4220
提交
1b4f4220
编写于
1月 13, 2022
作者:
tony001
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:更新
上级
5592e3ca
变更
18
展开全部
显示空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
302 行增加
和
355 行删除
+302
-355
control-base.ts
...s}}/src/core/modules/widgets/control-base/control-base.ts
+33
-36
exp-bar-control.ts
...c/core/modules/widgets/exp-bar-control/exp-bar-control.ts
+4
-7
form-control.ts
...s}}/src/core/modules/widgets/form-control/form-control.ts
+93
-98
grid-control.ts
...s}}/src/core/modules/widgets/grid-control/grid-control.ts
+62
-68
main-control.ts
...s}}/src/core/modules/widgets/main-control/main-control.ts
+9
-15
menu-control.ts
...s}}/src/core/modules/widgets/menu-control/menu-control.ts
+50
-53
pickupviewpanel-control.ts
...idgets/pickupviewpanel-control/pickupviewpanel-control.ts
+7
-21
search-form-control.ts
...odules/widgets/search-form-control/search-form-control.ts
+10
-14
tree-control.ts
...s}}/src/core/modules/widgets/tree-control/tree-control.ts
+15
-20
tree-exp-bar-control.ts
...ules/widgets/tree-exp-bar-control/tree-exp-bar-control.ts
+11
-15
{{ctrls@APPMENU}}-menu.vue.hbs
...s}}/{{ctrls@APPMENU}}-menu/{{ctrls@APPMENU}}-menu.vue.hbs
+1
-1
{{ctrls@FORM}}-form.vue.hbs
...ntities}}/{{ctrls@FORM}}-form/{{ctrls@FORM}}-form.vue.hbs
+1
-1
{{ctrls@GRID}}-grid.vue.hbs
...ntities}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid.vue.hbs
+1
-1
{{ctrls@PICKUPVIEWPANEL}}-pickup-view-panel.vue.hbs
...panel/{{ctrls@PICKUPVIEWPANEL}}-pickup-view-panel.vue.hbs
+1
-1
{{ctrls@PICKUPVIEWPANEL}}-pickupviewpanel.vue.hbs
...ewpanel/{{ctrls@PICKUPVIEWPANEL}}-pickupviewpanel.vue.hbs
+1
-1
{{ctrls@SEARCHFORM}}-searchForm.vue.hbs
...FORM}}-searchForm/{{ctrls@SEARCHFORM}}-searchForm.vue.hbs
+1
-1
{{ctrls@TREEEXPBAR}}-tree-exp-bar.vue.hbs
...}}-tree-exp-bar/{{ctrls@TREEEXPBAR}}-tree-exp-bar.vue.hbs
+1
-1
{{ctrls@TREEVIEW}}-tree.vue.hbs
...}/{{ctrls@TREEVIEW}}-tree/{{ctrls@TREEVIEW}}-tree.vue.hbs
+1
-1
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/control-base/control-base.ts
浏览文件 @
1b4f4220
import
{
ControlPropsBase
,
ControlStateBase
,
UIBase
}
from
'@core'
;
import
{
RouteLocationNormalizedLoaded
,
Router
,
useRoute
,
useRouter
}
from
'vue-router'
;
import
{
ControlPropsBase
,
ControlStateBase
,
IParam
,
UIBase
}
from
'@core'
;
/**
* @description 部件基类
...
...
@@ -9,67 +8,66 @@ import { RouteLocationNormalizedLoaded, Router, useRoute, useRouter } from 'vue-
export
class
ControlBase
{
/**
* @description 部件状态
* 部件状态数据
*
* @type {ControlStateBase}
* @memberof ControlBase
*/
public
controlS
tate
:
ControlStateBase
;
public
declare
s
tate
:
ControlStateBase
;
/**
* @description 路由器
* @type {Router}
* 输入参数
*
* @type {IParam}
* @memberof ControlBase
*/
public
router
:
Router
=
useRouter
()
;
public
declare
props
:
IParam
;
/**
* @description 路由
* @type {RouteLocationNormalizedLoaded}
* 输出事件
*
* @type {Function}
* @memberof ControlBase
*/
public
route
:
RouteLocationNormalizedLoaded
=
useRoute
()
;
public
declare
emit
:
Function
;
/**
*
@description 事件
* @
type {*}
*
Creates an instance of ControlBase.
* @
param {*} options 配置参数
* @memberof ControlBase
*/
public
emit
:
any
;
/**
* Creates an instance of ControlBase.
* @param {*} options 配置参数
* @param {ControlPropsBase} props 输入参数
* @param {Function} emit 输出事件
* @memberof ControlBase
*/
constructor
(
options
:
any
)
{
this
.
controlState
=
reactive
(
options
);
constructor
(
options
:
any
,
props
:
ControlPropsBase
,
emit
:
Function
)
{
this
.
state
=
reactive
(
options
);
this
.
props
=
props
;
this
.
emit
=
emit
;
}
/**
* @description 根据props调整设置部分部件基类
* @param {ControlPropsBase} props 传入props
* @memberof ControlBase
*/
public
setState
(
props
:
ControlPropsBase
)
{
// toDo 项目级配置入口,优先级大于平台,提供全局的一次性配置
// 只读属性处理:把props的属性的Ref赋给state,以维持响应性。
this
.
controlState
.
viewSubject
=
toRef
(
props
,
'viewSubject'
)
as
any
;
public
setState
()
{
this
.
state
.
viewSubject
=
toRef
(
this
.
props
,
'viewSubject'
)
as
any
;
}
/**
* @description 使用部件上下文参数逻辑块
* @param {ControlPropsBase} props
* @return {*}
* @memberof ControlBase
*/
public
useControlContextParams
(
props
:
ControlPropsBase
)
{
const
context
=
UIBase
.
toOneWayRef
(
props
,
'context'
);
const
viewParams
=
UIBase
.
toOneWayRef
(
props
,
'viewParams'
);
public
useControlContextParams
()
{
const
context
=
UIBase
.
toOneWayRef
(
this
.
props
,
'context'
);
const
viewParams
=
UIBase
.
toOneWayRef
(
this
.
props
,
'viewParams'
);
// 把Ref赋值到State上进行解包
this
.
controlS
tate
.
context
=
context
;
this
.
controlS
tate
.
viewParams
=
viewParams
;
this
.
s
tate
.
context
=
context
;
this
.
s
tate
.
viewParams
=
viewParams
;
return
{
context
,
viewParams
};
}
...
...
@@ -81,12 +79,11 @@ export class ControlBase {
* @return {*}
* @memberof ControlBase
*/
public
moduleInstall
(
props
:
ControlPropsBase
,
emit
?:
Function
)
{
this
.
emit
=
emit
?.
bind
(
this
);
this
.
setState
(
props
);
this
.
useControlContextParams
(
props
);
public
moduleInstall
()
{
this
.
setState
();
this
.
useControlContextParams
();
return
{
state
:
this
.
controlState
,
state
:
this
.
state
};
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/exp-bar-control/exp-bar-control.ts
浏览文件 @
1b4f4220
...
...
@@ -14,7 +14,7 @@ export class ExpBarControl extends MainControl {
* @type {ExpBarControlState}
* @memberof ExpBarControl
*/
public
declare
controlS
tate
:
ExpBarControlState
;
public
declare
s
tate
:
ExpBarControlState
;
/**
* @description 处理部件事件
...
...
@@ -23,7 +23,7 @@ export class ExpBarControl extends MainControl {
*/
public
handleCtrlEvent
(
actionParam
:
IActionParam
)
{
const
{
tag
,
action
,
data
}
=
actionParam
;
const
{
selection
}
=
this
.
controlS
tate
;
const
{
selection
}
=
this
.
s
tate
;
switch
(
action
)
{
case
'selectionchange'
:
this
.
onSelectionChange
(
data
);
...
...
@@ -66,16 +66,13 @@ export class ExpBarControl extends MainControl {
/**
* @description 安装部件所有功能模块的方法
* @param {ExpBarControlProps} props 传入的Props
* @param {Function} [emit]
* @return {*}
* @memberof ExpBarControl [emit] 事件
*/
public
moduleInstall
(
props
:
ExpBarControlProps
,
emit
?:
Function
)
{
const
superParams
=
super
.
moduleInstall
(
props
,
emit
);
public
moduleInstall
()
{
const
superParams
=
super
.
moduleInstall
();
return
{
...
superParams
,
state
:
this
.
controlState
,
handleCtrlEvent
:
this
.
handleCtrlEvent
.
bind
(
this
)
};
}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/form-control/form-control.ts
浏览文件 @
1b4f4220
此差异已折叠。
点击以展开。
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/grid-control/grid-control.ts
浏览文件 @
1b4f4220
此差异已折叠。
点击以展开。
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/main-control/main-control.ts
浏览文件 @
1b4f4220
...
...
@@ -13,32 +13,26 @@ export class MainControl extends ControlBase {
* @type {MainControlState}
* @memberof MainControl
*/
public
declare
controlS
tate
:
MainControlState
;
public
declare
s
tate
:
MainControlState
;
/**
* @description 根据props调整设置部件state
* @param {MainControlProps} props 传入的Props
* @memberof MainControl
*/
public
setState
(
props
:
MainControlProps
)
{
super
.
setState
(
props
);
// 只读属性处理:把props的属性的Ref赋给state,以维持响应性。
this
.
controlState
.
showBusyIndicator
=
toRef
(
props
,
'showBusyIndicator'
)
as
any
;
this
.
controlState
.
controlAction
=
toRef
(
props
,
'controlAction'
)
as
any
;
public
setState
()
{
super
.
setState
();
this
.
state
.
showBusyIndicator
=
toRef
(
this
.
props
,
'showBusyIndicator'
)
as
any
;
this
.
state
.
controlAction
=
toRef
(
this
.
props
,
'controlAction'
)
as
any
;
}
/**
* @description 安装部件所有功能模块的方法
* @param {MainControlProps} props 传入的Props
* @param {Function} [emit] [emit] 事件
* @return {*}
* @memberof MainControl
*/
public
moduleInstall
(
props
:
MainControlProps
,
emit
?:
Function
)
{
const
superParams
=
super
.
moduleInstall
(
props
,
emit
);
public
moduleInstall
()
{
const
superParams
=
super
.
moduleInstall
();
return
{
...
superParams
,
state
:
this
.
controlState
,
...
superParams
};
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/menu-control/menu-control.ts
浏览文件 @
1b4f4220
import
{
Ref
}
from
'vue'
;
import
{
MenuControlProps
,
MenuControlState
,
IActionParam
,
ControlBase
,
IParam
,
AppFuncService
,
deepCopy
}
from
'@core'
;
import
{
MenuControlState
,
IActionParam
,
ControlBase
,
IParam
,
deepCopy
}
from
'@core'
;
import
{
useRoute
}
from
'vue-router'
;
/**
* @description 菜单部件
...
...
@@ -14,17 +15,16 @@ export class MenuControl extends ControlBase {
* @type {MenuControlState}
* @memberof MenuControl
*/
public
declare
controlS
tate
:
MenuControlState
;
public
declare
s
tate
:
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
;
public
setState
()
{
super
.
setState
();
this
.
state
.
defaultView
=
toRef
(
this
.
props
,
'defaultView'
)
as
any
;
this
.
state
.
menuAlign
=
toRef
(
this
.
props
,
'menuAlign'
)
as
any
;
}
/**
...
...
@@ -34,7 +34,7 @@ export class MenuControl extends ControlBase {
*/
public
computedEffectiveMenus
(
items
:
IParam
[])
{
items
.
forEach
((
item
:
IParam
)
=>
{
const
{
authService
}
=
this
.
controlS
tate
;
const
{
authService
}
=
this
.
s
tate
;
// TODO 获取菜单权限
// if (!authService?.getMenusPermission?.(item)) {
// item.hidden = true;
...
...
@@ -53,7 +53,7 @@ export class MenuControl extends ControlBase {
public
handleDefaultOpens
(
items
:
IParam
[],
defaultOpens
:
Ref
<
string
[]
>
)
{
items
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
expanded
)
{
defaultOpens
.
value
=
[...
defaultOpens
.
value
,
item
.
name
];
defaultOpens
.
value
=
[...
defaultOpens
.
value
,
item
.
name
];
}
if
(
item
.
items
?.
length
>
0
)
{
this
.
handleDefaultOpens
(
item
.
items
,
defaultOpens
);
...
...
@@ -66,11 +66,12 @@ export class MenuControl extends ControlBase {
* @memberof MenuControl
*/
public
handleDefaultSelect
()
{
const
{
funcs
,
defaultView
,
menuAlign
}
=
this
.
controlState
;
const
defaultSelectRef
=
toRef
(
this
.
controlState
,
'defaultSelect'
);
const
dataRef
=
toRef
(
this
.
controlState
,
'menus'
);
if
(
this
.
route
.
matched
?.
length
==
2
)
{
const
[{
},
matched
]
=
this
.
route
.
matched
;
const
route
=
useRoute
();
const
{
funcs
,
defaultView
,
menuAlign
}
=
this
.
state
;
const
defaultSelectRef
=
toRef
(
this
.
state
,
'defaultSelect'
);
const
dataRef
=
toRef
(
this
.
state
,
'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
);
...
...
@@ -102,9 +103,9 @@ export class MenuControl extends ControlBase {
* @memberof MenuControl
*/
public
computeMenuSelect
(
menus
:
IParam
[],
funcTag
:
string
):
boolean
{
const
{
funcs
}
=
this
.
controlS
tate
;
const
defaultSelectRef
=
toRef
(
this
.
controlS
tate
,
'defaultSelect'
);
const
defaultOpensRef
=
toRef
(
this
.
controlS
tate
,
'defaultOpens'
);
const
{
funcs
}
=
this
.
s
tate
;
const
defaultSelectRef
=
toRef
(
this
.
s
tate
,
'defaultSelect'
);
const
defaultOpensRef
=
toRef
(
this
.
s
tate
,
'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
));
...
...
@@ -163,34 +164,33 @@ export class MenuControl extends ControlBase {
* @memberof MenuControl
*/
public
menuClick
(
item
:
IParam
)
{
const
{
context
,
viewParams
}
=
this
.
controlS
tate
;
const
{
context
,
viewParams
}
=
this
.
s
tate
;
App
.
getAppFuncService
().
executeAppFunc
(
item
,
deepCopy
(
context
),
deepCopy
(
viewParams
));
}
/**
* @description 使用加载功能模块
* @param {MenuControlProps} props 传入的props
* @return {*}
* @memberof MenuControl
*/
public
useLoad
(
props
:
MenuControlProps
)
{
const
{
viewSubject
,
controlName
}
=
this
.
controlS
tate
;
const
load
=
async
(
opt
:
any
=
{})
=>
{
const
dataRef
=
toRef
(
this
.
controlS
tate
,
'menus'
);
const
defaultOpensRef
=
toRef
(
this
.
controlS
tate
,
'defaultOpens'
);
public
useLoad
(
)
{
const
{
viewSubject
,
controlName
}
=
this
.
s
tate
;
const
load
=
async
(
opt
:
any
=
{})
=>
{
const
dataRef
=
toRef
(
this
.
s
tate
,
'menus'
);
const
defaultOpensRef
=
toRef
(
this
.
s
tate
,
'defaultOpens'
);
this
.
computedEffectiveMenus
(
dataRef
.
value
);
this
.
handleDefaultOpens
(
dataRef
.
value
,
defaultOpensRef
);
this
.
handleDefaultSelect
();
}
// 订阅viewSubject,监听load行为
if
(
viewSubject
)
{
let
subscription
=
viewSubject
.
subscribe
(({
tag
,
action
,
data
}:
IActionParam
)
=>
{
if
(
Object
.
is
(
controlName
,
tag
)
&&
Object
.
is
(
"load"
,
action
)
)
{
if
(
viewSubject
)
{
let
subscription
=
viewSubject
.
subscribe
(({
tag
,
action
,
data
}:
IActionParam
)
=>
{
if
(
Object
.
is
(
controlName
,
tag
)
&&
Object
.
is
(
"load"
,
action
))
{
load
(
data
);
}
})
// 部件卸载时退订viewSubject
onUnmounted
(()
=>
{
onUnmounted
(()
=>
{
subscription
.
unsubscribe
();
})
}
...
...
@@ -206,7 +206,7 @@ export class MenuControl extends ControlBase {
*/
public
menuSelect
(
$event
:
IParam
)
{
const
{
key
}
=
$event
;
const
dataRef
=
toRef
(
this
.
controlS
tate
,
'menus'
);
const
dataRef
=
toRef
(
this
.
s
tate
,
'menus'
);
let
item
=
this
.
compute
(
dataRef
.
value
,
key
);
if
(
Object
.
keys
(
item
).
length
>
0
)
{
this
.
menuClick
(
item
);
...
...
@@ -215,23 +215,20 @@ export class MenuControl extends ControlBase {
/**
* @description 安装部件所有功能模块的方法
* @param {MenuControlProps} props 传入的Props
* @param {Function} [emit] [emit] 事件
* @return {*}
* @memberof MenuControl
*/
public
moduleInstall
(
props
:
MenuControlProps
,
emit
?:
Function
)
{
const
superParams
=
super
.
moduleInstall
(
props
,
emit
);
const
{
load
}
=
this
.
useLoad
(
props
)
public
moduleInstall
()
{
const
superParams
=
super
.
moduleInstall
();
const
{
load
}
=
this
.
useLoad
(
);
const
menuSelect
=
this
.
menuSelect
.
bind
(
this
);
this
.
menuSelect
=
(
$event
:
IParam
)
=>
{
this
.
menuSelect
=
(
$event
:
IParam
)
=>
{
menuSelect
(
$event
);
}
return
{
...
superParams
,
state
:
this
.
controlState
,
load
,
menuSelect
:
this
.
menuSelect
,
};
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/pickupviewpanel-control/pickupviewpanel-control.ts
浏览文件 @
1b4f4220
import
{
Ref
,
ref
}
from
'vue'
;
import
{
IActionParam
,
MainControl
}
from
'@core'
;
import
{
PickupViewPanelControlProps
}
from
'./pickupviewpanel-control-prop'
;
import
{
PickupViewPanelControlState
}
from
'./pickupviewpanel-control-state'
;
...
...
@@ -14,19 +13,9 @@ export class PickupViewPanelControl extends MainControl {
/**
* @description 部件状态
* @type {FormControlState}
* @memberof FormControl
*/
public
declare
controlState
:
PickupViewPanelControlState
;
/**
* @description 根据props设置部件state
* @param {PickupViewPanelControlProps} props
* @memberof PickupViewPanelControl
*/
public
setState
(
props
:
PickupViewPanelControlProps
)
{
super
.
setState
(
props
);
}
public
declare
state
:
PickupViewPanelControlState
;
/**
* @description
...
...
@@ -34,7 +23,7 @@ export class PickupViewPanelControl extends MainControl {
* @memberof PickupViewPanelControl
*/
public
useLoad
(
props
:
PickupViewPanelControlProps
)
{
const
{
viewSubject
,
controlName
,
context
,
viewParams
}
=
this
.
controlS
tate
;
const
{
viewSubject
,
controlName
,
context
,
viewParams
}
=
this
.
s
tate
;
// 订阅viewSubject,监听load行为
if
(
viewSubject
)
{
let
subscription
=
viewSubject
.
subscribe
(({
tag
,
action
,
data
}:
IActionParam
)
=>
{
...
...
@@ -58,7 +47,7 @@ export class PickupViewPanelControl extends MainControl {
*/
public
handleViewEvent
(
actionParam
:
IActionParam
)
{
const
{
tag
,
action
,
data
}
=
actionParam
;
const
{
controlName
}
=
this
.
controlS
tate
;
const
{
controlName
}
=
this
.
s
tate
;
if
(
Object
.
is
(
"selectionChange"
,
action
))
{
this
.
emit
(
'ctrlEvent'
,
{
tag
:
controlName
,
action
:
action
,
data
:
data
});
}
...
...
@@ -66,17 +55,14 @@ export class PickupViewPanelControl extends MainControl {
/**
* @description 安装部件所有功能模块的方法
* @param {PickupViewPanelControlProps} props 传入的Props
* @param {Function} [emit]
* @return {*}
* @memberof
FormControl [emit] 事件
* @memberof
PickupViewPanelControl
*/
public
moduleInstall
(
props
:
PickupViewPanelControlProps
,
emit
?:
Function
)
{
const
superParams
=
super
.
moduleInstall
(
props
,
emit
);
public
moduleInstall
()
{
const
superParams
=
super
.
moduleInstall
();
return
{
...
superParams
,
handleViewEvent
:
this
.
handleViewEvent
.
bind
(
this
),
state
:
this
.
controlState
handleViewEvent
:
this
.
handleViewEvent
.
bind
(
this
)
};
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/search-form-control/search-form-control.ts
浏览文件 @
1b4f4220
import
{
deepCopy
,
FormControl
,
FormControlProps
,
FormControlState
}
from
'@core'
;
import
{
FormControl
,
FormControlState
}
from
'@core'
;
/**
* @description 表单部件
* @description
搜索
表单部件
* @export
* @class FormControl
* @extends {MainControl}
* @todo 部件加载loading,能否不写在行为方法里。
*/
export
class
SearchFormControl
extends
FormControl
{
/**
...
...
@@ -13,18 +12,18 @@ export class SearchFormControl extends FormControl {
* @type {FormControlState}
* @memberof FormControl
*/
public
declare
controlS
tate
:
FormControlState
;
public
declare
s
tate
:
FormControlState
;
/**
* @description 查询
* @memberof SearchFormControl
*/
public
onSearch
()
{
const
{
controlName
}
=
this
.
controlS
tate
;
const
{
controlName
}
=
this
.
s
tate
;
this
.
emit
(
"ctrlEvent"
,
{
tag
:
controlName
,
action
:
"selectionChange"
,
data
:
this
.
controlS
tate
.
data
,
data
:
this
.
s
tate
.
data
,
});
}
...
...
@@ -47,18 +46,15 @@ export class SearchFormControl extends FormControl {
/**
* @description 安装部件所有功能模块的方法
* @param {FormControlProps} props 传入的Props
* @param {Function} [emit]
* @return {*}
* @memberof
FormControl [emit] 事件
* @memberof
SearchFormControl
*/
public
moduleInstall
(
props
:
FormControlProps
,
emit
?:
Function
)
{
const
superParams
=
super
.
moduleInstall
(
props
,
emit
);
public
moduleInstall
()
{
const
superParams
=
super
.
moduleInstall
();
// 表单行为能力启用
const
{
loadDraft
}
=
this
.
useLoadDraft
(
props
);
const
{
loadDraft
}
=
this
.
useLoadDraft
();
return
{
...
superParams
,
state
:
this
.
controlState
,
loadDraft
,
onSearch
:
this
.
onSearch
.
bind
(
this
),
onCancel
:
this
.
onCancel
.
bind
(
this
),
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/tree-control/tree-control.ts
浏览文件 @
1b4f4220
...
...
@@ -15,16 +15,15 @@ export class TreeControl extends MainControl {
* @type {TreeControlState}
* @memberof TreeControl
*/
public
declare
controlS
tate
:
TreeControlState
;
public
declare
s
tate
:
TreeControlState
;
/**
* @description 根据props调整设置部件state
* @param {TreeControlProps} props 传入的props
* @memberof TreeControl
*/
public
setState
(
props
:
TreeControlProps
):
void
{
super
.
setState
(
props
);
this
.
controlState
.
isBranchAvailable
=
toRef
(
props
,
'isBranchAvailable'
)
as
any
;
public
setState
():
void
{
super
.
setState
();
this
.
state
.
isBranchAvailable
=
toRef
(
this
.
props
,
'isBranchAvailable'
)
as
any
;
}
/**
...
...
@@ -38,7 +37,7 @@ export class TreeControl extends MainControl {
e
.
node
.
isCurrent
=
false
;
return
;
}
const
{
isBranchAvailable
,
currentselectedNode
,
multiple
,
selectedNodes
,
controlName
}
=
this
.
controlS
tate
;
const
{
isBranchAvailable
,
currentselectedNode
,
multiple
,
selectedNodes
,
controlName
}
=
this
.
s
tate
;
if
(
isBranchAvailable
&&
e
.
node
.
leaf
)
{
if
(
currentselectedNode
&&
Object
.
keys
(
currentselectedNode
).
length
>
0
)
{
currentselectedNode
.
value
.
srfchecked
=
0
;
...
...
@@ -47,7 +46,7 @@ export class TreeControl extends MainControl {
currentselectedNode
.
value
=
e
.
node
;
if
(
!
multiple
)
{
selectedNodes
.
push
(
currentselectedNode
.
value
);
this
.
emit
(
"ctrlEvent"
,{
tag
:
controlName
,
action
:
'selectionchange'
,
data
:
deepCopy
(
selectedNodes
)
});
this
.
emit
(
"ctrlEvent"
,
{
tag
:
controlName
,
action
:
'selectionchange'
,
data
:
deepCopy
(
selectedNodes
)
});
}
}
}
...
...
@@ -60,7 +59,7 @@ export class TreeControl extends MainControl {
* @memberof TreeControl
*/
private
computecurNodeContext
(
curNode
:
any
)
{
const
{
context
}
=
this
.
controlS
tate
;
const
{
context
}
=
this
.
s
tate
;
let
tempContext
:
any
=
{};
if
(
curNode
&&
curNode
.
data
&&
curNode
.
data
.
srfappctx
)
{
tempContext
=
deepCopy
(
curNode
.
data
.
srfappctx
);
...
...
@@ -72,19 +71,18 @@ export class TreeControl extends MainControl {
/**
* @description 使用加载功能模块
* @param {TreeControlProps} props 传入的props
* @return {*}
* @memberof TreeControl
*/
public
useLoad
(
props
:
TreeControlProps
)
{
const
{
viewSubject
,
controlName
}
=
this
.
controlS
tate
;
public
useLoad
()
{
const
{
viewSubject
,
controlName
}
=
this
.
s
tate
;
const
load
=
async
(
node
:
any
,
isFirst
:
boolean
=
false
)
=>
{
if
(
node
?.
dataRef
?.
children
)
{
return
null
;
}
const
{
controlService
,
data
,
viewParams
,
srfnodefilter
}
=
this
.
controlS
tate
;
}
=
this
.
s
tate
;
let
tempViewParams
:
any
=
deepCopy
(
viewParams
);
let
curNode
:
any
=
{};
curNode
=
deepObjectMerge
(
curNode
,
node
);
...
...
@@ -128,7 +126,7 @@ export class TreeControl extends MainControl {
const
isSelectedAll
=
node
.
checked
;
// TODO 默认选中
// this.setDefaultSelection(items, isRoot, isSelectedAll);
this
.
emit
(
"ctrlEvent"
,{
tag
:
controlName
,
action
:
"load"
,
data
:
items
});
this
.
emit
(
"ctrlEvent"
,
{
tag
:
controlName
,
action
:
"load"
,
data
:
items
});
}
catch
(
error
)
{
console
.
error
(
error
);
}
...
...
@@ -152,17 +150,14 @@ export class TreeControl extends MainControl {
/**
* @description 安装部件所有功能模块的方法
* @param {TreeControlProps} props 传入的Props
* @param {Function} [emit]
* @return {*}
* @memberof TreeControl
[emit] 事件
* @memberof TreeControl
*/
public
moduleInstall
(
props
:
TreeControlProps
,
emit
?:
Function
)
{
const
superParams
=
super
.
moduleInstall
(
props
,
emit
);
const
{
load
}
=
this
.
useLoad
(
props
);
public
moduleInstall
()
{
const
superParams
=
super
.
moduleInstall
();
const
{
load
}
=
this
.
useLoad
();
return
{
...
superParams
,
state
:
this
.
controlState
,
treeNodeSelect
:
this
.
treeNodeSelect
.
bind
(
this
),
load
};
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/tree-exp-bar-control/tree-exp-bar-control.ts
浏览文件 @
1b4f4220
import
{
deepCopy
,
ExpBarControl
,
IActionParam
,
IParam
,
UIUtil
}
from
"@core"
;
import
{
TreeExpBarControlProps
}
from
"./tree-exp-bar-control-prop"
;
import
{
TreeExpBarControlState
}
from
"./tree-exp-bar-control-state"
;
/**
...
...
@@ -14,7 +13,7 @@ export class TreeExpBarControl extends ExpBarControl {
* @type {ExpBarControlState}
* @memberof TreeExpBarControl
*/
public
declare
controlS
tate
:
TreeExpBarControlState
;
public
declare
s
tate
:
TreeExpBarControlState
;
protected
onSelectionChange
(
args
:
any
[])
{
if
(
args
.
length
==
0
)
{
...
...
@@ -31,7 +30,7 @@ export class TreeExpBarControl extends ExpBarControl {
const
refView
=
this
.
getExpItemView
({
nodeType
:
nodeType
});
// TODO 选择视图面板支持
if
(
refView
)
{
const
{
selection
}
=
this
.
controlS
tate
;
const
{
selection
}
=
this
.
s
tate
;
const
{
tempContext
,
tempViewParams
}
=
this
.
computeNavParams
(
arg
);
// 置空
Object
.
assign
(
selection
,
{});
...
...
@@ -48,7 +47,7 @@ export class TreeExpBarControl extends ExpBarControl {
protected
getExpItemView
(
arg
:
any
=
{}):
IParam
|
null
{
const
expMode
:
string
=
`EXPITEM:
${
arg
.
nodeType
}
`
;
const
{
viewRefs
}
=
this
.
controlS
tate
;
const
{
viewRefs
}
=
this
.
s
tate
;
if
(
viewRefs
&&
viewRefs
.
length
>
0
)
{
const
viewRef
=
viewRefs
.
find
((
_viewRef
:
any
)
=>
_viewRef
.
name
==
expMode
);
return
viewRef
?
deepCopy
(
viewRef
)
:
null
;
...
...
@@ -60,7 +59,7 @@ export class TreeExpBarControl extends ExpBarControl {
protected
computeNavParams
(
arg
:
any
):
{
tempContext
:
any
,
tempViewParams
:
any
}
{
const
tempContext
:
any
=
{};
const
tempViewParams
:
any
=
{};
let
{
counter
,
context
}
=
this
.
controlS
tate
;
let
{
counter
,
context
}
=
this
.
s
tate
;
if
(
arg
&&
arg
.
navfilter
)
{
Object
.
defineProperty
(
tempViewParams
,
arg
.
navfilter
,
{
value
:
arg
.
srfkey
,
...
...
@@ -104,11 +103,10 @@ export class TreeExpBarControl extends ExpBarControl {
/**
* @description 使用加载功能模块
* @param {TreeExpBarControlProps} props 传入的props
* @memberof TreeExpBarControl
*/
public
useLoad
(
props
:
TreeExpBarControlProps
)
{
const
{
viewSubject
,
controlName
,
xDataControlName
}
=
this
.
controlS
tate
;
public
useLoad
()
{
const
{
viewSubject
,
controlName
,
xDataControlName
}
=
this
.
s
tate
;
if
(
viewSubject
)
{
let
subscription
=
viewSubject
.
subscribe
(({
tag
,
action
,
data
}:
IActionParam
)
=>
{
if
(
Object
.
is
(
controlName
,
tag
))
{
...
...
@@ -124,16 +122,14 @@ export class TreeExpBarControl extends ExpBarControl {
/**
* @description 安装部件所有功能模块的方法
* @param {TreeExpBarControlProps} props 传入的Props
* @param {Function} [emit]
* @return {*}
* @memberof TreeExpBarControl
[emit] 事件
* @memberof TreeExpBarControl
*/
public
moduleInstall
(
props
:
TreeExpBarControlProps
,
emit
?:
Function
)
{
const
superParams
=
super
.
moduleInstall
(
props
,
emit
);
this
.
useLoad
(
props
);
public
moduleInstall
()
{
const
superParams
=
super
.
moduleInstall
();
this
.
useLoad
();
return
{
...
superParams
,
...
superParams
};
}
}
\ 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
浏览文件 @
1b4f4220
...
...
@@ -20,7 +20,7 @@ interface CtrlEmit {
}
const
emit
=
defineEmits
<
CtrlEmit
>
();
const
{
state
,
menuSelect
}
=
new
MenuControl
(
CtrlConfig
).
moduleInstall
(
props
,
emit
);
const
{
state
,
menuSelect
}
=
new
MenuControl
(
CtrlConfig
,
props
,
emit
).
moduleInstall
(
);
// 暴露内部状态及能力
defineExpose
({
state
,
name
:
'
{{
ctrl
.
name
}}
'
});
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@FORM}}-form/{{ctrls@FORM}}-form.vue.hbs
浏览文件 @
1b4f4220
...
...
@@ -25,7 +25,7 @@ interface CtrlEmit {
const
emit
=
defineEmits
<
CtrlEmit
>
();
// 安装功能模块,提供状态和能力方法
const
{
state
,
handleEditorEvent
,
handleComponentEvent
}
=
new
FormControl
(
CtrlConfig
).
moduleInstall
(
props
,
emit
);
const
{
state
,
handleEditorEvent
,
handleComponentEvent
}
=
new
FormControl
(
CtrlConfig
,
props
,
emit
).
moduleInstall
(
);
// 暴露内部状态及能力
defineExpose
({
state
,
name
:
'
{{
ctrl
.
name
}}
'
});
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid.vue.hbs
浏览文件 @
1b4f4220
...
...
@@ -33,7 +33,7 @@ interface CtrlEmit {
const
emit
=
defineEmits
<
CtrlEmit
>
();
// 安装功能模块,提供状态和能力
const
{
state
,
load
,
handleEditorEvent
,
handleToolbarEvent
,
custom
}
=
new
GridControl
(
CtrlConfig
).
moduleInstall
(
props
,
emit
);
const
{
state
,
load
,
handleEditorEvent
,
handleToolbarEvent
,
custom
}
=
new
GridControl
(
CtrlConfig
,
props
,
emit
).
moduleInstall
(
);
const
{
scrollOption
,
rowKey
,
rowClassName
,
customRow
,
rowSelectionOption
,
resizeColumn
,
handleGridChange
}
=
custom
;
// 暴露内部状态及能力
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@PICKUPVIEWPANEL}}-pickup-view-panel/{{ctrls@PICKUPVIEWPANEL}}-pickup-view-panel.vue.hbs
浏览文件 @
1b4f4220
...
...
@@ -31,7 +31,7 @@ interface CtrlEmit {
const
emit
=
defineEmits
<
CtrlEmit
>
();
// 安装功能模块,提供状态和能力方法
const
{
state
,
handleViewEvent
}
=
new
PickupViewPanelControl
(
CtrlConfig
).
moduleInstall
(
props
,
emit
);
const
{
state
,
handleViewEvent
}
=
new
PickupViewPanelControl
(
CtrlConfig
,
props
,
emit
).
moduleInstall
(
);
// 暴露内部状态及能力
defineExpose
({
state
,
name
:
'
{{
ctrl
.
name
}}
'
});
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@PICKUPVIEWPANEL}}-pickupviewpanel/{{ctrls@PICKUPVIEWPANEL}}-pickupviewpanel.vue.hbs
浏览文件 @
1b4f4220
...
...
@@ -31,7 +31,7 @@ interface CtrlEmit {
const
emit
=
defineEmits
<
CtrlEmit
>
();
// 安装功能模块,提供状态和能力方法
const
{
state
,
inited
,
viewdata
,
viewparam
}
=
new
PickupViewPanelControl
(
CtrlConfig
).
moduleInstall
(
props
,
emit
);
const
{
state
,
inited
,
viewdata
,
viewparam
}
=
new
PickupViewPanelControl
(
CtrlConfig
,
props
,
emit
).
moduleInstall
(
);
// 暴露内部状态及能力
defineExpose
({
state
,
name
:
'
{{
ctrl
.
name
}}
'
});
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@SEARCHFORM}}-searchForm/{{ctrls@SEARCHFORM}}-searchForm.vue.hbs
浏览文件 @
1b4f4220
...
...
@@ -26,7 +26,7 @@ interface CtrlEmit {
const
emit
=
defineEmits
<
CtrlEmit
>
();
// 安装功能模块,提供状态和能力方法
const
{
state
,
handleEditorEvent
,
handleComponentEvent
,
onSearch
,
loadDraft
,
onOk
,
onCancel
}
=
new
SearchFormControl
(
CtrlConfig
).
moduleInstall
(
props
,
emit
);
const
{
state
,
handleEditorEvent
,
handleComponentEvent
,
onSearch
,
loadDraft
,
onOk
,
onCancel
}
=
new
SearchFormControl
(
CtrlConfig
,
props
,
emit
).
moduleInstall
(
);
</script>
<template>
...
...
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
浏览文件 @
1b4f4220
...
...
@@ -35,7 +35,7 @@ interface CtrlEmit {
const
emit
=
defineEmits
<
CtrlEmit
>
();
// 安装功能模块,提供状态和能力方法
const
{
state
,
handleCtrlEvent
}
=
new
TreeExpBarControl
(
CtrlConfig
).
moduleInstall
(
props
,
emit
);
const
{
state
,
handleCtrlEvent
}
=
new
TreeExpBarControl
(
CtrlConfig
,
props
,
emit
).
moduleInstall
(
);
// 暴露内部状态及能力
defineExpose
({
state
,
name
:
'
{{
ctrl
.
name
}}
'
});
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@TREEVIEW}}-tree/{{ctrls@TREEVIEW}}-tree.vue.hbs
浏览文件 @
1b4f4220
...
...
@@ -29,7 +29,7 @@ interface CtrlEmit {
const
emit
=
defineEmits
<
CtrlEmit
>
();
// 安装功能模块,提供状态和能力方法
const
{
state
,
load
,
treeNodeSelect
}
=
new
TreeControl
(
CtrlConfig
).
moduleInstall
(
props
,
emit
);
const
{
state
,
load
,
treeNodeSelect
}
=
new
TreeControl
(
CtrlConfig
,
props
,
emit
).
moduleInstall
(
);
// 暴露内部状态及能力
defineExpose
({
state
,
name
:
'
{{
ctrl
.
name
}}
'
});
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录