Files
dvcp_v2_webapp/packages/publicity/AppJob/AppJob.vue

106 lines
2.7 KiB
Vue
Raw Normal View History

2021-12-14 18:36:19 +08:00
<template>
2021-12-21 16:47:07 +08:00
<ai-list v-if="!isShowDetail">
<template slot="title">
2021-12-21 16:51:31 +08:00
<ai-title title="招工就业" :isShowBottomBorder="false"></ai-title>
2021-12-21 16:47:07 +08:00
</template>
<template slot="tabs">
<el-tabs v-model="currIndex">
<el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label">
<component :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>
<AddJob v-else-if="componentName === 'AddJob' && isShowDetail" :params="params" :instance="instance" :dict="dict" :permissions="permissions" @change="onChange"></AddJob>
<Add v-else-if="componentName === 'Add' && isShowDetail" :params="params" :instance="instance" :dict="dict" :permissions="permissions" @change="onChange"></Add>
2021-12-14 18:36:19 +08:00
</template>
<script>
2021-12-21 16:47:07 +08:00
import List from './components/List.vue'
import JobList from './components/JobList'
import Add from './components/Add'
import AddJob from './components/AddJob'
import { mapState } from 'vuex'
2021-12-14 18:36:19 +08:00
2021-12-21 16:47:07 +08:00
export default {
name: 'AppJob',
label: '招工就业',
2021-12-14 18:36:19 +08:00
2021-12-21 16:47:07 +08:00
components: {
JobList,
AddJob,
List,
Add
},
props: {
instance: Function,
dict: Object,
permissions: Function
},
2021-12-14 18:36:19 +08:00
2021-12-21 16:47:07 +08:00
computed: {
...mapState(['user']),
tabs () {
const tabList = [
{label: '找能人', name: 'List', comp: List, permission: ''},
{label: '找工作', name: 'Statistics', comp: JobList, permission: ''}
].filter(item => {
return true
2021-12-14 18:36:19 +08:00
})
2021-12-21 16:47:07 +08:00
return tabList
}
},
data () {
return {
activeName: 'List',
currIndex: '0',
componentName: '',
params: {},
isShowDetail: false
2021-12-14 18:36:19 +08:00
}
},
2021-12-21 16:47:07 +08:00
created () {
if (this.$route.query.id) {
this.componentName = this.$route.query?.type
this.params = {id: this.$route.query?.id}
this.isShowDetail = true
}
},
methods: {
onChange (data) {
if (data.type === 'List') {
this.componentName = 'List'
this.isShowDetail = false
this.params = data.params
}
if (data.type === 'Add') {
this.componentName = 'Add'
this.isShowDetail = true
this.params = data.params
}
if (data.type === 'JobList') {
this.componentName = 'JobList'
this.isShowDetail = false
this.params = data.params
}
if (data.type === 'AddJob') {
this.componentName = 'AddJob'
this.isShowDetail = true
this.params = data.params
}
}
}
}
2021-12-14 18:36:19 +08:00
</script>
2021-12-21 16:47:07 +08:00
<style lang="scss" scoped>
2021-12-14 18:36:19 +08:00
</style>