Commit d5f10e51 by 前端

合并数据大屏代码

1 parent d8051ec0
Showing 139 changed files with 4726 additions and 0 deletions
> 1%
last 2 versions
# http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
NODE_ENV='development'
# must start with VUE_APP_
VUE_APP_ENV = 'development'
NODE_ENV='production'
# must start with VUE_APP_
VUE_APP_ENV = 'production'
\ No newline at end of file
NODE_ENV='production'
# must start with VUE_APP_
VUE_APP_ENV = 'staging'
build/*.js
src/assets
src/config
public
dist
module.exports = {
root: true,
env: {
node: true
},
extends: ['plugin:vue/essential', 'eslint:recommended'],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
'vue/max-attributes-per-line': [
2,
{
singleline: 10,
multiline: {
max: 1,
allowFirstLine: false
}
}
],
'vue/singleline-html-element-content-newline': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/name-property-casing': ['error', 'PascalCase'],
'vue/no-v-html': 'off',
'accessor-pairs': 2,
'arrow-spacing': [
2,
{
before: true,
after: true
}
],
'block-spacing': [2, 'always'],
'brace-style': [
2,
'1tbs',
{
allowSingleLine: true
}
],
camelcase: [
0,
{
properties: 'always'
}
],
'comma-dangle': [2, 'never'],
'comma-spacing': [
2,
{
before: false,
after: true
}
],
'comma-style': [2, 'last'],
'constructor-super': 2,
curly: [2, 'multi-line'],
'dot-location': [2, 'property'],
'eol-last': 2,
eqeqeq: ['error', 'always', { null: 'ignore' }],
'generator-star-spacing': [
2,
{
before: true,
after: true
}
],
'handle-callback-err': [2, '^(err|error)$'],
indent: [
2,
2,
{
SwitchCase: 1
}
],
'jsx-quotes': [2, 'prefer-single'],
'key-spacing': [
2,
{
beforeColon: false,
afterColon: true
}
],
'keyword-spacing': [
2,
{
before: true,
after: true
}
],
'new-cap': [
2,
{
newIsCap: true,
capIsNew: false
}
],
'new-parens': 2,
'no-array-constructor': 2,
'no-caller': 2,
'no-console': 'off',
'no-class-assign': 2,
'no-cond-assign': 2,
'no-const-assign': 2,
'no-control-regex': 0,
'no-delete-var': 2,
'no-dupe-args': 2,
'no-dupe-class-members': 2,
'no-dupe-keys': 2,
'no-duplicate-case': 2,
'no-empty-character-class': 2,
'no-empty-pattern': 2,
'no-eval': 2,
'no-ex-assign': 2,
'no-extend-native': 2,
'no-extra-bind': 2,
'no-extra-boolean-cast': 2,
'no-extra-parens': [2, 'functions'],
'no-fallthrough': 2,
'no-floating-decimal': 2,
'no-func-assign': 2,
'no-implied-eval': 2,
'no-inner-declarations': [2, 'functions'],
'no-invalid-regexp': 2,
'no-irregular-whitespace': 2,
'no-iterator': 2,
'no-label-var': 2,
'no-labels': [
2,
{
allowLoop: false,
allowSwitch: false
}
],
'no-lone-blocks': 2,
'no-mixed-spaces-and-tabs': 2,
'no-multi-spaces': 2,
'no-multi-str': 2,
'no-multiple-empty-lines': [
2,
{
max: 1
}
],
'no-native-reassign': 2,
'no-negated-in-lhs': 2,
'no-new-object': 2,
'no-new-require': 2,
'no-new-symbol': 2,
'no-new-wrappers': 2,
'no-obj-calls': 2,
'no-octal': 2,
'no-octal-escape': 2,
'no-path-concat': 2,
'no-proto': 2,
'no-redeclare': 2,
'no-regex-spaces': 2,
'no-return-assign': [2, 'except-parens'],
'no-self-assign': 2,
'no-self-compare': 2,
'no-sequences': 2,
'no-shadow-restricted-names': 2,
'no-spaced-func': 2,
'no-sparse-arrays': 2,
'no-this-before-super': 2,
'no-throw-literal': 2,
'no-trailing-spaces': 2,
'no-undef': 2,
'no-undef-init': 2,
'no-unexpected-multiline': 2,
'no-unmodified-loop-condition': 2,
'no-unneeded-ternary': [
2,
{
defaultAssignment: false
}
],
'no-unreachable': 2,
'no-unsafe-finally': 2,
'no-unused-vars': [
2,
{
vars: 'all',
args: 'none'
}
],
'no-useless-call': 2,
'no-useless-computed-key': 2,
'no-useless-constructor': 2,
'no-useless-escape': 0,
'no-whitespace-before-property': 2,
'no-with': 2,
'one-var': [
2,
{
initialized: 'never'
}
],
'operator-linebreak': [
2,
'after',
{
overrides: {
'?': 'before',
':': 'before'
}
}
],
'padded-blocks': [2, 'never'],
quotes: [
2,
'single',
{
avoidEscape: true,
allowTemplateLiterals: true
}
],
semi: [2, 'never'],
'semi-spacing': [
2,
{
before: false,
after: true
}
],
'space-before-blocks': [2, 'always'],
'space-before-function-paren': [2, 'never'],
'space-in-parens': [2, 'never'],
'space-infix-ops': 2,
'space-unary-ops': [
2,
{
words: true,
nonwords: false
}
],
'spaced-comment': [
2,
'always',
{
markers: ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
}
],
'template-curly-spacing': [2, 'never'],
'use-isnan': 2,
'valid-typeof': 2,
'wrap-iife': [2, 'any'],
'yield-star-spacing': [2, 'both'],
yoda: [2, 'never'],
'prefer-const': 2,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'object-curly-spacing': [
2,
'always',
{
objectsInObjects: false
}
],
'array-bracket-spacing': [2, 'never']
}
}
.DS_Store
node_modules
/dist
/docs
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
package-lock.json
yarn.lock
\ No newline at end of file
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
plugins: {
autoprefixer: {
overrideBrowserslist: ['Android 4.1', 'iOS 7.1', 'Chrome > 31', 'ff > 31', 'ie >= 8']
},
// 'postcss-pxtorem': {
// rootValue: 37.5,
// propList: ['*'],
// selectorBlackList: ['van-','ignore','ign-','.hairlines']
// },
'postcss-px-to-viewport': {
viewportWidth: 1440, // 视窗的宽度,对应的是我们设计稿的宽度,一般是750
unitPrecision: 3, // 指定`px`转换为视窗单位值的小数位数(很多时候无法整除)
viewportUnit: 'vw', // 指定需要转换成的视窗单位,建议使用vw
selectorBlackList: ['.ignore', '.hairlines', 'ign-'], // 指定不转换为视窗单位的类,可以自定义,可以无限添加,建议定义一至两个通用的类名
minPixelValue: 1, // 小于或等于`1px`不转换为视窗单位,你也可以设置为你想要的值
mediaQuery: false // 允许在媒体查询中转换`px`
}
}
}
\ No newline at end of file
{
"printWidth": 200,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"semi": false,
"wrap_line_length": 120,
"wrap_attributes": "auto",
"proseWrap": "always",
"arrowParens": "avoid",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "ignore",
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"jsxBracketSameLine": true,
"files.insertFinalNewline": true,
"useTabs": false,
"eslintIntegration": true,
"overrides": [
{
"files": ".prettierrc",
"options": {
"parser": "json"
}
}
],
"endOfLine": "auto"
}
// 获取 VUE_APP_ENV 非 NODE_ENV,测试环境依然 console
const IS_PROD = ['production', 'prod'].includes(process.env.VUE_APP_ENV)
const plugins = [
[
'import',
{
libraryName: 'vant',
libraryDirectory: 'es',
style: true
},
'vant'
]
]
// 去除 console.log
if (IS_PROD) {
plugins.push('transform-remove-console')
}
module.exports = {
presets: [['@vue/cli-plugin-babel/preset', { useBuiltIns: 'usage', corejs: 3 }]],
plugins
}
{
"name": "rd-data-screen",
"version": "1.0.0",
"description": "GH Hall By Work WeChat",
"author": "limin <limin.mail@qq.com>",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --open",
"build": "vue-cli-service build",
"stage": "vue-cli-service build --mode staging",
"lint": "vue-cli-service lint --fix",
"dev": "npm run serve"
},
"dependencies": {
"autoprefixer": "^8.0.0",
"core-js": "^3.6.4",
"dayjs": "^1.10.5",
"echarts": "^5.3.3",
"lib-flexible": "^0.3.2",
"postcss-loader": "^6.2.0",
"sha1": "^1.1.1",
"storejs": "^1.1.0",
"vconsole": "^3.7.0",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"babel-plugin-import": "^1.13.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"node-sass": "^4.14.1",
"postcss-px-to-viewport": "^1.1.1",
"postcss-pxtorem": "^5.1.1",
"sass-loader": "^8.0.2",
"script-ext-html-webpack-plugin": "^2.1.4",
"vue-loader": "^15.9.8",
"vue-template-compiler": "^2.6.11",
"webpack-bundle-analyzer": "^3.8.0"
}
}
No preview for this file type
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no,viewport-fit=cover">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.css) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="preload" as="style" />
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="stylesheet" />
<% } %>
<title>
<%= webpackConfig.name %>
</title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it
to continue.</strong>
</noscript>
<div id="app"></div>
<!-- 使用CDN加速的JS文件,配置在vue.config.js下 -->
<% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %>
<!-- built files will be auto injected -->
</body>
</html>
<template>
<div id="app">
<router-view />
</div>
</template>
<script>
export default {
name: 'App'
}
</script>
<style lang="scss"></style>
/*
* @Descripttion:API 统一外部调用入口
* @version: 1.0.0
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: huyue
* @LastEditTime: 2022-06-28 15:12:48
*/
const modulesFiles = require.context('./modules', true, /\.js$/)
const modules = modulesFiles.keys().reduce((modules, modulePath) => {
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
const value = modulesFiles(modulePath)
modules[moduleName] = value.default
return modules
}, {})
export default modules
// window.$HTTP
export default {
/**获取品牌名称*/
getBrandList() {
return window.$HTTP.get('brand/getBrandName', {
req: {
queryTime: window.vm.getCurrentDate()
}
})
}
}
// 获取订单总数、今年新增订单数、收入总额、活动总数
const getTotal = params => {
return window.$HTTP.get('/CrowdFunding/getTotal', params)
}
// 近12个月订单量、订单收入趋势
const getOrderMonthlyTrend = params => {
return window.$HTTP.get('/CrowdFunding/getOrderMonthlyTrend', params)
}
// 获取商品统计——xx月前5品类
const getGoodsTop5Monthly = params => {
return window.$HTTP.get('/CrowdFunding/getGoodsTop5Monthly', params)
}
// // 每月各类商品订单信息
// const getGoodsOrderinfoMonthly = params => {
// return window.$HTTP.get('/CrowdFunding/getGoodsOrderinfoMonthly', params)
// }
// 获取商品统计——整体品类分布
// const getAllGoodsDistribution = params => {
// return window.$HTTP.get('/CrowdFunding/getVehicleBrandRanking', params)
// }
// 获取月份
const getMonth = params => {
return window.$HTTP.get('/CrowdFunding/getMonth', params)
}
export default {
getTotal,
getOrderMonthlyTrend,
getGoodsTop5Monthly,
// getGoodsOrderinfoMonthly,
// getAllGoodsDistribution,
getMonth
}
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 09:43:15
* @FilePath: \dj-data-view\src\api\modules\customer.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
// 获取企业客户总览数据
const getEnterpriseOverview = params => {
return window.$HTTP.get('enterpriseCustomer/getEnterpriseOverview', params)
}
// 获取门店区域/品牌/类型
const getEnterpriseDistribution = params => {
return window.$HTTP.get('enterpriseCustomer/getEnterpriseDistribution', params)
}
// 获取企业客户数据近12个月趋势图(包括:总客户数、新增客户数)
const getEnterpriseOverviewTrend = params => {
return window.$HTTP.get('enterpriseCustomer/getEnterpriseOverviewTrend', params)
}
export default {
getEnterpriseOverview,
getEnterpriseDistribution,
getEnterpriseOverviewTrend
}
// 获取订单总数、今年新增订单量、收入总额、月均收入
const getTotal = params => {
return window.$HTTP.get('MemberOrder/getTotal', params)
}
// 近12个月订单量、订单收入趋势
const getMemberMonthlyTrend = params => {
return window.$HTTP.get('MemberOrder/getMemberMonthlyTrend', params)
}
// 整体品牌车型排名
const getVehicleBrandRanking = params => {
return window.$HTTP.get('MemberOrder/getVehicleBrandRanking', params)
}
// 获取产品排名
const getProductRanking = params => {
return window.$HTTP.get('MemberOrder/getProductRanking', params)
}
// xx月前5产品排名
const getProductMonthly = params => {
return window.$HTTP.get('MemberOrder/getProductMonthly', params)
}
const getVehicleBrandMonthly = params => {
return window.$HTTP.get('MemberOrder/getVehicleBrandMonthly', params)
}
export default {
getTotal,
getMemberMonthlyTrend,
getVehicleBrandRanking,
getProductRanking,
getProductMonthly,
getVehicleBrandMonthly
}
// 当月进行中门店--区域(省份_地图)分布(参数:新车洽谈/新车交付/0~12个月/12个月以上)
const getMerchantInProgressThisMonth = params => {
return window.$HTTP.get('saasValueaddedTransformation/getMerchantInProgressThisMonth', params)
}
export default {
getMerchantInProgressThisMonth,
}
// 获取订单总数、今年新增订单数、收入总额
const getTotal = params => {
return window.$HTTP.get('/NoWorries/getTotal', params)
}
// 近12个月订单量、订单收入趋势
const getOrderMonthlyTrend = params => {
return window.$HTTP.get('/NoWorries/getOrderMonthlyTrend', params)
}
// 获取商品统计——xx月前5品类
const getGoodsTop5Monthly = params => {
return window.$HTTP.get('/NoWorries/getGoodsTop5Monthly', params)
}
// 每月各类商品订单信息
const getGoodsOrderinfoMonthly = params => {
return window.$HTTP.get('/NoWorries/getGoodsTop5Monthly', params)
}
// 获取商品统计——整体品类分布
const getAllGoodsDistribution = params => {
return window.$HTTP.get('/NoWorries/getAllGoodsDistribution', params)
}
// 获取月份
const getMonth = params => {
return window.$HTTP.get('/NoWorries/getMonth', params)
}
export default {
getTotal,
getOrderMonthlyTrend,
getGoodsTop5Monthly,
getGoodsOrderinfoMonthly,
getAllGoodsDistribution,
getMonth
}
// window.$HTTP
export default {
/** 获取品牌---总体模块信息(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus 的基础数据 和 前五排行/后五排行 ) */
getBrandOverallbase(req) {
return window.$HTTP.get('brand/overallbase', { req })
},
/* 获取品牌---总体模块趋势图指标(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus) */
getBrandOveralltrend(req) {
return window.$HTTP.get('brand/overalltrend', { req })
},
/* 获取门店总体相关信息 */
getMerchantOverallbase(req) {
return window.$HTTP.get('merchant/overallbase', { req })
},
/* 获取门店---总体模块趋势图指标(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus) */
getMerchantOveralltrend(req) {
return window.$HTTP.get('merchant/overalltrend', { req })
},
/**
* 获取接入门店数
*/
getMerchantNum(req) {
return window.$HTTP.get('brand/getMerchantNum', { req })
}
}
/*
* @Description: 获取品牌销售相关信息
* @Author: huyue
* @Date: 2022-06-28 14:58:30
* @LastEditors: huyue
* @LastEditTime: 2022-06-30 14:27:04
*/
// 集团相关
// 获取品牌销售模块其他相关信息
const getSales = params => {
return window.$HTTP.get('brand/saleothers', params)
}
// 获取品牌销售转化总数居
const saleTotal = params => {
return window.$HTTP.get('brand/saletotal', params)
}
// 获取品牌销售转化信息
const saleTrans = params => {
return window.$HTTP.get('brand/saleTrans', params)
}
// 获取品牌客流转化趋势
const saleTransTrend = params => {
return window.$HTTP.get('brand/saleTransTrend', params)
}
// 门店相关
// 获取门店销售转化总数据
const storeTotal = params => {
return window.$HTTP.get('merchant/saletotal', params)
}
// 获取门店销售转化相关信息
const storeSaleTrans = params => {
return window.$HTTP.get('merchant/saleTrans', params)
}
// 获取门店销售相关信息
const getMerchantSales = params => {
return window.$HTTP.get('merchant/sale', params)
}
// 获取门店客流转化趋势
const storeTransTrend = params => {
return window.$HTTP.get('merchant/saleTransTrend', params)
}
export default {
getSales,
saleTotal,
saleTrans,
storeTotal,
storeSaleTrans,
getMerchantSales,
saleTransTrend,
storeTransTrend
}
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 10:20:25
* @FilePath: \dj-data-view\src\api\modules\customer.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
// 新车洽谈、新车交付、0~12个月、12个月以上(累计展业门店数、当年新增、转化率、客单价、产值)
const getBusinessType = params => {
return window.$HTTP.get('saasValueaddedTransformation/getBusinessType', params)
}
// 已展业省份--区域(省份_地图)分布(参数:新车洽谈/新车交付/0~12个月/12个月以上)
const getDevelopedProvinces = params => {
return window.$HTTP.get('saasValueaddedTransformation/getDevelopedProvinces', params)
}
// 当月进行中门店--区域(省份_地图)分布(参数:新车洽谈/新车交付/0~12个月/12个月以上)
const getMerchantInProgressThisMonth = params => {
return window.$HTTP.get('saasValueaddedTransformation/getMerchantInProgressThisMonth', params)
}
// 当月进行中门店--区域(省份_地图)分布(参数:新车洽谈/新车交付/0~12个月/12个月以上)
const getSaasValueaddedTransformationOverview = params => {
return window.$HTTP.get('saasValueaddedTransformation/getSaasValueaddedTransformationOverview', params)
}
// 门店会员的权益
const getMerchantData = params => {
return window.$HTTP.get('saasSubscription/getMerchantMemberEquity', params)
}
// 智慧车管线索订阅
const getSmartData = params => {
return window.$HTTP.get('saasSubscription/getSmartCarManageClueSubscription', params)
}
// 智慧门店线索订阅
const getSmartClueData = params => {
return window.$HTTP.get('saasSubscription/getSmartMerchantClueSubscription', params)
}
export default {
getBusinessType,
getDevelopedProvinces,
getMerchantInProgressThisMonth,
getSaasValueaddedTransformationOverview,
getMerchantData,
getSmartData,
getSmartClueData
}
// 展业门店数、成单门店数
const getMerchantNum = params => {
return window.$HTTP.get('SpringbudAction/getMerchantNum', params)
}
// 近12个月整体(所有门店)的业务趋势
const getAllMerchantMonthlyTrend = params => {
return window.$HTTP.get('SpringbudAction/getAllMerchantMonthlyTrend', params)
}
// 近12个月每个月注册的门店数趋势
const getRegisterMerchantNumTrend = params => {
return window.$HTTP.get('SpringbudAction/getRegisterMerchantNumTrend', params)
}
// 门店每月展业情况
const getMerchantNumTrend = params => {
return window.$HTTP.get('SpringbudAction/getMerchantNumTrend', params)
}
// 近12个月每个门店的业务趋势(30天)
const getEveryMerMonthlyTrend = params => {
return window.$HTTP.get('SpringbudAction/getEveryMerMonthlyTrend', params)
}
// 获取展业时间
const getPromoteTime = params => {
return window.$HTTP.get('SpringbudAction/getPromoteTime', params)
}
// 获取各个业务的订单量和产值
const getEveryBusinessOrder = params => {
return window.$HTTP.get('SpringbudAction/getEveryBusinessOrder', params)
}
// 获取数据更新时间
const getUpdateTime = params => {
return window.$HTTP.get('SpringbudAction/getUpdateTime', params)
}
export default {
getMerchantNum,
getAllMerchantMonthlyTrend,
getRegisterMerchantNumTrend,
getMerchantNumTrend,
getEveryMerMonthlyTrend,
getPromoteTime,
getEveryBusinessOrder,
getUpdateTime
}
// 获取订单总数、今年新增订单数、收入总额
const getTotal = params => {
return window.$HTTP.get('/TransWork/getTotal', params)
}
// 近12个月订单量、订单收入趋势
const getOrderMonthlyTrend = params => {
return window.$HTTP.get('/TransWork/getOrderMonthlyTrend', params)
}
// 获取商品统计——xx月前5品类
const getGoodsTop5Monthly = params => {
return window.$HTTP.get('/TransWork/getGoodsTop5Monthly', params)
}
// 每月各类商品订单信息
const getGoodsOrderinfoMonthly = params => {
return window.$HTTP.get('/TransWork/getGoodsOrderinfoMonthly', params)
}
// 获取商品统计——整体品类分布
const getAllGoodsDistribution = params => {
return window.$HTTP.get('/TransWork/getAllGoodsDistribution', params)
}
// 获取月份
const getMonth = params => {
return window.$HTTP.get('/TransWork/getMonth', params)
}
export default {
getTotal,
getOrderMonthlyTrend,
getGoodsTop5Monthly,
getGoodsOrderinfoMonthly,
getAllGoodsDistribution,
getMonth
}
/*
* @Description: 售后数据
* @Author: huyue
* @Date: 2022-06-28 16:55:48
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 15:23:24
*/
// 私域用户池总览数据
const getoverview = params => {
return window.$HTTP.get('/privateDomainUserPool/getoverview', params)
}
// 客户年龄分布/车价占比/购车年限分布/里程分布
const getDistribution = params => {
return window.$HTTP.get('privateDomainUserPool/getDistribution', params)
}
// 用户数、企微客户数、企微群数、小程序、个微客户数 趋势图
const getTrend = params => {
return window.$HTTP.get('privateDomainUserPool/getTrend', params)
}
const getCustomerValueAnalysis = params => {
return window.$HTTP.get('privateDomainUserPool/getCustomerValueAnalysis', params)
}
const getValueDistribution = params => {
return window.$HTTP.get('privateDomainUserPool/getValueDistribution', params)
}
// // 获取品牌售后其他信息
// const aftersaleother = params => {
// return window.$HTTP.get('brand/aftersaleother', params)
// }
// // 获取门店品牌售后其他信息
// const afterMerchantSaleother = params => {
// return window.$HTTP.get('merchant/aftersaleother', params)
// }
export default { getoverview, getDistribution, getTrend, getCustomerValueAnalysis, getValueDistribution }
class Request {
DOMAIN = '/dev'
constructor(_request_) {
this.DOMAIN = _request_ ? _request_.baseURL : this.DOMAIN
}
get(url, params, returnAll) {
return this.request('GET', url, params, returnAll)
}
post(url, params, returnAll) {
return this.request('POST', url, params, returnAll)
}
request(method, url, params, returnAll) {
var requestConfig = {
headers: {
// 'Content-Type': method == 'GET' ? 'application/json' : 'application/x-www-form-urlencoded; charset=UTF-8'
'Content-Type': 'application/json'
},
method
}
if (method === 'GET') {
var paramsArray = []
params && Object.keys(params).forEach(key => paramsArray.push(key + '=' + params[key]))
if (url.search(/\?/) === -1) {
url += '?' + paramsArray.join('&')
} else {
url += '&' + paramsArray.join('&')
}
}
if (method === 'POST') {
Object.defineProperty(requestConfig, 'body', {
value: JSON.stringify(params)
})
}
return window
.fetch(this.DOMAIN + `/${url}`, requestConfig)
.then(res => {
return res.json()
})
// .catch(error => {
// alert(error)
// })
}
}
export default Request
@import './normalize.scss';
@font-face {
font-family: 'PingFangSC-Regular';
src: url('../font/PingFang-Regular.ttf');
}
html,
body .app {
color: #333333;
font-family: 'PingFangSC-Regular', Arial, Helvetica, 'STHeiti STXihei', 'Microsoft YaHei', Tohoma, sans-serif;
background-color: #fff;
-webkit-overflow-scrolling: touch;
height: 100%;
// overflow: hidden;
--themeColor: #3975c6;
}
img {
width: 100%;
height: 100%;
vertical-align: top;
}
.flex {
display: flex;
align-items: center;
}
.flex-around {
display: flex;
align-items: center;
justify-content: space-around;
}
.flex-between {
display: flex;
align-items: center;
justify-content: space-between;
}
.flex-column {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.text-two-line {
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.x-center {
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.y-center {
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.box-center {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.user-select {
user-select: none;
}
.pointer {
cursor: pointer;
}
.box {
background: #0b0e31;
// overflow: hidden;
}
.inline {
display: inline-block;
}
.title {
font-size: 0.75vw;
font-weight: 400;
font-size: 11px;
color: #ffffff;
user-select: none;
box-sizing: border-box;
height: 2.07vh;
margin-top: 4px;
}
.title-icon {
display: flex;
align-items: center;
.icon {
display: inline-block;
width: 18px;
height: 10px;
margin-right: 4px;
background-image: url(../images/icon.png);
}
}
.container {
height: 8.54vh;
margin: 8px 6px 8px 8px;
}
.user-container{
height:6.1vh;
margin: 5px 6px 5px 6px;
}
.empty {
display: flex;
width: 100%;
height: calc(100% - 4.1vh);
align-items: center;
justify-content: center;
img {
max-width: 20vh;
height: 9.5vh;
}
}
.text-linear {
background: linear-gradient(top, #b4bdff, #7e8eff);
color: transparent;
-webkit-background-clip: text;
}
.user-box {
height: 9.51vh;
width:11.18vw;
margin-right: 0.28vw;
margin-bottom: 0.28vw;
background: #0b0e31;
}
No preview for this file type
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-26 16:56:49
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-26 16:57:02
* @FilePath: \dj-data-view\src\bus.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import Vue from 'vue'
// export default new Vue()
const Bus = new Vue()
export default Bus
<template>
<div class='legend'>
<div class='legend-item flex' v-for='(item, index) in dataList' :key='index'>
<div class='icon' :style='{ background: colors[index] }'></div>
<div class='item-content'>{{ item[showName] }}</div>
</div>
</div>
</template>
<script>
export default {
name: 'Legend',
data() {
return {
dataList: this.list
}
},
props: {
showName: {
type: String,
default: ''
},
list: {
type: Array,
default: () => []
},
colors: {
type: Array,
default: () => ['#FF6E76', '#7CFFB2', ' #FDF006', '#4FA0FF', '#EB6001', '#BF98FF', '#BF98FF', '#58D9F9']
}
},
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 {
width: 3.68vw;
height: 2.44vh;
background: #0d133b;
align-items: center;
font-size: 7px;
color: #fff;
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>
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:43:46
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-28 14:53:22
* @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,getLineDoubleOptions } from './options'
export default {
name: 'lineChart',
props: {
domId: {
type: String,
default: 'line-chart'
},
isDouble: {
type: Boolean,
default: false
},
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 =this.isDouble?getLineDoubleOptions(this.privateList) : getLineOptions(this.privateList)
this.chartBindEvent()
},
deep: true
}
},
mounted() {
this.lineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.lineDom)
},
methods: {
chartBindEvent() {
this[this.domId].setOption(this.lineOptions)
}
}
}
</script>
<style lang="scss" scoped>
.line-box {
height: 100%;
color: #ffffff;
.txt-orange {
color: #eb6001;
}
.line-chart {
width: 100%;
}
}
</style>
<template>
<div class="marquee-box" ref="marqueeBox">
<span class="marquee" ref="marqueeText" :style="[{ transition: `all ${move ? speed : 0}s linear` }, { left: target }]">{{ text }}</span>
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: 'Marquee',
props: {
text: String,
direction: {
type: Number,
default: 5000
},
delay: {
type: Number,
default: 1000
}
},
data () {
return {
move: false,
valueWidth: 0,
target: 0,
boxWidth: 0,
speed: 0
}
},
watch:{
'text'(n){
if(n)setTimeout(() => {
let { marqueeBox, marqueeText } = this.$refs
if (!marqueeBox) return
let boxWidth = marqueeBox.offsetWidth,
valueWidth = marqueeText.offsetWidth
this.valueWidth = valueWidth
this.boxWidth = boxWidth
if (boxWidth - 10 <= valueWidth) this.run(valueWidth)
}, this.delay)
}
},
mounted () {
},
methods: {
run () {
let { valueWidth, direction } = this
this.target = `-${valueWidth}px`
this.move = true
this.speed = direction / 1000
setTimeout(() => {
this.again()
}, direction)
},
again () {
let { boxWidth, valueWidth, direction } = this
this.move = false
this.target = `${boxWidth}px`
setTimeout(() => {
this.speed = direction * (boxWidth / valueWidth).toFixed(2) / 1000
this.move = true
this.reset()
}, 500)
},
reset () {
let awaitTime = (this.speed + 2) * this.delay
this.target = 0
setTimeout(() => {
this.run()
}, awaitTime)
}
}
}
</script>
<style scoped lang="scss">
.marquee-box {
width: 100%;
height: 100%;
overflow: hidden;
position: relative;
.marquee {
position: absolute;
white-space: nowrap;
display: flex;
align-items: center;
}
.move {
transform: translateX(-100%);
}
}
</style>
<template>
<div class="pie-box">
<div :id="id" :style="{ height: height }" class="pie-chart"></div>
<!-- <div class="center-content" :style="{ fontSize: size }">
<div :class="[id, 'center-content-num', 'center-content-num-color']"></div>
</div> -->
<!-- <div class="content-desc">
<div class="content-desc-icon" :style="{ background: descColor }"></div>
{{ numDesc }}
</div> -->
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: 'PieChart',
props: {
id: {
type: String,
default: ''
},
keys: {
type: Array,
default: () => ['name', 'value']
},
height: {
type: String,
default: '8.54vh'
},
list: {
type: Array,
default: () => []
},
radius: {
type: Array,
default: () => ['60%', '89%']
},
colors: {
type: Array,
default: () => ['#FF6E76', '#7CFFB2', ' #FDF006', '#4FA0FF', '#EB6001', '#BF98FF', '#58D9F9']
},
size: {
type: String,
default: '0.6vw'
}
},
data() {
return {
option: '',
echartsPie: '',
mTime: '',
viewData: [],
text: '',
subtext: '',
currentIndex: -1,
mainValue: 0,
numDesc: '',
descColor: ''
}
},
watch: {
list: {
handler(newVal) {
if (newVal.length > 0) {
this.initData()
this.$nextTick(() => {
this.draw()
})
}
},
immediate: true
}
},
mounted() {
},
methods: {
//初始化数据
initData() {
let { list, keys } = this
this.viewData = []
list.forEach(item => {
this.viewData.push({
name: item[keys[0]],
value: item[keys[1]]
})
})
},
draw() {
if (this.mTime) clearInterval(this.mTime)
this.echartsPie = echarts.init(document.getElementById(this.id))
window.addEventListener('resize', () => {
this.echartsPie.resize()
})
// 指定图表的配置项和数据
this.option = {
// tooltip: {
// trigger: 'item'
// },
color: this.colors,
series: [
{
name: '客户年龄分布',
type: 'pie',
radius: this.radius,
center: ['50%', '50%'],
avoidLabelOverlap: false,
label: {
normal: {
show: false,
position: 'center'
},
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: this.size,
fontWeight: 'bold',
color:'#fff',
formatter: '{d}%'
}
},
labelLine: {
show: false
},
data: this.viewData,
minAngle: 30
}
]
}
this.echartsPie.clear()
this.mainValue = 0
this.numDesc = ''
this.echartsPie.setOption(this.option)
this.pieActive()
this.mTime = setInterval(this.pieActive, 15000)
// 鼠标划出
this.echartsPie.on('mouseout', () => {
if (this.mTime) clearInterval(this.mTime)
this.mTime = setInterval(this.pieActive, 15000)
})
this.echartsPie.on('mouseover', data => {
this.mainValue = data.data.value
this.numDesc = data.data.name
this.descColor = data.color
// 停止定时器,清除之前的高亮
clearInterval(this.mTime)
this.currentIndex = data.dataIndex
this.highlightPie()
this.emitEvent(data.data)
})
},
// 事件触发
emitEvent(data) {
this.echartsPie.setOption(this.option)
this.$emit('pieAction', data)
},
highlightPie() {
// 取消所有高亮并高亮当前图形
// 遍历饼图数据,取消所有图形的高亮效果
for (var idx in this.option.series[0].data)
this.echartsPie.dispatchAction({
type: 'downplay',
seriesIndex: 0,
dataIndex: idx
})
// 高亮当前图形
this.echartsPie.dispatchAction({
type: 'highlight',
seriesIndex: 0,
dataIndex: this.currentIndex
})
this.descColor = this.option.color[this.currentIndex]
},
//高亮
pieActive() {
const dataLen = this.option.series[0].data.length
this.currentIndex = (this.currentIndex + 1) % dataLen
this.highlightPie()
this.emitEvent(this.viewData[this.currentIndex])
}
}
}
</script>
<style lang="scss" scoped>
.pie-box {
// background: #262525;
position: relative;
flex: 1;
.center-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
max-width: 40%;
&-num-color {
color: #fff;
}
&-num {
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
// font-size: 0.6vw;
--step: 0;
counter-reset: count var(--step);
z-index: var(--step);
transition: --step 0.5s;
&::before {
content: counter(count);
}
}
&-desc {
font-size: 0.5vw;
color: #606266;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
animation: rotateIn 3s infinite;
}
}
.content-desc {
display: flex;
align-items: center;
font-size: 8px;
color: #c8c8c8;
text-align: center;
font-weight: 400;
position: absolute;
top: 91%;
left: 50%;
transform: translateX(-50%);
text-align: center;
height: 14px !important;
white-space: nowrap;
&-icon {
width: 8px;
height: 4px;
border-radius: 2px;
margin-right: 4px;
}
}
}
@property --step {
syntax: '<integer>';
inherits: false;
initial-value: 15;
}
@keyframes rotateIn {
from {
transform: rotateY(0turn);
}
to {
transform: rotateY(-1turn);
}
}
</style>
<!--
* @Description:
* @Author: huyue
* @Date: 2022-06-28 15:20:14
* @LastEditors: huyue
* @LastEditTime: 2022-07-08 19:03:36
-->
<template>
<div class="ranking-container">
<div class="ranking-title">{{ this.$store.state.app.reportParams.brand ? '门店' : '品牌' }}排名</div>
<div class="ranking">
<div class="brand flex" v-for="(item, index) in brandList" :key="index">
<span class="brand-num">{{ index + 1 }}</span>
<marquee class="marquee" :direction="directionTimer" :delay="delayTimer" :text="item" />
</div>
</div>
</div>
</template>
<script>
export default {
name: 'RanKing',
props: {
list: {
type: Array,
default: () => []
}
},
watch: {
list: {
handler(newVal) {
this.brandList = newVal
}
}
},
data() {
return {
delayTimer: 3000,
directionTimer: 3000,
brandList: this.list,
isBrandName: false
}
}
}
</script>
<style lang="scss" scoped>
.ranking-container {
flex: 1;
margin-left: 0.6vw;
box-sizing: border-box;
height: 12.7vh;
background: #262525;
.ranking-title {
background: rgba(53, 53, 53, 0.6);
font-size: 0.694vw;
color: #eb6001;
font-weight: 400;
padding: 0.4vh 0 0.4vh 20%;
box-sizing: border-box;
}
.ranking {
font-size: 0.694vw;
color: #ffffff;
letter-spacing: 0;
font-weight: 400;
padding: 0.2vh 0 0.3vh 8px;
.brand {
// line-height: 1.9vh;
height: 1.9vh;
display: flex;
align-items: center;
.brand-num {
color: #606266;
margin-right: 0.6vw;
display: inline-block;
width: 0.3vw;
text-align: center;
}
.marquee {
width: 80%;
height: 1.9vh;
font-weight: 400;
}
}
}
}
</style>
<template>
<div class='select'>
<select class='sel' id='sel' v-model='selStr' :style='widthHeight' @change='selSystem()'>
<option v-for='(item,index) in selectArr' :key='index' :value='item.value'>
{{ item.label }}
</option>
</select>
</div>
</template>
<script>
export default {
name: 'SelectOptions',
props: {
selectArr: {
type: Array,
default: () => []
},
widthHeight: {
type: Object,
default: () => {
}
},
getQuery: {
type: String,
default: ''
}
},
data() {
return {
selStr: ''
}
},
mounted() {
this.selStr = this.selectArr[0].value
this.initData(this.selStr)
},
methods: {
// 切换系统
selSystem() {
this.initData(this.selStr)
},
// 初始化数据
initData(val) {
this.getTotal(val) // 获取订单详情
this.getVehicleBrandRanking(val) // 获取车型排名
this.getProductRanking(val) // 获取产品排名
this.getMemberMonthlyTrend(val) // 获取月度趋势
},
handleParamsAndMethod(val, methodName, glParam, ghParam, month) {
const params = {
queryItem: val
}
if (month) params.month = month
this.api.equity[methodName](params).then(res => {
if (res.code == 0) {
if (val === 'gl_dj' || val === 'gl_scrm') {
const gl_result = res.data.dataList
this.$bus.$emit(glParam, { gl_result })
}
if (val === 'gh_bodyguard') {
const gh_result = res.data.dataList
this.$bus.$emit(ghParam, { gh_result })
}
}
})
},
getMemberMonthlyTrend(val) {
this.handleParamsAndMethod(val, 'getMemberMonthlyTrend', 'glMemberMonthlyTrend', 'ghMemberMonthlyTrend')
},
// 获取产品排名
getProductRanking(val) {
this.handleParamsAndMethod(val, 'getProductRanking', 'glProductRanking', 'ghProductRanking')
},
// 获取整体车型排名
getVehicleBrandRanking(val) {
this.handleParamsAndMethod(val, 'getVehicleBrandRanking', 'glVehicleBrandRanking', 'ghVehicleBrandRanking')
},
// 获取订单信息
getTotal(val) {
this.handleParamsAndMethod(val, 'getTotal', 'glOrderList', 'ghOrderList')
}
}
}
</script>
<style scoped lang='scss'>
.select {
margin: 1vh;
.sel {
background: #2436b7;
border: none;
color: #ffffff;
border-radius: 5px;
}
}
</style>
<template>
<div class="number-box flex">
<template v-if="numList.length">
<template v-for="(i,index) in numList">
<div :key="index">
{{i}}
</div>
<template v-if="index != numList.length - 1">,</template>
</template>
</template>
<template v-else>
<div
class="transition-number"
:id="idKey"
>
</div>
</template>
<slot name="suffix"></slot>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'TransitionNumber',
props: {
num: [String, Number],
idKey: String,
split: Boolean
},
data () {
return {
numList: []
}
},
watch: {
num (n) {
this.numList = []
setTimeout(() => {
if (n > 0) {
document.querySelector(`#${this.idKey}`).style = `--step:${n}`
setTimeout(() => {
this.numList = this.setPrice(n)
}, 1000)
} else document.querySelector(`#${this.idKey}`).style = `--step:0`
}, 200)
}
},
mounted () {
},
methods: {
setPrice (price) {
let number = (price.toString() || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
return number.split(',')
}
}
}
</script>
<style scoped lang='scss'>
.number-box {
}
.transition-number {
color: inherit;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
--step: 0;
counter-reset: count var(--step);
z-index: var(--step);
transition: --step 1s;
font-size: inherit;
&::before {
content: counter(count);
}
}
@property --step {
syntax: '<integer>';
inherits: false;
initial-value: 15;
}
</style>
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-26 10:22:41
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 14:30:38
* @FilePath: \dj-data-view\src\components\ViewChart.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="view-chart flex">
<div class="line-chart">
<line-chart domId="sumChart" boxHeight="17.54vh" :privateList="privateList"></line-chart>
</div>
<div class="pie-chart">
<Age></Age>
<Price></Price>
<BuyCar></BuyCar>
<Mileage></Mileage>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import * as echarts from 'echarts'
import datas from '../utils/data'
import Age from '../views/user/age.vue'
import Price from '../views/user/price'
import BuyCar from '../views/user/buyCar'
import Mileage from '../views/user/mileage'
import { userMixin } from '../mixins/index'
export default {
name: 'ViewChart',
mixins: [userMixin],
components: {
Age,
Price,
BuyCar,
Mileage
},
data() {
return {
privateList: []
}
},
created() {
this.getDistribution()
},
mounted() {
this.$bus.$on('drawPrivateChart', data => {
this.privateList = data
})
},
methods: {}
}
</script>
<style scoped lang="scss">
.view-chart {
height: 19.51vh;
margin: 0.98vh 0;
.line-chart {
width: 26.25vw;
height: 100%;
background: #0b0e31;
margin-right: 0.56vw;
}
.pie-chart {
width: 23.28vw;
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
}
}
</style>
<template>
<div class='ViewContainer'>
<div class='ViewContainer-title'>
<slot name='title' />
</div>
<div class='ViewContainer-body' @click='hideTitles'>
<slot name='content' />
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'ViewContainer',
props: {},
data() {
return {}
},
mounted() {
},
methods: {
hideTitles() {
this.$bus.$emit('hideEvent', { title: '11111' })
}
}
}
</script>
<style scoped lang='scss'>
.ViewContainer {
width: 100vw;
height: 100vh;
&-title {
height: 6.1vh;
width: 100%;
background-image: url('../assets/images/bg-title.jpg');
background-repeat: no-repeat;
background-size: cover;
}
&-body {
height: 93.9vh;
}
}
</style>
<template>
<div class='content'>
<view-content-left />
<view-content-right />
</div>
</template>
<script>
export default {
name: 'ViewContent',
props: {},
data() {
return {}
},
methods: {}
}
</script>
<style scoped lang='scss'>
.content {
width: 100%;
height: 100%;
box-sizing: border-box;
position: relative;
padding: 1.46vh 24px 1.95vh;
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-02-27 14:52:17
-->
<template>
<div class='left'>
<div class='top'>
<view-sub-title title='整体的业务趋势' />
<view-surface
:isMonthDay = 'true'
domId='thirtyChart'
:isEqually='false'
boxHeight='41.5vh'
:showSeletion='true'
:isDatazoom='true'
:dataList='springbudAtionList' />
<!-- <div class='topWrp'>-->
<!-- <view-surface domId='transworkChart' title='1.1转化+业务' :dataList='transworkList' />-->
<!-- <view-surface domId='expandedgoldChart' title='1.2膨胀金业务' :dataList='expandedgoldList' />-->
<!-- <view-surface domId='crowdfundingChart' title='1.3众筹业务' :dataList='crowdfundingList' />-->
<!-- <view-surface domId='noworriesChart' title='2.1车损无忧' :dataList='noworriesList' />-->
<!-- </div>-->
</div>
<div class='bottom'>
<view-sub-title title='门店每月各业务展业情况' />
<box-chart :boxList='boxList'></box-chart>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import datas from '../utils/data'
import Area from '../views/customer/area'
import Store from '../views/customer/store'
import Brand from '../views/customer/brand'
import OverSize from '../views/saas/overview.vue'
import { clientMixin } from '../mixins/index'
import BoxChart from 'plugins/boxChart'
import SelectCpn from 'views/sassPlus/componts/selectCpn'
export default {
name: 'ViewContentLeft',
mixins: [clientMixin],
components: {
BoxChart,
Area,
Store,
Brand,
OverSize,
SelectCpn
},
data() {
return {
defaultHeight: datas.DefaultData.defaultPieHeight,
springbudAtionList: [],
boxList: [],
current: 0,
springbudAtionBackup: '',
monthDayBackUp: ''
}
},
created() {
this.getMerchantMonthlyTrend('transwork', '1')
},
mounted() {
this.$bus.$on('changeSpringbudAtion', data => {
// this.springbudAtionBackup = data.action
this.getMerchantMonthlyTrend(data.action, this.monthDayBackUp)
})
// monthDayEvent
this.$bus.$on('monthDayEvent', data => {
// this.monthDayBackUp = data.queryItem
this.getMerchantMonthlyTrend(this.springbudAtionBackup, data.queryItem)
})
},
methods: {
getMerchantMonthlyTrend(val, monthday ) {
this.springbudAtionBackup = val
this.monthDayBackUp = monthday
this.api.springbudAtion.getAllMerchantMonthlyTrend({
queryItem: val,
queryType: monthday
}).then(res => {
if (res.code == 0) {
this.springbudAtionList = res.data.dataList
}
})
}
}
}
</script>
<style scoped lang='scss'>
.left {
display: flex;
flex-direction: column;
width: 43.89vw;
overflow: hidden;
.top {
height: 50.49vh;
width: 100%;
//background-image: url('../assets/images/bg-1.png');
background-image: url('../assets/images/bg-3.png');
background-repeat: no-repeat;
background-size: 100% 100%;
padding: 0 16px;
box-sizing: border-box;
.topWrp {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
align-content: space-between;
}
}
.bottom {
// height: calc(41% - 16px);
height: 38.05vh;
margin-top: auto;
background-image: url('../assets/images/bg-2.png');
background-repeat: no-repeat;
background-size: 100% 100%;
padding: 0 16px;
box-sizing: border-box;
}
}
</style>
<!--
* @Description:
* @Author: huyue
* @Date: 2022-06-23 10:52:23
* @LastEditors: huyue
* @LastEditTime: 2023-02-27 14:52:39
-->
<template>
<div class='right'>
<div class='top'>
<view-sub-title title='门店数量&展业时间展示' />
<Business></Business>
<div class='line-chart'>
<view-sub-title title='每日订单量&注册门店数' />
<line-chart :isDouble='true' domId='registerChart' boxHeight='33vh' :privateList='privateList'></line-chart>
</div>
</div>
<div class='bottom'>
<view-sub-title title='整体订单量&产值' />
<!-- <view-surface-->
<!-- domId='thirtyChart'-->
<!-- :isEqually='false'-->
<!-- boxHeight='45vh'-->
<!-- :title='businessName'-->
<!-- :merchantName='merchantName'-->
<!-- :dataList='thirtyDaysList' />-->
<div class='topWrp'>
<div class='business-desc-wrap'>
<div class='business-top' v-if='everyBusinessOrder'>
<div class='business-border'>
<div class='title-icon'>
<span class='icon'></span>
<div class='business-title'>1.1转换+业务</div>
</div>
<div class='content-wrap'>
<div class='business-content'>
<div class='content-title'>订单量</div>
<div class='content-num'>{{ everyBusinessOrder.orderNum11 }}</div>
</div>
<div class='business-content'>
<div class='content-title'>产值</div>
<div class='content-num'>{{ everyBusinessOrder.outputValue11 }}</div>
</div>
</div>
</div>
<div class='business-border'>
<div class='title-icon'>
<span class='icon'></span>
<div class='business-title'>1.2膨胀金业务</div>
</div>
<div class='content-wrap'>
<div class='business-content'>
<div class='content-title'>订单量</div>
<div class='content-num'>{{ everyBusinessOrder.orderNum12 }}</div>
</div>
<div class='business-content'>
<div class='content-title'>产值</div>
<div class='content-num'>{{ everyBusinessOrder.outputValue12 }}</div>
</div>
</div>
</div>
<div class='business-border'>
<div class='title-icon'>
<span class='icon'></span>
<div class='business-title'>1.3众筹业务</div>
</div>
<div class='content-wrap'>
<div class='business-content'>
<div class='content-title'>订单量</div>
<div class='content-num'>{{ everyBusinessOrder.orderNum13 }}</div>
</div>
<div class='business-content'>
<div class='content-title'>产值</div>
<div class='content-num'>{{ everyBusinessOrder.outputValue13 }}</div>
</div>
</div>
</div>
<div class='business-border'>
<div class='title-icon'>
<span class='icon'></span>
<div class='business-title'>2.1车损无忧业务</div>
</div>
<div class='content-wrap'>
<div class='business-content'>
<div class='content-title'>订单量</div>
<div class='content-num'>{{ everyBusinessOrder.orderNum21 }}</div>
</div>
<div class='business-content'>
<div class='content-title'>产值</div>
<div class='content-num'>{{ everyBusinessOrder.outputValue21 }}</div>
</div>
</div>
</div>
</div>
</div>
<!-- <view-surface domId='transworkChart' title='1.1转化+业务' :dataList='transworkList' />-->
<!-- <view-surface domId='expandedgoldChart' title='1.2膨胀金业务' :dataList='expandedgoldList' />-->
<!-- <view-surface domId='crowdfundingChart' title='1.3众筹业务' :dataList='crowdfundingList' />-->
<!-- <view-surface domId='noworriesChart' title='2.1车损无忧' :dataList='noworriesList' />-->
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import datas from '../utils/data'
import Business from '../views/saas/business'
export default {
name: 'ViewContentRight',
components: {
Business
},
data() {
return {
defaultHeight: datas.DefaultData.defaultLineHeight,
brandList: [],
areaList: [],
privateList: [],
thirtyDaysList: [],
businessName: '',
merchantName: '',
everyBusinessOrder: null
// transworkList: [],
// expandedgoldList: [],
// crowdfundingList: [],
// noworriesList: []
}
},
mounted() {
// this.$bus.$on('thirtyDays', data => {
// this.thirtyDaysList = data.thirtyDaysList
// this.merchantName = data.merchantName
// this.handleBusinessName(data.businessName)
// })
// this.getAllMerchantMonthlyTrend('')
this.api.springbudAtion.getRegisterMerchantNumTrend().then(res => {
if (res.code == 0) {
this.privateList = res.data.dataList
}
})
this.getEveryBusinessOrder()
// this.$bus.$off('storeDetails') // 解决监听两次问题
// this.$bus.$on('storeDetails', data => {
// this.getAllMerchantMonthlyTrend(data.merchantId)
// })
},
methods: {
getEveryBusinessOrder() {
this.api.springbudAtion.getEveryBusinessOrder().then(res => {
if (res.code == 0) {
this.everyBusinessOrder = res.data.dataList[0]
}
})
}
// getAllMerchantMonthlyTrend(merchantId) {
// this.api.springbudAtion.getEveryMerMonthlyTrend({ queryItem: 'transwork', merchantId }).then(res => {
// if (res.code == 0) {
// this.transworkList = res.data.dataList
// }
// })
//
// this.api.springbudAtion.getEveryMerMonthlyTrend({ queryItem: 'expandedgold', merchantId }).then(res => {
// if (res.code == 0) {
// this.expandedgoldList = res.data.dataList
// }
// })
//
// this.api.springbudAtion.getEveryMerMonthlyTrend({ queryItem: 'crowdfunding', merchantId }).then(res => {
// if (res.code == 0) {
// this.crowdfundingList = res.data.dataList
// }
// })
//
// this.api.springbudAtion.getEveryMerMonthlyTrend({ queryItem: 'noworries', merchantId }).then(res => {
// if (res.code == 0) {
// this.noworriesList = res.data.dataList
// }
// })
// }
// handleBusinessName(businessName) {
// switch (businessName) {
// case 'transwork':
// this.businessName = '1.1转化+业务'
// break
// case 'expandedgold':
// this.businessName = '1.2膨胀金业务'
// break
// case 'crowdfunding':
// this.businessName = '1.3众筹业务'
// break
// case 'noworries':
// this.businessName = '2.1车损无忧'
// break
// default:
// this.businessName = '1.1转化+业务'
// }
// }
}
}
</script>
<style scoped lang='scss'>
.right {
width: 51.67vw;
display: flex;
flex-direction: column;
.top {
height: 50.49vh;
background-image: url('../assets/images/bg-3.png');
background-repeat: no-repeat;
background-size: 100% 100%;
padding: 0 16px;
box-sizing: border-box;
}
.bottom {
height: 38.05vh;
margin-top: auto;
//background-image: url('../assets/images/bg-4.png');
background-image: url('../assets/images/bg-2.png');
background-repeat: no-repeat;
background-size: 100% 100%;
padding: 0 16px;
box-sizing: border-box;
.topWrp {
margin-top: 1.2vh;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
align-items: center;
.business-desc-wrap {
.business-top {
display: grid;
grid-template-columns: 50% 50%;
.business-border {
height: 14vh;
width: 23vw;
margin: 0 1vw 0.8vw;
padding: 0.4vh 1.11vw;
box-sizing: border-box;
background: #0b0e31;
.business-title {
font-weight: 400;
font-size: 12px;
color: #e8e8e8;
}
.content-wrap {
display: flex;
justify-content: space-around;
//align-items: center;
.business-content {
margin-top: 1vh;
width: 7vw;
//background: #2436b7;
border-radius: 3px;
opacity: 5;
padding: 0.5vw;
.content-title {
color: #e8e8e8;
}
.content-num {
font-weight: 700;
font-size: 20px;
line-height: 30px;
color: #6578ff;
}
}
}
}
}
}
}
}
}
</style>
<!--
* @Description: 一行两个一组
* @Author: huyue
* @Date: 2022-06-23 11:28:03
* @LastEditors: huyue
* @LastEditTime: 2022-06-24 14:57:41
-->
<template>
<div class="line-group">
<template v-for="(i, index) in items">
<div class="box" :key="index" :style="[{ height: height }, { 'margin-bottom': hideMargin ? 0 : '1vh' }]">
<slot :name="i"></slot>
</div>
</template>
</div>
</template>
<script type="text/ecmascript-6">
import datas from '../utils/data'
export default {
name: 'ViewLineGroup',
props: {
height: {
type: String,
default: datas.DefaultData.defaultLineHeight + 'vh'
},
hideMargin: Boolean
},
data() {
return {
items: [1, 2, 3]
}
},
mounted() {},
methods: {}
}
</script>
<style scoped lang="scss">
.line-group {
display: flex;
gap: 0 4px;
}
</style>
<template>
<div class="pie-group">
<template v-for="(i, index) in items">
<div class="box" :key="index">
<slot :name="i"></slot>
</div>
</template>
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: 'ViewPieGroup',
props: {},
data() {
return {
items: [1, 2, 3]
}
},
mounted() {
},
methods: {
}
}
</script>
<style scoped lang="scss">
.pie-group {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 0 8px;
.box {
height:13.05vh;
}
}
</style>
<template>
<div class="sub-title user-select">
<div class="text">{{ title }}</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'ViewSubTitle',
props: ['title'],
data() {
return {}
},
mounted() {},
methods: {}
}
</script>
<style scoped lang='scss'>
.sub-title {
width:11.88vw;
height: 2.93vh;
font-size: 12px;
margin-top: 8px;
margin-left:-12px;
background-image: url('../assets/images/title.png');
background-repeat: no-repeat;
background-size: 100% 100%;
.text {
color: #ffffff;
-webkit-background-clip: text;
margin-left: 2.36vw;
line-height: 2.93vh ;
}
}
</style>
\ No newline at end of file
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 10:58:34
* @FilePath: \dj-data-view\src\components\ViewSurface.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class='surface box' :class="isEqually?'whetherToDivideEqually':''">
<div class='title title-icon'>
<!-- <span class='icon'></span>-->
<div class='title-h3' v-if='title'>{{ title }}</div>
<span class='merchantName' v-if='merchantName'>{{ merchantName }}</span>
<!-- <div class='go'>-->
<!-- <img src='@/assets/images/go.png' />-->
<!-- </div>-->
<SelectCpn
v-if='showSeletion'
:selectName="'业务:'"
:selectArr='businessList'
:selectType="'springbudAtion'"></SelectCpn>
<div
v-if='isMonthDay'
class='month-day-wrap'
v-for='(item,index) in monthDayList' :key='index'
@click='changeMonthDay(item,index)'>
<div class='form' :class="currentIndex==index? 'light':''">{{ item.label }}</div>
</div>
</div>
<div class='line-chart'>
<line-bar :domId='domId' :isDatazoom='isDatazoom' :boxHeight='boxHeight' :dataList='dataList'></line-bar>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import SelectCpn from 'views/sassPlus/componts/selectCpn'
export default {
name: 'ViewSurface',
components: {
SelectCpn
},
props: {
title: {
type: String,
default: ''
},
isMonthDay: {
type: Boolean,
default: false
},
isDatazoom: {
type: Boolean,
default: false
},
showSeletion: {
type: Boolean,
default: false
},
isEqually: {
type: Boolean,
default: true
},
merchantName: {
type: String,
default: ''
},
boxHeight: {
type: String,
// default: '19.5vh'
default: '20vh'
},
dataList: {
type: Array,
default: () => []
},
domId: {
type: String,
default: ''
}
},
data() {
return {
businessList: [
{ label: '1.1转换+', value: 'transwork' },
{ label: '1.2膨胀金', value: 'expandedgold' },
{ label: '1.3众筹', value: 'crowdfunding' },
{ label: '2.1车损无忧', value: 'noworries' }
],
monthDayList: [{
label: '日表', value: 1
}, {
label: '月表', value: 0
}],
currentIndex: 0
}
},
mounted() {
},
methods: {
changeMonthDay(item, index) {
this.currentIndex = index
this.$bus.$emit('monthDayEvent', { queryItem: item.value })
}
}
}
</script>
<style scoped lang='scss'>
.whetherToDivideEqually {
height: 21.46vh;
width: calc(50% - 0.5vw);
height: calc(50% - 0.5vw);
}
.surface {
//height: 21.46vh;
margin-bottom: 0.98vh;
border: 2px solid black;
border-radius: 5px;
box-sizing: border-box;
//width: calc(50% - 5px);
//height: calc(50% - 5px);
.title {
//margin-bottom: 0.5vh;
.go {
margin-left: 0.2vw;
}
.merchantName {
margin-left: 0.5vw;
}
.month-day-wrap {
margin-left: 1vw;
display: flex;
width: 4.4vw;
justify-content: space-between;
align-items: center;
.form {
width: 100%;
border-radius: 3px;
text-align: center;
padding: 0.1vw;
}
.light {
background: #2436b7;
}
}
}
//.line-chart{
// padding-left: 2vw;
//}
}
</style>
<template>
<div class='tabs flex box'>
<div class='tab' v-for='item in tabs' :key='item.key'>
<div class='tab-title'>{{ item.title }}</div>
<div v-if="item.key != 'retention'" class='tab-text text-linear'>{{ numAddSymbol(dataList[item.key]) }}</div>
<div v-else class='tab-text text-linear'>{{ toFixNum(dataList[item.key]) }}</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import * as echarts from 'echarts'
export default {
name: 'ViewTabs',
data() {
return {
dataList: {},
tabs: [
{
title: '总门店数',
key: 'totalNum'
},
{
title: '当年新增',
key: 'incrNum'
},
{
title: '留存率',
key: 'retention'
}
// {
// title: '单店产值',
// key: 'outputValue'
// }
]
}
},
created() {
this.getEnterpriseOverview()
},
methods: {
toFixNum(val) {
return (val * 100).toFixed(1) + '%'
},
getEnterpriseOverview() {
this.api.customer.getEnterpriseOverview().then(res => {
if (res.code == 0) {
this.dataList = res.data.dataList[0]
}
})
}
}
}
</script>
<style scoped lang='scss'>
.tabs {
margin: 0.98vh 0 0.98vh 0;
padding: 20px 1.67vw;
height: 6.95vh;
width: 100%;
box-sizing: border-box;
justify-content: space-between;
.tab {
// padding: 2vh 0;
.tab-title {
font-weight: 400;
font-size: 12px;
color: #e8e8e8;
}
.tab-text {
font-weight: 700;
font-size: 24px;
line-height: 30px;
}
}
}
</style>
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-02-28 14:16:52
* @FilePath: \dj-data-view\src\components\ViewTitle.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div>
<div class='content flex'>
<div class='logo user-select'>
<img style='height: 3.17vh' src='@/assets/images/logo.png' alt='logo' />
</div>
<div class='view-title user-select' @click='changeTitles(title)'>{{ title }}</div>
<div class='time'>
<div class='top flex'>
<img src='@/assets/images/time.png' class='icon' />
<div class='now'>{{ now }}</div>
</div>
</div>
</div>
<div class='title-tab-wrap'>
<div class='circle-object' :class="titleClick?'anim-object':''" @click="goPage('/springbudAtion')">春蕾行动</div>
<div class='circle-object' :class="titleClick?'anim-object':''" @click="goPage('/sassPlus')">SASS+</div>
<div class='circle-object' :class="titleClick?'anim-object':''" @click="goPage('/equity')">会员权益</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import data from 'utils/data'
export default {
name: 'ViewTitle',
props: {
title: {
type: String,
default: ''
}
},
data() {
return {
// now: new Date().format('yyyy-MM-dd hh:mm:ss')
now: '',
titleClick: false
}
},
mounted() {
this.timer()
this.$bus.$on('hideEvent', data =>{
this.titleClick = false
})
},
methods: {
timer() {
// setInterval(() => {
// this.now = new Date().format('yyyy-MM-dd hh:mm:ss')
// }, 1e3)
this.api.springbudAtion.getUpdateTime().then(res => {
if (res.code == 0) {
this.now = res.data.dataList[0].updatetime
}
})
},
changeTitles() {
this.titleClick = !this.titleClick
},
goPage(val) {
this.$router.push(val)
this.titleClick = false
},
}
}
</script>
<style scoped lang='scss'>
.content {
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 0 42px 0 76px;
justify-content: space-between;
.view-title {
font-weight: 600;
font-size: 24px;
color: #ffffff;
letter-spacing: 8px;
text-align: center;
}
.time {
text-align: right;
font-size: 14px;
color: #ffffff;
.top {
justify-content: flex-end;
.now {
min-width: 9.3vw;
}
}
.icon {
width: 14px;
height: 14px;
margin-right: 8px;
}
}
}
.title-tab-wrap {
display: flex;
//justify-content: center;
width: 50vw;
margin: 0 auto;
.circle-object {
background: #2436b7;
width: 4vw;
height: 4vw;
text-align: center;
margin: 0 auto;
line-height: 4vw;
border-radius: 50%;
//overflow: hidden;
display: none;
}
.anim-object {
display: block;
position: relative;
z-index: 905;
transform-style: preserve-3d;
animation: bounce-in-top 1.1s ease 0s 1 normal both running;
}
@keyframes bounce-in-top {
0% {
transform: scale(0);
}
50% {
transform: scale(1.5);
}
100% {
transform: scale(1);
}
}
}
</style>
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:43:46
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-31 17:25:12
* @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>
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
},
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 } = this
console.log(this.analysisList)
const obj = {
rotate,
analysisList,
ValueAnalysis
}
this.lineOptions = this.revese ? getBarReverseOptions(obj) : getBarOptions(obj)
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)
)
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)
}
}
}
</script>
<style lang="scss" scoped>
.line-box {
height: 100%;
color: #ffffff;
.txt-orange {
color: #eb6001;
}
.line-chart {
width: 100%;
}
}
</style>
<template>
<div>
<div class='component'>
<div class='titles'>
<!-- <span>展业时间</span>-->
<!-- <span>业务</span>-->
<span>门店号</span>
<span>门店名称</span>
<span>订单数</span>
<span>订单金额</span>
</div>
<div
ref='forwardScrollBox'
class='list_dv'
@mouseenter='mouseenter'
@mouseleave='mouseleave'
>
<div ref='forwardContent' class='scroll_dv'>
<div v-for='(item, index) in boxList' :key='index' class='list_item dfac'>
<!-- @click='selectData(item)'-->
<div
class='dataList'
:class="currentIndex === index? 'selectMerchant' : ''"
@mouseleave="currentIndex = ''"
@mouseenter='mouseenterList(item,index)'>
<!-- <div>{{ item.date }}</div>-->
<!-- <div>-->
<!-- {{ item.businessName == '1.1' ? '1.1转化+'-->
<!-- : item.businessName == '1.2' ? '1.2膨胀金' :-->
<!-- item.businessName == '1.3' ? '1.3众筹'-->
<!-- : item.businessName == '2.1' ? '2.1车损无忧' : '' }}-->
<!-- </div>-->
<div>{{ item.merchantId }}</div>
<div>{{ item.merchantName }}</div>
<div>{{ item.orderNum }}</div>
<div>{{ item.orderPrice }}</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'boxChart',
components: {},
props: {},
data() {
return {
totalCount: 10000, // 总数
scrollContentHeight: 0, // 滚动内容的高度
scrollBoxHeight: 0, // 滚动父级盒子的高度
scrollableHeight: 0, // 可以滚动的高度
scrollTop: 0, // 元素已经滚动的高度
timer2: null, // 定时器
boxList: [],
currentIndex: ''
}
},
computed: {},
watch: {},
created() {
},
async mounted() {
await this.getList()
// this.$nextTick(() => {
// 窗口大小变化时,重新获取滚动相关元素的高度
// setTimeout(() => {
// window.onresize = this.regainHeight()
// })
// 监听元素滚动事件
// this.$refs.forwardScrollBox.addEventListener('scroll', this.handleScroll, true)
// })
},
destroyed() {
// 离开时销毁定时器
clearInterval(this.timer2)
},
methods: {
getList() {
this.api.springbudAtion.getMerchantNumTrend().then(res => {
if (res.code == 0) {
this.boxList = res.data.dataList
// this.initThirtyDays({
// queryItem: 'transwork'
// })
this.$nextTick(() => {
this.regainHeight()
})
}
})
},
mouseenterList(item, index) {
this.currentIndex = index
},
// 页面第一次进入或者窗口大小变化时,获取滚动相关元素的高度
regainHeight() {
// 获取需要滚动元素的真实高度
this.scrollContentHeight = this.$refs.forwardContent.getBoundingClientRect().height
// 获取限制高度滚动容器的真实高度
this.scrollBoxHeight = this.$refs.forwardScrollBox.getBoundingClientRect().height
// 可以滚动的高度
this.scrollableHeight = this.scrollContentHeight - this.scrollBoxHeight
console.log('内容高度', this.scrollContentHeight, '盒子高度', this.scrollBoxHeight, '可以滚动的高度', this.scrollableHeight)
this.autoScroll()
},
// 自动滚动
autoScroll() {
this.timer2 = setInterval(() => {
if (this.scrollableHeight >= this.scrollTop) {
// 当为滚动到结尾时滚动
this.scrollTop = this.$refs.forwardScrollBox.scrollTop += 2
} else {
// 滚动结束,清除当前定时器,scrollTop重置为0,继续滚动
this.scrollTop = this.$refs.forwardScrollBox.scrollTop = 0
clearInterval(this.timer2)
this.autoScroll()
}
}, 100)
},
// 鼠标移入时停止滚动
mouseenter() {
clearInterval(this.timer2)
},
// 鼠标移开继续滚动
mouseleave() {
this.autoScroll()
},
// 滚动元素滚动时的方法
handleScroll(e) {
console.log(e.target.scrollTop)
}
// initThirtyDays(params, businessName = 'transwork', merchantName = '') {
// this.api.springbudAtion.getEveryMerMonthlyTrend(params).then(res => {
// if (res.code == 0) {
// let thirtyDaysList = res.data.dataList
//
// this.$bus.$emit('thirtyDays', { thirtyDaysList, businessName, merchantName })
// }
// })
// },
// selectData(item) {
// businessName, merchantId, merchantName
// const { merchantId } = item
// this.$bus.$emit('storeDetails', { merchantId })
// switch (businessName) {
// case '1.1':
// businessName = 'transwork'
// break
// case '1.2':
// businessName = 'expandedgold'
// break
// case '1.3':
// businessName = 'crowdfunding'
// break
// case '2.1':
// businessName = 'noworries'
// break
// }
// const params = {
// merchantId,
// queryItem: businessName
// }
// this.$bus.$emit('getMerchantTime', { merchantId, businessName })
// this.initThirtyDays(params, businessName, merchantName)
// }
}
}
</script>
<style lang='scss' scoped>
.component {
padding: 1vw 0;
font-family: Source Han Sans CN, Source Han Sans CN-Regular;
letter-spacing: 0.1vw;
.titles {
//display: flex;
//justify-content: space-between;
display: grid;
//padding: 0 1vw;
grid-template-columns: 18% 46% 16% 20%;
font-size: 0.833vw;
}
.list_dv::-webkit-scrollbar {
display: none;
}
.list_dv {
//padding: 0 1vw;
width: 100%;
height: 100%;
overflow-y: auto;
font-size: 0.2vw;
color: #d4eaf6;
.list_item {
width: 100%;
height: 3vh;
line-height: 3vh;;
//height: 26px;
//margin-bottom: 1vw;
.dataList {
display: grid;
grid-template-columns: 18% 46% 16% 20%;
cursor: pointer;
//div{
// width: 100%;
// &:nth-child(2){
// width: 70px;
// }
//}
}
.selectMerchant {
background: #6578FF;
}
}
}
}
</style>
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-08 19:20:13
* @LastEditors: limin
* @LastEditTime: 2021-06-25 18:09:28
*/
import Vue from 'vue'
const componentsFiles = require.context(`./`, true, /.vue$/)
componentsFiles.keys().forEach(path => {
const component = componentsFiles(path).default
Vue.component(component.name, component)
})
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:43:46
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 11:30:04
* @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 { lineAndBarOptions, lineAndBarZoomOptions } from './options'
export default {
name: 'lineBar',
props: {
domId: {
type: String,
default: 'line-chart'
},
isDatazoom: {
type: Boolean,
default: false
},
revese: {
type: Boolean,
default: false
},
boxHeight: {
type: String,
default: '13.83vh'
},
storeOrBrandTxt: {
type: String,
default: '品牌'
},
dataList: {
type: 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: {
dataList: {
handler() {
this.lineOptions = this.isDatazoom ? lineAndBarZoomOptions(this.dataList) : lineAndBarOptions(this.dataList)
this.chartBindEvent()
},
deep: true
}
},
mounted() {
this.lineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.lineDom)
},
methods: {
chartBindEvent() {
// window.addEventListener('resize', () => {
// this[this.domId].resize()
// })
this[this.domId].setOption(this.lineOptions)
// if (this.domId === 'glLineBar' || this.domId == 'ghLineBar') (
this[this.domId].on('click', (params) => {
const month = params.name
const type = this.domId
if (this.domId === 'glLineBar') (
this.$bus.$emit('updataGLRank', { month, type })
)
if (this.domId === 'ghLineBar') (
this.$bus.$emit('updataGHRank', { month, type })
)
})
// )
}
}
}
</script>
<style lang='scss' scoped>
.line-box {
//height: 100%;
color: #ffffff;
.txt-orange {
color: #eb6001;
}
.line-chart {
width: 100%;
}
}
</style>
function getLineOptions(obj) {
const { tooltipFormatter } = obj
var lineOptions = {
tooltip: {
trigger: 'axis',
borderWidth: 0,
backgroundColor: 'rgba(68,68,68,0.80)',
textStyle: {
color: 'rgba(255,255,255,0.6)',
fontSize: '1.5px'
},
formatter: tooltipFormatter || '',
confine: true
},
grid: {
left: '3%',
right: '4%',
top: '10%',
bottom: '10%',
containLabel: true
},
xAxis: {
type: 'category',
axisLabel: {
color: '#606266',
fontSize: '0.8em'
},
data: []
},
yAxis: {
type: 'value',
splitLine: {
lineStyle: {
color: 'rgba(96,98,102,0.2)'
}
},
splitNumber: 4
},
series: [
{
type: 'line',
symbol: 'circle',
itemStyle: {
color: '#F5AA01'
},
// 平滑曲线
smooth: true,
showSymbol: false,
// 折线背景色
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: 'rgba(254, 84, 0, 0.3)'
},
{
offset: 1,
color: 'rgba(254, 84, 0, 0.01)'
}
]
}
},
data: []
}
]
}
return lineOptions
}
export default getLineOptions
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-08 16:55:43
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
const environment = process.env.VUE_APP_ENV || 'production'
let config = require('./env.' + environment)
module.exports = config
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: huyue
* @LastEditTime: 2023-02-28 14:50:10
*/
// 本地环境配置
module.exports = {
envVersion: 'trial',
title: '嘀加智慧门店',
request: {
// baseURL: 'http://192.168.3.126:8081', // 本地测试项目地址,
baseURL: 'http://192.168.1.152:8088', // 本地开发项目地址,
// baseURL: 'http://192.168.1.158:9996',
// baseURL: 'http://192.168.1.152:8081',
// baseURL: 'http://bi-view.beta.glsx.com.cn',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
response: {
data_key: 'data',
message_key: 'message',
code_key: 'code',
code_success_value: '0',
errId_logout_value: '21',
logout_function: 'reLogin',
code_message_map: {}
}
}
module.exports = {
title: '嘀加智慧门店',
request: {
// baseURL: 'http://ghwx.cgacar.com/scrm-wechat' // 生产
baseURL: 'http://bi-view.beta.glsx.com.cn' // 生产
// baseURL: 'http://cim.chinagrandauto.com' // 生产
},
APPID: 'xxx',
APPSECRET: 'xxx',
cdn: 'https://www.xxx.cn/static'
}
\ No newline at end of file
module.exports = {
title: '嘀加智慧门店',
request: {
baseURL: 'http://xxxxx' // 项目地址
},
APPID: 'xxx',
APPSECRET: 'xxx',
cdn: 'https://www.xxx.cn/static'
}
\ No newline at end of file
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-30 11:23:25
*/
// 根据环境引入不同配置 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)
}
/**测试mock */ return window.fetch('https://oss-config.dev.glsx.com.cn/mock/6352681802322627d6b83e8c/dj-data-view/config', {}).then(res => res.json())
// return window.fetch('https://oss-config.test.glsx.com.cn/mock/62cbf569f5137cf37678b828/data-view/config', {}).then(res => res.json())
}
export const cfg = {
install(vue, config) {
vue.prototype.$config = config
}
}
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-26 16:57:27
*/
// 兼容 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 App from './App.vue'
import router from './router'
import store from './store'
import api from './api'
import Request from './api/request'
import { fetchConfig, cfg } from '@/config'
import '@/assets/css/index.scss'
import './utils/util'
import 'components'
import * as echarts from 'echarts'
import dialog from './plugins/dialog'
import Bus from '../src/bus' //这是我的路径,正确引用你们的路径
Vue.prototype.$bus = Bus
Vue.prototype.$echarts = echarts
Vue.prototype.to = function (name, params) {
if (name === -1) {
router.go(-1)
return
}
router.push({ name, params })
}
// 移动端适配 rem
// import 'lib-flexible/flexible.js'
Vue.config.productionTip = false
Vue.use(dialog)
const isMock = ['prod', 'production'].includes(process.env.NODE_ENV)
fetchConfig(!isMock).then(res => {
// 从配置服务器获取动态配置
// 设置 js中可以访问 $cdn
Vue.use(cfg)
// if (res.vconsole) new VConsole()
window.$HTTP = new Request(res.request)
// window.$HTTP = new Request()
Vue.prototype.api = api
window.vm = new Vue({
el: '#app',
router,
store,
render: h => h(App)
})
})
export default {
watch: {
watchReportParams: {
immediate: true,
handler(newval) {
this && this.init && this.init(newval)
}
}
},
computed: {
watchReportParams() {
return this.$store.state.app.reportParams
}
}
}
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 09:44:37
* @FilePath: \dj-data-view\src\mixins\clientMixin.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
export default {
data() {
return {
areaData: [],
brandData: [],
storeData: []
}
},
methods: {
getClientData() {
console.log(22)
this.api.customer.getEnterpriseDistribution().then(res => {
if (res.code == 0) {
res.data.dataList.forEach(item => {
if (item.queryitem == '区域排名') this.areaData = item.rankDistributions
if (item.queryitem == '品牌分布') this.brandData = item.rankDistributions
if (item.queryitem == '门店类型') this.storeData = item.rankDistributions
this.$bus.$emit('clientData', {
areaData: this.areaData,
brandData: this.brandData,
storeData: this.storeData
})
})
}
})
}
}
}
import changeMixin from './changeMixin'
import clientMixin from './clientMixin'
import salesMixin from './salesMixin'
import userMixin from './userMixin'
export {
changeMixin,
clientMixin,
salesMixin,
userMixin
}
\ No newline at end of file
import { changeMixin } from './index'
export default {
data() {
return {
salesData: [],
brandList: [],
typeRanking: '',
isBrand: false,
brandName: ''
}
},
mixins: [changeMixin],
created() {
// this.getSalesData()
},
methods: {
getSalesData() {
let salesApi = !this.isBrand ? 'getSales' : 'getMerchantSales'
const params = {
req: {
queryItem: this.type,
queryTime: this.getCurrentDate(),
queryType: this.watchReportParams.reportType
}
}
if (this.isBrand) params.req.brandName = this.brandName
this.api.sales[salesApi](params).then(res => {
this.salesData = []
this.typeRanking = ''
this.brandList = []
if (res.data.dataList.length > 0) {
let typeNum = JSON.parse(res.data.dataList[0].typeNum)
Object.keys(typeNum).forEach((item, index) => {
this.salesData.push({
name: item,
value: typeNum[item]
})
})
this.typeRanking = JSON.parse(res.data.dataList[0].typeRanking)
}
})
},
init(newVal) {
this.isBrand = false
if (newVal.brand) {
this.isBrand = true
this.brandName = newVal.brand.name
}
this.getSalesData()
},
pieAction(data) {
this.brandList = []
let array = this.typeRanking && this.typeRanking[data.name]
if (array&&array.length > 0) {
for (let i of array) {
this.brandList.push(i && Object.keys(i)[0])
}
}
}
}
}
export default {
data() {
return {
ageData: [],
priceData: [],
buyCarData: [],
mileageData: []
}
},
methods: {
getDistribution() {
this.api.user.getDistribution().then(res => {
if (res.code == 0) {
res.data.dataList.forEach(item => {
if (item.queryitem == '年龄') this.ageData = item.distribution
if (item.queryitem == '车价') this.priceData = item.distribution
if (item.queryitem == '购车年限') this.buyCarData = item.distribution
if (item.queryitem == '里程') this.mileageData = item.distribution
this.$bus.$emit('userData', {
ageData: this.ageData,
priceData: this.priceData,
buyCarData: this.buyCarData,
mileageData: this.mileageData
})
})
}
})
}
}
}
<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>
R=最近一次和上一次到店间隔时间
<br />
F=一年内到店频次
<br />
M=一年内售后工单金额
</div>
</div>
<div class="content-bottom bg">
<div class="title">当前逻辑</div>
<div>
6个月内(高)< R ≤ 超6个月(低) <br />
2次以内(低)≤ F <超2次(高)
<br />
3000元 (低)≤ M <超 3000元(高)
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'my-dialog',
data() {
return {
msg: '',
isShow: true
}
},
methods: {
handleBtn(index) {
if (this.btns[index].onPress) {
this.btns[index].onPress()
}
this.isShow = false
},
closeHandle() {
this.$el.parentElement.removeChild(this.$el)
}
}
}
</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 10px;
height: 2.68vh;
line-height: 2.68vh;
}
}
.content-info {
font-weight: 400;
font-size: 14px;
color: #ffffff;
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: 600;
font-size: 16px;
margin-bottom: 8px;
height: 2.68vh;
}
}
.bg {
background: #090e38;
border: 2px solid #07116f;
box-shadow: inset 0 0 20px 0 #1b008c;
}
}
</style>
\ No newline at end of file
import Dialog from './dialog';
export default {
install(Vue) {
let DialogObj=Vue.extend(Dialog);
Vue.prototype.$Dialog=function () {
// const div = document.createElement('div')
// document.body.appendChild(div)
// let DialogInit = new DialogObj().$mount(div)
let DialogInit=new DialogObj().$mount();
document.body.appendChild(DialogInit.$el);
}
}
}
\ No newline at end of file
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-09 17:11:43
*/
import router from './router'
import { keeps } from './routes'
export const keepAlives = keeps
export default router
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-09 10:59:50
* @LastEditors: limin
* @LastEditTime: 2021-06-29 14:51:39
*/
import Vue from 'vue'
import Router from 'vue-router'
import routes from './routes'
// hack router push callback
const originalPush = Router.prototype.push
Router.prototype.push = function push (location, onResolve, onReject) {
if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
return originalPush.call(this, location).catch(err => err)
}
Vue.use(Router)
const router = createRouter()
function createRouter () {
return new Router({
// mode: 'history', // 如果是 history模式 需要配置vue.config.js publicPath
base: process.env.BASE_URL,
scrollBehavior: function (to, from, savedPosition) {
return savedPosition || { x: 0, y: 0 }
},
routes
})
}
// http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-main/
router.beforeEach((to, from, next) => {
next()
})
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter () {
const newRouter = createRouter()
router.matcher = newRouter.matcher // reset router
}
export default router
\ No newline at end of file
const pages = [
{
name: 'home',
meta: {
isTab: true,
keepAlive: true,
backgroundColor: '#F7F7F7'
},
children: []
},
{
name: 'springbudAtion',
meta: {
isTab: true,
keepAlive: true,
backgroundColor: '#F7F7F7'
},
children: []
},
{
name: 'equity',
meta: {
// isTab: true,
keepAlive: true,
backgroundColor: '#F7F7F7'
},
children: []
},
{
name: 'sassPlus',
meta: {
// isTab: true,
keepAlive: true,
backgroundColor: '#F7F7F7'
},
children: []
},
]
const keepAlives = []
const setChildren = (e, parent) => {
let arr = []
e.children.map(child => {
const { children, meta } = child
let url = `${parent}/${child.name}`
let name = url.replace(/\//g, '.')
let route = {
path: `/${url}`,
name,
meta: meta || {},
component: resolve => require([`views/${url}.vue`], resolve)
}
if (meta && meta.keepAlive) keepAlives.push(name)
if (children) route.children = setChildren(child, url)
arr.push(route)
})
return arr
}
const getPages = _ => {
let router = {
path: '/',
name: 'springbudAtion',
redirect: '/springbudAtion',
component: resolve => require([`views/home.vue`], resolve)
}
router.children = pages.map(e => {
let name = `${e.name}`
let route = {
path: `/${name}`,
name,
meta: e.meta || {},
component: resolve => require([`views/${name}/index.vue`], resolve)
}
if (e.children) route.children = setChildren(e, name)
if (e.meta && e.meta.keepAlive) keepAlives.push(name)
return route
})
return [router]
}
export const keeps = keepAlives
export default getPages()
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-20 12:49:54
* @FilePath: \gh-hall\src\store\getters.js
*/
const getters = {
app: state => state.app
}
export default getters
import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import app from './modules/app'
// import createPersistedState from "vuex-persistedstate"
Vue.use(Vuex)
const store = new Vuex.Store({
modules: {
app
},
getters
// plugins: [createPersistedState({
// //指定存储模式
// storage: window.sessionStorage
// })]
})
export default store
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-07-06 12:02:21
*/
const state = {
reportParams: {
reportType: 0 //月表0,日表1
}
}
const mutations = {
SET_PAGE_META (state, meta) {
state.pageMeta = meta
},
}
const actions = {
// 设置name
setUserInfo ({ commit }, user) {
commit('SET_USER_INFO', user)
},
}
export default {
state,
mutations,
actions
}
/*
* @Description: 公共数据
* @Author: huyue
* @Date: 2022-06-23 17:38:33
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-31 16:36:33
*/
const DefaultData = {
defaultLineHeight: '17.32',
defaultPieHeight: '13.05',
directionTimer: 3000,
delayTimer: 3000
}
const Customer = {
age: {
name: '年龄区间',
value: [
{ name: '未知', value: 0 },
{ name: '18~25', value: 1 },
{ name: '26~30', value: 2 },
{ name: '31~35', value: 3 },
{ name: '36~40', value: 4 },
{ name: '41~45', value: 5 },
{ name: '46~50', value: 6 },
{ name: '50+', value: 7 }
]
},
sex: {
name: '性别',
value: [
{ name: '未知', value: 0 },
{ name: '男', value: 1 },
{ name: '女', value: 2 }
]
},
carPeriod: {
name: '购车年限',
value: [
{ name: '未知', value: 0 },
{ name: '1年内', value: 0 },
{ name: '1年', value: 0 },
{ name: '2年', value: 0 },
{ name: '3年', value: 0 },
{ name: '4年', value: 0 },
{ name: '5年', value: 0 },
{ name: '5年+', value: 0 }
]
},
enterCategory: {
name: '进店类型',
value: [
{ name: '展厅客户', value: 15 },
{ name: '网电客户', value: 16 },
{ name: '其他客户', value: 17 }
]
},
infoFrom: {
name: '信息来源',
value: [
{ name: '自然进店', value: 25 },
{ name: '报纸', value: 26 },
{ name: '电台', value: 27 },
{ name: '网络', value: 28 },
{ name: '朋友介绍', value: 31 },
{ name: '广告牌', value: 32 },
{ name: '车展', value: 35 },
{ name: '其他', value: 36 }
]
},
level: {
name: '客户级别',
value: [
{ name: 'H(一周內)', value: 37 },
{ name: 'A(半个月內)', value: 38 },
{ name: 'B(1个月内)', value: 39 },
{ name: 'C(3个月内)', value: 40 },
{ name: 'N(3个月后 )', value: 41 },
{ name: 'F(战败)', value: 42 },
{ name: 'O(订车)', value: 43 }
]
},
valueType: {
name: '价值类型',
value: [
{ name: '重要价值', value: 1 },
{ name: '重要发展', value: 2 },
{ name: '重要召回', value: 3 },
{ name: '重要挽留', value: 4 },
{ name: '一般价值', value: 5 },
{ name: '一般发展', value: 6 },
{ name: '一般召回', value: 7 },
{ name: '一般挽留', value: 8 }
]
}
}
export default Object.freeze({
DefaultData,
Customer
})
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-20 12:49:11
*/
import util from './util'
export { util }
\ No newline at end of file
import Vue from 'vue'
import { Toast, Dialog } from 'vant'
/**
* 日期格式化
* let time = new Date().format('yyyy-MM-dd hh:mm:ss')
*/
Date.prototype.format = function(fmt) {
let o = {
'M+': this.getMonth() + 1, //月份
'd+': this.getDate(), //日
'h+': this.getHours(), //小时
'm+': this.getMinutes(), //分
's+': this.getSeconds(), //秒
//季度
'q+': Math.floor((this.getMonth() + 3) / 3),
S: this.getMilliseconds() //毫秒
}
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
}
for (let k in o) {
if (new RegExp(`(${k})`).test(fmt)) {
fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length))
}
}
return fmt
}
const throttle = (fn, gapTime) => {
if (gapTime == null || gapTime == undefined) {
gapTime = 1500
}
let _lastTime = null
return function() {
let _nowTime = +new Date()
if (_nowTime - _lastTime > gapTime || !_lastTime) {
fn.apply(this, arguments)
_lastTime = _nowTime
}
}
}
/**num:要转换的数值,fixed:精确几位小数 */
const decimal = (num, fixed) => {
let pow = Math.pow(10, fixed)
return Math.round(num * pow) / pow
}
const toTop = () => {
let bodySrcollTop = document.body.scrollTop
if (bodySrcollTop !== 0) {
document.body.scrollTop = 0
return
}
let docSrcollTop = document.documentElement.scrollTop
if (docSrcollTop !== 0) {
document.documentElement.scrollTop = 0
}
}
const getParams = () => {
return window.vm.$route.params
}
const getQuery = name => {
let [url, paramsList] = window.location.href.split('?')
if (!paramsList) return name ? null : {}
let param = paramsList.split('&')
let obj = {}
param.map(e => {
let [key, value] = e.split('=')
obj[key] = value
})
return name ? obj[name] : obj
}
/** 三个数字加一个逗号 */
const numAddSymbol = val => {
return val ? (val + '').replace(/\B(?=(?:\d{3})+\b)/g, ',') : 0
}
// 获取当前时间
const getCurrentDate = (fmt = 'yyyy-MM-dd') => {
return new Date().format(fmt)
}
/** 获取前/后n天
* 负数:今天前n天
* 正数:今天后n天
*/
const getNDate = (n, fmt = 'yyyy-MM-dd') => {
return new Date(new Date().setDate(new Date().getDate() + n)).format(fmt)
}
/** 获取前/后n月
* 负数:今天前n月
* 正数:今天后n月
*/
const getNMonth = (n, fmt = 'yyyy-MM-dd') => {
return new Date(new Date().setMonth(new Date().getMonth() + n)).format(fmt)
}
const debounce = function(func, wait = 200) {
let timeout
return function(event) {
clearTimeout(timeout)
timeout = setTimeout(() => {
func.call(this, event)
}, wait)
}
}
const setChartFontSize = fontSize => {
let clientWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
if (!clientWidth) return fontSize
return (fontSize * clientWidth) / 1440
}
const deepClone = obj => {
// Handle the 3 simple types, and null or undefined or function
if (obj == null || typeof obj !== 'object') return obj
// Handle Date
if (obj instanceof Date) {
const copy = new Date()
copy.setTime(obj.getTime())
return copy
}
// Handle Array or Object
if ((obj instanceof Array) | (obj instanceof Object)) {
const copy = obj instanceof Array ? [] : {}
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) {
copy[attr] = deepClone(obj[attr])
}
}
return copy
}
throw new Error('Unable to clone obj! Its type isn\'t supported.')
}
const utils = {
getParams,
getQuery,
throttle,
decimal,
toTop,
numAddSymbol,
getCurrentDate,
getNDate,
getNMonth,
debounce,
setChartFontSize,
deepClone
}
Object.keys(utils).map(key => {
Vue.prototype[key] = utils[key]
})
export default utils
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-26 17:13:06
* @FilePath: \dj-data-view\src\views\customer\area.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div>
<div class="title title-icon">
<span class="icon"></span>
<span>区域分布</span>
</div>
<div class="container flex">
<pie-chart :id="chart.id" :list="areaData" :keys="chart.keys"></pie-chart>
<Legend :list="areaData"></Legend>
</div>
</div>
</template>
<script>
export default {
name: 'Area',
data() {
return {
chart: {
id: 'area',
keys: ['name', 'num']
},
areaData: []
}
},
created() {
this.$bus.$on('clientData', data => {
this.areaData = data.areaData
})
}
}
</script>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!