Commit 4053f749 by 胡悦

Merge branch 'gh_v1.2.0' of http://192.168.3.233:8090/gh/data-view into gh_v1.2.0

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