Commit 3f514a39 by 胡悦

init

1 parent a965c5be
Showing 227 changed files with 4866 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"
}
File mode changed
// 获取 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": "glsk-data-view-scene",
"version": "1.0.0",
"description": "glsk-data-view-scene for BI",
"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",
"element-ui": "^2.15.13",
"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"
}
}
<!--
* @Description:
* @Author: huyue
* @Date: 2023-07-04 11:48:53
* @LastEditors: huyue
* @LastEditTime: 2023-07-04 11:49:00
-->
<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: 2023-07-13 15:06:41
*/
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
// 总 - 获取门店总产值、客单价、转化率排行
const getAllMerchantRank = params => {
return window.$HTTP.get('upgrade/getAllMerchantRank', params)
}
// 总 - 获取业务开始事件、总门店数等
const getAllOverview = params => {
return window.$HTTP.get('upgrade/getAllOverview', params)
}
// 总 - 获取门店员工业绩、客单价、转化率排行
const getAllStaffRank = params => {
return window.$HTTP.get('upgrade/getAllStaffRank', params)
}
// 总 - 获取门店的总产值、客单价、转化率趋势
const getAllTrend = params => {
return window.$HTTP.get('upgrade/getAllTrend', params)
}
// 单 - 获取门店列表
const getMerchant = params => {
return window.$HTTP.get('upgrade/getMerchant', params)
}
// 单 - 获取门店商品销售排行
const getMerchantGoodsRank = params => {
return window.$HTTP.get('upgrade/getMerchantGoodsRank', params)
}
// 单 - 获取门店的总展业时间&最近订单时间、总产值&本月产值等
const getMerchantOverview = params => {
return window.$HTTP.get('upgrade/getMerchantOverview', params)
}
// 单 - 获取门店支付方式占比
const getMerchantPay = params => {
return window.$HTTP.get('upgrade/getMerchantPay', params)
}
// 单 - 获取门店商品供应方占比
const getMerchantSupply = params => {
return window.$HTTP.get('upgrade/getMerchantSupply', params)
}
// 单 - 获取门店产值、客单价、转化率趋势
const getMerchantTrend = params => {
return window.$HTTP.get('upgrade/getMerchantTrend', params)
}
// 总 - 获取区域门店数据
const getRegionMerchant = params => {
return window.$HTTP.get('upgrade/getRegionMerchant', params)
}
// 总 - 获取春雷行动业务趋势
const getSpringbudTrend = params => {
return window.$HTTP.get('upgrade/getSpringbudTrend', params)
}
// 总 - 获取年份
const getYears = params => {
return window.$HTTP.get('upgrade/getYears', params)
}
// 总体----获取上月新增门店
const getIncreMerchant = params => {
return window.$HTTP.get('upgrade/getIncreMerchant', params)
}
// 总体----获取新增门店趋势
const getIncreMerchantTrend = params => {
return window.$HTTP.get('upgrade/getIncreMerchantTrend', params)
}
export default {
getAllMerchantRank,
getAllOverview,
getAllStaffRank,
getAllTrend,
getMerchant,
getMerchantGoodsRank,
getMerchantOverview,
getMerchantPay,
getMerchantSupply,
getMerchantTrend,
getRegionMerchant,
getSpringbudTrend,
getYears,
getIncreMerchant,
getIncreMerchantTrend
}
// 单店----获取门店的活动明细数据
const getActivityDetail = params => {
return window.$HTTP.get('crowdFunding/getActivityDetail', params)
}
// 总体(广联维度)----获取近一年活动趋势
const getActivityTrend = params => {
return window.$HTTP.get('crowdFunding/getActivityTrend', params)
}
// 总体----获取总产值、总场次、总订单数
const getAllOverview = params => {
return window.$HTTP.get('crowdFunding/getAllOverview', params)
}
// 总体(品牌品类维度)----获取各品牌下各品牌的 场次、产值 、平均转化率 、平均退单率排名
const getBrandRank = params => {
return window.$HTTP.get('crowdFunding/getBrandRank', params)
}
// 总体(广联维度)----获取所有门店总览:总场次、进行中场次、已完成场次、产值、订单数、转换率、退单率
const getGLOverview = params => {
return window.$HTTP.get('crowdFunding/getGLOverview', params)
}
// 单店----获取门店列表
const getMerchant = params => {
return window.$HTTP.get('crowdFunding/getMerchant', params)
}
// 总体(广联维度)----获取近一年门店活动排名
const getMerchantActivityRank = params => {
return window.$HTTP.get('crowdFunding/getMerchantActivityRank', params)
}
// 单店----获取门店的总产值(周同比&日环比)、总场次、平均客单价、平均转化率、平均退单率
const getMerchantOverview = params => {
return window.$HTTP.get('crowdFunding/getMerchantOverview', params)
}
// 总体(广联维度)----获取 产值、转换率、退单率 门店排名
const getMerchantRank = params => {
return window.$HTTP.get('crowdFunding/getMerchantRank', params)
}
// 总体----获取月份
const getMonth = params => {
return window.$HTTP.get('crowdFunding/getMonth', params)
}
// 总体(广联维度)----获取 总场次、进行中、已完成的支付方式占比
const getPaymentModel = params => {
return window.$HTTP.get('crowdFunding/getPaymentModel', params)
}
export default {
getActivityDetail,
getActivityTrend,
getAllOverview,
getBrandRank,
getGLOverview,
getMerchant,
getMerchantActivityRank,
getMerchantOverview,
getMerchantRank,
getMonth,
getPaymentModel
}
// 驻店零售权益----获取总产值(周同比&日环比)、推荐量、成交量(周同比&日环比)、转化率、客单价
const getRetailOverview = params => {
return window.$HTTP.get('member/getRetailOverview', params)
}
// 驻店零售权益----获取产值、转换率、客单价门店排名
const getRetailRank = params => {
return window.$HTTP.get('member/getRetailRank', params)
}
// 驻店零售权益----获取产值、订单量趋势
const getRetailTrend = params => {
return window.$HTTP.get('member/getRetailTrend', params)
}
// 驻店零售权益----获取年份和区域
const getRetailYearsArea = params => {
return window.$HTTP.get('member/getRetailYearsArea', params)
}
// 批发销售权益----获取提单门店、提单量占比
const getWholesaleNum = params => {
return window.$HTTP.get('member/getWholesaleNum', params)
}
// 批发销售权益----获取广汇/非广汇提单门店排名
const getWholesaleRank = params => {
return window.$HTTP.get('member/getWholesaleRank', params)
}
// 批发销售权益----获取广汇/非广汇提单门店、提单量趋势
const getWholesaleTrend = params => {
return window.$HTTP.get('member/getWholesaleTrend', params)
}
// 批发销售权益----获取年份
const getWholesaleYears = params => {
return window.$HTTP.get('member/getWholesaleYears', params)
}
// 延保权益----获取总产值(周同比&日环比)、推荐量、成交量(周同比&日环比)、转化率、客单价
const getExtendinsurOverview = params => {
return window.$HTTP.get('member/getExtendinsurOverview', params)
}
// 延保权益----获取产值、转换率、客单价门店排名
const getExtendinsurRank = params => {
return window.$HTTP.get('member/getExtendinsurRank', params)
}
// 延保权益----获取产值、订单量趋势
const getExtendinsurTrend = params => {
return window.$HTTP.get('member/getExtendinsurTrend', params)
}
// 延保权益----获取年份和区域
const getExtendinsurYearsArea = params => {
return window.$HTTP.get('member/getExtendinsurYearsArea', params)
}
// 批发销售权益----获取营业门店、停业门店占比
const getWholesaleOpenCloseNum = params => {
return window.$HTTP.get('member/getWholesaleOpenCloseNum', params)
}
export default {
getRetailOverview,
getRetailRank,
getRetailTrend,
getRetailYearsArea,
getWholesaleNum,
getWholesaleRank,
getWholesaleTrend,
getWholesaleYears,
getExtendinsurOverview,
getExtendinsurRank,
getExtendinsurTrend,
getExtendinsurYearsArea,
getWholesaleOpenCloseNum
}
// 总览数据:核心指标、数字化连接、数字化管理(线索服务/会员权益/虎哥E盾)、数字化营销(1.1精品升级/1.3售后众筹)
const getAllOverview = params => {
return window.$HTTP.get('inner/getAllOverview', params)
}
// 核心指标:门店活跃统计
const getCoreActiveMerchant = params => {
return window.$HTTP.get('inner/getCoreActiveMerchant', params)
}
// 核心指标:SAAS门店留存率
const getCoreRetention = params => {
return window.$HTTP.get('inner/getCoreRetention', params)
}
// 数字化链接:成品设备激活趋势
const getLinkFinishedProductTrend = params => {
return window.$HTTP.get('inner/getLinkFinishedProductTrend', params)
}
// 数字化管理(线索服务):设备订阅数量和线索相关性分析
const getManageClueAnalysis = params => {
return window.$HTTP.get('inner/getManageClueAnalysis', {})
}
// 数字化管理(线索服务):按年统计销售金额的合理性
const getManageClueSalesAmountRationality = params => {
return window.$HTTP.get('inner/getManageClueSalesAmountRationality', params)
}
// 数字化管理(线索服务):注册门店趋势 && 活跃门店势 && 月收入趋势 && 销售渠道趋势
const getManageClueTrend = params => {
return window.$HTTP.get('inner/getManageClueTrend', {})
}
// 数字化管理(虎哥E盾):按年统计客户销售金额的合理性
const getManageESalesAmountRationality = params => {
return window.$HTTP.get('inner/getManageESalesAmountRationality', params)
}
// 数字化管理(虎哥E盾):月收入趋势
const getManageETrend = params => {
return window.$HTTP.get('inner/getManageETrend', params)
}
// 数字化管理(会员权益):按年统计客户销售金额的合理性
const getManageMemberSalesAmountRationality = params => {
return window.$HTTP.get('inner/getManageMemberSalesAmountRationality', params)
}
// 数字化管理(会员权益):月收入趋势
const getManageMemberTrend = params => {
return window.$HTTP.get('inner/getManageMemberTrend', params)
}
// 数字化营销(1.3售后众筹): 活动订单分布
const getMarketingCrowdFundingActivityDistr = params => {
return window.$HTTP.get('inner/getMarketingCrowdFundingActivityDistr', params)
}
// 数字化营销(1.3售后众筹):活动订单金额分布
const getMarketingCrowdFundingActivityMoneyDistr = params => {
return window.$HTTP.get('inner/getMarketingCrowdFundingActivityMoneyDistr', params)
}
// 数字化营销(1.3售后众筹):门店订单分布
const getMarketingCrowdFundingMerDistr = params => {
return window.$HTTP.get('inner/getMarketingCrowdFundingMerDistr', params)
}
// 数字化营销(1.3售后众筹):活动趋势 && 订单趋势 && 客单价趋势
const getMarketingCrowdFundingTrend = params => {
return window.$HTTP.get('inner/getMarketingCrowdFundingTrend', params)
}
// 数字化营销(1.1精品升级):门店订单金额分布 && 门店订单量分布
const getMarketingDistribution = params => {
return window.$HTTP.get('inner/getMarketingDistribution', params)
}
// 数字化营销(1.1精品升级):注册门店/活跃门店/月订单量收入趋势
const getMarketingTrend = params => {
return window.$HTTP.get('inner/getMarketingTrend', params)
}
// 数字化营销(1.3售后众筹):门店 && 订单 && 活动 && 订单金额 分布
const getMarketingCrowdFundingDistr = params => {
return window.$HTTP.get('inner/getMarketingCrowdFundingDistr', params)
}
export default {
getAllOverview,
getCoreActiveMerchant,
getCoreRetention,
getLinkFinishedProductTrend,
getManageClueAnalysis,
getManageClueSalesAmountRationality,
getManageClueTrend,
getManageESalesAmountRationality,
getManageETrend,
getManageMemberSalesAmountRationality,
getManageMemberTrend,
getMarketingCrowdFundingActivityDistr,
getMarketingCrowdFundingActivityMoneyDistr,
getMarketingCrowdFundingMerDistr,
getMarketingCrowdFundingTrend,
getMarketingDistribution,
getMarketingTrend,
getMarketingCrowdFundingDistr
}
// 运营版接口
// 企业客户总览接口---获取企业客户总览数据-区域(省份前5)/品牌(品牌前5)/门店类型分布(门店类型:豪华、合资、新能源、自主品牌)
const getEnterpriseDistribution = params => {
return window.$HTTP.get('dj/overview/getEnterpriseDistribution', params)
}
// 企业客户总览接口---获取企业客户总览数据(包括:总客户数、新增客户数、留存率、单店产值)
const getEnterpriseOverview = params => {
return window.$HTTP.get('dj/overview/getEnterpriseOverview', params)
}
// 企业客户总览接口---获取企业客户数据近12个月趋势图(包括:总客户数、新增客户数)
const getEnterpriseOverviewTrend = params => {
return window.$HTTP.get('dj/overview/getEnterpriseOverviewTrend', params)
}
// 企业客户总览接口---获取路演版本三项新的指标
const getRoadShowNewIndicators = params => {
return window.$HTTP.get('dj/overview/getRoadShowNewIndicators', params)
}
// 客户数字化业务---门店会员的权益(线索订阅门店数(累计)、线索订阅门店数(当年新增)、活跃使用门店、留存率、自店权益、数字权益、自店权益_产值、数字权益_产值)
const getMerchantMemberEquity = params => {
return window.$HTTP.get('dj/digit/getMerchantMemberEquity', params)
}
// 客户数字化业务---智慧车管线索订阅(线索订阅门店数(累计)、线索订阅门店数(当年新增)、活跃使用门店、留存率、高危点、高危报警、挽回损失)
const getSmartCarManageClueSubscription = params => {
return window.$HTTP.get('dj/digit/getSmartCarManageClueSubscription', params)
}
// 客户数字化业务---智慧门店线索订阅(线索订阅门店数(累计)、线索订阅门店数(当年新增)、活跃使用门店、留存率、到店线索、送修线索、续保线索、到店线索_产值、送修线索_产值、续保线索_产值)
const getSmartMerchantClueSubscription = params => {
return window.$HTTP.get('dj/digit/getSmartMerchantClueSubscription', params)
}
// 私域用户池总览接口---客户价值分析
const getCustomerValueAnalysis = params => {
return window.$HTTP.get('dj/private/getCustomerValueAnalysis', params)
}
// 私域用户池总览接口---客户年龄分布/车价占比/购车年限分布/里程分布
const getDistribution = params => {
return window.$HTTP.get('dj/private/getDistribution', params)
}
// 私域用户池总览接口---用户数、企微客户数、企微群数、小程序、个微客户数 趋势图
const getTrend = params => {
return window.$HTTP.get('dj/private/getTrend', params, false, true)
}
// 私域用户池总览接口---客户价值分析--品牌分布/区域分布
const getValueDistribution = params => {
return window.$HTTP.get('dj/private/getValueDistribution', params, false, true)
}
// 私域用户池总览接口---用户数:总数/当年新增,企微客户数:总数/当年新增,企微群数:总数/当年新增,小程序:总数/当年新增,个微客户数:总数/当年新增
const getoverview = params => {
return window.$HTTP.get('dj/private/getoverview', params)
}
// 营销增值服务业务接口---1.0新车权益销售、1.1新车精品升级、1.2新车线上转化、1.3存量用户众筹(累计展业门店数、当年新增、转化率、客单价、产值)
const getBusinessType = params => {
return window.$HTTP.get('dj/saasAdded/getBusinessType', params)
}
// 营销增值服务业务接口---累计展业门店数、当年新增门店数、产值_当月、产值_当年、客单价、业务品类_权益类、业务品类_膜类、业务品类_电子类
const getSaasValueaddedTransformationOverview = params => {
return window.$HTTP.get('dj/saasAdded/getSaasValueaddedTransformationOverview', params)
}
export default {
getEnterpriseDistribution,
getEnterpriseOverview,
getEnterpriseOverviewTrend,
getRoadShowNewIndicators,
getMerchantMemberEquity,
getSmartCarManageClueSubscription,
getSmartMerchantClueSubscription,
getCustomerValueAnalysis,
getDistribution,
getTrend,
getValueDistribution,
getoverview,
getBusinessType,
getSaasValueaddedTransformationOverview
}
/*
* @Description: 1.0 太阳膜接口
* @Author: huyue
* @Date: 2023-07-12 16:17:18
* @LastEditors: huyue
* @LastEditTime: 2023-07-17 10:15:45
*/
// 总 - 商品采购占比
const getAllGoodsRatio = params => {
return window.$HTTP.get('solarfilm/getAllGoodsRatio', params)
}
// 总 - 开通商户数和使用商户数 趋势
const getAllOpenBuyTrend = params => {
return window.$HTTP.get('solarfilm/getAllOpenBuyTrend', params)
}
// 总 - 获取所有门店的 总采购额(总计、本月) 、商城采购额(总计、本月) 、自采采购额(总计、本月)、开通商户数(总计、本月)、购买商户数(总计、本月)、入库使用商户数、业务时间
const getAllPurchase = params => {
return window.$HTTP.get('solarfilm/getAllPurchase', params)
}
// 总 - 商城采购额(占比)、自采采购额(占比) 趋势
const getAllPurchaseTrend = params => {
return window.$HTTP.get('solarfilm/getAllPurchaseTrend', params)
}
// 总 - 商品采购额排名
const getAllRanking = params => {
return window.$HTTP.get('solarfilm/getAllRanking', params)
}
// 单店 - 获取每个门店的商品采购占比
const getMerchantGoodsRatio = params => {
return window.$HTTP.get('solarfilm/getMerchantGoodsRatio', params)
}
// 单店 - 获取每个门店的 总采购额(总计、本月) 、商城采购额(总计、本月) 、自采采购额(总计、本月)
const getMerchantPurchase = params => {
return window.$HTTP.get('solarfilm/getMerchantPurchase', params)
}
// 单店 - 获取每个门店的商城采购额(占比)、自采采购额(占比) 趋势
const getMerchantPurchaseTrend = params => {
return window.$HTTP.get('solarfilm/getMerchantPurchaseTrend', params)
}
// 总体----获取所有门店入库使用情况
const getUsedWarehousing = params => {
return window.$HTTP.get('solarfilm/getUsedWarehousing', params)
}
// 总体----获取商品采购进度占比
const getBugProgress = params => {
return window.$HTTP.get('solarfilm/getBugProgress', params)
}
// 获取年份接口
const getYears = params => {
return window.$HTTP.get('solarfilm/getYears', params)
}
// 获取门店列表
const getMerchant = params => {
return window.$HTTP.get('solarfilm/getMerchant', params)
}
// 单店----获取每个门店的门店采购额和入库情况
const getMerchantMer = params => {
return window.$HTTP.get('solarfilm/getMerchantMer', params)
}
// 单店----获取每个门店的服务中心的采购额和入库情况
const getMerchantServiceCenter = params => {
return window.$HTTP.get('solarfilm/getMerchantServiceCenter', params)
}
export default {
getAllGoodsRatio,
getAllOpenBuyTrend,
getAllPurchase,
getAllPurchaseTrend,
getAllRanking,
getMerchantGoodsRatio,
getMerchantPurchase,
getMerchantPurchaseTrend,
getUsedWarehousing,
getBugProgress,
getYears,
getMerchant,
getMerchantMer,
getMerchantServiceCenter
}
/*
* @Description:
* @Author: huyue
* @Date: 2023-07-04 11:40:34
* @LastEditors: huyue
* @LastEditTime: 2023-07-13 17:55:25
*/
class Request {
DOMAIN = '/dev'
constructor(_request_) {
this.DOMAIN = _request_ ? _request_.baseURL : this.DOMAIN
}
get(url, params, returnAll, typeFlag) {
return this.request('GET', url, params, returnAll, typeFlag)
}
post(url, params, returnAll) {
return this.request('POST', url, params, returnAll)
}
request(method, url, params, returnAll, typeFlag) {
var requestConfig = {
headers: {
// 'Content-Type': method == 'GET' ? 'application/json' : 'application/x-www-form-urlencoded; charset=UTF-8'
'Content-Type': 'application/json'
},
method
}
var paramsArray = []
if (method === 'GET' && typeFlag) {
// var paramsArray = []
params && Object.keys(params.req).forEach(key => paramsArray.push('req.' + key + '=' + params.req[key]))
if (url.search(/\?/) === -1) {
url += '?' + paramsArray.join('&')
} else {
url += '&' + paramsArray.join('&')
}
}
if (method === 'GET' && !typeFlag) {
// var paramsArray = []
params && Object.keys(params).forEach(key => paramsArray.push(key + '=' + params[key]))
if (url.search(/\?/) === -1) {
url += '?' + paramsArray.join('&')
} 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;
}
div {
user-select: none;
}
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: #061422;
box-shadow: inset 0 0 10.42px 0 #3d57ff69;
}
.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-bg {
display: inline-block;
height: 1.71vh;
padding-left: 0.83vw;
transform: rotate(-360deg);
background-image: linear-gradient(90deg, #003F57 0%, #111056 54%, #07173500 100%);
}
}
.container {
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 {
display: inline-block;
color: #5894FF;
background-image:-webkit-linear-gradient(left,#24D8FF,#7787FF);
-webkit-background-clip:text;
-webkit-text-fill-color:transparent;
}
.user-box {
height: 9.63vh;
width:13.26vw;
background: #071735;
}
.patch-title {
position: relative;
height: 2.22vh;
color: #fff;
line-height: 2.22vh;
padding-left: 0.83vw;
font-size: 14px;
z-index: 1;
&::before {
content: '';
position: absolute;
left: 0;
width: 7.5vw;
height: 2.22vh;
background-image: linear-gradient(269deg, #5663ff00 10%, #6578ffd4 49%, #079FF1 100%);
z-index: -1;
}
}
\ No newline at end of file
No preview for this file type
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-26 16:56:49
* @LastEditors: huyue
* @LastEditTime: 2023-07-04 11:48:36
* @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
<!--
* @Description:
* @Author: huyue
* @Date: 2023-07-06 11:46:13
* @LastEditors: huyue
* @LastEditTime: 2023-07-07 18:01:41
-->
<template>
<div class="main-box">
<div class="trapezoid"> <div class="text-box">{{title}}</div></div>
</div>
</template>
<script>
export default {
name: 'BoxTitle',
props: {
title: {
type: String,
default: '标题'
}
},
data() {
return {}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.main-box {
position: relative;
background-image: url('../assets/images/title-bg.png');
background-repeat: no-repeat;
background-size: 9.04vw 3.33vh;
}
.trapezoid {
height: 3.33vh;
.text-box {
// width: 126px;
height: 3.33vh;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 14px;
color: #FFFFFF;
line-height: 3.33vh;
margin-left: 1.67vw;
}
}
</style>
<template>
<div>
<el-date-picker v-model="dateValue" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" @change="selectDate"></el-date-picker>
</div>
</template>
<script>
export default {
name: 'Calendar',
data() {
return {
dateValue: ''
}
},
mounted() {},
methods: {
selectDate(e) {
this.$emit('customerSelect', e)
}
}
}
</script>
<style lang="scss">
.el-date-editor.el-input,
.el-date-editor.el-input__inner {
width: 17.5vw;
height: 3.56vh;
line-height: 3.56vh;
border-radius: 0;
border: none;
background-image: linear-gradient(270deg, #6578ff 0%, #079ff1 100%);
}
.el-date-editor .el-range__icon,
.el-date-editor .el-range__close-icon {
line-height: 3vh;
}
.el-date-editor .el-range-input {
background: transparent;
font-size: 12px;
color: #ffffff;
line-height: 3.56vh;
}
.el-date-editor .el-range-separator {
font-size: 12px;
color: #ffffff;
line-height: 2.76vh;
}
.el-popper .popper__arrow,
.el-popper .popper__arrow::after {
border-style: none;
}
.el-picker-panel {
font-size: 14px;
color: #ffffffd9;
background: #051526;
border: 2px solid;
border-image: linear-gradient(90deg, #074989, #30dcff, #074989) 1;
border-radius: 0;
}
.el-picker-panel__icon-btn,
.el-date-table th {
color: #ffffffd9;
}
.el-date-table th {
border-bottom: none;
}
.el-date-table td.today span {
color: #5894ff;
background-image: -webkit-linear-gradient(left, #24d8ff, #7787ff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.el-date-table td.next-month,
.el-date-table td.prev-month {
color: #808080;
}
.el-date-range-picker__content.is-left {
border-right: none;
}
.el-date-range-picker__content {
padding: 0;
}
.el-date-range-picker__header {
height: 4.44vh;
line-height: 4.44vh;
padding: 0 1.11vw;
border-bottom: 2px solid;
border-image: linear-gradient(90deg, #074989, #30dcff) 1;
}
.is-right .el-date-range-picker__header {
border-image: linear-gradient(90deg, #30dcff, #074989) 1 !important;
}
.el-date-range-picker table {
border-collapse: inherit;
padding: 1.78vh 0.95vw 1.78vh 1.67vw;
}
.el-date-table td.in-range div,
.el-date-table td.in-range div:hover,
.el-date-table.is-week-mode .el-date-table__row.current div,
.el-date-table.is-week-mode .el-date-table__row:hover div {
background-color: #244888;
}
.el-date-table td.end-date span,
.el-date-table td.start-date span {
background-image: linear-gradient(270deg, #6578ff 0%, #079ff1 100%);
}
.el-date-table td.start-date div {
margin-left: 0.547vw;
}
.el-date-table td div {
height: 1.683vw;
padding: 0;
}
.el-date-table td.end-date div {
margin-right: 0.547vw;
}
</style>
<!--
* @Description:
* @Author: huyue
* @Date: 2023-07-04 17:23:09
* @LastEditors: huyue
* @LastEditTime: 2023-07-10 17:07:39
-->
<template>
<div class="mapChart">
<h2 class="title-item">{{ title }}</h2>
<div id="demo" class="midtop"></div>
</div>
</template>
<script>
import * as echarts from 'echarts'
import '@/utils/china.js'
export default {
name: 'Charts',
// mixins: [resize],
props: {
id: {
type: String,
default: ''
// required: true
},
chartData: {
type: Array,
default: () => [],
// required: true
},
title: {
type: String,
default: '',
// required: true
}
},
data() {
return {
chart: null
}
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val)
}
}
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
methods: {
initChart() {
this.chart = echarts.init(document.getElementById('demo'))
this.setOptions(this.chartData)
this.chart.on('click', function (params) {
})
},
setOptions(data = []) {
this.chart.setOption({
tooltip: {
trigger: 'item',
formatter: '{b}<br/>{c} (人)'
},
toolbox: {
show: true,
orient: 'vertical',
left: 'right',
top: 'center',
feature: {
dataView: { readOnly: false },
restore: {},
saveAsImage: {}
}
},
visualMap: {
min: 800,
max: 50000,
text: ['High', 'Low'],
realtime: false,
calculable: true,
left: '5%',
bottom: '8%',
textStyle: {
color: '#fff'
},
color: '#fff',
inRange: {
color: ['lightskyblue', 'yellow', 'orangered']
}
},
series: [
{
type: 'map',
map: 'china',
label: {
show: true,
color: 'yellow'
},
data
}
]
})
}
}
}
</script>
<style scoped lang="scss">
.mapChart {
text-align: center;
width: 100%;
font-size: 12px;
font-weight: normal;
letter-spacing: 2px;
font-weight: normal;
overflow: hidden;
}
.midtop {
width: 99%;
height: 430px;
}
</style>
<template>
<div class="date-tab-box">
<div v-for="(item, index) in dateList" :key="index" class="tab-item" :class="tabActive == index ? 'tab-item-active' : ''" @click="changeDate(index)">{{ item }}</div>
</div>
</template>
<script>
export default {
name: 'DateTab',
props: {
dateList: {
type: Array,
default: () => []
}
},
data() {
return {
tabActive: 1,
nearThreeMonth: '',
nearSixMonth: '',
nearOneYear: ''
}
},
created() {},
methods: {
changeDate(val) {
this.tabActive = val
this.$emit('changeDate', val)
}
}
}
</script>
<style lang="scss" scoped>
.date-tab-box {
display: flex;
// width: 17.62vw;
height: 3.56vh;
border: 2px solid;
border-image: linear-gradient(90deg, #074989, #30dcff, #074989) 1;
padding: 0.28vh;
box-sizing: border-box;
.tab-item {
font-weight: 400;
font-size: 12px;
color: #c9c9c9;
height: 2.67vh;
line-height: 2.67vh;
padding: 0 0.83vw;
}
.tab-item-active {
font-weight: 600;
color: #ffffff;
background: #244888;
}
}
</style>
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-08-24 15:52:39
* @FilePath: \dj-data-view\src\components\ViewTitle.vue
* @Description: 页面头部组件
-->
<template>
<div class="content flex">
<div class="logo user-select">
<img style="height: 48px" src="@/assets/images/logo.png" alt="logo" />
</div>
<div class="tab">
<div class="tab-item first-tab active" @click.stop="openSelect">
<div class="merchant-name">{{ firstTab[dataListObj.labelName] }}</div>
<img class="arrow-down" src="@/assets/images/title-arrow.png" alt="" />
</div>
<SelectBox
:isShow="isShow"
:defaultValue="firstTab[dataListObj.valueName]"
@clickOutside="clickOutside"
:dataList="merchantList"
:boxWidth="'26.53vw'"
isObject
@selectVal="selectVal"
:labelName="dataListObj.labelName"
:valueName="dataListObj.valueName"
>
<div slot="search" class="search">
<input type="text" class="search-input" v-model="search" @input="handleInput" />
<img class="icon-search" src="@/assets/images/icon-search.png" @click="searchMerchant" alt="" />
</div>
<div slot="empty" class="search-empty">
<div>相关搜索</div>
<div>为你搜索到0个结果</div>
</div>
</SelectBox>
</div>
<!-- <div class="view-title user-select">嘀加智慧门店运营看板</div> -->
<div class="time">
<div class="top flex">
{{ weekList[week] }}
<div class="now">{{ now }}</div>
</div>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import utils from '@/utils/util'
export default {
name: 'DetailTitle',
props: {
dataList: {
type: Array,
default: () => []
},
dataListObj: {
type: Object,
default: () => {}
},
tabObject: {
type: Object,
default: () => {}
},
searchType: String
},
watch: {
'dataList'(val) {
this.merchantList = utils.deepClone(this.dataList)
}
},
data() {
return {
isShow: false,
merchantList: [],
weekList: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
firstTab: this.tabObject, // 存储第一个tab下的子菜单对象
now: new Date().format('yyyy-MM-dd hh:mm:ss'),
week: new Date().getDay(),
currentMenu: 'home', // 标记当前是哪个tab菜单
search: ''
}
},
created() {
},
mounted() {
this.timer()
},
methods: {
timer() {
setInterval(() => {
this.now = new Date().format('yyyy-MM-dd hh:mm:ss')
}, 1e3)
},
openSelect() {
this.isShow = !this.isShow
},
// 监听子菜单变化
selectVal(val) {
this.firstTab = val
this.$bus.$emit('selectVal', val)
this.openSelect()
this.search = ''
},
async searchMerchant() {
switch (this.searchType) {
case 'boutique':
this.searchBoutiqueMerchant()
break
case 'solar':
this.searchSolarMerchant()
break
}
},
async searchSolarMerchant() {
const _searchData = await this.api.solar.getMerchant({
merchantName: this.search
})
const _dataList = _searchData.data.dataList
_dataList.forEach(item => {
item.merchantname = item.merchantName
item.merchantid = item.merchantid + ''
})
this.merchantList = _dataList
},
async searchBoutiqueMerchant() {
const _searchData = await this.api.boutique.getMerchant({
merchantName: this.search
})
const _dataList = _searchData.data.dataList
_dataList.forEach(item => {
item.merchantname = item.merchantName
item.merchantid = item.merchantid + ''
})
this.merchantList = _dataList
},
handleInput: utils.debounce(function(e) {
this.searchMerchant()
}, 1000 / 25),
clickOutside() {
this.isShow = false
}
}
}
</script>
<style scoped lang="scss">
.content {
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 0 26px 0 24px;
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 {
width: 10.97vw;
}
}
.icon {
width: 14px;
height: 14px;
margin-right: 8px;
}
}
}
.tab {
position: relative;
display: flex;
// align-items: center;
color: #ffffff;
font-size: 16px;
&-item {
display: flex;
align-items: center;
// justify-content: center;
padding-left: 1.39vw;
height: 4.44vh;
box-sizing: border-box;
margin-right: 0.56vw;
border: 2px solid;
border-image: linear-gradient(90deg, #074989, #30dcff, #074989) 1;
background-image: linear-gradient(180deg, #001948 0%, #00223c 99%);
cursor: pointer;
}
.first-tab {
position: relative;
width: 26.53vw;
box-sizing: border-box;
.merchant-name {
max-width: 22.36vw;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: left;
color: #5894ff;
background-image: -webkit-linear-gradient(left, #24d8ff, #7787ff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
&.active {
background-image: url('../assets/images/first-tab-bg.png');
background-repeat: no-repeat;
background-size: 100% 100%;
border: none;
}
.arrow-down {
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 1.39vw;
margin-left: 0.28vw;
width: 1.39vw;
height: 2.22vh;
}
.select-box {
left: 0;
}
}
}
.search {
position: relative;
margin-bottom: 2.22vh;
padding: 0 1.39vw;
&-input {
width: 100%;
background-color: #001b46;
border: 1px solid #183d6f;
padding: 0.89vh 2.15vw 0.89vh 0.56vw;
color: #fff;
box-sizing: border-box;
}
.icon-search {
position: absolute;
right: 1.95vw;
top: 50%;
transform: translateY(-50%);
width: 15px;
height: 15px;
}
}
.search-empty {
text-align: center;
}
input:focus-visible {
border: 1px solid;
outline-offset: -4vh;
border-image: linear-gradient(90deg, #074989, #30dcff, #074989) 1 !important;
}
</style>
<template>
<div class="empty-box">
<div>
<img src="../assets/images/empty.png" class="empty-img" alt="" />
</div>
<div class="empty-text">暂无数据</div>
</div>
</template>
<script>
export default {
name: 'Empty',
data() {
return {}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.empty-box {
text-align: center;
}
.empty-img {
width: 11.11vw;
height: 5.98vh;
}
.empty-text {
font-weight: 400;
font-size: 12px;
color: #C9C9C9;
}
</style>
<template>
<div class="tab-box">
<div class="tab-item-box" :style="{ width: width + 'vw' }">
<div :class="['tab-item', tabActive == index ? 'tab-item-active' : '']" :style="{ 'padding-left': itemPadding + 'vw', 'padding-right': itemPadding + 'vw' }" v-for="(item, index) in list" :key="index" @click="changeTab(index)">
{{ item }}
</div>
</div>
</div>
</template>
<script>
export default {
name: 'InnerTab',
props: {
list: {
type: Array,
default: () => []
},
width: Number,
itemPadding: Number
},
data() {
return {
tabActive: 0
}
},
mounted() {},
methods: {
// 切换tab
changeTab(index) {
this.tabActive = index
this.$emit('changeTab', index)
}
}
}
</script>
<style lang="scss" scoped>
.tab-box {
.tab-item-box {
display: flex;
margin: 0 auto;
height: 2.67vh;
background: #072545;
line-height: 2.67vh;
cursor: pointer;
.tab-item {
text-align: center;
box-sizing: border-box;
font-weight: 400;
font-size: 12px;
line-height: 2.67vh;
color: #c9c9c9;
&-active {
color: #5894ff;
background-image: -webkit-linear-gradient(left, #24d8ff, #7787ff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
line-height: 2.22vh;
font-weight: 600;
border: 2px solid;
border-image: linear-gradient(90deg, #074989, #30dcff, #074989) 1;
box-sizing: border-box;
}
}
}
}
</style>
<template>
<div class="legend-box">
<div class="legend-item flex" v-for="(item, index) in dataList" :key="index">
<div class="legend-item-text" v-for="(itm, inx) in legentList" :key="inx">
<template v-if="inx == 0">
<div class="flex legend-item-right">
<div class="icon" :style="{ background: colors[index] }"></div>
<div class="item-content" :style="{ width: itm.width,'max-width': itm.width }">{{ item[itm.name] }}</div>
</div>
</template>
<template v-else>
<div class="flex item-content" :style="{ width: itm.width,'max-width': itm.width }">
<!-- <div v-show="itm.hasIcon">{{ itm.hasIcon }}</div>
<div v-if="itm.type == 'number'">{{numAddSymbol(item[itm.name])}}</div>
<div v-else-if="itm.type == 'decimal'">{{toPercent(item[itm.name])}}</div>
<div v-else>{{ item[itm.name] }}</div> -->
{{ itm.hasIcon ? itm.hasIcon : '' }}{{ itm.type == 'number' ? numAddSymbol(item[itm.name]) : itm.type == 'decimal' ? toPercent(item[itm.name]) : item[itm.name] }}{{ itm.unitIcon ? itm.unitIcon : '' }}
</div>
</template>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Legend',
data() {
return {
dataList: this.list
}
},
props: {
list: {
type: Array,
default: () => []
},
legentList: {
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-box {
margin-left: 0.42vw;
.legend-item {
font-size: 12px;
font-weight: 400;
line-height: 18px;
color: #c9c9c9ff;
justify-content: space-between;
&-text {
// margin-right: 1.39vw;
}
&-text:last-child {
margin-right: 0;
}
&-right {
// margin-right: 1.39vw;
}
.item-content {
text-align: left;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.icon {
width: 5px;
height: 5px;
background: #bf98ff;
border-radius: 50%;
margin: 4px;
}
}
}
</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
}
},
mounted() {
setTimeout(() => {
const { marqueeBox, marqueeText } = this.$refs
if (!marqueeBox) return
const boxWidth = marqueeBox.offsetWidth
const valueWidth = marqueeText.offsetWidth
this.valueWidth = valueWidth
this.boxWidth = boxWidth
if (boxWidth - 20 <= valueWidth) this.run(valueWidth)
}, this.delay)
},
methods: {
run() {
const { valueWidth, direction } = this
this.target = `-${valueWidth}px`
this.move = true
this.speed = direction / 1000
setTimeout(() => {
this.again()
}, direction)
},
again() {
const { 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() {
const 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'
import utils from '@/utils/util.js'
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: () => ['50%', '80%']
},
colors: {
type: Array,
default: () => ['#16E193', '#747DFF', '#E588FF', '#34AFFF', '#FFC200', '#EB6001']
},
size: {
type: String,
default: '12px'
},
formatter: {
type: String,
default: ''
},
formatterName: {
type: String,
default: ''
},
formtUnit: String
},
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() {
const { list, keys } = this
this.viewData = []
list.forEach(item => {
this.viewData.push({
name: item[keys[0]],
value: item[keys[1]],
avarage: item[keys[2]]
})
})
},
draw() {
if (this.mTime) clearInterval(this.mTime)
this.echartsPie = echarts.init(document.getElementById(this.id))
window.addEventListener('resize', () => {
this.echartsPie.resize()
})
const _this = this
// 指定图表的配置项和数据
this.option = {
// tooltip: {
// trigger: 'item',
// label: {
// show: true
// }
// },
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: params => {
const _dataIndex = params.dataIndex
// 价格
const _purchaseamount = utils.numAddSymbol(_this.list[_dataIndex].purchaseamount)
// 均价
const _avarage = utils.numAddSymbol(_this.list[_dataIndex].averprice)
// 总价
let _totalValue = 0
_this.list.forEach(item => {
_totalValue += item[this.keys[1]]
})
_totalValue = utils.numAddSymbol(_totalValue)
let _html
/**
* price -- 价格+均价组合
* total -- 名称+总数组合
* none -- 不显示内容
* 默认显示名称
*/
switch (_this.formatter) {
case 'price':
_html = `{a|¥${_purchaseamount}}\n{b|均价¥ ${_avarage}}`
break
case 'total':
_html = `${_this.formatterName}\n{c|${_totalValue}${_this.formtUnit || ''}}`
break
case 'none':
_html = ''
break
case 'rate':
_html = utils.toPercent(params.percent)
break
default:
_html = utils.legend(params.name)
}
return _html
},
rich: {
a: {
color: '#c8c8c8'
},
b: {
color: '#ffffff66',
fontSize: '12px',
lineHeight: '28'
},
c: {
lineHeight: '20'
}
}
}
},
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, 5000)
// 鼠标划出
this.echartsPie.on('mouseout', () => {
if (this.mTime) clearInterval(this.mTime)
this.mTime = setInterval(this.pieActive, 5000)
})
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>
<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: 'PieChartShadow',
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: () => ['#16E193', '#747DFF', '#E588FF', '#34AFFF', '#FFC200', '#EB6001']
},
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() {
const { 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%'],
roseType: 'radius',
avoidLabelOverlap: false,
label: {
normal: {
show: false,
position: 'center'
},
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: this.size,
fontWeight: 'bold',
color: '#fff',
formatter: '{b}'
}
},
labelLine: {
show: false
},
data: this.viewData,
minAngle: 30
},
{
name: '外边框',
type: 'pie',
tooltip: {
show: false
},
clockWise: false, // 顺时加载
hoverAnimation: false, // 鼠标移入变大
center: ['50%', '50%'], // 这里跟上面那组一样即可
radius: ['80%', '80%'], // 这里根据自己的需要自行调整,但是两个值要一样大哦,如果小于上方设置的最小内圆30%则为内阴影,大于外圆60%则为外阴影
label: {
normal: {
show: false // 重点:此处主要是为了不展示data中的value和name
}
},
data: [
{
value: 1, // 此处的值无所谓是多少
name: '', // 因为不展示label,可不填
itemStyle: {
// 边框样式,此处我们设置的浅蓝色,颜色可自行修改
normal: {
borderWidth: 20, // 边框宽度
borderColor: 'rgba(94, 183, 249, 0.13)'// 边框颜色
}
}
}
]
}
]
}
this.echartsPie.clear()
this.mainValue = 0
this.numDesc = ''
this.echartsPie.setOption(this.option)
this.pieActive()
this.mTime = setInterval(this.pieActive, 1000)
// 鼠标划出
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>
<template>
<div>
<div v-for="(item, index) in rankingsList" :key="index" class="ranking-box-item">
<div v-for="(itm, inx) in rankingDataObj" :key="inx">
<template v-if="inx === 0">
<div class="ranking-box-item-left" @click="goDetailPage(item)">
<div class="circle" :style="{ 'background-image': index < 3 ? RankColor[index] : '' }">{{ index + 1 }}</div>
<div class="text" :class="itm.action ? 'action-text' : ''" :style="{ width: itm.width }">{{ item[itm.name] }}</div>
</div>
</template>
<template v-else-if="inx !== rankingDataObj.length - 1">
<div class="ranking-box-item-middle" :style="{ width: itm.width, color: itm.color }">
{{ itm.preunit }}{{ item[itm.name] }}{{ itm.sufunit }}
</div>
</template>
<template v-else>
<div class="ranking-box-item-right" :style="{ width: itm.width, color: itm.color }">
{{ itm.preunit }}{{ itm.type == 'number' ? numAddSymbol(item[itm.name]) : itm.type == 'decimal' ? toPercent(item[itm.name]) : item[itm.name] }}{{ itm.sufunit }}
</div>
</template>
</div>
</div>
</div>
</template>
<script>
import datas from '@/utils/data'
export default {
name: 'Ranking',
props: {
// 排名对象值
rankingsList: {
type: Array,
default: () => []
},
/**
* 排名对象映射关系
* name: 字段名称
* width: 字段长度
* color: 字段颜色
* preunit: 字段前图标、字
* sufunit: 字段后图标、字
* type: 字段类别 --number、decimal
*/
rankingDataObj: {
type: Array,
default: () => []
},
// 是否是多个
isMultiple: {
type: Boolean,
default: true
}
},
data() {
return {
RankColor: datas.RankColor,
delayTimer: 3000,
directionTimer: 3000
}
},
mounted() {},
methods: {
// 跳转详情页面
goDetailPage(item) {
this.$emit('goDetailPage', item)
}
}
}
</script>
<style lang="scss" scoped>
.ranking-box-item {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 0.89vh;
box-sizing: border-box;
&-left {
display: flex;
.circle {
width: 20px;
height: 20px;
border-radius: 20px;
font-size: 14px;
color: #ffffff;
text-align: center;
background: #1e3372;
}
.text {
font-weight: 400;
font-size: 12px;
color: #ffffff;
margin-left: 1.11vw;
cursor: default;
// max-width: 20.3vw;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.marquee {
width: 17vw;
height: 20px;
}
.action-text:hover {
box-sizing: border-box;
// padding-bottom: 1px;
// border-bottom: 1px solid #fff;
color: #5894ff;
background-image: -webkit-linear-gradient(left, #24d8ff, #7787ff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
&-middle {
font-weight: 400;
font-size: 12px;
color: #C0C0C0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
&-right {
font-weight: 400;
font-size: 12px;
color: #95acd9;
text-align: right;
}
}
</style>
<!--
* @Description: 下拉框组件
* @Author: huyue
* @Date: 2023-07-05 15:11:53
* @LastEditors: huyue
* @LastEditTime: 2023-08-14 14:06:17
-->
<template>
<div v-click-outside="handleClickOutside" @mouseleave="handleMouseLeave" v-show="isShow" class="select-box" :style="{'width': boxWidth}">
<slot name="search"></slot>
<div v-if="dataList.length > 0" class="select-scroll">
<div class="select-item" :class="(isObject ? item[valueName] : item) == value ? 'active' : ''" v-for="(item,index) in dataList" :key="index" @click="select(item)">{{isObject ? item[labelName] : item}}</div>
</div>
<div v-else class="empty">
<slot name="empty"></slot>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'SelectBox',
props: {
isShow: {
type: Boolean,
default: false
},
dataList: {
type: Array,
default: () => []
},
// dataList里面的值是否是对象
isObject: {
type: Boolean,
default: false
},
labelName: {
type: String,
default: 'label'
},
valueName: {
type: String,
default: 'value'
},
// 下拉框的宽度设置
boxWidth: {
type: String
},
defaultValue: {
type: [String, Number, Object]
}
},
directives: {
'click-outside': {
bind: function(el, binding, vnode) {
el.clickOutsideEvent = function(event) {
// 判断点击事件是否在绑定元素的内部
if (!(el == event.target || el.contains(event.target))) {
// 调用绑定的回调函数
vnode.context[binding.expression](event)
}
}
document.body.addEventListener('click', el.clickOutsideEvent)
},
unbind: function(el) {
document.body.removeEventListener('click', el.clickOutsideEvent)
}
}
},
data() {
return {
value: '',
empty: '暂无数据'
}
},
watch: {
'defaultValue'(val) {
this.value = val
}
},
mounted() {
const { valueName, isObject, dataList, defaultValue } = this
const isDefaultObject = (defaultValue instanceof Object)
this.value = isDefaultObject ? defaultValue[valueName] : defaultValue || (isObject ? dataList[0][valueName] : dataList[0])
},
methods: {
select(item) {
const { valueName, isObject } = this
this.value = isObject ? item[valueName] : item
this.$emit('selectVal', item)
},
handleMouseLeave() {
// 在此处处理鼠标移出事件的逻辑
},
handleClickOutside() {
this.$emit('clickOutside')
// 在此处处理鼠标点击事件的逻辑
}
}
}
</script>
<style scoped lang='scss'>
.select-box {
position: absolute;
top: 4.8vh;
left: 0;
background-color: #051526;
padding: 16px 0;
box-sizing: border-box;
z-index: 1;
border: 2px solid;
border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;
.select-item {
margin-bottom: 8px;
color: #C9C9C9;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding: 0 1.39vw;
cursor: pointer;
&:hover {
color: #5894FF;
background-image: -webkit-linear-gradient(left, #24D8FF, #7787FF);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
&:last-child {
margin-bottom: 0;
}
&.active {
color: #5894FF;
background-image: -webkit-linear-gradient(left, #24D8FF, #7787FF);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
}
.select-scroll {
max-height: 23.33vh;
overflow-y: auto;
}
</style>
<style>
::-webkit-scrollbar {
width: 5px; /* 设置滚动条的宽度 */
}
::-webkit-scrollbar-track {
background-image: linear-gradient(90deg, #0A214A 0%, #061422 50%, #0A214A 100%);
/* 设置滚动条的轨道背景颜色 */
}
::-webkit-scrollbar-thumb {
border-radius: 5px;
background-color: rgba(244, 244, 244, 0.26); /* 设置滑块的颜色 */
}
</style>
<template>
<div class="statistics">
<div class="statistics-item" v-for="(item, index) in list" :key="index" :style="{'width': 100 / list.length + '%'}">
<div class="statistics-top">
<div class="statistics-name">{{item.name}}</div>
<div class="statistics-price"><span class="statistics-unit" v-if="item.unitType == 'left'">{{item.unit}}</span><span class="statistics-price-number">{{numAddSymbol(item.value)}}</span><span v-if="item.unitType == 'right'">{{item.unit}}</span></div>
<div v-if="item.rate" class="statistics-top-rate">占比<span>{{item.rate}}%</span></div>
</div>
<div class="statistics-bottom" v-if="item.bottomLabel || item.bottomType">
<template v-if="item.bottomType == 'money'">
<span> {{item.bottomLabel}}</span>
<span>¥{{numAddSymbol(item.bottomValue)}}</span>
</template>
<template v-else-if="item.bottomType == 'slot'">
<slot :name="item.valueName" :[item.valueName]="item"></slot>
</template>
<template v-else-if="item.bottomType == 'ratio'">
<div class="ratio">
<div class="ratio-left">{{item.ratioLeftLabel}}<span :class="item.ratioLeftValue > 0 ? 'positive' : 'negative'">{{item.ratioLeftValue}}%</span></div>
<div class="ratio-right">{{item.ratioRightLabel}}<span :class="item.ratioRightValue > 0 ? 'positive' : 'negative'">{{item.ratioRightValue}}%</span></div>
</div>
</template>
<template v-else>
<span>{{item.bottomLabel}}</span>
<span>{{numAddSymbol(item.bottomValue)}}</span>
</template>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'StatisticsBox',
props: {
list: {
type: Array
}
// bottomType: {
// type: String,
// default: 'default'
// }
},
data() {
return {
}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.statistics {
display: flex;
color: #fff;
height: 11.78vh;
&-item {
padding: 0.89vh 0.53vw;
margin-right: 1.11vw;
background: #061422;
box-shadow: inset 0 0 20px 0 #3d57ff69;
&:last-child {
margin-right: 0;
}
}
&-top {
position: relative;
padding-left: 0.3vw;
&-rate {
position: absolute;
right: 0;
top: 0;
font-size: 12px;
color: #95ACD9;
span {
color: #EB6001;
}
}
}
&-name {
font-weight: 500;
font-size: 14px;
margin-bottom: 0.89vh;
height: 2.22vh;
}
&-unit {
padding-right: 0.56vw;
}
&-price {
display: flex;
align-items: center;
color: #25D6FF;
font-weight: 600;
font-size: 14px;
height: 3.11vh;
&-number {
padding-right: 0.56vw;
font-size: 20px;
color: #5894FF;
background-image:-webkit-linear-gradient(left,#24D8FF,#7787FF);
-webkit-background-clip:text;
-webkit-text-fill-color:transparent;
}
}
&-bottom {
display: flex;
justify-content: space-between;
font-size: 12px;
color: #95ACD9;
border-top: 1px solid #2A3D72;
padding: 0.89vh 0.3vw 0;
margin-top: 0.89vh;
.ratio {
display: flex;
width: 100%;
justify-content: space-between;
.positive,
.negative{
display: inline-block;
margin-left: 0.28vw;
}
.positive {
color: #EB6001;
}
.negative {
color: #16E193;
}
}
}
}
</style>
<template>
<div class="tab-box">
<div class="tab-item-box" :style="{ width: width + 'vw' }">
<div :class="['tab-item', tabActive == index ? 'tab-item-active' : '']" :style="{ width: (itemWidth) + 'vw','padding-left': paddingWidth + 'vw','padding-right': paddingWidth + 'vw' }" v-for="(item, index) in list" :key="index" @click="changeTab(index)">
{{ item }}
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Tab',
props: {
list: {
type: Array,
default: () => []
},
width: Number,
itemWidth: Number,
paddingWidth: Number
},
data() {
return {
tabActive: 0
}
},
mounted() {},
methods: {
// 切换tab
changeTab(index) {
this.tabActive = index
this.$emit('changeTab', index)
}
}
}
</script>
<style lang="scss" scoped>
.tab-box {
margin: 0 auto;
.tab-item-box {
display: flex;
padding: 0.44vh 0.28vw;
border: 2px solid;
border-image: linear-gradient(90deg, #074989, #30dcff, #074989) 1;
background-image: linear-gradient(180deg, #001948 0%, #00223c 99%);
cursor: pointer;
.tab-item {
padding: 0.56vh 0;
text-align: center;
box-sizing: border-box;
font-weight: 400;
font-size: 16px;
color: #ffffffbf;
&-active {
background-image: linear-gradient(270deg, #6578ff 0%, #079ff1 100%);
color: #ffffff;
}
}
}
}
</style>
<template>
<div class="tab-box">
<div class="flex">
<div v-for="(item, index) in tabList" :key="index" class="tab-item" :class="tabActive == index ? 'tab-item-active' : ''" @click="changeTab(index)">{{ item }}</div>
</div>
<div>
<slot name="right"></slot>
</div>
</div>
</template>
<script>
export default {
name: 'TopTab',
props: {
tabList: {
type: Array,
default: () => []
}
},
data() {
return {
tabActive: 0
}
},
mounted() {},
methods: {
// tab切换
changeTab(index) {
this.tabActive = index
this.$emit('tabChange', index)
}
}
}
</script>
<style lang="scss" scoped>
.tab-box {
height: 4.44vh;
display: flex;
justify-content: space-between;
padding: 0.2vh 0.2vw;
box-sizing: border-box;
border: 2px solid;
border-image: linear-gradient(90deg, #074989, #30dcff, #074989) 1;
.tab-item {
height: 3.56vh;
line-height: 3.56vh;
font-weight: 400;
font-size: 14px;
color: #ffffffbf;
padding: 0 1.11vw;
cursor: pointer;
}
.tab-item-active {
font-weight: 500;
font-size: 14px;
color: #ffffff;
background-image: linear-gradient(270deg, #6578ff 0%, #079ff1 100%);
}
}
.flex {
display: flex;
}
</style>
<!--
* @Description: 内容
* @Author: huyue
* @Date: 2023-07-04 16:12:38
* @LastEditors: huyue
* @LastEditTime: 2023-07-05 10:40:02
-->
<template>
<div class="ViewContainer">
<div class="ViewContainer-title">
<slot name="title" />
</div>
<div class="title-line"></div>
<div class="ViewContainer-body">
<slot name="content" />
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'ViewContainer',
props: {
},
data() {
return {
}
},
mounted() { },
methods: {}
}
</script>
<style scoped lang='scss'>
.ViewContainer {
// width: 100vw;
// height: 100vh;
&-title {
height: 6.1vh;
width:100%;
background-image: linear-gradient(90deg, #0A214A 0%, #061422 50%, #0A214A 100%);
// background-image: url('../assets/images/bg-title.jpg');
// background-repeat: no-repeat;
// background-size:cover;
}
&-body {
height: calc(93.9vh - 2px);
}
.title-line {
width: 100%;
height: 2px;
background-image: linear-gradient(90deg, #27B0FF 0%, #4792ff00 34%, #5784ff00 66%, #6379FF 100%);
}
}
</style>
<!--
* @Description: 内容页面统计年份组件
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditTime: 2023-07-17 18:13:20
-->
<template>
<div class="view-date">统计年份:
<div class="year-plugin">
<div class="year" @click.stop="switchYear">
{{$store.state.app.solarYear ? $store.state.app.solarYear : '全部'}}
<img class="arrow-down" src="@/assets/images/arrow-down.png" alt="">
</div>
<SelectBox :isShow="isShow" isObject :defaultValue="defaultYear" @clickOutside="clickOutside" :dataList="dataList" :boxWidth="'8.61vw'" @selectVal="selectVal"></SelectBox>
</div>
<span class="businessTime">
业务开始时间:{{businessTime ? new Date(businessTime).format('yyyy-MM-dd') : ''}}
</span>
</div>
</template>
<script type='text/ecmascript-6'>
// import datas from '@/utils/data'
import { mapActions } from 'vuex'
export default {
name: 'ViewDate',
props: {
businessTime: String,
dataList: {
type: Array,
default: () => []
},
defaultYear: String
},
data() {
return {
isShow: false,
// dataList: datas.DefaultData.yearList,
year: ''
}
},
mounted() {
const { defaultYear } = this
if (defaultYear) this.setSolarYear(defaultYear)
// this.year = this.$store.state.app.solarYear
},
methods: {
...mapActions(['setSolarYear']),
switchYear() {
this.isShow = !this.isShow
},
selectVal(val) {
this.setSolarYear(val.value)
this.switchYear()
},
clickOutside() {
this.isShow = false
}
}
}
</script>
<style scoped lang='scss'>
.view-date {
display: flex;
align-items: center;
// width: 100%;
height: 6.67vh;
color: #C9C9C9;
font-size: 14px;
padding: 0 1.33vh;
background-color: #091C40;
.year-plugin {
position: relative;
}
.year {
display: flex;
align-items: center;
justify-content: space-between;
width: 8.61vw;
height: 4vh;
padding: 0 0.56vw;
box-sizing: border-box;
font-size: 14px;
background-image: linear-gradient(270deg, #6578FF 0%, #079FF1 100%);
margin-right: 0.56vw;
color: #FFFFFF;
.arrow-down {
width: 0.69vw;
height: 0.67vh;
}
}
}
.businessTime {
color: #536079;
font-size: 14px;
}
</style>
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-08-24 15:52:22
* @FilePath: \dj-data-view\src\components\ViewTitle.vue
* @Description: 页面头部组件
-->
<template>
<div class="content flex">
<div class="logo user-select">
<img style="height: 48px" src="@/assets/images/logo.png" alt="logo" />
</div>
<div class="tab">
<div v-for="(item, index) in menuList" :key="index">
<template v-if="item.tabName == 'business' && item.isShow">
<div class="tab-item first-tab" :class="currentMenu == item.tabName ? 'active' : ''" @click.prevent="jump(item.tabName)">
<div class="tab-title">{{ firstTab.label }}</div>
<img class="arrow-down" @click.stop="openSelect" src="@/assets/images/title-arrow.png" alt="">
<SelectBox :isShow="isShow" @clickOutside="clickOutside" :dataList="item.children" :boxWidth="'16.94vw'" isObject @selectVal="selectVal"></SelectBox>
</div>
</template>
<template v-else>
<div v-show="item.isShow" class="tab-item other-tab" :class="currentMenu == item.tabName ? 'active' : ''" @click="jump(item.tabName)">
<div class="tab-name">{{item.label}}</div>
</div>
</template>
</div>
</div>
<!-- <div class="tab">
<div class="tab-item first-tab" :class="currentMenu == 'home' ? 'active' : ''" @click.prevent="jump('home')">
<div class="tab-title">{{ firstTab.label }}</div>
<img class="arrow-down" @click.stop="openSelect" src="@/assets/images/title-arrow.png" alt="">
<SelectBox :isShow="isShow" @clickOutside="clickOutside" :dataList="dataList" :boxWidth="'16.94vw'" isObject @selectVal="selectVal"></SelectBox>
</div> -->
<!-- <div class="tab-item other-tab" :class="currentMenu == 'operational' ? 'active' : ''" @click="jump('operational')">
<div class="tab-name">运营数据</div>
</div>
<div class="tab-item other-tab" :class="currentMenu == 'interior' ? 'active' : ''" @click="jump('interior')">
<div class="tab-name">内部数据</div>
</div> -->
<!-- </div> -->
<!-- <div class="view-title user-select">嘀加智慧门店运营看板</div> -->
<div class="time">
<div class="top flex">
{{ weekList[week] }}
<div class="now">{{ now }}</div>
</div>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import datas from '@/utils/data'
export default {
name: 'ViewTitle',
data() {
return {
isShow: false,
// dataList: datas.DefaultData.businessList,
menuList: datas.DefaultData.menuList,
weekList: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
firstTab: '', // 存储第一个tab下的子菜单对象
now: new Date().format('yyyy-MM-dd hh:mm:ss'),
week: new Date().getDay(),
currentMenu: 'home' // 标记当前是哪个tab菜单
}
},
created() {
const { menuList, $roleAuth, $role } = this
const permissions = $roleAuth[$role]
menuList.forEach(menu => {
if (menu.children) {
menu.children = menu.children.filter(child => {
child.isShow = permissions[child.value]
return child.isShow
})
menu.isShow = menu.children.length > 0
} else {
menu.isShow = permissions[menu.value]
}
})
this.menuList = menuList.filter(item => item.isShow)
this.firstTab = this.menuList[0].children ? this.menuList[0].children[0] : this.menuList[0]
this.jump(this.firstTab.tabName)
},
mounted() {
this.timer()
},
methods: {
timer() {
setInterval(() => {
this.now = new Date().format('yyyy-MM-dd hh:mm:ss')
}, 1e3)
},
openSelect() {
this.isShow = !this.isShow
},
// 监听子菜单变化
selectVal(val) {
this.firstTab = val
this.$bus.$emit('selectVal', val.value)
this.openSelect()
},
// tab菜单切换
jump(val) {
let _val = val
this.currentMenu = val
if (val === 'business') _val = this.firstTab.value
this.$bus.$emit('selectVal', _val)
this.isShow = false
},
clickOutside() {
this.isShow = false
}
}
}
</script>
<style scoped lang="scss">
.content {
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 0 26px 0 24px;
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 {
width: 11.2vw;
}
}
.icon {
width: 14px;
height: 14px;
margin-right: 8px;
}
}
}
.tab {
display: flex;
// align-items: center;
color: #FFFFFF;
font-size: 16px;
&-item {
position: relative;
display: flex;
align-items: center;
justify-content: center;
height: 4.44vh;
// padding: 0 1.36vw;
box-sizing: border-box;
margin-right: 0.56vw;
border: 2px solid;
border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;
background-image: linear-gradient(180deg, #001948 0%, #00223C 99%);
cursor: pointer;
.tab-title {
max-width: 18.61vw;
}
}
.first-tab {
position: relative;
width: 16.94vw;
box-sizing: border-box;
justify-content: flex-start;
padding-left: 1.39vw;
&.active {
background-image: url('../assets/images/first-tab-bg.png');
background-repeat: no-repeat;
background-size: 100% 100%;
border: none;
.tab-title {
color: #5894FF;
background-image: -webkit-linear-gradient(left, #24D8FF, #7787FF);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
.arrow-down {
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 1.39vw;
margin-left: 0.28vw;
width: 1.39vw;
height: 2.22vh;
}
}
.other-tab{
width: 7.22vw;
box-sizing: border-box;
&.active {
background-image: url('../assets/images/other-tab-bg.png');
background-repeat: no-repeat;
background-size: 100% 100%;
border: none;
.tab-name {
color: #5894FF;
background-image: -webkit-linear-gradient(left, #24D8FF, #7787FF);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
}
}
</style>
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-08 19:20:13
* @LastEditors: huyue
* @LastEditTime: 2023-07-04 11:43:15
*/
import Vue from 'vue'
const componentsFiles = require.context(`./`, true, /.vue$/)
componentsFiles.keys().forEach(path => {
const component = componentsFiles(path).default
Vue.component(component.name, component)
})
\ No newline at end of file
/*
* @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-07-13 14:11:18
*/
// 本地环境配置
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: {}
}
}
/*
* @Description:
* @Author: huyue
* @Date: 2023-07-04 11:43:38
* @LastEditors: huyue
* @LastEditTime: 2023-07-18 14:17:13
*/
module.exports = {
title: '内部BI',
request: {
baseURL: 'http://glsk-data-view.test.glsx.com.cn' // 测试
},
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: huyue
* @LastEditTime: 2023-08-15 16:22:12
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
let config = require('./conf.js')
let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) {
// if (isEnv) {
// let { request } = config
// Object.assign(request, { timeout })
// return Promise.resolve(config)
// }
/**测试mock */ return window.fetch('https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=glsk-data-view').then(res => res.json())
// return window.fetch('https://oss-config.test.glsx.com.cn/mock/62cbf569f5137cf37678b828/data-view/config', {}).then(res => res.json())
}
export const cfg = {
install(vue, config) {
vue.prototype.$config = config
}
}
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: huyue
* @LastEditTime: 2023-08-15 17:15:24
*/
// 兼容 IE
// https://github.com/zloirock/core-js/blob/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md#babelpolyfill
// import 'core-js/stable'
// import 'regenerator-runtime/runtime'
import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import 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 })
}
Vue.use(ElementUI)
// 移动端适配 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 => {
Vue.prototype.$roleAuth = res.roleAuth
// 从配置服务器获取动态配置
// 设置 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)
})
})
/*
* @Description:
* @Author: huyue
* @Date: 2023-07-07 11:23:06
* @LastEditors: huyue
* @LastEditTime: 2023-07-31 10:09:08
*/
export default {
data() {
return {
isFlag: false
}
},
watch: {
watchBoutiqueYear: {
immediate: true,
handler(newval) {
this.isFlag = true
this && this.init && this.init(newval)
}
},
watchBoutiqueChannel: {
immediate: true,
handler(newval) {
if (!this.isFlag) return
this && this.init && this.init(newval)
}
}
},
computed: {
watchBoutiqueYear() {
return this.$store.state.app.boutique.year
},
watchBoutiqueChannel() {
return this.$store.state.app.boutique.channel.value
}
},
method: {
openMessage(msg) {
this.$message({
message: msg,
type: 'warning'
})
}
}
}
/*
* @Description:
* @Author: huyue
* @Date: 2023-07-07 11:23:06
* @LastEditors: huyue
* @LastEditTime: 2023-07-14 10:41:28
*/
export default {
watch: {
// watchReportParams: {
// immediate: true,
// handler(newval) {
// this && this.init && this.init(newval)
// }
// },
watchSolarYear: {
immediate: true,
handler(newval) {
this && this.init && this.init(newval)
}
}
},
computed: {
// watchReportParams() {
// return this.$store.state.app.reportParams
// },
watchSolarYear() {
return this.$store.state.app.solarYear
}
},
method: {
openMessage(msg) {
this.$message({
message: msg,
type: 'warning'
})
}
}
}
export default {
data() {
return {
areaData: [],
brandData: [],
storeData: []
}
},
methods: {
getClientData() {
this.api.operational.getEnterpriseDistribution().then(res => {
if (res.code == 0) {
res.data.dataList.forEach(item => {
if (item.queryitem == '区域排名') this.areaData = item.rankDistributions
if (item.queryitem == '品牌分布') this.brandData = item.rankDistributions
if (item.queryitem == '门店类型') this.storeData = item.rankDistributions
this.$bus.$emit('clientData', {
areaData: this.areaData,
brandData: this.brandData,
storeData: this.storeData
})
})
}
})
}
}
}
/*
* @Description:
* @Author: huyue
* @Date: 2023-07-04 11:44:11
* @LastEditors: huyue
* @LastEditTime: 2023-08-16 16:25:46
*/
import changeMixin from './changeMixin'
import boutiqueMixin from './boutiqueMixin'
import clientMixin from './clientMixin'
import userMixin from './userMixin'
export {
changeMixin,
boutiqueMixin,
clientMixin,
userMixin
}
/*
* @Description:
* @Author: huyue
* @Date: 2023-08-16 16:25:20
* @LastEditors: huyue
* @LastEditTime: 2023-08-16 16:25:25
*/
export default {
data() {
return {
ageData: [],
priceData: [],
buyCarData: [],
mileageData: []
}
},
methods: {
getDistribution() {
this.api.operational.getDistribution().then(res => {
if (res.code == 0) {
res.data.dataList.forEach(item => {
if (item.queryitem == '年龄') this.ageData = item.distribution
if (item.queryitem == '车价') this.priceData = item.distribution
if (item.queryitem == '购车年限') this.buyCarData = item.distribution
if (item.queryitem == '里程') this.mileageData = item.distribution
this.$bus.$emit('userData', {
ageData: this.ageData,
priceData: this.priceData,
buyCarData: this.buyCarData,
mileageData: this.mileageData
})
})
}
})
}
}
}
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: huyue
* @LastEditTime: 2023-07-04 11:45:14
*/
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: huyue
* @LastEditTime: 2023-08-15 17:00:16
*/
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) => {
Vue.prototype.$role = to.query.role
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
const pages = [
{
name: 'home',
meta: {
isTab: true,
keepAlive: true,
backgroundColor: '#F7F7F7'
},
children: []
},
{
name: 'boutiqueDetail',
meta: {
isTab: true,
backgroundColor: '#F7F7F7'
}
},
{
name: 'solarDetail',
meta: {
isTab: true,
backgroundColor: '#F7F7F7'
}
},
{
name: 'crowdfundingDetail',
meta: {
isTab: true,
backgroundColor: '#F7F7F7'
}
}
]
const keepAlives = []
const setChildren = (e, parent) => {
const arr = []
e.children.map(child => {
const { children, meta } = child
const url = `${parent}/${child.name}`
const name = url.replace(/\//g, '.')
const 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 = _ => {
const router = {
path: '/',
name: 'home',
redirect: '/home',
component: resolve => require([`views/home.vue`], resolve)
}
router.children = pages.map(e => {
const name = `${e.name}`
const route = {
path: `/${name}`,
name,
meta: e.meta || {},
component: resolve => require([`views/${name}/index.vue`], resolve)
// component: resolve => require([`views/home/detail/${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: huyue
* @LastEditTime: 2023-07-04 11:46:02
* @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: huyue
* @LastEditTime: 2023-07-21 15:00:41
*/
const state = {
reportParams: {
reportType: 0 // 月表0,日表1
},
solarYear: '',
solarTime: '',
merchantRankingList: [],
boutique: {
year: '',
channel: {
label: '全部渠道',
value: 'all'
},
merchantId: ''
}
}
const mutations = {
SET_PAGE_META(state, meta) {
state.pageMeta = meta
},
SET_SOLAR_YEAR(state, meta) {
state.solarYear = meta
},
SET_SOLAR_TIME(state, meta) {
state.solarTime = meta
},
SET_MERCHANT_LIST(state, meta) {
state.merchantRankingList = meta
},
SET_BOUTIQUE_YEAR(state, meta) {
state.boutique.year = meta
},
SET_BOUTIQUE_CHANNEL(state, meta) {
state.boutique.channel = meta
},
SET_BOUTIQUE_MERCHANTID(state, meta) {
state.boutique.merchantId = meta
}
}
const actions = {
// 设置name
setUserInfo({ commit }, user) {
commit('SET_USER_INFO', user)
},
setSolarYear({ commit }, year) {
commit('SET_SOLAR_YEAR', year)
},
setSolarTime({ commit }, time) {
commit('SET_SOLAR_TIME', time)
},
setMerchantRankingList({ commit }, list) {
commit('SET_MERCHANT_LIST', list)
},
setBoutiqueYear({ commit }, year) {
commit('SET_BOUTIQUE_YEAR', year)
},
setBoutiqueChannel({ commit }, channel) {
commit('SET_BOUTIQUE_CHANNEL', channel)
},
setBoutiqueMerchantid({ commit }, id) {
commit('SET_BOUTIQUE_MERCHANTID', id)
}
}
export default {
state,
mutations,
actions
}
/*
* @Description: 基础数据
* @Author: huyue
* @Date: 2023-07-04 11:46:53
* @LastEditors: huyue
* @LastEditTime: 2023-08-16 14:33:14
*/
const DefaultData = {
defaultLineHeight: '17.32',
defaultPieHeight: '13.05',
yearList: ['2023', '2022'],
menuList: [
{
tabName: 'business',
children: [
{
label: '业务数据 | 1.0太阳膜采购',
tabName: 'business',
value: 'm_1.0'
},
{
label: '业务数据 | 1.1精品升级',
tabName: 'business',
value: 'm_1.1'
},
{
label: '业务数据 | 1.3售后众筹',
tabName: 'business',
value: 'm_1.3'
},
{
label: '业务数据 | 2.1会员权益',
tabName: 'business',
value: 'm_2.1'
}
]
},
{
label: '运营数据',
tabName: 'operational',
value: 'operational'
},
{
label: '内部数据',
tabName: 'interior',
value: 'interior'
}
],
directionTimer: 3000,
delayTimer: 3000
}
const RankColor = ['linear-gradient(180deg, #FFDA0B 0%, #FFBC24 100%)', 'linear-gradient(180deg, #EBE5D6 0%, #BDB4A6 100%)', 'linear-gradient(180deg, #EEC08E 0%, #B86E3A 100%)']
export default Object.freeze({
DefaultData,
RankColor
})
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: huyue
* @LastEditTime: 2023-07-04 11:47:06
*/
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, delay = 1000) => {
// 距离上一次的执行时间
let lastTime = 0
return function () {
const _this = this
const _arguments = arguments
const now = new Date().getTime()
// 如果距离上一次执行超过了delay才能再次执行
if (now - lastTime > delay) {
fn.apply(_this, _arguments)
lastTime = now
}
}
}
/**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 toPercent = num => {
let str = Number(num).toFixed(0)
str += '%'
return str
}
// piechart文字超出六个字换行
const legend = val => {
if (val.length > 6) {
const firstText = val.substring(0, 6)
const lastText = val.substring(6)
return `${firstText}\n{c|${lastText}}`
} else {
return val
}
}
const utils = {
getParams,
getQuery,
throttle,
decimal,
toTop,
numAddSymbol,
getCurrentDate,
getNDate,
getNMonth,
debounce,
setChartFontSize,
deepClone,
toPercent,
legend
}
Object.keys(utils).map(key => {
Vue.prototype[key] = utils[key]
})
export default utils
<!--
* @Description: 柱状图
* @Author: huyue
* @Date: 2023-07-07 14:01:42
* @LastEditors: huyue
* @LastEditTime: 2023-08-28 14:09:19
-->
<template>
<div>
<div :id="domId" style="width: 100%;" :style="{ height }"></div>
</div>
</template>
<script type="text/ecmascript-6">
import * as echarts from 'echarts'
import BarOptions from './BarOptions'
import utils from '../../utils/util'
export default {
name: 'BarChart',
props: {
height: {
type: String
},
domId: {
type: String,
default: 'bar-line'
},
dataList: {
type: Array,
default: () => []
},
tooltipFormatterObj: {
type: Array,
default: () => {
return [
{
label: '数量',
attrName: 'num'
},
{
label: '环比',
attrName: 'hrate',
addSymbol: '%'
},
{
label: '同比',
attrName: 'trate',
addSymbol: '%'
}
]
}
}
},
data() {
return {
barLineOptions: []
}
},
created() {
this.barLineOptions = BarOptions({ tooltipFormatter: this.tooltipFormatter })
},
mounted() {
this.barLineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.barLineDom)
this.chartBindEvent()
},
methods: {
tooltipFormatter(obj) {
var _currentItem = this.dataList[obj[0].dataIndex]
var _html = ''
var _txt = ''
this.tooltipFormatterObj.forEach(item => {
_txt += `<div style="display:flex;"><div style="color: #c9c9c9">${item.label}:</div><div style="color: #fff;">${utils.numAddSymbol(_currentItem[item.attrName])}${item.addSymbol || ''}</div></div>`
})
_html += `<div style="backdrop-filter: blur(4px);background-color: #051526;border: 2px solid;border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;padding: 10px;">
${_txt}
</div>`
return _html
},
drawBar() {
this.barLineOptions.xAxis.data = this.dataList.map(item => item.month)
this.barLineOptions.series[0].data = this.dataList.map(item => item.data1)
this.barLineOptions.series[1].data = this.dataList.map(item => item.data2)
this.barLineOptions.series[2].data = this.dataList.map(item => item.data3)
this.barLineOptions.series[3].data = this.dataList.map(item => item.data4)
this[this.domId].setOption(this.barLineOptions)
},
chartBindEvent() {
// resize
window.addEventListener('resize', () => {
this[this.domId].resize()
})
}
}
}
</script>
<style scoped lang="scss">
</style>
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-08-23 16:22:16
* @FilePath: \dj-data-view\src\components\ViewTitle.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div>
<div :id="domId" style="width: 100%;" :style="{ height }"></div>
</div>
</template>
<script type="text/ecmascript-6">
import utils from '../../utils/util'
import * as echarts from 'echarts'
import getBarLineOptions from './BarLineOptions'
export default {
name: 'BarLineChart',
props: {
height: {
type: String
},
domId: {
type: String,
default: 'bar-line'
},
dataList: {
type: Array,
default: () => []
},
tooltipFormatterObj: {
type: Array,
default: () => {
return [
{
label: '数量',
attrName: 'num'
},
{
label: '环比',
attrName: 'hrate',
addSymbol: '%'
},
{
label: '同比',
attrName: 'trate',
addSymbol: '%'
}
]
}
}
},
data() {
return {
barLineOptions: [],
moveAttr: {
// speed: 900,
seriesIndex: 0,
dataIndex: 0
},
timer: null
}
},
// created() {
// this.barLineOptions = getBarLineOptions({ tooltipFormatter: this.tooltipFormatter })
// },
mounted() {
this.barLineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.barLineDom)
this.chartBindEvent()
},
methods: {
tooltipFormatter(obj) {
var _currentItem = this.dataList[obj[0].dataIndex]
var _html = ''
var _txt = ''
this.tooltipFormatterObj.forEach(item => {
_txt += `<div style="display:flex;"><div style="color: #c9c9c9">${item.label}:</div><div style="color: #fff;">${utils.numAddSymbol(_currentItem[item.attrName])}${item.addSymbol || ''}</div></div>`
})
_html += `<div style="backdrop-filter: blur(4px);background-color: #051526;border: 2px solid;border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;padding: 10px;">
${_txt}
</div>`
return _html
},
drawBarLine() {
this.barLineOptions = getBarLineOptions({ tooltipFormatter: this.tooltipFormatter, seriesData: this.dataList })
this.barLineOptions.xAxis.data = this.dataList.map(item => item.month)
this.barLineOptions.series[0].data = this.dataList.map(item => item.data1)
this.barLineOptions.series[1].data = this.dataList.map(item => item.data2)
this.barLineOptions.series[2].data = this.dataList.map(item => item.data3)
this[this.domId].setOption(this.barLineOptions)
},
chartBindEvent() {
// resize
window.addEventListener('resize', () => {
this[this.domId].resize()
})
}
}
}
</script>
<style scoped lang="scss">
</style>
import * as echarts from 'echarts'
import utils from '../../utils/util'
function getBarLineOptions(obj) {
const { tooltipFormatter, seriesData } = obj
var barLineOption = {
tooltip: {
trigger: 'axis',
borderWidth: 0,
padding: 0,
backgroundColor: '#051526',
formatter: tooltipFormatter || ''
},
xAxis: {
data: []
},
yAxis: [
{
name: '¥',
splitLine: {
show: false
}
},
{
name: '',
type: 'value',
min: 0,
max: 100,
interval: 20,
axisLabel: {
formatter: '{value}%'
},
splitLine: {
lineStyle: {
color: '#1d2a38'
}
}
}
],
grid: {
left: '3%',
right: '2%',
top: '20%',
bottom: '6%',
containLabel: true
},
series: [
{
name: 'bar',
type: 'bar',
data: [],
label: {
show: true,
position: 'top',
color: '#fff',
formatter: (params) => {
return utils.numAddSymbol(params.value)
}
},
itemStyle: {
barBorderRadius: [2, 2, 0, 0], // 柱体圆角
color: function(params) {
return new echarts.graphic.LinearGradient(
0, 0, 0, 1, [{ // 代表渐变色从正上方开始
offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色
color: '#22D8FF'
}, // 柱图渐变色
{
offset: 0.5, // 指100%处的颜色
color: '#223FA9'
},
{
offset: 1, // 指100%处的颜色
color: '#061422'
}]
)
}
}
},
{
name: 'bar2',
type: 'bar',
min: 100,
label: {
show: true,
position: 'top',
color: '#fff',
formatter: (params) => {
return utils.numAddSymbol(params.value)
}
},
data: [],
itemStyle: {
barBorderRadius: [2, 2, 0, 0], // 柱体圆角
color: function(params) {
return new echarts.graphic.LinearGradient(
0, 0, 0, 1, [{ // 代表渐变色从正上方开始
offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色
color: '#2AD191'
}, // 柱图渐变色
{
offset: 0.5, // 指100%处的颜色
color: '#0E958D'
},
{
offset: 1, // 指100%处的颜色
color: '#061422'
}]
)
}
}
},
{
name: 'Dynamic Line',
type: 'line',
yAxisIndex: 1,
data: []
}
]
}
return barLineOption
}
export default getBarLineOptions
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!