事项配置重构

This commit is contained in:
aixianling
2023-04-07 11:35:09 +08:00
parent aebf16936c
commit 485a294fb4
3 changed files with 189 additions and 261 deletions

View File

@@ -1,21 +1,6 @@
<template>
<section class="matters-config">
<ai-list v-if="!showDetail">
<template #title>
<ai-title title="事项配置" :isShowBottomBorder="false"></ai-title>
</template>
<template slot="tabs">
<el-tabs class="tabs-page" v-model="currIndex">
<el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label" :name="String(i)">
<component :is="tab.comp" v-if="currIndex==i" :ref="currIndex" :instance="instance" :dict="dict"
:permissions="permissions" @goPage="goPage" :tab="currentTab"/>
</el-tab-pane>
</el-tabs>
</template>
</ai-list>
<component v-else :is="currentComp" :instance="instance" :dict="dict"
:processType="currentTab.value" :row="row"></component>
<component :is="currentPage" v-bind="$props"/>
</section>
</template>
@@ -27,43 +12,20 @@ import guidance from "./components/guidance";
export default {
name: "AppMattersConfig",
label: '事项配置',
components: {addConfig,guidance},
components: {addConfig, guidance},
props: {
instance: Function,
dict: Object,
permissions: Function
},
data() {
return {
currIndex: "0",
row: {},
currentComp: "",
}
},
computed: {
tabs() {
return [
{label: "网上办事", name: "configList", value: "0", comp: configList, detail: addConfig, permission: ""},
{label: "办事指南", name: "configList", value: "2", comp: configList, detail: guidance, permission: ""},
]
currentPage() {
const {hash} = this.$route
return hash == "#add" ? addConfig : hash == "#guidance" ? guidance : configList
},
currentTab() {
return this.tabs?.[this.currIndex] || {}
},
showDetail() {
return !!this.$route.query?.id || !!this.$route.query?.processType
}
},
methods: {
goPage(params) {
this.row = params.row
this.currentComp = params.comp
this.$router.push({query: {processType: this.currentTab.value}})
}
},
created() {
this.$router.push({query: {}});
this.$dict.load("hbDepartment", 'sex', 'nation', 'marital', 'native_place', 'education', 'candidateApproverType', 'scopeCandidates', 'nodeType')
this.dict.load("hbDepartment", 'sex', 'nation', 'marital', 'native_place', 'education', 'candidateApproverType', 'scopeCandidates', 'nodeType')
}
}
</script>