Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
1cb602a1
提交
1cb602a1
编写于
12月 31, 2021
作者:
zhangkang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:模态优化 & 视图详情接口
上级
89af27f3
变更
7
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
264 行增加
和
157 行删除
+264
-157
i-view-detail.ts
...pp_sample/src/ibiz-core/interface/common/i-view-detail.ts
+96
-0
i-view-detail.ts
..._{{apps}}/src/ibiz-core/interface/common/i-view-detail.ts
+96
-0
index.ts
...l/r7/app_{{apps}}/src/ibiz-core/interface/common/index.ts
+2
-1
app.ts
...in/resources/templ/r7/app_{{apps}}/src/service/app/app.ts
+5
-5
open-view-service.ts
...7/app_{{apps}}/src/service/open-view/open-view-service.ts
+7
-9
app-modal.ts
...es/templ/r7/app_{{apps}}/src/utils/app-modal/app-modal.ts
+23
-76
app-modal.vue
...s/templ/r7/app_{{apps}}/src/utils/app-modal/app-modal.vue
+35
-66
未找到文件。
code/app_sample/src/ibiz-core/interface/common/i-view-detail.ts
0 → 100644
浏览文件 @
1cb602a1
/**
* 视图对象参数
*
* @export
* @interface ViewDetail
*/
export
interface
ViewDetail
{
/**
* 视图名称
*
* @type {string}
* @memberof ViewDetail
*/
name
:
string
;
/**
* 代码名称
*
* @type {string}
* @memberof ViewDetail
*/
codeName
:
string
;
/**
* 视图宽度
*
* @type {number}
* @memberof ViewDetail
*/
width
?:
number
;
/**
* 视图高度
*
* @type {number}
* @memberof ViewDetail
*/
height
?:
number
;
/**
* 视图标题
*
* @type {string}
* @memberof ViewDetail
*/
title
?:
string
;
/**
* 打开方式
*
* @type {string}
* @memberof ViewDetail
*/
openMode
?:
'INDEXViewDetailTAB'
|
'POPUPAPP'
|
'POPUPMODAL'
|
'DRAWER'
|
'POPOVER'
|
string
;
/**
* 重定向视图
*
* @type {boolean}
* @memberof ViewDetail
*/
redirectView
?:
boolean
;
/**
* 关系路径
*
* @type {[]}
* @memberof ViewDetail
*/
deResPaths
?:
[];
/**
* 标题
*
* @type {string}
* @memberof ViewDetail
*/
caption
?:
string
;
/**
* 视图类型
*
* @type {string}
* @memberof ViewDetail
*/
ViewDetailType
?:
string
;
/**
* 文件路径
*
* @type {string}
* @memberof ViewDetail
*/
fileDir
?:
string
;
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/interface/common/i-view-detail.ts
0 → 100644
浏览文件 @
1cb602a1
/**
* 视图对象参数
*
* @export
* @interface ViewDetail
*/
export
interface
ViewDetail
{
/**
* 视图名称
*
* @type {string}
* @memberof ViewDetail
*/
name
:
string
;
/**
* 代码名称
*
* @type {string}
* @memberof ViewDetail
*/
codeName
:
string
;
/**
* 视图宽度
*
* @type {number}
* @memberof ViewDetail
*/
width
?:
number
;
/**
* 视图高度
*
* @type {number}
* @memberof ViewDetail
*/
height
?:
number
;
/**
* 视图标题
*
* @type {string}
* @memberof ViewDetail
*/
title
?:
string
;
/**
* 打开方式
*
* @type {string}
* @memberof ViewDetail
*/
openMode
?:
'INDEXViewDetailTAB'
|
'POPUPAPP'
|
'POPUPMODAL'
|
'DRAWER'
|
'POPOVER'
|
string
;
/**
* 重定向视图
*
* @type {boolean}
* @memberof ViewDetail
*/
redirectView
?:
boolean
;
/**
* 关系路径
*
* @type {[]}
* @memberof ViewDetail
*/
deResPaths
?:
[];
/**
* 标题
*
* @type {string}
* @memberof ViewDetail
*/
caption
?:
string
;
/**
* 视图类型
*
* @type {string}
* @memberof ViewDetail
*/
ViewDetailType
?:
string
;
/**
* 文件路径
*
* @type {string}
* @memberof ViewDetail
*/
fileDir
?:
string
;
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/interface/common/index.ts
浏览文件 @
1cb602a1
...
...
@@ -2,3 +2,4 @@ export * from './i-context';
export
*
from
'./i-param'
;
export
*
from
'./i-action-param'
;
export
*
from
'./i-control-action'
;
export
*
from
'./i-view-detail'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/service/app/app.ts
浏览文件 @
1cb602a1
import
{
AppModal
}
from
'@/utils'
;
import
{
Http
,
deepCopy
}
from
'@ibiz-core'
;
import
{
Http
,
deepCopy
,
ViewDetail
}
from
'@ibiz-core'
;
import
{
OpenViewService
}
from
'@service'
;
import
{
AppFuncService
}
from
'@ibiz-core'
;
...
...
@@ -37,8 +37,8 @@ export class App {
* @param codeName 视图codeName
* @return {*}
*/
public
static
getViewInfo
(
codeName
:
string
){
return
App
.
allViewInfos
[
codeName
]
?
deepCopy
(
App
.
allViewInfos
[
codeName
]
)
:
undefined
;
public
static
getViewInfo
(
codeName
:
string
)
:
ViewDetail
|
undefined
{
return
App
.
allViewInfos
[
codeName
]
?
(
deepCopy
(
App
.
allViewInfos
[
codeName
])
as
ViewDetail
)
:
undefined
;
}
/**
...
...
@@ -46,7 +46,7 @@ export class App {
*
* @static
*/
public
static
async
init
(){
public
static
async
init
()
{
const
response
=
await
Http
.
getInstance
().
get
(
'./assets/json/views.json'
)
App
.
allViewInfos
=
response
.
data
;
}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/service/open-view/open-view-service.ts
浏览文件 @
1cb602a1
import
{
deepCopy
,
IParam
,
RouteToo
l
}
from
'@ibiz-core'
;
import
{
IParam
,
RouteTool
,
ViewDetai
l
}
from
'@ibiz-core'
;
import
{
App
}
from
'@service'
;
import
router
from
'@/router'
;
import
{
AppModal
}
from
'@/utils'
;
interface
View
extends
IParam
{
codeName
:
string
;
openMode
?:
string
;
}
interface
Params
extends
IParam
{
context
:
any
;
...
...
@@ -44,9 +41,9 @@ export class OpenViewService {
* @param view 视图信息
* @param params 相关参数
*/
public
openView
(
view
:
View
,
params
:
Params
)
{
public
openView
(
view
:
View
Detail
,
params
:
Params
)
{
// 获取详细视图信息
let
_view
:
any
=
App
.
getViewInfo
(
view
.
codeName
);
let
_view
:
ViewDetail
|
undefined
=
App
.
getViewInfo
(
view
.
codeName
);
if
(
!
_view
)
{
console
.
error
(
`应用中不存在
${
view
.
codeName
}
视图`
);
return
;
...
...
@@ -70,7 +67,7 @@ export class OpenViewService {
* @param view 视图信息
* @param params 相关参数
*/
public
openByOpenMode
(
view
:
any
,
params
:
Params
)
{
public
openByOpenMode
(
view
:
ViewDetail
,
params
:
Params
)
{
const
{
openMode
}
=
view
;
const
{
viewParams
,
context
}
=
params
;
// 路由打开视图
...
...
@@ -83,7 +80,8 @@ export class OpenViewService {
window
.
open
(
'./#'
+
routePath
,
'_blank'
);
}
}
else
if
(
openMode
==
'POPUPMODAL'
)
{
}
else
if
(
openMode
.
indexOf
(
'DRAWER'
)
!==
-
1
)
{
AppModal
.
getInstance
().
openModal
(
view
,
params
);
}
else
if
(
openMode
?.
indexOf
(
'DRAWER'
)
!==
-
1
)
{
// TODO PMS上面抽屉DRAWER_TOP
}
else
if
(
openMode
==
'POPOVER'
)
{
// TODO 打开气泡卡片
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/utils/app-modal/app-modal.ts
浏览文件 @
1cb602a1
import
{
createVNode
,
render
as
vueRender
}
from
'vue'
import
{
Subject
}
from
'rxjs'
;
import
Antd
from
'ant-design-vue'
;
// import { AppServiceBase, LogUtil } from 'ibiz-core';
import
AppModalComponent
from
"./app-modal.vue"
;
import
IbizLoading
from
'@components/render/IbizLoading.vue'
;
import
{
IParam
,
ViewDetail
}
from
'@ibiz-core'
;
export
class
AppModal
{
...
...
@@ -17,37 +16,12 @@ export class AppModal {
private
static
modal
=
new
AppModal
();
/**
* vue 实例
*
* @private
* @type {Vue}
* @memberof AppModal
*/
private
vueExample
!
:
any
;
/**
* store对象
*
* @
private
* @
type {*}
* @memberof AppModal
*/
private
store
:
any
;
/**
* i18n对象
*
* @private
* @memberof AppModal
*/
private
i18n
:
any
;
/**
* router对象
*
* @private
* @memberof AppModal
*/
private
router
:
any
;
public
asyncComp
:
any
;
/**
* Creates an instance of AppModal.
...
...
@@ -55,7 +29,6 @@ export class AppModal {
* @memberof AppModal
*/
private
constructor
()
{
this
.
initBasicData
();
if
(
AppModal
.
modal
)
{
return
AppModal
.
modal
;
}
...
...
@@ -76,38 +49,20 @@ export class AppModal {
}
/**
* 初始化基础数据
*
* @memberof AppModal
*/
private
initBasicData
()
{
// const appService = AppServiceBase.getInstance();
// this.store = appService.getAppStore();
// this.i18n = appService.getI18n();
// this.router = appService.getRouter();
}
/**
* 创建 Vue 实例对象
* 创建vue对象
*
* @private
* @param \{{ name: string, title: string, fileDir: string, width?: number, height?: number,isfullscreen?:boolean }} view 视图数据
* @param {*} [context={}] 应用上下文参数
* @param {*} [viewparams={}] 视图参数
* @param {*} [navdatas=[]] 导航数据
* @param {string} uuid 标识
* @returns {Subject<any>}
* @param {view} ViewDetail 视图对象
* @param {IParam} params 视图参数
* @param {IParam} [options] 模态配置项
* @return {*} {Subject<any>}
* @memberof AppModal
*/
private
createVueExample
(
view
:
{
name
:
string
,
title
:
string
,
fileDir
:
string
,
width
?:
number
,
height
?:
number
,
isfullscreen
?:
boolean
,
customClass
?:
string
},
context
:
any
=
{},
viewparam
:
any
=
{},
navdatas
:
Array
<
any
>
=
[],
uuid
:
string
):
Subject
<
any
>
{
const
self
:
any
=
this
;
if
(
!
self
.
store
||
!
self
.
i18n
)
{
self
.
initBasicData
();
}
private
createVueExample
(
view
:
ViewDetail
,
params
:
IParam
,
options
?:
IParam
):
Subject
<
any
>
{
try
{
let
subject
:
null
|
Subject
<
any
>
=
new
Subject
<
any
>
();
let
props
=
{
view
:
view
,
context
:
context
,
viewparam
:
viewparam
,
navdatas
:
navdatas
,
uuid
:
uuid
,
subject
:
subject
};
let
dir
=
view
.
fileDir
.
replace
(
/@page/
,
''
);
let
props
=
{
view
:
view
,
context
:
params
.
context
,
viewParams
:
params
.
viewParams
,
isFullscreen
:
params
.
isFullscreen
,
subject
:
subject
,
options
:
options
};
let
dir
=
view
.
fileDir
?
.
replace
(
/@page/
,
''
);
//Vite 支持使用特殊的 import.meta.glob 函数从文件系统导入多个模块
const
modules
=
import
.
meta
.
glob
(
'../../page/*/*/index.ts'
);
const
AsyncComp
=
defineAsyncComponent
({
...
...
@@ -129,8 +84,7 @@ export class AppModal {
}
);
app
.
component
(
view
.
name
,
AsyncComp
);
const
vm
=
app
.
use
(
Antd
).
mount
(
div
);
this
.
vueExample
=
vm
;
app
.
use
(
Antd
).
mount
(
div
);
}
return
subject
;
}
catch
(
error
)
{
...
...
@@ -142,22 +96,15 @@ export class AppModal {
/**
* 打开模态视图
*
* @param \{{ name: string, title: string, fileDir:string, width?: number, height?: number }} view 视图
* @param {*} [viewParam={}] 应用上下文参数
* @param {any[]} deResParameters 关系实体参数对象
* @param {any[]} parameters 当前应用视图参数对象
* @param {any[]} args 多项数据
* @param {*} [data={}] 行为参数
* @param {any[]} navdatas 导航数据
* @returns {Subject<any>}
* @param {View} view 视图对象
* @param {IParam} params 视图参数
* @param {IParam} [options] 模态配置项
* @return {*} {Subject<any>}
* @memberof AppModal
*/
public
openModal
(
view
:
{
name
:
string
,
title
:
string
,
fileDir
:
string
,
width
?:
number
,
height
?:
number
,
isfullscreen
?:
boolean
,
customClass
?:
string
},
context
:
any
=
{},
data
:
any
=
{},
navdatas
:
Array
<
any
>
=
[]
):
Subject
<
any
>
{
public
openModal
(
view
:
ViewDetail
,
params
:
IParam
,
options
?:
IParam
):
Subject
<
any
>
{
try
{
let
viewdata
:
any
=
{};
Object
.
assign
(
viewdata
,
JSON
.
parse
(
JSON
.
stringify
(
context
)));
const
uuid
=
this
.
getUUID
();
const
subject
=
this
.
createVueExample
(
view
,
viewdata
,
data
,
navdatas
,
uuid
);
const
subject
=
this
.
createVueExample
(
view
,
params
,
options
);
return
subject
;
}
catch
(
error
)
{
console
.
log
(
error
);
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/utils/app-modal/app-modal.vue
浏览文件 @
1cb602a1
<
script
setup
lang=
"ts"
>
import
{
IParam
,
ViewDetail
}
from
'@ibiz-core'
;
import
{
Subject
}
from
'rxjs'
;
import
{
Ref
,
ref
}
from
'vue'
;
interface
AppModalProps
{
/**
* @description 视图
*/
view
:
any
;
view
:
ViewDetail
;
/**
* @description 视图上下文参数
...
...
@@ -15,50 +16,49 @@ interface AppModalProps {
/**
* @description 视图参数
*/
view
param
?:
any
;
view
Params
?:
any
;
/**
* @description
导航数据
* @description
数据传递对象
*/
navdatas
?:
any
;
subject
?:
Subject
<
any
>
;
/**
* @description
数据传递对象
* @description
关闭回调
*/
subject
?:
any
close
:
Function
;
/**
* @description
关闭回调
* @description
是否全屏
*/
close
:
Function
;
isFullscreen
:
boolean
;
/**
* @description 模态参数
*/
option
?:
IParam
;
}
const
props
=
withDefaults
(
defineProps
<
AppModalProps
>
(),
{
view
:{},
context
:
{},
viewparam
:
{},
navdatas
:
[],
viewParams
:
{},
});
/**
* 是否显示
*/
let
is
Show
:
Ref
<
boolean
>
=
ref
(
false
);
let
is
Visible
:
Ref
<
boolean
>
=
ref
(
false
);
/**
* 是否满屏
*/
let
isfullscreen
:
Ref
<
boolean
>
=
ref
(
false
);
/**
*
零
时结果
*
临
时结果
*/
let
tempResult
=
{
ret
:
''
};
/**
* 视图名称
*/
let
view
n
ame
:
Ref
<
string
>
=
ref
(
''
);
let
view
N
ame
:
Ref
<
string
>
=
ref
(
''
);
/**
* 视图标题
...
...
@@ -75,11 +75,6 @@ let width: Ref<number> = ref(0);
*/
let
height
:
Ref
<
number
>
=
ref
(
0
);
/**
* 视图层级
*/
let
zIndex
:
any
=
null
;
/**
* 视图样式
*/
...
...
@@ -90,30 +85,16 @@ let style: any = {};
*/
const
getSubject
=
()
=>
{
return
props
.
subject
;
}
/**
* 监听isShow
*/
watch
(
()
=>
isShow
,
(
newVal
,
oldVal
)
=>
{
if
(
newVal
!==
oldVal
&&
newVal
.
value
==
false
)
{
zIndex
-=
100
;
// this.$store.commit('updateZIndex', this.zIndex);
}
},
);
};
/**
* Vue生命周期beforeMount
*/
onBeforeMount
(()
=>
{
if
(
props
.
view
)
{
viewname
.
value
=
props
.
view
.
name
;
title
=
props
.
view
.
title
;
isfullscreen
.
value
=
props
.
view
.
isfullscreen
?
props
.
view
.
isfullscreen
:
false
;
if
(
isfullscreen
.
value
)
{
viewName
.
value
=
props
.
view
.
name
;
title
=
props
.
view
.
title
||
''
;
if
(
props
.
isFullscreen
)
{
Object
.
assign
(
style
,
{
height
:
'auto'
});
}
else
{
if
(
!
props
.
view
.
width
||
props
.
view
.
width
===
0
||
Object
.
is
(
props
.
view
.
width
,
'0px'
))
{
...
...
@@ -143,13 +124,7 @@ onBeforeMount(() => {
* Vue生命周期mounted
*/
onMounted
(()
=>
{
// const curmodal: any = this.$refs.curmodal;
// const zIndex = this.$store.getters.getZIndex();
// if (zIndex) {
// this.zIndex = zIndex + 100;
// this.$store.commit('updateZIndex', this.zIndex);
// }
isShow
.
value
=
true
;
isVisible
.
value
=
true
;
});
/**
...
...
@@ -157,18 +132,15 @@ onMounted(() => {
*/
const
close
=
(
result
:
any
)
=>
{
if
(
result
&&
Array
.
isArray
(
result
)
&&
result
.
length
>
0
)
{
if
(
zIndex
)
{
// this.$store.commit('updateZIndex', zIndex - 100);
}
Object
.
assign
(
tempResult
,
{
ret
:
'OK'
},
{
datas
:
JSON
.
parse
(
JSON
.
stringify
(
result
))
});
}
is
Show
.
value
=
false
;
is
Visible
.
value
=
false
;
};
/**
* 视图数据变化
*/
const
d
ataChange
=
(
result
:
any
)
=>
{
const
viewD
ataChange
=
(
result
:
any
)
=>
{
tempResult
=
{
ret
:
''
};
if
(
result
&&
Array
.
isArray
(
result
)
&&
result
.
length
>
0
)
{
Object
.
assign
(
tempResult
,
{
ret
:
'OK'
},
{
datas
:
JSON
.
parse
(
JSON
.
stringify
(
result
))
});
...
...
@@ -178,7 +150,7 @@ const dataChange = (result: any) => {
/**
* 视图数据激活
*/
const
viewData
s
Activated
=
(
result
:
any
)
=>
{
const
viewDataActivated
=
(
result
:
any
)
=>
{
if
(
result
&&
Array
.
isArray
(
result
)
&&
result
.
length
>
0
)
{
close
(
result
);
}
...
...
@@ -189,6 +161,7 @@ const viewDatasActivated = (result: any) => {
*/
const
onVisibleChange
=
(
$event
:
any
)
=>
{
handleShowState
(
$event
);
props
.
close
(
tempResult
);
};
/**
...
...
@@ -198,9 +171,6 @@ const handleShowState = ($event: any) => {
if
(
props
.
subject
&&
tempResult
)
{
props
.
subject
.
next
(
tempResult
);
}
setTimeout
(()
=>
{
props
.
close
();
},
500
);
};
</
script
>
...
...
@@ -208,7 +178,7 @@ const handleShowState = ($event: any) => {
<a-modal
ref=
"curModal"
class=
"app-modal"
v-model:visible=
"is
Show
"
v-model:visible=
"is
Visible
"
:title=
"title"
:footer=
"null"
:maskClosable=
"true"
...
...
@@ -218,19 +188,18 @@ const handleShowState = ($event: any) => {
@
cancel=
"onVisibleChange($event)"
>
<component
:is=
"view
n
ame"
class=
"
viewcontainer2
"
:is=
"view
N
ame"
class=
"
app-modal-view-component
"
:width=
"width"
:height=
"height"
:context=
"JSON.stringify(context)"
:viewparam=
"JSON.stringify(viewparam)"
:navdatas=
"navdatas"
:context=
"context"
:viewParams=
"viewParams"
:viewDefaultUsage=
"false"
:noViewCaption=
"true"
@
view
dataschange=
"d
ataChange($event)"
@
view
datasactivated=
"viewDatas
Activated($event)"
@
view
DataChange=
"viewD
ataChange($event)"
@
view
DataActivated=
"viewData
Activated($event)"
@
close=
"close($event)"
:ref=
"view
n
ame"
:ref=
"view
N
ame"
></component>
</a-modal>
</
template
>
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录