提交 f7e22721 编写于 作者: KK's avatar KK

抽屉调整

上级 04afc9c5
<template> <template>
<div > <div >
<ion-menu <div :id="uuid"></div>
<ibiz-drawer
:content-id="uuid" :content-id="uuid"
:ref="this.uuid+'drawer'" :ref="this.uuid+'drawer'"
@ionWillClose="close" @dropClick="close"
:myObject="myObject"
@confirmToClose="confirmToClose"
:close-view="closeView"
@on-visible-change="onVisibleChange($event)"> @on-visible-change="onVisibleChange($event)">
<component <component
:is="viewname" :is="viewname"
...@@ -16,7 +20,8 @@ ...@@ -16,7 +20,8 @@
@close="close($event)" @close="close($event)"
:ref="viewname"> :ref="viewname">
</component> </component>
</ion-menu> </ibiz-drawer>
</div> </div>
</template> </template>
...@@ -28,7 +33,6 @@ import { Subject } from "rxjs"; ...@@ -28,7 +33,6 @@ import { Subject } from "rxjs";
}) })
export default class AppDrawerCompponent extends Vue { export default class AppDrawerCompponent extends Vue {
/** /**
* 视图UI参数 * 视图UI参数
* *
...@@ -37,6 +41,15 @@ export default class AppDrawerCompponent extends Vue { ...@@ -37,6 +41,15 @@ export default class AppDrawerCompponent extends Vue {
*/ */
@Prop() public view!: any; @Prop() public view!: any;
/**
* 是否关闭view
*
* @type {any}
* @memberof AppDrawerCompponent
*/
public closeView = false;
/** /**
* 视图上下文 * 视图上下文
* *
...@@ -53,10 +66,6 @@ export default class AppDrawerCompponent extends Vue { ...@@ -53,10 +66,6 @@ export default class AppDrawerCompponent extends Vue {
*/ */
@Prop() public uuid?: any; @Prop() public uuid?: any;
public ionWillClose(value:any){
console.log(value);
}
/** /**
* 视图参数 * 视图参数
* *
...@@ -71,7 +80,7 @@ export default class AppDrawerCompponent extends Vue { ...@@ -71,7 +80,7 @@ export default class AppDrawerCompponent extends Vue {
* @type {(null | Subject<any>)} * @type {(null | Subject<any>)}
* @memberof AppDrawerCompponent * @memberof AppDrawerCompponent
*/ */
public subject: null | Subject<any> = new Subject<any>(); public subject: Subject<any> = new Subject<any>();
/** /**
...@@ -82,8 +91,6 @@ export default class AppDrawerCompponent extends Vue { ...@@ -82,8 +91,6 @@ export default class AppDrawerCompponent extends Vue {
*/ */
public placement: string = ''; public placement: string = '';
/** /**
* 是否显示 * 是否显示
* *
...@@ -166,7 +173,7 @@ export default class AppDrawerCompponent extends Vue { ...@@ -166,7 +173,7 @@ export default class AppDrawerCompponent extends Vue {
} }
} }
} }
/** /**
* Vue生命周期mounted * Vue生命周期mounted
* *
...@@ -221,8 +228,8 @@ export default class AppDrawerCompponent extends Vue { ...@@ -221,8 +228,8 @@ export default class AppDrawerCompponent extends Vue {
Object.assign(this.tempResult, { ret: 'OK' }, { datas: JSON.parse(JSON.stringify(result)) }); Object.assign(this.tempResult, { ret: 'OK' }, { datas: JSON.parse(JSON.stringify(result)) });
} }
this.isShow = false; this.isShow = false;
// (this.$refs.drawer as any).dismiss();
this.onVisibleChange(true); this.onVisibleChange(true);
} }
/** /**
...@@ -267,15 +274,16 @@ export default class AppDrawerCompponent extends Vue { ...@@ -267,15 +274,16 @@ export default class AppDrawerCompponent extends Vue {
this.$store.commit('viewaction/setViewDataChange', { viewtag: _viewtag, viewdatachange: false }); this.$store.commit('viewaction/setViewDataChange', { viewtag: _viewtag, viewdatachange: false });
this.isShow = false; this.isShow = false;
this.handleShowState($event); this.handleShowState($event);
this.closeView = true;
} else { } else {
this.closeView = false;
this.isShow = true; this.isShow = true;
let drawer :any = this.$refs[this.uuid+'drawer']; let drawer :any = this.$refs[this.uuid+'drawer'];
if(drawer){
const re = drawer.toggle(true);
}
} }
}else{ }else{
this.handleShowState($event); this.handleShowState($event);
this.closeView = true;
} }
} }
} }
...@@ -289,17 +297,15 @@ export default class AppDrawerCompponent extends Vue { ...@@ -289,17 +297,15 @@ export default class AppDrawerCompponent extends Vue {
if (!$event) { if (!$event) {
return; return;
} }
if (this.subject) { if (this.subject && this.subject!=null) {
if (this.tempResult && Object.is(this.tempResult.ret, 'OK')) { if (this.tempResult && Object.is(this.tempResult.ret, 'OK')) {
} }
setTimeout(() => {
this.subject.next(this.tempResult); this.subject.next(this.tempResult);
}, 500)
} }
// setTimeout(() => {
// // document.body.removeChild(this.$el);
// this.$destroy();
// this.subject = null;
// }, 500)
} }
} }
</script> </script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册