Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
da5b4d9f
提交
da5b4d9f
编写于
1月 18, 2022
作者:
RedPig97
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add: 新增导航数据服务
上级
a3d91f4d
变更
10
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
307 行增加
和
7 行删除
+307
-7
app.ts
...e/src/main/resources/templ/r7/app_{{apps}}/src/app/app.ts
+11
-2
i-app.ts
...ces/templ/r7/app_{{apps}}/src/core/interface/app/i-app.ts
+8
-1
i-nav-data-service.ts
...{{apps}}/src/core/interface/service/i-nav-data-service.ts
+26
-0
index.ts
...templ/r7/app_{{apps}}/src/core/interface/service/index.ts
+2
-1
app-base.ts
...es/templ/r7/app_{{apps}}/src/core/modules/app/app-base.ts
+10
-1
view-base.ts
...pp_{{apps}}/src/core/modules/views/view-base/view-base.ts
+13
-1
index.ts
.../r7/app_{{apps}}/src/core/service/common-service/index.ts
+2
-0
navdata-param.ts
...{{apps}}/src/core/service/common-service/navdata-param.ts
+52
-0
navdata-service.ts
...apps}}/src/core/service/common-service/navdata-service.ts
+181
-0
index.ts
...resources/templ/r7/app_{{apps}}/src/core/service/index.ts
+2
-1
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/app/app.ts
浏览文件 @
da5b4d9f
import
{
Environment
}
from
"@/environments/environment"
;
import
{
Environment
}
from
"@/environments/environment"
;
import
{
OpenViewService
}
from
"@/utils"
;
import
{
OpenViewService
}
from
"@/utils"
;
import
{
AppBase
,
IParam
,
ViewDetail
,
IApp
,
IOpenViewService
,
deepCopy
,
getSessionStorage
,
Http
,
AppUtil
}
from
"@core"
;
import
{
AppBase
,
IParam
,
ViewDetail
,
IApp
,
IOpenViewService
,
deepCopy
,
getSessionStorage
,
Http
,
AppUtil
,
NavDataService
,
INavDataService
}
from
"@core"
;
import
{
SyncSeriesHook
}
from
"qx-util"
;
import
{
SyncSeriesHook
}
from
"qx-util"
;
import
{
AppFuncConfig
,
AppViewConfig
,
AppEntityConfig
}
from
'./config'
;
import
{
AppFuncConfig
,
AppViewConfig
,
AppEntityConfig
}
from
'./config'
;
import
{
DataServiceRegister
,
UIServiceRegister
}
from
"./register"
;
import
{
DataServiceRegister
,
UIServiceRegister
}
from
"./register"
;
...
@@ -139,7 +139,16 @@ export class App extends AppBase implements IApp {
...
@@ -139,7 +139,16 @@ export class App extends AppBase implements IApp {
* @return {*}
* @return {*}
*/
*/
public
getEntityInfo
(
codeName
:
string
):
any
{
public
getEntityInfo
(
codeName
:
string
):
any
{
return
AppEntityConfig
[
codeName
]
?
deepCopy
(
AppEntityConfig
[
codeName
])
:
undefined
;;
return
AppEntityConfig
[
codeName
]
?
deepCopy
(
AppEntityConfig
[
codeName
])
:
undefined
;
}
/**
* @description 获取导航数据服务
* @return {*} {*}
* @memberof App
*/
public
getNavDataService
():
INavDataService
{
return
NavDataService
.
getInstance
();
}
}
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/interface/app/i-app.ts
浏览文件 @
da5b4d9f
import
{
IParam
,
ViewDetail
}
from
"../common"
;
import
{
IParam
,
ViewDetail
}
from
"../common"
;
import
{
IAppFuncService
,
IDataServiceRegister
,
IOpenViewService
,
IUIServiceRegister
}
from
"../service"
;
import
{
IAppFuncService
,
IDataServiceRegister
,
I
NavDataService
,
I
OpenViewService
,
IUIServiceRegister
}
from
"../service"
;
/**
/**
...
@@ -99,4 +99,11 @@ export interface IApp {
...
@@ -99,4 +99,11 @@ export interface IApp {
*/
*/
setAppData
(
opt
:
IParam
):
void
;
setAppData
(
opt
:
IParam
):
void
;
/**
* @description 获取导航数据服务
* @return {*} {INavDataService}
* @memberof IApp
*/
getNavDataService
():
INavDataService
;
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/interface/service/i-nav-data-service.ts
0 → 100644
浏览文件 @
da5b4d9f
import
{
INavDataParam
,
IParam
,
ViewDetail
}
from
"@core"
;
import
{
Subject
}
from
'rxjs'
;
/**
* @description 打开视图服务接口
* @export
* @interface INavDataService
*/
export
interface
INavDataService
{
addNavData
(
curNavData
:
INavDataParam
):
void
;
getNavData
():
Array
<
INavDataParam
>
;
getPreNavData
(
tag
:
string
):
INavDataParam
|
null
;
skipNavData
(
tag
:
string
):
void
;
removeNavData
(
tag
:
string
):
void
;
removeNavDataFirst
():
void
;
removeNavDataLast
():
void
;
removeAllNavData
():
void
;
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/interface/service/index.ts
浏览文件 @
da5b4d9f
...
@@ -2,4 +2,5 @@ export * from './i-app-func-service';
...
@@ -2,4 +2,5 @@ export * from './i-app-func-service';
export
*
from
'./i-app-action-service'
;
export
*
from
'./i-app-action-service'
;
export
*
from
'./i-open-view-service'
;
export
*
from
'./i-open-view-service'
;
export
*
from
'./i-data-service-register'
;
export
*
from
'./i-data-service-register'
;
export
*
from
'./i-ui-service-register'
;
export
*
from
'./i-ui-service-register'
;
\ No newline at end of file
export
*
from
'./i-nav-data-service'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/app/app-base.ts
浏览文件 @
da5b4d9f
import
{
AppFuncService
,
IApp
,
IAppFuncService
,
IOpenViewService
,
ViewDetail
}
from
"@core"
;
import
{
AppFuncService
,
IApp
,
IAppFuncService
,
IOpenViewService
,
ViewDetail
}
from
"@core"
;
import
{
IDataServiceRegister
,
IParam
,
IUIServiceRegister
}
from
"@core/interface"
;
import
{
IDataServiceRegister
,
I
NavDataService
,
I
Param
,
IUIServiceRegister
}
from
"@core/interface"
;
/**
/**
* 应用基类
* 应用基类
...
@@ -120,4 +120,13 @@ export abstract class AppBase implements IApp {
...
@@ -120,4 +120,13 @@ export abstract class AppBase implements IApp {
public
getViewInfo
(
codeName
:
string
):
ViewDetail
|
undefined
{
public
getViewInfo
(
codeName
:
string
):
ViewDetail
|
undefined
{
return
undefined
;
return
undefined
;
}
}
/**
* @description 获取导航数据服务
* @return {*} {INavDataService}
* @memberof AppBase
*/
public
getNavDataService
():
INavDataService
{
throw
new
Error
(
"Method not implemented."
);
}
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/view-base/view-base.ts
浏览文件 @
da5b4d9f
...
@@ -194,7 +194,19 @@ export class ViewBase {
...
@@ -194,7 +194,19 @@ export class ViewBase {
*
*
* @memberof ViewBase
* @memberof ViewBase
*/
*/
public
useViewInit
()
{
}
public
useViewInit
()
{
const
route
=
useRoute
();
App
.
getNavDataService
().
addNavData
({
title
:
this
.
state
.
viewCaption
,
viewType
:
this
.
state
.
viewType
,
path
:
unref
(
route
.
fullPath
),
openType
:
this
.
props
.
openType
,
tag
:
this
.
state
.
viewCodeName
,
key
:
''
,
data
:
{}});
}
/**
* @description 视图销毁
* @memberof ViewBase
*/
public
useViewDestroyed
()
{
// 视图销毁从导航栈里面删除数据
App
.
getNavDataService
().
removeNavData
(
this
.
state
.
viewCodeName
);
}
/**
/**
* @description 安装视图所有功能模块的方法
* @description 安装视图所有功能模块的方法
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/service/common-service/index.ts
0 → 100644
浏览文件 @
da5b4d9f
export
*
from
'./navdata-service'
;
export
*
from
'./navdata-param'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/service/common-service/navdata-param.ts
0 → 100644
浏览文件 @
da5b4d9f
import
{
IParam
}
from
'@core'
;
export
interface
INavDataParam
{
/**
* @description 视图标题
* @type {*}
* @memberof INavDataParam
*/
title
:
string
;
/**
* @description 视图数据
* @type {*}
* @memberof INavDataParam
*/
data
:
IParam
;
/**
* @description 视图路径
* @type {string}
* @memberof INavDataParam
*/
path
:
string
;
/**
* @description 视图打开模式("ROUTE" | "MODAL" | "EMBED")
* @type {("ROUTE" | "MODAL" | "EMBED")}
* @memberof INavDataParam
*/
openType
:
"ROUTE"
|
"MODAL"
|
"EMBED"
;
/**
* @description 视图类型
* @type {string}
* @memberof INavDataParam
*/
viewType
:
string
;
/**
* @description 视图标识
* @type {string}
* @memberof INavDataParam
*/
tag
:
string
;
/**
* @description 数据标识
* @type {*}
* @memberof INavDataParam
*/
key
:
string
;
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/service/common-service/navdata-service.ts
0 → 100644
浏览文件 @
da5b4d9f
import
{
IActionParam
,
INavDataService
}
from
'@core'
;
import
{
Subject
}
from
'rxjs'
;
import
{
INavDataParam
}
from
'./navdata-param'
;
/**
* 导航数据服务
*
* @export
* @class CodeListService
*/
export
class
NavDataService
implements
INavDataService
{
/**
* 单例变量声明
*
* @private
* @static
* @type {NavDataService}
* @memberof NavDataService
*/
private
static
navDataService
:
NavDataService
;
/**
* 服务状态
*
* @memberof NavDataService
*/
public
serviceState
:
Subject
<
IActionParam
>
=
new
Subject
();
/**
* 导航数据栈
*
* @memberof NavDataService
*/
public
navDataStack
:
Array
<
INavDataParam
>
=
[];
/**
* 初始化实例
*
* @memberof NavDataService
*/
constructor
(
opts
:
any
=
{})
{
}
/**
* 获取 NavDataService 单例对象
*
* @static
* @returns {NavDataService}
* @memberof NavDataService
*/
public
static
getInstance
():
NavDataService
{
if
(
!
NavDataService
.
navDataService
)
{
NavDataService
.
navDataService
=
new
NavDataService
();
}
return
this
.
navDataService
;
}
/**
* 添加基础导航数据到栈中
*
* @memberof NavDataService
*/
public
addNavData
(
curNavData
:
INavDataParam
)
{
this
.
navDataStack
.
push
(
curNavData
);
}
/**
* 设置指定数据到基础导航数据栈中
*
* @memberof NavDataService
*/
public
setNavDataByTag
(
tag
:
string
,
isSingleMode
:
boolean
,
data
:
any
)
{
if
(
this
.
navDataStack
.
length
>
0
)
{
let
tempIndex
:
number
=
this
.
navDataStack
.
findIndex
((
element
:
INavDataParam
)
=>
{
return
Object
.
is
(
element
.
tag
,
tag
);
})
if
(
this
.
navDataStack
[
tempIndex
]){
this
.
navDataStack
[
tempIndex
].
data
=
data
;
if
(
isSingleMode
&&
data
.
srfkey
&&
data
.
srfmajortext
)
{
this
.
navDataStack
[
tempIndex
].
key
=
data
.
srfkey
;
this
.
navDataStack
[
tempIndex
].
title
=
data
.
srfmajortext
;
}
return
this
.
navDataStack
[
tempIndex
];
}
else
{
return
null
;
}
}
else
{
return
null
;
}
}
/**
* 获取基础导航数据
*
* @memberof NavDataService
*/
public
getNavData
()
{
return
this
.
navDataStack
;
}
/**
* 从导航数据栈中获取指定数据的前一条数据
*
* @memberof NavDataService
*/
public
getPreNavData
(
tag
:
string
)
{
if
(
this
.
navDataStack
.
length
>
0
)
{
let
tempIndex
:
number
=
this
.
navDataStack
.
findIndex
((
element
:
INavDataParam
)
=>
{
return
Object
.
is
(
element
.
tag
,
tag
);
})
return
this
.
navDataStack
[
tempIndex
-
1
];
}
else
{
return
null
;
}
}
/**
* 跳转到导航数据栈中指定数据
*
* @memberof NavDataService
*/
public
skipNavData
(
tag
:
string
)
{
if
((
this
.
navDataStack
.
length
>
0
)
&&
tag
)
{
let
tempIndex
:
number
=
this
.
navDataStack
.
findIndex
((
element
:
INavDataParam
)
=>
{
return
Object
.
is
(
element
.
tag
,
tag
);
})
if
(
tempIndex
!==
-
1
)
{
this
.
navDataStack
=
this
.
navDataStack
.
slice
(
0
,
tempIndex
+
1
);
}
}
}
/**
* 从导航数据栈中指定数据
*
* @memberof NavDataService
*/
public
removeNavData
(
tag
:
string
)
{
if
((
this
.
navDataStack
.
length
>
0
)
&&
tag
)
{
let
tempIndex
:
number
=
this
.
navDataStack
.
findIndex
((
element
:
INavDataParam
)
=>
{
return
Object
.
is
(
element
.
tag
,
tag
);
})
if
(
tempIndex
!==
-
1
)
{
this
.
navDataStack
=
this
.
navDataStack
.
slice
(
0
,
tempIndex
);
}
}
}
/**
* 从导航数据栈中删除仅剩第一条数据
*
* @memberof NavDataService
*/
public
removeNavDataFirst
()
{
if
(
this
.
navDataStack
.
length
>
0
)
{
this
.
navDataStack
=
this
.
navDataStack
.
slice
(
0
,
1
);
}
}
/**
* 从导航数据栈中删除最后一条数据
*
* @memberof NavDataService
*/
public
removeNavDataLast
()
{
if
(
this
.
navDataStack
.
length
>
0
)
{
this
.
navDataStack
.
pop
();
}
}
/**
* 从导航数据栈中删除所有数据
*
* @memberof NavDataService
*/
public
removeAllNavData
()
{
this
.
navDataStack
=
[];
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/service/index.ts
浏览文件 @
da5b4d9f
export
*
from
'./control-service'
export
*
from
'./control-service'
export
*
from
'./entity-service'
export
*
from
'./entity-service'
export
*
from
'./ui-service'
export
*
from
'./ui-service'
\ No newline at end of file
export
*
from
'./common-service'
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录