无等级网格版合并
This commit is contained in:
@@ -1,27 +1,7 @@
|
||||
<template>
|
||||
<ai-list class="AppGridMember" v-if="!isShowDetail">
|
||||
<template slot="title">
|
||||
<ai-title title="网格员管理" :isShowBottomBorder="false"></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 :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'" :params="params" :instance="instance" :dict="dict" :permissions="permissions"
|
||||
@change="onChange"></Add>
|
||||
<Family v-else-if="component === 'Family'" :params="params" :instance="instance" :dict="dict"
|
||||
:permissions="permissions" @change="onChange"></Family>
|
||||
<MonitorUser v-else-if="component === 'MonitorUser'" :params="params" :instance="instance" :dict="dict"
|
||||
:permissions="permissions" @change="onChange"></MonitorUser>
|
||||
<ApplyDetail v-else-if="component === 'ApplyDetail'" :params="params" :instance="instance" :dict="dict"
|
||||
:permissions="permissions" @change="onChange"></ApplyDetail>
|
||||
<ApplyAdd v-else-if="component === 'ApplyAdd'" :params="params" :instance="instance" :dict="dict"
|
||||
:permissions="permissions" @change="onChange"></ApplyAdd>
|
||||
<keep-alive include="GmList">
|
||||
<component :is="currentPage" v-bind="$props" @change="onChange"/>
|
||||
</keep-alive>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -32,39 +12,29 @@ import ApplyDetail from './components/ApplyDetail'
|
||||
import ApplyAdd from './components/ApplyAdd'
|
||||
import Family from './components/Family'
|
||||
import MonitorUser from './components/MonitorUser'
|
||||
import GmList from "./components/gmList";
|
||||
|
||||
export default {
|
||||
name: "AppGridMember",
|
||||
label: "网格管理员",
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
component: "List",
|
||||
params: {},
|
||||
include: [],
|
||||
currIndex: '0',
|
||||
isShowDetail: false
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
tabs() {
|
||||
return [
|
||||
{label: '网格员信息', name: 'List', comp: List, permission: ''},
|
||||
{label: '申报信息', name: 'ApplyList', comp: ApplyList, permission: 'app_appgirdmemberapply_detail'}
|
||||
].filter(item => {
|
||||
return item.name !== 'ApplyList' || this.permissions(item.permission)
|
||||
})
|
||||
currentPage() {
|
||||
let {hash} = this.$route
|
||||
return hash == "#Family" ? Family :
|
||||
hash == "#MonitorUser" ? MonitorUser :
|
||||
hash == "#Add" ? Add :
|
||||
hash == "#ApplyAdd" ? ApplyAdd :
|
||||
hash == "#ApplyDetail" ? ApplyDetail :
|
||||
GmList
|
||||
}
|
||||
},
|
||||
|
||||
components: {
|
||||
GmList,
|
||||
Add,
|
||||
List,
|
||||
Family,
|
||||
@@ -76,46 +46,9 @@ export default {
|
||||
|
||||
methods: {
|
||||
onChange(data) {
|
||||
if (data.type === "Add") {
|
||||
this.component = "Add"
|
||||
this.isShowDetail = true
|
||||
this.params = data.params
|
||||
}
|
||||
|
||||
if (data.type === "Family") {
|
||||
this.component = "Family"
|
||||
this.isShowDetail = true
|
||||
this.params = data.params
|
||||
}
|
||||
|
||||
if (data.type === "MonitorUser") {
|
||||
this.component = "MonitorUser"
|
||||
this.isShowDetail = true
|
||||
this.params = data.params
|
||||
}
|
||||
if (data.type === "ApplyDetail") {
|
||||
this.component = "ApplyDetail"
|
||||
this.isShowDetail = true
|
||||
this.params = data.params
|
||||
}
|
||||
|
||||
if (data.type === "ApplyAdd") {
|
||||
this.component = "ApplyAdd"
|
||||
this.isShowDetail = true
|
||||
this.params = data.params
|
||||
}
|
||||
|
||||
if (data.type === "list") {
|
||||
this.component = "List"
|
||||
this.isShowDetail = false
|
||||
this.params = data.params
|
||||
}
|
||||
|
||||
if (data.type === "ApplyList") {
|
||||
this.component = "ApplyList"
|
||||
this.isShowDetail = false
|
||||
this.params = data.params
|
||||
}
|
||||
let {type, params: query} = data,
|
||||
hash = ["ApplyList", "list"].includes(type) ? "" : "#" + type
|
||||
this.$router.push({hash, query})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user