Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-Mob-R7-Res
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-Mob-R7-Res
提交
9acad24e
提交
9acad24e
编写于
5月 20, 2020
作者:
KK
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
抽屉组件
上级
aa75fdea
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
51 行增加
和
34 行删除
+51
-34
app-drawer.ts
src/utils/app-drawer/app-drawer.ts
+6
-1
app-drawer.vue
src/utils/app-drawer/app-drawer.vue
+45
-33
未找到文件。
src/utils/app-drawer/app-drawer.ts
浏览文件 @
9acad24e
...
...
@@ -21,6 +21,8 @@ export class AppDrawer {
*/
private
static
readonly
$drawer
=
new
AppDrawer
();
private
$refs
:
any
=
{
equipmentForm
:
HTMLFormElement
,
upload
:
HTMLFormElement
}
/**
* 构造方法
*
...
...
@@ -75,7 +77,10 @@ export class AppDrawer {
}
}).
$mount
();
this
.
vueExample
=
vm
;
document
.
body
.
appendChild
(
vm
.
$el
);
let
app
=
document
.
getElementById
(
"app"
);
if
(
app
){
app
.
appendChild
(
vm
.
$el
);
}
const
comp
:
any
=
vm
.
$children
[
0
];
return
comp
.
getSubject
();
}
catch
(
error
)
{
...
...
src/utils/app-drawer/app-drawer.vue
浏览文件 @
9acad24e
<
template
>
<drawer
:placement=
"placement"
:closable=
"false"
v-model=
"isShow"
:width=
"width"
<div
class=
"drawer"
>
<div
:id=
"uuid"
></div>
<ion-menu
:side=
"placement"
:content-id=
"uuid"
:ref=
'viewname'
@
ionDidClose=
"close"
@
on-visible-change=
"onVisibleChange($event)"
>
<ion-content>
<component
:is=
"viewname"
class=
"viewcontainer2"
...
...
@@ -16,8 +19,11 @@
@
close=
"close($event)"
:ref=
"viewname"
>
</component>
</drawer>
</ion-content>
</ion-menu>
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
Vue
,
Component
,
Prop
,
Provide
,
Emit
,
Watch
}
from
"vue-property-decorator"
;
import
{
Subject
}
from
"rxjs"
;
...
...
@@ -26,6 +32,7 @@ import { Subject } from "rxjs";
})
export
default
class
AppDrawerCompponent
extends
Vue
{
/**
* 视图UI参数
*
...
...
@@ -42,6 +49,14 @@ export default class AppDrawerCompponent extends Vue {
*/
@
Prop
({
default
:
{}
})
public
context
?:
any
;
/**
* 视图上下文
*
* @type {*}
* @memberof AppDrawerCompponent
*/
@
Prop
()
public
uuid
?:
any
;
/**
* 视图参数
*
...
...
@@ -66,13 +81,15 @@ export default class AppDrawerCompponent extends Vue {
*/
public
placement
:
string
=
''
;
/**
* 是否显示
*
* @type {boolean}
* @memberof AppDrawerCompponent
*/
public
isShow
:
boolean
=
fals
e
;
public
isShow
:
boolean
=
tru
e
;
/**
* 零时结果
...
...
@@ -123,7 +140,7 @@ export default class AppDrawerCompponent extends Vue {
*/
public
created
()
{
this
.
viewname
=
this
.
view
.
viewname
;
this
.
placement
=
this
.
view
.
placement
===
'DRAWER_LEFT'
?
'
left'
:
'right
'
;
this
.
placement
=
this
.
view
.
placement
===
'DRAWER_LEFT'
?
'
start'
:
'end
'
;
if
(
this
.
view
.
width
)
{
if
(
this
.
view
.
width
.
toString
().
indexOf
(
'px'
)
>
0
)
{
if
(
!
Object
.
is
(
this
.
view
.
width
,
'0px'
))
{
...
...
@@ -157,6 +174,10 @@ export default class AppDrawerCompponent extends Vue {
public
mounted
()
{
this
.
isShow
=
true
;
this
.
handleZIndex
(
'ivu-drawer-mask'
,
'ivu-drawer-wrap'
);
let
drawer
:
any
=
this
.
$refs
[
this
.
viewname
];
if
(
drawer
){
drawer
.
open
()
}
}
/**
...
...
@@ -177,16 +198,16 @@ export default class AppDrawerCompponent extends Vue {
* @memberof AppDrawerCompponent
*/
public
handleZIndex
(
mask
:
string
,
wrap
:
string
)
{
const
zIndex
=
this
.
$store
.
getters
.
getZIndex
();
if
(
zIndex
)
{
this
.
zIndex
=
zIndex
+
100
;
this
.
$store
.
commit
(
'updateZIndex'
,
this
.
zIndex
);
}
const
element
:
Element
=
this
.
$el
;
const
maskTag
:
any
=
element
.
getElementsByClassName
(
mask
)[
0
];
const
warpTag
:
any
=
element
.
getElementsByClassName
(
wrap
)[
0
];
maskTag
.
style
.
zIndex
=
this
.
zIndex
;
warpTag
.
style
.
zIndex
=
this
.
zIndex
;
//
const zIndex = this.$store.getters.getZIndex();
//
if (zIndex) {
//
this.zIndex = zIndex + 100;
//
this.$store.commit('updateZIndex', this.zIndex);
//
}
//
const element: Element = this.$el;
//
const maskTag: any = element.getElementsByClassName(mask)[0];
//
const warpTag: any = element.getElementsByClassName(wrap)[0];
//
maskTag.style.zIndex = this.zIndex;
//
warpTag.style.zIndex = this.zIndex;
}
/**
...
...
@@ -199,6 +220,8 @@ export default class AppDrawerCompponent extends Vue {
Object
.
assign
(
this
.
tempResult
,
{
ret
:
'OK'
},
{
datas
:
JSON
.
parse
(
JSON
.
stringify
(
result
))
});
}
this
.
isShow
=
false
;
// (this.$refs.drawer as any).dismiss();
this
.
onVisibleChange
(
true
);
}
/**
...
...
@@ -238,20 +261,7 @@ export default class AppDrawerCompponent extends Vue {
this
.
isShow
=
true
;
const
title
:
any
=
this
.
$t
(
'app.tabpage.sureclosetip.title'
);
const
contant
:
any
=
this
.
$t
(
'app.tabpage.sureclosetip.content'
);
// this.$Modal.confirm({
// title: title,
// content: contant,
// onOk: () => {
// this.$store.commit('viewaction/setViewDataChange', { viewtag: _viewtag, viewdatachange: false });
// this.isShow = false;
// },
// onCancel: () => {
// this.isShow = true;
// }
// });
}
else
{
this
.
handleShowState
(
$event
);
}
}
}
}
...
...
@@ -261,7 +271,7 @@ export default class AppDrawerCompponent extends Vue {
* @memberof AppDrawerCompponent
*/
public
handleShowState
(
$event
:
any
)
{
if
(
$event
)
{
if
(
!
$event
)
{
return
;
}
if
(
this
.
subject
)
{
...
...
@@ -270,10 +280,12 @@ export default class AppDrawerCompponent extends Vue {
}
}
setTimeout
(()
=>
{
console
.
log
(
this
.
$el
)
document
.
body
.
removeChild
(
this
.
$el
);
this
.
$destroy
();
this
.
subject
=
null
;
},
500
)
}
}
</
script
>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录