Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
c976694e
提交
c976694e
编写于
1月 12, 2022
作者:
tony001
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:更新模板
上级
7b60c857
变更
34
显示空白字符变更
内嵌
并排
正在显示
34 个修改的文件
包含
666 行增加
和
359 行删除
+666
-359
ModelStorage.java
.../src/main/java/cn/ibizlab/codegen/model/ModelStorage.java
+33
-32
include-view-control.hbs
...r7/@macro/front-end/views/config/include-view-control.hbs
+0
-4
include-view-control.hbs
.../templ/r7/@macro/front-end/views/include-view-control.hbs
+4
-0
view-base-config.hbs
...rces/templ/r7/@macro/front-end/views/view-base-config.hbs
+4
-3
view-control-form.hbs
...nt-end/views/view-control/view-form/view-control-form.hbs
+9
-0
view-control-grid.hbs
...nt-end/views/view-control/view-grid/view-control-grid.hbs
+0
-0
view-control-menu.hbs
...nt-end/views/view-control/view-menu/view-control-menu.hbs
+0
-0
view-control-form.hbs
...r7/@macro/front-end/views/view-form/view-control-form.hbs
+0
-7
i-app-action-service.ts
...apps}}/src/core/interface/service/i-app-action-service.ts
+19
-0
index.ts
...templ/r7/app_{{apps}}/src/core/interface/service/index.ts
+1
-0
app-action-service.ts
...p_{{apps}}/src/core/logic/app-logic/app-action-service.ts
+45
-0
app-global-action-service.ts
...s}}/src/core/logic/app-logic/app-global-action-service.ts
+0
-98
index.ts
...s/templ/r7/app_{{apps}}/src/core/logic/app-logic/index.ts
+1
-1
app-action-base.ts
..._{{apps}}/src/core/logic/app-ui-action/app-action-base.ts
+2
-3
app-front-action.ts
...{{apps}}/src/core/logic/app-ui-action/app-front-action.ts
+0
-2
app-sys-action.ts
...p_{{apps}}/src/core/logic/app-ui-action/app-sys-action.ts
+53
-4
app-ui-action.ts
...pp_{{apps}}/src/core/logic/app-ui-action/app-ui-action.ts
+0
-30
index.ts
...mpl/r7/app_{{apps}}/src/core/logic/app-ui-action/index.ts
+2
-2
grid-view.ts
...pp_{{apps}}/src/core/modules/views/grid-view/grid-view.ts
+47
-11
index-view.ts
..._{{apps}}/src/core/modules/views/index-view/index-view.ts
+5
-4
main-view.ts
...pp_{{apps}}/src/core/modules/views/main-view/main-view.ts
+32
-33
md-view.ts
...r7/app_{{apps}}/src/core/modules/views/md-view/md-view.ts
+243
-1
view-base.ts
...pp_{{apps}}/src/core/modules/views/view-base/view-base.ts
+97
-25
view-state-base.ts
...pps}}/src/core/modules/views/view-base/view-state-base.ts
+0
-37
{{pages@APPINDEXVIEW}}-config.ts.hbs
...pages@APPINDEXVIEW}}/{{pages@APPINDEXVIEW}}-config.ts.hbs
+1
-1
{{pages@DEEDITVIEW}}-config.ts.hbs
...}/{{pages@DEEDITVIEW}}/{{pages@DEEDITVIEW}}-config.ts.hbs
+1
-1
{{pages@DEEDITVIEW}}.vue.hbs
...dules}}/{{pages@DEEDITVIEW}}/{{pages@DEEDITVIEW}}.vue.hbs
+1
-1
{{pages@DEGRIDVIEW}}-config.ts.hbs
...}/{{pages@DEGRIDVIEW}}/{{pages@DEGRIDVIEW}}-config.ts.hbs
+1
-1
{{pages@DEGRIDVIEW}}.vue.hbs
...dules}}/{{pages@DEGRIDVIEW}}/{{pages@DEGRIDVIEW}}.vue.hbs
+2
-1
{{pages@DEPICKUPGRIDVIEW}}-config.ts.hbs
...PICKUPGRIDVIEW}}/{{pages@DEPICKUPGRIDVIEW}}-config.ts.hbs
+1
-1
{{pages@DEPICKUPVIEW}}-config.ts.hbs
...pages@DEPICKUPVIEW}}/{{pages@DEPICKUPVIEW}}-config.ts.hbs
+1
-1
{{pages@DETREEEXPVIEW}}-config.ts.hbs
...ges@DETREEEXPVIEW}}/{{pages@DETREEEXPVIEW}}-config.ts.hbs
+1
-1
{{ctrls@GRID}}-grid.vue.hbs
...ntities}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid.vue.hbs
+45
-54
yarn.lock
...r-core/src/main/resources/templ/r7/app_{{apps}}/yarn.lock
+15
-0
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/ModelStorage.java
浏览文件 @
c976694e
...
...
@@ -102,38 +102,39 @@ public class ModelStorage {
if
(!
templateData
.
containsKey
(
type
))
{
CliData
rt
=
new
CliData
();
if
(
type
.
equals
(
TemplateFileType
.
api
))
{
getSystemModel
().
getApis
().
forEach
(
item
->{
CliOption
opt
=
newCliOption
(
TemplateFileType
.
api
).
baseData
(
item
,
item
.
getCodeName
().
toLowerCase
());
rt
.
addOption
(
opt
);
});
}
else
if
(
type
.
equals
(
TemplateFileType
.
apiEntity
))
{
getSystemModel
().
getApis
().
forEach
(
api
->{
api
.
getApiEntities
().
forEach
(
item
->{
CliOption
opt
=
newCliOption
(
TemplateFileType
.
apiEntity
).
baseData
(
item
,
item
.
getCodeName
().
toString
()).
set
(
"apis"
,
api
.
getCodeName
().
toLowerCase
());
rt
.
addOption
(
opt
);
});
});
}
else
if
(
type
.
equals
(
TemplateFileType
.
apiDto
))
{
getSystemModel
().
getApis
().
forEach
(
api
->
{
api
.
getApiEntities
().
forEach
(
item
->
{
item
.
getDtos
().
forEach
(
dto
->
{
CliOption
opt
=
newCliOption
(
TemplateFileType
.
apiDto
)
.
setCliSubType
(
dto
.
getType
())
.
baseData
(
dto
,
dto
.
getCodeName
())
.
set
(
"apiDtos"
,
dto
.
getCodeName
()).
set
(
"apis"
,
dto
.
getApi
().
getCodeName
().
toLowerCase
());
rt
.
addOption
(
opt
);
});
});
});
}
else
if
(
type
.
equals
(
TemplateFileType
.
app
))
// if(type.equals(TemplateFileType.api))
// {
//
// getSystemModel().getApis().forEach(item->{
// CliOption opt=newCliOption(TemplateFileType.api).baseData(item,item.getCodeName().toLowerCase());
// rt.addOption(opt);
// });
//
// }
// else if(type.equals(TemplateFileType.apiEntity))
// {
// getSystemModel().getApis().forEach(api->{
// api.getApiEntities().forEach(item->{
// CliOption opt=newCliOption(TemplateFileType.apiEntity).baseData(item,item.getCodeName().toString()).set("apis",api.getCodeName().toLowerCase());
// rt.addOption(opt);
// });
// });
// }
// else if (type.equals(TemplateFileType.apiDto)) {
// getSystemModel().getApis().forEach(api -> {
// api.getApiEntities().forEach(item -> {
// item.getDtos().forEach(dto -> {
// CliOption opt = newCliOption(TemplateFileType.apiDto)
// .setCliSubType(dto.getType())
// .baseData(dto, dto.getCodeName())
// .set("apiDtos",dto.getCodeName()).set("apis",dto.getApi().getCodeName().toLowerCase());
// rt.addOption(opt);
// });
// });
// });
// }
// else if(type.equals(TemplateFileType.app))
if
(
type
.
equals
(
TemplateFileType
.
app
))
{
getSystemModel
().
getApps
().
forEach
(
item
->{
CliOption
opt
=
newCliOption
(
TemplateFileType
.
app
).
baseData
(
item
,
item
.
getCodeName
().
toLowerCase
());
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/views/config/include-view-control.hbs
已删除
100644 → 0
浏览文件 @
7b60c857
{{#
*
inline
"FORM"
}}{{>
@macro
/
front-end
/
views
/
view-form
/
view-control-form
.
hbs
}}{{/
inline
}}
{{#
*
inline
"SEARCHFORM"
}}{{>
@macro
/
front-end
/
views
/
view-form
/
view-control-form
.
hbs
}}{{/
inline
}}
{{#
*
inline
"GRID"
}}{{>
@macro
/
front-end
/
views
/
view-grid
/
view-control-grid
.
hbs
}}{{/
inline
}}
{{#
*
inline
"APPMENU"
}}{{>
@macro
/
front-end
/
views
/
view-menu
/
view-control-menu
.
hbs
}}{{/
inline
}}
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/views/include-view-control.hbs
0 → 100644
浏览文件 @
c976694e
{{#
*
inline
"FORM"
}}{{>
@macro
/
front-end
/
views
/
view-control
/
view-form
/
view-control-form
.
hbs
}}{{/
inline
}}
{{#
*
inline
"SEARCHFORM"
}}{{>
@macro
/
front-end
/
views
/
view-control
/
view-form
/
view-control-form
.
hbs
}}{{/
inline
}}
{{#
*
inline
"GRID"
}}{{>
@macro
/
front-end
/
views
/
view-control
/
view-grid
/
view-control-grid
.
hbs
}}{{/
inline
}}
{{#
*
inline
"APPMENU"
}}{{>
@macro
/
front-end
/
views
/
view-control
/
view-menu
/
view-control-menu
.
hbs
}}{{/
inline
}}
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/views/
config/
view-base-config.hbs
→
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/views/view-base-config.hbs
浏览文件 @
c976694e
{{>
@macro
/
front-end
/
views
/
config
/
include-view-control
}}
{{>
@macro
/
front-end
/
views
/
include-view-control
}}
viewCodeName: '
{{
page
.
codeName
}}
',
viewName: '
{{
page
.
name
}}
',
viewCaption: '
{{
page
.
caption
}}
',
height: '
{{
page
.
height
}}
',
width: '
{{
page
.
width
}}
',
appEntityName:'
{{
page
.
appEntity
.
codeName
}}
',
appEntityName: '
{{
page
.
appEntity
.
codeName
}}
',
isLoadDefault: true,
{{!-- viewMsgGroup: '{{page.psAppViewMsgGroup}}', --}}
{{!-- viewUIActions: '{{page.psAppViewUIActions}}', --}}
viewSysCss: '
{{
page
.
psSysCss
}}
',
...
...
@@ -14,7 +15,7 @@
viewStyle: '
{{
page
.
viewStyle
}}
',
showCaptionBar: '
{{
page
.
viewStyle
}}
',
xDataControlName:'
{{
page
.
xDataControlName
}}
',
openDataViewName:'ExampleEditorEditView',
openDataViewName:
'ExampleEditorEditView',
appViewNavContexts:
{{>
@macro
/
front-end
/
common
/
navparam
.
hbs
appNavParams
=
page
.
psAppViewNavContexts
}}
,
appViewNavParams:
{{>
@macro
/
front-end
/
common
/
navparam
.
hbs
appNavParams
=
page
.
getPSAppViewNavParams
}}
,
toolbar: [
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/views/view-control/view-form/view-control-form.hbs
0 → 100644
浏览文件 @
c976694e
{{
name
}}
:{
action:{
loadAction: '
{{
ctrl
.
getPSControlAction
.
psAppDEMethod
.
codeName
}}
',
removeAction: '
{{
ctrl
.
removePSControlAction
.
psAppDEMethod
.
codeName
}}
',
updateAction: '
{{
ctrl
.
updatePSControlAction
.
psAppDEMethod
.
codeName
}}
',
loadDraftAction: '
{{
ctrl
.
getDraftPSControlAction
.
psAppDEMethod
.
codeName
}}
',
createAction: '
{{
ctrl
.
createPSControlAction
.
psAppDEMethod
.
codeName
}}
'
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/views/view-grid/view-control-grid.hbs
→
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/views/view-
control/view-
grid/view-control-grid.hbs
浏览文件 @
c976694e
文件已移动
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/views/view-menu/view-control-menu.hbs
→
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/views/view-
control/view-
menu/view-control-menu.hbs
浏览文件 @
c976694e
文件已移动
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/views/view-form/view-control-form.hbs
已删除
100644 → 0
浏览文件 @
7b60c857
{{
name
}}
:{
loadAction: '
{{
ctrl
.
getPSControlAction
.
psAppDEMethod
.
codeName
}}
',
removeAction: '
{{
ctrl
.
removePSControlAction
.
psAppDEMethod
.
codeName
}}
',
updateAction: '
{{
ctrl
.
updatePSControlAction
.
psAppDEMethod
.
codeName
}}
',
loadDraftAction: '
{{
ctrl
.
getDraftPSControlAction
.
psAppDEMethod
.
codeName
}}
',
createAction: '
{{
ctrl
.
createPSControlAction
.
psAppDEMethod
.
codeName
}}
'
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/interface/service/i-app-action-service.ts
0 → 100644
浏览文件 @
c976694e
import
{
IContext
,
IParam
}
from
"../common"
;
/**
* @description 界面行为服务
* @export
* @interface IAppActionService
*/
export
interface
IAppActionService
{
/**
* 执行界面行为
*
* @param uiAction 界面行为信息
* @param params 运行参数 { context: 上下文对象, viewParams: 视图参数, data: 当前激活数据, event: 事件源对象, actionEnvironment:操作环境}
* @memberof IAppActionService
*/
execute
(
uiAction
:
IParam
,
params
:
{
context
:
IContext
,
viewParams
:
IParam
,
data
:
IParam
,
event
:
MouseEvent
,
actionEnvironment
:
IParam
}):
void
;
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/interface/service/index.ts
浏览文件 @
c976694e
export
*
from
'./i-app-func-service'
;
export
*
from
'./i-app-action-service'
;
export
*
from
'./i-open-view-service'
;
export
*
from
'./i-data-service-register'
;
export
*
from
'./i-ui-service-register'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/logic/app-logic/app-action-service.ts
0 → 100644
浏览文件 @
c976694e
import
{
hasFunction
}
from
"@core"
;
import
{
IParam
,
IContext
,
IAppActionService
}
from
"@core/interface"
;
import
{
AppSysAction
}
from
"../app-ui-action/app-sys-action"
;
export
class
AppActionService
implements
IAppActionService
{
/**
* @description 唯一实例
* @private
* @static
* @memberof AppActionService
*/
private
static
readonly
instance
=
new
AppActionService
();
/**
* @description 获取唯一实例
* @static
* @return {*} {AppActionService}
* @memberof AppActionService
*/
public
static
getInstance
():
AppActionService
{
return
AppActionService
.
instance
;
}
/**
* 执行界面行为
*
* @param uiAction 界面行为信息
* @param params 运行参数 { context: 上下文对象, viewParams: 视图参数, data: 当前激活数据, event: 事件源对象, actionEnvironment:操作环境}
*/
public
execute
(
uiAction
:
IParam
,
params
:
{
context
:
IContext
,
viewParams
:
IParam
,
data
:
IParam
,
event
:
MouseEvent
,
actionEnvironment
:
IParam
})
{
const
{
uIActionTag
}
=
uiAction
;
if
(
uiAction
.
uIActionMode
==
'SYS'
)
{
AppSysAction
.
execute
(
uiAction
,
params
);
}
else
{
const
{
actionEnvironment
}
=
params
;
if
(
actionEnvironment
&&
actionEnvironment
.
appUIService
&&
hasFunction
(
actionEnvironment
.
appUIService
,
uIActionTag
))
{
actionEnvironment
.
appUIService
[
uIActionTag
](
uiAction
,
params
);
}
else
{
console
.
warn
(
"非(前台界面行为、后台界面行为、系统预置界面行为)暂未支持"
);
}
}
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/logic/app-logic/app-global-action-service.ts
已删除
100644 → 0
浏览文件 @
7b60c857
import
{
IContext
,
IParam
,
ViewUtil
}
from
"@core"
;
/**
* 全局界面行为服务
*
* @export
* @class AppGlobalActionService
*/
export
class
AppGlobalActionService
{
/**
* 单例变量声明
*
* @private
* @static
* @type {AppGlobalActionService}
* @memberof AppGlobalActionService
*/
private
static
AppGlobalActionService
:
AppGlobalActionService
;
/**
* 获取 AppGlobalActionService 单例对象
*
* @static
* @returns {AppGlobalActionService}
* @memberof AppGlobalActionService
*/
public
static
getInstance
():
AppGlobalActionService
{
if
(
!
AppGlobalActionService
.
AppGlobalActionService
)
{
AppGlobalActionService
.
AppGlobalActionService
=
new
AppGlobalActionService
();
}
return
this
.
AppGlobalActionService
;
}
/**
* 执行全局界面行为
*
* @param {IParam} uiAction
* @param { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment: IParam } params
* @memberof AppGlobalActionService
*/
public
executeGlobalAction
(
uiAction
:
IParam
,
params
:
{
context
:
IContext
,
viewParams
:
IParam
,
data
:
IParam
,
event
:
MouseEvent
,
actionEnvironment
:
IParam
})
{
const
tag
=
uiAction
.
uIActionTag
;
switch
(
tag
)
{
case
"Edit"
:
this
.
Edit
(
params
);
break
;
case
"New"
:
this
.
New
(
params
);
break
;
default
:
console
.
log
(
`未支持
${
tag
}
`
);
}
}
/**
* 编辑
*
* @param { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment: IParam } params
* @return {*}
* @memberof AppGlobalActionService
*/
public
Edit
(
params
:
{
context
:
IContext
,
viewParams
:
IParam
,
data
:
IParam
,
event
:
MouseEvent
,
actionEnvironment
:
IParam
})
{
const
{
actionEnvironment
}
=
params
if
(
!
actionEnvironment
?.
viewState
?.
editDataViewName
)
{
return
;
}
const
viewName
=
actionEnvironment
?.
viewState
?.
editDataViewName
;
const
view
=
App
.
getViewInfo
(
viewName
);
if
(
!
view
)
{
return
;
}
ViewUtil
.
openData
(
view
,
params
);
}
/**
* 新建
*
* @param { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment: IParam } params
* @return {*}
* @memberof AppGlobalActionService
*/
public
New
(
params
:
{
context
:
IContext
,
viewParams
:
IParam
,
data
:
IParam
,
event
:
MouseEvent
,
actionEnvironment
:
IParam
})
{
const
{
actionEnvironment
}
=
params
if
(
!
actionEnvironment
?.
viewState
?.
openDataViewName
)
{
return
;
}
const
viewName
=
actionEnvironment
?.
viewState
?.
openDataViewName
;
const
view
=
App
.
getViewInfo
(
viewName
);
if
(
!
view
)
{
return
;
}
ViewUtil
.
newData
(
view
,
params
);
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/logic/app-logic/index.ts
浏览文件 @
c976694e
export
*
from
'./app-func-service'
;
export
*
from
'./app-global-action-service'
;
\ No newline at end of file
export
*
from
'./app-action-service'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/logic/app-ui-action/app-action-base.ts
浏览文件 @
c976694e
import
{
IContext
,
IParam
}
from
"@core"
;
import
{
AppUIAction
}
from
"."
;
import
{
AppActionService
,
IContext
,
IParam
}
from
"@core"
;
export
interface
ActionParams
{
/**
...
...
@@ -147,7 +146,7 @@ export class AppActionBase {
return
;
}
// 参数合并 todo
App
UIAction
.
execute
(
actionModel
,
params
);
App
ActionService
.
getInstance
()
.
execute
(
actionModel
,
params
);
}
/**
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/logic/app-ui-action/app-front-action.ts
浏览文件 @
c976694e
...
...
@@ -9,8 +9,6 @@ import { ActionParams, AppActionBase, UIActionResult } from "./app-action-base";
*/
export
class
AppFrontAction
extends
AppActionBase
{
/**
* 打开视图
*
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/logic/app-ui-action/app-sys-action.ts
浏览文件 @
c976694e
import
{
AppGlobalActionService
,
IContext
,
IParam
}
from
"@core"
;
import
{
IContext
,
IParam
,
ViewUtil
}
from
"@core"
;
/**
* 系统预置界面行为
...
...
@@ -14,10 +14,59 @@ export class AppSysAction {
* @static
* @param {IParam} uiAction 界面行为对象
* @param { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment:IParam} params { context: 上下文对象, viewParams: 视图参数, data: 当前激活数据, event: 事件源对象, actionEnvironment:操作环境}
* @memberof App
Backend
Action
* @memberof App
Sys
Action
*/
public
static
async
execute
(
uiAction
:
IParam
,
params
:
{
context
:
IContext
,
viewParams
:
IParam
,
data
:
IParam
,
event
:
MouseEvent
,
actionEnvironment
:
IParam
})
{
console
.
log
(
uiAction
,
params
);
AppGlobalActionService
.
getInstance
().
executeGlobalAction
(
uiAction
,
params
)
const
tag
=
uiAction
.
uIActionTag
;
switch
(
tag
)
{
case
"Edit"
:
this
.
Edit
(
params
);
break
;
case
"New"
:
this
.
New
(
params
);
break
;
default
:
console
.
log
(
`未支持
${
tag
}
`
);
}
}
/**
* 编辑
*
* @param { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment: IParam } params
* @return {*}
* @memberof AppSysAction
*/
public
static
Edit
(
params
:
{
context
:
IContext
,
viewParams
:
IParam
,
data
:
IParam
,
event
:
MouseEvent
,
actionEnvironment
:
IParam
})
{
const
{
actionEnvironment
}
=
params
if
(
!
actionEnvironment
?.
viewState
?.
editDataViewName
)
{
return
;
}
const
viewName
=
actionEnvironment
?.
viewState
?.
editDataViewName
;
const
view
=
App
.
getViewInfo
(
viewName
);
if
(
!
view
)
{
return
;
}
ViewUtil
.
openData
(
view
,
params
);
}
/**
* 新建
*
* @param { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment: IParam } params
* @return {*}
* @memberof AppGlobalActionService
*/
public
static
New
(
params
:
{
context
:
IContext
,
viewParams
:
IParam
,
data
:
IParam
,
event
:
MouseEvent
,
actionEnvironment
:
IParam
})
{
const
{
actionEnvironment
}
=
params
if
(
!
actionEnvironment
?.
viewState
?.
openDataViewName
)
{
return
;
}
const
viewName
=
actionEnvironment
?.
viewState
?.
openDataViewName
;
const
view
=
App
.
getViewInfo
(
viewName
);
if
(
!
view
)
{
return
;
}
ViewUtil
.
newData
(
view
,
params
);
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/logic/app-ui-action/app-ui-action.ts
已删除
100644 → 0
浏览文件 @
7b60c857
import
{
IContext
,
IParam
}
from
'@core'
;
import
{
AppBackendAction
}
from
'./app-backend-action'
;
import
{
AppFrontAction
}
from
'./app-front-action'
;
import
{
AppSysAction
}
from
'./app-sys-action'
;
/**
* 界面行为功能执行
*
* @export
* @class AppUIAction
*/
export
class
AppUIAction
{
/**
* 执行界面行为
*
* @param uiAction 界面行为信息
* @param params 运行参数 { context: 上下文对象, viewParams: 视图参数, data: 当前激活数据, event: 事件源对象, actionEnvironment:操作环境}
*/
public
static
execute
(
uiAction
:
IParam
,
params
:
{
context
:
IContext
,
viewParams
:
IParam
,
data
:
IParam
,
event
:
MouseEvent
,
actionEnvironment
:
IParam
}){
if
(
uiAction
.
uIActionMode
==
'FRONT'
){
AppFrontAction
.
execute
(
uiAction
,
params
);
}
else
if
(
uiAction
.
uIActionMode
==
'BACKEND'
){
AppBackendAction
.
execute
(
uiAction
,
params
);
}
else
if
(
uiAction
.
uIActionMode
==
'SYS'
){
AppSysAction
.
execute
(
uiAction
,
params
);
}
else
{
console
.
warn
(
"非(前台界面行为、后台界面行为、系统预置界面行为)暂未支持"
);
}
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/logic/app-ui-action/index.ts
浏览文件 @
c976694e
export
*
from
'./app-ui-action'
;
export
*
from
'./app-front-action'
;
export
*
from
'./app-backend-action'
;
export
*
from
'./app-sys-action'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/grid-view/grid-view.ts
浏览文件 @
c976694e
import
{
GridViewProps
,
GridViewState
,
MDView
}
from
'@core'
;
import
{
GridViewProps
,
GridViewState
,
IActionParam
,
IParam
,
MDView
}
from
'@core'
;
/**
* @description 表格视图
...
...
@@ -16,15 +16,52 @@ export class GridView extends MDView {
public
declare
viewState
:
GridViewState
;
/**
* @description 使用加载功能模块
* @param {GridViewProps} props 传入的props
* 当前视图表格部件
*
* @type {IParam}
* @memberof GridView
*/
public
useLoad
(
props
:
GridViewProps
){
const
{
viewSubject
}
=
this
.
viewState
;
onMounted
(()
=>
{
viewSubject
.
next
({
tag
:
'grid'
,
action
:
"load"
,
data
:
{}})
})
public
declare
grid
:
IParam
;
/**
* @description 处理视图初始化
*
* @param {GridViewProps} props
* @param {Function} emit
* @memberof GridView
*/
public
useViewInit
(
props
:
GridViewProps
,
emit
:
Function
)
{
super
.
useViewInit
(
props
,
emit
);
// 初始化搜索表格引用
this
.
grid
=
ref
(
null
);
}
/**
* 处理部件事件
*
* @param {IActionParam} actionParam
* @memberof MDView
*/
public
handleCtrlEvent
(
actionParam
:
IActionParam
)
{
const
{
tag
,
action
,
data
}
=
actionParam
;
if
(
Object
.
is
(
tag
,
'grid'
))
{
this
.
MDCtrlEvent
(
action
,
data
);
}
super
.
handleCtrlEvent
(
actionParam
);
}
/**
* 获取多数据部件
*
* @return {*} {*}
* @memberof GridView
*/
public
getMDCtrl
():
any
{
if
(
this
.
grid
.
value
)
{
return
this
.
grid
.
value
;
}
else
{
return
null
;
}
}
/**
...
...
@@ -34,12 +71,11 @@ export class GridView extends MDView {
* @return {*}
* @memberof GridView
*/
public
moduleInstall
(
props
:
GridViewProps
,
emit
?
:
Function
)
{
public
moduleInstall
(
props
:
GridViewProps
,
emit
:
Function
)
{
const
superParams
=
super
.
moduleInstall
(
props
,
emit
);
this
.
useLoad
(
props
);
return
{
...
superParams
,
state
:
this
.
viewState
,
grid
:
this
.
grid
};
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/index-view/index-view.ts
浏览文件 @
c976694e
import
{
IndexViewProps
,
IndexViewState
,
ViewBase
}
from
'@core'
;
import
{
onMounted
}
from
'vue'
;
/**
* @description 首页视图
...
...
@@ -16,10 +17,10 @@ export class IndexView extends ViewBase {
* 使用加载功能模块
* @param props 传入的props
*/
public
useLoad
(
props
:
IndexViewProps
){
public
useLoad
(
props
:
IndexViewProps
)
{
const
{
viewSubject
}
=
this
.
viewState
;
onMounted
(()
=>
{
viewSubject
.
next
({
tag
:
'appmenu'
,
action
:
"load"
,
data
:
{}
})
onMounted
(()
=>
{
viewSubject
.
next
({
tag
:
'appmenu'
,
action
:
"load"
,
data
:
{}
})
})
}
...
...
@@ -28,7 +29,7 @@ export class IndexView extends ViewBase {
* @param props 传入的Props
* @param [emit] 事件
*/
public
moduleInstall
(
props
:
IndexViewProps
,
emit
?
:
Function
)
{
public
moduleInstall
(
props
:
IndexViewProps
,
emit
:
Function
)
{
const
superParams
=
super
.
moduleInstall
(
props
,
emit
);
this
.
useLoad
(
props
);
return
{
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/main-view/main-view.ts
浏览文件 @
c976694e
import
{
ViewBase
,
MainViewProps
,
MainViewState
,
IActionParam
,
IParam
,
App
UIAction
}
from
'@core'
;
import
{
ViewBase
,
MainViewProps
,
MainViewState
,
IActionParam
,
IParam
,
App
ActionService
}
from
'@core'
;
/**
* 实体
部件
* 实体
视图
* @export
* @class ViewBase
*/
...
...
@@ -20,30 +20,30 @@ export class MainView extends ViewBase {
public
declare
xDataControl
:
IParam
;
/**
* 根据props调整设置部件state
* @param props 传入的Props
* @description 根据props调整设置视图状态变量
*
* @param {ViewPropsBase} props 传入的Props
* @param {Function} emit 事件
* @memberof MainView
*/
public
setState
(
props
:
MainViewProps
)
{
super
.
setState
(
props
);
this
.
xDataControl
=
ref
(
null
);
protected
handleState
(
props
:
MainViewProps
,
emit
:
Function
)
{
super
.
handleState
(
props
,
emit
);
}
/**
* 打开编辑视图功能模块
* @todo
* @param props
*/
public
useOpenData
(
props
:
MainViewProps
)
{
}
/**
* 打开新建视图功能模块
* @todo
* @param props
* @description 处理视图初始化
*
* @param {MainViewProps} props
* @param {Function} emit
* @memberof MainView
*/
public
useNewData
(
props
:
MainViewProps
)
{
}
public
useViewInit
(
props
:
MainViewProps
,
emit
:
Function
)
{
super
.
useViewInit
(
props
,
emit
);
}
/**
* @description 处理工具栏事件
*
* @param {IActionParam} actionParam
* @memberof MainView
*/
...
...
@@ -67,29 +67,28 @@ export class MainView extends ViewBase {
actionEnvironment
:
this
};
// 执行行为
App
UIAction
.
execute
(
uIAction
,
inputParam
);
App
ActionService
.
getInstance
()
.
execute
(
uIAction
,
inputParam
);
}
public
handleCtrlEvent
(
actionParam
:
IActionParam
)
{
const
{
tag
,
action
,
data
}
=
actionParam
;
// TODO
console
.
log
(
tag
,
action
,
data
);
}
/**
* 处理部件事件
*
* @param {IActionParam} actionParam
* @memberof MainView
*/
public
handleCtrlEvent
(
actionParam
:
IActionParam
)
{
}
/**
* 安装部件所有功能模块的方法
* @param props 传入的Props
* @param [emit] 事件
* @description 安装视图所有功能模块的方法
*
* @param {ViewPropsBase} props 传入的Props
* @param {Function} emit 事件
* @memberof MainView
*/
public
moduleInstall
(
props
:
MainViewProps
,
emit
?
:
Function
)
{
public
moduleInstall
(
props
:
MainViewProps
,
emit
:
Function
)
{
const
superParams
=
super
.
moduleInstall
(
props
,
emit
);
const
handleToolbarEvent
=
this
.
handleToolbarEvent
.
bind
(
this
);
this
.
handleToolbarEvent
=
(
actionParam
:
IActionParam
)
=>
{
handleToolbarEvent
(
actionParam
)
}
return
{
...
superParams
,
state
:
this
.
viewState
,
xDataControl
:
this
.
xDataControl
,
handleToolbarEvent
:
this
.
handleToolbarEvent
.
bind
(
this
),
handleCtrlEvent
:
this
.
handleCtrlEvent
.
bind
(
this
),
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/md-view/md-view.ts
浏览文件 @
c976694e
import
{
MainView
,
MDViewState
}
from
'@core'
;
import
{
IActionParam
,
IParam
,
MainView
,
MDViewProps
,
MDViewState
}
from
'@core'
;
/**
* 多数据视图
...
...
@@ -13,4 +13,246 @@ export class MDView extends MainView {
*/
public
declare
viewState
:
MDViewState
;
/**
* 当前视图搜索表单部件
*
* @type {IParam}
* @memberof MDView
*/
public
declare
searchForm
:
IParam
;
/**
* 当前视图搜索栏部件
*
* @type {IParam}
* @memberof MDView
*/
public
declare
searchBar
:
IParam
;
/**
* @description 处理视图初始化
*
* @param {MainViewProps} props
* @param {Function} emit
* @memberof MDView
*/
public
useViewInit
(
props
:
MDViewProps
,
emit
:
Function
)
{
super
.
useViewInit
(
props
,
emit
);
// 初始化搜索表单引用
this
.
searchForm
=
ref
(
null
);
// 初始化搜索栏引用
this
.
searchBar
=
ref
(
null
);
onMounted
(()
=>
{
// 初始化数据能力部件
this
.
xDataControl
=
this
.
getMDCtrl
();
const
{
isLoadDefault
}
=
this
.
viewState
;
if
(
this
.
getSearchForm
()
&&
isLoadDefault
)
{
const
tag
=
this
.
getSearchForm
().
name
;
this
.
next
({
tag
:
tag
,
action
:
'loaddraft'
,
data
:
null
});
}
else
if
(
this
.
getMDCtrl
()
&&
isLoadDefault
)
{
const
tag
=
this
.
getMDCtrl
().
name
;
this
.
next
({
tag
:
tag
,
action
:
'load'
,
data
:
null
});
}
else
{
this
.
viewState
.
isLoadDefault
=
true
;
}
})
}
/**
* 处理部件事件
*
* @param {IActionParam} actionParam
* @memberof MDView
*/
public
handleCtrlEvent
(
actionParam
:
IActionParam
)
{
const
{
tag
,
action
,
data
}
=
actionParam
;
if
(
Object
.
is
(
tag
,
'searchform'
))
{
this
.
searchFormEvent
(
action
,
data
);
}
}
/**
* 搜索表单事件
*
* @param {string} eventName
* @param {*} [args={}]
* @memberof MDView
*/
public
searchFormEvent
(
eventName
:
string
,
args
:
any
=
{}):
void
{
if
(
Object
.
is
(
eventName
,
'load'
))
{
this
.
onSearchFormLoad
(
args
);
}
if
(
Object
.
is
(
eventName
,
'search'
))
{
this
.
onSearchFormLoad
(
args
);
}
}
/**
* 搜索表单加载完成
*
* @param {*} [args={}]
* @memberof MDView
*/
public
onSearchFormLoad
(
args
:
any
=
{}):
void
{
const
{
isLoadDefault
,
viewParams
}
=
this
.
viewState
;
if
(
this
.
getMDCtrl
()
&&
isLoadDefault
)
{
const
tag
=
this
.
getMDCtrl
().
name
;
this
.
next
({
tag
:
tag
,
action
:
'load'
,
data
:
viewParams
});
}
this
.
viewState
.
isLoadDefault
=
true
;
}
/**
* 搜索表单搜索
*
* @param {*} [args={}]
* @memberof MDView
*/
public
onSearchFormSearch
(
args
:
any
=
{}):
void
{
const
{
isLoadDefault
,
viewParams
}
=
this
.
viewState
;
if
(
this
.
getMDCtrl
()
&&
isLoadDefault
)
{
const
tag
=
this
.
getMDCtrl
().
name
;
this
.
next
({
tag
:
tag
,
action
:
'load'
,
data
:
viewParams
});
}
this
.
viewState
.
isLoadDefault
=
true
;
}
/**
* 多数据部件事件处理
*
* @param {string} eventName
* @param {any[]} args
* @memberof MDView
*/
public
MDCtrlEvent
(
eventName
:
string
,
args
:
any
):
void
{
if
(
Object
.
is
(
eventName
,
'rowclick'
))
{
this
.
doEdit
(
args
);
}
if
(
Object
.
is
(
eventName
,
'rowdblclick'
))
{
this
.
doEdit
(
args
);
}
if
(
Object
.
is
(
eventName
,
'selectionchange'
))
{
this
.
selectionChange
(
args
);
}
if
(
Object
.
is
(
eventName
,
'load'
))
{
this
.
MDCtrlLoaded
(
args
);
}
if
(
Object
.
is
(
eventName
,
'beforeload'
))
{
this
.
MDCtrlBeforeLoad
(
args
)
}
}
/**
* 多数据部件加载之前
*
* @param {*} args
* @memberof MDView
*/
public
MDCtrlBeforeLoad
(
args
:
any
=
{})
{
if
(
this
.
getSearchForm
())
{
Object
.
assign
(
args
,
this
.
getSearchForm
().
getData
());
}
if
(
this
.
getSearchBar
())
{
Object
.
assign
(
args
,
this
.
getSearchBar
().
getData
());
}
// if (this.view && !this.view.isExpandSearchForm) {
// Object.assign(args, { query: this.view.query });
// }
// 快速分组和快速搜索栏
// if (this.view && this.view.quickGroupData) {
// Object.assign(args, this.view.quickGroupData);
// }
// if (this.view && this.view.quickFormData) {
// Object.assign(args, this.view.quickFormData);
// }
// 自定义查询条件
// const mdCtrl: any = this.getMDCtrl();
// if (mdCtrl && mdCtrl.controlInstance && mdCtrl.controlInstance.customCond) {
// Object.assign(args, { srfdsscope: mdCtrl.controlInstance.customCond });
// }
}
/**
* 多数据部件加载完成
*
* @param {*} args
* @memberof MDView
*/
public
MDCtrlLoaded
(
args
:
any
)
{
throw
new
Error
(
'Method not implemented.'
);
}
/**
* 多数据部件选中数据
*
* @param {*} args
* @memberof MDView
*/
public
selectionChange
(
args
:
any
)
{
throw
new
Error
(
'Method not implemented.'
);
}
/**
* 执行编辑操作
*
* @param {*} args
* @memberof MDView
*/
public
doEdit
(
args
:
any
)
{
throw
new
Error
(
'Method not implemented.'
);
}
/**
* @description 安装视图所有功能模块的方法
*
* @param {ViewPropsBase} props 传入的Props
* @param {Function} emit 事件
* @memberof MDView
*/
public
moduleInstall
(
props
:
MDViewProps
,
emit
:
Function
)
{
const
superParams
=
super
.
moduleInstall
(
props
,
emit
);
return
{
...
superParams
,
xDataControl
:
this
.
xDataControl
,
searchForm
:
this
.
searchForm
,
searchBar
:
this
.
searchBar
};
}
/**
* @description 获取搜索表单部件
*
* @return {*} {*}
* @memberof MDView
*/
public
getSearchForm
():
any
{
if
(
this
.
searchForm
.
value
)
{
return
this
.
searchForm
.
value
;
}
else
{
return
null
;
}
}
/**
* 获取搜索栏部件
*
* @returns {*}
* @memberof MDView
*/
public
getSearchBar
()
{
if
(
this
.
searchBar
.
value
)
{
return
this
.
searchBar
.
value
;
}
else
{
return
null
;
}
}
/**
* 获取多数据部件
*
* @return {*} {*}
* @memberof MDView
*/
public
getMDCtrl
():
any
{
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/view-base/view-base.ts
浏览文件 @
c976694e
...
...
@@ -16,6 +16,22 @@ export class ViewBase {
*/
public
viewState
:
ViewStateBase
;
/**
* 界面行为服务
*
* @type {(IParam | undefined)}
* @memberof ViewBase
*/
public
appUIService
:
IParam
|
undefined
;
/**
* 数据服务
*
* @type {(IParam | undefined)}
* @memberof ViewBase
*/
public
appDataService
:
IParam
|
undefined
;
/**
* Creates an instance of ViewBase.
* @param {*} options 配置参数
...
...
@@ -26,31 +42,35 @@ export class ViewBase {
}
/**
* @description 事件
* @type {*}
* @description 根据props调整视图状态变量
* @param {ViewPropsBase} props 传入的Props
* @param {Function} emit 事件
* @memberof ViewBase
*/
emit
:
any
;
protected
handleState
(
props
:
ViewPropsBase
,
emit
:
Function
)
{
// 只读属性处理:把props的属性的Ref赋给state,以维持响应性
this
.
viewState
.
viewSubject
=
toRef
(
props
,
'viewSubject'
)
as
any
;
}
/**
* @description 根据props调整设置部分视图基类
* @param {ViewPropsBase} props 传入参数
* @memberof ViewBase
* 通知状态
*
* @param { tag: string, action: string, data: any } { tag, action, data }
* @memberof ViewEngine
*/
public
setState
(
props
:
ViewPropsBase
)
{
// todo 项目级配置入口,优先级大于平台,提供全局的一次性配置
// 只读属性处理:把props的属性的Ref赋给state,以维持响应性。
this
.
viewState
.
viewSubject
=
toRef
(
props
,
'viewSubject'
)
as
any
;
public
next
({
tag
,
action
,
data
}:
{
tag
:
string
,
action
:
string
,
data
:
any
}):
void
{
const
{
viewSubject
}
=
this
.
viewState
;
viewSubject
.
next
({
tag
:
tag
,
action
:
action
,
data
:
data
})
}
/**
* @description 处理视图导航参数
*
* @param props 输入属性
* @param context 应用上下文
* @param viewParams 视图参数
*/
p
ublic
handleViewContextParams
(
props
:
ViewPropsBase
,
context
:
Ref
<
IParam
|
undefined
>
,
viewParams
:
Ref
<
IParam
|
undefined
>
)
{
p
rivate
handleViewContextParams
(
props
:
ViewPropsBase
,
context
:
Ref
<
IParam
|
undefined
>
,
viewParams
:
Ref
<
IParam
|
undefined
>
)
{
if
(
!
context
.
value
)
context
.
value
=
{};
if
(
!
viewParams
.
value
)
viewParams
.
value
=
{};
const
{
appViewNavContexts
,
appViewNavParams
}
=
this
.
viewState
;
...
...
@@ -98,11 +118,12 @@ export class ViewBase {
/**
* @description 使用视图上下文参数逻辑块
*
* @param {ViewPropsBase} props 传入的Props
* @
return {*}
* @
param {Function} emit 事件
* @memberof ViewBase
*/
public
useViewContextParams
(
props
:
ViewPropsBase
)
{
public
useViewContextParams
(
props
:
ViewPropsBase
,
emit
:
Function
)
{
const
context
=
UIBase
.
toOneWayRef
(
props
,
'context'
);
const
viewParams
=
UIBase
.
toOneWayRef
(
props
,
'viewParams'
);
// 导航视图参数处理
...
...
@@ -117,26 +138,77 @@ export class ViewBase {
}
/**
* @description 使用计数器服务模块
* @param {ViewPropsBase} props 传入参数
*@description 使用UI服务
*
* @param {ViewPropsBase} props
* @param {Function} emit
* @memberof ViewBase
*/
public
useUIService
(
props
:
ViewPropsBase
,
emit
:
Function
)
{
const
{
appEntityName
,
context
}
=
this
.
viewState
;
if
(
appEntityName
)
{
App
.
getUIService
(
appEntityName
.
toLowerCase
(),
context
).
then
((
service
:
IParam
)
=>
{
this
.
appUIService
=
service
;
})
}
}
/**
*@description 使用数据服务
*
* @param {ViewPropsBase} props
* @param {Function} emit
* @memberof ViewBase
*/
public
useDataService
(
props
:
ViewPropsBase
,
emit
:
Function
)
{
const
{
appEntityName
,
context
}
=
this
.
viewState
;
if
(
appEntityName
)
{
App
.
getDataService
(
appEntityName
.
toLowerCase
(),
context
).
then
((
service
:
IParam
)
=>
{
this
.
appDataService
=
service
;
})
}
}
/**
* @description 使用计数器服务
*
* @param {ViewPropsBase} props 传入的Props
* @param {Function} emit 事件
* @memberof ViewBase
*/
public
useCounterService
(
props
:
ViewPropsBase
,
emit
:
Function
)
{
}
/**
* @description 处理视图初始化
*
* @param {ViewPropsBase} props
* @param {Function} emit
* @memberof ViewBase
*/
public
use
CounterService
(
props
:
ViewPropsBase
)
{
}
public
use
ViewInit
(
props
:
ViewPropsBase
,
emit
:
Function
)
{
}
/**
* @description 安装视图所有功能模块的方法
*
* @param {ViewPropsBase} props 传入的Props
* @param {Function} [emit] [emit] 事件
* @return {*}
* @param {Function} emit 事件
* @memberof ViewBase
*/
public
moduleInstall
(
props
:
ViewPropsBase
,
emit
?:
Function
)
{
this
.
emit
=
emit
?.
bind
(
this
);
this
.
setState
(
props
);
this
.
useViewContextParams
(
props
);
this
.
useCounterService
(
props
);
public
moduleInstall
(
props
:
ViewPropsBase
,
emit
:
Function
)
{
// 处理视图状态
this
.
handleState
(
props
,
emit
);
// 处理视图导航参数
this
.
useViewContextParams
(
props
,
emit
);
// 使用计数器服务
this
.
useCounterService
(
props
,
emit
);
// 使用数据服务
this
.
useDataService
(
props
,
emit
);
// 使用UI服务
this
.
useUIService
(
props
,
emit
);
// 处理视图初始化
this
.
useViewInit
(
props
,
emit
);
return
{
state
:
this
.
viewState
,
state
:
this
.
viewState
};
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/view-base/view-state-base.ts
浏览文件 @
c976694e
...
...
@@ -8,20 +8,6 @@ import { IActionParam, IParam } from '@core';
*/
export
interface
ViewStateBase
{
/**
* @description 视图名称
* @type {string}
* @memberof ViewStateBase
*/
viewName
:
string
;
/**
* @description 视图代码名称
* @type {string}
* @memberof ViewStateBase
*/
viewCodeName
:
string
;
/**
* @description 上下文参数
* @type {IParam}
...
...
@@ -43,29 +29,6 @@ export interface ViewStateBase {
*/
viewSubject
:
Subject
<
IActionParam
>
;
/**
* @description 视图工具栏模型
* @type {IParam[]}
* @memberof ViewStateBase
*/
viewToolbarModel
:
IParam
[];
/**
* 自定义视图导航上下文
*
* @type {IParam}
* @memberof ViewStateBase
*/
appViewNavContexts
:
IParam
;
/**
* 自定义视图参数
*
* @type {IParam}
* @memberof ViewStateBase
*/
appViewNavParams
:
IParam
;
// 声明任意属性
[
propName
:
string
]:
any
;
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/views/{{appModules}}/{{pages@APPINDEXVIEW}}/{{pages@APPINDEXVIEW}}-config.ts.hbs
浏览文件 @
c976694e
export const ViewConfig = {
{{>
@macro
/
front-end
/
views
/
config
/
view-base-config
.
hbs
}}
{{>
@macro
/
front-end
/
views
/
view-base-config
.
hbs
}}
};
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/views/{{appModules}}/{{pages@DEEDITVIEW}}/{{pages@DEEDITVIEW}}-config.ts.hbs
浏览文件 @
c976694e
export const ViewConfig = {
{{>
@macro
/
front-end
/
views
/
config
/
view-base-config
.
hbs
}}
{{>
@macro
/
front-end
/
views
/
view-base-config
.
hbs
}}
};
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/views/{{appModules}}/{{pages@DEEDITVIEW}}/{{pages@DEEDITVIEW}}.vue.hbs
浏览文件 @
c976694e
...
...
@@ -59,7 +59,7 @@ const { state, handleToolbarEvent } = new EditView(ViewConfig).moduleInstall(pro
:showBusyIndicator=
"true"
:context=
"state.context"
:viewParams=
"state.viewParams"
:controlAction=
"state.
controlsAction.
{{
name
}}
"
:controlAction=
"state.
{{
name
}}
.action
"
:viewSubject=
"state.viewSubject"
></
{{
codeName
}}
Form>
{{/
eq
}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/views/{{appModules}}/{{pages@DEGRIDVIEW}}/{{pages@DEGRIDVIEW}}-config.ts.hbs
浏览文件 @
c976694e
export const ViewConfig = {
gridRowActiveMode:
{{
page
.
gridRowActiveMode
}}
,
rowEditState:
{{#if
page
.
enableRowEdit
}}{{
page
.
rowEditDefault
}}{{else}}
false
{{/if}}
,
{{>
@macro
/
front-end
/
views
/
config
/
view-base-config
.
hbs
}}
{{>
@macro
/
front-end
/
views
/
view-base-config
.
hbs
}}
};
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/views/{{appModules}}/{{pages@DEGRIDVIEW}}/{{pages@DEGRIDVIEW}}.vue.hbs
浏览文件 @
c976694e
...
...
@@ -29,7 +29,7 @@ interface ViewEmit {
const
emit
=
defineEmits
<
ViewEmit
>
();
// 安装功能模块,提供状态和能力方法
const
{
state
,
handleCtrlEvent
,
handleToolbarEvent
}
=
new
GridView
(
ViewConfig
).
moduleInstall
(
props
,
emit
);
const
{
state
,
grid
,
handleCtrlEvent
,
handleToolbarEvent
}
=
new
GridView
(
ViewConfig
).
moduleInstall
(
props
,
emit
);
</script>
...
...
@@ -50,6 +50,7 @@ const { state, handleCtrlEvent, handleToolbarEvent } = new GridView(ViewConfig).
{{/
eq
}}
{{#
eq
controlType
"GRID"
}}
<
{{
codeName
}}
Grid
ref=
"grid"
:context=
"state.context"
:rowEditState=
"state.rowEditState"
:rowActiveMode=
"state.gridRowActiveMode"
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/views/{{appModules}}/{{pages@DEPICKUPGRIDVIEW}}/{{pages@DEPICKUPGRIDVIEW}}-config.ts.hbs
浏览文件 @
c976694e
export const ViewConfig = {
{{>
@macro
/
front-end
/
views
/
config
/
view-base-config
.
hbs
}}
{{>
@macro
/
front-end
/
views
/
view-base-config
.
hbs
}}
};
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/views/{{appModules}}/{{pages@DEPICKUPVIEW}}/{{pages@DEPICKUPVIEW}}-config.ts.hbs
浏览文件 @
c976694e
export const ViewConfig = {
{{>
@macro
/
front-end
/
views
/
config
/
view-base-config
.
hbs
}}
{{>
@macro
/
front-end
/
views
/
view-base-config
.
hbs
}}
};
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/views/{{appModules}}/{{pages@DETREEEXPVIEW}}/{{pages@DETREEEXPVIEW}}-config.ts.hbs
浏览文件 @
c976694e
...
...
@@ -4,5 +4,5 @@ export const ViewConfig = {
treeExpBarName: '
{{
ctrl
.
name
}}
',
{{/if}}
{{/
each
}}
{{>
@macro
/
front-end
/
views
/
config
/
view-base-config
.
hbs
}}
{{>
@macro
/
front-end
/
views
/
view-base-config
.
hbs
}}
};
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid.vue.hbs
浏览文件 @
c976694e
{{>
@macro
/
front-end
/
widgets
/
grid-detail
/
include-grid
.
hbs
}}
<script
setup
lang=
"ts"
>
import
{
Subject
}
from
'rxjs'
;
import
{
CtrlConfig
}
from
'./
{{
spinalCase
ctrl
.
codeName
}}
-grid-config'
;
import
{
GridControl
,
IActionParam
,
IParam
,
IContext
,
ControlAction
,
deepCopy
}
from
'@core'
;
import
{
Subject
}
from
'rxjs'
;
import
{
CtrlConfig
}
from
'./
{{
spinalCase
ctrl
.
codeName
}}
-grid-config'
;
import
{
GridControl
,
IActionParam
,
IParam
,
IContext
,
ControlAction
,
deepCopy
}
from
'@core'
;
interface
Props
{
interface
Props
{
context
:
IContext
;
multiple
:
boolean
;
rowEditState
:
boolean
;
...
...
@@ -15,44 +15,34 @@ interface Props {
controlAction
:
ControlAction
;
showBusyIndicator
?:
boolean
;
viewSubject
:
Subject
<
IActionParam
>
;
}
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
viewSubject
:
()
=>
new
Subject
<
IActionParam
>
(),
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
viewSubject
:
()
=>
new
Subject
<
IActionParam
>
(),
showBusyIndicator
:
true
,
multiple
:
false
,
rowEditState
:
false
,
rowActiveMode
:
0
,
selectFirstDefault
:
false
,
})
})
// emit声明
interface
CtrlEmit
{
// emit声明
interface
CtrlEmit
{
(
name
:
"ctrlEvent"
,
value
:
IActionParam
):
void
;
}
const
emit
=
defineEmits
<
CtrlEmit
>
();
// 安装功能模块,提供状态和能力方法
const
{
state
,
load
,
handleEditorEvent
,
handleToolbarEvent
,
custom
}
=
new
GridControl
(
CtrlConfig
).
moduleInstall
(
props
,
emit
);
const
{
scrollOption
,
rowKey
,
rowClassName
,
customRow
,
rowSelectionOption
,
resizeColumn
,
handleGridChange
}
=
custom
;
}
const
emit
=
defineEmits
<
CtrlEmit
>
();
// 安装功能模块,提供状态和能力
const
{
state
,
load
,
handleEditorEvent
,
handleToolbarEvent
,
custom
}
=
new
GridControl
(
CtrlConfig
).
moduleInstall
(
props
,
emit
);
const
{
scrollOption
,
rowKey
,
rowClassName
,
customRow
,
rowSelectionOption
,
resizeColumn
,
handleGridChange
}
=
custom
;
// 暴露内部状态及能力
defineExpose
({
state
,
name
:
'
{{
ctrl
.
name
}}
'
,
load
});
</script>
<template>
<a-table
bordered
sticky
class=
"ibiz-grid
{{#if
ctrl
.
psSysCss
}}
{{
ctrl
.
psSysCss
.
cssName
}}{{/if}}
"
:rowKey=
"rowKey"
:showHeader=
"
{{#if
ctrl
.
hideHeader
}}
false
{{else}}
true
{{/if}}
"
:scroll=
"scrollOption"
:sortDirections=
"['ascend', 'descend']"
:data-source=
"state.data"
:row-selection=
"rowSelectionOption"
:columns=
"state.columnsModel"
:pagination=
"state.gridPaging.pagination"
:customRow=
"customRow"
:rowClassName=
"rowClassName"
@
change=
"handleGridChange"
@
resizeColumn=
"resizeColumn"
>
<a-table
bordered
sticky
class=
"ibiz-grid
{{#if
ctrl
.
psSysCss
}}
{{
ctrl
.
psSysCss
.
cssName
}}{{/if}}
"
:rowKey=
"rowKey"
:showHeader=
"
{{#if
ctrl
.
hideHeader
}}
false
{{else}}
true
{{/if}}
"
:scroll=
"scrollOption"
:sortDirections=
"['ascend', 'descend']"
:data-source=
"state.data"
:row-selection=
"rowSelectionOption"
:columns=
"state.columnsModel"
:pagination=
"state.gridPaging.pagination"
:customRow=
"customRow"
:rowClassName=
"rowClassName"
@
change=
"handleGridChange"
@
resizeColumn=
"resizeColumn"
>
<template
#
emptyText
>
<div
class=
"not-data"
>
<span
class=
"empty-text"
>
...
...
@@ -85,11 +75,12 @@ const { scrollOption, rowKey, rowClassName, customRow, rowSelectionOption, resiz
</a-table>
</template>
<style
lang=
"scss"
>
.ibiz-grid
{
.ibiz-grid
{
height
:
100%
;
padding-top
:
8px
;
.table-striped
{
background-color
:
#fafafa
;
}
}
}
</style>
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/yarn.lock
浏览文件 @
c976694e
...
...
@@ -980,6 +980,11 @@ mlly@^0.2.2:
dependencies:
import-meta-resolve "^1.1.1"
monaco-editor@^0.24.0:
version "0.24.0"
resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.24.0.tgz#990b55096bcc95d08d8d28e55264c6eb17707269"
integrity sha512-o1f0Lz6ABFNTtnEqqqvlY9qzNx24rQZx1RgYNQ8SkWkE+Ka63keHH/RqxQ4QhN4fs/UYOnvAtEUZsPrzccH++A==
ms@2.1.2:
version "2.1.2"
resolved "https://registry.npmmirror.com/ms/download/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
...
...
@@ -1283,6 +1288,11 @@ sourcemap-codec@^1.4.4:
resolved "https://registry.npmmirror.com/sourcemap-codec/download/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4"
integrity sha1-6oBL2UhXQC5pktBaOO8a41qatMQ=
tinymce@5.7.1:
version "5.7.1"
resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-5.7.1.tgz#658a6fb4c7d53a8496cc00f8da33f4b8290da06d"
integrity sha512-1gY8RClc734srSlkYwY0MQzmkS1j73PuPC+nYtNtrrQVPY9VNcZ4bOiRwzTbdjPPD8GOtv6BAk8Ww/H2RiqKpA==
to-fast-properties@^2.0.0:
version "2.0.0"
resolved "https://registry.npmmirror.com/to-fast-properties/download/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
...
...
@@ -1355,6 +1365,11 @@ upath@^2.0.1:
resolved "https://registry.npmmirror.com/upath/download/upath-2.0.1.tgz#50c73dea68d6f6b990f51d279ce6081665d61a8b"
integrity sha1-UMc96mjW9rmQ9R0nnOYIFmXWGos=
vite-plugin-monaco-editor@^1.0.10:
version "1.0.10"
resolved "https://registry.yarnpkg.com/vite-plugin-monaco-editor/-/vite-plugin-monaco-editor-1.0.10.tgz#cd370f68d4121bced6f902c6284649cc8eca4170"
integrity sha512-7yTAFIE0SefjCmfnjrvXOl53wkxeSASc/ZIcB5tZeEK3vAmHhveV8y3f90Vp8b+PYdbUipjqf91mbFbSENkpcw==
vite@^2.7.0:
version "2.7.0"
resolved "https://registry.npmmirror.com/vite/download/vite-2.7.0.tgz#d3d753220d10afb055731cd7feaa8e87b2b779b6"
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录