Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
e74dc6ef
提交
e74dc6ef
编写于
1月 07, 2022
作者:
tony001
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add:新增上下文、视图参数处理
上级
e754676d
变更
13
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
90 行增加
和
51 行删除
+90
-51
auto-complete.hbs
...c/main/resources/templ/r7/@macro/editor/auto-complete.hbs
+2
-2
checkbox-list.hbs
...c/main/resources/templ/r7/@macro/editor/checkbox-list.hbs
+2
-2
data-picker-view.hbs
...ain/resources/templ/r7/@macro/editor/data-picker-view.hbs
+2
-2
data-picker.hbs
...src/main/resources/templ/r7/@macro/editor/data-picker.hbs
+2
-2
dropdown-list.hbs
...c/main/resources/templ/r7/@macro/editor/dropdown-list.hbs
+2
-2
radio-group.hbs
...src/main/resources/templ/r7/@macro/editor/radio-group.hbs
+2
-2
span.hbs
...r-core/src/main/resources/templ/r7/@macro/editor/span.hbs
+2
-2
navparam.hbs
...n/resources/templ/r7/@macro/front-end/common/navparam.hbs
+1
-0
viewBaseConfig.hbs
.../templ/r7/@macro/front-end/view/common/viewBaseConfig.hbs
+2
-0
view-base.ts
...pp_{{apps}}/src/core/modules/views/view-base/view-base.ts
+45
-24
view-state-base.ts
...pps}}/src/core/modules/views/view-base/view-state-base.ts
+17
-1
interceptor.ts
...s/templ/r7/app_{{apps}}/src/core/utils/net/interceptor.ts
+0
-1
ui-util.ts
...ources/templ/r7/app_{{apps}}/src/core/utils/ui/ui-util.ts
+11
-11
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/editor/auto-complete.hbs
浏览文件 @
e74dc6ef
...
...
@@ -10,10 +10,10 @@
:context=
"state.context"
:viewParams=
"state.viewParams"
{{#if
item
.
psEditor
.
psNavigateContexts
}}
localContext=
"
{{
item
.
psEditor
.
psNavigateContexts
}}
"
localContext=
"
{{
>
@macro
/
front-end
/
common
/
navparam
.
hbs
appNavParams
=
item
.
psEditor
.
psNavigateContexts
}}
"
{{/if}}
{{#if
item
.
psEditor
.
psNavigateParams
}}
localParam=
"
{{
item
.
psEditor
.
psNavigateParams
}}
"
localParam=
"
{{
>
@macro
/
front-end
/
common
/
navparam
.
hbs
appNavParams
=
item
.
psEditor
.
psNavigateParams
}}
"
{{/if}}
{{#if
item
.
psEditor
.
psAppDataEntity
}}
{{!-- deMajorField="getDeMajorField({{item.psEditor.psAppDataEntity.codeName}})" --}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/editor/checkbox-list.hbs
浏览文件 @
e74dc6ef
...
...
@@ -13,10 +13,10 @@
valueSeparator=
"
{{
item
.
psEditor
.
codeList
.
valueSeparator
}}
"
{{/if}}
{{#if
item
.
psEditor
.
psNavigateContexts
}}
localContext=
"
{{
item
.
psEditor
.
psNavigateContexts
}}
"
localContext=
"
{{
>
@macro
/
front-end
/
common
/
navparam
.
hbs
appNavParams
=
item
.
psEditor
.
psNavigateContexts
}}
"
{{/if}}
{{#if
item
.
psEditor
.
psNavigateParams
}}
localParam=
"
{{
item
.
psEditor
.
psNavigateParams
}}
"
localParam=
"
{{
>
@macro
/
front-end
/
common
/
navparam
.
hbs
appNavParams
=
item
.
psEditor
.
psNavigateParams
}}
"
{{/if}}
:context=
"state.context"
:viewParams=
"state.viewParams"
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/editor/data-picker-view.hbs
浏览文件 @
e74dc6ef
...
...
@@ -11,10 +11,10 @@
disabled=
"
{{
item
.
psEditor
.
disabled
}}
"
{{/if}}
{{#if
item
.
psEditor
.
psNavigateContexts
}}
localContext=
"
{{
item
.
psEditor
.
psNavigateContexts
}}
"
localContext=
"
{{
>
@macro
/
front-end
/
common
/
navparam
.
hbs
appNavParams
=
item
.
psEditor
.
psNavigateContexts
}}
"
{{/if}}
{{#if
item
.
psEditor
.
psNavigateParams
}}
localParam=
"
{{
item
.
psEditor
.
psNavigateParams
}}
"
localParam=
"
{{
>
@macro
/
front-end
/
common
/
navparam
.
hbs
appNavParams
=
item
.
psEditor
.
psNavigateParams
}}
"
{{/if}}
:context=
"state.context"
:viewParams=
"state.viewParams"
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/editor/data-picker.hbs
浏览文件 @
e74dc6ef
...
...
@@ -11,10 +11,10 @@
disabled=
"
{{
item
.
psEditor
.
disabled
}}
"
{{/if}}
{{#if
item
.
psEditor
.
psNavigateContexts
}}
localContext=
"
{{
item
.
psEditor
.
psNavigateContexts
}}
"
localContext=
"
{{
>
@macro
/
front-end
/
common
/
navparam
.
hbs
appNavParams
=
item
.
psEditor
.
psNavigateContexts
}}
"
{{/if}}
{{#if
item
.
psEditor
.
psNavigateParams
}}
localParam=
"
{{
item
.
psEditor
.
psNavigateParams
}}
"
localParam=
"
{{
>
@macro
/
front-end
/
common
/
navparam
.
hbs
appNavParams
=
item
.
psEditor
.
psNavigateParams
}}
"
{{/if}}
:context=
"state.context"
:viewParams=
"state.viewParams"
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/editor/dropdown-list.hbs
浏览文件 @
e74dc6ef
...
...
@@ -16,10 +16,10 @@
:multiple=
"
{{
item
.
psEditor
.
editorParams
.
multiple
}}
"
{{/if}}
{{#if
item
.
psEditor
.
psNavigateContexts
}}
localContext=
"
{{
item
.
psEditor
.
psNavigateContexts
}}
"
localContext=
"
{{
>
@macro
/
front-end
/
common
/
navparam
.
hbs
appNavParams
=
item
.
psEditor
.
psNavigateContexts
}}
"
{{/if}}
{{#if
item
.
psEditor
.
psNavigateParams
}}
localParam=
"
{{
item
.
psEditor
.
psNavigateParams
}}
"
localParam=
"
{{
>
@macro
/
front-end
/
common
/
navparam
.
hbs
appNavParams
=
item
.
psEditor
.
psNavigateParams
}}
"
{{/if}}
{{#
eq
item
.
psEditor
.
editorType
"MDROPDOWNLIST"
}}
:multiple=
"true"
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/editor/radio-group.hbs
浏览文件 @
e74dc6ef
...
...
@@ -13,10 +13,10 @@
:readonly=
"
{{
item
.
psEditor
.
isReadOnly
}}
"
{{/if}}
{{#if
item
.
psEditor
.
psNavigateContexts
}}
localContext=
"
{{
item
.
psEditor
.
psNavigateContexts
}}
"
localContext=
"
{{
>
@macro
/
front-end
/
common
/
navparam
.
hbs
appNavParams
=
item
.
psEditor
.
psNavigateContexts
}}
"
{{/if}}
{{#if
item
.
psEditor
.
psNavigateParams
}}
localParam=
"
{{
item
.
psEditor
.
psNavigateParams
}}
"
localParam=
"
{{
>
@macro
/
front-end
/
common
/
navparam
.
hbs
appNavParams
=
item
.
psEditor
.
psNavigateParams
}}
"
{{/if}}
:context=
"state.context"
:viewParams=
"state.viewParams"
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/editor/span.hbs
浏览文件 @
e74dc6ef
...
...
@@ -17,10 +17,10 @@
:precision=
"
{{
item
.
psEditor
.
precision
}}
"
{{/if}}
{{#if
item
.
psEditor
.
psNavigateContexts
}}
localContext=
"
{{
item
.
psEditor
.
psNavigateContexts
}}
"
localContext=
"
{{
>
@macro
/
front-end
/
common
/
navparam
.
hbs
appNavParams
=
item
.
psEditor
.
psNavigateContexts
}}
"
{{/if}}
{{#if
item
.
psEditor
.
psNavigateParams
}}
localParam=
"
{{
item
.
psEditor
.
psNavigateParams
}}
"
localParam=
"
{{
>
@macro
/
front-end
/
common
/
navparam
.
hbs
appNavParams
=
item
.
psEditor
.
psNavigateParams
}}
"
{{/if}}
{{#if
(
or
(
eq
ctrlType
'form'
)
(
eq
ctrlType
'panel'
))
}}
:value=
"state.data.
{{
item
.
psEditor
.
name
}}
"
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/common/navparam.hbs
0 → 100644
浏览文件 @
e74dc6ef
{
{{#
appNavParams
}}
'
{{
lowerCase
getKey
}}
':
{{#if
(
eq
isRawValue
true
)
}}
'
{{
lowerCase
getValue
}}
'
{{else}}
'%
{{
lowerCase
getValue
}}
%'
{{/if}}{{#
unless
@last
}}
,
{{/
unless
}}{{/
appNavParams
}}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/view/common/viewBaseConfig.hbs
浏览文件 @
e74dc6ef
...
...
@@ -14,6 +14,8 @@
showCaptionBar: '
{{
page
.
viewStyle
}}
',
xDataControlName:'
{{
page
.
xDataControlName
}}
',
openDataViewName:'ExampleEditorEditView',
appViewNavContexts:
{{>
@macro
/
front-end
/
common
/
navparam
.
hbs
appNavParams
=
page
.
psAppViewNavContexts
}}
,
appViewNavParams:
{{>
@macro
/
front-end
/
common
/
navparam
.
hbs
appNavParams
=
page
.
getPSAppViewNavParams
}}
,
viewToolbarModel: [
{{#
page
.
viewToolBarItems
}}
{{#
items
}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/view-base/view-base.ts
浏览文件 @
e74dc6ef
import
{
Ref
}
from
'vue'
;
import
{
useRoute
}
from
'vue-router'
;
import
{
ViewPropsBase
,
ViewStateBase
,
UIBase
,
IParam
}
from
'@core'
;
import
{
ViewPropsBase
,
ViewStateBase
,
UIBase
,
IParam
,
UIUtil
}
from
'@core'
;
/**
* @description 视图基类
...
...
@@ -8,7 +8,7 @@ import { ViewPropsBase, ViewStateBase, UIBase, IParam } from '@core';
* @class ViewBase
*/
export
class
ViewBase
{
/**
* @description 视图状态
* @type {ViewStateBase}
...
...
@@ -44,27 +44,48 @@ export class ViewBase {
* @param viewParams 视图参数
*/
public
handleViewContextParams
(
props
:
ViewPropsBase
,
context
:
Ref
<
IParam
|
undefined
>
,
viewParams
:
Ref
<
IParam
|
undefined
>
)
{
if
(
!
context
.
value
)
context
.
value
=
{};
if
(
!
viewParams
.
value
)
viewParams
.
value
=
{};
if
(
Object
.
is
(
props
.
openType
,
'ROUTE'
))
{
const
appContext
=
{};
Object
.
assign
(
context
.
value
,
appContext
);
const
pageContext
=
useRoute
().
params
;
Object
.
assign
(
context
.
value
,
pageContext
);
const
pageCustomContext
=
{};
Object
.
assign
(
context
.
value
,
pageCustomContext
);
console
.
log
(
context
);
const
pageViewParams
=
useRoute
().
query
;
Object
.
assign
(
viewParams
.
value
,
pageViewParams
);
const
pageCustomViewParams
=
{};
Object
.
assign
(
viewParams
.
value
,
pageCustomViewParams
);
console
.
log
(
viewParams
);
}
else
{
const
customContext
=
{};
Object
.
assign
(
context
.
value
,
customContext
);
const
pageCustomViewParams
=
{};
Object
.
assign
(
viewParams
.
value
,
pageCustomViewParams
);
if
(
!
context
.
value
)
context
.
value
=
{};
if
(
!
viewParams
.
value
)
viewParams
.
value
=
{};
if
(
Object
.
is
(
props
.
openType
,
'ROUTE'
))
{
// 应用上下文
const
appContext
=
App
.
getAppData
();
Object
.
assign
(
context
.
value
,
appContext
);
// 视图应用上下文
const
pageContext
=
{};
const
routeParams
=
useRoute
().
params
;
if
(
routeParams
&&
(
Object
.
keys
(
routeParams
).
length
>
0
))
{
Object
.
keys
(
routeParams
).
forEach
((
key
:
string
)
=>
{
if
(
routeParams
[
key
])
{
Object
.
assign
(
pageContext
,
{
[
key
]:
decodeURIComponent
(
routeParams
[
key
]
as
string
)
});
}
})
}
Object
.
assign
(
context
.
value
,
pageContext
);
// 视图参数
const
pageViewParams
=
{};
const
routeQuerys
=
useRoute
().
query
;
if
(
routeQuerys
&&
(
Object
.
keys
(
routeQuerys
).
length
>
0
))
{
Object
.
keys
(
routeQuerys
).
forEach
((
key
:
string
)
=>
{
if
(
routeQuerys
[
key
])
{
Object
.
assign
(
pageViewParams
,
{
[
key
]:
routeQuerys
[
key
]
});
}
})
}
Object
.
assign
(
viewParams
.
value
,
pageViewParams
);
// 视图自定义应用上下文
const
pageCustomContext
=
UIUtil
.
computedNavData
(
null
,
context
.
value
,
viewParams
.
value
,
this
.
viewState
.
appViewNavContexts
);
Object
.
assign
(
context
.
value
,
pageCustomContext
);
// 视图自定义视图参数
const
pageCustomViewParams
=
UIUtil
.
computedNavData
(
null
,
context
.
value
,
viewParams
.
value
,
this
.
viewState
.
appViewNavParams
);
Object
.
assign
(
viewParams
.
value
,
pageCustomViewParams
);
}
else
{
// 视图自定义应用上下文
const
customContext
=
UIUtil
.
computedNavData
(
null
,
context
.
value
,
viewParams
.
value
,
this
.
viewState
.
appViewNavContexts
);
Object
.
assign
(
context
.
value
,
customContext
);
// 视图自定义视图参数
const
pageCustomViewParams
=
UIUtil
.
computedNavData
(
null
,
context
.
value
,
viewParams
.
value
,
this
.
viewState
.
appViewNavParams
);
Object
.
assign
(
viewParams
.
value
,
pageCustomViewParams
);
}
}
/**
...
...
@@ -79,7 +100,7 @@ export class ViewBase {
// 导航视图参数处理
this
.
handleViewContextParams
(
props
,
context
,
viewParams
);
watch
(
context
,
(
newVal
:
any
,
oldVal
:
any
)
=>
{
this
.
handleViewContextParams
(
props
,
newVal
,
viewParams
);
this
.
handleViewContextParams
(
props
,
newVal
,
viewParams
);
});
// 把Ref赋值到State上进行解包
this
.
viewState
.
context
=
context
;
...
...
@@ -92,7 +113,7 @@ export class ViewBase {
* @param {ViewPropsBase} props 传入参数
* @memberof ViewBase
*/
public
useCounterService
(
props
:
ViewPropsBase
)
{
}
public
useCounterService
(
props
:
ViewPropsBase
)
{
}
/**
* @description 安装视图所有功能模块的方法
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/view-base/view-state-base.ts
浏览文件 @
e74dc6ef
...
...
@@ -7,7 +7,7 @@ import { IActionParam, IParam } from '@core';
* @interface ViewStateBase
*/
export
interface
ViewStateBase
{
/**
* @description 视图名称
* @type {string}
...
...
@@ -50,6 +50,22 @@ export interface 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/core/utils/net/interceptor.ts
浏览文件 @
e74dc6ef
...
...
@@ -77,7 +77,6 @@ export class Interceptors {
if
(
!
Object
.
is
(
Environment
.
BaseUrl
,
""
)
&&
!
config
.
url
.
startsWith
(
'https://'
)
&&
!
config
.
url
.
startsWith
(
'http://'
)
&&
!
config
.
url
.
startsWith
(
'./assets'
))
{
config
.
url
=
Environment
.
BaseUrl
+
config
.
url
;
}
console
.
log
(
config
);
return
config
;
},
(
error
:
any
)
=>
{
return
Promise
.
reject
(
error
);
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/utils/ui/ui-util.ts
浏览文件 @
e74dc6ef
...
...
@@ -60,15 +60,15 @@ export class UIUtil {
/**
* @description 计算导航数据
* 先从当前
数据目标
计算,然后再从当前上下文计算,最后从当前视图参数计算,没有则为null
* 先从当前
激活数据
计算,然后再从当前上下文计算,最后从当前视图参数计算,没有则为null
* @export
* @param {*}
data 当前数据目标
* @param {*}
parentC
ontext 当前上下文
* @param {*}
parent
Param 当前视图参数
* @param {*}
activedata 当前激活数据
* @param {*}
c
ontext 当前上下文
* @param {*}
view
Param 当前视图参数
* @param {*} params 导航参数
* @return {*}
*/
public
static
computedNavData
(
data
:
any
,
parentContext
:
any
,
parent
Param
:
any
,
params
:
any
):
any
{
public
static
computedNavData
(
activedata
:
any
,
context
:
any
,
view
Param
:
any
,
params
:
any
):
any
{
const
_data
:
any
=
{};
if
(
params
&&
Object
.
keys
(
params
).
length
>
0
)
{
Object
.
keys
(
params
).
forEach
((
name
:
string
)
=>
{
...
...
@@ -78,12 +78,12 @@ export class UIUtil {
let
value
:
string
|
null
=
params
[
name
];
if
(
value
&&
value
.
toString
().
startsWith
(
'%'
)
&&
value
.
toString
().
endsWith
(
'%'
))
{
const
key
=
value
.
substring
(
1
,
value
.
length
-
1
).
toLowerCase
();
if
(
data
&&
data
.
hasOwnProperty
(
key
))
{
value
=
data
[
key
];
}
else
if
(
parentContext
&&
parentC
ontext
[
key
])
{
value
=
parentC
ontext
[
key
];
}
else
if
(
parentParam
&&
parent
Param
[
key
])
{
value
=
parent
Param
[
key
];
if
(
activedata
&&
active
data
.
hasOwnProperty
(
key
))
{
value
=
active
data
[
key
];
}
else
if
(
context
&&
c
ontext
[
key
])
{
value
=
c
ontext
[
key
];
}
else
if
(
viewParam
&&
view
Param
[
key
])
{
value
=
view
Param
[
key
];
}
else
{
value
=
null
;
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录