Commit 277539f2 by xuyl

封装滚动组件,配置全局错误监控

1 parent 86d11795
...@@ -222,7 +222,6 @@ export const Util = { ...@@ -222,7 +222,6 @@ export const Util = {
value: '' value: ''
}) })
}) })
console.log(id, staff)
return { id, staff } return { id, staff }
} }
} }
......
<template>
<div class="swiper-container" id="swiper">
<div class="swiper-wrapper">
<slot></slot>
</div>
<div class="swiper-pagination"></div>
</div>
</template>
<script>
import Swiper from 'swiper'
import 'swiper/dist/css/swiper.min.css'
export default {
data() {
return {}
},
mounted() {
let previewSwiper = new Swiper('.swiper-container', {
grabCursor: true,
// spaceBetween: 20,
mousewheel: true,
// slidesPerView: 'auto',
observer: true, //修改swiper自己或子元素时,自动初始化
observeParents: true, //修改swiper的父元素时,自动初始化swiper
breakpoints: {
//当宽度小于等于1919
1440: {
slidesPerView: 4,
spaceBetween: 20
},
2800: {
slidesPerView: 5,
spaceBetween: 20
}
},
pagination: {
el: '.swiper-pagination',
type: 'progressbar'
}
})
this.$nextTick(() => {
setTimeout(function() {
previewSwiper.slideTo(0, 0, false)
}, 700)
})
}
}
</script>
<style lang="scss" scoped>
.swiper-container-horizontal > .swiper-pagination-progressbar {
width: 60px;
height: 5px;
bottom: 0px;
top: auto;
right: 0;
margin: auto;
border-radius: 5px;
background: #dddee0;
/deep/.swiper-pagination-progressbar-fill {
background: #5850ff;
border-radius: 3px;
}
}
#swiper {
padding: 0 20px;
.swiper-wrapper {
margin-bottom: 20px;
.swiper-slide {
}
}
}
</style>
...@@ -30,17 +30,30 @@ Vue.prototype.$apis = apis ...@@ -30,17 +30,30 @@ Vue.prototype.$apis = apis
Vue.use(glsxTable) Vue.use(glsxTable)
Vue.prototype.$message = message Vue.prototype.$message = message
Vue.prototype.size = 'small' Vue.prototype.size = 'small'
// Vue.prototype.btn_size = 'mini' // Vue.prototype.btn_size = 'mini'
Vue.prototype.$Constants = Constants Vue.prototype.$Constants = Constants
Vue.prototype.$Utils = Util Vue.prototype.$Utils = Util
Vue.prototype.$Commons = common Vue.prototype.$Commons = common
Vue.prototype.$echarts = echarts Vue.prototype.$echarts = echarts
//过滤器统一处理预加载 //过滤器统一处理预加载
Object.keys(filters).forEach(key => { Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key]) Vue.filter(key, filters[key])
}) })
export { bootstrap, mount, unmount } from '@/setup' Vue.config.errorHandler = function(err, vm, info) {
let {
message, // 异常信息
name, // 异常名称
stack // 异常堆栈信息
} = err
// vm 为抛出异常的 Vue 实例
// info 为 Vue 特定的错误信息,比如错误所在的生命周期钩子
console.error(`组件${vm.$vnode.tag},特定的错误信息:${info},异常信息:${message},异常名称:${name},异常堆栈信息:${stack}`)
}
export { bootstrap, mount, unmount }
from '@/setup'
export const http = params => Vue.prototype.$http(params) export const http = params => Vue.prototype.$http(params)
export const http2 = params => Vue.prototype.$http2(params) export const http2 = params => Vue.prototype.$http2(params)
export const http3 = params => Vue.prototype.$http3(params) export const http3 = params => Vue.prototype.$http3(params)
export const http_common = params => Vue.prototype.$http_common(params) export const http_common = params => Vue.prototype.$http_common(params)
\ No newline at end of file \ No newline at end of file
...@@ -25,10 +25,7 @@ ...@@ -25,10 +25,7 @@
<div :class="{ secondBigMarketItem: isSecondBigMarketItem, bigMarketItem: isBigMarketItem }" v-if="closeFlag"> <div :class="{ secondBigMarketItem: isSecondBigMarketItem, bigMarketItem: isBigMarketItem }" v-if="closeFlag">
<div v-for="(item, idx) in itemArr" :key="idx" :class="[{ active: isActive == idx }, 'marketItem']" @click="choickItem(idx, item.crowdName, item.crowdId, item.sop)"> <div v-for="(item, idx) in itemArr" :key="idx" :class="[{ active: isActive == idx }, 'marketItem']" @click="choickItem(idx, item.crowdName, item.crowdId, item.sop)">
<template v-if="idx < displayNum"> <template v-if="idx < displayNum">
<!-- <el-tooltip :content="item.crowdName" placement="top"> -->
<p class="peopleName">{{ item.crowdName }}</p> <p class="peopleName">{{ item.crowdName }}</p>
<!-- </el-tooltip> -->
<!-- <p class="peopleName">{{ item.crowdName }}</p> -->
<div class="itemBox"> <div class="itemBox">
<p class="peopleNum"> <p class="peopleNum">
{{ item.total }} {{ item.total }}
...@@ -42,26 +39,21 @@ ...@@ -42,26 +39,21 @@
</div> </div>
<!-- 轮播展示 --> <!-- 轮播展示 -->
<div v-show="!closeFlag"> <div v-show="!closeFlag">
<div class="swiper-container" id="swiper"> <GLSwiper>
<div class="swiper-wrapper"> <div v-for="(item, idx) in itemArr" :key="idx" :class="[{ active: isActive == idx }, 'marketItem', 'swiper-slide']" @click="choickItem(idx, item.crowdName, item.crowdId, item.sop)">
<div v-for="(item, idx) in itemArr" :key="idx" :class="[{ active: isActive == idx }, 'marketItem', 'swiper-slide']" @click="choickItem(idx, item.crowdName, item.crowdId, item.sop)"> <div class="marketItem-border">
<div class="marketItem-border"> <p class="peopleName">{{ item.crowdName }}</p>
<!-- <el-tooltip :content="item.crowdName" placement="top"> --> <div class="itemBox">
<p class="peopleName">{{ item.crowdName }}</p> <p class="peopleNum">
<!-- </el-tooltip> --> {{ item.total }}
<div class="itemBox"> <span>人</span>
<p class="peopleNum"> </p>
{{ item.total }} <p class="peopledesc">{{ item.crowdDesc }}</p>
<span>人</span> <el-button :class="['createSOP', { isDisableSOP: item.sop == 'Y' }]" @click.stop="createMarketSOP(item)" :disabled="item.sop == 'Y' ? true : false">创建营销SOP</el-button>
</p>
<p class="peopledesc">{{ item.crowdDesc }}</p>
<el-button :class="['createSOP', { isDisableSOP: item.sop == 'Y' }]" @click.stop="createMarketSOP(item)" :disabled="item.sop == 'Y' ? true : false">创建营销SOP</el-button>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="swiper-pagination"></div> </GLSwiper>
</div>
</div> </div>
</div> </div>
<div class="otherPageContent"> <div class="otherPageContent">
...@@ -114,11 +106,10 @@ ...@@ -114,11 +106,10 @@
<script> <script>
import { marketingPeopleListShow, getcrowdManageList, customerClusterListExport } from '@/api/modules/clientDataOverview' import { marketingPeopleListShow, getcrowdManageList, customerClusterListExport } from '@/api/modules/clientDataOverview'
import marketingPlan from './components/marketingPlan.vue' import marketingPlan from './components/marketingPlan.vue'
import Swiper from 'swiper' import GLSwiper from '@/components/GLSwiper'
import 'swiper/dist/css/swiper.min.css'
export default { export default {
name: 'marketingPeople', name: 'marketingPeople',
components: { marketingPlan }, components: { marketingPlan, GLSwiper },
data() { data() {
return { return {
sopStatus: '', sopStatus: '',
...@@ -323,35 +314,6 @@ export default { ...@@ -323,35 +314,6 @@ export default {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.screenWidth = document.body.clientWidth this.screenWidth = document.body.clientWidth
}) })
let previewSwiper = new Swiper('.swiper-container', {
grabCursor: true,
// spaceBetween: 20,
mousewheel: true,
// slidesPerView: 'auto',
observer: true, //修改swiper自己或子元素时,自动初始化
observeParents: true, //修改swiper的父元素时,自动初始化swiper
breakpoints: {
//当宽度小于等于1919
1440: {
slidesPerView: 4,
spaceBetween: 20
},
2800: {
slidesPerView: 5,
spaceBetween: 20
}
},
pagination: {
el: '.swiper-pagination',
type: 'progressbar'
}
})
this.$nextTick(() => {
setTimeout(function() {
previewSwiper.slideTo(0, 0, false)
}, 700)
})
}, },
watch: { watch: {
screenWidth: { screenWidth: {
...@@ -507,9 +469,7 @@ export default { ...@@ -507,9 +469,7 @@ export default {
setTableHeightEvent() { setTableHeightEvent() {
this.$refs.marketPeople.setTableHeightFun() this.$refs.marketPeople.setTableHeightFun()
}, },
handleClick(tab) { handleClick(tab) {}
console.log(tab)
}
} }
} }
</script> </script>
...@@ -539,85 +499,61 @@ export default { ...@@ -539,85 +499,61 @@ export default {
.pure-yello-text { .pure-yello-text {
color: #fb8f28; color: #fb8f28;
} }
/deep/.swiper-container-horizontal > .swiper-pagination-progressbar {
width: 60px;
height: 5px;
bottom: 0px;
top: auto;
right: 0;
margin: auto;
border-radius: 5px;
background: #dddee0;
.swiper-pagination-progressbar-fill {
background: #5850ff;
border-radius: 3px;
}
}
#swiper { .marketItem-border {
padding: 0 20px; min-height: 251px;
.swiper-wrapper { .peopleName {
margin-bottom: 20px; height: 54px;
.swiper-slide { line-height: 54px;
// width: 234px; background: #f7f7fc;
font-size: 16px;
.marketItem-border { font-weight: 600;
min-height: 251px; padding-left: 16px;
.peopleName { vertical-align: middle;
height: 54px; overflow: hidden;
line-height: 54px; text-overflow: ellipsis;
background: #f7f7fc; white-space: nowrap;
font-size: 16px; }
font-weight: 600; .itemBox {
padding-left: 16px; border-left: 1px solid #ededf0;
vertical-align: middle; border-right: 1px solid #ededf0;
overflow: hidden; border-bottom: 1px solid #ededf0;
text-overflow: ellipsis; padding: 0 16px;
white-space: nowrap; box-sizing: border-box;
} .peopleNum {
.itemBox { padding: 24px 0;
border-left: 1px solid #ededf0; font-size: 26px;
border-right: 1px solid #ededf0; font-weight: 600;
border-bottom: 1px solid #ededf0; color: #333333;
padding: 0 16px; span {
box-sizing: border-box; font-size: 14px;
.peopleNum { font-weight: 400;
padding: 24px 0;
font-size: 26px;
font-weight: 600;
color: #333333;
span {
font-size: 14px;
font-weight: 400;
}
}
.peopledesc {
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
display: -webkit-box;
-webkit-box-orient: vertical;
word-break: break-all;
font-size: 14px;
color: #999999;
line-height: 20px;
height: 40px;
}
.createSOP {
margin: 24px 0;
border-radius: 4px;
border: 1px solid #5850ff;
width: 100%;
color: #5850ff;
padding: 9px 20px;
}
.isDisableSOP {
color: #c0bcff;
border: 1px solid #c0bcff;
}
}
} }
} }
.peopledesc {
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
display: -webkit-box;
-webkit-box-orient: vertical;
word-break: break-all;
font-size: 14px;
color: #999999;
line-height: 20px;
height: 40px;
}
.createSOP {
margin: 24px 0;
border-radius: 4px;
border: 1px solid #5850ff;
width: 100%;
color: #5850ff;
padding: 9px 20px;
}
.isDisableSOP {
color: #c0bcff;
border: 1px solid #c0bcff;
}
} }
} }
.active { .active {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!