|
@@ -1,35 +1,18 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<el-button size="small" type="text" @click="onShow">详 情</el-button>
|
|
|
- <el-drawer
|
|
|
- title="我是标题"
|
|
|
- :visible.sync="drawer"
|
|
|
- :with-header="false"
|
|
|
- direction="rtl"
|
|
|
- size="90%"
|
|
|
- append-to-body
|
|
|
- @close="closeDrawer">
|
|
|
- <div class="detail__panel">
|
|
|
- <router-view v-if = "drawer"/>
|
|
|
- </div>
|
|
|
- </el-drawer>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {mapGetters} from 'vuex'
|
|
|
export default {
|
|
|
props:['data','detailPath','idName'],
|
|
|
components:{
|
|
|
},
|
|
|
computed:{
|
|
|
- ...mapGetters({
|
|
|
- closeDrawerTemp:'closeDrawerTemp'
|
|
|
- })
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
- drawer:false
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
@@ -43,18 +26,9 @@ export default {
|
|
|
let query = {id:this.data[key],rowindex:this.data.rowindex}
|
|
|
this.$router.push({path:this.detailPath.path,query:Object.assign({},query,this.detailPath.param)})
|
|
|
this.$store.dispatch('changeDetailDrawer',true)
|
|
|
- },
|
|
|
- closeDrawer () {
|
|
|
- this.$router.go(-1)
|
|
|
- this.$store.dispatch('changeDetailDrawer',false)
|
|
|
- this.$emit('onSuccess')
|
|
|
}
|
|
|
},
|
|
|
watch:{
|
|
|
- closeDrawerTemp (val) {
|
|
|
- console.log(val,'drawer')
|
|
|
- val?this.drawer = false:true
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
|