Commit 0c3ef488 by 前端

Merge branch 'v2.1.0' into 'master'

V2.1.0

See merge request !2
2 parents a80fa60a 43d0c6ec
Showing 101 changed files with 4234 additions and 106 deletions
// 驻店零售权益----获取总产值(周同比&日环比)、推荐量、成交量(周同比&日环比)、转化率、客单价
const getRetailOverview = params => {
return window.$HTTP.get('member/getRetailOverview', params)
}
// 驻店零售权益----获取产值、转换率、客单价门店排名
const getRetailRank = params => {
return window.$HTTP.get('member/getRetailRank', params)
}
// 驻店零售权益----获取产值、订单量趋势
const getRetailTrend = params => {
return window.$HTTP.get('member/getRetailTrend', params)
}
// 驻店零售权益----获取年份和区域
const getRetailYearsArea = params => {
return window.$HTTP.get('member/getRetailYearsArea', params)
}
// 批发销售权益----获取提单门店、提单量占比
const getWholesaleNum = params => {
return window.$HTTP.get('member/getWholesaleNum', params)
}
// 批发销售权益----获取广汇/非广汇提单门店排名
const getWholesaleRank = params => {
return window.$HTTP.get('member/getWholesaleRank', params)
}
// 批发销售权益----获取广汇/非广汇提单门店、提单量趋势
const getWholesaleTrend = params => {
return window.$HTTP.get('member/getWholesaleTrend', params)
}
// 批发销售权益----获取年份
const getWholesaleYears = params => {
return window.$HTTP.get('member/getWholesaleYears', params)
}
export default {
getRetailOverview,
getRetailRank,
getRetailTrend,
getRetailYearsArea,
getWholesaleNum,
getWholesaleRank,
getWholesaleTrend,
getWholesaleYears
}
// 运营版接口
// 企业客户总览接口---获取企业客户总览数据-区域(省份前5)/品牌(品牌前5)/门店类型分布(门店类型:豪华、合资、新能源、自主品牌)
const getEnterpriseDistribution = params => {
return window.$HTTP.get('dj/overview/getEnterpriseDistribution', params)
}
// 企业客户总览接口---获取企业客户总览数据(包括:总客户数、新增客户数、留存率、单店产值)
const getEnterpriseOverview = params => {
return window.$HTTP.get('dj/overview/getEnterpriseOverview', params)
}
// 企业客户总览接口---获取企业客户数据近12个月趋势图(包括:总客户数、新增客户数)
const getEnterpriseOverviewTrend = params => {
return window.$HTTP.get('dj/overview/getEnterpriseOverviewTrend', params)
}
// 企业客户总览接口---获取路演版本三项新的指标
const getRoadShowNewIndicators = params => {
return window.$HTTP.get('dj/overview/getRoadShowNewIndicators', params)
}
// 客户数字化业务---门店会员的权益(线索订阅门店数(累计)、线索订阅门店数(当年新增)、活跃使用门店、留存率、自店权益、数字权益、自店权益_产值、数字权益_产值)
const getMerchantMemberEquity = params => {
return window.$HTTP.get('dj/digit/getMerchantMemberEquity', params)
}
// 客户数字化业务---智慧车管线索订阅(线索订阅门店数(累计)、线索订阅门店数(当年新增)、活跃使用门店、留存率、高危点、高危报警、挽回损失)
const getSmartCarManageClueSubscription = params => {
return window.$HTTP.get('dj/digit/getSmartCarManageClueSubscription', params)
}
// 客户数字化业务---智慧门店线索订阅(线索订阅门店数(累计)、线索订阅门店数(当年新增)、活跃使用门店、留存率、到店线索、送修线索、续保线索、到店线索_产值、送修线索_产值、续保线索_产值)
const getSmartMerchantClueSubscription = params => {
return window.$HTTP.get('dj/digit/getSmartMerchantClueSubscription', params)
}
// 私域用户池总览接口---客户价值分析
const getCustomerValueAnalysis = params => {
return window.$HTTP.get('dj/private/getCustomerValueAnalysis', params)
}
// 私域用户池总览接口---客户年龄分布/车价占比/购车年限分布/里程分布
const getDistribution = params => {
return window.$HTTP.get('dj/private/getDistribution', params)
}
// 私域用户池总览接口---用户数、企微客户数、企微群数、小程序、个微客户数 趋势图
const getTrend = params => {
return window.$HTTP.get('dj/private/getTrend', params, false, true)
}
// 私域用户池总览接口---客户价值分析--品牌分布/区域分布
const getValueDistribution = params => {
return window.$HTTP.get('dj/private/getValueDistribution', params, false, true)
}
// 私域用户池总览接口---用户数:总数/当年新增,企微客户数:总数/当年新增,企微群数:总数/当年新增,小程序:总数/当年新增,个微客户数:总数/当年新增
const getoverview = params => {
return window.$HTTP.get('dj/private/getoverview', params)
}
// 营销增值服务业务接口---1.0新车权益销售、1.1新车精品升级、1.2新车线上转化、1.3存量用户众筹(累计展业门店数、当年新增、转化率、客单价、产值)
const getBusinessType = params => {
return window.$HTTP.get('dj/saasAdded/getBusinessType', params)
}
// 营销增值服务业务接口---累计展业门店数、当年新增门店数、产值_当月、产值_当年、客单价、业务品类_权益类、业务品类_膜类、业务品类_电子类
const getSaasValueaddedTransformationOverview = params => {
return window.$HTTP.get('dj/saasAdded/getSaasValueaddedTransformationOverview', params)
}
export default {
getEnterpriseDistribution,
getEnterpriseOverview,
getEnterpriseOverviewTrend,
getRoadShowNewIndicators,
getMerchantMemberEquity,
getSmartCarManageClueSubscription,
getSmartMerchantClueSubscription,
getCustomerValueAnalysis,
getDistribution,
getTrend,
getValueDistribution,
getoverview,
getBusinessType,
getSaasValueaddedTransformationOverview
}
......@@ -10,13 +10,13 @@ class Request {
constructor(_request_) {
this.DOMAIN = _request_ ? _request_.baseURL : this.DOMAIN
}
get(url, params, returnAll) {
return this.request('GET', url, params, returnAll)
get(url, params, returnAll, typeFlag) {
return this.request('GET', url, params, returnAll, typeFlag)
}
post(url, params, returnAll) {
return this.request('POST', url, params, returnAll)
}
request(method, url, params, returnAll) {
request(method, url, params, returnAll, typeFlag) {
var requestConfig = {
headers: {
// 'Content-Type': method == 'GET' ? 'application/json' : 'application/x-www-form-urlencoded; charset=UTF-8'
......@@ -24,8 +24,21 @@ class Request {
},
method
}
if (method === 'GET') {
var paramsArray = []
var paramsArray = []
if (method === 'GET' && typeFlag) {
// var paramsArray = []
params && Object.keys(params.req).forEach(key => paramsArray.push('req.' + key + '=' + params.req[key]))
if (url.search(/\?/) === -1) {
url += '?' + paramsArray.join('&')
} else {
url += '&' + paramsArray.join('&')
}
}
if (method === 'GET' && !typeFlag) {
// var paramsArray = []
params && Object.keys(params).forEach(key => paramsArray.push(key + '=' + params[key]))
if (url.search(/\?/) === -1) {
url += '?' + paramsArray.join('&')
......
......@@ -92,8 +92,8 @@ img {
}
.box {
background: #0b0e31;
// overflow: hidden;
background: #061422;
box-shadow: inset 0 0 10.42px 0 #3d57ff69;
}
.inline {
......@@ -108,7 +108,14 @@ img {
user-select: none;
box-sizing: border-box;
height: 2.07vh;
margin-top: 4px;
// margin-top: 4px;
.title-bg {
display: inline-block;
height: 1.71vh;
padding-left: 0.83vw;
transform: rotate(-360deg);
background-image: linear-gradient(90deg, #003F57 0%, #111056 54%, #07173500 100%);
}
}
.container {
......@@ -132,14 +139,14 @@ 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;
width:11.18vw;
margin-right: 0.28vw;
margin-bottom: 0.28vw;
background: #0b0e31;
height: 9.63vh;
width:13.26vw;
background: #071735;
}

10.3 KB | W: | H:

7.21 KB | W: | H:

src/assets/images/logo.png
src/assets/images/logo.png
src/assets/images/logo.png
src/assets/images/logo.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -18,7 +18,6 @@ export default {
methods: {
selectDate(e) {
console.log(e, 'eeeee')
this.$emit('customerSelect', e)
}
}
......
......@@ -64,7 +64,6 @@ export default {
this.chart = echarts.init(document.getElementById('demo'))
this.setOptions(this.chartData)
this.chart.on('click', function (params) {
console.log(params.name)
})
},
setOptions(data = []) {
......
......@@ -2,14 +2,14 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-07-20 15:27:03
* @LastEditTime: 2023-08-24 15:52:39
* @FilePath: \dj-data-view\src\components\ViewTitle.vue
* @Description: 页面头部组件
-->
<template>
<div class="content flex">
<div class="logo user-select">
<img style="height: 2.89vh" src="@/assets/images/logo.png" alt="logo" />
<img style="height: 48px" src="@/assets/images/logo.png" alt="logo" />
</div>
<div class="tab">
<div class="tab-item first-tab active" @click.stop="openSelect">
......@@ -68,7 +68,6 @@ export default {
},
watch: {
'dataList'(val) {
console.log(val)
this.merchantList = utils.deepClone(this.dataList)
}
},
......@@ -100,7 +99,6 @@ export default {
},
// 监听子菜单变化
selectVal(val) {
console.log(val)
this.firstTab = val
this.$bus.$emit('selectVal', val)
this.openSelect()
......@@ -164,7 +162,7 @@ export default {
}
.time {
text-align: right;
font-size: 16px;
font-size: 14px;
color: #ffffff;
.top {
justify-content: flex-end;
......
......@@ -36,7 +36,7 @@ export default {
},
radius: {
type: Array,
default: () => ['60%', '89%']
default: () => ['50%', '80%']
},
colors: {
type: Array,
......@@ -138,7 +138,7 @@ export default {
fontSize: this.size,
fontWeight: 'bold',
color: '#fff',
formatter: (params) => {
formatter: params => {
const _dataIndex = params.dataIndex
// 价格
const _purchaseamount = utils.numAddSymbol(_this.list[_dataIndex].purchaseamount)
......@@ -156,7 +156,7 @@ export default {
* total -- 名称+总数组合
* none -- 不显示内容
* 默认显示名称
*/
*/
switch (_this.formatter) {
case 'price':
_html = `{a|¥${_purchaseamount}}\n{b|均价¥ ${_avarage}}`
......@@ -167,6 +167,9 @@ export default {
case 'none':
_html = ''
break
case 'rate':
_html = utils.toPercent(params.percent)
break
default:
_html = utils.legend(params.name)
}
......
......@@ -177,8 +177,6 @@ export default {
this.mTime = setInterval(this.pieActive, 15000)
})
this.echartsPie.on('mouseover', data => {
console.log(222);
console.log(data);
this.mainValue = data.data.value
this.numDesc = data.data.name
this.descColor = data.color
......
......@@ -91,7 +91,7 @@ export default {
}
.text {
font-weight: 400;
font-size: 14px;
font-size: 12px;
color: #ffffff;
margin-left: 1.11vw;
cursor: default;
......@@ -116,7 +116,7 @@ export default {
}
&-middle {
font-weight: 400;
font-size: 14px;
font-size: 12px;
color: #C0C0C0;
overflow: hidden;
white-space: nowrap;
......@@ -124,7 +124,7 @@ export default {
}
&-right {
font-weight: 400;
font-size: 14px;
font-size: 12px;
color: #95acd9;
text-align: right;
}
......
......@@ -72,6 +72,11 @@ export default {
empty: '暂无数据'
}
},
watch: {
'defaultValue'(val) {
this.value = val
}
},
mounted() {
const { valueName, isObject, dataList, defaultValue } = this
const isDefaultObject = (defaultValue instanceof Object)
......
......@@ -39,6 +39,7 @@ export default {
<style lang="scss" scoped>
.tab-box {
height: 4.44vh;
display: flex;
justify-content: space-between;
padding: 0.2vh 0.2vw;
box-sizing: border-box;
......@@ -48,14 +49,14 @@ export default {
height: 3.56vh;
line-height: 3.56vh;
font-weight: 400;
font-size: 16px;
font-size: 14px;
color: #ffffffbf;
padding: 0 1.11vw;
cursor: pointer;
}
.tab-item-active {
font-weight: 500;
font-size: 16px;
font-size: 14px;
color: #ffffff;
background-image: linear-gradient(270deg, #6578ff 0%, #079ff1 100%);
}
......
......@@ -80,6 +80,7 @@ export default {
height: 4vh;
padding: 0 0.56vw;
box-sizing: border-box;
font-size: 14px;
background-image: linear-gradient(270deg, #6578FF 0%, #079FF1 100%);
margin-right: 0.56vw;
color: #FFFFFF;
......
......@@ -2,28 +2,44 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-07-20 15:25:22
* @LastEditTime: 2023-08-24 15:52:22
* @FilePath: \dj-data-view\src\components\ViewTitle.vue
* @Description: 页面头部组件
-->
<template>
<div class="content flex">
<div class="logo user-select">
<img style="height: 2.89vh" src="@/assets/images/logo.png" alt="logo" />
<img style="height: 48px" src="@/assets/images/logo.png" alt="logo" />
</div>
<div class="tab">
<div v-for="(item, index) in menuList" :key="index">
<template v-if="item.tabName == 'business' && item.isShow">
<div class="tab-item first-tab" :class="currentMenu == item.tabName ? 'active' : ''" @click.prevent="jump(item.tabName)">
<div class="tab-title">{{ firstTab.label }}</div>
<img class="arrow-down" @click.stop="openSelect" src="@/assets/images/title-arrow.png" alt="">
<SelectBox :isShow="isShow" @clickOutside="clickOutside" :dataList="item.children" :boxWidth="'16.94vw'" isObject @selectVal="selectVal"></SelectBox>
</div>
</template>
<template v-else>
<div v-show="item.isShow" class="tab-item other-tab" :class="currentMenu == item.tabName ? 'active' : ''" @click="jump(item.tabName)">
<div class="tab-name">{{item.label}}</div>
</div>
</template>
</div>
</div>
<!-- <div class="tab">
<div class="tab-item first-tab" :class="currentMenu == 'home' ? 'active' : ''" @click.prevent="jump('home')">
<div class="tab-title">{{ firstTab.label }}</div>
<img class="arrow-down" @click.stop="openSelect" src="@/assets/images/title-arrow.png" alt="">
<SelectBox :isShow="isShow" @clickOutside="clickOutside" :dataList="dataList" :boxWidth="'16.94vw'" isObject @selectVal="selectVal"></SelectBox>
</div>
</div> -->
<!-- <div class="tab-item other-tab" :class="currentMenu == 'operational' ? 'active' : ''" @click="jump('operational')">
<div class="tab-name">运营数据</div>
</div>
<div class="tab-item other-tab" :class="currentMenu == 'interior' ? 'active' : ''" @click="jump('interior')">
<div class="tab-name">内部数据</div>
</div> -->
</div>
<!-- </div> -->
<!-- <div class="view-title user-select">嘀加智慧门店运营看板</div> -->
<div class="time">
<div class="top flex">
......@@ -41,7 +57,8 @@ export default {
data() {
return {
isShow: false,
dataList: datas.DefaultData.businessList,
// dataList: datas.DefaultData.businessList,
menuList: datas.DefaultData.menuList,
weekList: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
firstTab: '', // 存储第一个tab下的子菜单对象
now: new Date().format('yyyy-MM-dd hh:mm:ss'),
......@@ -49,9 +66,26 @@ export default {
currentMenu: 'home' // 标记当前是哪个tab菜单
}
},
created() {
const { menuList, $roleAuth, $role } = this
const permissions = $roleAuth[$role]
menuList.forEach(menu => {
if (menu.children) {
menu.children = menu.children.filter(child => {
child.isShow = permissions[child.value]
return child.isShow
})
menu.isShow = menu.children.length > 0
} else {
menu.isShow = permissions[menu.value]
}
})
this.menuList = menuList.filter(item => item.isShow)
this.firstTab = this.menuList[0].children ? this.menuList[0].children[0] : this.menuList[0]
this.jump(this.firstTab.tabName)
},
mounted() {
this.timer()
this.firstTab = this.dataList[0]
},
methods: {
timer() {
......@@ -72,7 +106,7 @@ export default {
jump(val) {
let _val = val
this.currentMenu = val
if (val === 'home') _val = this.firstTab.value
if (val === 'business') _val = this.firstTab.value
this.$bus.$emit('selectVal', _val)
this.isShow = false
},
......@@ -99,7 +133,7 @@ export default {
}
.time {
text-align: right;
font-size: 16px;
font-size: 14px;
color: #ffffff;
.top {
justify-content: flex-end;
......
......@@ -4,17 +4,17 @@
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: huyue
* @LastEditTime: 2023-07-18 14:32:42
* @LastEditTime: 2023-08-15 16:22:12
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
let config = require('./conf.js')
let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) {
if (isEnv) {
let { request } = config
Object.assign(request, { timeout })
return Promise.resolve(config)
}
// if (isEnv) {
// let { request } = config
// Object.assign(request, { timeout })
// return Promise.resolve(config)
// }
/**测试mock */ return window.fetch('https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=glsk-data-view').then(res => res.json())
// return window.fetch('https://oss-config.test.glsx.com.cn/mock/62cbf569f5137cf37678b828/data-view/config', {}).then(res => res.json())
}
......
......@@ -4,15 +4,15 @@
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: huyue
* @LastEditTime: 2023-07-13 15:06:27
* @LastEditTime: 2023-08-15 17:15:24
*/
// 兼容 IE
// https://github.com/zloirock/core-js/blob/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md#babelpolyfill
// import 'core-js/stable'
// import 'regenerator-runtime/runtime'
import Vue from 'vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import App from './App.vue'
import router from './router'
import store from './store'
......@@ -23,7 +23,7 @@ import '@/assets/css/index.scss'
import './utils/util'
import 'components'
import * as echarts from 'echarts'
// import dialog from './plugins/dialog'
// import dialog from './plugins/dialog'
import Bus from '../src/bus' // 这是我的路径,正确引用你们的路径
Vue.prototype.$bus = Bus
Vue.prototype.$echarts = echarts
......@@ -44,6 +44,7 @@ Vue.config.productionTip = false
// Vue.use(dialog)
const isMock = ['prod', 'production'].includes(process.env.NODE_ENV)
fetchConfig(!isMock).then(res => {
Vue.prototype.$roleAuth = res.roleAuth
// 从配置服务器获取动态配置
// 设置 js中可以访问 $cdn
Vue.use(cfg)
......
export default {
data() {
return {
areaData: [],
brandData: [],
storeData: []
}
},
methods: {
getClientData() {
this.api.operational.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.operational.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,8 +3,8 @@
* @version:
* @Author: limin
* @Date: 2021-06-09 10:59:50
* @LastEditors: limin
* @LastEditTime: 2021-06-29 14:51:39
* @LastEditors: huyue
* @LastEditTime: 2023-08-15 17:00:16
*/
import Vue from 'vue'
import Router from 'vue-router'
......@@ -32,6 +32,7 @@ function createRouter() {
}
// http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-main/
router.beforeEach((to, from, next) => {
Vue.prototype.$role = to.query.role
next()
})
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
......
......@@ -69,7 +69,6 @@ const getPages = _ => {
if (e.meta && e.meta.keepAlive) keepAlives.push(name)
return route
})
console.log(router)
return [router]
}
export const keeps = keepAlives
......
......@@ -3,26 +3,47 @@
* @Author: huyue
* @Date: 2023-07-04 11:46:53
* @LastEditors: huyue
* @LastEditTime: 2023-08-01 17:44:47
* @LastEditTime: 2023-08-16 14:33:14
*/
const DefaultData = {
defaultLineHeight: '17.32',
defaultPieHeight: '13.05',
yearList: ['2023', '2022'],
businessList: [
menuList: [
{
label: '业务数据 | 1.0太阳膜采购',
value: '1'
tabName: 'business',
children: [
{
label: '业务数据 | 1.0太阳膜采购',
tabName: 'business',
value: 'm_1.0'
},
{
label: '业务数据 | 1.1精品升级',
tabName: 'business',
value: 'm_1.1'
},
{
label: '业务数据 | 1.3售后众筹',
tabName: 'business',
value: 'm_1.3'
},
{
label: '业务数据 | 2.1会员权益',
tabName: 'business',
value: 'm_2.1'
}
]
},
{
label: '业务数据 | 1.1精品升级',
value: '2'
label: '运营数据',
tabName: 'operational',
value: 'operational'
},
{
label: '业务数据 | 1.3售后众筹',
value: '3'
// },
// {
// label: '业务数据 | 2.1会员权益',
// value: '4'
label: '内部数据',
tabName: 'interior',
value: 'interior'
}
],
directionTimer: 3000,
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-07 14:01:42
* @LastEditors: huyue
* @LastEditTime: 2023-08-02 17:06:11
* @LastEditTime: 2023-08-28 14:09:19
-->
<template>
<div>
......
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-07-18 17:27:55
* @LastEditTime: 2023-08-23 16:22:16
* @FilePath: \dj-data-view\src\components\ViewTitle.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......
......@@ -27,7 +27,6 @@ export default {
computed: {
tabName() {
let sname
console.log(this.$store.state.app)
switch (this.activeName) {
case 0:
sname = this.$store.state.app.boutique.channel.value == 'cl' ? 'BarTrends' : 'BusinessTrends'
......@@ -170,7 +169,6 @@ export default {
value: ''
}]
const _data = await this.api.boutique.getYears({})
console.log(_data)
const _yearList = _data.data.dataList[0].year
_yearList.forEach(item => {
this.yearList.push({
......
......@@ -39,7 +39,6 @@ export default {
mounted() { },
methods: {
changeTab(data) {
console.log(data);
this.activeName = data
}
}
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-20 10:19:06
* @LastEditors: huyue
* @LastEditTime: 2023-07-26 16:26:03
* @LastEditTime: 2023-08-23 16:15:25
-->
<template>
<div>
......@@ -50,7 +50,16 @@ export default {
type: 'map',
map: 'china',
data: data,
label: {
normal: {
color: '#ffffff'
},
emphasis: {
color: '#ffffff'
}
},
itemStyle: {
color: '#ffffff',
// areaColor: '#061422',
areaColor: {
image: mapBg,
......@@ -58,13 +67,8 @@ export default {
},
borderColor: '#65C6F8',
shadowBlur: 10,
shadowColor: 'rgba(61, 87, 255, 0.41)'
},
emphasis: {
label: {
color: '#fff'
},
itemStyle: {
shadowColor: 'rgba(61, 87, 255, 0.41)',
emphasis: {
areaColor: {
type: 'linear',
x: 0,
......@@ -78,14 +82,18 @@ export default {
}],
global: false // 缺省为 false
}
},
select: {
}
},
select: {
itemStyle: {
// color: this.clickcolor, // 设置地图点击后的颜色
color: '#ffffff', // 设置地图点击后的颜色
areaColor: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
x2: 1,
y2: 0,
colorStops: [{
offset: 0, color: '#079FF1' // 0% 处的颜色
}, {
......@@ -94,7 +102,7 @@ export default {
global: false // 缺省为 false
}
}
}
},
}]
}
return option
......@@ -102,6 +110,74 @@ export default {
drawMap(data) {
this.mapOption = this.getOptions(data)
this.myChart.setOption(this.mapOption)
this.selectEvent()
this.myChart.dispatchAction({
type: 'showTip',
seriesIndex: 0,
dataIndex: 0
})
// 取消高亮指定的数据图形
this.myChart.dispatchAction({
type: 'downplay',
seriesIndex: 0,
dataIndex: 0
})
this.myChart.dispatchAction({
type: 'highlight',
seriesIndex: 0,
dataIndex: 0
})
},
selectEvent() {
const myChart = this.myChart
this.myChart.on('click', function(e) {
myChart.dispatchAction({
type: 'downplay',
seriesIndex: 0
})
myChart.dispatchAction({
type: 'highlight',
seriesIndex: 0,
dataIndex: e.dataIndex
})
myChart.dispatchAction({
type: 'showTip',
seriesIndex: 1,
dataIndex: e.dataIndex
})
})
this.myChart.on('mousemove', function(e) {
myChart.dispatchAction({
type: 'downplay',
seriesIndex: 0
})
myChart.dispatchAction({
type: 'highlight',
seriesIndex: 0,
dataIndex: e.dataIndex
})
myChart.dispatchAction({
type: 'showTip',
seriesIndex: 1,
dataIndex: e.dataIndex
})
})
this.myChart.on('mouseout', function (e) {
myChart.dispatchAction({
type: 'downplay',
seriesIndex: 0
})
myChart.dispatchAction({
type: 'highlight',
seriesIndex: 0,
dataIndex: e.dataIndex
})
myChart.dispatchAction({
type: 'showTip',
seriesIndex: 1,
dataIndex: e.dataIndex
})
})
},
chartBindEvent() {
// resize
......
......@@ -108,6 +108,7 @@ export default {
position: relative;
}
.legend {
font-size: 14px;
display: flex;
position: absolute;
right: 1.39vw;
......
......@@ -120,6 +120,7 @@ export default {
position: relative;
}
.legend {
font-size: 14px;
display: flex;
position: absolute;
right: 1.39vw;
......
<template>
<div>
<el-table :data="tableData" style="width: 100%" :header-cell-style="{ color: '#ffffff', fontSize: '14px', height: '4.44vh', background: '#244888' }" :row-class-name="tableRowClassName">
<el-table-column label="序号" width="60">
<el-table :data="tableData" style="width: 100%" :header-cell-style="{ color: '#ffffff', fontSize: '12px', height: '4.44vh', background: '#244888' }" :row-class-name="tableRowClassName">
<el-table-column label="序号" width="80">
<template slot-scope="scope">
{{ curPageSize * (currentPage - 1) + (scope.$index + 1) }}
</template>
......@@ -106,7 +106,7 @@ export default {
<style lang="scss">
.el-table {
font-weight: 400;
font-size: 14px;
font-size: 12px;
text-align: center;
thead {
height: 4.44vh;
......
<template>
<div class="overview-box">
<box-title title="数据总览"></box-title>
<Tab class="tab-main-box" :list="tabList" :width="19.17" :itemWidth="10" @changeTab="changeTab"></Tab>
<div class="overview-bottom-box">
<SelectModel></SelectModel>
<TrendDetail></TrendDetail>
</div>
</div>
</template>
<script>
import SelectModel from './components/SelectModel.vue'
import TrendDetail from './components/TrendDetail.vue'
export default {
name: 'EquityBottom',
components: {
SelectModel,
TrendDetail
},
data() {
return {
tabList: ['广汇数据总览', '非广汇数据总览']
}
},
mounted() {},
methods: {
changeTab(val) {
this.$bus.$emit('whosaleTabChange', val === 0 ? 'gh' : 'gl')
}
}
}
</script>
<style lang="scss" scoped>
.overview-box {
// width: 100%;
height: 59.78vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
.tab-main-box {
margin-top: 1.78vh;
/deep/.tab-item-box {
margin: 0 auto;
}
}
.overview-bottom-box {
padding: 1.11vw;
}
}
</style>
<template>
<div class="equity-left">
<StatisticsBox :list="equitylList" class="bottom-class">
<template #recommNum>
<img class="img-statictic" src="../../assets/images/bar-graph.png" alt="" />
</template>
<template #perCusTrans>
<img class="img-statictic" src="../../assets/images/curve.png" alt="" />
</template>
<template #conversionRate="{ conversionRate }">
<el-progress class="conversion-progress" :percentage="Number(conversionRate.value)" :stroke-width="18"></el-progress>
</template>
</StatisticsBox>
<ProductionTrend ref="productionTrend" class="bottom-class" :dataList="dataList"></ProductionTrend>
<OrderTrends ref="orderTrends" :dataList="dataList"></OrderTrends>
</div>
</template>
<script>
import ProductionTrend from './components/ProductionTrend.vue'
import OrderTrends from './components/OrderTrends.vue'
export default {
name: 'EquityLeft',
components: {
ProductionTrend,
OrderTrends
},
data() {
return {
equitylList: [
{
name: '总产值',
valueName: 'outputvalue',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'outputvalueTB',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'outputvalueHB',
ratioRightValue: '0'
},
{
name: '推荐量',
valueName: 'recommNum',
value: '0',
bottomType: 'slot'
},
{
name: '成交量',
valueName: 'payOrderNum',
value: '0',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'payOrderNumTB',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'payOrderNumHB',
ratioRightValue: '0'
},
{
name: '转化率',
valueName: 'conversionRate',
value: '20',
unit: '%',
unitType: 'right',
bottomType: 'slot'
},
{
name: '客单价',
valueName: 'perCusTrans',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'slot'
}
],
dataList: [],
area: '',
month: ''
}
},
watch: {
area: {
handler(newVal) {
this.getRetailOverview()
this.getRetailTrend()
}
},
month: {
handler(newVal) {
this.getRetailOverview()
this.getRetailTrend()
}
}
},
created() {
this.$bus.$on('selectAreaChange', val => {
if (val === '全部') val = ''
this.area = val
})
this.$bus.$on('selectMonthChange', val => {
if (val === '全部') val = ''
this.month = val
})
this.getRetailOverview()
this.getRetailTrend()
},
mounted() {},
methods: {
async getRetailOverview() {
const params = {
province: this.area,
statMonth: this.month
}
const _result = await this.api.equity.getRetailOverview(params)
const _data = _result.data.dataList[0]
this.equitylList.forEach(item => {
item.value = _data[item.valueName]
item.bottomValue = _data[item.bottemName]
item.ratioLeftValue = _data[item.ratioLeftValueName]
item.ratioRightValue = _data[item.ratioRightValueName]
})
},
async getRetailTrend() {
const params = {
province: this.area,
statMonth: this.month
}
const _result = await this.api.equity.getRetailTrend(params)
this.dataList = _result.data.dataList
this.$nextTick(() => {
this.$refs.productionTrend.$refs.productionTrendsRef.drawBarLine()
this.$refs.orderTrends.$refs.orderTrendsRef.drawBarLine()
})
}
}
}
</script>
<style lang="scss" scoped>
.equity-left {
width: 64.17vw;
.bottom-class {
margin-bottom: 1.78vh;
// /deep/.statistics-item {
// margin-right: 0.5vw;
// }
// /deep/.statistics-item:last-child {
// margin-right: 0;
// }
/deep/.ratio {
font-size: 10px;
}
}
.el-progress--line {
width: 10.2vw;
}
/deep/.el-progress__text {
display: none;
}
/deep/.el-progress-bar {
padding-right: 0;
}
/deep/.el-progress-bar__outer {
border-radius: 0;
}
/deep/.el-progress-bar__inner {
border-radius: 0;
}
.conversion-progress {
/deep/.el-progress-bar__outer {
background-image: linear-gradient(-89deg, #11627a 0%, #282f7a 100%);
}
/deep/.el-progress-bar__inner {
background-image: linear-gradient(270deg, #22d8ff 0%, #5c56ff 100%);
}
}
}
</style>
<template>
<div>
<!-- 第一个盒子 -->
<div class="rank-box">
<box-title title="门店产值排名"></box-title>
<div class="rank-content" v-if="storeOutputList.length">
<Ranking :id="'storeOutput'" :rankingsList="storeOutputList" :rankingDataObj="rankingDataObj"></Ranking>
</div>
<div v-else class="empty">
<Empty></Empty>
</div>
</div>
<!-- 第二个盒子 -->
<div class="rank-box">
<box-title title="门店转化率排行"></box-title>
<div class="rank-content" v-if="storePercentList.length">
<Ranking :id="'storePercent'" :rankingsList="storePercentList" :rankingDataObj="rankPercentObj"></Ranking>
</div>
<div v-else class="empty">
<Empty></Empty>
</div>
</div>
<!-- 第三个盒子 -->
<div class="rank-box">
<box-title title="门店客单价排行"></box-title>
<div class="rank-content" v-if="storePriceList.length">
<Ranking :id="'storePrice'" :rankingsList="storePriceList" :rankingDataObj="rankingDataObj"></Ranking>
</div>
<div v-else class="empty">
<Empty></Empty>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'EquityRight',
data() {
return {
// 门店产值排名数据
storeOutputList: [],
// 门店转化率排名数据
storePercentList: [],
// 门店客单价排名数据
storePriceList: [],
// rankingDataObj
rankingDataObj: [
{
name: 'merchantname',
width: '17vw'
},
{
name: 'num',
width: '7vw',
type: 'number',
preunit: '¥'
}
],
rankPercentObj: [
{
name: 'merchantname',
width: '18vw',
action: true
},
{
name: 'num',
width: '3vw',
type: 'decimal'
}
],
area: '',
month: ''
}
},
watch: {
area: {
handler(newVal) {
this.getRetailRank()
}
},
month: {
handler(newVal) {
this.getRetailRank()
}
}
},
created() {
this.$bus.$on('selectAreaChange', val => {
if (val === '全部') val = ''
this.area = val
})
this.$bus.$on('selectMonthChange', val => {
if (val === '全部') val = ''
this.month = val
})
this.getRetailRank()
},
mounted() {},
methods: {
async getRetailRank() {
const params = {
province: this.area,
statMonth: this.month
}
const _result = await this.api.equity.getRetailRank(params)
const { outputvalueRank, perCusTransRank, conversionRateRank } = _result.data.dataList[0]
this.storeOutputList = outputvalueRank.slice(0,5)
this.storePercentList = conversionRateRank.slice(0,5)
this.storePriceList = perCusTransRank.slice(0,5)
}
}
}
</script>
<style lang="scss" scoped>
.rank-box {
width: 31.39vw;
height: 26.78vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
&:nth-child(-n + 2) {
margin-bottom: 1.78vh;
}
.rank-content {
padding: 1.67vh 1.39vw;
}
.empty {
height: 24.45vh;
display: flex;
align-items: center;
}
}
</style>
<template>
<div class="pie-box">
<TotalBill :totalBillData="numProportion" :totalNum="totalNum"></TotalBill>
<TotalMerchant :totalMerchantData="merProportion" :totalMerchant="totalMerchant"></TotalMerchant>
</div>
</template>
<script>
import TotalBill from './components/TotalBill.vue'
import TotalMerchant from './components/TotalMerchant.vue'
export default {
name: 'EquityTop',
components: {
TotalBill,
TotalMerchant
},
data() {
return {
totalNum: 0,
totalMerchant: 0,
merProportion: [],
numProportion: [],
month: ''
}
},
created() {
this.$bus.$on('selectMonthChange', val => {
if (val === '全部') val = ''
this.month = val
this.getWholesaleNum()
})
this.getWholesaleNum()
},
mounted() {},
methods: {
async getWholesaleNum() {
const params = {
statMonth: this.month
}
const _result = await this.api.equity.getWholesaleNum(params)
const { merProportion, numProportion, totalNum, totalMerchant } = _result.data.dataList[0]
this.merProportion = merProportion
this.numProportion = numProportion
this.totalNum = totalNum
this.totalMerchant = totalMerchant
}
}
}
</script>
<style lang="scss" scoped>
.pie-box {
display: flex;
justify-content: space-between;
}
</style>
<template>
<div class="content">
<EquityLeft></EquityLeft>
<EquityRight></EquityRight>
</div>
</template>
<script>
import EquityLeft from './EquityLeft.vue'
import EquityRight from './EquityRight.vue'
export default {
name: 'Resident',
components: {
EquityLeft,
EquityRight
},
data() {
return {}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.content {
display: flex;
justify-content: space-between;
// padding: 1.78vh 0 0;
// margin-top: 1.78vh;
}
</style>
<template>
<div>
<EquityTop></EquityTop>
<EquityBottom class="top-class"></EquityBottom>
</div>
</template>
<script>
import EquityTop from './EquityTop.vue'
import EquityBottom from './EquityBottom.vue'
export default {
name: 'Wholesale',
components: {
EquityTop,
EquityBottom
},
data() {
return {}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.top-class {
margin-top: 1.78vh;
}
</style>
<!--
* @Description: 柱状图
* @Author: huyue
* @Date: 2023-07-07 14:01:42
* @LastEditors: huyue
* @LastEditTime: 2023-08-03 16:43:09
-->
<template>
<div>
<div :id="domId" style="width: 100%" :style="{ height }"></div>
</div>
</template>
<script type="text/ecmascript-6">
import * as echarts from 'echarts'
import BarOptions from './BarOptions'
import utils from '../../../utils/util'
export default {
name: 'BarChart',
props: {
domId: {
type: String,
default: ''
},
dataList: {
type: Array,
default: () => []
},
tooltipFormatterObj: {
type: Object,
default: () => {
return {
label: '数量',
attrName: 'num'
}
}
},
colorList: {
type: Array
},
height: {
type: String,
default: '15vh'
},
barWidth: String,
isMultiple: {
type: Boolean,
default: false
},
formatYAxis: Boolean
},
data() {
return {
barOptions: []
}
},
created() {
this.barOptions = BarOptions({ tooltipFormatter: this.tooltipFormatter }, this.colorList, this.isMultiple, this.barWidth, this.formatYAxis)
},
mounted() {
this.barDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.barDom)
this.chartBindEvent()
},
methods: {
tooltipFormatter(obj) {
var _currentItem = this.dataList[obj[0].dataIndex]
var _html = ''
var _txt = ''
_txt += `<div style="display:flex;"><div style="color: #c9c9c9">${this.tooltipFormatterObj.label}:</div><div style="color: #fff;">${utils.numAddSymbol(_currentItem[this.tooltipFormatterObj.attrName])}${this.tooltipFormatterObj.addSymbol || ''}</div></div>`
_html += `<div style="backdrop-filter: blur(4px);background-color: #051526;border: 2px solid;border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;padding: 10px;">
${_txt}
</div>`
return _html
},
drawBar() {
this.barOptions.xAxis.data = this.dataList.map(item => item.statDate)
this.barOptions.series[0].data = this.dataList.map(item => item[this.tooltipFormatterObj.attrName])
this[this.domId].setOption(this.barOptions)
},
chartBindEvent() {
// resize
window.addEventListener('resize', () => {
this[this.domId].resize()
})
}
}
}
</script>
<template>
<div :id="domId" style="width: 100%" :style="{ height }"></div>
</template>
<script type="text/ecmascript-6">
import utils from '../../../utils/util'
import * as echarts from 'echarts'
import getBarLineOptions from './BarLineOptions'
export default {
name: 'BarLineCharts',
props: {
height: {
type: String
},
dataList: {
type: Array,
default: () => []
},
domId: {
type: String,
default: 'bar-line'
},
tooltipFormatterObj: {
type: Array,
default: () => {}
},
valName: {
type: String,
default: 'val'
}
},
data() {
return {}
},
mounted() {
this.barLineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.barLineDom)
this.chartBindEvent()
},
methods: {
tooltipFormatter(obj) {
var _currentItem = this.dataList[obj[0].dataIndex]
var _html = ''
var _txt = `<div><div style="color: #FFFFFF">${_currentItem.statMonth}</div><div style="display:flex;align-items:center"><div style="width: 4px;height: 4px;background: #FFC200;border-radius: 4px;margin-right: 4px;"></div><div style="color: #fff;">${utils.numAddSymbol(_currentItem[this.valName])}</div></div></div>`
_html += `<div style="backdrop-filter: blur(4px);background-color: #051526;border: 2px solid;border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;padding: 10px;">
${_txt}
</div>`
return _html
},
drawBarLine() {
this.barLineOptions = getBarLineOptions({ tooltipFormatter: this.tooltipFormatter, seriesData: this.dataList })
this.barLineOptions.xAxis.data = this.dataList.map(item => item.statMonth)
this.barLineOptions.series[0].data = this.dataList.map(item => item[this.valName])
this[this.domId].setOption(this.barLineOptions)
},
chartBindEvent() {
// resize
window.addEventListener('resize', () => {
this[this.domId].resize()
})
}
}
}
</script>
<style lang="scss" scoped></style>
import * as echarts from 'echarts'
// import utils from '../../utils/util'
function getBarLineOptions(obj) {
const { tooltipFormatter, seriesData } = obj
var barLineOption = {
tooltip: {
trigger: 'axis',
borderWidth: 0,
padding: 0,
backgroundColor: '#051526',
formatter: tooltipFormatter || ''
},
xAxis: {
data: []
},
yAxis: [
{
// 纵轴标尺固定
type: 'value',
scale: true,
// max: 200,
min: 0,
splitNumber: 4,
boundaryGap: [0.1, 0.1],
splitLine: {
lineStyle: {
color: '#ffffff1a'
}
}
}
],
grid: {
left: '3%',
right: '2%',
top: '25%',
bottom: '6%',
containLabel: true
},
series: [
{
name: 'line',
type: 'line',
data: [],
showSymbol: true, // 是否默认展示圆点
symbol: 'circle', // 设定为实心点
symbolSize: 6, // 设定实心点的大小
itemStyle: {
normal: {
color: '#FFC200', // 改变折线点的颜色
lineStyle: {
color: '#FFC200' // 改变折线颜色
}
}
}
}
]
}
return barLineOption
}
export default getBarLineOptions
/*
* @Description: 柱状图配置
* @Author: huyue
* @Date: 2023-07-07 14:04:52
* @LastEditors: huyue
* @LastEditTime: 2023-08-03 16:42:12
*/
import * as echarts from 'echarts'
function getBarOptions(obj, colorList, isMultiple, barwidth, formatYAxis) {
const barWidth = barwidth || '14'
const multiple = isMultiple || false
const { tooltipFormatter } = obj
var barLineOption = {
tooltip: {
trigger: 'axis',
borderWidth: 0,
padding: 0,
formatter: tooltipFormatter || '',
confine: true
},
xAxis: {
data: []
},
barWidth: barWidth,
yAxis: {
name: '',
type: 'value',
// min: 0,
// max: 100,
splitLine: {
lineStyle: {
color: '#1d2a38'
}
},
splitNumber: 4,
axisLabel: {
// 这种做法就是在y轴的数据的值旁边拼接单位,貌似也挺方便的
formatter: function(value) {
if (formatYAxis) {
return `${value / 10000}万`
} else {
return value
}
}
}
},
grid: {
left: '0',
right: '4%',
top: '20%',
bottom: '4%',
containLabel: true
},
series: [
{
name: 'bar',
type: 'bar',
barWidth: '50%',
// barGap: '10%',
data: [],
label: {
show: false
},
itemStyle: {
barBorderRadius: [2, 2, 0, 0], // 柱体圆角
color: function(params) {
var colorItem = []
if (multiple) {
colorItem = params.dataIndex % 2 === 0 ? colorList[0] : colorList[1]
}
return new echarts.graphic.LinearGradient(
0, 0, 0, 1, [{ // 代表渐变色从正上方开始
offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色
color: multiple ? colorItem[0] : colorList[0]
}, // 柱图渐变色
{
offset: 0.5, // 指100%处的颜色
color: multiple ? colorItem[1] : colorList[1]
},
{
offset: 1, // 指100%处的颜色
color: multiple ? colorItem[2] : colorList[2]
}]
)
}
}
}
]
}
return barLineOption
}
export default getBarOptions
<template>
<div class="trend-box">
<box-title title="订单趋势"></box-title>
<BarLineCharts ref="orderTrendsRef" height="29vh" domId="orderTrends" :dataList.sync="dataList" valName="orderNum"></BarLineCharts>
</div>
</template>
<script>
import BarLineCharts from './BarLineCharts.vue'
export default {
name: 'OrderTrends',
components: {
BarLineCharts
},
props: {
dataList: {
type: Array,
default: () => []
}
},
data() {
return {
}
},
mounted() {
},
methods: {}
}
</script>
<style lang="scss" scoped>
.trend-box {
width: 64.17vw;
height: 34.22vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
}
</style>
<template>
<div class="trend-box">
<box-title title="产值趋势"></box-title>
<BarLineCharts ref="productionTrendsRef" height="29vh" domId="productionTrend" :dataList.sync="dataList" valName="outputvalue"></BarLineCharts>
</div>
</template>
<script>
import BarLineCharts from './BarLineCharts.vue'
export default {
name: 'ProductionTrend',
components: {
BarLineCharts
},
props: {
dataList: {
type: Array,
default: () => []
}
},
data() {
return {
}
},
created() {
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.trend-box {
width: 64.17vw;
height: 34.22vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
}
</style>
<template>
<div class="right-tab-box">
<div class="flex area-box" v-show="tabActive == 0">
<span class="area-text">区域:</span>
<div class="area-plugin">
<div class="area" @click.stop="switchArea">
{{ area || '全部' }}
<img class="arrow-down" src="@/assets/images/arrow-down.png" alt="" />
</div>
<SelectBox :isShow="isShowArea" :defaultValue.sync="defaultArea" @clickOutside="clickOutsideArea" :dataList.sync="areaDataList" :boxWidth="'8.61vw'" @selectVal="selectAreaVal"></SelectBox>
</div>
</div>
<div class="flex">
<span class="month-text">时间:</span>
<div class="month-plugin">
<div class="month" @click.stop="switchMonth">
{{ month || '全部' }}
<img class="arrow-down" src="@/assets/images/arrow-down.png" alt="" />
</div>
<SelectBox
:isShow="isShowMonth"
:defaultValue.sync="defaultMonth"
@clickOutside="clickOutsideMonth"
:dataList.sync="monthDataList"
:boxWidth="'8.61vw'"
@selectVal="selectMonthVal"
></SelectBox>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'RightTab',
props: {
tabActive: Number
},
data() {
return {
area: '',
isShowArea: false,
defaultArea: '',
areaDataList: [],
month: '',
isShowMonth: false,
defaultMonth: '',
monthDataList: []
}
},
watch: {
tabActive: {
handler(val) {
if (val === 0) {
this.area = ''
this.month = ''
this.defaultArea = ''
this.defaultMonth = ''
this.getRetailYearsArea()
} else {
this.area = ''
this.month = ''
this.defaultArea = ''
this.defaultMonth = ''
this.getWholesaleYears()
}
}
}
},
created() {
this.getRetailYearsArea()
},
mounted() {},
methods: {
// 获取零售权益年份和区域
async getRetailYearsArea() {
const _result = await this.api.equity.getRetailYearsArea({})
const { areas, years } = _result.data.dataList[0]
console.log(areas, years)
areas.unshift('全部')
years.unshift('全部')
this.defaultArea = areas[0]
this.defaultMonth = years[0]
this.areaDataList = areas
this.monthDataList = years
},
// 批发销售权益----获取年份
async getWholesaleYears() {
const _result = await this.api.equity.getWholesaleYears({})
const { years } = _result.data.dataList[0]
this.defaultMonth = years[0]
years.unshift('全部')
this.monthDataList = years
},
switchArea() {
this.isShowArea = !this.isShowArea
},
clickOutsideArea() {
this.isShowArea = false
},
selectAreaVal(val) {
this.area = val
this.$bus.$emit('selectAreaChange', val)
this.switchArea()
},
switchMonth() {
this.isShowMonth = !this.isShowMonth
},
clickOutsideMonth() {
this.isShowMonth = false
},
selectMonthVal(val) {
this.month = val
this.$bus.$emit('selectMonthChange', val)
this.switchMonth()
}
}
}
</script>
<style lang="scss" scoped>
.right-tab-box {
display: flex;
.flex {
display: flex;
}
.area-box {
margin-right: 3.06vw;
}
.month-text,
.area-text {
font-weight: 400;
font-size: 14px;
color: #c9c9c9;
}
.month-plugin,
.area-plugin {
position: relative;
}
.month,
.area {
font-size: 14px;
display: flex;
align-items: center;
justify-content: space-between;
width: 8.61vw;
height: 4vh;
padding: 0 0.56vw;
box-sizing: border-box;
background-image: linear-gradient(270deg, #6578ff 0%, #079ff1 100%);
color: #ffffff;
.arrow-down {
width: 0.69vw;
height: 0.67vh;
}
}
}
</style>
<template>
<div class="select-model-box">
<div class="type-plugin">
<div class="trend-type-box" @click.stop="switchType">
<div class="text">{{ selectType || selectList[0].name }}</div>
<div class="trangle-icon"></div>
</div>
<SelectBox
:isShow="isShow"
isObject
:defaultValue.sync="selectList[0]"
@clickOutside="clickOutside"
:dataList.sync="selectList"
:boxWidth="'9.1vw'"
@selectVal="selectVal"
:labelName="'name'"
:valueName="'name'"
></SelectBox>
</div>
<DateTab :dateList="dateList" @changeDate="changeDate"></DateTab>
<Calendar ref="calender" v-show="showCalendar" @customerSelect="customerSelect"></Calendar>
</div>
</template>
<script>
export default {
name: 'SelectModel',
data() {
return {
dateList: ['本月', '全年', '自定义'],
showCalendar: false,
isShow: false,
selectList: [
{
name: '提单量趋势',
val: 'num'
},
{
name: '提单门店量趋势',
val: 'merNum'
}
],
selectType: ''
}
},
mounted() {},
methods: {
changeDate(val) {
if (val === 2) {
this.showCalendar = true
return
} else {
this.$refs.calender.dateValue = ''
this.showCalendar = false
}
const date = val === 0 ? 'thisMonth' : 'thisYear'
this.$bus.$emit('dateTabChange', date)
},
switchType() {
this.isShow = !this.isShow
},
clickOutside() {
this.isShow = false
},
selectVal(val) {
this.selectType = val.name
this.$bus.$emit('equityTypeChange', val.val)
this.switchType()
},
// 自定义日期选择
customerSelect(val) {
this.$bus.$emit('dateCustomerChange', val)
}
}
}
</script>
<style lang="scss" scoped>
.select-model-box {
display: flex;
.type-plugin {
position: relative;
}
.trend-type-box {
display: flex;
justify-content: space-between;
width: 9.1vw;
height: 3.56vh;
line-height: 3.56vh;
padding: 0 0.83vw;
box-sizing: border-box;
margin-right: 2.08vw;
background-image: linear-gradient(269deg, #5663ff00 10%, #6578ffd4 49%, #079ff1 100%);
.text {
font-weight: 500;
font-size: 14px;
color: #ffffff;
}
.trangle-icon {
width: 0px;
height: 0px;
border: 4px solid transparent;
border-top: 4px solid #fff;
margin-top: 10%;
}
}
}
</style>
<template>
<div>
<div class="bill-total-box">
<box-title title="提单总数"></box-title>
<div v-if="totalBillData.length" class="content-box">
<div class="text-box">
<div class="text">提单总数</div>
<div class="number-text">{{ numAddSymbol(totalNum) }}</div>
</div>
<RightViewContent :chart="totalBillChart" :listData="totalBillData" :legentList="totalBillLegend" :legendColors="totalBillChart.colors"></RightViewContent>
</div>
<div v-else class="empty">
<Empty></Empty>
</div>
</div>
</div>
</template>
<script>
import RightViewContent from '../../solar/RightViewContent.vue'
export default {
name: 'TotalBill',
components: {
RightViewContent
},
props: {
totalBillData: {
type: Array,
default: () => []
},
totalNum: Number
},
data() {
return {
totalBillChart: {
id: 'totalBill',
keys: ['name', 'num'],
height: '15vh',
colors: ['#FF7D5E', '#69EE9F'],
formatter: 'none'
},
totalBillLegend: [
{
name: 'name',
width: '7vw'
},
{
name: 'num',
type: 'number',
width: '5vw'
}
]
}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.bill-total-box {
width: 47.78vw;
height: 21.78vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
.content-box {
display: flex;
padding: 3.03vh 0 0 2.92vw;
.text-box {
margin-right: 3.75vw;
.text {
font-weight: 500;
font-size: 14px;
color: #ffffff;
}
.number-text {
font-weight: 600;
font-size: 20px;
color: #5894ff;
background-image: -webkit-linear-gradient(left, #24d8ff, #7787ff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
}
.empty {
height: 18.45vh;
display: flex;
align-items: center;
}
}
</style>
<template>
<div>
<div class="bill-total-box">
<box-title title="提单门店数"></box-title>
<div v-if="totalMerchantData.length" class="content-box">
<div class="text-box">
<div class="text">提单门店数</div>
<div class="number-text">{{ numAddSymbol(totalMerchant) }}</div>
</div>
<RightViewContent
:chart="totalMerchantChart"
:listData="totalMerchantData"
:legentList="totalMerchantLegend"
:legendColors="totalMerchantChart.colors"
></RightViewContent>
</div>
<div v-else class="empty">
<Empty></Empty>
</div>
</div>
</div>
</template>
<script>
import RightViewContent from '../../solar/RightViewContent.vue'
export default {
name: 'TotalMerchant',
components: {
RightViewContent
},
props: {
totalMerchantData: {
type: Array,
default: () => []
},
totalMerchant: Number
},
data() {
return {
totalMerchantChart: {
id: 'totalMerchant',
keys: ['name', 'num'],
height: '15.34vh',
colors: ['#EBA3FF', '#726BFF'],
formatter: 'none'
},
totalMerchantLegend: [
{
name: 'name',
width: '7vw'
},
{
name: 'num',
type: 'number',
width: '5vw'
}
]
}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.bill-total-box {
width: 47.78vw;
height: 21.78vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
.content-box {
display: flex;
padding: 3.03vh 0 0 2.92vw;
.text-box {
margin-right: 3.75vw;
.text {
font-weight: 500;
font-size: 14px;
color: #ffffff;
}
.number-text {
font-weight: 600;
font-size: 20px;
color: #5894ff;
background-image: -webkit-linear-gradient(left, #24d8ff, #7787ff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
}
.empty {
height: 18.45vh;
display: flex;
align-items: center;
}
}
</style>
<template>
<div class="detail-box">
<TrendLeft></TrendLeft>
<TrendRight></TrendRight>
</div>
</template>
<script>
import TrendLeft from './TrendLeft'
import TrendRight from './TrendRight'
export default {
name: 'TrendDetail',
components: {
TrendLeft,
TrendRight
},
data() {
return {}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.detail-box {
display: flex;
height: 41vh;
}
</style>
<template>
<div class="trend-left">
<BarChart
v-if="!isEmpty"
ref="orderTrendChartRef"
class="bar-chart"
isMultiple
:barWidth="'24'"
domId="orderTrendChart"
height="37.22vh"
:dataList.sync="dataList"
:colorList="colorList"
:tooltipFormatterObj="tooltips.amountTooltip"
></BarChart>
<div v-else class="empty">
<Empty></Empty>
</div>
</div>
</template>
<script>
import BarChart from './BarChart.vue'
export default {
name: 'TrendLeft',
components: {
BarChart
},
data() {
return {
isEmpty: false,
dataList: [],
tooltips: {
amountTooltip: {
label: '单量',
// num --> 提单量;merNum --> 提单门店
attrName: 'num'
}
},
colorList: [
['#2AD191', '#00A89E', '#061422'],
['#22D8FF', '#223FA9', '#061422']
],
queryType: 'gh',
queryItem: 'thisYear',
endDate: '',
startDate: ''
}
},
watch: {
queryType: {
handler() {
this.getWholesaleTrend()
}
},
queryItem: {
handler() {
this.getWholesaleTrend()
}
}
},
created() {
this.$bus.$on('whosaleTabChange', data => {
this.queryType = data
})
this.$bus.$on('dateTabChange', data => {
this.queryItem = data
this.startDate = ''
this.endDate = ''
})
this.$bus.$on('dateCustomerChange', data => {
this.startDate = data[0]
this.endDate = data[1]
this.queryItem = 'selfDefined'
this.getWholesaleTrend()
})
this.$bus.$on('equityTypeChange', data => {
this.tooltips.amountTooltip.attrName = data
this.$nextTick(() => {
this.$refs.orderTrendChartRef.drawBar()
})
})
this.getWholesaleTrend()
},
mounted() {},
methods: {
async getWholesaleTrend() {
const params = {
queryItem: this.queryItem,
queryType: this.queryType,
startDate: this.startDate,
endDate: this.endDate
}
const _result = await this.api.equity.getWholesaleTrend(params)
this.dataList = _result.data.dataList
this.$nextTick(() => {
this.$refs.orderTrendChartRef.drawBar()
})
}
}
}
</script>
<style lang="scss" scoped>
.trend-left {
width: 60.84vw;
padding-right: 5.9vw;
border-right: 1px solid #1e3372;
}
</style>
<template>
<div class="trend-right">
<div class="title">{{ title }}</div>
<div class="rank-content" v-if="merchantRankList.length">
<Ranking class="rank-box" :rankingsList="merchantRankList" :rankingDataObj="rankingDataObj"></Ranking>
</div>
<div v-else class="empty">
<Empty></Empty>
</div>
</div>
</template>
<script>
export default {
name: 'TrendRight',
data() {
return {
title: '广汇门店提单量排名',
merchantRankList: [],
rankingDataObj: [
{
name: 'merchantName',
width: '14vw'
},
{
name: 'num',
width: '5vw',
type: 'number'
}
],
queryType: 'gh',
queryItem: 'thisYear',
endDate: '',
startDate: ''
}
},
watch: {
queryType: {
handler() {
this.getWholesaleRank()
}
},
queryItem: {
handler() {
this.getWholesaleRank()
}
}
},
created() {
this.$bus.$on('whosaleTabChange', data => {
this.queryType = data
this.title = data === 'gh' ? '广汇门店提单量排名' : '非广汇门店提单量排名'
})
this.$bus.$on('dateTabChange', data => {
this.queryItem = data
this.startDate = ''
this.endDate = ''
})
this.$bus.$on('dateCustomerChange', data => {
this.startDate = data[0]
this.endDate = data[1]
this.queryItem = 'selfDefined'
})
this.$bus.$on('equityTypeChange', data => {
this.tooltips.amountTooltip.attrName = data
})
this.getWholesaleRank()
},
mounted() {},
methods: {
async getWholesaleRank() {
const params = {
queryItem: this.queryItem,
queryType: this.queryType,
startDate: this.startDate,
endDate: this.endDate
}
const _result = await this.api.equity.getWholesaleRank(params)
this.merchantRankList = _result.data.dataList
}
}
}
</script>
<style lang="scss" scoped>
.trend-right {
margin-left: 4.1vw;
.title {
width: 7.5vw;
height: 2.22vh;
font-weight: 500;
font-size: 14px;
color: #ffffff;
line-height: 2.22vh;
overflow: visible;
white-space: nowrap;
margin-top: 0;
margin-bottom: 2.67vh;
background-image: linear-gradient(269deg, #5663ff00 10%, #6578ffd4 49%, #079ff1 100%);
padding-left: 0.83vw;
}
}
</style>
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-04 13:55:35
* @LastEditors: huyue
* @LastEditTime: 2023-08-01 18:03:26
* @LastEditTime: 2023-08-22 16:02:45
-->
<template>
<div class="layout">
......@@ -32,16 +32,16 @@ export default {
tabName() {
let sname
switch (this.activeName) {
case '1':
case 'm_1.0':
sname = 'ViewSolar'
break
case '2':
case 'm_1.1':
sname = 'ViewBoutique'
break
case '3':
case 'm_1.3':
sname = 'ViewCrowdfunding'
break
case '4':
case 'm_2.1':
sname = 'ViewEquity'
break
case 'operational':
......@@ -50,19 +50,21 @@ export default {
case 'interior':
sname = 'ViewInterior'
break
case 'home':
case 'business':
sname = 'ViewSolar'
break
// default:
// sname = 'ViewSolar'
}
return sname
}
},
data() {
return {
activeName: '1'
activeName: ''
}
},
mounted() {
created() {
this.$bus.$on('selectVal', data => {
this.activeName = data
})
......
......@@ -6,23 +6,58 @@
* @LastEditTime: 2023-07-06 10:09:59
-->
<template>
<div class="layout">
阿斯顿发射点
<div class="view-content">
<TopTab class="top-tab" :tabList="tabList" @tabChange="changeTab">
<template #right>
<RightTab :tabActive="tabActive"></RightTab>
</template>
</TopTab>
<template v-if="tabActive == 0">
<Resident></Resident>
</template>
<template v-else>
<Wholesale></Wholesale>
</template>
</div>
</template>
<script>
import Resident from '../../equity/Resident.vue'
import Wholesale from '../../equity/Wholesale.vue'
import RightTab from '../../equity/components/RightTab.vue'
export default {
name: 'ViewEquity',
components: {
Resident,
Wholesale,
RightTab
},
data() {
return {}
return {
tabList: ['驻店零售权益', '批发销售权益'],
tabActive: 0
}
},
mounted() { },
mounted() {},
methods: {
changeTab(index) {
this.tabActive = index
}
}
}
</script>
<style lang="scss" scoped>
.view-content {
width: 100%;
height: 100%;
box-sizing: border-box;
position: relative;
padding: 1.78vh 1.67vw;
gap: 0 16px;
.top-tab {
margin-bottom: 1.78vh;
height: 5vh;
}
}
</style>
......@@ -3,11 +3,12 @@
* @Author: huyue
* @Date: 2023-07-04 13:55:35
* @LastEditors: huyue
* @LastEditTime: 2023-07-11 16:18:46
* @LastEditTime: 2023-08-22 17:31:50
-->
<template>
<div>
内部数据
<Charts></Charts>
</div>
</template>
......
......@@ -3,17 +3,24 @@
* @Author: huyue
* @Date: 2023-07-04 13:55:35
* @LastEditors: huyue
* @LastEditTime: 2023-07-11 16:18:22
* @LastEditTime: 2023-08-16 16:57:54
-->
<template>
<div>
<ViewDate></ViewDate>
<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: 41.67vw;
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-17 18:02:44
-->
<template>
<div class="right">
<div class="top box">
<box-title title="营销增值服务业务"></box-title>
<Business></Business>
<Project></Project>
</div>
<div class="bottom">
<box-title title="私域用户池总览"></box-title>
<div class="bottom-content">
<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>
</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/AreaSaas.vue'
import Brand from './components/BrandSaas.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.operational.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: 53.89vw;
display: flex;
flex-direction: column;
.top {
height: 32.68vh;
box-sizing: border-box;
}
.bottom {
height: 53.66vh;
margin-top: 1.95vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
box-sizing: border-box;
&-content {
padding: 0 0.83vw;
}
}
}
</style>
<!--
* @Description:
* @Author: huyue
* @Date: 2023-08-16 16:26:49
* @LastEditors: huyue
* @LastEditTime: 2023-08-24 15:48:36
-->
<template>
<div class="user-box">
<div class="title-icon">
<span class="title-bg">客户年龄分布</span>
</div>
<div class="user-container flex">
<pie-chart ref="pieChart" :id="chart.id" :colors="chart.colors" :formatter="chart.formatter" :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%'],
colors: ['#FF6E76', '#16E193', '#FDF006', '#EB6001', '#34AFFF', '#BF98FF', '#726BFF'],
size: '8px',
formatter: 'rate'
},
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-icon {
font-weight: 500;
font-size: 10px;
color: #ffffff;
.title-bg {
background-image: linear-gradient(90deg, #003f57 0%, #111056 54%, #071735 100%);
padding-left: 0.83vw;
}
}
.legend-item {
width: 4.65vw;
height: 1.83vh;
background: #0A214D;
font-weight: 400;
font-size: 7px;
color: #fff;
margin-right: 2vw;
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-22 16:49:20
* @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">
<BarChart domId="analyseChart" :revese="true" boxHeight="14.54vh" :analysisList="analysisList" :colorList="colorList"></BarChart>
</div>
<MyDialog :isShow="dialogShow" @closeDialog="closeDialog"></MyDialog>
</div>
</template>
<script>
import BarChart from './BarChart.vue'
import MyDialog from './Dialog.vue'
export default {
name: 'Analyse',
components: {
BarChart,
MyDialog
},
data() {
return {
analysisList: {},
isShow: true,
colorList: ['#5C56FF', '#22D8FF'],
dialogShow: false
}
},
mounted() {
this.getCustomerValueAnalysis()
},
methods: {
getCustomerValueAnalysis() {
this.api.operational.getCustomerValueAnalysis().then(res => {
if (res.code === '0') {
this.analysisList = res.data.dataList[0]
}
})
},
goAnalyse() {
this.dialogShow = true
},
closeDialog() {
this.dialogShow = false
}
}
}
</script>
<style scoped lang="scss">
.analyse {
width: 19.44vw;
.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;
background-image: linear-gradient(180deg, #003F57 0%, #111056 54%, #071735 100%);
}
.go {
width: 0.65vw;
height: 0.65vw;
margin: 3px 0;
cursor: pointer;
}
}
</style>
<!--
* @Description: 区域分布
* @Author: huyue
* @Date: 2023-08-16 14:34:58
* @LastEditors: huyue
* @LastEditTime: 2023-08-22 10:53:20
-->
<template>
<div>
<div class="title title-icon">
<span class="icon"></span>
<span class="title-bg">区域分布</span>
</div>
<div class="container flex">
<pie-chart :id="chart.id" :list="areaData" :formatter="chart.formatter" :keys="chart.keys" :colors="chart.colors"></pie-chart>
<OperationaLegend :list="areaData" :width="'3.68vw'" :colors="chart.colors"></OperationaLegend>
</div>
</div>
</template>
<script>
import OperationaLegend from './OperationaLegend.vue'
export default {
name: 'Area',
components: {
OperationaLegend
},
data() {
return {
chart: {
id: 'area',
keys: ['name', 'num'],
colors: ['#FF6E76', '#16E193', '#FDF006', '#EB6001', '#34AFFF', '#BF98FF'],
formatter: 'rate'
},
areaData: []
}
},
created() {
this.$bus.$on('clientData', data => {
this.areaData = data.areaData
})
}
}
</script>
<template>
<div class="area">
<div class="title-icon">
<span class="title-bg">区域分布</span>
</div>
<div class="container">
<BarChart domId="areaChart" :analysisList="areaList" :colorList="colorList"></BarChart>
</div>
</div>
</template>
<script>
import BarChart from './BarChart.vue'
export default {
name: 'AreaSaas',
components: {
BarChart
},
data() {
return {
colorList: ['#22D8FF', '#223FA9', '#071735']
}
},
props: {
areaList: {
type: Array,
default: () => []
}
}
}
</script>
<style scoped lang="scss">
.area {
width: 15.83vw;
.title-icon {
font-weight: 500;
font-size: 10px;
color: #ffffff;
.title-bg {
background-image: linear-gradient(90deg, #003f57 0%, #111056 54%, #071735 100%);
padding-left: 0.83vw;
}
}
}
</style>
<template>
<div class="line-box">
<div :id="domId" class="line-chart" :style="{ height: boxHeight }"></div>
</div>
</template>
<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 * as echarts from 'echarts'
import utils from '../../../utils/util'
import { getBarOptions, getBarReverseOptions } from './options'
export default {
name: 'BarChart',
props: {
domId: {
type: String,
default: 'line-chart'
},
rotate: {
type: Number,
default: 0
},
revese: {
type: Boolean,
default: false
},
boxHeight: {
type: String,
default: '13.83vh'
},
storeOrBrandTxt: {
type: String,
default: '品牌'
},
analysisList: {
type: [Array, Object],
default: () => []
},
// 0-月表;1-日表
queryType: {
type: Number,
default: 0
},
colorList: {
type: Array
},
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: [],
areaList2: this.areaList,
echartsLine: '',
moveAttr: {
// speed: 900,
seriesIndex: 0,
dataIndex: 0
},
timer: null,
currentData: {
dataIndex: 0
}
}
},
// created() {
// const { rotate, analysisList } = this
// const obj = {
// rotate,
// analysisList
// }
// this.lineOptions = this.revese ? getBarReverseOptions(obj) : getBarOptions(obj)
// },
watch: {
analysisList: {
handler() {
const { rotate, analysisList, colorList } = this
const obj = {
rotate,
analysisList,
ValueAnalysis
}
this.lineOptions = this.revese ? getBarReverseOptions(obj, colorList) : getBarOptions(obj, colorList)
this.chartBindEvent()
},
deep: true
}
},
mounted() {
this.lineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.lineDom)
this.chartBindEvent()
},
methods: {
chartBindEvent() {
this[this.domId].setOption(this.lineOptions)
if (this.revese === false) return
this.chartAction()
this[this.domId].getZr().on(
'mousemove',
utils.debounce(params => {
clearInterval(this.timer)
this.timer = null
const pointInPixel = [params.offsetX, params.offsetY]
const pointInGrid = this[this.domId].convertFromPixel({ seriesIndex: 0 }, pointInPixel)
const yIndex = pointInGrid[1]
this.currentData = {
dataIndex: yIndex
}
this.chartAction(yIndex)
}, 500)
)
window.addEventListener('resize', () => {
this[this.domId].resize()
})
this[this.domId].getZr().on(
'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) {
this[this.domId].dispatchAction({
type: 'showTip',
seriesIndex: 0,
dataIndex: index
})
this.$bus.$emit('drawChart', index)
}
},
destroyed() {
clearInterval(this.timer)
}
}
</script>
<style lang="scss" scoped>
.line-box {
height: 100%;
color: #ffffff;
.txt-orange {
color: #eb6001;
}
.line-chart {
width: 100%;
}
}
</style>
<!--
* @Description: 品牌分布
* @Author: huyue
* @Date: 2023-08-16 14:35:24
* @LastEditors: huyue
* @LastEditTime: 2023-08-22 10:56:23
-->
<template>
<div>
<div class="title title-icon">
<span class="icon"></span>
<span class="title-bg">品牌分布</span>
</div>
<div class="container flex">
<pie-chart :id="chart.id" :list="brandData" :keys="chart.keys" :formatter="chart.formatter" :colors="chart.colors"></pie-chart>
<OperationaLegend :list="brandData" :colors="chart.colors"></OperationaLegend>
</div>
</div>
</template>
<script>
import OperationaLegend from './OperationaLegend.vue'
export default {
name: 'Brand',
components: {
OperationaLegend
},
data() {
return {
type: 'gender',
chart: {
id: 'brand',
keys: ['name', 'num'],
colors: ['#FF6E76', '#16E193', '#FDF006', '#EB6001', '#34AFFF', '#BF98FF'],
formatter: 'rate'
},
brandData: []
}
},
created() {
this.$bus.$on('clientData', data => {
this.brandData = data.brandData
})
}
}
</script>
<template>
<div class="brand">
<div class="title-icon">
<span class="title-bg">品牌分布</span>
</div>
<div class="container">
<BarChart domId="brandChart" :rotate="30" :analysisList="brandList" :colorList="colorList"></BarChart>
</div>
</div>
</template>
<script>
import BarChart from './BarChart.vue'
export default {
name: 'BrandSaas',
components: {
BarChart
},
data() {
return {
colorList: ['#2AD191', '#0E958D', '#071735']
}
},
props: {
brandList: {
type: Array,
default: () => []
}
}
}
</script>
<style scoped lang="scss">
.brand {
width: 15.83vw;
.title-icon {
font-weight: 500;
font-size: 10px;
color: #ffffff;
.title-bg {
background-image: linear-gradient(90deg, #003f57 0%, #111056 54%, #071735 100%);
padding-left: 0.83vw;
}
}
}
</style>
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-08-28 10:37:35
* @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> -->
<StatisticsBox class="business-box" :list="list.slice(0,3)"></StatisticsBox>
<StatisticsBox class="business-box second-box" :list="list.slice(3,5)"></StatisticsBox>
</div>
<div class="business-category">
<Category :categoryData="categoryData"></Category>
</div>
</div>
</template>
<script>
import Category from './Category'
export default {
components: {
Category
},
name: 'Business',
data() {
return {
categoryData: [],
list: [
{
name: '累计展业门店数',
valueName: 'totalNum',
value: 0
},
{
name: '当年新增门店数',
valueName: 'increnum',
value: 0
},
{
name: '客单价',
valueName: 'atv',
value: 0
},
{
name: '当月产值',
valueName: 'outputValuethismonth',
value: 0
},
{
name: '当年产值',
valueName: 'outputValuethisyear',
value: 0
}
]
}
},
created() {
this.getSaasValueaddedTransformationOverview()
},
methods: {
toFixNum(val) {
return (val * 100).toFixed(2) + '%'
},
getSaasValueaddedTransformationOverview() {
this.api.operational.getSaasValueaddedTransformationOverview().then(res => {
if (res.code === '0') {
const _data = res.data.dataList[0]
this.list.forEach(item => {
item.value = _data[item.valueName]
})
this.categoryData = [
{
name: '精品类',
value: _data.equity
},
{
name: '权益类',
value: _data.membrane
},
{
name: '续保类',
value: _data.electronics
}
]
}
})
}
}
}
</script>
<style lang="scss" scoped>
.business-wrap {
height: 14.15vh;
margin: 0.98vh 0.83vw;
// margin-bottom: 0.98vh;
// margin-top: 0.98vh;
justify-content: space-between;
.business-data {
margin-right: 4px;
// margin-top: 0.98vh;
width: 38.06vw;
height: 100%;
/deep/{
.business-box.statistics {
height: 6.83vh;
box-sizing: border-box;
.statistics-item {
margin-right: 0.28vw;
.statistics-top {
.statistics-name {
margin-bottom: 0;
font-size: 12px;
}
.statistics-price-number {
font-size: 24px;
}
}
}
}
}
.second-box {
margin-top: 0.29vh;
}
}
.business-category {
width: 13.89vw;
height: 100%;
}
}
</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-icon">
<span class="title-bg">购车年限</span>
</div>
<div class="user-container flex">
<pie-chart @pieAction="pieAction" :colors="chart.colors" :formatter="chart.formatter" :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%'],
colors: ['#FF6E76', '#16E193', '#FDF006', '#EB6001', '#34AFFF', '#BF98FF', '#726BFF'],
size: '8px',
formatter: 'rate'
},
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-icon {
font-weight: 500;
font-size: 10px;
color: #ffffff;
.title-bg {
background-image: linear-gradient(90deg, #003f57 0%, #111056 54%, #071735 100%);
padding-left: 0.83vw;
}
}
.legend-item {
width: 4.65vw;
height: 1.83vh;
background: #0a214d;
font-weight: 400;
font-size: 9px;
color: #fff;
margin-right: 2vw;
span {
width: 5px;
height: 5px;
border-radius: 50%;
margin: 4px;
display: inline-block;
}
}
}
</style>
<template>
<div class="category-box box">
<div class="title-icon">
<span class="title-bg">品类业务</span>
</div>
<div class="category-container flex">
<pie-chart ref="pieChartCategory" :id="chart.id" :list="categoryData" :formatter="chart.formatter" :colors="chart.colors"></pie-chart>
<OperationaLegend class="category-legend" :list="categoryData" :width="'4.17vw'" :height="'2.44vh'" :colors="chart.colors"></OperationaLegend>
</div>
</div>
</template>
<script>
import OperationaLegend from './OperationaLegend.vue'
export default {
name: 'Category',
components: {
OperationaLegend
},
data() {
return {
chart: {
id: 'category',
colors: ['#EB6001', '#34AFFF', '#16E193', '#BF98FF'],
formatter: 'rate'
}
}
},
props: {
categoryData: {
type: Array,
default: () => []
}
},
methods: {}
}
</script>
<style lang="scss" scoped>
.category-box {
overflow: hidden;
height: 13.9vh;
.title-icon {
font-weight: 500;
font-size: 14px;
color: #ffffff;
.title-bg {
background-image: linear-gradient(90deg, #003f57 0%, #111056 54%, #06142200 100%);
padding-left: 0.83vw;
}
}
.category-container {
height: 11.34vh;
// margin: 1.59vh 1.67vw 1.46vh 1.11vw;
.category-legend {
width: 4.2vw;
margin-right: 1.81vw;
}
}
}
</style>
<template>
<div class="mask" v-if="isShow">
<div class="dialog-wrap">
<div class="dialog">
<div class="dialog-title">
客户价值分析
<div class="close" @click="closeHandle">
<img src="@/assets/images/close.png" />
</div>
</div>
<div class="dialog-content flex">
<div class="content-top axis">
<img src="@/assets/images/axis.png" />
</div>
<div class="content-top bg">
<div class="content-top-title">
<!-- <img class="title-icon" src="@/assets/images/title-icon.png" /> -->
<div class="title">客户价值</div>
<!-- <img class="title-icon" src="@/assets/images/title-icon.png" /> -->
</div>
<div class="content-info">
重要价值:R高、F高、M高
<br />
重要发展:R高、F低、M高
<br />
重要召回:R低、F高、M高
<br />
重要挽留:R低、F低、M高
<br />
一般价值:R高、F高、M低
<br />
一般发展:R高、F低、M低
<br />
一般召回:R低、F高、M低
<br />
一般挽留:R低、F低、M低
</div>
</div>
<div class="content-bottom bg">
<div class="title">售后客户价值模型</div>
<div class="info">
R=最近一次和上一次到店间隔时间
<br />
F=一年内到店频次
<br />
M=一年内售后工单金额
</div>
</div>
<div class="content-bottom bg">
<div class="title">当前逻辑</div>
<div class="info">
6个月内(高)< R ≤ 超6个月(低)
<br />
2次以内(低)≤ F <超2次(高)
<br />
3000元 (低)≤ M <超 3000元(高)
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'MyDialog',
props: {
isShow: Boolean
},
data() {
return {
msg: ''
}
},
methods: {
closeHandle() {
this.$emit('closeDialog')
}
}
}
</script>
<style lang="scss" scoped>
.mask {
width: 100%;
height: 100%;
position: fixed;
z-index: 99;
left: 0px;
top: 0px;
background: rgba(0, 0, 0, 0.8);
}
.dialog-wrap {
width: 61.11vw;
height: 73.29vh;
position: absolute;
z-index: 1;
left: 50%;
top: 50%;
background-image: url('../../../assets/images/bg-5.png');
background-repeat: no-repeat;
background-size: 100% 100%;
transform: translate(-50%, -50%);
border-radius: 5px;
padding: 3.9vh 3.67vw;
box-sizing: border-box;
.close {
width: 20px;
height: 20px;
position: absolute;
right: -330px;
top: -5px;
cursor: pointer;
}
.dialog-title {
width: 13.19vw;
height: 4.39vh;
background-image: url('../../../assets/images/title-dialog.png');
background-repeat: no-repeat;
background-size: 100% 100%;
text-align: center;
font-size: 20px;
color: #ffffff;
margin: 0 auto;
position: relative;
line-height: 4.39vh;
}
.dialog-content {
flex-wrap: wrap;
justify-content: space-between;
margin-top: 3.5vh;
.axis {
width: 26.88vw;
height: 34.97vh;
margin-right: 1.25vw;
img {
height: 100%;
}
}
.content-top-title {
width: 10vw;
margin: 7px auto;
display: flex;
align-items: center;
height: 2.68vh;
.title-icon {
width: 21px;
height: 7px;
}
.title {
font-weight: 500;
font-size: 16px;
color: #ffffff;
margin: 0 auto;
height: 2.68vh;
line-height: 2.68vh;
}
}
.content-info {
font-weight: 400;
font-size: 14px;
color: #c0c8d4;
margin: 0 auto;
text-align: center;
}
}
.content-top {
width: 25.14vw;
height: 27.93vh;
margin-bottom: 4.45vh;
}
.content-bottom {
width: 25.14vw;
height: 14.88vh;
font-weight: 400;
font-size: 14px;
color: #ffffff;
padding: 1.2vh 1.39vw;
box-sizing: border-box;
.title {
font-weight: 500;
font-size: 16px;
margin-bottom: 8px;
height: 2.68vh;
}
.info {
font-weight: 400;
font-size: 14px;
color: #c0c8d4;
}
}
.bg {
background: #001d43;
box-shadow: inset 0 0 20px 0 #003587;
border-radius: 4px;
}
}
</style>
<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 { lineAndBarOptions } from './options'
export default {
name: 'LineBar',
props: {
domId: {
type: String,
default: 'line-chart'
},
revese: {
type: Boolean,
default: false
},
boxHeight: {
type: String,
default: '13.83vh'
},
storeOrBrandTxt: {
type: String,
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: {
// dataList: {
// handler() {
// console.log(33333333333);
// this.lineOptions = lineAndBarOptions(this.dataList)
// this.chartBindEvent()
// },
// deep: true
// }
// },
mounted() {
this.lineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.lineDom)
this.chartBindEvent()
},
methods: {
tooltipFormatter(obj) {
var _currentItem = this.dataList[obj[0].dataIndex]
var _html = ''
var _txt = ''
_txt += `<div style="display:flex;"><div style="color: #c9c9c9">${this.tooltipFormatterObj.label}:</div><div style="color: #fff;">${utils.numAddSymbol(_currentItem[this.tooltipFormatterObj.attrName])}${this.tooltipFormatterObj.addSymbol || ''}</div></div>`
_html += `<div style="backdrop-filter: blur(4px);background-color: #051526;border: 2px solid;border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;padding: 10px;">
${_txt}
</div>`
return _html
},
chartBindEvent() {
// resize
window.addEventListener('resize', () => {
this[this.domId].resize()
})
},
drawLine(dataList) {
this.lineOptions = lineAndBarOptions(dataList)
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>
<!--
* @Description:
* @Author: huyue
* @Date: 2023-08-16 15:48:46
* @LastEditors: huyue
* @LastEditTime: 2023-08-28 14:32:18
-->
<!--
* @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)
window.addEventListener('resize', () => {
this[this.domId].resize()
})
},
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-icon">
<span class="title-bg">里程分布</span>
</div>
<div class="user-container flex">
<pie-chart @pieAction="pieAction" :colors="chart.colors" :formatter="chart.formatter" :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%'],
colors: ['#FF6E76', '#16E193', '#FDF006', '#EB6001', '#34AFFF', '#BF98FF', '#726BFF'],
size: '8px',
formatter: 'rate'
},
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-icon {
font-weight: 500;
font-size: 10px;
color: #ffffff;
.title-bg {
background-image: linear-gradient(90deg, #003f57 0%, #111056 54%, #071735 100%);
padding-left: 0.83vw;
}
}
.legend-item {
width: 4.65vw;
height: 1.83vh;
background: #0A214D;
font-weight: 400;
font-size: 9px;
color: #fff;
margin-right: 2vw;
span {
width: 5px;
height: 5px;
border-radius: 50%;
margin: 4px;
display: inline-block;
}
}
}
</style>
<template>
<div class="legend">
<div class="legend-item flex" :style="{width: width,height: height}" v-for="(item, index) in dataList" :key="index">
<div class="icon" :style="{ background: colors[index] }"></div>
<div class="item-content">{{ item.name }}</div>
</div>
</div>
</template>
<script>
export default {
name: 'OperationaLegend',
data() {
return {
dataList: this.list
}
},
props: {
list: {
type: Array,
default: () => []
},
colors: {
type: Array,
default: () => ['#FF6E76', '#7CFFB2', ' #FDF006', '#4FA0FF', '#EB6001', '#BF98FF', '#BF98FF', '#58D9F9']
},
width: {
type: String,
default: '3.68vw'
},
height: {
type: String,
default: '2.44vh'
}
},
watch: {
list(val) {
this.dataList = val
}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.legend {
display: flex;
align-items: center;
flex-wrap: wrap;
width: 7.7vw;
height: 8.54vh;
margin-left: 0.42vw;
.legend-item {
background: #0A214D;
align-items: center;
font-size: 7px;
color: #FFFFFF;
box-sizing: border-box;
margin: 2px 2px 2px 0;
white-space: nowrap;
.item-content {
width: 2.5vw;
overflow: hidden;
}
.icon {
width: 5px;
height: 5px;
background: #bf98ff;
border-radius: 50%;
margin: 4px;
}
}
}
</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.operational.getMerchantMemberEquity().then(res => {
if (res.code == 0) {
this.merchantData = res.data.dataList[0]
}
})
},
getSmartData() {
this.api.operational.getSmartCarManageClueSubscription().then(res => {
if (res.code == 0) {
this.smartData = res.data.dataList[0]
}
})
},
getSmartClueData() {
this.api.operational.getSmartMerchantClueSubscription().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;
}
.clew-num {
color: #FF0000;
}
}
.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-icon">
<span class="title-bg">车价占比</span>
</div>
<div class="user-container flex">
<pie-chart @pieAction="pieAction" ref="pieChart" :formatter="chart.formatter" :colors="chart.colors" :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%'],
colors: ['#FF6E76', '#16E193', '#FDF006', '#EB6001', '#34AFFF', '#BF98FF', '#726BFF'],
size: '8px',
formatter: 'rate'
},
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-icon {
font-weight: 500;
font-size: 10px;
color: #ffffff;
.title-bg {
background-image: linear-gradient(90deg, #003f57 0%, #111056 54%, #071735 100%);
padding-left: 0.83vw;
}
}
.legend-item {
width: 4.65vw;
height: 1.83vh;
background: #0A214D;
font-weight: 400;
font-size: 9px;
color: #fff;
margin-right: 2vw;
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-22 17:18:53
* @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.operational.getBusinessType().then(res => {
if (res.code == 0) {
this.projectList = res.data.dataList
}
})
}
}
}
</script>
<style lang="scss" scoped>
.project-wrap {
margin: 0.98vh 0.83vw 0;
height: 11.71vh;
flex-wrap: wrap;
justify-content: space-between;
.project-item {
width: 49.6%;
background: #071735;
.project-left {
width: 2.8vw;
padding: 0px 0.4vw;
height: 5.61vh;
background-image: linear-gradient(270deg, #6578FF 0%, #079FF1 100%);
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.project-title {
color: #e8e8e8;
font-size: 10px;
line-height: 12px;
margin-top: 0.4vh;
// &.fontSmall {
// font-size: 9px;
// }
}
.project-icon {
width: 0.83vw;
height: 0.98vh;
margin: 0 auto;
margin-top: 0.24vh;
}
}
.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>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!