Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
f7809e95
提交
f7809e95
编写于
1月 21, 2022
作者:
tony001
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:更新
上级
86103fac
变更
13
显示空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
69 行增加
和
318 行删除
+69
-318
app.ts
...e/src/main/resources/templ/r7/app_{{apps}}/src/app/app.ts
+25
-8
i-app.ts
...ces/templ/r7/app_{{apps}}/src/core/interface/app/i-app.ts
+12
-4
i-nav-data-service.ts
...{{apps}}/src/core/interface/service/i-nav-data-service.ts
+0
-26
index.ts
...templ/r7/app_{{apps}}/src/core/interface/service/index.ts
+1
-2
app-base.ts
...es/templ/r7/app_{{apps}}/src/core/modules/app/app-base.ts
+24
-4
view-base.ts
...pp_{{apps}}/src/core/modules/views/view-base/view-base.ts
+0
-20
index.ts
.../r7/app_{{apps}}/src/core/service/common-service/index.ts
+0
-2
navdata-param.ts
...{{apps}}/src/core/service/common-service/navdata-param.ts
+0
-52
navdata-service.ts
...apps}}/src/core/service/common-service/navdata-service.ts
+0
-181
index.ts
...resources/templ/r7/app_{{apps}}/src/core/service/index.ts
+1
-2
interceptor.ts
...s/templ/r7/app_{{apps}}/src/core/utils/net/interceptor.ts
+1
-12
app-util.ts
...urces/templ/r7/app_{{apps}}/src/core/utils/ui/app-util.ts
+4
-4
vite.config.ts
...e/src/main/resources/templ/r7/app_{{apps}}/vite.config.ts
+1
-1
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/app/app.ts
浏览文件 @
f7809e95
import
{
SyncSeriesHook
}
from
"qx-util"
;
import
{
Environment
}
from
"@/environments/environment"
;
import
router
from
"@/router"
;
import
{
OpenViewService
}
from
"@/utils"
;
import
{
AppBase
,
IParam
,
ViewDetail
,
IApp
,
IOpenViewService
,
deepCopy
,
getSessionStorage
,
Http
,
AppUtil
,
NavDataService
,
INavDataService
}
from
"@core"
;
import
{
SyncSeriesHook
}
from
"qx-util"
;
import
{
AppBase
,
IParam
,
ViewDetail
,
IApp
,
IOpenViewService
,
deepCopy
,
getSessionStorage
,
Http
,
AppUtil
}
from
"@core"
;
import
{
AppFuncConfig
,
AppViewConfig
,
AppEntityConfig
}
from
'./config'
;
import
{
DataServiceRegister
,
UIServiceRegister
}
from
"./register"
;
...
...
@@ -123,7 +124,6 @@ export class App extends AppBase implements IApp {
/**
* 获取视图信息
*
* @static
* @param codeName 视图codeName
* @return {*}
*/
...
...
@@ -134,7 +134,6 @@ export class App extends AppBase implements IApp {
/**
* 获取实体信息
*
* @static
* @param codeName 实体codeName
* @return {*}
*/
...
...
@@ -143,12 +142,30 @@ export class App extends AppBase implements IApp {
}
/**
* @description 获取导航数据服务
* @return {*} {*}
* @description 跳转登录页
*
* @memberof App
*/
gotoLoginPage
():
void
{
const
currentRoute
=
unref
(
router
.
currentRoute
);
if
(
Environment
.
loginUrl
)
{
window
.
location
.
href
=
`
${
Environment
.
loginUrl
}
?redirect=
${
window
.
location
.
href
}
`
;
}
else
{
if
(
Object
.
is
(
currentRoute
.
name
,
'login'
))
{
return
;
}
router
.
push
({
name
:
'login'
,
query
:
{
redirect
:
window
.
location
.
hash
.
replace
(
"#"
,
''
)
}
});
}
}
/**
* @description 登录
*
* @return {*} {Promise<IParam>}
* @memberof App
*/
public
getNavDataService
():
INavDataService
{
return
NavDataService
.
getInstance
(
);
handleLogin
():
Promise
<
IParam
>
{
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/interface/app/i-app.ts
浏览文件 @
f7809e95
import
{
IParam
,
ViewDetail
}
from
"../common"
;
import
{
IAppFuncService
,
I
DataServiceRegister
,
INavDataService
,
IOpenViewService
,
IUIServiceRegister
}
from
"../service"
;
import
{
IAppFuncService
,
I
OpenViewService
}
from
"../service"
;
/**
...
...
@@ -100,10 +100,18 @@ export interface IApp {
setAppData
(
opt
:
IParam
):
void
;
/**
* @description 获取导航数据服务
* @return {*} {INavDataService}
* @description 跳转登录页
*
* @memberof IApp
*/
gotoLoginPage
():
void
;
/**
* @description 登录
*
* @return {*} {Promise<IParam>}
* @memberof IApp
*/
getNavDataService
():
INavDataService
;
handleLogin
():
Promise
<
IParam
>
;
}
\ 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
已删除
100644 → 0
浏览文件 @
86103fac
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
浏览文件 @
f7809e95
...
...
@@ -3,4 +3,3 @@ 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
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
浏览文件 @
f7809e95
import
{
AppFuncService
,
IApp
,
IAppFuncService
,
IOpenViewService
,
ViewDetail
}
from
"@core"
;
import
{
I
DataServiceRegister
,
INavDataService
,
IParam
,
IUIServiceRegister
}
from
"@core/interface"
;
import
{
I
Param
}
from
"@core/interface"
;
/**
* 应用基类
...
...
@@ -122,11 +122,31 @@ export abstract class AppBase implements IApp {
}
/**
* @description 获取导航数据服务
* @return {*} {INavDataService}
* @description 获取实体信息
*
* @param {string} codeName
* @memberof AppBase
*/
public
getEntityInfo
(
codeName
:
string
)
{
throw
new
Error
(
"Method not implemented."
);
}
/**
* @description 跳转登录页
*
* @memberof AppBase
*/
gotoLoginPage
():
void
{
throw
new
Error
(
"Method not implemented."
);
}
/**
* @description 登录
*
* @return {*} {Promise<IParam>}
* @memberof AppBase
*/
public
getNavDataService
():
INavDataService
{
handleLogin
():
Promise
<
IParam
>
{
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
浏览文件 @
f7809e95
...
...
@@ -189,24 +189,6 @@ export class ViewBase {
*/
public
useCounterService
()
{
}
/**
* @description 处理视图初始化
*
* @memberof ViewBase
*/
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 安装视图所有功能模块的方法
...
...
@@ -224,8 +206,6 @@ export class ViewBase {
this
.
useDataService
();
// 使用UI服务
this
.
useUIService
();
// 处理视图初始化
this
.
useViewInit
();
return
{
state
:
this
.
state
};
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/service/common-service/index.ts
已删除
100644 → 0
浏览文件 @
86103fac
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
已删除
100644 → 0
浏览文件 @
86103fac
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
已删除
100644 → 0
浏览文件 @
86103fac
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
浏览文件 @
f7809e95
export
*
from
'./control-service'
export
*
from
'./entity-service'
export
*
from
'./ui-service'
\ No newline at end of file
export
*
from
'./common-service'
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/utils/net/interceptor.ts
浏览文件 @
f7809e95
...
...
@@ -97,7 +97,7 @@ export class Interceptors {
res
.
data
.
entityName
=
res
.
headers
[
'x-ibz-params'
];
}
if
(
res
.
status
===
401
)
{
this
.
doNoLogin
(
res
,
_data
.
data
);
App
.
gotoLoginPage
(
);
}
if
(
res
.
status
===
403
)
{
if
(
res
.
data
&&
res
.
data
.
status
&&
Object
.
is
(
res
.
data
.
status
,
"FORBIDDEN"
))
{
...
...
@@ -114,16 +114,5 @@ export class Interceptors {
});
}
/**
* 处理未登录异常情况
*
* @private
* @param {*} [data={}]
* @memberof Interceptors
*/
private
doNoLogin
(
response
:
any
,
data
:
any
=
{}):
void
{
// todo
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/utils/ui/app-util.ts
浏览文件 @
f7809e95
import
{
Environment
}
from
"@/environments/environment"
;
import
{
getSessionStorage
,
Http
,
IParam
,
setSessionStorage
}
from
"@core"
;
import
qs
from
"qs"
;
import
{
getCookie
}
from
"qx-util"
;
import
{
Environment
}
from
"@/environments/environment"
;
import
{
getSessionStorage
,
Http
,
IParam
,
setSessionStorage
}
from
"@core"
;
/**
* 应用相关处理逻辑工具类
...
...
@@ -47,7 +47,7 @@ export class AppUtil {
return
false
;
}
}
catch
(
error
)
{
console
.
warn
(
error
);
// App.gotoLoginPage(
);
return
false
;
}
}
...
...
@@ -95,7 +95,7 @@ export class AppUtil {
return
false
;
}
}
catch
(
error
)
{
console
.
warn
(
error
);
// App.gotoLoginPage(
);
return
false
;
}
}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/vite.config.ts
浏览文件 @
f7809e95
...
...
@@ -26,7 +26,7 @@ export default defineConfig({
},
server
:{
proxy
:{
'/api'
:
'http://localhost:8080'
//
'/api':'http://localhost:8080'
}
},
plugins
:
[
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录