BUG 30150

This commit is contained in:
aixianling
2022-06-13 14:32:40 +08:00
parent 95ac3d55ae
commit a3f5bc03d0
2 changed files with 54 additions and 87 deletions

View File

@@ -1,72 +1,54 @@
<template>
<div class="doc-circulation ailist-wrapper">
<keep-alive :include="['List']">
<component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component>
</keep-alive>
</div>
<section class="AppReportAtWill">
<component ref="component" :is="currentPage" @change="onChange" :params="params" :instance="instance" :dict="dict"/>
</section>
</template>
<script>
import List from './components/List'
import Detail from './components/Detail'
import Setting from './components/Setting'
import List from './components/List'
import Detail from './components/Detail'
import Setting from './components/Setting'
export default {
name: 'AppReportAtWill',
label: '随手拍',
export default {
name: 'AppReportAtWill',
label: '随手拍',
props: {
instance: Function,
dict: Object
},
props: {
instance: Function,
dict: Object
},
data () {
return {
component: 'List',
params: {}
}
},
data() {
return {
component: 'List',
params: {}
}
},
computed: {
currentPage() {
let {hash, query: {id}} = this.$route
return hash == "#Setting" ? Setting :
!!id ? Detail : List
}
},
components: {
List,
Detail,
Setting
},
components: {
List,
Detail,
Setting
},
mounted () {
},
methods: {
onChange (data) {
if (data.type === 'Detail') {
this.component = 'Detail'
this.params = data.params
}
if (data.type === 'Setting') {
this.component = 'Setting'
this.params = data.params
}
if (data.type === 'list') {
this.component = 'List'
this.params = data.params
this.$nextTick(() => {
if (data.isRefresh) {
this.$refs.component.getList()
}
})
}
}
methods: {
onChange(data) {
this.$router.push({query: data.params, hash: data.type == "Setting" ? "#Setting" : ""})
}
}
}
</script>
<style lang="scss">
.doc-circulation {
height: 100%;
background: #F3F6F9;
overflow: auto;
}
.AppReportAtWill {
height: 100%;
background: #F3F6F9;
overflow: auto;
}
</style>