Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
806232a3
提交
806232a3
编写于
2月 15, 2022
作者:
Mosher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:搜索表单调整
上级
a0661022
变更
8
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
81 行增加
和
23 行删除
+81
-23
main-view.ts
...pp_{{apps}}/src/core/modules/views/main-view/main-view.ts
+32
-8
md-view.ts
...r7/app_{{apps}}/src/core/modules/views/md-view/md-view.ts
+36
-6
quick-search-form-control.ts
...ts/quick-search-form-control/quick-search-form-control.ts
+1
-1
search-form-control.ts
...odules/widgets/search-form-control/search-form-control.ts
+1
-1
{{pages@DEGRIDVIEW}}.vue.hbs
...dules}}/{{pages@DEGRIDVIEW}}/{{pages@DEGRIDVIEW}}.vue.hbs
+4
-1
{{ctrls@QUICKSEARCHFORM}}-quick-search-form-state.ts.hbs
.../{{ctrls@QUICKSEARCHFORM}}-quick-search-form-state.ts.hbs
+1
-1
{{ctrls@QUICKSEARCHFORM}}-quick-search-form.vue.hbs
...-form/{{ctrls@QUICKSEARCHFORM}}-quick-search-form.vue.hbs
+4
-3
{{ctrls@SEARCHFORM}}-search-form.vue.hbs
...RM}}-search-form/{{ctrls@SEARCHFORM}}-search-form.vue.hbs
+2
-2
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/main-view/main-view.ts
浏览文件 @
806232a3
...
@@ -15,6 +15,14 @@ export class MainView extends ViewBase {
...
@@ -15,6 +15,14 @@ export class MainView extends ViewBase {
*/
*/
public
declare
state
:
MainViewState
;
public
declare
state
:
MainViewState
;
/**
* 视图实体UI服务
*
* @type {*}
* @memberof MainView
*/
public
appUIService
:
any
;
/**
/**
* 设置工具栏项状态
* 设置工具栏项状态
*
*
...
@@ -23,11 +31,13 @@ export class MainView extends ViewBase {
...
@@ -23,11 +31,13 @@ export class MainView extends ViewBase {
* @return {*}
* @return {*}
* @memberof MainView
* @memberof MainView
*/
*/
public
async
setToolbarItemState
(
state
:
boolean
,
data
?:
IParam
)
{
public
setToolbarItemState
(
state
:
boolean
,
data
?:
IParam
)
{
if
(
!
this
.
state
.
toolbar
)
{
if
(
!
this
.
state
.
toolbar
)
{
return
;
return
;
}
}
const
appUIService
=
await
this
.
getUIService
();
if
(
!
this
.
appUIService
)
{
await
this
.
useUIService
();
}
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
))
{
...
@@ -47,18 +57,18 @@ export class MainView extends ViewBase {
...
@@ -47,18 +57,18 @@ export class MainView extends ViewBase {
const
{
actionTarget
,
uIActionTag
,
dataAccessAction
}
=
item
.
uIAction
;
const
{
actionTarget
,
uIActionTag
,
dataAccessAction
}
=
item
.
uIAction
;
// 不需要数据的界面行为
// 不需要数据的界面行为
if
(
item
.
uIAction
&&
(
Object
.
is
(
actionTarget
,
"NONE"
)
||
!
actionTarget
))
{
if
(
item
.
uIAction
&&
(
Object
.
is
(
actionTarget
,
"NONE"
)
||
!
actionTarget
))
{
if
(
!
actionTarget
&&
Object
.
is
(
uIActionTag
,
"Save"
)
&&
appUIService
.
isEnableDEMainState
)
{
if
(
!
actionTarget
&&
Object
.
is
(
uIActionTag
,
"Save"
)
&&
this
.
appUIService
.
isEnableDEMainState
)
{
if
(
data
&&
Object
.
keys
(
data
).
length
>
0
)
{
if
(
data
&&
Object
.
keys
(
data
).
length
>
0
)
{
dataActionResult
=
appUIService
.
getAllOPPrivs
(
data
,
dataAccessAction
);
dataActionResult
=
this
.
appUIService
.
getAllOPPrivs
(
data
,
dataAccessAction
);
}
}
}
else
{
}
else
{
dataActionResult
=
appUIService
.
getAllOPPrivs
(
undefined
,
dataAccessAction
);
dataActionResult
=
this
.
appUIService
.
getAllOPPrivs
(
undefined
,
dataAccessAction
);
}
}
}
else
{
}
else
{
if
(
data
&&
Object
.
keys
(
data
).
length
>
0
&&
appUIService
?
.
isEnableDEMainState
)
{
if
(
data
&&
Object
.
keys
(
data
).
length
>
0
&&
this
.
appUIService
.
isEnableDEMainState
)
{
dataActionResult
=
appUIService
.
getAllOPPrivs
(
data
,
dataAccessAction
);
dataActionResult
=
this
.
appUIService
.
getAllOPPrivs
(
data
,
dataAccessAction
);
}
else
{
}
else
{
dataActionResult
=
appUIService
.
getAllOPPrivs
(
undefined
,
dataAccessAction
);
dataActionResult
=
this
.
appUIService
.
getAllOPPrivs
(
undefined
,
dataAccessAction
);
}
}
}
}
// 无权限:0;有权限:1
// 无权限:0;有权限:1
...
@@ -110,6 +120,20 @@ export class MainView extends ViewBase {
...
@@ -110,6 +120,20 @@ export class MainView extends ViewBase {
App
.
getAppActionService
().
execute
(
uIAction
,
inputParam
);
App
.
getAppActionService
().
execute
(
uIAction
,
inputParam
);
}
}
/**
* @description 注册UI服务
*
* @private
* @memberof MainView
*/
private
useUIService
()
{
const
{
context
,
appEntityCodeName
}
=
this
.
state
;
App
.
getUIService
(
appEntityCodeName
.
toLowerCase
(),
context
).
then
((
service
:
IParam
)
=>
{
this
.
appUIService
=
service
;
this
.
state
.
UIService
=
this
.
appUIService
;
});
}
/**
/**
* @description 安装视图所有功能模块的方法
* @description 安装视图所有功能模块的方法
*
*
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/md-view/md-view.ts
浏览文件 @
806232a3
...
@@ -24,6 +24,14 @@ export class MDView extends MainView {
...
@@ -24,6 +24,14 @@ export class MDView extends MainView {
*/
*/
public
declare
searchForm
:
IParam
;
public
declare
searchForm
:
IParam
;
/**
* 当前视图快速搜索表单部件
*
* @type {IParam}
* @memberof MDView
*/
public
declare
quickSearchForm
:
IParam
;
/**
/**
* 当前视图搜索栏部件
* 当前视图搜索栏部件
*
*
...
@@ -41,6 +49,8 @@ export class MDView extends MainView {
...
@@ -41,6 +49,8 @@ export class MDView extends MainView {
super
.
useViewInit
();
super
.
useViewInit
();
// 初始化搜索表单引用
// 初始化搜索表单引用
this
.
searchForm
=
ref
(
null
);
this
.
searchForm
=
ref
(
null
);
// 初始化快速搜索表单引用
this
.
quickSearchForm
=
ref
(
null
);
// 初始化搜索栏引用
// 初始化搜索栏引用
this
.
searchBar
=
ref
(
null
);
this
.
searchBar
=
ref
(
null
);
onMounted
(()
=>
{
onMounted
(()
=>
{
...
@@ -68,7 +78,7 @@ export class MDView extends MainView {
...
@@ -68,7 +78,7 @@ export class MDView extends MainView {
public
onCtrlEvent
(
actionParam
:
IActionParam
)
{
public
onCtrlEvent
(
actionParam
:
IActionParam
)
{
super
.
onCtrlEvent
(
actionParam
);
super
.
onCtrlEvent
(
actionParam
);
const
{
tag
,
action
,
data
}
=
actionParam
;
const
{
tag
,
action
,
data
}
=
actionParam
;
if
(
Object
.
is
(
tag
,
'searchform'
))
{
if
(
Object
.
is
(
tag
,
'searchform'
)
||
Object
.
is
(
tag
,
'quicksearchform'
)
)
{
this
.
handleSearchFormEvent
(
action
,
data
);
this
.
handleSearchFormEvent
(
action
,
data
);
}
}
}
}
...
@@ -85,7 +95,7 @@ export class MDView extends MainView {
...
@@ -85,7 +95,7 @@ export class MDView extends MainView {
this
.
onSearchFormLoad
(
args
);
this
.
onSearchFormLoad
(
args
);
}
}
if
(
Object
.
is
(
eventName
,
'search'
))
{
if
(
Object
.
is
(
eventName
,
'search'
))
{
this
.
onSearchForm
Load
(
args
);
this
.
onSearchForm
Search
(
args
);
}
}
}
}
...
@@ -176,11 +186,20 @@ export class MDView extends MainView {
...
@@ -176,11 +186,20 @@ export class MDView extends MainView {
* @memberof MDView
* @memberof MDView
*/
*/
public
MDCtrlBeforeLoad
(
args
:
any
=
{})
{
public
MDCtrlBeforeLoad
(
args
:
any
=
{})
{
if
(
this
.
getSearchForm
())
{
// 搜索表单
Object
.
assign
(
args
,
this
.
getSearchForm
().
getData
());
const
searchForm
=
this
.
getSearchForm
();
if
(
searchForm
)
{
Object
.
assign
(
args
,
searchForm
.
getData
());
}
// 快速搜索表单
const
quickSearchForm
=
this
.
getQuickSearchForm
();
if
(
quickSearchForm
)
{
Object
.
assign
(
args
,
quickSearchForm
.
getData
());
}
}
if
(
this
.
getSearchBar
())
{
// 搜索栏
Object
.
assign
(
args
,
this
.
getSearchBar
().
getData
());
const
searchBar
=
this
.
getSearchBar
();
if
(
searchBar
)
{
Object
.
assign
(
args
,
searchBar
.
getData
());
}
}
// if (this.view && !this.view.isExpandSearchForm) {
// if (this.view && !this.view.isExpandSearchForm) {
// Object.assign(args, { query: this.view.query });
// Object.assign(args, { query: this.view.query });
...
@@ -289,6 +308,7 @@ export class MDView extends MainView {
...
@@ -289,6 +308,7 @@ export class MDView extends MainView {
...
superParams
,
...
superParams
,
xDataControl
:
this
.
xDataControl
,
xDataControl
:
this
.
xDataControl
,
searchForm
:
this
.
searchForm
,
searchForm
:
this
.
searchForm
,
quickSearchForm
:
this
.
quickSearchForm
,
searchBar
:
this
.
searchBar
,
searchBar
:
this
.
searchBar
,
onQuickGroupEvent
:
this
.
onQuickGroupEvent
.
bind
(
this
),
onQuickGroupEvent
:
this
.
onQuickGroupEvent
.
bind
(
this
),
onQuickSearchEvent
:
this
.
onQuickSearchEvent
.
bind
(
this
),
onQuickSearchEvent
:
this
.
onQuickSearchEvent
.
bind
(
this
),
...
@@ -305,6 +325,16 @@ export class MDView extends MainView {
...
@@ -305,6 +325,16 @@ export class MDView extends MainView {
return
unref
(
this
.
searchForm
);
return
unref
(
this
.
searchForm
);
}
}
/**
* @description 获取快速搜索表单部件
*
* @return {*} {*}
* @memberof MDView
*/
public
getQuickSearchForm
():
any
{
return
unref
(
this
.
quickSearchForm
);
}
/**
/**
* 获取搜索栏部件
* 获取搜索栏部件
*
*
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/quick-search-form-control/quick-search-form-control.ts
浏览文件 @
806232a3
...
@@ -23,7 +23,7 @@ export class QuickSearchFormControl extends FormControl {
...
@@ -23,7 +23,7 @@ export class QuickSearchFormControl extends FormControl {
super
.
onEditorEvent
(
actionParam
);
super
.
onEditorEvent
(
actionParam
);
this
.
emit
(
"ctrlEvent"
,
{
this
.
emit
(
"ctrlEvent"
,
{
tag
:
this
.
props
.
name
,
tag
:
this
.
props
.
name
,
action
:
"se
lectionChange
"
,
action
:
"se
arch
"
,
data
:
this
.
state
.
data
,
data
:
this
.
state
.
data
,
});
});
}
}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/search-form-control/search-form-control.ts
浏览文件 @
806232a3
...
@@ -21,7 +21,7 @@ export class SearchFormControl extends FormControl {
...
@@ -21,7 +21,7 @@ export class SearchFormControl extends FormControl {
public
onSearch
()
{
public
onSearch
()
{
this
.
emit
(
"ctrlEvent"
,
{
this
.
emit
(
"ctrlEvent"
,
{
tag
:
this
.
props
.
name
,
tag
:
this
.
props
.
name
,
action
:
"se
lectionChange
"
,
action
:
"se
arch
"
,
data
:
this
.
state
.
data
,
data
:
this
.
state
.
data
,
});
});
}
}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/views/{{appModules}}/{{pages@DEGRIDVIEW}}/{{pages@DEGRIDVIEW}}.vue.hbs
浏览文件 @
806232a3
...
@@ -40,7 +40,7 @@ const emit = defineEmits<ViewEmit>();
...
@@ -40,7 +40,7 @@ const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
// 安装功能模块,提供状态和能力方法
const
gridView
=
new
GridView
(
viewState
,
props
,
emit
).
moduleInstall
();
const
gridView
=
new
GridView
(
viewState
,
props
,
emit
).
moduleInstall
();
const
{
state
,
grid
,
onCtrlEvent
,
onToolbarEvent
,
onQuickGroupEvent
,
onQuickSearchEvent
}
=
gridView
;
const
{
state
,
grid
,
searchForm
,
quickSearchForm
,
onCtrlEvent
,
onToolbarEvent
,
onQuickGroupEvent
,
onQuickSearchEvent
}
=
gridView
;
</script>
</script>
...
@@ -72,6 +72,7 @@ const { state, grid, onCtrlEvent, onToolbarEvent, onQuickGroupEvent, onQuickSear
...
@@ -72,6 +72,7 @@ const { state, grid, onCtrlEvent, onToolbarEvent, onQuickGroupEvent, onQuickSear
<a-popover
v-if=
"state.expandSearchForm"
trigger=
"click"
:overlayStyle=
"{width: '50%'}"
placement=
"bottom"
>
<a-popover
v-if=
"state.expandSearchForm"
trigger=
"click"
:overlayStyle=
"{width: '50%'}"
placement=
"bottom"
>
<template
#
content
>
<template
#
content
>
<
{{
codeName
}}
SearchForm
<
{{
codeName
}}
SearchForm
ref=
"searchForm"
name=
"
{{
name
}}
"
name=
"
{{
name
}}
"
:context=
"state.context"
:context=
"state.context"
:viewParams=
"state.viewParams"
:viewParams=
"state.viewParams"
...
@@ -88,6 +89,7 @@ const { state, grid, onCtrlEvent, onToolbarEvent, onQuickGroupEvent, onQuickSear
...
@@ -88,6 +89,7 @@ const { state, grid, onCtrlEvent, onToolbarEvent, onQuickGroupEvent, onQuickSear
<template
v-slot:searchForm
>
<template
v-slot:searchForm
>
<
{{
codeName
}}
SearchForm
<
{{
codeName
}}
SearchForm
v-if=
"state.expandSearchForm"
v-if=
"state.expandSearchForm"
ref=
"searchForm"
name=
"
{{
name
}}
"
name=
"
{{
name
}}
"
:context=
"state.context"
:context=
"state.context"
:viewParams=
"state.viewParams"
:viewParams=
"state.viewParams"
...
@@ -101,6 +103,7 @@ const { state, grid, onCtrlEvent, onToolbarEvent, onQuickGroupEvent, onQuickSear
...
@@ -101,6 +103,7 @@ const { state, grid, onCtrlEvent, onToolbarEvent, onQuickGroupEvent, onQuickSear
{{#if
(
and
(
eq
controlType
"SEARCHFORM"
)
(
eq
name
'quicksearchform'
))
}}
{{#if
(
and
(
eq
controlType
"SEARCHFORM"
)
(
eq
name
'quicksearchform'
))
}}
<template
v-slot:quickSearchForm
>
<template
v-slot:quickSearchForm
>
<
{{
codeName
}}
QuickSearchForm
<
{{
codeName
}}
QuickSearchForm
ref=
"quickSearchForm"
name=
"
{{
name
}}
"
name=
"
{{
name
}}
"
:context=
"state.context"
:context=
"state.context"
:viewParams=
"state.viewParams"
:viewParams=
"state.viewParams"
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@QUICKSEARCHFORM}}-quick-search-form/{{ctrls@QUICKSEARCHFORM}}-quick-search-form-state.ts.hbs
浏览文件 @
806232a3
...
@@ -60,7 +60,7 @@ export const ctrlState = {
...
@@ -60,7 +60,7 @@ export const ctrlState = {
detailsModel: {
detailsModel: {
{{#if
ctrl
.
psDEFormPages
}}
{{#if
ctrl
.
psDEFormPages
}}
{{#
each
ctrl
.
psDEFormPages
as
|
FormPage
|
}}
{{#
each
ctrl
.
psDEFormPages
as
|
FormPage
|
}}
{{>
(
lookup
'FORMDETAILSMODEL'
)
formDetail
=
FormPage
}}
{{>
@macro
/
front-end
/
widgets
/
form-detail
/
include-form
.
hbs
type
=
'FORMDETAILSMODEL'
item
=
FormPage
}}
{{/
each
}}
{{/
each
}}
{{/if}}
{{/if}}
},
},
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@QUICKSEARCHFORM}}-quick-search-form/{{ctrls@QUICKSEARCHFORM}}-quick-search-form.vue.hbs
浏览文件 @
806232a3
...
@@ -27,7 +27,8 @@ interface CtrlEmit {
...
@@ -27,7 +27,8 @@ interface CtrlEmit {
const
emit
=
defineEmits
<
CtrlEmit
>
();
const
emit
=
defineEmits
<
CtrlEmit
>
();
// 安装功能模块,提供状态和能力方法
// 安装功能模块,提供状态和能力方法
const
{
name
,
state
,
onEditorEvent
}
=
new
QuickSearchFormControl
(
ctrlState
,
props
,
emit
).
moduleInstall
();
const
{
name
,
state
,
getData
,
onEditorEvent
}
=
new
QuickSearchFormControl
(
ctrlState
,
props
,
emit
).
moduleInstall
();
defineExpose
({
name
,
state
,
getData
});
</script>
</script>
<template>
<template>
...
@@ -41,13 +42,13 @@ const { name, state, onEditorEvent } = new QuickSearchFormControl(ctrlState, pro
...
@@ -41,13 +42,13 @@ const { name, state, onEditorEvent } = new QuickSearchFormControl(ctrlState, pro
{{#if
ctrl
.
noTabHeader
}}
{{#if
ctrl
.
noTabHeader
}}
{{#
each
ctrl
.
psDEFormPages
as
|
ctrlPage
|
}}
{{#
each
ctrl
.
psDEFormPages
as
|
ctrlPage
|
}}
{{#
each
ctrlPage
.
psDEFormDetails
as
|
formDetail
|
}}
{{#
each
ctrlPage
.
psDEFormDetails
as
|
formDetail
|
}}
{{>
(
lookup
.
'formDetail.detailType'
)
item
=
formDetail
}}
{{>
@macro
/
front-end
/
widgets
/
form-detail
/
include-form
.
hbs
type
=
formDetail
.
detailType
item
=
formDetail
}}
{{/
each
}}
{{/
each
}}
{{/
each
}}
{{/
each
}}
{{else}}
{{else}}
<a-tabs
class=
"app-form-page"
>
<a-tabs
class=
"app-form-page"
>
{{#
each
ctrl
.
psDEFormPages
as
|
ctrlPage
|
}}
{{#
each
ctrl
.
psDEFormPages
as
|
ctrlPage
|
}}
{{>
(
lookup
.
'ctrlPage.detailType'
)
item
=
ctrlPage
}}
{{>
@macro
/
front-end
/
widgets
/
form-detail
/
include-form
.
hbs
type
=
ctrlPage
.
detailType
item
=
ctrlPage
}}
{{/
each
}}
{{/
each
}}
</a-tabs>
</a-tabs>
{{/if}}
{{/if}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@SEARCHFORM}}-search-form/{{ctrls@SEARCHFORM}}-search-form.vue.hbs
浏览文件 @
806232a3
...
@@ -27,8 +27,8 @@ interface CtrlEmit {
...
@@ -27,8 +27,8 @@ interface CtrlEmit {
const
emit
=
defineEmits
<
CtrlEmit
>
();
const
emit
=
defineEmits
<
CtrlEmit
>
();
// 安装功能模块,提供状态和能力方法
// 安装功能模块,提供状态和能力方法
const
{
state
,
onEditorEvent
,
onComponentEvent
,
onSearch
,
loadDraft
,
onSaveHistoryItem
,
onCancel
,
onRemoveHistoryItem
}
=
new
SearchFormControl
(
ctrlState
,
props
,
emit
).
moduleInstall
();
const
{
name
,
state
,
getData
,
onEditorEvent
,
onComponentEvent
,
onSearch
,
loadDraft
,
onSaveHistoryItem
,
onCancel
,
onRemoveHistoryItem
}
=
new
SearchFormControl
(
ctrlState
,
props
,
emit
).
moduleInstall
();
defineExpose
({
name
,
state
,
getData
});
</script>
</script>
<template>
<template>
<a-form
<a-form
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录