parent
f97b2709ca
commit
dfb6c22de4
@ -1,89 +1,89 @@
|
||||
<template>
|
||||
<el-breadcrumb class="app-breadcrumb" separator="/">
|
||||
<transition-group name="breadcrumb">
|
||||
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
|
||||
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1"
|
||||
class="no-redirect">{{ item.meta.title }}</span>
|
||||
<a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
|
||||
</el-breadcrumb-item>
|
||||
</transition-group>
|
||||
</el-breadcrumb>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pathToRegexp from 'path-to-regexp'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
levelList: null
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route() {
|
||||
this.getBreadcrumb()
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getBreadcrumb()
|
||||
},
|
||||
methods: {
|
||||
getBreadcrumb() {
|
||||
// only show routes with meta.title
|
||||
let matched = this.$route.matched.filter(item => item.meta && item.meta.title)
|
||||
const first = matched[0]
|
||||
|
||||
if (!this.isDashboard(first)) {
|
||||
matched = [{
|
||||
path: '/dashboard',
|
||||
meta: {
|
||||
title: '系统首页'
|
||||
}
|
||||
}].concat(matched)
|
||||
}
|
||||
|
||||
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
|
||||
},
|
||||
isDashboard(route) {
|
||||
const name = route && route.name
|
||||
if (!name) {
|
||||
return false
|
||||
}
|
||||
return name.trim().toLocaleLowerCase() === '系统首页'.toLocaleLowerCase()
|
||||
},
|
||||
pathCompile(path) {
|
||||
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
|
||||
const {
|
||||
params
|
||||
} = this.$route
|
||||
var toPath = pathToRegexp.compile(path)
|
||||
return toPath(params)
|
||||
},
|
||||
handleLink(item) {
|
||||
const {
|
||||
redirect,
|
||||
path
|
||||
} = item
|
||||
if (redirect) {
|
||||
this.$router.push(redirect)
|
||||
return
|
||||
}
|
||||
this.$router.push(this.pathCompile(path))
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.app-breadcrumb.el-breadcrumb {
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
line-height: 50px;
|
||||
margin-left: 8px;
|
||||
|
||||
.no-redirect {
|
||||
color: #97a8be;
|
||||
cursor: text;
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<el-breadcrumb class="app-breadcrumb" separator="/">
|
||||
<transition-group name="breadcrumb">
|
||||
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
|
||||
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1||item.path.includes('key')"
|
||||
class="no-redirect">{{ item.meta.title }}</span>
|
||||
<a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
|
||||
</el-breadcrumb-item>
|
||||
</transition-group>
|
||||
</el-breadcrumb>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pathToRegexp from 'path-to-regexp'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
levelList: null
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route() {
|
||||
this.getBreadcrumb()
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getBreadcrumb()
|
||||
},
|
||||
methods: {
|
||||
getBreadcrumb() {
|
||||
// only show routes with meta.title
|
||||
let matched = this.$route.matched.filter(item => item.meta && item.meta.title)
|
||||
const first = matched[0]
|
||||
|
||||
if (!this.isDashboard(first)) {
|
||||
matched = [{
|
||||
path: '/dashboard',
|
||||
meta: {
|
||||
title: '系统首页'
|
||||
}
|
||||
}].concat(matched)
|
||||
}
|
||||
|
||||
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
|
||||
},
|
||||
isDashboard(route) {
|
||||
const name = route && route.name
|
||||
if (!name) {
|
||||
return false
|
||||
}
|
||||
return name.trim().toLocaleLowerCase() === '系统首页'.toLocaleLowerCase()
|
||||
},
|
||||
pathCompile(path) {
|
||||
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
|
||||
const {
|
||||
params
|
||||
} = this.$route
|
||||
var toPath = pathToRegexp.compile(path)
|
||||
return toPath(params)
|
||||
},
|
||||
handleLink(item) {
|
||||
const {
|
||||
redirect,
|
||||
path
|
||||
} = item
|
||||
if (redirect) {
|
||||
this.$router.push(redirect)
|
||||
return
|
||||
}
|
||||
this.$router.push(this.pathCompile(path))
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.app-breadcrumb.el-breadcrumb {
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
line-height: 50px;
|
||||
margin-left: 8px;
|
||||
|
||||
.no-redirect {
|
||||
color: #97a8be;
|
||||
cursor: text;
|
||||
}
|
||||
}
|
||||
</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