Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
cac6d3a2
提交
cac6d3a2
编写于
3月 21, 2022
作者:
Mosher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:更新路由计算逻辑
上级
9c8aa3ac
变更
8
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
54 行增加
和
46 行删除
+54
-46
AppEntityModel.java
...rc/main/java/cn/ibizlab/codegen/model/AppEntityModel.java
+14
-15
AppModel.java
...core/src/main/java/cn/ibizlab/codegen/model/AppModel.java
+5
-6
tab-exp-view-prop.ts
.../src/core/modules/views/tab-exp-view/tab-exp-view-prop.ts
+1
-1
tab-exp-view-state.ts
...src/core/modules/views/tab-exp-view/tab-exp-view-state.ts
+1
-1
tab-exp-panel-control-prop.ts
...dgets/tab-exp-panel-control/tab-exp-panel-control-prop.ts
+2
-2
tab-exp-panel-control-state.ts
...gets/tab-exp-panel-control/tab-exp-panel-control-state.ts
+2
-2
tab-exp-panel-control.ts
...es/widgets/tab-exp-panel-control/tab-exp-panel-control.ts
+10
-2
route-util.ts
...ces/templ/r7/app_{{apps}}/src/core/utils/ui/route-util.ts
+19
-17
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/AppEntityModel.java
浏览文件 @
cac6d3a2
...
...
@@ -51,22 +51,21 @@ public class AppEntityModel extends BaseModel{
appEntityResource
.
put
(
"deResPaths"
,
deResPaths
);
appEntityResources
.
add
(
appEntityResource
);
});
}
else
{
// 没有主从关系,路径就只有自己本身一个
JSONObject
appEntityResource
=
new
JSONObject
();
appEntityResource
.
put
(
"curCodeName"
,
appDataEntity
.
getCodeName
().
toLowerCase
());
appEntityResource
.
put
(
"path"
,
String
.
format
(
"%1$s/:%2$s?"
,
Inflector
.
getInstance
().
pluralize
(
appDataEntity
.
getCodeName
()),
appDataEntity
.
getCodeName
()).
toLowerCase
());
// 路由关系路径集合
List
deResPaths
=
new
JSONArray
();
// 实体本身关系路径节点
JSONObject
curResNode
=
new
JSONObject
();
curResNode
.
put
(
"pathName"
,
Inflector
.
getInstance
().
pluralize
(
appDataEntity
.
getCodeName
()).
toLowerCase
());
curResNode
.
put
(
"parameterName"
,
appDataEntity
.
getCodeName
().
toLowerCase
());
deResPaths
.
add
(
curResNode
);
appEntityResource
.
put
(
"deResPaths"
,
deResPaths
);
appEntityResource
.
put
(
"deResPathsString"
,
deResPaths
.
toString
());
appEntityResources
.
add
(
appEntityResource
);
}
// 本身路径
JSONObject
appEntityResource
=
new
JSONObject
();
appEntityResource
.
put
(
"curCodeName"
,
appDataEntity
.
getCodeName
().
toLowerCase
());
appEntityResource
.
put
(
"path"
,
String
.
format
(
"%1$s/:%2$s?"
,
Inflector
.
getInstance
().
pluralize
(
appDataEntity
.
getCodeName
()),
appDataEntity
.
getCodeName
()).
toLowerCase
());
// 路由关系路径集合
List
deResPaths
=
new
JSONArray
();
// 实体本身关系路径节点
JSONObject
curResNode
=
new
JSONObject
();
curResNode
.
put
(
"pathName"
,
Inflector
.
getInstance
().
pluralize
(
appDataEntity
.
getCodeName
()).
toLowerCase
());
curResNode
.
put
(
"parameterName"
,
appDataEntity
.
getCodeName
().
toLowerCase
());
deResPaths
.
add
(
curResNode
);
appEntityResource
.
put
(
"deResPaths"
,
deResPaths
);
appEntityResource
.
put
(
"deResPathsString"
,
deResPaths
.
toString
());
appEntityResources
.
add
(
appEntityResource
);
// 初始化界面行为
try
{
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/AppModel.java
浏览文件 @
cac6d3a2
...
...
@@ -54,13 +54,12 @@ public class AppModel extends BaseModel{
tempObj
.
put
(
"appDataEntity"
,
appDataEntity
);
appEntityResourceMap
.
put
(
String
.
format
(
"%1$s:%2$s"
,
majorCodeName
,
minorCodeName
),
tempObj
);
});
}
else
{
JSONObject
tempObj
=
new
JSONObject
();
tempObj
.
put
(
"curCodeName"
,
appDataEntity
.
getCodeName
().
toLowerCase
());
tempObj
.
put
(
"path"
,
String
.
format
(
"%1$s/:%2$s?"
,
Inflector
.
getInstance
().
pluralize
(
appDataEntity
.
getCodeName
()),
appDataEntity
.
getCodeName
()).
toLowerCase
());
tempObj
.
put
(
"appDataEntity"
,
appDataEntity
);
appEntityResourceMap
.
put
(
appDataEntity
.
getCodeName
(),
tempObj
);
}
JSONObject
tempObj
=
new
JSONObject
();
tempObj
.
put
(
"curCodeName"
,
appDataEntity
.
getCodeName
().
toLowerCase
());
tempObj
.
put
(
"path"
,
String
.
format
(
"%1$s/:%2$s?"
,
Inflector
.
getInstance
().
pluralize
(
appDataEntity
.
getCodeName
()),
appDataEntity
.
getCodeName
()).
toLowerCase
());
tempObj
.
put
(
"appDataEntity"
,
appDataEntity
);
appEntityResourceMap
.
put
(
appDataEntity
.
getCodeName
(),
tempObj
);
});
}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/tab-exp-view/tab-exp-view-prop.ts
浏览文件 @
cac6d3a2
import
{
ExpViewProps
}
from
"@core"
;
/**
* @description
树
导航视图props
* @description
分页
导航视图props
* @export
* @interface TabExpViewProps
* @extends {ExpViewProps}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/tab-exp-view/tab-exp-view-state.ts
浏览文件 @
cac6d3a2
import
{
ExpViewState
}
from
'@core'
;
/**
* @description
树
导航视图状态
* @description
分页
导航视图状态
* @export
* @interface TabExpViewState
* @extends {ExpViewState}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/tab-exp-panel-control/tab-exp-panel-control-prop.ts
浏览文件 @
cac6d3a2
import
{
IParam
,
MainControlProps
}
from
"@core"
;
/**
* @description
搜索栏部件的
props
* @description
分页导航部件
props
* @export
* @interface TabExpPanelControlProps
* @extends {MainControlProps}
...
...
@@ -16,5 +16,5 @@ export interface TabExpPanelControlProps extends MainControlProps {
/**
* 默认打开的分页name
*/
defaultActivePanel
?
:
string
;
defaultActivePanel
:
string
;
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/tab-exp-panel-control/tab-exp-panel-control-state.ts
浏览文件 @
cac6d3a2
import
{
IParam
,
MainControlState
}
from
'@core'
;
import
{
MainControlState
}
from
'@core'
;
/**
* @description
搜索栏部件
状态
* @description
分页导航面板
状态
* @export
* @interface TabExpPanelControlState
* @extends {MainControlState}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/tab-exp-panel-control/tab-exp-panel-control.ts
浏览文件 @
cac6d3a2
import
{
UIUtil
,
deepCopy
,
IActionParam
,
IParam
,
MainControl
,
TabExpPanelControlState
,
TabExpPanelControlProps
}
from
'@core'
;
import
{
MainControl
,
TabExpPanelControlState
,
TabExpPanelControlProps
}
from
'@core'
;
/**
* @description 分页导航部件
...
...
@@ -16,9 +16,17 @@ export class TabExpPanelControl extends MainControl {
public
declare
state
:
TabExpPanelControlState
;
/**
* 分页导航部件输出参数
*
* @type {TabExpPanelControlProps}
* @memberof TabExpPanelControl
*/
public
setState
()
{
public
declare
props
:
TabExpPanelControlProps
;
/**
* @memberof TabExpPanelControl
*/
public
setState
()
{
super
.
setState
();
this
.
state
.
tabPosition
=
toRef
(
this
.
props
,
'tabPosition'
)
as
any
;
this
.
state
.
activePanel
=
this
.
props
.
defaultActivePanel
;
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/utils/ui/route-util.ts
浏览文件 @
cac6d3a2
...
...
@@ -59,7 +59,7 @@ export class RouteUtil {
public
static
getDeResRoutePath
(
context
:
any
=
{},
deResPaths
:
any
[]):
string
{
let
routePath
:
string
=
''
;
// 首先给deResPaths排序,关系多的排前面。
deResPaths
.
sort
((
a
:
any
[],
b
:
any
[])
=>
a
.
length
-
b
.
length
);
deResPaths
.
sort
((
a
:
any
[],
b
:
any
[])
=>
b
.
length
-
a
.
length
);
// 最多匹配路径节点数
let
maxMatch
:
number
=
0
;
...
...
@@ -118,7 +118,7 @@ export class RouteUtil {
public
static
buildDeResRequestPath
(
context
:
any
=
{},
deResPaths
:
any
[]):
string
{
let
routePath
:
string
=
''
;
// 首先给deResPaths排序,关系多的排前面。
deResPaths
.
sort
((
a
:
any
[],
b
:
any
[])
=>
a
.
length
-
b
.
length
);
deResPaths
.
sort
((
a
:
any
[],
b
:
any
[])
=>
b
.
length
-
a
.
length
);
// 最多匹配路径节点数
let
maxMatch
:
number
=
0
;
...
...
@@ -135,20 +135,22 @@ export class RouteUtil {
deResPath
.
some
((
deResNode
:
any
,
index
:
number
)
=>
{
let
value
:
any
=
context
[
deResNode
.
parameterName
];
// 如果不是最后一条,则正常拼接,否则会一直拼接
if
(
index
!==
deResPath
.
length
-
1
)
{
if
(
notEmpty
(
value
))
{
// 存在关系
if
(
deResPath
.
length
>
1
)
{
if
(
index
!==
deResPath
.
length
-
1
)
{
if
(
notEmpty
(
value
))
{
curMatch
++
;
curRoutPath
+=
`/
${
deResNode
.
pathName
}
/
${
value
}
`
;
}
else
{
// 只要有一个主关系节点没值,则整个路径作废。
curMatch
=
0
;
curRoutPath
=
''
;
return
true
;
}
}
else
{
// 该实体本身主键正常拼接
curMatch
++
;
curRoutPath
+=
`/
${
deResNode
.
pathName
}
/
${
value
}
`
;
}
else
{
// 只要有一个节点没值,则整个路径作废。
curMatch
=
0
;
curRoutPath
=
''
;
return
true
curRoutPath
+=
`/
${
deResNode
.
pathName
}
/
${
notEmpty
(
value
)
?
value
:
'undefined'
}
`
;
}
}
else
{
curMatch
++
;
curRoutPath
+=
`/
${
deResNode
.
pathName
}
/
${
notEmpty
(
value
)
?
value
:
'undefined'
}
`
;
}
});
...
...
@@ -160,9 +162,9 @@ export class RouteUtil {
});
// 如果一个匹配的没有,即没有任何主键匹配上,关系路径为实体自身的/pathName/undefined
//
if(routePath == ''){
//
routePath = "/"+deResPaths[deResPaths.length -1][0].pathName+"/undefined";
//
}
if
(
routePath
==
''
){
routePath
=
"/"
+
deResPaths
[
deResPaths
.
length
-
1
][
0
].
pathName
+
"/undefined"
;
}
return
routePath
;
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录