Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
5a7024f6
提交
5a7024f6
编写于
2月 07, 2022
作者:
tony001
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:新增工具栏状态控制逻辑
上级
5d89de7e
变更
9
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
104 行增加
和
12 行删除
+104
-12
PageModel.java
...ore/src/main/java/cn/ibizlab/codegen/model/PageModel.java
+1
-0
view-base-config.hbs
...rces/templ/r7/@macro/front-end/views/view-base-config.hbs
+3
-3
app-col.vue
...s/templ/r7/app_{{apps}}/src/components/common/app-col.vue
+0
-2
edit-view.ts
...pp_{{apps}}/src/core/modules/views/edit-view/edit-view.ts
+66
-2
grid-view.ts
...pp_{{apps}}/src/core/modules/views/grid-view/grid-view.ts
+1
-1
main-view.ts
...pp_{{apps}}/src/core/modules/views/main-view/main-view.ts
+26
-0
md-view.ts
...r7/app_{{apps}}/src/core/modules/views/md-view/md-view.ts
+3
-1
form-control.ts
...s}}/src/core/modules/widgets/form-control/form-control.ts
+2
-2
{{pages@DEEDITVIEW}}.vue.hbs
...dules}}/{{pages@DEEDITVIEW}}/{{pages@DEEDITVIEW}}.vue.hbs
+2
-1
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/PageModel.java
浏览文件 @
5a7024f6
...
@@ -102,6 +102,7 @@ public class PageModel extends BaseModel{
...
@@ -102,6 +102,7 @@ public class PageModel extends BaseModel{
appUIAction
.
put
(
"uIActionMode"
,
UIAction
.
getUIActionMode
());
appUIAction
.
put
(
"uIActionMode"
,
UIAction
.
getUIActionMode
());
appUIAction
.
put
(
"uIActionTag"
,
UIAction
.
getUIActionTag
());
appUIAction
.
put
(
"uIActionTag"
,
UIAction
.
getUIActionTag
());
appUIAction
.
put
(
"uIActionType"
,
UIAction
.
getUIActionType
());
appUIAction
.
put
(
"uIActionType"
,
UIAction
.
getUIActionType
());
appUIAction
.
put
(
"actionTarget"
,
UIAction
.
getActionTarget
());
toolbarItem
.
put
(
"uIAction"
,
appUIAction
);
toolbarItem
.
put
(
"uIAction"
,
appUIAction
);
}
}
}
}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/views/view-base-config.hbs
浏览文件 @
5a7024f6
...
@@ -57,13 +57,13 @@
...
@@ -57,13 +57,13 @@
{{/if}}
{{/if}}
{{/
each
}}
{{/
each
}}
},
},
toolbar: [
{{#
page
.
viewToolBarItems
}}
{{#
page
.
viewToolBarItems
}}
toolbar: [
{{#
items
}}
{{#
items
}}
{ id:'
{{
id
}}
',name:'
{{
name
}}
',caption:'
{{
caption
}}
',groupExtractMode:'
{{
groupExtractMode
}}
',itemType:'
{{
itemType
}}
',noPrivDisplayMode:'
{{
noPrivDisplayMode
}}
',showIcon:
{{
showIcon
}}
,showCaption:
{{
showCaption
}}
,tooltip:'
{{
tooltip
}}
',disabled: false, visible: true, imgPath: '
{{
imgPath
}}
',iconClass: '
{{
iconClass
}}
',xDataControlName:'
{{
xDataControlName
}}
',
{{#if
uIAction
}}
uIAction:{codeName:'
{{
uIAction
.
codeName
}}
',fullCodeName:'
{{
uIAction
.
fullCodeName
}}
',uIActionMode:'
{{
uIAction
.
uIActionMode
}}
',uIActionTag:'
{{
uIAction
.
uIActionTag
}}
',uIActionType:'
{{
uIAction
.
uIActionType
}}
'}
{{/if}}
},
{ id:'
{{
id
}}
',name:'
{{
name
}}
',caption:'
{{
caption
}}
',groupExtractMode:'
{{
groupExtractMode
}}
',itemType:'
{{
itemType
}}
',noPrivDisplayMode:'
{{
noPrivDisplayMode
}}
',showIcon:
{{
showIcon
}}
,showCaption:
{{
showCaption
}}
,tooltip:'
{{
tooltip
}}
',disabled: false, visible: true, imgPath: '
{{
imgPath
}}
',iconClass: '
{{
iconClass
}}
',xDataControlName:'
{{
xDataControlName
}}
',
{{#if
uIAction
}}
uIAction:{codeName:'
{{
uIAction
.
codeName
}}
',fullCodeName:'
{{
uIAction
.
fullCodeName
}}
',uIActionMode:'
{{
uIAction
.
uIActionMode
}}
',
actionTarget:'
{{
uIAction
.
actionTarget
}}
',
uIActionTag:'
{{
uIAction
.
uIActionTag
}}
',uIActionType:'
{{
uIAction
.
uIActionType
}}
'}
{{/if}}
},
{{/
items
}}
{{/
items
}}
],
{{/
page
.
viewToolBarItems
}}
{{/
page
.
viewToolBarItems
}}
],
{{#
each
page
.
ctrls
as
|
ctrl
|
}}
{{#
each
page
.
ctrls
as
|
ctrl
|
}}
{{#if
(
neq
ctrl
.
controlType
"TOOLBAR"
)
}}
{{#if
(
neq
ctrl
.
controlType
"TOOLBAR"
)
}}
{{>
(
lookup
.
'ctrl.controlType'
)
ctrl
=
ctrl
}}{{#
unless
@last
}}
,
{{/
unless
}}
{{>
(
lookup
.
'ctrl.controlType'
)
ctrl
=
ctrl
}}{{#
unless
@last
}}
,
{{/
unless
}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/common/app-col.vue
浏览文件 @
5a7024f6
...
@@ -29,8 +29,6 @@ let slotStyle = computed(() => {
...
@@ -29,8 +29,6 @@ let slotStyle = computed(() => {
}
}
let
result
=
''
;
let
result
=
''
;
result
+=
isObject
(
attrs
.
style
)
?
styleObj2Str
(
attrs
.
style
)
:
attrs
.
style
;
result
+=
isObject
(
attrs
.
style
)
?
styleObj2Str
(
attrs
.
style
)
:
attrs
.
style
;
console
.
log
(
attrs
.
style
)
console
.
log
(
result
)
if
(
layout
?.
value
?.
colStyle
)
{
if
(
layout
?.
value
?.
colStyle
)
{
result
+=
layout
.
value
.
colStyle
;
result
+=
layout
.
value
.
colStyle
;
}
}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/edit-view/edit-view.ts
浏览文件 @
5a7024f6
import
{
EditViewState
,
IParam
,
MainView
}
from
'@core'
;
import
{
EditViewState
,
I
ActionParam
,
I
Param
,
MainView
}
from
'@core'
;
/**
/**
* @description 编辑视图
* @description 编辑视图
...
@@ -54,11 +54,75 @@ export class EditView extends MainView {
...
@@ -54,11 +54,75 @@ export class EditView extends MainView {
})
})
}
}
/**
* 处理部件事件
*
* @param {IActionParam} actionParam
* @memberof EditView
*/
public
onCtrlEvent
(
actionParam
:
IActionParam
)
{
super
.
onCtrlEvent
(
actionParam
);
const
{
tag
,
action
,
data
}
=
actionParam
;
if
(
Object
.
is
(
tag
,
'form'
))
{
this
.
formEvent
(
action
,
data
);
}
}
/**
* 表单事件
*
* @param {string} action
* @param {*} data
* @memberof EditView
*/
public
formEvent
(
action
:
string
,
data
:
IParam
):
void
{
if
(
Object
.
is
(
action
,
'load'
))
{
this
.
onFormLoad
(
data
);
}
if
(
Object
.
is
(
action
,
'save'
))
{
this
.
onFormSave
(
data
);
}
if
(
Object
.
is
(
action
,
'remove'
))
{
this
.
onFormRemove
(
data
);
}
}
/**
* 表单加载完成
*
* @param {*} data
* @memberof EditView
*/
public
onFormLoad
(
data
:
IParam
):
void
{
// 设置工具栏状态
const
state
:
boolean
=
!
Object
.
is
(
data
.
srfuf
,
'1'
);
this
.
setToolbarItemState
(
state
);
}
/**
* 表单保存完成
*
* @param {*} data
* @memberof EditView
*/
public
onFormSave
(
data
:
IParam
):
void
{
}
/**
* 表单删除完成
*
* @param {*} data
* @memberof EditView
*/
public
onFormRemove
(
data
:
IParam
):
void
{
}
/**
/**
* 获取表单部件
* 获取表单部件
*
*
* @return {*} {*}
* @return {*} {*}
* @memberof
Index
View
* @memberof
Edit
View
*/
*/
public
getForm
():
any
{
public
getForm
():
any
{
return
unref
(
this
.
form
);
return
unref
(
this
.
form
);
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/grid-view/grid-view.ts
浏览文件 @
5a7024f6
...
@@ -42,11 +42,11 @@ public declare state: GridViewState;
...
@@ -42,11 +42,11 @@ public declare state: GridViewState;
* @memberof MDView
* @memberof MDView
*/
*/
public
onCtrlEvent
(
actionParam
:
IActionParam
)
{
public
onCtrlEvent
(
actionParam
:
IActionParam
)
{
super
.
onCtrlEvent
(
actionParam
);
const
{
tag
,
action
,
data
}
=
actionParam
;
const
{
tag
,
action
,
data
}
=
actionParam
;
if
(
Object
.
is
(
tag
,
'grid'
))
{
if
(
Object
.
is
(
tag
,
'grid'
))
{
this
.
MDCtrlEvent
(
action
,
data
);
this
.
MDCtrlEvent
(
action
,
data
);
}
}
super
.
onCtrlEvent
(
actionParam
);
}
}
/**
/**
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/main-view/main-view.ts
浏览文件 @
5a7024f6
...
@@ -15,6 +15,32 @@ export class MainView extends ViewBase {
...
@@ -15,6 +15,32 @@ export class MainView extends ViewBase {
*/
*/
public
declare
state
:
MainViewState
;
public
declare
state
:
MainViewState
;
/**
* 设置工具栏项状态
*
* @param {boolean} state 初始化状态
* @return {*}
* @memberof MainView
*/
public
setToolbarItemState
(
state
:
boolean
)
{
if
(
!
this
.
state
.
toolbar
)
{
return
;
}
for
(
const
key
in
this
.
state
.
toolbar
)
{
if
(
!
this
.
state
.
toolbar
.
hasOwnProperty
(
key
))
{
return
;
}
const
item
=
this
.
state
.
toolbar
[
key
];
if
(
item
.
uIAction
&&
(
Object
.
is
(
item
.
uIAction
.
actionTarget
,
'SINGLEKEY'
)
||
Object
.
is
(
item
.
uIAction
.
actionTarget
,
'MULTIKEY'
)))
{
item
.
disabled
=
state
;
}
item
.
visible
=
true
;
if
(
item
.
noPrivDisplayMode
&&
Object
.
is
(
item
.
noPrivDisplayMode
,
'6'
))
{
item
.
visible
=
false
;
}
}
}
/**
/**
* @description 处理工具栏事件
* @description 处理工具栏事件
*
*
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/md-view/md-view.ts
浏览文件 @
5a7024f6
...
@@ -66,6 +66,7 @@ export class MDView extends MainView {
...
@@ -66,6 +66,7 @@ export class MDView extends MainView {
* @memberof MDView
* @memberof MDView
*/
*/
public
onCtrlEvent
(
actionParam
:
IActionParam
)
{
public
onCtrlEvent
(
actionParam
:
IActionParam
)
{
super
.
onCtrlEvent
(
actionParam
);
const
{
tag
,
action
,
data
}
=
actionParam
;
const
{
tag
,
action
,
data
}
=
actionParam
;
if
(
Object
.
is
(
tag
,
'searchform'
))
{
if
(
Object
.
is
(
tag
,
'searchform'
))
{
this
.
handleSearchFormEvent
(
action
,
data
);
this
.
handleSearchFormEvent
(
action
,
data
);
...
@@ -205,7 +206,8 @@ export class MDView extends MainView {
...
@@ -205,7 +206,8 @@ export class MDView extends MainView {
* @memberof MDView
* @memberof MDView
*/
*/
public
MDCtrlLoaded
(
args
:
any
)
{
public
MDCtrlLoaded
(
args
:
any
)
{
console
.
log
(
'数据加载完成'
,
args
);
// 设置工具栏状态
this
.
setToolbarItemState
(
true
);
}
}
/**
/**
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/form-control/form-control.ts
浏览文件 @
5a7024f6
...
@@ -447,7 +447,6 @@ export class FormControl extends MainControl {
...
@@ -447,7 +447,6 @@ export class FormControl extends MainControl {
const
load
=
async
(
opt
:
any
=
{})
=>
{
const
load
=
async
(
opt
:
any
=
{})
=>
{
try
{
try
{
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
,
controlAction
}
=
this
.
state
;
const
{
controlService
,
context
,
viewParams
,
showBusyIndicator
,
controlAction
}
=
this
.
state
;
const
{
data
}
=
toRefs
(
this
.
state
);
if
(
!
controlAction
.
loadAction
)
{
if
(
!
controlAction
.
loadAction
)
{
return
;
return
;
}
}
...
@@ -462,7 +461,8 @@ export class FormControl extends MainControl {
...
@@ -462,7 +461,8 @@ export class FormControl extends MainControl {
{
action
:
controlAction
.
loadAction
,
isLoading
:
showBusyIndicator
},
{
action
:
controlAction
.
loadAction
,
isLoading
:
showBusyIndicator
},
);
);
if
(
response
.
status
&&
response
.
status
==
200
)
{
if
(
response
.
status
&&
response
.
status
==
200
)
{
data
.
value
=
response
.
data
;
this
.
state
.
data
=
response
.
data
;
this
.
emit
(
'ctrlEvent'
,
{
tag
:
this
.
props
.
name
,
action
:
'load'
,
data
:
response
.
data
});
this
.
afterFormAction
(
'load'
);
this
.
afterFormAction
(
'load'
);
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/views/{{appModules}}/{{pages@DEEDITVIEW}}/{{pages@DEEDITVIEW}}.vue.hbs
浏览文件 @
5a7024f6
...
@@ -29,7 +29,7 @@ interface ViewEmit {
...
@@ -29,7 +29,7 @@ interface ViewEmit {
const
emit
=
defineEmits
<
ViewEmit
>
();
const
emit
=
defineEmits
<
ViewEmit
>
();
// 安装功能模块,提供状态和能力方法
// 安装功能模块,提供状态和能力方法
const
{
state
,
form
,
onToolbarEvent
}
=
new
EditView
(
viewState
,
props
,
emit
).
moduleInstall
();
const
{
state
,
form
,
onToolbarEvent
,
onCtrlEvent
}
=
new
EditView
(
viewState
,
props
,
emit
).
moduleInstall
();
</script>
</script>
...
@@ -63,6 +63,7 @@ const { state, form, onToolbarEvent } = new EditView(viewState, props, emit).mod
...
@@ -63,6 +63,7 @@ const { state, form, onToolbarEvent } = new EditView(viewState, props, emit).mod
:viewParams=
"state.viewParams"
:viewParams=
"state.viewParams"
:controlAction=
"state.
{{
name
}}
.action"
:controlAction=
"state.
{{
name
}}
.action"
:viewSubject=
"state.viewSubject"
:viewSubject=
"state.viewSubject"
@
ctrlEvent=
"onCtrlEvent"
></
{{
codeName
}}
Form>
></
{{
codeName
}}
Form>
{{/
eq
}}
{{/
eq
}}
{{/
page
.
ctrls
}}
{{/
page
.
ctrls
}}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录