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
...
...
@@ -13,7 +13,7 @@ export class FormControl extends MainControl {
* @type {FormControlState}
* @memberof FormControl
*/
public
declare
controlS
tate
:
FormControlState
;
public
declare
s
tate
:
FormControlState
;
/**
* @description 检验表单动态逻辑
...
...
@@ -26,12 +26,12 @@ export class FormControl extends MainControl {
if
(
logic
.
logicType
==
'GROUP'
&&
logic
.
logics
?.
length
>
0
)
{
let
result
:
boolean
=
true
;
if
(
logic
.
groupOP
==
'AND'
)
{
const
falseItem
=
logic
.
logics
.
find
((
childLogic
:
IParam
)
=>
{
const
falseItem
=
logic
.
logics
.
find
((
childLogic
:
IParam
)
=>
{
return
!
this
.
verifyGroupLogic
(
data
,
childLogic
);
})
result
=
falseItem
?
false
:
true
;
}
else
if
(
logic
.
groupOP
==
'OR'
)
{
const
trueItem
=
logic
.
logics
.
find
((
childLogic
:
IParam
)
=>
{
const
trueItem
=
logic
.
logics
.
find
((
childLogic
:
IParam
)
=>
{
return
this
.
verifyGroupLogic
(
data
,
childLogic
);
})
result
=
trueItem
?
true
:
false
;
...
...
@@ -55,8 +55,8 @@ export class FormControl extends MainControl {
* @memberof FormControl
*/
public
formDataChange
(
name
:
string
,
value
:
any
)
{
const
{
enableAutoSave
}
=
this
.
controlS
tate
;
const
{
data
}
=
toRefs
(
this
.
controlS
tate
);
const
{
enableAutoSave
}
=
this
.
s
tate
;
const
{
data
}
=
toRefs
(
this
.
s
tate
);
data
.
value
[
name
]
=
value
;
this
.
resetFormData
(
name
);
this
.
formItemUpdate
(
name
);
...
...
@@ -72,7 +72,7 @@ export class FormControl extends MainControl {
* @memberof FormControl
*/
public
resetFormData
(
name
:
string
)
{
const
{
detailsModel
}
=
this
.
controlS
tate
;
const
{
detailsModel
}
=
this
.
s
tate
;
Object
.
values
(
detailsModel
).
forEach
((
item
:
IParam
)
=>
{
if
(
item
.
resetItemName
&&
Object
.
is
(
name
,
item
.
resetItemName
))
{
this
.
formDataChange
(
item
.
name
,
null
);
...
...
@@ -89,8 +89,8 @@ export class FormControl extends MainControl {
* @memberof FormControl
*/
public
async
formItemUpdate
(
name
:
string
)
{
const
{
detailsModel
,
context
,
viewParams
,
controlService
}
=
this
.
controlS
tate
;
const
{
data
}
=
toRefs
(
this
.
controlS
tate
);
const
{
detailsModel
,
context
,
viewParams
,
controlService
}
=
this
.
s
tate
;
const
{
data
}
=
toRefs
(
this
.
s
tate
);
if
(
detailsModel
[
name
]
&&
detailsModel
[
name
].
formItemUpdate
)
{
const
formItemUpdate
=
detailsModel
[
name
].
formItemUpdate
;
if
(
formItemUpdate
.
customCode
)
{
...
...
@@ -123,8 +123,8 @@ export class FormControl extends MainControl {
* @memberof FormControl
*/
public
formDynamicLogic
(
name
:
string
)
{
const
{
data
}
=
this
.
controlS
tate
;
const
{
detailsModel
}
=
toRefs
(
this
.
controlS
tate
);
const
{
data
}
=
this
.
s
tate
;
const
{
detailsModel
}
=
toRefs
(
this
.
s
tate
);
Object
.
values
(
detailsModel
.
value
).
forEach
((
item
:
IParam
)
=>
{
if
(
item
.
groupLogics
?.
length
>
0
)
{
item
.
groupLogics
.
forEach
((
logic
:
IParam
)
=>
{
...
...
@@ -162,8 +162,8 @@ export class FormControl extends MainControl {
* @memberof FormControl
*/
public
afterFormAction
(
action
:
string
)
{
const
{
appDeCodeName
,
data
}
=
this
.
controlS
tate
;
const
{
context
}
=
toRefs
(
this
.
controlS
tate
);
const
{
appDeCodeName
,
data
}
=
this
.
s
tate
;
const
{
context
}
=
toRefs
(
this
.
s
tate
);
if
(
appDeCodeName
)
{
if
(
Object
.
is
(
action
,
'save'
)
||
Object
.
is
(
action
,
'autoSave'
)
||
Object
.
is
(
action
,
'submit'
))
{
if
(
data
[
appDeCodeName
])
{
...
...
@@ -182,8 +182,8 @@ export class FormControl extends MainControl {
* @memberof FormControl
*/
public
setFormEnableCond
()
{
const
{
data
}
=
this
.
controlS
tate
;
const
{
detailsModel
}
=
toRefs
(
this
.
controlS
tate
);
const
{
data
}
=
this
.
s
tate
;
const
{
detailsModel
}
=
toRefs
(
this
.
s
tate
);
Object
.
values
(
detailsModel
.
value
).
forEach
((
item
:
IParam
)
=>
{
if
(
Object
.
is
(
item
.
detailType
,
'FORMITEM'
))
{
switch
(
item
.
enableCond
)
{
...
...
@@ -215,8 +215,8 @@ export class FormControl extends MainControl {
* @memberof FormControl
*/
public
calcActionAuthState
()
{
const
{
data
,
UIService
,
actionModel
}
=
this
.
controlS
tate
;
const
{
detailsModel
}
=
toRefs
(
this
.
controlS
tate
);
const
{
data
,
UIService
,
actionModel
}
=
this
.
s
tate
;
const
{
detailsModel
}
=
toRefs
(
this
.
s
tate
);
const
tempModel
=
deepCopy
(
actionModel
);
UIUtil
.
calcActionItemAuthState
(
data
,
tempModel
,
UIService
);
Object
.
values
(
detailsModel
.
value
).
forEach
((
item
:
IParam
)
=>
{
...
...
@@ -256,8 +256,8 @@ export class FormControl extends MainControl {
* @memberof FormControl
*/
public
setCreateDefault
()
{
const
{
detailsModel
,
context
,
viewParams
,
controlService
}
=
this
.
controlS
tate
;
const
{
data
}
=
toRefs
(
this
.
controlS
tate
);
const
{
detailsModel
,
context
,
viewParams
,
controlService
}
=
this
.
s
tate
;
const
{
data
}
=
toRefs
(
this
.
s
tate
);
Object
.
values
(
detailsModel
).
forEach
((
detail
:
IParam
)
=>
{
if
(
Object
.
is
(
detail
.
detailType
,
'FORMITEM'
))
{
if
((
detail
.
createDV
||
detail
.
createDVT
)
&&
data
.
value
.
hasOwnProperty
(
detail
.
codeName
))
{
...
...
@@ -297,8 +297,8 @@ export class FormControl extends MainControl {
* @memberof FormControl
*/
public
setUpdateDefault
()
{
const
{
detailsModel
,
context
,
viewParams
,
controlService
}
=
this
.
controlS
tate
;
const
{
data
}
=
toRefs
(
this
.
controlS
tate
);
const
{
detailsModel
,
context
,
viewParams
,
controlService
}
=
this
.
s
tate
;
const
{
data
}
=
toRefs
(
this
.
s
tate
);
Object
.
values
(
detailsModel
).
forEach
((
detail
:
IParam
)
=>
{
if
(
Object
.
is
(
detail
.
detailType
,
'FORMITEM'
))
{
if
((
detail
.
updateDV
||
detail
.
updateDVT
)
&&
data
.
value
.
hasOwnProperty
(
detail
.
codeName
))
{
...
...
@@ -339,8 +339,8 @@ export class FormControl extends MainControl {
* @return {*}
* @memberof FormControl
*/
public
useLoadDraft
(
props
:
FormControlProps
)
{
const
{
viewSubject
,
controlName
}
=
this
.
controlS
tate
;
public
useLoadDraft
()
{
const
{
viewSubject
,
controlName
}
=
this
.
s
tate
;
/**
* 加载行为
...
...
@@ -350,8 +350,8 @@ export class FormControl extends MainControl {
*/
const
loadDraft
=
async
(
opt
:
any
=
{})
=>
{
try
{
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
,
controlAction
,
appDeKeyFieldName
}
=
this
.
controlS
tate
;
const
{
data
}
=
toRefs
(
this
.
controlS
tate
);
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
,
controlAction
,
appDeKeyFieldName
}
=
this
.
s
tate
;
const
{
data
}
=
toRefs
(
this
.
s
tate
);
if
(
!
controlAction
.
loadDraftAction
)
{
return
;
}
...
...
@@ -399,12 +399,11 @@ export class FormControl extends MainControl {
/**
* @description 使用加载功能模块
* @param {FormControlProps} props 传入的props
* @return {*}
* @memberof FormControl
*/
public
useLoad
(
props
:
FormControlProps
)
{
const
{
viewSubject
,
controlName
}
=
this
.
controlS
tate
;
public
useLoad
()
{
const
{
viewSubject
,
controlName
}
=
this
.
s
tate
;
/**
* 加载行为
...
...
@@ -414,8 +413,8 @@ export class FormControl extends MainControl {
*/
const
load
=
async
(
opt
:
any
=
{})
=>
{
try
{
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
,
controlAction
}
=
this
.
controlS
tate
;
const
{
data
}
=
toRefs
(
this
.
controlS
tate
);
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
,
controlAction
}
=
this
.
s
tate
;
const
{
data
}
=
toRefs
(
this
.
s
tate
);
if
(
!
controlAction
.
loadAction
)
{
return
;
}
...
...
@@ -460,12 +459,11 @@ export class FormControl extends MainControl {
/**
* @description 使用加载功能模块
* @param {FormControlProps} props 传入的props
* @return {*}
* @memberof FormControl
*/
public
useSave
(
props
?:
FormControlProps
)
{
const
{
viewSubject
,
controlName
}
=
this
.
controlS
tate
;
public
useSave
()
{
const
{
viewSubject
,
controlName
}
=
this
.
s
tate
;
/**
* 保存行为
...
...
@@ -476,12 +474,12 @@ export class FormControl extends MainControl {
const
save
=
async
(
opt
:
any
=
{})
=>
{
try
{
// 获取需要的状态变量
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
,
data
}
=
this
.
controlS
tate
;
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
,
data
}
=
this
.
s
tate
;
// TODO 值规则校验处理
// 判断实体行为
const
{
updateAction
,
createAction
}
=
this
.
controlS
tate
.
controlAction
;
const
{
updateAction
,
createAction
}
=
this
.
s
tate
.
controlAction
;
const
saveAction
:
any
=
data
.
srfuf
==
'1'
?
updateAction
:
createAction
;
const
saveFunName
=
data
.
srfuf
==
'1'
?
'update'
:
'create'
;
if
(
!
saveAction
)
{
...
...
@@ -514,7 +512,7 @@ export class FormControl extends MainControl {
}
// 请求后处理
this
.
controlS
tate
.
data
=
response
.
data
;
this
.
s
tate
.
data
=
response
.
data
;
// TODO 表单onFormLoad
}
catch
(
error
)
{
...
...
@@ -548,7 +546,7 @@ export class FormControl extends MainControl {
* @memberof FormControl
*/
public
useRemove
(
props
:
FormControlProps
)
{
const
{
viewSubject
,
controlName
}
=
this
.
controlS
tate
;
const
{
viewSubject
,
controlName
}
=
this
.
s
tate
;
/**
* 删除行为
...
...
@@ -559,10 +557,10 @@ export class FormControl extends MainControl {
const
remove
=
async
(
opt
:
any
=
{})
=>
{
try
{
// 获取需要的状态变量
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
}
=
this
.
controlS
tate
;
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
}
=
this
.
s
tate
;
// 判断实体行为
const
removeAction
=
this
.
controlS
tate
.
controlAction
.
removeAction
;
const
removeAction
=
this
.
s
tate
.
controlAction
.
removeAction
;
if
(
!
removeAction
)
{
return
;
}
...
...
@@ -579,7 +577,7 @@ export class FormControl extends MainControl {
arg
,
{
action
:
removeAction
,
isLoading
:
showBusyIndicator
isLoading
:
showBusyIndicator
},
);
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
...
...
@@ -587,7 +585,7 @@ export class FormControl extends MainControl {
}
// 请求后处理
this
.
controlS
tate
.
data
=
response
.
data
;
this
.
s
tate
.
data
=
response
.
data
;
}
catch
(
error
)
{
// TODO 错误异常处理
console
.
log
(
error
);
...
...
@@ -657,20 +655,17 @@ export class FormControl extends MainControl {
/**
* @description 安装部件所有功能模块的方法
* @param {FormControlProps} props 传入的Props
* @param {Function} [emit]
* @return {*}
* @memberof FormControl [emit] 事件
*/
public
moduleInstall
(
props
:
FormControlProps
,
emit
?:
Function
)
{
const
superParams
=
super
.
moduleInstall
(
props
,
emit
);
public
moduleInstall
()
{
const
superParams
=
super
.
moduleInstall
();
// 表单行为能力启用
const
{
load
}
=
this
.
useLoad
(
props
);
const
{
save
}
=
this
.
useSave
(
props
);
const
{
load
}
=
this
.
useLoad
();
const
{
save
}
=
this
.
useSave
();
return
{
...
superParams
,
state
:
this
.
controlState
,
load
,
save
,
handleEditorEvent
:
this
.
handleEditorEvent
.
bind
(
this
),
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/grid-control/grid-control.ts
浏览文件 @
1b4f4220
...
...
@@ -14,20 +14,20 @@ export class GridControl extends MainControl {
* @type {GridControlState}
* @memberof GridControl
*/
public
declare
controlS
tate
:
GridControlState
;
public
declare
s
tate
:
GridControlState
;
/**
* @description
* @param {GridControlProps} props
* @memberof GridControl
*/
public
setState
(
props
:
GridControlProps
)
{
super
.
setState
(
props
);
this
.
controlState
.
multiple
=
toRef
(
props
,
"multiple"
)
as
any
;
this
.
controlState
.
rowEditState
=
toRef
(
props
,
"rowEditState"
)
as
any
;
this
.
controlState
.
rowActiveMode
=
toRef
(
props
,
"rowActiveMode"
)
as
any
;
this
.
controlState
.
selectedData
=
toRef
(
props
,
"selectedData"
)
as
any
;
this
.
controlState
.
selectFirstDefault
=
toRef
(
props
,
"selectFirstDefault"
)
as
any
;
public
setState
()
{
super
.
setState
();
this
.
state
.
multiple
=
toRef
(
this
.
props
,
"multiple"
)
as
any
;
this
.
state
.
rowEditState
=
toRef
(
this
.
props
,
"rowEditState"
)
as
any
;
this
.
state
.
rowActiveMode
=
toRef
(
this
.
props
,
"rowActiveMode"
)
as
any
;
this
.
state
.
selectedData
=
toRef
(
this
.
props
,
"selectedData"
)
as
any
;
this
.
state
.
selectFirstDefault
=
toRef
(
this
.
props
,
"selectFirstDefault"
)
as
any
;
}
/**
...
...
@@ -37,8 +37,8 @@ export class GridControl extends MainControl {
* @param {*} value 表格列属性值
* @memberof GridControl
*/
public
gridDataChange
(
rowIndex
:
number
,
name
:
string
,
value
:
any
){
const
{
data
}
=
toRefs
(
this
.
controlS
tate
);
public
gridDataChange
(
rowIndex
:
number
,
name
:
string
,
value
:
any
)
{
const
{
data
}
=
toRefs
(
this
.
s
tate
);
if
(
data
.
value
[
rowIndex
][
name
]
!==
value
)
{
data
.
value
[
rowIndex
][
name
]
=
value
;
data
.
value
[
rowIndex
][
"rowDataState"
]
=
"update"
;
...
...
@@ -52,7 +52,7 @@ export class GridControl extends MainControl {
* @memberof GridControl
*/
public
getActionAuthState
(
rowData
:
IParam
)
{
const
{
UIService
,
uAColumnModel
}
=
this
.
controlS
tate
;
const
{
UIService
,
uAColumnModel
}
=
this
.
s
tate
;
let
tempModel
:
any
=
deepCopy
(
uAColumnModel
);
UIUtil
.
calcActionItemAuthState
(
rowData
,
tempModel
,
UIService
);
return
tempModel
;
...
...
@@ -81,8 +81,8 @@ export class GridControl extends MainControl {
* @memberof GridControl
*/
public
autoGroup
()
{
const
{
gridGroup
}
=
this
.
controlS
tate
;
const
{
data
,
columnsModel
}
=
toRefs
(
this
.
controlS
tate
);
const
{
gridGroup
}
=
this
.
s
tate
;
const
{
data
,
columnsModel
}
=
toRefs
(
this
.
s
tate
);
const
{
groupField
}
=
gridGroup
;
let
autoGroup
:
string
[]
=
[];
data
.
value
.
forEach
((
item
:
IParam
)
=>
{
...
...
@@ -116,8 +116,8 @@ export class GridControl extends MainControl {
* @memberof GridControl
*/
public
async
codeListGroup
()
{
const
{
gridGroup
}
=
this
.
controlS
tate
;
const
{
data
,
columnsModel
}
=
toRefs
(
this
.
controlS
tate
);
const
{
gridGroup
}
=
this
.
s
tate
;
const
{
data
,
columnsModel
}
=
toRefs
(
this
.
s
tate
);
const
{
groupField
}
=
gridGroup
;
// TODO 代码表数据
let
codeListGroup
:
IParam
[]
=
[];
...
...
@@ -160,7 +160,7 @@ export class GridControl extends MainControl {
* @memberof GridControl
*/
public
calcGridAuthState
()
{
const
{
data
,
columnsModel
}
=
toRefs
(
this
.
controlS
tate
);
const
{
data
,
columnsModel
}
=
toRefs
(
this
.
s
tate
);
let
columnModel
=
this
.
getGridColumn
(
columnsModel
.
value
,
"UAGRIDCOLUMN"
);
if
(
columnModel
)
{
data
.
value
.
forEach
((
item
:
IParam
)
=>
{
...
...
@@ -176,26 +176,26 @@ export class GridControl extends MainControl {
* @memberof GridControl
*/
public
setGridColSpan
()
{
const
{
columnsModel
}
=
toRefs
(
this
.
controlS
tate
);
const
{
columnsModel
}
=
toRefs
(
this
.
s
tate
);
columnsModel
.
value
.
forEach
((
columnModel
:
IParam
)
=>
{
const
customRender
=
({
text
,
record
,
index
,
column
}:
IParam
)
=>
{
const
customRender
=
({
text
,
record
,
index
,
column
}:
IParam
)
=>
{
const
option
=
{
props
:
{}
as
IParam
,
};
if
(
record
.
children
)
{
if
(
Object
.
is
(
column
.
columnType
,
"GROUP"
))
{
Object
.
assign
(
option
.
props
,{
Object
.
assign
(
option
.
props
,
{
colSpan
:
columnsModel
.
value
.
length
,
});
}
else
{
Object
.
assign
(
option
.
props
,{
Object
.
assign
(
option
.
props
,
{
colSpan
:
0
});
}
}
return
option
;
}
Object
.
assign
(
columnModel
,{
Object
.
assign
(
columnModel
,
{
customRender
:
customRender
,
})
});
...
...
@@ -206,7 +206,7 @@ export class GridControl extends MainControl {
* @memberof GridControl
*/
public
handleGridGroup
()
{
const
{
gridGroup
}
=
this
.
controlS
tate
;
const
{
gridGroup
}
=
this
.
s
tate
;
const
{
enableGroup
,
groupField
,
groupMode
}
=
gridGroup
;
if
(
enableGroup
&&
groupField
&&
!
Object
.
is
(
groupMode
,
"NONE"
))
{
if
(
Object
.
is
(
groupMode
,
"AUTO"
))
{
...
...
@@ -223,7 +223,7 @@ export class GridControl extends MainControl {
* @memberof GridControl
*/
public
async
remoteAgg
():
Promise
<
IParam
[]
>
{
const
{
gridAgg
}
=
this
.
controlS
tate
;
const
{
gridAgg
}
=
this
.
s
tate
;
const
aggData
:
IParam
[]
=
[];
// TODO 调用服务获取聚合数据
return
aggData
;
...
...
@@ -279,15 +279,15 @@ export class GridControl extends MainControl {
* @memberof GridControl
*/
public
async
handleDataAgg
()
{
const
{
gridPaging
,
gridGroup
,
columnsModel
}
=
this
.
controlS
tate
;
const
{
gridAgg
}
=
toRefs
(
this
.
controlS
tate
);
const
{
gridPaging
,
gridGroup
,
columnsModel
}
=
this
.
s
tate
;
const
{
gridAgg
}
=
toRefs
(
this
.
s
tate
);
let
{
aggMode
,
aggData
}
=
gridAgg
.
value
;
const
{
enableGroup
}
=
gridGroup
;
if
(
!
Object
.
is
(
aggMode
,
"NONE"
))
{
const
{
enablePagingBar
,
current
,
pageSize
}
=
gridPaging
;
let
dataAgg
:
IParam
[]
=
[];
if
(
Object
.
is
(
aggMode
,
"PAGE"
))
{
const
dataRef
=
toRef
(
this
.
controlS
tate
,
"data"
);
const
dataRef
=
toRef
(
this
.
s
tate
,
"data"
);
dataAgg
=
[...
dataRef
.
value
];
}
else
if
(
Object
.
is
(
aggMode
,
"ALL"
))
{
dataAgg
=
await
this
.
remoteAgg
();
...
...
@@ -323,8 +323,8 @@ export class GridControl extends MainControl {
* @memberof GridControl
*/
public
handleDefaultSelect
()
{
const
{
selectedData
,
selectFirstDefault
,
controlName
,
data
}
=
this
.
controlS
tate
;
const
{
selectedRowKeys
}
=
toRefs
(
this
.
controlS
tate
);
const
{
selectedData
,
selectFirstDefault
,
controlName
,
data
}
=
this
.
s
tate
;
const
{
selectedRowKeys
}
=
toRefs
(
this
.
s
tate
);
if
(
selectedData
?.
length
>
0
)
{
const
_selectedRowKeys
:
string
[]
=
[];
selectedData
.
forEach
((
selected
:
IParam
)
=>
{
...
...
@@ -346,18 +346,17 @@ export class GridControl extends MainControl {
/**
* @description 使用加载功能模块
* @param {GridControlProps} props 传入的props
* @return {*}
* @memberof GridControl
*/
public
useLoad
(
props
:
GridControlProps
)
{
const
{
viewSubject
,
controlName
}
=
this
.
controlS
tate
;
public
useLoad
()
{
const
{
viewSubject
,
controlName
}
=
this
.
s
tate
;
const
load
=
async
(
opt
:
any
=
{})
=>
{
try
{
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
,
controlAction
,
gridSort
}
=
this
.
controlS
tate
;
const
{
gridPaging
,
data
}
=
toRefs
(
this
.
controlS
tate
);
}
=
this
.
s
tate
;
const
{
gridPaging
,
data
}
=
toRefs
(
this
.
s
tate
);
if
(
!
controlAction
.
fetchAction
)
{
return
;
}
...
...
@@ -412,15 +411,14 @@ export class GridControl extends MainControl {
/**
* @description 使用保存功能模块
* @param {GridControlProps} props 传入的props
* @return {*}
* @memberof GridControl
*/
public
useSave
(
props
:
GridControlProps
)
{
const
{
viewSubject
,
controlName
}
=
this
.
controlS
tate
;
public
useSave
()
{
const
{
viewSubject
,
controlName
}
=
this
.
s
tate
;
const
save
=
async
(
opt
:
any
=
{})
=>
{
try
{
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
,
data
,
controlAction
}
=
this
.
controlS
tate
;
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
,
data
,
controlAction
}
=
this
.
s
tate
;
// TODO 值规则校验处理
for
(
const
item
of
data
)
{
...
...
@@ -474,11 +472,11 @@ export class GridControl extends MainControl {
* @memberof GridControl
*/
public
useRemove
(
props
:
GridControlProps
)
{
const
{
viewSubject
,
controlName
}
=
this
.
controlS
tate
;
const
{
viewSubject
,
controlName
}
=
this
.
s
tate
;
const
remove
=
async
(
opt
:
IParam
[]
=
[])
=>
{
try
{
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
,
controlAction
,
appDeCodeName
}
=
this
.
controlS
tate
;
const
{
data
}
=
toRefs
(
this
.
controlS
tate
);
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
,
controlAction
,
appDeCodeName
}
=
this
.
s
tate
;
const
{
data
}
=
toRefs
(
this
.
s
tate
);
if
(
!
controlAction
.
removeAction
)
{
return
;
}
...
...
@@ -502,7 +500,7 @@ export class GridControl extends MainControl {
});
const
_removeAction
=
keys
.
length
>
1
?
"removeBatch"
:
controlAction
.
removeAction
;
let
_context
=
deepCopy
(
context
);
Object
.
assign
(
_context
,
{
[
appDeCodeName
]:
keys
});
Object
.
assign
(
_context
,
{
[
appDeCodeName
]:
keys
});
let
_viewParams
=
deepCopy
(
viewParams
);
const
arg
:
IParam
=
{
[
appDeCodeName
]:
keys
,
...
...
@@ -548,17 +546,17 @@ export class GridControl extends MainControl {
* @memberof GridControl
*/
public
useNewRow
(
props
:
GridControlProps
)
{
const
{
viewSubject
,
controlName
}
=
this
.
controlS
tate
;
const
{
viewSubject
,
controlName
}
=
this
.
s
tate
;
const
newRow
=
async
(
opt
:
any
=
{})
=>
{
try
{
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
,
controlAction
}
=
this
.
controlS
tate
;
const
{
data
}
=
toRefs
(
this
.
controlS
tate
);
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
,
controlAction
}
=
this
.
s
tate
;
const
{
data
}
=
toRefs
(
this
.
s
tate
);
if
(
!
controlAction
.
loadDraftAction
)
{
return
;
}
let
_context
=
deepCopy
(
context
);
let
_viewParams
=
deepCopy
(
viewParams
);
const
arg
:
any
=
{
...
opt
};
const
arg
:
any
=
{
...
opt
};
Object
.
assign
(
arg
,
{
viewParams
:
_viewParams
});
const
response
=
await
controlService
.
loadDraft
(
_context
,
...
...
@@ -566,7 +564,7 @@ export class GridControl extends MainControl {
{
action
:
controlAction
.
loadDraftAction
,
isLoading
:
showBusyIndicator
},
);
if
(
response
.
status
||
response
.
status
==
200
)
{
data
.
value
=
[...
data
.
value
,
[
response
.
data
]];
data
.
value
=
[...
data
.
value
,
[
response
.
data
]];
}
}
catch
(
error
)
{
// TODO 错误异常处理
...
...
@@ -594,12 +592,11 @@ export class GridControl extends MainControl {
/**
* @description 使用自定义模块(蚂蚁金服UI自定义)
* @param {GridControlProps} props
* @memberof GridControl
*/
public
useCustom
(
props
:
GridControlProps
)
{
const
{
controlName
,
selectFirstDefault
,
rowEditState
,
rowActiveMode
}
=
this
.
controlS
tate
;
const
{
selectedRowKeys
,
gridPaging
}
=
toRefs
(
this
.
controlS
tate
);
public
useCustom
()
{
const
{
controlName
,
selectFirstDefault
,
rowEditState
,
rowActiveMode
}
=
this
.
s
tate
;
const
{
selectedRowKeys
,
gridPaging
}
=
toRefs
(
this
.
s
tate
);
let
{
current
,
pageSize
}
=
gridPaging
.
value
;
// 滚动条配置
const
scrollOption
=
computed
(()
=>
{
...
...
@@ -624,16 +621,16 @@ export class GridControl extends MainControl {
if
(
!
rowEditState
)
{
selectedRowKeys
.
value
=
[
record
.
srfkey
];
if
(
!
record
.
children
)
{
this
.
emit
(
"ctrlEvent"
,{
tag
:
controlName
,
action
:
"selectionChange"
,
data
:
[
deepCopy
(
record
)]
})
this
.
emit
(
"ctrlEvent"
,
{
tag
:
controlName
,
action
:
"selectionChange"
,
data
:
[
deepCopy
(
record
)]
})
if
(
Object
.
is
(
rowActiveMode
,
1
))
{
this
.
emit
(
"ctrlEvent"
,{
tag
:
controlName
,
action
:
"rowClick"
,
data
:
[
deepCopy
(
record
)]
})
this
.
emit
(
"ctrlEvent"
,
{
tag
:
controlName
,
action
:
"rowClick"
,
data
:
[
deepCopy
(
record
)]
})
}
}
}
},
onDblclick
:
()
=>
{
if
(
!
record
.
children
&&
Object
.
is
(
rowActiveMode
,
2
))
{
this
.
emit
(
"ctrlEvent"
,{
tag
:
controlName
,
action
:
"rowDbClick"
,
data
:
[
deepCopy
(
record
)]
})
this
.
emit
(
"ctrlEvent"
,
{
tag
:
controlName
,
action
:
"rowDbClick"
,
data
:
[
deepCopy
(
record
)]
})
}
}
};
...
...
@@ -646,7 +643,7 @@ export class GridControl extends MainControl {
return
{
columnWidth
:
90
,
selectedRowKeys
:
selectedRowKeys
.
value
,
checkStrictly
:
props
.
multiple
?
false
:
true
,
checkStrictly
:
this
.
props
.
multiple
?
false
:
true
,
onChange
:
(
_selectedRowKeys
:
string
[],
selectedRows
:
IParam
[])
=>
{
selectedRowKeys
.
value
=
_selectedRowKeys
;
const
selection
:
IParam
[]
=
[];
...
...
@@ -655,7 +652,7 @@ export class GridControl extends MainControl {
selection
.
push
(
select
);
}
})
this
.
emit
(
"ctrlEvent"
,{
tag
:
controlName
,
action
:
"selectionChange"
,
data
:
selection
})
this
.
emit
(
"ctrlEvent"
,
{
tag
:
controlName
,
action
:
"selectionChange"
,
data
:
selection
})
},
};
});
...
...
@@ -668,7 +665,7 @@ export class GridControl extends MainControl {
if
(
pagination
)
{
current
=
pagination
.
current
;
pageSize
=
pagination
.
pageSize
;
this
.
useLoad
(
props
).
load
();
this
.
useLoad
().
load
();
}
}
return
{
...
...
@@ -713,18 +710,15 @@ export class GridControl extends MainControl {
/**
* @description 安装部件所有功能模块的方法
* @param {GridControlProps} props 传入的Props
* @param {Function} [emit]
* @return {*}
* @memberof GridControl [emit] 事件
*/
public
moduleInstall
(
props
:
GridControlProps
,
emit
?:
Function
)
{
const
superParams
=
super
.
moduleInstall
(
props
,
emit
);
const
{
load
}
=
this
.
useLoad
(
props
);
const
{
custom
}
=
this
.
useCustom
(
props
);
public
moduleInstall
()
{
const
superParams
=
super
.
moduleInstall
();
const
{
load
}
=
this
.
useLoad
();
const
{
custom
}
=
this
.
useCustom
();
return
{
...
superParams
,
state
:
this
.
controlState
,
load
,
custom
,
handleEditorEvent
:
this
.
handleEditorEvent
.
bind
(
this
),
...
...
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
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录