parent
f97b2709ca
commit
dfb6c22de4
@ -1,89 +1,89 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-breadcrumb class="app-breadcrumb" separator="/">
|
<el-breadcrumb class="app-breadcrumb" separator="/">
|
||||||
<transition-group name="breadcrumb">
|
<transition-group name="breadcrumb">
|
||||||
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
|
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
|
||||||
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1"
|
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1||item.path.includes('key')"
|
||||||
class="no-redirect">{{ item.meta.title }}</span>
|
class="no-redirect">{{ item.meta.title }}</span>
|
||||||
<a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
|
<a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
</transition-group>
|
</transition-group>
|
||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import pathToRegexp from 'path-to-regexp'
|
import pathToRegexp from 'path-to-regexp'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
levelList: null
|
levelList: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route() {
|
$route() {
|
||||||
this.getBreadcrumb()
|
this.getBreadcrumb()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getBreadcrumb()
|
this.getBreadcrumb()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getBreadcrumb() {
|
getBreadcrumb() {
|
||||||
// only show routes with meta.title
|
// only show routes with meta.title
|
||||||
let matched = this.$route.matched.filter(item => item.meta && item.meta.title)
|
let matched = this.$route.matched.filter(item => item.meta && item.meta.title)
|
||||||
const first = matched[0]
|
const first = matched[0]
|
||||||
|
|
||||||
if (!this.isDashboard(first)) {
|
if (!this.isDashboard(first)) {
|
||||||
matched = [{
|
matched = [{
|
||||||
path: '/dashboard',
|
path: '/dashboard',
|
||||||
meta: {
|
meta: {
|
||||||
title: '系统首页'
|
title: '系统首页'
|
||||||
}
|
}
|
||||||
}].concat(matched)
|
}].concat(matched)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
|
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
|
||||||
},
|
},
|
||||||
isDashboard(route) {
|
isDashboard(route) {
|
||||||
const name = route && route.name
|
const name = route && route.name
|
||||||
if (!name) {
|
if (!name) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return name.trim().toLocaleLowerCase() === '系统首页'.toLocaleLowerCase()
|
return name.trim().toLocaleLowerCase() === '系统首页'.toLocaleLowerCase()
|
||||||
},
|
},
|
||||||
pathCompile(path) {
|
pathCompile(path) {
|
||||||
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
|
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
|
||||||
const {
|
const {
|
||||||
params
|
params
|
||||||
} = this.$route
|
} = this.$route
|
||||||
var toPath = pathToRegexp.compile(path)
|
var toPath = pathToRegexp.compile(path)
|
||||||
return toPath(params)
|
return toPath(params)
|
||||||
},
|
},
|
||||||
handleLink(item) {
|
handleLink(item) {
|
||||||
const {
|
const {
|
||||||
redirect,
|
redirect,
|
||||||
path
|
path
|
||||||
} = item
|
} = item
|
||||||
if (redirect) {
|
if (redirect) {
|
||||||
this.$router.push(redirect)
|
this.$router.push(redirect)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$router.push(this.pathCompile(path))
|
this.$router.push(this.pathCompile(path))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-breadcrumb.el-breadcrumb {
|
.app-breadcrumb.el-breadcrumb {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 50px;
|
line-height: 50px;
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
|
|
||||||
.no-redirect {
|
.no-redirect {
|
||||||
color: #97a8be;
|
color: #97a8be;
|
||||||
cursor: text;
|
cursor: text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,51 @@
|
|||||||
|
<template>
|
||||||
|
<div style="padding: 0 20px">
|
||||||
|
<div ref="lxHeader">
|
||||||
|
<lx-header icon="md-apps" text="会所产品" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||||
|
<div slot="content"></div>
|
||||||
|
<slot>
|
||||||
|
<div>
|
||||||
|
<Input v-model="select.keywords" style="width: 200px; margin-right: 10px" placeholder="关键字搜索" />
|
||||||
|
<Select placeholder="类型搜索" v-model="select.type" style="width: 140px;margin-right: 10px">
|
||||||
|
|
||||||
|
</Select>
|
||||||
|
<Button type="primary">查询</Button>
|
||||||
|
<Button type="primary" style="margin-left: 10px" @click="$refs['addClubProduct'].type = 'add',$refs['addClubProduct'].isShow = true">新增</Button>
|
||||||
|
</div>
|
||||||
|
</slot>
|
||||||
|
</lx-header>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<xy-table></xy-table>
|
||||||
|
|
||||||
|
<addClubProduct ref="addClubProduct"></addClubProduct>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import addClubProduct from '@/views/productService/components/addClubProduct'
|
||||||
|
export default {
|
||||||
|
components:{
|
||||||
|
addClubProduct
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
select:{
|
||||||
|
page:1,
|
||||||
|
pageSize:10,
|
||||||
|
keywords:'',
|
||||||
|
type:''
|
||||||
|
},
|
||||||
|
|
||||||
|
total:0,
|
||||||
|
list:[],
|
||||||
|
table:[]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
</style>
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<xy-dialog type="form" :is-show.sync="isShow" :title="this.type === 'add' ? '新增会所产品' : '编辑会所产品'">
|
||||||
|
|
||||||
|
</xy-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
id:'',
|
||||||
|
isShow:false,
|
||||||
|
type:''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
</style>
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增月子会所' : '编辑月子会所'" :form="form" :rules="rules">
|
||||||
|
|
||||||
|
</xy-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
id:'',
|
||||||
|
isShow:false,
|
||||||
|
type:'',
|
||||||
|
|
||||||
|
form:{
|
||||||
|
|
||||||
|
},
|
||||||
|
rules:{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
},
|
||||||
|
watch:{
|
||||||
|
isShow(newVal){
|
||||||
|
if(newVal){
|
||||||
|
|
||||||
|
}else{
|
||||||
|
this.id = ''
|
||||||
|
this.type = ''
|
||||||
|
this.$refs['dialog'].reset()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
</style>
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
<template>
|
||||||
|
<div style="padding: 0 20px">
|
||||||
|
<div ref="lxHeader">
|
||||||
|
<lx-header icon="md-apps" text="月子会所" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||||
|
<div slot="content"></div>
|
||||||
|
<slot>
|
||||||
|
<div>
|
||||||
|
<Input v-model="select.keywords" style="width: 200px; margin-right: 10px" placeholder="关键字搜索" />
|
||||||
|
<Select placeholder="类型搜索" v-model="select.type" style="width: 140px;margin-right: 10px">
|
||||||
|
|
||||||
|
</Select>
|
||||||
|
<Button type="primary">查询</Button>
|
||||||
|
<Button type="primary" style="margin-left: 10px" @click="$refs['addConfinementClub'].type = 'add',$refs['addConfinementClub'].isShow = true">新增</Button>
|
||||||
|
</div>
|
||||||
|
</slot>
|
||||||
|
</lx-header>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<xy-table :total="total" :list="list" :table-item="table" @pageSizeChange="e => select.pageSize = e"></xy-table>
|
||||||
|
|
||||||
|
<addConfinementClub ref="addConfinementClub"></addConfinementClub>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import addConfinementClub from '@/views/productService/components/addConfinementClub'
|
||||||
|
export default {
|
||||||
|
components:{
|
||||||
|
addConfinementClub
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
select:{
|
||||||
|
page:1,
|
||||||
|
pageSize:10,
|
||||||
|
keywords:'',
|
||||||
|
type:''
|
||||||
|
},
|
||||||
|
|
||||||
|
total:0,
|
||||||
|
list:[],
|
||||||
|
table:[],
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
</style>
|
||||||
Loading…
Reference in new issue