Commit 40d06003 by 胡悦

Merge branch 'gh_v1.2.0' into gh_v1.2.1

2 parents 219cea56 4ed1a877
......@@ -2,7 +2,7 @@
<div class="pie-box">
<div :id="id" :style="{ height: height }" class="pie-chart"></div>
<div class="center-content" :style="{ fontSize: size }">
<div :class="[id, 'center-content-num']"></div>
<div :class="[id, 'center-content-num', 'center-content-num-color']"></div>
</div>
<div class="content-desc">
<div class="content-desc-icon" :style="{ background: descColor }"></div>
......@@ -191,7 +191,17 @@ export default {
},
setAnamiteText() {
// document.querySelector(`.${this.id}`).nextElementSibling.style = 'animation-iteration-count:infinite;'
if (document.querySelector(`.${this.id}`)) document.querySelector(`.${this.id}`).style = `--step:${this.mainValue}`
// if (document.querySelector(`.${this.id}`))
if (document.querySelector(`.${this.id}`)) {
if (typeof this.mainValue == 'string') {
let dom = document.querySelector(`.${this.id}`)
dom.classList.remove('center-content-num')
dom.innerText = this.mainValue + '%'
} else {
document.querySelector(`.${this.id}`).style = `--step:${this.mainValue}`
}
}
// document.querySelector("div").style.setProperty("--percent", Math.random())
// setTimeout(() => {
// document.querySelector(`.${this.id}`).nextElementSibling.style = 'animation-iteration-count:0'
// }, 3000)
......@@ -219,12 +229,14 @@ export default {
transform: translate(-50%, -50%);
text-align: center;
max-width: 40%;
&-num-color {
color: #fff;
}
&-num {
// 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);
......@@ -243,7 +255,7 @@ export default {
}
}
.content-desc {
display:flex;
display: flex;
align-items: center;
font-size: 8px;
color: #c8c8c8;
......@@ -260,7 +272,7 @@ export default {
width: 8px;
height: 4px;
border-radius: 2px;
margin-right:4px;
margin-right: 4px;
}
}
}
......
......@@ -15,6 +15,7 @@
>
</div>
</template>
<slot name="suffix"></slot>
</div>
</template>
......@@ -78,4 +79,4 @@ export default {
inherits: false;
initial-value: 15;
}
</style>
\ No newline at end of file
</style>
<template>
<div class="tabs">
<div class="tab pointer">
<div class="tab">
<div class="tab-left box" @click="changeType('total')">
<div :class="{ 'tab-total-box': true, active: tabType == 'total' }">
<div class="total-title-box flex">
......@@ -17,9 +17,11 @@
</div>
<div class="tab-right box">
<template v-for="(i, index) in tabs">
<div :key="index" :class="['item', 'flex', tabType == i.key ? 'active' : '']" @click="changeType(i.key)">
<div :key="index" :class="['item', 'flex', tabType == i.key ? 'active' : '', ['applet', 'publiccus'].includes(i.key) ? '' : 'pointer']" @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" />
<transition-number :num="pageData[i.key].totalNum" :idKey="`number-${i.key}`" class="item-total">
<span v-if="['applet', 'publiccus'].includes(i.key)" class="item-txt" slot="suffix">(总)</span>
</transition-number>
<div :class="['item-incr flex', { up: pageData[i.key].up }, { down: pageData[i.key].down }]">
{{ req.queryType == 0 ? '上月' : '昨日' }}
<template v-if="pageData[i.key].up || pageData[i.key].down">
......@@ -126,7 +128,7 @@ export default {
updata: Date.now()
}
},
mounted() {},
mounted() { },
methods: {
init(params) {
this.isGroup = true
......@@ -144,6 +146,9 @@ export default {
this.getOveralltrend(this.tabType)
},
changeType(type) {
if (['applet', 'publiccus'].includes(type)) {
return true
}
let title = {
total: '客户总数',
wechat: '企微客户数',
......@@ -383,8 +388,8 @@ export default {
width: 27%;
padding-left: 0;
white-space: nowrap;
.describe{
font-size:8px;
.describe {
font-size: 8px;
color: #eb6001;
}
}
......@@ -418,6 +423,11 @@ export default {
color: #e8e8e8;
padding-top: 0.5vh;
}
&-txt {
font-size: 12px;
color: #e8e8e8;
font-weight: 400;
}
&-total {
font-size: 14px;
color: #eb6001;
......
......@@ -49,7 +49,6 @@ export default {
},
getMerchantNum() {
this.api.overview.getMerchantNum({}).then(res => {
console.log(res)
if (res.code === '0') {
this.merchantNum = res.data.dataList[0]
}
......
......@@ -29,13 +29,18 @@ export default {
this.distributionRank = ''
if (res.data.dataList.length > 0) {
let distribution = JSON.parse(res.data.dataList[0].distribution)
const keys = Object.keys(distribution)
// 删掉“未知”
delete distribution['未知']
let keys = Object.keys(distribution)
let total = Object.values(distribution).reduce((prev, next) => prev + next)
keys.forEach((item, index) => {
this.clientData.push({
name: item,
value: distribution[item]
// value: distribution[item]
value: (distribution[item] / total * 100).toFixed(1)
})
})
console.log(this.clientData)
this.distributionRank = JSON.parse(res.data.dataList[0].distributionRank)
}
})
......@@ -51,7 +56,7 @@ export default {
pieAction(data) {
this.brandList = []
let array = this.distributionRank && this.distributionRank[data.name]
if (array&&array.length > 0) {
if (array && array.length > 0) {
for (let i of array) {
this.brandList.push(i && Object.keys(i)[0])
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!