内容发布
This commit is contained in:
65
packages/3.0.0/AppContentInfo/AppContentInfo.vue
vendored
65
packages/3.0.0/AppContentInfo/AppContentInfo.vue
vendored
@@ -1,15 +1,26 @@
|
||||
<template>
|
||||
<div class="doc-circulation ailist-wrapper">
|
||||
<keep-alive :include="['List']">
|
||||
<component ref="component" :moduleName="moduleName" :moduleId="moduleId" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component>
|
||||
</keep-alive>
|
||||
</div>
|
||||
<ai-list v-if="!isShowDetail">
|
||||
<template slot="title">
|
||||
<ai-title :title="moduleName" :isShowBottomBorder="false" :isShowArea="currIndex === '0'" v-model="areaId" :instance="instance" @change="onAreaChange"></ai-title>
|
||||
</template>
|
||||
<template slot="tabs">
|
||||
<el-tabs v-model="currIndex">
|
||||
<el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label">
|
||||
<component :areaId="areaId" :moduleName="moduleName" :moduleId="moduleId" :ref="String(i)" v-if="currIndex == i" :is="tab.comp" @change="onChange" lazy :instance="instance" :dict="dict" :permissions="permissions"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
</ai-list>
|
||||
<Add v-else-if="component === 'Add'" :moduleName="moduleName" :moduleId="moduleId" :areaId="areaId" :params="params" :instance="instance" :dict="dict" :permissions="permissions" @change="onChange"></Add>
|
||||
<Detail v-else-if="component === 'Detail'" :moduleName="moduleName" :moduleId="moduleId" :params="params" :instance="instance" :dict="dict" :permissions="permissions" @change="onChange"></Detail>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import List from './components/List'
|
||||
import Add from './components/Add'
|
||||
import Detail from './components/Detail'
|
||||
import Audit from './components/Audit'
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'AppContentInfo',
|
||||
@@ -17,31 +28,48 @@
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object
|
||||
dict: Object,
|
||||
permissions: Function
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
areaId: '',
|
||||
component: 'List',
|
||||
params: {},
|
||||
moduleId: '',
|
||||
include: [],
|
||||
moduleName: ''
|
||||
moduleName: '',
|
||||
tabs: [],
|
||||
currIndex: '0',
|
||||
isShowDetail: false
|
||||
}
|
||||
},
|
||||
|
||||
components: {
|
||||
Add,
|
||||
List,
|
||||
Audit,
|
||||
Detail
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['user'])
|
||||
},
|
||||
|
||||
created () {
|
||||
this.moduleId = this.$route.query.moduleId
|
||||
this.areaId = this.user.info.areaId
|
||||
|
||||
this.instance.post('/app/appcontentmoduleinfo/queryDetailById?id=' + this.$route.query.moduleId).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.moduleName = res.data.moduleName
|
||||
this.tabs = [
|
||||
{label: this.moduleName, name: 'List', comp: List, permission: ''},
|
||||
{label: `${this.moduleName}审核`, name: 'Audit', comp: Audit, permission: ''}
|
||||
].filter(item => {
|
||||
return true
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -51,23 +79,32 @@
|
||||
if (data.type === 'Add') {
|
||||
this.component = 'Add'
|
||||
this.params = data.params
|
||||
this.isShowDetail = true
|
||||
}
|
||||
|
||||
if (data.type === 'Detail') {
|
||||
this.component = 'Detail'
|
||||
this.params = data.params
|
||||
this.isShowDetail = true
|
||||
}
|
||||
|
||||
if (data.type === 'list') {
|
||||
if (data.type === 'Audit') {
|
||||
this.component = 'Audit'
|
||||
this.params = data.params
|
||||
this.isShowDetail = false
|
||||
}
|
||||
|
||||
if (data.type === 'List') {
|
||||
this.component = 'List'
|
||||
this.params = data.params
|
||||
|
||||
this.$nextTick(() => {
|
||||
if (data.isRefresh) {
|
||||
this.$refs.component.getList()
|
||||
}
|
||||
})
|
||||
this.isShowDetail = false
|
||||
}
|
||||
},
|
||||
|
||||
onAreaChange () {
|
||||
this.$nextTick(() => {
|
||||
this.$refs[this.currIndex][0].getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user