Commit 414d8f50 by 胡悦

提交运营数据组件页面等

1 parent 2e753451
......@@ -92,8 +92,8 @@ img {
}
.box {
background: #0b0e31;
// overflow: hidden;
background: #061422;
box-shadow: inset 0 0 10.42px 0 #3d57ff69;
}
.inline {
......@@ -132,9 +132,11 @@ img {
}
}
.text-linear {
background: linear-gradient(top, #b4bdff, #7e8eff);
color: transparent;
-webkit-background-clip: text;
display: inline-block;
color: #5894FF;
background-image:-webkit-linear-gradient(left,#24D8FF,#7787FF);
-webkit-background-clip:text;
-webkit-text-fill-color:transparent;
}
.user-box {
height: 9.51vh;
......
export default {
data() {
return {
areaData: [],
brandData: [],
storeData: []
}
},
methods: {
getClientData() {
console.log(22)
this.api.customer.getEnterpriseDistribution().then(res => {
if (res.code == 0) {
res.data.dataList.forEach(item => {
if (item.queryitem == '区域排名') this.areaData = item.rankDistributions
if (item.queryitem == '品牌分布') this.brandData = item.rankDistributions
if (item.queryitem == '门店类型') this.storeData = item.rankDistributions
this.$bus.$emit('clientData', {
areaData: this.areaData,
brandData: this.brandData,
storeData: this.storeData
})
})
}
})
}
}
}
......@@ -3,11 +3,15 @@
* @Author: huyue
* @Date: 2023-07-04 11:44:11
* @LastEditors: huyue
* @LastEditTime: 2023-07-27 10:33:52
* @LastEditTime: 2023-08-16 16:25:46
*/
import changeMixin from './changeMixin'
import boutiqueMixin from './boutiqueMixin'
import clientMixin from './clientMixin'
import userMixin from './userMixin'
export {
changeMixin,
boutiqueMixin
boutiqueMixin,
clientMixin,
userMixin
}
/*
* @Description:
* @Author: huyue
* @Date: 2023-08-16 16:25:20
* @LastEditors: huyue
* @LastEditTime: 2023-08-16 16:25:25
*/
export default {
data() {
return {
ageData: [],
priceData: [],
buyCarData: [],
mileageData: []
}
},
methods: {
getDistribution() {
this.api.user.getDistribution().then(res => {
if (res.code == 0) {
res.data.dataList.forEach(item => {
if (item.queryitem == '年龄') this.ageData = item.distribution
if (item.queryitem == '车价') this.priceData = item.distribution
if (item.queryitem == '购车年限') this.buyCarData = item.distribution
if (item.queryitem == '里程') this.mileageData = item.distribution
this.$bus.$emit('userData', {
ageData: this.ageData,
priceData: this.priceData,
buyCarData: this.buyCarData,
mileageData: this.mileageData
})
})
}
})
}
}
}
......@@ -3,9 +3,11 @@
* @Author: huyue
* @Date: 2023-07-04 11:46:53
* @LastEditors: huyue
* @LastEditTime: 2023-08-15 18:16:39
* @LastEditTime: 2023-08-16 14:33:14
*/
const DefaultData = {
defaultLineHeight: '17.32',
defaultPieHeight: '13.05',
yearList: ['2023', '2022'],
menuList: [
{
......
......@@ -3,17 +3,24 @@
* @Author: huyue
* @Date: 2023-07-04 13:55:35
* @LastEditors: huyue
* @LastEditTime: 2023-08-15 16:52:55
* @LastEditTime: 2023-08-16 16:57:54
-->
<template>
<div>
运营数据
<div class="content">
<OperationalLeft></OperationalLeft>
<OperationalRight></OperationalRight>
</div>
</template>
<script>
import OperationalLeft from '../../operational/OperationalLeft.vue'
import OperationalRight from '../../operational/OperationalRight.vue'
export default {
name: 'ViewOperational',
components: {
OperationalLeft,
OperationalRight
},
data() {
return {}
},
......@@ -24,5 +31,18 @@ export default {
</script>
<style lang="scss" scoped>
.content {
width: 100%;
height: 100%;
box-sizing: border-box;
position: relative;
padding: 1.95vh 1.67vw;
gap: 0 16px;
display: flex;
justify-content: space-between;
> div {
height: 100%;
}
}
</style>
<!--
* @Description: 运营数据左侧
* @Author: huyue
* @Date: 2023-02-27 11:29:02
* @LastEditors: huyue
* @LastEditTime: 2023-08-17 14:14:50
-->
<template>
<div class="left">
<div class="top box">
<box-title title="企业客户总览"></box-title>
<view-tabs />
<view-surface />
<view-pie-group>
<div slot="1"><Area :height="defaultHeight"></Area></div>
<div slot="2"><Brand :height="defaultHeight"></Brand></div>
<div slot="3"><Store :height="defaultHeight"></Store></div>
</view-pie-group>
</div>
<div class="bottom box">
<box-title title="客户数字化业务"></box-title>
<OverSize></OverSize>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import datas from '../../utils/data'
import Area from './components/Area.vue'
import Store from './components/Store.vue'
import Brand from './components/Brand.vue'
import OverSize from './components/Overview.vue'
import ViewTabs from './components/ViewTabs.vue'
import ViewSurface from './components/ViewSurface.vue'
import ViewPieGroup from './components/ViewPieGroup.vue'
import { clientMixin } from '../../mixins/index'
export default {
name: 'OperationalLeft',
mixins: [clientMixin],
components: {
Area,
Store,
Brand,
OverSize,
ViewTabs,
ViewSurface,
ViewPieGroup
},
data() {
return {
defaultHeight: datas.DefaultData.defaultPieHeight
}
},
created() {
this.getClientData()
},
mounted() {},
methods: {}
}
</script>
<style scoped lang="scss">
.left {
display: flex;
flex-direction: column;
width: 43.89vw;
overflow: hidden;
.top {
height: 52.2vh;
width: 100%;
// padding: 0 16px;
box-sizing: border-box;
}
.bottom {
height: 34.15vh;
margin-top: 1.95vh;
box-sizing: content-box;
}
}
</style>
<!--
* @Description: 运营数据右侧
* @Author: huyue
* @Date: 2022-06-23 10:52:23
* @LastEditors: huyue
* @LastEditTime: 2023-08-16 16:45:18
-->
<template>
<div class="right">
<div class="top">
<box-title title="营销增值服务业务"></box-title>
<Business></Business>
<Project></Project>
</div>
<div class="bottom">
<box-title title="私域用户池总览"></box-title>
<UserTab></UserTab>
<view-chart></view-chart>
<view-line-group>
<div slot="1"><Analyse :height="defaultHeight"></Analyse></div>
<div slot="2"><Brand :height="defaultHeight" :brandList="brandList"></Brand></div>
<div slot="3"><Area :height="defaultHeight" :areaList="areaList"></Area></div>
</view-line-group>
</div>
</div>
</template>
<script type="text/ecmascript-6">
const queryItem = ['Importantvalue', 'Importantdevelopments', 'Importantrecall', 'Importantretention', 'Generalvalue', 'Generaldevelopments', 'Generalrecall', 'Generalretention']
import datas from '../../utils/data'
import Business from './components/Business.vue'
import Project from './components/Project.vue'
import Analyse from './components/Analyse.vue'
import Area from './components/Area.vue'
import Brand from './components/Brand.vue'
import UserTab from './components/UserTab.vue'
import ViewChart from './components/ViewChart.vue'
import ViewLineGroup from './components/ViewLineGroup.vue'
export default {
name: 'OperationalRight',
components: {
Business,
Project,
Analyse,
Brand,
Area,
UserTab,
ViewChart,
ViewLineGroup
},
data() {
return {
defaultHeight: datas.DefaultData.defaultLineHeight,
brandList: [],
areaList: []
}
},
mounted() {
this.getValueDistribution(7)
this.$bus.$on('drawChart', data => {
this.getValueDistribution(data)
})
},
methods: {
getValueDistribution(itemKey) {
const params = {
req: {
queryItem: queryItem[7 - itemKey]
}
}
this.api.user.getValueDistribution(params).then(res => {
if (res.code == 0) {
this.areaList = res.data.dataList[0].rankDistributions
this.brandList = res.data.dataList[1].rankDistributions
}
})
}
}
}
</script>
<style scoped lang="scss">
.right {
width: 51.67vw;
display: flex;
flex-direction: column;
.top {
height: 33.41vh;
// background-image: url('../assets/images/bg-3.png');
background-repeat: no-repeat;
background-size: 100% 100%;
padding: 0 16px;
box-sizing: border-box;
}
.bottom {
height: 55.12vh;
margin-top: auto;
// background-image: url('../assets/images/bg-4.png');
background-repeat: no-repeat;
background-size: 100% 100%;
padding: 0 16px;
box-sizing: border-box;
}
}
</style>
<!--
* @Description:
* @Author: huyue
* @Date: 2023-08-16 16:26:49
* @LastEditors: huyue
* @LastEditTime: 2023-08-16 16:26:54
-->
<template>
<div class="user-box">
<div class="title title-icon">
<span class="icon"></span>
<span>客户年龄分布</span>
</div>
<div class="user-container flex">
<pie-chart ref="pieChart" :id="chart.id" :size="chart.size" :list="ageData" :keys="chart.keys" :radius="chart.radius" height="6.1vh" @pieAction="pieAction"></pie-chart>
<div class="legend-item flex">
<span :style="{ background: descColor }"></span>
{{ selectData && selectData.name }}
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Age',
data() {
return {
chart: {
id: 'user-age',
keys: ['name', 'num'],
radius: ['56%', '85%'],
size: '8px'
},
selectData: '',
descColor: '',
ageData: []
}
},
created() {
this.$bus.$on('userData', data => {
this.ageData = data.ageData
})
},
methods: {
pieAction(data) {
this.descColor = this.$refs.pieChart.descColor
this.selectData = data
}
}
}
</script>
<style lang="scss" scoped>
.user-box {
.title {
font-size: 10px;
}
.legend-item {
width: 4.65vw;
height: 1.83vh;
background: #0d133b;
font-weight: 400;
font-size: 9px;
color: #fff;
span {
width: 5px;
height: 5px;
border-radius: 50%;
margin: 4px;
display: inline-block;
}
}
}
</style>
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-08-16 15:31:56
* @FilePath: \dj-data-view\src\views\user\analyse.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="analyse">
<div class="title title-icon">
<span class="icon"></span>
<div class="title-h3">客户价值分析</div>
<div class="go" @click="goAnalyse">
<!-- <img src="@/assets/images/go.png" /> -->
</div>
</div>
<div class="container">
<bar-chart domId="analyseChart" :revese="true" boxHeight="14.54vh" :analysisList="analysisList"></bar-chart>
</div>
</div>
</template>
<script>
export default {
name: 'Analyse',
data() {
return {
analysisList: {},
isShow: true
}
},
mounted() {
this.getCustomerValueAnalysis()
},
methods: {
getCustomerValueAnalysis() {
this.api.user.getCustomerValueAnalysis().then(res => {
if (res.code == 0) {
this.analysisList = res.data.dataList[0]
}
})
},
goAnalyse() {
this.$Dialog()
}
}
}
</script>
<style scoped lang="scss">
.analyse {
width: 18.06vw;
.container {
margin-top: -1vh;
margin-left: 1.5vw;
}
.icon {
display: inline-block;
transform: rotate(90deg);
}
.title {
display: block;
}
.title-h3 {
width: 10px;
margin: 4px 4px;
// height:10.98vh;
font-size: 10px;
}
.go {
width: 12px;
height: 12px;
margin: 3px;
cursor: pointer;
}
}
</style>
<!--
* @Description: 区域分布
* @Author: huyue
* @Date: 2023-08-16 14:34:58
* @LastEditors: huyue
* @LastEditTime: 2023-08-16 14:35:10
-->
<template>
<div>
<div class="title title-icon">
<span class="icon"></span>
<span>区域分布</span>
</div>
<div class="container flex">
<pie-chart :id="chart.id" :list="areaData" :keys="chart.keys"></pie-chart>
<Legend :list="areaData"></Legend>
</div>
</div>
</template>
<script>
export default {
name: 'Area',
data() {
return {
chart: {
id: 'area',
keys: ['name', 'num']
},
areaData: []
}
},
created() {
this.$bus.$on('clientData', data => {
this.areaData = data.areaData
})
}
}
</script>
<!--
* @Description: 品牌分布
* @Author: huyue
* @Date: 2023-08-16 14:35:24
* @LastEditors: huyue
* @LastEditTime: 2023-08-16 14:38:45
-->
<template>
<div>
<div class="title title-icon">
<span class="icon"></span>
<span>品牌分布</span>
</div>
<div class="container flex">
<pie-chart :id="chart.id" :list="brandData" :keys="chart.keys"></pie-chart>
<Legend :list="brandData"></Legend>
</div>
</div>
</template>
<script>
export default {
name: 'Brand',
data() {
return {
type: 'gender',
chart: {
id: 'brand',
keys: ['name', 'num']
},
brandData: []
}
},
created() {
this.$bus.$on('clientData', data => {
this.brandData = data.brandData
})
}
}
</script>
<!--
* @Description:
* @Author: huyue
* @Date: 2023-08-16 15:12:44
* @LastEditors: huyue
* @LastEditTime: 2023-08-16 15:33:53
-->
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-02-28 14:53:09
* @FilePath: \dj-data-view\src\views\saas\business.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="business-wrap flex">
<div class="business-data">
<business-view :businessNum="businessNum"></business-view>
</div>
<div class="business-category">
<Category :categoryData="categoryData"></Category>
</div>
</div>
</template>
<script>
import BusinessView from './BusinessView'
import Category from './Category'
export default {
components: {
BusinessView,
Category
},
name: 'Business',
data() {
return {
businessNum: {},
categoryData: []
}
},
mounted() {
this.getSaasValueaddedTransformationOverview()
},
methods: {
toFixNum(val) {
return (val * 100).toFixed(2) + '%'
},
getSaasValueaddedTransformationOverview() {
this.api.sass.getSaasValueaddedTransformationOverview().then(res => {
if (res.code == 0) {
this.businessNum = res.data.dataList[0]
this.categoryData = [
{
name: '精品类',
value: this.businessNum.equity
},
{
name: '权益类',
value: this.businessNum.membrane
},
{
name: '续保类',
value: this.businessNum.electronics
}
]
}
})
}
}
}
</script>
<style lang="scss" scoped>
.business-wrap {
height: 13.9vh;
margin-bottom: 0.98vh;
margin-top: 0.98vh;
.business-data {
margin-right: 4px;
// margin-top: 0.98vh;
width: 36.11vw;
height: 100%;
}
.business-category {
width: 13.06vw;
height: 100%;
}
}
</style>
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-08-16 15:13:24
* @FilePath: \dj-data-view\src\views\saas\business.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="business-desc-wrap">
<div class="business-top flex">
<div class="business-border">
<div class="business-title">累计展业门店数</div>
<div class="business-number">{{ numAddSymbol(businessNum.totalNum) }}</div>
</div>
<div class="business-border">
<div class="business-title">当年新增门店数</div>
<div class="business-number">{{ numAddSymbol(businessNum.increnum) }}</div>
</div>
<div class="business-border">
<div class="business-title">客单价</div>
<div class="business-number">{{ toFixNum(businessNum.atv) }}</div>
</div>
</div>
<div class="business-bottom flex">
<div class="business-border">
<div class="business-title">上月GMV</div>
<div class="business-number">{{ numAddSymbol(businessNum.outputValuethismonth) }}</div>
</div>
<div class="business-border">
<div class="business-title">累计GMV</div>
<div class="business-number">{{ numAddSymbol(businessNum.outputValuethisyear) }}</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'BusinessView',
data() {
return {}
},
props: {
businessNum: {
type: Object,
default: () => {}
}
},
methods: {
toFixNum(val) {
return this.numAddSymbol(Math.round(Number(val)))
}
}
}
</script>
<style lang="scss" scoped>
.business-desc-wrap {
.business-top {
justify-content: space-around;
.business-border {
height: 6.71vh;
width: 11.86vw;
padding: 0.4vh 1.11vw;
box-sizing: border-box;
background: #0b0e31;
.business-title {
font-weight: 400;
font-size: 12px;
color: #e8e8e8;
}
.business-number {
font-weight: 700;
font-size: 24px;
line-height: 30px;
color: #6578ff;
}
}
}
.business-bottom {
margin-top: 0.5vh;
height: 6.71vh;
width: 100%;
padding: 0.4vh 1.11vw;
box-sizing: border-box;
background: #0b0e31;
.business-border {
&:first-child {
width: 12vw;
}
}
.business-title {
font-weight: 400;
font-size: 12px;
color: #e8e8e8;
}
.business-number {
font-weight: 700;
font-size: 24px;
line-height: 30px;
color: #6578ff;
}
}
}
</style>
<!--
* @Description:
* @Author: huyue
* @Date: 2023-08-16 16:27:46
* @LastEditors: huyue
* @LastEditTime: 2023-08-16 16:27:51
-->
<template>
<div class="user-box">
<div class="title title-icon">
<span class="icon"></span>
<span>购车年限</span>
</div>
<div class="user-container flex">
<pie-chart @pieAction="pieAction" :size="chart.size" ref="pieChart" :id="chart.id" :list="buyCarData" :keys="chart.keys" :radius="chart.radius" height="6.1vh"></pie-chart>
<div class="legend-item flex">
<span :style="{ background: descColor }"></span>
{{ selectData && selectData.name }}
</div>
</div>
</div>
</template>
<script>
export default {
name: 'BuyCar',
data() {
return {
selectData: '',
descColor: '',
chart: {
id: 'bugCar',
keys: ['name', 'num'],
radius: ['56%', '85%'],
size: '8px'
},
buyCarData: [],
}
},
created() {
this.$bus.$on('userData',data=>{
this.buyCarData = data.buyCarData
})
},
methods: {
pieAction(data) {
this.descColor = this.$refs.pieChart.descColor
this.selectData = data
}
}
}
</script>
<style lang="scss" scoped>
.user-box {
.title {
font-size: 10px;
}
.legend-item {
width: 4.65vw;
height: 1.83vh;
background: #0d133b;
font-weight: 400;
font-size: 9px;
color: #fff;
span {
width: 5px;
height: 5px;
border-radius: 50%;
margin: 4px;
display: inline-block;
}
}
}
</style>
<template>
<div class="category-box">
<div class="title title-icon">
<span class="icon"></span>
<span>品类业务</span>
</div>
<div class="category-container flex">
<pie-chart ref="pieChart" :id="chart.id" :list="categoryData" height="8.29vh"></pie-chart>
<Legend class="category-legend" :list="categoryData"></Legend>
</div>
</div>
</template>
<script>
export default {
name: 'Category',
data() {
return {
chart: {
id: 'category'
}
}
},
props: {
categoryData: {
type: Array,
default: () => []
}
},
methods: {}
}
</script>
<style lang="scss" scoped>
.category-box {
overflow: hidden;
height: 13.9vh;
background: #0b0e31;
.title {
font-size: 10px;
}
.category-container {
height: 11.34vh;
// margin: 1.59vh 1.67vw 1.46vh 1.11vw;
.category-legend{
width:4.2vw;
}
}
}
</style>
<!--
* @Description:
* @Author: huyue
* @Date: 2023-08-16 15:48:46
* @LastEditors: huyue
* @LastEditTime: 2023-08-16 15:51:22
-->
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:43:46
* @LastEditors: huyue
* @LastEditTime: 2023-08-16 15:48:55
* @FilePath: \dj-data-view\src\components\barChart.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="line-box">
<div :id="domId" class="line-chart" :style="{ height: boxHeight }"></div>
</div>
</template>
<script>
import datas from '@/utils/data'
import * as echarts from 'echarts'
import { getLineOptions } from './options'
export default {
name: 'LineChart',
props: {
domId: {
type: String,
default: 'line-chart'
},
revese: {
type: Boolean,
default: false
},
boxHeight: {
type: String,
default: '12.83vh'
},
storeOrBrandTxt: {
type: String,
default: '品牌'
},
privateList: {
type: [Object, Array],
default: () => {}
},
// 0-月表;1-日表
queryType: {
type: Number,
default: 0
},
tooltipFormatterObj: {
type: Array,
default: () => {
return [
{
label: '数量',
attrName: 'num'
},
{
label: '环比',
attrName: 'hrate',
addSymbol: '%'
},
{
label: '同比',
attrName: 'trate',
addSymbol: '%'
}
]
}
}
},
data() {
return {
directionTimer: datas.DefaultData.directionTimer,
delayTimer: datas.DefaultData.delayTimer,
rankFlag: 'top',
lineOptions: [],
rankList: [],
echartsLine: '',
moveAttr: {
// speed: 900,
seriesIndex: 0,
dataIndex: 0
},
timer: null
}
},
watch: {
privateList: {
handler() {
this.lineOptions = getLineOptions(this.privateList)
this.chartBindEvent()
},
deep: true
}
},
mounted() {
this.lineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.lineDom)
},
methods: {
chartBindEvent() {
this[this.domId].setOption(this.lineOptions)
}
}
}
</script>
<style lang="scss" scoped>
.line-box {
height: 100%;
color: #ffffff;
.txt-orange {
color: #eb6001;
}
.line-chart {
width: 100%;
}
}
</style>
<template>
<div class="user-box">
<div class="title title-icon">
<span class="icon"></span>
<span>里程分布</span>
</div>
<div class="user-container flex">
<pie-chart @pieAction="pieAction" :size="chart.size" ref="pieChart" :id="chart.id" :list="mileageData" :keys="chart.keys" :radius="chart.radius" height="6.1vh"></pie-chart>
<div class="legend-item flex">
<span :style="{ background: descColor }"></span>
{{ selectData && selectData.name }}
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Mileage',
data() {
return {
selectData: '',
descColor: '',
chart: {
id: 'mileage',
keys: ['name', 'num'],
radius: ['56%', '85%'],
size: '8px'
},
mileageData: []
}
},
created() {
this.$bus.$on('userData', data => {
this.mileageData = data.mileageData
})
},
methods: {
pieAction(data) {
this.descColor = this.$refs.pieChart.descColor
this.selectData = data
}
}
}
</script>
<style lang="scss" scoped>
.user-box {
.title {
font-size: 10px;
}
.legend-item {
width: 4.65vw;
height: 1.83vh;
background: #0d133b;
font-weight: 400;
font-size: 9px;
color: #fff;
span {
width: 5px;
height: 5px;
border-radius: 50%;
margin: 4px;
display: inline-block;
}
}
}
</style>
<template>
<div class="overview flex">
<div class="store mgr4">
<div class="headline flex-around">
<div :style="{ width: item.width ? item.width : 'auto' }" v-for="(item, index) in titleList" :key="index">{{ item.text }}</div>
</div>
<div class="content">
<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>
<template v-for="(data, ids) in info.dataList">
<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)) }}
</div>
<div v-else :class="['content-number', 'num-' + ids]" :key="ids">
{{ index == 0 ? toFixNum(data(smartClueData)) : index == 1 ? toFixNum(data(merchantData)) : toFixNum(data(smartData)) }}
</div>
</template>
</div>
</div>
</div>
<div class="clew mgr4">
<div class="headline text-center">产生线索/核销数</div>
<div class="clew-content">
<div :class="['clew-content-item', 'bg-' + clewInx]" v-for="(clew, clewInx) in clewList" :key="clewInx">
<template v-for="(clewData, clewIds) in clew">
<div class="clew-line-text flex-between" :key="clewIds">
<div>{{ clewData.title }}</div>
<div class="clew-num">
{{ clewInx == 0 ? numAddSymbol(clewData.value(smartClueData)) : clewInx == 1 ? numAddSymbol(clewData.value(merchantData)) : numAddSymbol(clewData.value(smartData)) }}
</div>
</div>
</template>
</div>
</div>
</div>
<!-- <div class="estimate">
<div class="headline text-center">预估价值/挽回损失</div>
<div class="estimate-content">
<div :class="['estimate-content-item', 'bgEstimate-' + estimateInx]" v-for="(estimate, estimateInx) in estimateList" :key="estimateInx">
<template v-for="(estimateData, estimateIds) in estimate">
<div :class="['estimate-line-text', estimateInx == 2 ? 'flex-column retrieve' : 'text-center']" :key="estimateIds">
<div v-if="estimateInx == 2">挽回损失</div>
<div class="estimate-num">
{{ estimateInx == 0 ? numAddSymbol(estimateData(smartClueData)) : estimateInx == 1 ? numAddSymbol(estimateData(merchantData)) : numAddSymbol(estimateData(smartData)) }}
</div>
</div>
</template>
</div>
</div>
</div> -->
</div>
</template>
<script>
export default {
name: 'Oversize',
data() {
return {
merchantData: '', // 门店会员的权益
smartData: '', // 智慧车管线索订阅
smartClueData: '', // 智慧门店线索订阅
titleList: [
{ text: '订阅门店', width: '2.78vw' },
{ text: '线索订阅门店数(累计)', width: '3.82vw' },
{ text: '活跃使用门店', width: '4.95vw' },
{ text: '留存率', width: '4.29vw' }
],
infoList: [
{
title: '智慧门店线索订阅',
pd: 'pd26',
width: '2.78vw',
dataList: [obj => obj.totalnum, obj => obj.activenum, obj => obj.retention]
},
{
title: '门店会员的权益',
width: '2.78vw',
dataList: [obj => obj.totalnum, obj => obj.activenum, obj => obj.retention]
},
{
title: '智慧车管线索订阅',
width: '2.78vw',
dataList: [obj => obj.totalnum, obj => obj.activenum, obj => obj.retention]
}
],
clewList: [
[
{ title: '到店线索', value: obj => obj.arrival },
{ title: '送修线索', value: obj => obj.repair },
{ title: '续保线索', value: obj => obj.insurance }
],
[
// { title: '自店权益', value: obj => obj.ownshopequity },
{ title: '数字权益', value: obj => obj.digitalequity }
],
[
{ title: '高危点', value: obj => obj.highcriticalpoint },
{ title: '高危报警', value: obj => obj.highriskalarm }
]
],
estimateList: [[obj => obj.totalnum, obj => obj.increnum, obj => obj.activenum], [obj => obj.totalnum], [obj => obj.totalnum]]
}
},
created() {
this.getMerchantData()
this.getSmartData()
this.getSmartClueData()
},
methods: {
toFixNum(val) {
return (val * 100).toFixed(1) + '%'
},
getMerchantData() {
this.api.sass.getMerchantData().then(res => {
if (res.code == 0) {
this.merchantData = res.data.dataList[0]
}
})
},
getSmartData() {
this.api.sass.getSmartData().then(res => {
if (res.code == 0) {
this.smartData = res.data.dataList[0]
}
})
},
getSmartClueData() {
this.api.sass.getSmartClueData().then(res => {
if (res.code == 0) {
this.smartClueData = res.data.dataList[0]
}
})
}
}
}
</script>
<style lang="scss" scoped>
.overview {
// box-sizing: border-box;
padding: 1.22vh 0.83vw;
.store {
width: 30.28vw;
height: 29.27vh;
}
.clew {
width: 11.11vw;
height: 29.27vh;
}
.estimate {
width: 7.64vw;
height: 29.27vh;
}
.headline {
height: 5.61vh;
background: #0A214D;
font-weight: 600;
font-size: 10px;
color: #e8e8e8;
text-align: center;
}
.content {
width: 100%;
height: 23.66vh;
&-item {
padding: 1.59vh 0;
height: 4.88vh;
background: #071735;
margin-bottom: 0.49vh;
justify-content: space-around;
box-sizing: border-box;
&:last-child {
height: 6.34vh;
margin-bottom: 0;
}
}
&-title {
width: 2.78vw;
font-weight: 400;
font-size: 10px;
color: #fff;
text-align: center;
// white-space: pre-wrap;
}
&-number {
font-weight: 700;
font-size: 12px;
color: #ffffff;
text-align: center;
}
.num-0 {
width: 3.82vw;
}
.num-1 {
width: 4.95vw;
}
.num-2 {
width: 4.29vw;
}
.pd26 {
height: 9.51vh;
padding: 3.17vh 0;
}
}
.mgr4 {
margin-right: 0.28vw;
}
.clew-content {
width: 100%;
&-item {
margin-bottom: 0.49vh;
background: #091b39;
.clew-line-text {
padding: 0.85vh 0.56vw 0.73vh 0.56vw;
font-weight: 400;
font-size: 10px;
color: #fff;
border-bottom: 1px solid #0E2949;
box-sizing: border-box;
height: 3.17vh;
.clew-num {
font-weight: 700;
font-size: 12px;
color: #ffffff;
}
&:last-child {
border: none !important;
}
}
}
.bg-1 {
background: #072A23;
.clew-line-text {
border-bottom: 1px solid #0a2d26;
height: 4.88vh;
}
}
.bg-2 {
background: #280935;
.clew-line-text {
border-bottom: 1px solid #390b4b;
height: 3.17vh;
}
}
}
.estimate-content {
width: 100%;
&-item {
margin-bottom: 0.49vh;
background: #0b0e31;
.estimate-line-text {
font-weight: 400;
border-bottom: 1px solid #171f60;
box-sizing: border-box;
height: 3.333vh;
.estimate-num {
font-weight: 700;
font-size: 12px;
color: #ffffff;
}
&:last-child {
border: none !important;
}
}
}
.bgEstimate-1 {
.estimate-line-text {
height: 6.83vh;
border: none;
}
}
.bgEstimate-2 {
.estimate-line-text {
height: 6.83vh;
border: none;
}
}
.retrieve {
font-size: 10px;
color: #ff3540;
.estimate-num {
color: #ff3540 !important;
margin-top: 0.37vh;
}
}
}
}
</style>
<template>
<div class="user-box">
<div class="title title-icon">
<span class="icon"></span>
<span>车价占比</span>
</div>
<div class="user-container flex">
<pie-chart @pieAction="pieAction" ref="pieChart" :size="chart.size" :id="chart.id" :list="priceData" :keys="chart.keys" :radius="chart.radius" height="6.1vh"></pie-chart>
<div class="legend-item flex">
<span :style="{ background: descColor }"></span>
{{ selectData && selectData.name }}
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Price',
data() {
return {
selectData: '',
descColor: '',
chart: {
id: 'user-price',
keys: ['name', 'num'],
radius: ['56%', '85%'],
size: '8px'
},
priceData: []
}
},
created() {
this.$bus.$on('userData', data => {
this.priceData = data.priceData
})
},
methods: {
pieAction(data) {
this.descColor = this.$refs.pieChart.descColor
this.selectData = data
}
}
}
</script>
<style lang="scss" scoped>
.user-box {
.title {
font-size: 10px;
}
.legend-item {
width: 4.65vw;
height: 1.83vh;
background: #0d133b;
font-weight: 400;
font-size: 9px;
color: #fff;
span {
width: 5px;
height: 5px;
border-radius: 50%;
margin: 4px;
display: inline-block;
}
}
}
</style>
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-08-16 15:31:34
* @FilePath: \dj-data-view\src\views\saas\project.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="project-wrap flex">
<div class="project-item flex" v-for="(item, index) in projectList" :key="index">
<div class="project-left">
<div :class="['project-title', { fontSmall: index == 3 }]">{{ item.name }}</div>
<!-- <div class="project-icon"><img src="@/assets/images/arrow.png" alt="" /></div> -->
</div>
<div class="project-right flex">
<div class="project-content-item">
<div class="project-content-desc">展业门店数</div>
<div class="project-content-num">{{ item.totalNum }}</div>
</div>
<div class="project-content-item">
<div class="project-content-desc">当年新增</div>
<div class="project-content-num">{{ item.incrNum }}</div>
</div>
<div class="project-content-item">
<div class="project-content-desc">转化率</div>
<div class="project-content-num">{{ toFixRatio(item.conversionrate) }}</div>
</div>
<div class="project-content-item">
<div class="project-content-desc">客单价</div>
<div class="project-content-num">{{ toFixNum(item.atv) }}</div>
</div>
<div class="project-content-item">
<div class="project-content-desc">GMV</div>
<div class="project-content-num">{{ numAddSymbol(item.outputValue) }}</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Project',
data() {
return {
projectList: []
}
},
mounted() {
this.getBusinessType()
},
methods: {
toFixRatio(val) {
return (val * 100).toFixed(2) + '%'
},
toFixNum(val) {
return this.numAddSymbol(Math.round(val))
},
getBusinessType() {
this.api.sass.getBusinessType().then(res => {
if (res.code == 0) {
this.projectList = res.data.dataList
}
})
}
}
}
</script>
<style lang="scss" scoped>
.project-wrap {
margin-top: 1.5vh;
height: 11.71vh;
flex-wrap: wrap;
justify-content: space-between;
.project-item {
width: 49.6%;
background: #0b0e31;
.project-left {
width: 2.8vw;
padding: 0px 0.4vw;
height: 5.61vh;
background: #2436b7;
text-align: center;
.project-title {
color: #e8e8e8;
font-size: 10px;
line-height: 12px;
margin-top: 0.4vh;
// &.fontSmall {
// font-size: 9px;
// }
}
.project-icon {
width: 1.25vw;
height: 1.22vh;
margin: 0 auto;
}
}
.project-right {
flex: 1;
.project-content-item {
&:first-child {
width: 22%;
}
&:nth-child(2) {
width: 16%;
}
&:nth-child(3) {
width: 16%;
}
&:nth-child(4) {
width: 17%;
}
&:nth-child(5) {
width: 28%;
}
padding-left: 0.5vw;
.project-content-desc {
font-size: 9px;
color: #dddddd;
}
.project-content-num {
font-weight: 700;
font-size: 12px;
color: #ffffff;
}
}
}
}
}
</style>
<template>
<div>
<div class="title title-icon">
<span class="icon"></span>
<span>门店类型</span>
</div>
<div class="container flex">
<pie-chart :id="chart.id" :list="storeData" :keys="chart.keys"></pie-chart>
<Legend :list="storeData" :colors="chart.colors"></Legend>
</div>
</div>
</template>
<script>
export default {
name: 'Store',
data() {
return {
chart: {
id: 'store',
keys: ['name', 'num'],
colors: ['#4FA0FF', '#7CFFB2', '#FDF006', '#EB6001']
},
storeData: []
}
},
created() {
this.$bus.$on('clientData', data => {
this.storeData = data.storeData
})
}
}
</script>
<template>
<div class="user-tab flex">
<template v-for="(tab, index) in userData">
<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-count text-linear">{{ numAddSymbol(dataList[tab.value]) }}</div>
<div class="tab-increase flex-between">
<div class="increase-text">当年新增</div>
<div class="increase-count">{{ numAddSymbol(dataList[tab.key]) }}</div>
</div>
</div>
</template>
</div>
</template>
<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 {
name: 'UserTab',
data() {
return {
dataList: {},
userData: TEXT_VIEW,
selectIndex: 0
}
},
async created() {
await this.getoverview()
this.getTrend('total', '用户数')
},
methods: {
getoverview() {
this.api.user.getoverview().then(res => {
if (res.code == 0) {
this.dataList = res.data.dataList[0]
}
})
},
getTrend(queryItem, name) {
const selectIndex = TEXT_VIEW.findIndex(item => item.text == name)
if (selectIndex > 2) return
this.selectIndex = selectIndex
const params = { req: { queryItem } }
this.api.user.getTrend(params).then(res => {
if (res.code == 0) {
const dataList = res.data.dataList
const obj = {
dataList,
name
}
this.$bus.$emit('drawPrivateChart', obj)
}
})
}
}
}
</script>
<style scoped lang="scss">
.user-tab {
height: 9.02vh;
margin: 1.46vh 0 0.98vh 0;
.tab-item {
cursor: pointer;
width: 9.65vw;
height: 9.02vh;
background: #0b0e31;
margin-right: 0.28vw;
padding: 0.28vh 0;
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 {
font-weight: 400;
font-size: 12px;
color: #e8e8e8;
margin: 0 0.69vw;
height: 2.07vh;
}
.tab-count {
font-weight: 700;
font-size: 22px;
margin: 0 0.69vw;
height: 3.8vh;
line-height: 3.8vh;
}
.tab-increase {
height: 2.44vh;
border-top: 1px solid #171f60;
padding: 0 0.69vw;
}
.increase-text {
font-size: 9px;
color: #dddddd;
}
.increase-count {
font-weight: 700;
font-size: 12px;
color: #ffffff;
}
}
}
</style>
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-26 10:22:41
* @LastEditors: huyue
* @LastEditTime: 2023-08-16 16:28:43
* @FilePath: \dj-data-view\src\components\ViewChart.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="view-chart flex">
<div class="line-chart">
<line-chart domId="sumChart" boxHeight="17.54vh" :privateList="privateList"></line-chart>
</div>
<div class="pie-chart">
<Age></Age>
<Price></Price>
<BuyCar></BuyCar>
<Mileage></Mileage>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import Age from './Age.vue'
import Price from './Price.vue'
import BuyCar from './BuyCar.vue'
import Mileage from './Mileage.vue'
import { userMixin } from '../../../mixins/index'
export default {
name: 'ViewChart',
mixins: [userMixin],
components: {
Age,
Price,
BuyCar,
Mileage
},
data() {
return {
privateList: []
}
},
created() {
this.getDistribution()
},
mounted() {
this.$bus.$on('drawPrivateChart', data => {
this.privateList = data
})
},
methods: {}
}
</script>
<style scoped lang="scss">
.view-chart {
height: 19.51vh;
margin: 0.98vh 0;
.line-chart {
width: 26.25vw;
height: 100%;
background: #0b0e31;
margin-right: 0.56vw;
}
.pie-chart {
width: 23.28vw;
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
}
}
</style>
<!--
* @Description: 一行两个一组
* @Author: huyue
* @Date: 2022-06-23 11:28:03
* @LastEditors: huyue
* @LastEditTime: 2023-08-16 16:44:38
-->
<template>
<div class="line-group">
<template v-for="(i, index) in items">
<div class="box" :key="index" :style="[{ height: height }, { 'margin-bottom': hideMargin ? 0 : '1vh' }]">
<slot :name="i"></slot>
</div>
</template>
</div>
</template>
<script type="text/ecmascript-6">
import datas from '../../../utils/data'
export default {
name: 'ViewLineGroup',
props: {
height: {
type: String,
default: datas.DefaultData.defaultLineHeight + 'vh'
},
hideMargin: Boolean
},
data() {
return {
items: [1, 2, 3]
}
},
mounted() {},
methods: {}
}
</script>
<style scoped lang="scss">
.line-group {
display: flex;
gap: 0 4px;
}
</style>
<template>
<div class="pie-group">
<template v-for="(i, index) in items">
<div class="box" :key="index">
<slot :name="i"></slot>
</div>
</template>
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: 'ViewPieGroup',
props: {},
data() {
return {
items: [1, 2, 3]
}
},
mounted() {
},
methods: {
}
}
</script>
<style scoped lang="scss">
.pie-group {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 0 8px;
.box {
height:13.05vh;
}
}
</style>
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-08-16 17:36:08
* @FilePath: \dj-data-view\src\components\ViewSurface.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="surface">
<line-bar domId="surfaceChart" boxHeight="21.46vh" :dataList="dataList"></line-bar>
</div>
</template>
<script type="text/ecmascript-6">
import LineBar from './LineChart.vue'
export default {
name: 'ViewSurface',
components: {
LineBar
},
data() {
return {
dataList: [
]
}
},
mounted() {
this.getEnterpriseOverviewTrend()
},
methods: {
getEnterpriseOverviewTrend() {
this.api.customer.getEnterpriseOverviewTrend().then(res => {
if (res.code == 0) {
this.dataList = res.data.dataList
}
})
}
}
}
</script>
<style scoped lang="scss">
.surface {
height: 21.46vh;
margin-bottom: 0.98vh;
}
</style>
<!--
* @Description:
* @Author: huyue
* @Date: 2023-08-16 14:44:03
* @LastEditors: huyue
* @LastEditTime: 2023-08-16 17:32:12
-->
<template>
<div class="tabs flex">
<div class="tab" :style="{width: `calc((100% - ${(tabs.length - 1) * 0.56 + 0.83 * 2}vw) / ${tabs.length})`}" v-for="item in tabs" :key="item.key">
<div class="tab-title">{{ item.title }}</div>
<div v-if="item.key != 'retention'" class="tab-text text-linear">{{ numAddSymbol(dataList[item.key]) }}</div>
<div v-else class="tab-text text-linear">{{ toFixNum(dataList[item.key]) }}</div>
</div>
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: 'ViewTabs',
data() {
return {
dataList: {},
tabs: [
{
title: '总门店数',
key: 'totalNum'
},
{
title: '当年新增',
key: 'incrNum'
},
{
title: '订阅留存率',
key: 'retention'
// },
// {
// title: '单店产值',
// key: 'outputValue'
}
]
}
},
created() {
this.getEnterpriseOverview()
},
methods: {
toFixNum(val) {
return (val * 100).toFixed(1) + '%'
},
getEnterpriseOverview() {
this.api.customer.getEnterpriseOverview().then(res => {
if (res.code == 0) {
this.dataList = res.data.dataList[0]
}
})
}
}
}
</script>
<style scoped lang="scss">
.tabs {
padding: 1.22vh 0.83vw 0.98vh;
// padding: 20px 1.67vw;
height: 8.05vh;
width: 100%;
// box-sizing: border-box;
// justify-content: space-between;
.tab {
box-sizing: border-box;
padding: 0.98vh 0.56vw;
background: #061422;
box-shadow: inset 0 0 10.42px 0 #3d57ff69;
margin-right: 0.56vw;
&:last-child {
margin-right: 0;
}
// padding: 2vh 0;
.tab-title {
font-weight: 400;
font-size: 12px;
color: #e8e8e8;
margin-bottom: 0.24vh;
}
.tab-text {
font-weight: 700;
font-size: 24px;
line-height: 30px;
}
}
}
</style>
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:46:24
* @LastEditors: huyue
* @LastEditTime: 2023-08-16 15:51:58
* @FilePath: \dj-data-view\src\components\barOptions.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import utils from '../../../utils/util'
function getBarOptions(obj) {
const { analysisList, rotate } = obj
const num = analysisList.map(item => item.ratio * 100)
console.log(num)
const name = analysisList.map(item => item.name)
var options = {
xAxis: {
type: 'category',
axisLabel: {
color: '#fff',
fontSize: '0.72em'
},
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLine: {
show: false
},
data: name
},
grid: {
left: '6%',
right: '6%',
top: '6%',
bottom: '4%',
// bottom: obj.rotate ? '4%' : '12%',
containLabel: true
},
yAxis: {
type: 'value',
splitLine: {
lineStyle: {
color: '#2F314F'
}
},
axisLabel: {
color: '#fff',
fontSize: '0.75em',
formatter: '{value}%'
},
splitNumber: 4
},
series: [
{
type: 'bar',
symbol: 'circle',
backgroundStyle: {
color: '#6578FF'
},
barWidth: '35%',
data: num
}
]
}
return options
}
function getBarReverseOptions(obj) {
const { analysisList, ValueAnalysis } = obj
// 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 = {
tooltip: {
trigger: 'axis',
showContent: false,
axisPointer: {
type: 'shadow',
shadowStyle: {
color: 'rgba(210, 210, 210, 0.2)'
}
},
borderWidth: 0,
backgroundColor: 'rgba(68,68,68,0.80)',
confine: true,
textStyle: {
color: '#ffffff',
fontSize: 8
}
},
yAxis: {
type: 'category',
axisLabel: {
color: '#ccc',
fontSize: '0.8em'
},
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLine: {
show: false
},
data: value.map(item => item.label)
},
grid: {
left: '8%',
right: '0%',
top: '0%',
bottom: '0%',
containLabel: true
},
xAxis: {
nameGap: 30,
type: 'value',
splitLine: {
show: false
},
axisLabel: {
show: false
},
splitNumber: 4
},
series: [
{
type: 'bar',
symbol: 'circle',
backgroundStyle: {
color: '#6578FF'
},
itemStyle: {
normal: {
label: {
show: true,
position: 'center',
textStyle: {
fontSize: 10,
color: '#fff',
height: 16,
padding: [0, 2, 2, 4],
lineHeight: 16
}
}
}
},
data: value.map(item => item.value)
}
]
}
return options
}
function getLineOptions(obj) {
const { dataList, name } = obj
const statDate = dataList.map(item => item.statDate)
const num = dataList.map(item => item.num)
var options = {
tooltip: {
trigger: 'axis',
axisPointer: {
lineStyle: {
type: 'solid'
}
},
padding: 5,
borderWidth: 0.5,
backgroundColor: 'rgba(35, 45, 152, 1)',
borderRadius: 4,
textStyle: {
color: 'rgba(255,255,255,1)',
fontSize: 10
},
formatter: function (item) {
return `${name}:${item[0].value}`
}
},
xAxis: {
type: 'category',
axisLabel: {
color: '#fff',
fontSize: '0.7em',
rotate: 30
},
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLine: {
show: false
},
data: statDate
},
grid: {
left: '6%',
right: '6%',
top: '14%',
bottom: '3%',
containLabel: true
},
yAxis: {
nameGap: 30,
type: 'value',
splitLine: {
lineStyle: {
color: '#2F314F'
}
},
axisLabel: {
color: '#ccc',
fontSize: '0.7em'
},
splitNumber: 4
},
series: [
{
type: 'line',
symbol: 'circle',
itemStyle: {
color: '#F5AA01'
},
// 平滑曲线
smooth: true,
showSymbol: false,
// 折线背景色
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: 'rgba(254, 84, 0, 0.3)'
},
{
offset: 1,
color: 'rgba(254, 84, 0, 0.01)'
}
]
}
},
data: num
}
]
}
return options
}
function lineAndBarOptions(list) {
const statDate = list.map(item => item.statDate)
const totalNum = list.map(item => item.totalNum)
const increNum = list.map(item => item.increNum)
var options = {
tooltip: {
trigger: 'axis',
axisPointer: {
lineStyle: {
type: 'solid'
}
},
padding: 5,
borderWidth: 1,
backgroundColor: 'rgba(35, 45, 152, 1)',
borderRadius: 4,
textStyle: {
color: 'rgba(255,255,255,1)',
fontSize: 10
},
formatter: function (item) {
const items = list[item[0].dataIndex]
return `当月总门店数:${item[0].value}<br>当月新增:${item[1].value}<br>上月总门店数:${items.yesterdaytotalNum}<br>上月月新增:${items.yesterdayincreNum}`
}
},
xAxis: [
{
type: 'category',
axisLabel: {
color: '#fff',
fontSize: '0.8em'
},
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLine: {
show: false
},
data: statDate
}
],
grid: {
left: '3%',
right: '6%',
top: '6%',
bottom: '0%',
containLabel: true
},
yAxis: [
{
name: 'bar',
nameGap: 30,
type: 'value',
splitLine: {
lineStyle: {
color: '#2F314F'
}
},
axisLabel: {
color: '#FFD241',
fontSize: '0.8em'
},
splitNumber: 4
},
{
name: 'line',
nameGap: 30,
type: 'value',
splitLine: {
lineStyle: {
color: '#2F314F'
}
},
axisLabel: {
color: '#769EFF',
fontSize: '0.8em'
},
splitNumber: 4
}
],
series: [
{
name: 'line',
type: 'line',
symbol: 'circle',
itemStyle: {
color: '#F5AA01'
},
// 平滑曲线
smooth: true,
showSymbol: false,
// 折线背景色
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: 'rgba(254, 84, 0, 0.3)'
},
{
offset: 1,
color: 'rgba(254, 84, 0, 0.01)'
}
]
}
},
data: totalNum
},
{
name: 'bar',
type: 'bar',
symbol: 'circle',
backgroundStyle: {
color: '#6578FF'
},
yAxisIndex: 1,
barWidth: '30%',
data: increNum
}
]
}
return options
}
export { getBarReverseOptions, getBarOptions, lineAndBarOptions, getLineOptions }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!