Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-custom
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 277539f2
authored
Jul 05, 2022
by
xuyl
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
封装滚动组件,配置全局错误监控
1 parent
86d11795
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
95 additions
and
74 deletions
src/common/util.js
src/components/GLSwiper/index.vue
src/main.js
src/views/clientDataOverview/marketingPeople.vue
src/common/util.js
View file @
277539f
...
@@ -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
}
}
}
}
}
...
...
src/components/GLSwiper/index.vue
0 → 100644
View file @
277539f
<
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
>
src/main.js
View file @
277539f
...
@@ -30,16 +30,29 @@ Vue.prototype.$apis = apis
...
@@ -30,16 +30,29 @@ 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
)
...
...
src/views/clientDataOverview/marketingPeople.vue
View file @
277539f
...
@@ -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,13 +39,10 @@
...
@@ -42,13 +39,10 @@
</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"
>
<!-- <el-tooltip :content="item.crowdName" placement="top"> -->
<p
class=
"peopleName"
>
{{ item.crowdName }}
</p>
<p
class=
"peopleName"
>
{{ item.crowdName }}
</p>
<!-- </el-tooltip> -->
<div
class=
"itemBox"
>
<div
class=
"itemBox"
>
<p
class=
"peopleNum"
>
<p
class=
"peopleNum"
>
{{ item.total }}
{{ item.total }}
...
@@ -59,9 +53,7 @@
...
@@ -59,9 +53,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</GLSwiper>
<div
class=
"swiper-pagination"
></div>
</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,29 +499,8 @@ export default {
...
@@ -539,29 +499,8 @@ 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
;
.swiper-wrapper
{
margin-bottom
:
20px
;
.swiper-slide
{
//
width
:
234px
;
.marketItem-border
{
min-height
:
251px
;
min-height
:
251px
;
.peopleName
{
.peopleName
{
height
:
54px
;
height
:
54px
;
...
@@ -616,9 +555,6 @@ export default {
...
@@ -616,9 +555,6 @@ export default {
border
:
1px
solid
#c0bcff
;
border
:
1px
solid
#c0bcff
;
}
}
}
}
}
}
}
}
}
.active
{
.active
{
border
:
1px
solid
#5850ff
;
border
:
1px
solid
#5850ff
;
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment