Commit 6509b9a4 by 王志慧

commit

1 parent 9346226f
<template>
<div
class="marquee-box"
ref="marqueeBox"
>
<span
class="marquee"
ref="marqueeText"
:style="[{'transition': `all ${move ? speed : 0}s linear`},{'left':target}]"
>{{text}}</span>
<div class="marquee-box" ref="marqueeBox">
<span class="marquee" ref="marqueeText" :style="[{ transition: `all ${move ? speed : 0}s linear` }, { left: target }]">{{ text }}</span>
</div>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
export default {
name: 'Marquee',
props: {
......@@ -34,16 +27,21 @@ export default {
speed: 0
}
},
mounted () {
setTimeout(() => {
watch:{
'text'(n){
if(n)setTimeout(() => {
let { marqueeBox, marqueeText } = this.$refs
if (!marqueeBox) return
let boxWidth = marqueeBox.offsetWidth,
valueWidth = marqueeText.offsetWidth
this.valueWidth = valueWidth
this.boxWidth = boxWidth
if (boxWidth - 20 <= valueWidth) this.run(valueWidth)
if (boxWidth - 10 <= valueWidth) this.run(valueWidth)
}, this.delay)
}
},
mounted () {
},
methods: {
run () {
......@@ -76,7 +74,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.marquee-box {
width: 100%;
height: 100%;
......@@ -92,4 +90,4 @@ export default {
transform: translateX(-100%);
}
}
</style>
\ No newline at end of file
</style>
......@@ -35,7 +35,7 @@ export default {
},
radius: {
type: Array,
default: () => ['55%', '75%']
default: () => ['50%', '70%']
},
colors: {
type: Array,
......@@ -221,15 +221,15 @@ export default {
text-align: center;
max-width: 40%;
&-num {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
// font-size: 0.6vw;
color: #fff;
--step: 0;
counter-reset: count var(--step);
z-index: var(--step);
transition: --step 1s;
transition: --step 0.5s;
&::before {
content: counter(count);
}
......@@ -251,7 +251,7 @@ export default {
text-align: center;
font-weight: 400;
position: absolute;
top: 93%;
top: 91%;
left: 50%;
transform: translateX(-50%);
text-align: center;
......
......@@ -2,7 +2,7 @@
<div class="tabs">
<div class="tab pointer">
<div class="tab-left box" @click="changeType('total')">
<div class="tab-total-box">
<div :class="{ 'tab-total-box': true, active: tabType == 'total' }">
<div class="total-title-box flex">
<div class="title inline total">客户总数</div>
<div class="title inline">{{ req.queryType == 0 ? '上月' : '昨日' }}新增</div>
......@@ -17,7 +17,7 @@
</div>
<div class="tab-right box">
<template v-for="(i, index) in tabs">
<div :key="index" class="item flex" @click="changeType(i.key)">
<div :key="index" :class="['item', 'flex', tabType == i.key ? 'active' : '']" @click="changeType(i.key)">
<div class="item-title">{{ i.title }}</div>
<transition-number :num="pageData[i.key].totalNum" :idKey="`number-${i.key}`" class="item-total" />
<div :class="['item-incr flex', { up: pageData[i.key].up }, { down: pageData[i.key].down }]">
......@@ -34,7 +34,10 @@
<div class="tabs-content box">
<div class="tabs-title title-icon">
<span class="icon"></span>
<span>客户增长趋势</span>
<span>
客户增长趋势
<label class="tabs-title-info">-{{ tabTitle }}</label>
</span>
</div>
<div class="tabs-content-chart flex">
<div class="line flex">
......@@ -50,6 +53,7 @@
</template>
</div>
<div class="table user-select pointer">
<div class="tabs-title-info table-position">({{tabTitle}})</div>
<div class="table-head">
<template v-for="(i, index) in tabHead">
<div :class="['table-head-item flex', { active: index == tabIndex }]" :key="index" @click="tabIndex = index">
......@@ -57,7 +61,7 @@
</div>
</template>
</div>
<div class="table-body flex">
<div class="table-body">
<template v-for="(i, index) in tabIndex == 0 ? pageData[tabType].top : pageData[tabType].last">
<div class="table-body-item flex" :key="index">
<div class="table-num flex">{{ index + 1 }}</div>
......@@ -102,6 +106,7 @@ export default {
return {
tabs,
tabHead: [],
tabTitle:'客户总数',
tabType: 'total',
tabIndex: 0,
delayTimer: 3000,
......@@ -140,7 +145,14 @@ export default {
this.getOveralltrend('total')
},
changeType (type) {
console.log(type,'type')
let title = {
'total': '客户总数',
'wechat': '企微客户数',
'wechatGroup': '企微群数',
'applet': '小程序客户数',
'publiccus': '公众号客户数'
}
this.tabTitle = title[type]
this.tabType = type
this.getOveralltrend(type)
},
......@@ -337,8 +349,8 @@ export default {
display: grid;
grid-template-columns: 41.5% 57.5%;
justify-content: space-between;
margin-bottom: 0.5vh;
overflow: hidden;
margin-bottom: 1vh;
// overflow: hidden;
.tab-total-box {
height: 100%;
padding-left: 8px;
......@@ -427,6 +439,11 @@ export default {
}
}
}
.active {
background: rgba(235, 96, 1, 0.1);
box-sizing: border-box;
border: 1px solid rgba(235, 96, 1, 0.8);
}
}
&-content {
height: 24.4vh;
......@@ -437,6 +454,11 @@ export default {
.tabs-title {
font-size: 12px;
color: #e8e8e8;
&-info {
font-size: 10px;
color: #eb6001;
line-height: 17px;
}
}
&-chart {
height: 20.2vh;
......@@ -458,6 +480,13 @@ export default {
.table {
flex: 3;
background: #262525;
position:relative;
.table-position{
position:absolute;
top:-20px;
left:50%;
transform: translateX(-50%);
}
&-head {
display: grid;
grid-template-columns: repeat(2, 50%);
......@@ -479,8 +508,6 @@ export default {
}
&-body {
height: calc(100% - 2.4vh);
flex-direction: column;
justify-content: space-between;
&-item {
line-height: 3.4vh;
width: 100%;
......@@ -493,6 +520,7 @@ export default {
}
.table-key {
width: calc(100% - 96px);
height: 3.6vh;
}
.tab-value {
width: 52px;
......
......@@ -56,7 +56,7 @@ export default {
color: transparent;
background: linear-gradient(left, #e60115 10%, #eb6001 25%, #f5aa01 50%, #fdf006 100%);
-webkit-background-clip: text;
font-size: 22px;
font-size: 18px;
font-weight: 600;
&::before {
content: '';
......
......@@ -7,7 +7,7 @@ function getLineOptions(obj) {
backgroundColor: 'rgba(68,68,68,0.80)',
textStyle: {
color: '#FFFFFF',
fontSize: '8px'
fontSize: '1.5px'
},
formatter: tooltipFormatter || '',
confine: true
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!