Commit 25616c35 by 前端

fixed

1 parent b5c40703
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:43:46 * @Date: 2022-10-25 10:43:46
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-31 10:28:51 * @LastEditTime: 2022-10-31 17:25:12
* @FilePath: \dj-data-view\src\components\barChart.vue * @FilePath: \dj-data-view\src\components\barChart.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -12,6 +12,16 @@ ...@@ -12,6 +12,16 @@
</div> </div>
</template> </template>
<script> <script>
const ValueAnalysis = [
{ name: 'gendev', label: '一般发展', order: 6 },
{ name: 'genrecall', label: '一般召回', order: 7 },
{ name: 'gensave', label: '一般挽留', order: 8 },
{ name: 'genval', label: '一般价值', order: 5 },
{ name: 'majordev', label: '重要发展', order: 2 },
{ name: 'majorrecall', label: '重要召回', order: 3 },
{ name: 'majorsave', label: '重要挽留', order: 4 },
{ name: 'majorval', label: '重要价值', order: 1 }
]
import datas from '@/utils/data' import datas from '@/utils/data'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import utils from '../utils/util' import utils from '../utils/util'
...@@ -85,7 +95,9 @@ export default { ...@@ -85,7 +95,9 @@ export default {
dataIndex: 0 dataIndex: 0
}, },
timer: null, timer: null,
currentData: {} currentData: {
dataIndex: 0
}
} }
}, },
// created() { // created() {
...@@ -102,20 +114,19 @@ export default { ...@@ -102,20 +114,19 @@ export default {
const { rotate, analysisList } = this const { rotate, analysisList } = this
const obj = { const obj = {
rotate, rotate,
analysisList analysisList,
ValueAnalysis
} }
this.lineOptions = this.revese ? getBarReverseOptions(obj) : getBarOptions(obj) this.lineOptions = this.revese ? getBarReverseOptions(obj) : getBarOptions(obj)
this.chartBindEvent() this.chartBindEvent()
}, },
deep: true, deep: true
immediate: true
} }
}, },
mounted() { mounted() {
console.log(this.areaList, 999)
this.lineDom = document.getElementById(this.domId) this.lineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.lineDom) this[this.domId] = echarts.init(this.lineDom)
this.chartBindEvent() // this.chartBindEvent()
}, },
methods: { methods: {
chartBindEvent() { chartBindEvent() {
...@@ -125,18 +136,34 @@ export default { ...@@ -125,18 +136,34 @@ export default {
this[this.domId].getZr().on( this[this.domId].getZr().on(
'mousemove', 'mousemove',
utils.debounce(params => { utils.debounce(params => {
clearInterval(this.timer)
this.timer = null
const pointInPixel = [params.offsetX, params.offsetY] const pointInPixel = [params.offsetX, params.offsetY]
const pointInGrid = this[this.domId].convertFromPixel({ seriesIndex: 0 }, pointInPixel) const pointInGrid = this[this.domId].convertFromPixel({ seriesIndex: 0 }, pointInPixel)
const yIndex = pointInGrid[1] const yIndex = pointInGrid[1]
this.currentData = { this.currentData = {
dataIndex: yIndex dataIndex: yIndex
} }
this.$bus.$emit('drawChart', yIndex) this.chartAction(yIndex)
}, 500) }, 500)
) )
this[this.domId].on('globalout', () => { this[this.domId].getZr().on(
this.chartAction(this.currentData.dataIndex) 'mouseout',
}) utils.debounce(() => {
if (!this.timer) {
this.timer = setInterval(this.setInter, 5000)
}
}, 500)
)
this.timer = setInterval(this.setInter, 5000)
},
setInter() {
if (this.currentData.dataIndex == 0) {
this.currentData.dataIndex = 7
} else {
this.currentData.dataIndex--
}
this.chartAction(this.currentData.dataIndex)
}, },
chartAction(index = 7) { chartAction(index = 7) {
this[this.domId].dispatchAction({ this[this.domId].dispatchAction({
...@@ -144,6 +171,7 @@ export default { ...@@ -144,6 +171,7 @@ export default {
seriesIndex: 0, seriesIndex: 0,
dataIndex: index dataIndex: index
}) })
this.$bus.$emit('drawChart', index)
} }
} }
} }
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:46:24 * @Date: 2022-10-25 10:46:24
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-31 09:38:47 * @LastEditTime: 2022-10-31 16:41:32
* @FilePath: \dj-data-view\src\components\barOptions.js * @FilePath: \dj-data-view\src\components\barOptions.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
import utils from '../utils/util'
function getBarOptions(obj) { function getBarOptions(obj) {
console.log(obj)
const { analysisList, rotate } = obj const { analysisList, rotate } = obj
const num = analysisList.map(item => item.num) const num = analysisList.map(item => item.ratio * 100)
console.log(num) console.log(num)
const name = analysisList.map(item => item.name) const name = analysisList.map(item => item.name)
var options = { var options = {
...@@ -17,8 +17,7 @@ function getBarOptions(obj) { ...@@ -17,8 +17,7 @@ function getBarOptions(obj) {
type: 'category', type: 'category',
axisLabel: { axisLabel: {
color: '#fff', color: '#fff',
fontSize: '0.75em', fontSize: '0.72em'
rotate
}, },
splitLine: { splitLine: {
show: false show: false
...@@ -34,24 +33,23 @@ function getBarOptions(obj) { ...@@ -34,24 +33,23 @@ function getBarOptions(obj) {
grid: { grid: {
left: '8%', left: '8%',
right: '6%', right: '6%',
top: '3%', top: '6%',
bottom: obj.rotate ? '4%' : '12%', bottom: '4%',
// bottom: obj.rotate ? '4%' : '12%',
containLabel: true containLabel: true
}, },
yAxis: { yAxis: {
nameGap: 30,
type: 'value', type: 'value',
splitLine: { splitLine: {
show: false
},
axisLabel: {
show: false
},
splitLine: {
lineStyle: { lineStyle: {
color: '#2F314F' color: '#2F314F'
} }
}, },
axisLabel: {
color: '#fff',
fontSize: '0.75em',
formatter: '{value}%'
},
splitNumber: 4 splitNumber: 4
}, },
series: [ series: [
...@@ -69,8 +67,17 @@ function getBarOptions(obj) { ...@@ -69,8 +67,17 @@ function getBarOptions(obj) {
return options return options
} }
function getBarReverseOptions(obj) { function getBarReverseOptions(obj) {
const { analysisList } = obj const { analysisList, ValueAnalysis } = obj
const value = Object.values(analysisList) // const value = Object.values(analysisList)
const entries = Object.entries(analysisList)
ValueAnalysis.forEach(sis => {
entries.forEach(key => {
if (sis.name == key[0]) {
sis.value = key[1]
}
})
})
const value = utils.deepClone(ValueAnalysis).sort((a, b) => b.order - a.order)
var options = { var options = {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
...@@ -104,7 +111,7 @@ function getBarReverseOptions(obj) { ...@@ -104,7 +111,7 @@ function getBarReverseOptions(obj) {
axisLine: { axisLine: {
show: false show: false
}, },
data: ['一般发展', '一般价值', '一般挽留', '重要挽留', '重要价值', '重要发展', '重要保持', '一般保持'].reverse() data: value.map(item => item.label)
}, },
grid: { grid: {
left: '15%', left: '15%',
...@@ -146,7 +153,7 @@ function getBarReverseOptions(obj) { ...@@ -146,7 +153,7 @@ function getBarReverseOptions(obj) {
} }
} }
}, },
data: value data: value.map(item => item.value)
} }
] ]
} }
...@@ -170,7 +177,7 @@ function getLineOptions(obj) { ...@@ -170,7 +177,7 @@ function getLineOptions(obj) {
borderRadius: 4, borderRadius: 4,
textStyle: { textStyle: {
color: 'rgba(255,255,255,1)', color: 'rgba(255,255,255,1)',
fontSize: 14 fontSize: 10
}, },
formatter: function (item) { formatter: function (item) {
return `${name}:${item[0].value}` return `${name}:${item[0].value}`
...@@ -264,15 +271,16 @@ function lineAndBarOptions(list) { ...@@ -264,15 +271,16 @@ function lineAndBarOptions(list) {
} }
}, },
padding: 5, padding: 5,
borderWidth: 0.5, borderWidth: 1,
backgroundColor: 'rgba(35, 45, 152, 1)', backgroundColor: 'rgba(35, 45, 152, 1)',
borderRadius: 4, borderRadius: 4,
textStyle: { textStyle: {
color: 'rgba(255,255,255,1)', color: 'rgba(255,255,255,1)',
fontSize: 14 fontSize: 10
}, },
formatter: function (item) { formatter: function (item) {
return `门店数:${item[0].value}<br>新增数:${item[1].value}` const items = list[item[0].dataIndex]
return `当月总门店数:${item[0].value}<br>当月新增:${item[1].value}<br>上月总门店数:${items.yesterdaytotalNum}<br>上月月新增:${items.yesterdayincreNum}`
} }
}, },
xAxis: [ xAxis: [
...@@ -312,7 +320,7 @@ function lineAndBarOptions(list) { ...@@ -312,7 +320,7 @@ function lineAndBarOptions(list) {
} }
}, },
axisLabel: { axisLabel: {
color: '#fff', color: '#FFD241',
fontSize: '0.8em' fontSize: '0.8em'
}, },
splitNumber: 4 splitNumber: 4
...@@ -327,7 +335,7 @@ function lineAndBarOptions(list) { ...@@ -327,7 +335,7 @@ function lineAndBarOptions(list) {
} }
}, },
axisLabel: { axisLabel: {
color: '#fff', color: '#769EFF',
fontSize: '0.8em' fontSize: '0.8em'
}, },
splitNumber: 4 splitNumber: 4
...@@ -335,16 +343,6 @@ function lineAndBarOptions(list) { ...@@ -335,16 +343,6 @@ function lineAndBarOptions(list) {
], ],
series: [ series: [
{ {
name: 'bar',
type: 'bar',
symbol: 'circle',
backgroundStyle: {
color: '#6578FF'
},
barWidth: '30%',
data: increNum
},
{
name: 'line', name: 'line',
type: 'line', type: 'line',
symbol: 'circle', symbol: 'circle',
...@@ -374,8 +372,18 @@ function lineAndBarOptions(list) { ...@@ -374,8 +372,18 @@ function lineAndBarOptions(list) {
] ]
} }
}, },
yAxisIndex: 1,
data: totalNum data: totalNum
},
{
name: 'bar',
type: 'bar',
symbol: 'circle',
backgroundStyle: {
color: '#6578FF'
},
yAxisIndex: 1,
barWidth: '30%',
data: increNum
} }
] ]
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2022-06-23 17:38:33 * @Date: 2022-06-23 17:38:33
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-25 10:38:15 * @LastEditTime: 2022-10-31 16:36:33
*/ */
const DefaultData = { const DefaultData = {
defaultLineHeight: '17.32', defaultLineHeight: '17.32',
......
...@@ -73,7 +73,7 @@ const getQuery = name => { ...@@ -73,7 +73,7 @@ const getQuery = name => {
/** 三个数字加一个逗号 */ /** 三个数字加一个逗号 */
const numAddSymbol = val => { const numAddSymbol = val => {
return (val + '').replace(/\B(?=(?:\d{3})+\b)/g, ',') return val ? (val + '').replace(/\B(?=(?:\d{3})+\b)/g, ',') : 0
} }
// 获取当前时间 // 获取当前时间
...@@ -111,6 +111,27 @@ const setChartFontSize = fontSize => { ...@@ -111,6 +111,27 @@ const setChartFontSize = fontSize => {
if (!clientWidth) return fontSize if (!clientWidth) return fontSize
return (fontSize * clientWidth) / 1440 return (fontSize * clientWidth) / 1440
} }
const deepClone = obj => {
// Handle the 3 simple types, and null or undefined or function
if (obj == null || typeof obj !== 'object') return obj
// Handle Date
if (obj instanceof Date) {
const copy = new Date()
copy.setTime(obj.getTime())
return copy
}
// Handle Array or Object
if ((obj instanceof Array) | (obj instanceof Object)) {
const copy = obj instanceof Array ? [] : {}
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) {
copy[attr] = deepClone(obj[attr])
}
}
return copy
}
throw new Error("Unable to clone obj! Its type isn't supported.")
}
const utils = { const utils = {
getParams, getParams,
getQuery, getQuery,
...@@ -122,7 +143,8 @@ const utils = { ...@@ -122,7 +143,8 @@ const utils = {
getNDate, getNDate,
getNMonth, getNMonth,
debounce, debounce,
setChartFontSize setChartFontSize,
deepClone
} }
Object.keys(utils).map(key => { Object.keys(utils).map(key => {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26 * @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 11:18:27 * @LastEditTime: 2022-10-31 17:28:49
* @FilePath: \dj-data-view\src\views\saas\business.vue * @FilePath: \dj-data-view\src\views\saas\business.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
data() { data() {
return { return {
businessNum: {}, businessNum: {},
categoryData:[], categoryData: []
} }
}, },
mounted() { mounted() {
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
this.api.sass.getSaasValueaddedTransformationOverview().then(res => { this.api.sass.getSaasValueaddedTransformationOverview().then(res => {
if (res.code == 0) { if (res.code == 0) {
this.businessNum = res.data.dataList[0] this.businessNum = res.data.dataList[0]
this.categoryData = [ this.categoryData = [
{ {
name: '权益类', name: '权益类',
value: this.businessNum.equity value: this.businessNum.equity
...@@ -68,7 +68,7 @@ export default { ...@@ -68,7 +68,7 @@ export default {
.business-wrap { .business-wrap {
height: 13.9vh; height: 13.9vh;
margin-bottom: 0.98vh; margin-bottom: 0.98vh;
margin-top: 0.98vh; margin-top: 0.98vh;
.business-data { .business-data {
margin-right: 4px; margin-right: 4px;
// margin-top: 0.98vh; // margin-top: 0.98vh;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26 * @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 13:33:57 * @LastEditTime: 2022-10-31 10:47:45
* @FilePath: \dj-data-view\src\views\saas\business.vue * @FilePath: \dj-data-view\src\views\saas\business.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -49,7 +49,7 @@ export default { ...@@ -49,7 +49,7 @@ export default {
}, },
methods: { methods: {
toFixNum(val) { toFixNum(val) {
return this.numAddSymbol(Number(val).toFixed(2)) return this.numAddSymbol(Math.round(Number(val)))
} }
} }
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div :class="['content-item', 'flex-around', info.pd ? info.pd : '']" v-for="(info, index) in infoList" :key="index"> <div :class="['content-item', 'flex-around', info.pd ? info.pd : '']" v-for="(info, index) in infoList" :key="index">
<div class="content-title">{{ info.title }}</div> <div class="content-title">{{ info.title }}</div>
<template v-for="(data, ids) in info.dataList"> <template v-for="(data, ids) in info.dataList">
<div v-if="ids != 3" :class="['content-number', 'num-' + ids]" :key="ids"> <div v-if="ids != 2" :class="['content-number', 'num-' + ids]" :key="ids">
{{ index == 0 ? numAddSymbol(data(smartClueData)) : index == 1 ? numAddSymbol(data(merchantData)) : numAddSymbol(data(smartData)) }} {{ index == 0 ? numAddSymbol(data(smartClueData)) : index == 1 ? numAddSymbol(data(merchantData)) : numAddSymbol(data(smartData)) }}
</div> </div>
<div v-else :class="['content-number', 'num-' + ids]" :key="ids"> <div v-else :class="['content-number', 'num-' + ids]" :key="ids">
...@@ -60,7 +60,12 @@ export default { ...@@ -60,7 +60,12 @@ export default {
merchantData: '', //门店会员的权益 merchantData: '', //门店会员的权益
smartData: '', // 智慧车管线索订阅 smartData: '', // 智慧车管线索订阅
smartClueData: '', //智慧门店线索订阅 smartClueData: '', //智慧门店线索订阅
titleList: [{ text: '订阅门店',width: '2.78vw' }, { text: '线索订阅门店数(累计)', width: '3.82vw' }, { text: '活跃使用门店', width: '4.95vw' }, { text: '留存率', width: '4.29vw' }], titleList: [
{ text: '订阅门店', width: '2.78vw' },
{ text: '线索订阅门店数(累计)', width: '3.82vw' },
{ text: '活跃使用门店', width: '4.95vw' },
{ text: '留存率', width: '4.29vw' }
],
infoList: [ infoList: [
{ {
title: '智慧门店线索订阅', title: '智慧门店线索订阅',
...@@ -104,7 +109,7 @@ export default { ...@@ -104,7 +109,7 @@ export default {
}, },
methods: { methods: {
toFixNum(val) { toFixNum(val) {
return (val * 100).toFixed(0) + '%' return (val * 100).toFixed(1) + '%'
}, },
getMerchantData() { getMerchantData() {
this.api.sass.getMerchantData().then(res => { this.api.sass.getMerchantData().then(res => {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26 * @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-31 10:16:04 * @LastEditTime: 2022-10-31 10:47:10
* @FilePath: \dj-data-view\src\views\saas\project.vue * @FilePath: \dj-data-view\src\views\saas\project.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</div> </div>
<div class="project-right flex"> <div class="project-right flex">
<div class="project-content-item"> <div class="project-content-item">
<div class="project-content-desc">累计展业门店数</div> <div class="project-content-desc">展业门店数</div>
<div class="project-content-num">{{ item.totalNum }}</div> <div class="project-content-num">{{ item.totalNum }}</div>
</div> </div>
<div class="project-content-item"> <div class="project-content-item">
...@@ -57,7 +57,7 @@ export default { ...@@ -57,7 +57,7 @@ export default {
return (val * 100).toFixed(2) + '%' return (val * 100).toFixed(2) + '%'
}, },
toFixNum(val) { toFixNum(val) {
return this.numAddSymbol(val.toFixed(2)) return this.numAddSymbol(Math.round(val))
}, },
getBusinessType() { getBusinessType() {
this.api.sass.getBusinessType().then(res => { this.api.sass.getBusinessType().then(res => {
...@@ -104,16 +104,16 @@ export default { ...@@ -104,16 +104,16 @@ export default {
flex: 1; flex: 1;
.project-content-item { .project-content-item {
&:first-child { &:first-child {
width: 27%; width: 22%;
} }
&:nth-child(2) { &:nth-child(2) {
width: 15%; width: 16%;
} }
&:nth-child(3) { &:nth-child(3) {
width: 15%; width: 16%;
} }
&:nth-child(4) { &:nth-child(4) {
width: 15%; width: 17%;
} }
&:nth-child(5) { &:nth-child(5) {
width: 28%; width: 28%;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26 * @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 15:17:26 * @LastEditTime: 2022-10-31 13:52:49
* @FilePath: \dj-data-view\src\views\user\analyse.vue * @FilePath: \dj-data-view\src\views\user\analyse.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
name: 'Analyse', name: 'Analyse',
data() { data() {
return { return {
analysisList: '' analysisList: {}
} }
}, },
mounted() { mounted() {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26 * @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 17:28:40 * @LastEditTime: 2022-10-31 14:03:19
* @FilePath: \dj-data-view\src\views\user\area.vue * @FilePath: \dj-data-view\src\views\user\area.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26 * @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 17:28:13 * @LastEditTime: 2022-10-31 14:03:21
* @FilePath: \dj-data-view\src\views\user\brand.vue * @FilePath: \dj-data-view\src\views\user\brand.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
......
<template> <template>
<div class="user-tab flex"> <div class="user-tab flex">
<template v-for="(tab, index) in userData"> <template v-for="(tab, index) in userData">
<div class="tab-item" :key="index" @click="getTrend(tab.view, tab.text)"> <div :class="['tab-item', { active: selectIndex == index }]" :key="index" @click="getTrend(tab.view, tab.text)">
<div class="tab-title">{{ tab.text }}</div> <div class="tab-title">{{ tab.text }}</div>
<div class="tab-count text-linear">{{ numAddSymbol(dataList[tab.value]) }}</div> <div class="tab-count text-linear">{{ numAddSymbol(dataList[tab.value]) }}</div>
<div class="tab-increase flex-between"> <div class="tab-increase flex-between">
...@@ -14,43 +14,45 @@ ...@@ -14,43 +14,45 @@
</template> </template>
<script> <script>
const TEXT_VIEW = [
{
text: '用户数',
value: 'totalnum',
key: 'increnum',
view: 'total'
},
{
text: '企微客户数',
value: 'totalwechatnum',
key: 'increwechatnum',
view: 'wechat'
},
{
text: '企微群数',
value: 'totalwechatgroupnum',
key: 'increwechatgroupnum',
view: 'wechatgroup'
},
{
text: '小程序',
value: 'totalappletnum',
key: 'increappletnum',
view: 'applet'
},
{
text: '个微客户数',
value: 'totalsinglewechantnum',
key: 'incresinglewechantnum',
view: 'individual'
}
]
export default { export default {
name: 'UserTab', name: 'UserTab',
data() { data() {
return { return {
dataList: {}, dataList: {},
userData: [ userData: TEXT_VIEW,
{ selectIndex: 0
text: '用户数',
value: 'totalnum',
key: 'increnum',
view: 'total'
},
{
text: '企微客户数',
value: 'totalwechatnum',
key: 'increwechatnum',
view: 'wechat'
},
{
text: '企微群数',
value: 'totalwechatgroupnum',
key: 'increwechatgroupnum',
view: 'wechatgroup'
},
{
text: '小程序',
value: 'totalappletnum',
key: 'increappletnum',
view: 'applet'
},
{
text: '个微客户数',
value: 'totalsinglewechantnum',
key: 'incresinglewechantnum',
view: 'individual'
}
]
} }
}, },
async created() { async created() {
...@@ -67,6 +69,9 @@ export default { ...@@ -67,6 +69,9 @@ export default {
}, },
getTrend(queryItem, name) { getTrend(queryItem, name) {
const selectIndex = TEXT_VIEW.findIndex(item => item.text == name)
if (selectIndex > 2) return
this.selectIndex = selectIndex
const params = { req: { queryItem } } const params = { req: { queryItem } }
this.api.user.getTrend(params).then(res => { this.api.user.getTrend(params).then(res => {
if (res.code == 0) { if (res.code == 0) {
...@@ -94,6 +99,23 @@ export default { ...@@ -94,6 +99,23 @@ export default {
margin-right: 0.28vw; margin-right: 0.28vw;
padding: 0.28vh 0; padding: 0.28vh 0;
box-sizing: border-box; box-sizing: border-box;
&.active {
border: 1px solid #6578ff;
position: relative;
&::after {
content: '';
position: absolute;
bottom: -4px;
left: 50%;
height: 6px;
width: 6px;
margin-left: -3px;
background: #0b0e31;
border-bottom: 1px solid #6578ff;
border-right: 1px solid #6578ff;
transform: rotate(45deg);
}
}
.tab-title { .tab-title {
font-weight: 400; font-weight: 400;
font-size: 12px; font-size: 12px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!