Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
59fc6e29
提交
59fc6e29
编写于
2月 07, 2022
作者:
tony001
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:更新
上级
5a7024f6
变更
7
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
72 行增加
和
49 行删除
+72
-49
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
+1
-1
edit-view.ts
...pp_{{apps}}/src/core/modules/views/edit-view/edit-view.ts
+12
-10
main-view.ts
...pp_{{apps}}/src/core/modules/views/main-view/main-view.ts
+41
-1
md-view.ts
...r7/app_{{apps}}/src/core/modules/views/md-view/md-view.ts
+10
-6
view-base.ts
...pp_{{apps}}/src/core/modules/views/view-base/view-base.ts
+6
-30
form-control.ts
...s}}/src/core/modules/widgets/form-control/form-control.ts
+1
-1
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/PageModel.java
浏览文件 @
59fc6e29
...
@@ -103,6 +103,7 @@ public class PageModel extends BaseModel{
...
@@ -103,6 +103,7 @@ public class PageModel extends BaseModel{
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
());
appUIAction
.
put
(
"actionTarget"
,
UIAction
.
getActionTarget
());
appUIAction
.
put
(
"dataAccessAction"
,
UIAction
.
getDataAccessAction
());
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
浏览文件 @
59fc6e29
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
{{#
page
.
viewToolBarItems
}}
{{#
page
.
viewToolBarItems
}}
toolbar: [
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
}}
',actionTarget:'
{{
uIAction
.
actionTarget
}}
',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
}}
',
dataAccessAction:'
{{
uIAction
.
dataAccessAction
}}
',
uIActionType:'
{{
uIAction
.
uIActionType
}}
'}
{{/if}}
},
{{/
items
}}
{{/
items
}}
],
],
{{/
page
.
viewToolBarItems
}}
{{/
page
.
viewToolBarItems
}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/edit-view/edit-view.ts
浏览文件 @
59fc6e29
...
@@ -72,10 +72,10 @@ export class EditView extends MainView {
...
@@ -72,10 +72,10 @@ export class EditView extends MainView {
* 表单事件
* 表单事件
*
*
* @param {string} action
* @param {string} action
* @param {
*
} data
* @param {
IParam[]
} data
* @memberof EditView
* @memberof EditView
*/
*/
public
formEvent
(
action
:
string
,
data
:
IParam
):
void
{
public
formEvent
(
action
:
string
,
data
:
IParam
[]
):
void
{
if
(
Object
.
is
(
action
,
'load'
))
{
if
(
Object
.
is
(
action
,
'load'
))
{
this
.
onFormLoad
(
data
);
this
.
onFormLoad
(
data
);
}
}
...
@@ -90,32 +90,34 @@ export class EditView extends MainView {
...
@@ -90,32 +90,34 @@ export class EditView extends MainView {
/**
/**
* 表单加载完成
* 表单加载完成
*
*
* @param {
*
} data
* @param {
IParam[]
} data
* @memberof EditView
* @memberof EditView
*/
*/
public
onFormLoad
(
data
:
IParam
):
void
{
public
onFormLoad
(
data
:
IParam
[]):
void
{
// 抛出数据
this
.
emit
(
"onViewEvent"
,
{
tag
:
this
.
state
.
viewName
,
action
:
'viewLoad'
,
data
:
data
});
// 设置工具栏状态
// 设置工具栏状态
const
state
:
boolean
=
!
Object
.
is
(
data
.
srfuf
,
'1'
);
const
state
:
boolean
=
!
Object
.
is
(
data
[
0
]
.
srfuf
,
'1'
);
this
.
setToolbarItemState
(
state
);
this
.
setToolbarItemState
(
state
,
data
[
0
]
);
}
}
/**
/**
* 表单保存完成
* 表单保存完成
*
*
* @param {
*
} data
* @param {
IParam[]
} data
* @memberof EditView
* @memberof EditView
*/
*/
public
onFormSave
(
data
:
IParam
):
void
{
public
onFormSave
(
data
:
IParam
[]
):
void
{
}
}
/**
/**
* 表单删除完成
* 表单删除完成
*
*
* @param {
*
} data
* @param {
IParam[]
} data
* @memberof EditView
* @memberof EditView
*/
*/
public
onFormRemove
(
data
:
IParam
):
void
{
public
onFormRemove
(
data
:
IParam
[]
):
void
{
}
}
/**
/**
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/main-view/main-view.ts
浏览文件 @
59fc6e29
...
@@ -19,14 +19,17 @@ export class MainView extends ViewBase {
...
@@ -19,14 +19,17 @@ export class MainView extends ViewBase {
* 设置工具栏项状态
* 设置工具栏项状态
*
*
* @param {boolean} state 初始化状态
* @param {boolean} state 初始化状态
* @param {IParam} data 数据
* @return {*}
* @return {*}
* @memberof MainView
* @memberof MainView
*/
*/
public
setToolbarItemState
(
state
:
boolean
)
{
public
async
setToolbarItemState
(
state
:
boolean
,
data
?:
IParam
)
{
if
(
!
this
.
state
.
toolbar
)
{
if
(
!
this
.
state
.
toolbar
)
{
return
;
return
;
}
}
const
appUIService
=
await
this
.
getUIService
();
for
(
const
key
in
this
.
state
.
toolbar
)
{
for
(
const
key
in
this
.
state
.
toolbar
)
{
// 设置初始化状态
if
(
!
this
.
state
.
toolbar
.
hasOwnProperty
(
key
))
{
if
(
!
this
.
state
.
toolbar
.
hasOwnProperty
(
key
))
{
return
;
return
;
}
}
...
@@ -38,6 +41,43 @@ export class MainView extends ViewBase {
...
@@ -38,6 +41,43 @@ export class MainView extends ViewBase {
if
(
item
.
noPrivDisplayMode
&&
Object
.
is
(
item
.
noPrivDisplayMode
,
'6'
))
{
if
(
item
.
noPrivDisplayMode
&&
Object
.
is
(
item
.
noPrivDisplayMode
,
'6'
))
{
item
.
visible
=
false
;
item
.
visible
=
false
;
}
}
// 设置权限状态
if
(
item
&&
item
.
uIAction
&&
item
.
uIAction
.
dataAccessAction
)
{
let
dataActionResult
:
any
;
const
{
actionTarget
,
uIActionTag
,
dataAccessAction
}
=
item
.
uIAction
;
// 不需要数据的界面行为
if
(
item
.
uIAction
&&
(
Object
.
is
(
actionTarget
,
"NONE"
)
||
!
actionTarget
))
{
if
(
!
actionTarget
&&
Object
.
is
(
uIActionTag
,
"Save"
)
&&
appUIService
.
isEnableDEMainState
)
{
if
(
data
&&
Object
.
keys
(
data
).
length
>
0
)
{
dataActionResult
=
appUIService
.
getAllOPPrivs
(
data
,
dataAccessAction
);
}
}
else
{
dataActionResult
=
appUIService
.
getAllOPPrivs
(
undefined
,
dataAccessAction
);
}
}
else
{
if
(
data
&&
Object
.
keys
(
data
).
length
>
0
&&
appUIService
?.
isEnableDEMainState
)
{
dataActionResult
=
appUIService
.
getAllOPPrivs
(
data
,
dataAccessAction
);
}
else
{
dataActionResult
=
appUIService
.
getAllOPPrivs
(
undefined
,
dataAccessAction
);
}
}
// 无权限:0;有权限:1
if
(
dataActionResult
===
0
)
{
// 禁用:1;隐藏:2;隐藏且默认隐藏:6
if
(
item
.
noPrivDisplayMode
===
1
)
{
item
.
disabled
=
true
;
}
if
((
item
.
noPrivDisplayMode
===
2
)
||
(
item
.
noPrivDisplayMode
===
6
))
{
item
.
visible
=
false
;
}
else
{
item
.
visible
=
true
;
}
}
if
(
dataActionResult
===
1
)
{
item
.
visible
=
true
;
item
.
visible
=
false
;
}
}
}
}
}
}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/md-view/md-view.ts
浏览文件 @
59fc6e29
...
@@ -202,10 +202,12 @@ export class MDView extends MainView {
...
@@ -202,10 +202,12 @@ export class MDView extends MainView {
/**
/**
* 多数据部件加载完成
* 多数据部件加载完成
*
*
* @param {
*} args
* @param {
IParam[]} data
* @memberof MDView
* @memberof MDView
*/
*/
public
MDCtrlLoaded
(
args
:
any
)
{
public
MDCtrlLoaded
(
data
:
IParam
[])
{
// 抛出数据
this
.
emit
(
"onViewEvent"
,
{
tag
:
this
.
state
.
viewName
,
action
:
'viewLoad'
,
data
:
data
});
// 设置工具栏状态
// 设置工具栏状态
this
.
setToolbarItemState
(
true
);
this
.
setToolbarItemState
(
true
);
}
}
...
@@ -213,13 +215,15 @@ export class MDView extends MainView {
...
@@ -213,13 +215,15 @@ export class MDView extends MainView {
/**
/**
* 多数据部件选中数据
* 多数据部件选中数据
*
*
* @param {
*} args
* @param {
IParam[]} data
* @memberof MDView
* @memberof MDView
*/
*/
public
selectionChange
(
args
:
any
)
{
public
selectionChange
(
data
:
IParam
[]
)
{
// 抛出数据
// 抛出数据
this
.
emit
(
"onViewEvent"
,
{
tag
:
this
.
state
.
viewName
,
action
:
'selectionChange'
,
data
:
args
});
this
.
emit
(
"onViewEvent"
,
{
tag
:
this
.
state
.
viewName
,
action
:
'viewDataChange'
,
data
:
data
});
// 计算按钮权限 todo
// 设置工具栏状态
const
state
:
boolean
=
!
Object
.
is
(
data
[
0
]?.
srfuf
,
'1'
);
this
.
setToolbarItemState
(
state
,
data
[
0
]?.
$DO
);
}
}
/**
/**
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/view-base/view-base.ts
浏览文件 @
59fc6e29
...
@@ -41,22 +41,6 @@ export class ViewBase {
...
@@ -41,22 +41,6 @@ export class ViewBase {
*/
*/
public
declare
xDataControl
:
IParam
;
public
declare
xDataControl
:
IParam
;
/**
* 界面行为服务
*
* @type {(IParam | undefined)}
* @memberof ViewBase
*/
public
appUIService
:
IParam
|
undefined
;
/**
* 数据服务
*
* @type {(IParam | undefined)}
* @memberof ViewBase
*/
public
appDataService
:
IParam
|
undefined
;
/**
/**
* Creates an instance of ViewBase.
* Creates an instance of ViewBase.
* @param {*} options 配置参数
* @param {*} options 配置参数
...
@@ -184,30 +168,26 @@ export class ViewBase {
...
@@ -184,30 +168,26 @@ export class ViewBase {
}
}
/**
/**
*@description
使用
UI服务
*@description
获取
UI服务
*
*
* @memberof ViewBase
* @memberof ViewBase
*/
*/
public
use
UIService
()
{
public
async
get
UIService
()
{
const
{
appEntityCodeName
,
context
}
=
this
.
state
;
const
{
appEntityCodeName
,
context
}
=
this
.
state
;
if
(
appEntityCodeName
)
{
if
(
appEntityCodeName
)
{
App
.
getUIService
(
appEntityCodeName
.
toLowerCase
(),
context
).
then
((
service
:
IParam
)
=>
{
return
await
App
.
getUIService
(
appEntityCodeName
.
toLowerCase
(),
context
);
this
.
appUIService
=
service
;
})
}
}
}
}
/**
/**
*@description
使用
数据服务
*@description
获取
数据服务
*
*
* @memberof ViewBase
* @memberof ViewBase
*/
*/
public
use
DataService
()
{
public
async
get
DataService
()
{
const
{
appEntityCodeName
,
context
}
=
this
.
state
;
const
{
appEntityCodeName
,
context
}
=
this
.
state
;
if
(
appEntityCodeName
)
{
if
(
appEntityCodeName
)
{
App
.
getDataService
(
appEntityCodeName
.
toLowerCase
(),
context
).
then
((
service
:
IParam
)
=>
{
return
await
App
.
getDataService
(
appEntityCodeName
.
toLowerCase
(),
context
)
this
.
appDataService
=
service
;
})
}
}
}
}
...
@@ -243,10 +223,6 @@ export class ViewBase {
...
@@ -243,10 +223,6 @@ export class ViewBase {
this
.
useViewContextParams
();
this
.
useViewContextParams
();
// 使用计数器服务
// 使用计数器服务
this
.
useCounterService
();
this
.
useCounterService
();
// 使用数据服务
this
.
useDataService
();
// 使用UI服务
this
.
useUIService
();
// 处理视图初始化
// 处理视图初始化
this
.
useViewInit
();
this
.
useViewInit
();
return
{
return
{
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/form-control/form-control.ts
浏览文件 @
59fc6e29
...
@@ -462,7 +462,7 @@ export class FormControl extends MainControl {
...
@@ -462,7 +462,7 @@ export class FormControl extends MainControl {
);
);
if
(
response
.
status
&&
response
.
status
==
200
)
{
if
(
response
.
status
&&
response
.
status
==
200
)
{
this
.
state
.
data
=
response
.
data
;
this
.
state
.
data
=
response
.
data
;
this
.
emit
(
'ctrlEvent'
,
{
tag
:
this
.
props
.
name
,
action
:
'load'
,
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
)
{
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录