Commit a2454b3b by 前端

Merge branch 'scrmv3.13.0' into 'master'

合并Scrmv3.13.0版本代码

See merge request !20
2 parents 0ae04365 3e012ef3
Showing 87 changed files with 4903 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": "renewal-interest-data-board",
"version": "1.0.0",
"description": "GH Hall By Work WeChat",
"author": "limin <limin.mail@qq.com>",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --open",
"build": "vue-cli-service build",
"stage": "vue-cli-service build --mode staging",
"lint": "vue-cli-service lint --fix",
"dev": "npm run serve"
},
"dependencies": {
"autoprefixer": "^8.0.0",
"core-js": "^3.6.4",
"dayjs": "^1.10.5",
"echarts": "^5.3.3",
"element-ui": "^2.15.13",
"glsx-components": "^1.5.7",
"glsx-components_beta": "^1.1.3",
"lib-flexible": "^0.3.2",
"postcss-loader": "^6.2.0",
"sha1": "^1.1.1",
"storejs": "^1.1.0",
"v-fit-columns": "^0.2.0",
"vconsole": "^3.7.0",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"babel-plugin-import": "^1.13.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"node-sass": "^4.14.1",
"postcss-px-to-viewport": "^1.1.1",
"postcss-pxtorem": "^5.1.1",
"sass-loader": "^8.0.2",
"script-ext-html-webpack-plugin": "^2.1.4",
"vue-loader": "^15.9.8",
"vue-template-compiler": "^2.6.11",
"webpack-bundle-analyzer": "^3.8.0"
}
}
No preview for this file type
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no,viewport-fit=cover">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.css) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="preload" as="style" />
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="stylesheet" />
<% } %>
<title>
<%= webpackConfig.name %>
</title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it
to continue.</strong>
</noscript>
<div id="app"></div>
<!-- 使用CDN加速的JS文件,配置在vue.config.js下 -->
<% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %>
<!-- built files will be auto injected -->
</body>
</html>
<template>
<div id="app">
<router-view />
</div>
</template>
<script>
export default {
name: 'App'
}
</script>
<style lang="scss"></style>
/*
* @Descripttion:API 统一外部调用入口
* @version: 1.0.0
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: huyue
* @LastEditTime: 2022-06-28 15:12:48
*/
const modulesFiles = require.context('./modules', true, /\.js$/)
const modules = modulesFiles.keys().reduce((modules, modulePath) => {
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
const value = modulesFiles(modulePath)
modules[moduleName] = value.default
return modules
}, {})
export default modules
// 获取已开通门店数、浏览量、转发量、线索量、激活量
const getOverview = params => {
return window.$HTTP.get('renewalInsurance/getOverview', params)
}
// 获取浏览量、转发量、线索量、激活量排名
const getRanking = params => {
return window.$HTTP.get('renewalInsurance/getRanking', params)
}
// 获取各门店各品牌的不同活动的情况,包括浏览量、转发量、线索量、激活量
const getBrandActivity = params => {
return window.$HTTP.get('renewalInsurance/getBrandActivity', params)
}
// 获取浏览量趋势
const getviewTrend = params => {
return window.$HTTP.get('renewalInsurance/getviewTrend', params)
}
// 获取浏览量、转发量、线索量、激活量明细
const getDetail = params => {
return window.$HTTP.get('renewalInsurance/getDetail', params)
}
// 获取品牌名称
const getBrandName = params => {
return window.$HTTP.get('renewalInsurance/getBrandName', params)
}
// 导出
const exportApi = params => {
return window.$HTTP.get('renewalInsurance/download', params)
}
export default {
getOverview,
getRanking,
getBrandActivity,
getviewTrend,
getBrandName,
getDetail,
exportApi
}
class Request {
DOMAIN = '/dev'
constructor(_request_) {
this.DOMAIN = _request_ ? _request_.baseURL : this.DOMAIN
}
get(url, params, returnAll) {
return this.request('GET', url, params, returnAll)
}
post(url, params, returnAll) {
return this.request('POST', url, params, returnAll)
}
request(method, url, params, returnAll) {
var requestConfig = {
headers: {
// 'Content-Type': method == 'GET' ? 'application/json' : 'application/x-www-form-urlencoded; charset=UTF-8'
'Content-Type': 'application/json'
},
method
}
if (method === 'GET') {
var paramsArray = []
params && Object.keys(params).forEach(key => paramsArray.push(key + '=' + params[key]))
if (url.search(/\?/) === -1) {
url += '?' + paramsArray.join('&')
} else {
url += '&' + paramsArray.join('&')
}
}
if (method === 'POST') {
Object.defineProperty(requestConfig, 'body', {
value: JSON.stringify(params)
})
}
return window
.fetch(this.DOMAIN + `/${url}`, requestConfig)
.then(res => {
return res.json()
})
// .catch(error => {
// alert(error)
// })
}
}
export default Request
@import './normalize.scss';
@font-face {
font-family: 'PingFangSC-Regular';
src: url('../font/PingFang-Regular.ttf');
}
html,
body .app {
color: #333333;
font-family: 'PingFangSC-Regular', Arial, Helvetica, 'STHeiti STXihei', 'Microsoft YaHei', Tohoma, sans-serif;
background-color: #fff;
-webkit-overflow-scrolling: touch;
height: 100%;
// overflow: hidden;
--themeColor: #3975c6;
}
img {
width: 100%;
height: 100%;
vertical-align: top;
}
.flex {
display: flex;
align-items: center;
}
.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: #1d1c1c;
// overflow: hidden;
}
.inline {
display: inline-block;
}
.title {
font-size: 0.75vw;
color: #e8e8e8;
// line-height: 2.1vh;
font-weight: 400;
padding: 0.5vh 8px;
user-select: none;
box-sizing: border-box;
height: 3.1vh;
overflow: hidden;
}
.title-icon {
display: flex;
align-items: center;
.icon {
display: inline-block;
width: 4px;
height: 4px;
background: #eb6001;
box-shadow: 0px 0px 5px 5px rgba(255, 104, 0, 0.3);
border-radius: 1px;
margin-right: 6px;
}
}
.container {
margin: 0 8px;
}
.empty {
display: flex;
width: 100%;
height: calc(100% - 4.1vh);
align-items: center;
justify-content: center;
img {
max-width: 20vh;
height: 9.5vh;
}
}
\ No newline at end of file
No preview for this file type
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>时间</title>
<g id="飞机稿" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="广汇BI设计稿" transform="translate(-1250.000000, -8.000000)" fill-rule="nonzero">
<g id="编组-2备份-8" transform="translate(159.000000, 6.000000)">
<g id="编组-14" transform="translate(1091.000000, 0.000000)">
<g id="时间" transform="translate(0.000000, 2.000000)">
<rect id="矩形" fill="#000000" opacity="0" x="0" y="0" width="16" height="16"></rect>
<path d="M13.72,11.4261667 C13.5778787,11.6629587 13.2707088,11.7397046 13.0339167,11.5975833 C12.7971246,11.455462 12.7203787,11.1482921 12.8625,10.9115 C13.3904053,10.0322179 13.6684418,9.02558172 13.6666667,8 C13.6666667,4.87033333 11.1296667,2.33333333 8,2.33333333 C4.87033333,2.33333333 2.33333333,4.87033333 2.33333333,8 C2.33333333,11.1296667 4.87033333,13.6666667 8,13.6666667 C9.02543715,13.6684819 10.0319479,13.3905634 10.9111667,12.8628333 C11.0643443,12.7709268 11.2549178,12.7677209 11.4111001,12.8544233 C11.5672823,12.9411257 11.6653454,13.1045643 11.6683501,13.2831733 C11.6713547,13.4617823 11.5788443,13.6284268 11.4256667,13.7203333 C10.3910338,14.3413182 9.20668308,14.6684926 8,14.6666743 C4.31816667,14.6666743 1.33333333,11.6818333 1.33333333,8 C1.33333333,4.31816667 4.31816667,1.33333333 8,1.33333333 C11.6818333,1.33333333 14.6666667,4.31816666 14.6666667,8 C14.6666667,9.22333333 14.3361667,10.3995 13.72,11.4261667 Z M5.1465,10.1465 L7.5,7.79283333 L7.5,5 C7.5,4.72385763 7.72385763,4.5 8,4.5 C8.27614237,4.5 8.5,4.72385763 8.5,5 L8.5,8 C8.5,8.13259741 8.44727469,8.25975363 8.3535,8.3535 L5.8535,10.8535 C5.72796276,10.9834783 5.54206105,11.0356063 5.36724634,10.9898486 C5.19243162,10.9440909 5.05590914,10.8075684 5.01015142,10.6327537 C4.9643937,10.4579389 5.01652171,10.2720372 5.1465,10.1465 L5.1465,10.1465 Z" id="形状" fill="#EB6001"></path>
</g>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>标题</title>
<defs>
<radialGradient cx="50%" cy="50%" fx="50%" fy="50%" r="82.6455241%" gradientTransform="translate(0.500000,0.500000),scale(1.000000,0.966292),rotate(90.000000),translate(-0.500000,-0.500000)" id="radialGradient-1">
<stop stop-color="#FFAA01" offset="0%"></stop>
<stop stop-color="#FE7200" offset="100%"></stop>
</radialGradient>
</defs>
<g id="飞机稿" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.985056559">
<g id="广汇BI设计稿" transform="translate(-28.000000, -61.000000)">
<g id="标题备份" transform="translate(24.000000, 56.000000)">
<g id="标题" transform="translate(4.000000, 5.000000)">
<rect id="矩形" x="0" y="0" width="14" height="14"></rect>
<path d="M4.0988764,1 L4.0988764,3 L3.13258427,3 L3.13258427,11 L4.0988764,11 L4.0988764,13 L1.2,13 L1.2,1 L4.0988764,1 Z M12.7955056,1 L12.7955056,13 L9.89662921,13 L9.89662921,11 L10.8629213,11 L10.8629213,3 L9.89662921,3 L9.89662921,1 L12.7955056,1 Z M6.99775281,5 C8.06508963,5 8.93033708,5.8954305 8.93033708,7 C8.93033708,8.1045695 8.06508963,9 6.99775281,9 C5.93041599,9 5.06516854,8.1045695 5.06516854,7 C5.06516854,5.8954305 5.93041599,5 6.99775281,5 Z" id="形状" fill="url(#radialGradient-1)"></path>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
import Vue from 'vue'
export const Util = {
getExplorer: function () {
var ua = navigator.userAgent.toLocaleLowerCase()
var browserType = null
if (ua.match(/msie/) != null || ua.match(/trident/) != null) {
browserType = 'IE'
} else if (ua.match(/firefox/) != null) {
browserType = '火狐'
} else if (ua.match(/ubrowser/) != null) {
browserType = 'UC'
} else if (ua.match(/opera/) != null) {
browserType = '欧朋'
} else if (ua.match(/bidubrowser/) != null) {
browserType = '百度'
} else if (ua.match(/metasr/) != null) {
browserType = '搜狗'
} else if (
ua.match(/tencenttraveler/) != null ||
ua.match(/qqbrowse/) != null
) {
browserType = 'QQ'
} else if (ua.match(/maxthon/) != null) {
browserType = '遨游'
} else {
browserType = '谷歌'
}
return browserType
},
exportFn: function (url) {
console.log(url)
let browserType = getExplorer()
if (browserType == 'QQ') {
window.open(url)
return
}
let iframe = document.createElement('iframe')
console.log(iframe)
iframe.style.display = 'none'
iframe.src = url
document.body.appendChild(iframe)
console.log(document.body)
},
deepClone: function (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] = Util.deepClone(obj[attr])
}
}
return copy
}
throw new Error("Unable to clone obj! Its type isn't supported.")
},
timeTransfer: function (time) {
const date = new Date(time)
const y = date.getFullYear()
let m = date.getMonth() + 1
m = m < 10 ? '0' + m : m
let d = date.getDate()
d = d < 10 ? '0' + d : d
let h = date.getHours()
h = h < 10 ? '0' + h : h
let minute = date.getMinutes()
minute = minute < 10 ? '0' + minute : minute
let s = date.getSeconds()
s = s < 10 ? '0' + s : s
return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + s
},
}
export const getExplorer = Util.getExplorer
export const exportFn = Util.exportFn
export const deepClone = Util.deepClone
export const timeTransfer = Util.timeTransfer
<template>
<div class="gl-dialog-wrap " :class="mode" :id="idDom" >
<el-dialog v-bind="$attrs" v-on="$listeners">
<template v-slot:title>
<!-- 标题插槽 -->
<slot name="title" v-if="!bigTitle"></slot>
<template v-if="bigTitle">
<template v-if="mode === 'big'">
<span class="el-dialog__title" v-if="!$slots.custombigtitle">
{{ bigTitle }}
</span>
<span class="el-dialog__title" v-if="$slots.custombigtitle">
<!-- 大弹窗自定义插槽 -->
<slot name="custombigtitle"></slot>
</span>
<button type="button" aria-label="Close" class="el-dialog__headerbtn">
<!-- <i v-if="mode === 'big'" class="el-icon-full-screen full-screen" @click="fullScreenFn"></i> -->
<i v-if="mode === 'big'" :class="isFull ? 's-full-screen' : 'full-screen'" @click="fullScreenFn"></i>
<!-- <i class="el-icon-close "></i> -->
</button>
</template>
</template>
</template>
<template v-slot:default>
<!-- 默认插槽 -->
<slot name="default" v-if="!content"></slot>
<template v-if="content">
<div v-if="mode === 'small'" class="small-content">
<i :class="iconType"></i>
<div class="content">{{ content }}</div>
</div>
<div v-else class="content">{{ content }}</div>
</template>
</template>
<template v-slot:footer v-if="hasFooter">
<template v-if="!$slots.footer">
<span class="dialog-footer">
<el-button plain size="small" class="btn-three" @click="cancel">{{ cancelName }}</el-button>
<el-button type="primary" size="small" @click="ok">{{ okName }}</el-button>
</span>
</template>
<!-- footer插槽 -->
<slot name="footer" v-if="$slots.footer"></slot>
</template>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'GlDialog',
inheritAttrs: false,
// 传入width会覆盖默认的宽度
props: {
// 弹框模式
mode: {
type: String,
// `big` / `mid` / `small`
default: 'mid'
},
// 是否有按钮
hasFooter: {
type: Boolean,
default: true
},
// 取消按钮名称
cancelText: {
type: String,
default: ''
},
// 确定按钮名称
okText: {
type: String,
default: ''
},
// 大标题(不与title(低)共存)
bigTitle: {
type: String,
default: ''
},
// 内容(small生效)
content: {
type: String,
default: ''
},
// 消息类型(图标,small生效)
type: {
type: String,
// `success` / `info` / `warning` / `error`
default: ''
},
// 是否添加到body
appendToBody:{
type: Boolean,
default: false
}
},
data() {
return {
isFull: false,
idDom:Math.random().toString(36).slice(-8)
}
},
mounted(){
document.addEventListener('keyup', (e)=>{
this.keyupHook(e)
});
if (this.appendToBody) {
document.body.appendChild(this.$el);
}
},
computed: {
okName: function() {
let resName
switch (this.mode) {
case 'small':
resName = this.okText ? this.okText : '是'
break
default:
resName = this.okText ? this.okText : '确定'
break
}
return resName
},
cancelName: function() {
let resName
switch (this.mode) {
case 'small':
resName = this.cancelText ? this.cancelText : '否'
break
default:
resName = this.cancelText ? this.cancelText : '取消'
break
}
return resName
},
iconType: function() {
let type
switch (this.type) {
case 'success':
type = 'el-icon-success'
break
case 'info':
type = 'el-icon-info'
break
case 'warning':
type = 'el-icon-warning'
break
case 'error':
type = 'el-icon-error'
break
}
return type
}
},
methods: {
ok() {
// 这是确认事件
this.$emit('onOk')
},
cancel() {
// 这是取消事件
this.$emit('onCancel')
},
escFn(){
setTimeout(() => {
this.isFull = false
this.exitFullscreenHook()
},300)
},
fullScreenFn() {
if(this.isFull){
this.exitFullscreenHook()
this.isFull = false
}else{
this.fullScreenHook()
this.isFull = true
}
},
fullScreenHook(){
const rootdom = document.getElementById(this.idDom)
const dialog = rootdom.getElementsByClassName('el-dialog')[0]
const dialogBody = rootdom.getElementsByClassName('el-dialog__body')[0]
dialog.style.margin = 0
dialog.style.width = window.innerWidth +'px'
dialog.style.height = window.innerHeight +'px'
// dialogBody.style.maxHeight = window.innerHeight -60 -40 -64 + 'px'
dialogBody.style.minHeight = window.innerHeight -60 -40 -64 + 'px'
},
exitFullscreenHook(){
const rootdom = document.getElementById(this.idDom)
const dialog = rootdom.getElementsByClassName('el-dialog')[0]
const dialogBody = rootdom.getElementsByClassName('el-dialog__body')[0]
if(dialogBody){
// dialogBody.style.maxHeight = '586px'
dialogBody.style.minHeight = '156px'
}
dialog.style.margin = '15vh auto 50px'
dialog.style.width = 1080 +'px'
dialog.style.height = 'auto'
},
keyupHook(e){
if(this.isFull){
if( e.key === 'Escape'){
this.escFn()
}
}
}
},
beforeDestroy(){
document.removeEventListener('keyup',(e)=>{
this.keyupHook(e)
})
if (this.appendToBody && this.$el && this.$el.parentNode) {
this.$el.parentNode.removeChild(this.$el);
}
}
}
</script>
<style lang="scss">
.gl-dialog-wrap {
&.big {
.el-dialog {
width: 1080px;
}
.el-dialog__body {
min-height: 156px;
max-height: 586px;
}
}
&.mid {
.el-dialog {
width: 720px;
}
.el-dialog__body {
min-height: 156px;
max-height: 586px;
}
}
&.small {
.el-dialog {
width: 576px;
}
.el-dialog__body {
height: 152px;
}
.el-dialog__footer {
text-align: center;
}
.small-content {
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.el-icon-success {
font-size: 48px;
color: #67c23a;
}
.el-icon-info {
font-size: 48px;
color: #909399;
}
.el-icon-warning {
font-size: 48px;
color: #e6a23c;
}
.el-icon-error {
font-size: 48px;
color: #f56c6c;
}
.content {
margin-top: 16px;
}
}
}
.el-dialog__header {
//padding: 16px 20px;
background: #0A0909;
.el-dialog__title{
color: #FFFFFF;
}
.el-dialog__headerbtn {
top: 18px;
font-size: 24px;
font-weight: 600;
line-height: 24px;
color: #000;
.full-screen {
display: block;
margin-right: 34px;
width: 24px;
height: 24px;
background-image: url('../assets/images/full-screen.png');
background-size: 100% 100%;
// &:hover {
// color: $color-primary;
// }
}
.s-full-screen {
display: block;
margin-right: 34px;
width: 24px;
height: 24px;
background-image: url('../assets/images/full-screen.png');
background-size: 100% 100%;
}
}
}
.el-dialog__body {
padding: 20px;
overflow: auto;
background: #0A0909;
}
.el-dialog__footer {
padding: 15px 20px 16px;
background: #0A0909;
}
.el-table .el-table__row td {
height: 40px;
}
}
</style>
<template>
<div class="line-box">
<div :id="domId" class="line-chart"></div>
<div class="rank-box">
<div class="rank-title-block">
<p :class="['rank-title', rankFlag == 'top' ? 'rank-title-active' : '']" @click="handleRankChange('top')">前5{{ storeOrBrandTxt }}</p>
<p :class="['rank-title', rankFlag == 'last' ? 'rank-title-active' : '']" @click="handleRankChange('last')">后5{{ storeOrBrandTxt }}</p>
</div>
<div class="rank-block">
<div class="rank-line" v-for="(item, index) in rankList" :key="index">
<div class="line-item">
<marquee :direction="directionTimer" :delay="delayTimer" :text="item.label"></marquee>
</div>
<div class="line-item">
<span class="txt-orange" :direction="directionTimer" :delay="delayTimer">{{ item.value }}</span>
</div>
<!-- <div class="line-item">
<marquee class="txt-orange" :direction="directionTimer" :delay="delayTimer" :text="item.value"></marquee>
</div> -->
</div>
</div>
</div>
</div>
</template>
<script>
import datas from '@/utils/data'
import * as echarts from 'echarts'
import getLineOptions from './lineOptions'
export default {
name: 'LineChart',
props: {
domId: {
type: String,
default: 'line-chart'
},
storeOrBrandTxt: {
type: String,
default: '品牌'
},
dataList: {
type: Array,
default: () => []
},
queryType: {
type: Number,
default: 0
},
tooltipFormatterObj: {
type: Array,
default: () => {
return [
{
label: '数量',
attrName: 'num'
},
{
label: '环比',
attrName: 'hrate',
addSymbol: '%'
},
{
label: '同比',
attrName: 'trate',
addSymbol: '%'
}
]
}
}
},
data() {
return {
directionTimer: datas.DefaultData.directionTimer,
delayTimer: datas.DefaultData.delayTimer,
rankFlag: 'top',
lineOptions: [],
rankList: [],
echartsLine: '',
moveAttr: {
// speed: 900,
seriesIndex: 0,
dataIndex: 0
},
timer: null
}
},
created() {
this.lineOptions = getLineOptions({ tooltipFormatter: this.tooltipFormatter })
},
mounted() {
this.lineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.lineDom)
this.chartBindEvent()
},
methods: {
resetRankList() {
this.rankList = new Array(5).fill({ label: '- -', value: '- -' })
},
tooltipFormatter(obj) {
var currentItem = this.dataList[obj[0].dataIndex]
var txt = ''
txt = currentItem.statDate
this.tooltipFormatterObj.forEach(item => {
if (txt) {
txt = txt + '<br>'
}
txt = txt + item.label + ':' + currentItem[item.attrName] + (item.addSymbol || '')
})
return txt
},
chartBindEvent() {
// resize
window.addEventListener('resize', () => {
this[this.domId].resize()
})
// 鼠标划入
// this[this.domId].on('mouseover', data => {
// console.log(data,'data')
// this.moveAttr.dataIndex = data.dataIndex
// console.log(2222222222)
// this.getRankList(this.moveAttr.dataIndex, this.rankFlag + 'List')
// })
// 绑定点击事件
this[this.domId].getZr().on('mousemove', params => {
const pointInPixel = [params.offsetX, params.offsetY]
if (this[this.domId].containPixel('grid', pointInPixel)) {
this[this.domId].getZr().setCursorStyle('pointer')
var xIndex = this[this.domId].convertFromPixel({ seriesIndex: 0 }, [params.offsetX, params.offsetY])[0]
/* 事件处理代码书写位置 */
this.moveAttr.dataIndex = xIndex
this.getRankList(this.moveAttr.dataIndex, this.rankFlag + 'List')
}
})
this[this.domId].on('mouseout', params => {
var pointInPixel = [params.offsetX, params.offsetY]
if (!this[this.domId].containPixel('grid', pointInPixel)) {
this[this.domId].getZr().setCursorStyle('default')
}
})
// 移除图表
this[this.domId].on('globalout', () => {
this.chartAction()
this.getRankList(this.dataList.length - 1, this.rankFlag + 'List')
})
},
chartAction(type) {
this[this.domId].dispatchAction({
type: type || 'showTip',
seriesIndex: 0,
dataIndex: this.dataList.length - 1
})
},
getRankList(idx, attrName = 'topList') {
this.dataList[idx][attrName].length ? this.$set(this, 'rankList', this.dataList[idx][attrName]) : this.resetRankList()
},
drawLine() {
this.lineOptions.xAxis.data = []
this.dataList.map(e => {
let month = new Date(e.statDate).getMonth()
this.lineOptions.xAxis.data.push(this.queryType == 0 ? `${month == 0 ? '1月' : `${Number(month) + 1}月`}` : e.statDate.split('-').slice(1).join('-'))
})
var seriesDate = this.dataList.map(item => +item.num)
this.lineOptions.series[0].data = seriesDate
this.lineOptions.yAxis.scale = true
// this.lineOptions.yAxis.min = Math.min(...seriesDate)
// this.lineOptions.yAxis.max = Math.max(...seriesDate)
this[this.domId].setOption(this.lineOptions)
// 默认展示tooltip
this.chartAction()
this.getRankList(this.dataList.length - 1)
},
handleRankChange(value) {
this.rankFlag = value
this.getRankList(this.moveAttr.dataIndex, this.rankFlag + 'List')
}
}
}
</script>
<style lang="scss" scoped>
p {
margin: 0 0;
}
.line-box {
height: 100%;
color: #ffffff;
// padding: 4px 8px;
font-size: 0.75em;
overflow: hidden;
.txt-orange {
color: #eb6001;
}
.line-chart {
width: 100%;
height: calc(100% - 3.1vh - 4.6vh);
}
.rank-box {
box-sizing: border-box;
display: flex;
height: 4.6vh;
padding: 0.5vh 0.87vh;
border-top: 1px solid #373739;
.rank-title-block {
// flex: 0 0 55px;
width: 55px;
.rank-title {
box-sizing: border-box;
width: 100%;
text-align: center;
// font-size: 0.6em;
font-size: 9px;
background: #353535;
padding: 0.2vh 5px;
height: 1.8vh;
opacity: 0.7;
cursor: pointer;
}
.rank-title-active {
opacity: 1;
width: 100%;
color: #ffffff;
background: #eb6001;
}
}
.rank-block {
width: calc(100% - 55px);
display: flex;
.rank-line {
box-sizing: border-box;
width: 20%;
padding: 0 6px;
border-left: 1px solid rgba(96, 98, 102, 0.4);
.line-item {
height: 1.8vh;
width: 100%;
font-size: 0.55vw;
padding-bottom: 0.3vh;
}
.line-item:last-of-type {
padding-bottom: 0;
}
}
.rank-line:first-of-type {
border-width: 0;
}
}
}
}
::v-deep.line-chart {
width: 100%;
height: 100%;
div {
&:nth-child(1) {
width: 100% !important;
height: 100% !important;
canvas {
width: 100% !important;
height: 100% !important;
}
}
}
}
</style>
<template>
<div class="marquee-box" ref="marqueeBox">
<span class="marquee" ref="marqueeText" :style="[{ transition: `all ${move ? speed : 0}s linear` }, { left: target }]">{{ text }}</span>
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: 'Marquee',
props: {
text: String,
direction: {
type: Number,
default: 5000
},
delay: {
type: Number,
default: 1000
}
},
data () {
return {
move: false,
valueWidth: 0,
target: 0,
boxWidth: 0,
speed: 0
}
},
watch:{
'text'(n){
if(n)setTimeout(() => {
let { marqueeBox, marqueeText } = this.$refs
if (!marqueeBox) return
let boxWidth = marqueeBox.offsetWidth,
valueWidth = marqueeText.offsetWidth
this.valueWidth = valueWidth
this.boxWidth = boxWidth
if (boxWidth - 10 <= valueWidth) this.run(valueWidth)
}, this.delay)
}
},
mounted () {
},
methods: {
run () {
let { valueWidth, direction } = this
this.target = `-${valueWidth}px`
this.move = true
this.speed = direction / 1000
setTimeout(() => {
this.again()
}, direction)
},
again () {
let { boxWidth, valueWidth, direction } = this
this.move = false
this.target = `${boxWidth}px`
setTimeout(() => {
this.speed = direction * (boxWidth / valueWidth).toFixed(2) / 1000
this.move = true
this.reset()
}, 500)
},
reset () {
let awaitTime = (this.speed + 2) * this.delay
this.target = 0
setTimeout(() => {
this.run()
}, awaitTime)
}
}
}
</script>
<style scoped lang="scss">
.marquee-box {
width: 100%;
height: 100%;
overflow: hidden;
position: relative;
.marquee {
position: absolute;
white-space: nowrap;
display: flex;
align-items: center;
}
.move {
transform: translateX(-100%);
}
}
</style>
<template>
<div class="pie-box">
<div :id="id" :style="{ height: height }" class="pie-chart"></div>
<div class="center-content" :style="{ fontSize: size }">
<div :class="[id, 'center-content-num']"></div>
</div>
<div class="content-desc">
<div class="content-desc-icon" :style="{ background: descColor }"></div>
{{ numDesc }}
</div>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: 'PieChart',
props: {
id: {
type: String,
default: ''
},
keys: {
type: Array,
default: () => ['name', 'value']
},
height: {
type: String,
default: '12.7vh'
},
list: {
type: Array,
default: () => []
},
radius: {
type: Array,
default: () => ['50%', '70%']
},
colors: {
type: Array,
default: () => ['#4FA0FF', '#FF6E76', '#7CFFB2', '#FDF006', '#EB6001', '#F5AA01', '#BF98FF', '#58D9F9']
},
size: {
type: String,
default: '0.6vw'
}
},
data() {
return {
option: '',
echartsPie: '',
mTime: '',
viewData: [],
text: '',
subtext: '',
currentIndex: -1,
mainValue: 0,
numDesc: '',
descColor: ''
}
},
watch: {
list: {
handler(newVal) {
if (newVal.length > 0) {
this.initData()
this.$nextTick(() => {
this.draw()
})
}
},
immediate: true
}
},
mounted() {
// this.initData()
// this.draw()
},
methods: {
//初始化数据
initData() {
let { list, keys } = this
this.viewData = []
list.forEach(item => {
this.viewData.push({
name: item[keys[0]],
value: item[keys[1]]
})
})
},
draw() {
if (this.mTime) clearInterval(this.mTime)
this.echartsPie = echarts.init(document.getElementById(this.id))
window.addEventListener('resize', () => {
this.echartsPie.resize()
})
// 指定图表的配置项和数据
this.option = {
// tooltip: {
// trigger: 'item'
// },
color: this.colors,
series: [
{
name: '客户年龄分布',
type: 'pie',
radius: this.radius,
center: ['50%', '50%'],
avoidLabelOverlap: false,
label: {
normal: {
show: false,
position: 'center'
},
show: false,
position: 'center'
},
emphasis: {
label: {
show: false,
fontSize: '14',
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: this.viewData,
minAngle: 30
}
]
}
this.echartsPie.clear()
this.mainValue = 0
this.numDesc = ''
// this.setAnamiteText()
this.echartsPie.setOption(this.option)
this.pieActive()
this.mTime = setInterval(this.pieActive, 15000)
// 鼠标划出
this.echartsPie.on('mouseout', () => {
if (this.mTime) clearInterval(this.mTime)
this.mTime = setInterval(this.pieActive, 15000)
})
this.echartsPie.on('mouseover', data => {
this.mainValue = data.data.value
this.numDesc = data.data.name
this.descColor = data.color
this.setAnamiteText()
// 停止定时器,清除之前的高亮
clearInterval(this.mTime)
this.currentIndex = data.dataIndex
this.highlightPie()
this.emitEvent(data.data)
})
},
// 事件触发
emitEvent(data) {
this.text = data.name
this.subtext = data.value
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.currentIndex
this.mainValue = this.option.series[0].data[this.currentIndex].value
this.numDesc = this.option.series[0].data[this.currentIndex].name
this.descColor = this.option.color[this.currentIndex]
this.setAnamiteText()
},
setAnamiteText() {
// document.querySelector(`.${this.id}`).nextElementSibling.style = 'animation-iteration-count:infinite;'
if (document.querySelector(`.${this.id}`)) document.querySelector(`.${this.id}`).style = `--step:${this.mainValue}`
// setTimeout(() => {
// document.querySelector(`.${this.id}`).nextElementSibling.style = 'animation-iteration-count:0'
// }, 3000)
},
//高亮
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 {
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
// font-size: 0.6vw;
color: #fff;
--step: 0;
counter-reset: count var(--step);
z-index: var(--step);
transition: --step 0.5s;
&::before {
content: counter(count);
}
}
&-desc {
font-size: 0.5vw;
color: #606266;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
animation: rotateIn 3s infinite;
}
}
.content-desc {
display:flex;
align-items: center;
font-size: 8px;
color: #c8c8c8;
text-align: center;
font-weight: 400;
position: absolute;
top: 91%;
left: 50%;
transform: translateX(-50%);
text-align: center;
height: 14px !important;
white-space: nowrap;
&-icon {
width: 8px;
height: 4px;
border-radius: 2px;
margin-right:4px;
}
}
}
@property --step {
syntax: '<integer>';
inherits: false;
initial-value: 15;
}
@keyframes rotateIn {
from {
transform: rotateY(0turn);
}
to {
transform: rotateY(-1turn);
}
}
</style>
<!--
* @Description:
* @Author: huyue
* @Date: 2022-06-28 15:20:14
* @LastEditors: huyue
* @LastEditTime: 2022-07-08 19:03:36
-->
<template>
<div class="ranking-container">
<div class="ranking-title">{{ this.$store.state.app.reportParams.brand ? '门店' : '品牌' }}排名</div>
<div class="ranking">
<div class="brand flex" v-for="(item, index) in brandList" :key="index">
<span class="brand-num">{{ index + 1 }}</span>
<marquee class="marquee" :direction="directionTimer" :delay="delayTimer" :text="item" />
</div>
</div>
</div>
</template>
<script>
export default {
name: 'RanKing',
props: {
list: {
type: Array,
default: () => []
}
},
watch: {
list: {
handler(newVal) {
this.brandList = newVal
}
}
},
data() {
return {
delayTimer: 3000,
directionTimer: 3000,
brandList: this.list,
isBrandName: false
}
}
}
</script>
<style lang="scss" scoped>
.ranking-container {
flex: 1;
margin-left: 0.6vw;
box-sizing: border-box;
height: 12.7vh;
background: #262525;
.ranking-title {
background: rgba(53, 53, 53, 0.6);
font-size: 0.694vw;
color: #eb6001;
font-weight: 400;
padding: 0.4vh 0 0.4vh 20%;
box-sizing: border-box;
}
.ranking {
font-size: 0.694vw;
color: #ffffff;
letter-spacing: 0;
font-weight: 400;
padding: 0.2vh 0 0.3vh 8px;
.brand {
// line-height: 1.9vh;
height: 1.9vh;
display: flex;
align-items: center;
.brand-num {
color: #606266;
margin-right: 0.6vw;
display: inline-block;
width: 0.3vw;
text-align: center;
}
.marquee {
width: 80%;
height: 1.9vh;
font-weight: 400;
}
}
}
}
</style>
<template>
<div class='static-rank'>
<view-sub-title :title='title' />
<div class='rank-wrap flex' v-for='(item,index) in rankDataList' :key='index'>
<div class='rank-index'>{{ index + 1 }}</div>
<div class='rank-name'>
<span :title='item[name]'> {{ item[name] }}</span>
</div>
<div>{{ item[numName] }}</div>
</div>
</div>
</template>
<script>
import datas from 'utils/data'
export default {
props: {
title: {
type: String,
default: ''
},
rankDataList: {
type: Array,
default: []
},
name: {
type: String,
default: ''
},
numName: {
type: String,
default: ''
}
},
name: 'StaticRank'
}
</script>
<style lang='scss' scoped>
.static-rank {
margin: 0 3px;
.rank-wrap {
height: 8.9%;
display: grid;
grid-template-columns: 8% 77% 15%;
color: #FFFFFF;
background: #1D1C1C;
font-size: 10px;
line-height: 24px;
padding: 0 8px;
.rank-index {
color: #606266;
}
.rank-name{
cursor: default;
span{
display: block;
width: 93%;
text-overflow:ellipsis;
white-space:nowrap;
overflow:hidden;
}
}
}
}
</style>
<template>
<div class='sub-el-table-column'>
<el-table-column
v-for='(item, index) in reverseData'
:key="index + 'child'"
:label='item.label'
:prop='item.prop'
:width='item.width'
:min-width='item.minWidth'
:fixed='item.fixed'
:align="item.align || 'left'"
:sortable='item.sortable'
:render-header='item.renderHeader'
v-bind='item.columnattrs ? item.columnattrs : {}'
v-on='item.columnlisteners ? item.columnlisteners : {}'>
<template slot-scope='scope'>
<slot v-if='item.addHtml' :name='item.addHtml' :scope='scope.row' :prop='item.prop' :width='item.width'></slot>
<template v-else-if='item.formatter'>
<el-popover
v-if='scope.row[item.prop] && scope.row[item.prop].length >= Math.ceil((item.width - 36) / 14) * item.line'
placement='top' popper-class='base-popper' trigger='hover' :content='item.formatter(scope.row)'>
<span slot='reference' class='line-ellipsis' :style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
{{ item.formatter(scope.row) | lineEllipsis(item.width, item.line) }}
</span>
</el-popover>
<span v-else class='line-ellipsis' :style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
<!-- {{ item.formatter(scope.row) || '--' }} -->
{{ item.formatter(scope.row) | tableCellFormat }}
</span>
</template>
<template v-else-if='getListApi'>
<el-popover
v-if='scope.row[item.prop] && scope.row[item.prop].length >= Math.ceil((item.width - 36) / 14) * item.line'
placement='top' popper-class='base-popper' trigger='hover' :content='scope.row[item.prop]'>
<span slot='reference' class='line-ellipsis' :style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
{{ scope.row[item.prop] | lineEllipsis(item.width, item.line) }}
</span>
</el-popover>
<span v-else class='line-ellipsis' :style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
<!-- {{ scope.row[item.prop] || '--' }} -->
{{ scope.row[item.prop] | tableCellFormat }}
</span>
</template>
<template v-else>
<!-- 大于10或 20个字节长度 -->
<el-popover
v-if='tableData[scope.$index][item.prop] && tableData[scope.$index][item.prop].length >= Math.ceil((item.width - 36) / 14) * item.line'
placement='top' width='200' trigger='hover' :content='tableData[scope.$index][item.prop]'>
<span slot='reference' class='line-ellipsis' :style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
{{ tableData[scope.$index][item.prop] | lineEllipsis(item.width, item.line) }}
</span>
</el-popover>
<!-- <span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="tableData[scope.$index][item.prop]"></span> -->
<span v-else class='line-ellipsis' :style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
<!-- {{ tableData[scope.$index][item.prop] || '--' }} -->
{{ tableData[scope.$index][item.prop] | tableCellFormat }}
</span>
</template>
<template v-if='item.addSymbol'>
<span v-text='item.addSymbol'></span>
</template>
</template>
<!-- 递归 -->
<sub-el-table-column v-if='item.children' :data='item.children' :tableData='tableData'
:getListApi='getListApi'></sub-el-table-column>
</el-table-column>
</div>
</template>
<script>
// import GlSubTableColumn from '../../GlSubTableColumn'
export default {
name: 'SubElTableColumn',
props: {
data: {
type: Array,
default: () => []
},
// 表格数据-外部传入
tableData: {
type: Array,
default: () => []
},
// 获取列表接口
getListApi: {
type: Function,
default: null
}
},
computed: {
reverseData() {
const arr = [...this.data]
const temp = arr.pop()
arr.unshift(temp)
console.log(arr)
console.log(this.tableData)
arr.forEach(item => {
console.log(item.addHtml)
})
return arr
}
}
// components: {
// GlSubTableColumn
// }
// created(){
// // console.log('data',this.data)
// }
}
</script>
<style lang='scss'>
// .sub-el-table-column {
// }
</style>
<template>
<div class='number-box flex'>
<template>
<template>
<div>
{{ num }}
</div>
</template>
</template>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'TransitionNumber',
props: {
num: {
type: Number,
default: 0
}
},
data() {
return {
numList: []
}
},
// watch: {
// num (n) {
// this.numList = []
// setTimeout(() => {
// if (n > 0) {
// document.querySelector(`#${this.idKey}`).style = `--step:${n}`
// setTimeout(() => {
// this.numList = this.setPrice(n)
// }, 1000)
// } else document.querySelector(`#${this.idKey}`).style = `--step:0`
// }, 200)
// }
// },
mounted() {
},
methods: {
setPrice(price) {
let number = (price.toString() || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
return number.split(',')
}
}
}
</script>
<style scoped lang='scss'>
.number-box {
}
.transition-number {
color: inherit;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
--step: 0;
counter-reset: count var(--step);
z-index: var(--step);
transition: --step 1s;
font-size: inherit;
&::before {
content: counter(count);
}
}
@property --step {
syntax: '<integer>';
inherits: false;
initial-value: 15;
}
</style>
<template>
<div class="ViewContainer">
<div class="ViewContainer-title">
<slot name="title" />
</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: 100%;
//height: 100%;
background: #0a0909;
//overflow: hidden;
&-title {
height: 5.85vh;
}
//&-body {
// height: 100%;
//}
}
</style>
<template>
<div class='content'>
<div class='top'>
<view-content-left />
<!-- <div class='line'></div>-->
<view-content-right />
</div>
<div class='bottom'>
<view-content-bottom></view-content-bottom>
</div>
</div>
</template>
<script>
export default {
name: 'ViewContent',
props: {},
data() {
return {}
},
methods: {}
}
</script>
<style scoped lang='scss'>
.content {
width: 100%;
//height: 100%;
box-sizing: border-box;
position: relative;
padding: 1vh 24px 1.1vh;
min-height: 94.15vh;
//z-index: 1000;
.top{
display: grid;
grid-template-columns: 30% 70%;
gap: 0 10px;
//.line{
// background: red;
// height: 100%;
// width: 1px;
//}
}
}
</style>
<template>
<div class='left'>
<div class='top'>
<view-sub-title title='数据总览' />
<view-tabs />
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import datas from '../utils/data'
export default {
name: 'ViewContentLeft',
components: {},
data() {
return {
defaultHeight: datas.DefaultData.defaultPieHeight
}
},
mounted() {
},
methods: {}
}
</script>
<style scoped lang='scss'>
.left {
display: flex;
flex-direction: column;
.top{
height: 100%;
}
}
</style>
<!--
* @Description:
* @Author: huyue
* @Date: 2022-06-23 10:52:23
* @LastEditors: huyue
* @LastEditTime: 2022-06-24 14:44:50
-->
<template>
<div class='right'>
<!-- <view-sub-title title="售后数据总览" />-->
<StaticRank :rankDataList='totalRank' name='viewMerchant' numName='viewNum' title='访问排名' />
<StaticRank :rankDataList='totalRank' name='forwardMerchant' numName='forwardMum' title='转发排名' />
<StaticRank :rankDataList='totalRank' name='clueMerchant' numName='clueMum' title='线索排名' />
<StaticRank :rankDataList='totalRank' name='activateMerchant' numName='activateMum' title='激活排名' />
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'ViewContentRight',
components: {},
data() {
return {
// defaultHeight: datas.DefaultData.defaultLineHeight
totalRank: null
}
},
mounted() {
this.getRank()
},
methods: {
getRank() {
this.api.renewal.getRanking().then(res => {
if (res.code == 0) {
this.totalRank = res.data.dataList
}
})
}
}
}
</script>
<style scoped lang='scss'>
.right {
width: 99%;
display: grid;
grid-template-columns: 25% 25% 25% 25%;
}
</style>
<template>
<div class="control">
<div class="left flex user-select pointer">
<template v-for="(i,index) in tab">
<div
:class="['item flex',index == 0?'text-center':'brand',{'active':tabIndex == index}]"
:key="index"
@click="change(index)"
>
<div class="text text-hide">
{{i}}
</div>
<template v-if="index == 1">
<div class="arrow"></div>
</template>
</div>
</template>
<div
class="options-box"
:key="brandsKey"
ref="brands"
>
<template v-for="(i,index) in brands">
<div
:class="['options-item flex',{'active':i.active}]"
:key="index"
@click="chooseBrand({i,index})"
>
<div class="text-hide">{{i.brandName}}</div>
</div>
</template>
</div>
</div>
<div class="right y-center flex user-select pointer">
<template v-for="(i,index) in options">
<div
:key="index"
@click="reportChange(index)"
:class="['item text-center',{'active':reportIndex == index}]"
>
{{i}}
</div>
</template>
<div :class="['line',`line-${reportIndex}`]"></div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'ViewControl',
data () {
return {
tab: ['广汇集团', '品牌概览'],
tabIndex: 0,
options: ['日表', '月表'],
reportIndex: 1,
brands: [],
brandsKey: Date.now()
}
},
mounted () {
this.api.common.getBrandList().then(({ code, data }) => {
let brands = []
if (code == 0) {
data.dataList.map(e => {
brands.push({
brandName: e,
active: false
})
})
}
this.brands = brands
})
},
methods: {
change (index, item) {
let { tabIndex } = this
if (index == 0) {
if (tabIndex == index) return
this.tab = ['广汇集团', '品牌概览']
this.brands.map(e => e.active = false)
} else {
if (!item) return
this.tab[1] = item.brandName
}
this.tabIndex = index
this.emit()
},
reportChange (index) {
let { reportIndex } = this
if (reportIndex == index) return
this.reportIndex = index
this.emit()
},
emit () {
let { reportIndex, tabIndex, brands } = this
let params = {
reportType: reportIndex == 0 ? 1 : 0 //月表0,日表1
}
if (tabIndex == 1) brands.map(e => {
if (e.active) params.brand = {
name: e.brandName
}
})
this.$store.state.app.reportParams = params
},
chooseBrand ({ i, index }) {
let { brands } = this
brands.map(e => e.active = false)
brands[index].active = true
// this.brandsKey = Date.now()
// this.$refs.brands.style.display = 'none'
this.change(1, i)
},
}
}
</script>
<style scoped lang='scss'>
.control {
position: relative;
.left {
width: 280px;
height: 3.9vh;
background: #383737;
border-radius: 4px;
position: relative;
.item {
font-size: 14px;
color: #eb6001;
font-weight: 600;
border-radius: 4px 0px 0px 4px;
}
.brand {
padding: 0 16px;
border-radius: 0 4px 4px 0;
.text {
width: calc(100% - 20px);
}
&:hover ~ .options-box {
display: block;
}
.arrow {
position: relative;
top: 4.5px;
border-top: 4.5px solid #eb6001;
border-right: 4.5px solid transparent;
border-bottom: 4.5px solid transparent;
border-left: 4.5px solid transparent;
margin-left: auto;
transition: all 0.25s;
}
&:hover {
.arrow {
transform: rotate(-180deg);
top: 0;
}
}
}
.active {
color: #fff;
background: #eb6001;
.arrow {
border-top-color: #fff;
transform: rotate(-180deg);
top: 0;
}
}
.options-box {
display: none;
position: absolute;
top: 4.1vh;
right: 0;
width: 50%;
max-height: 30vh;
background: #383737;
border: 1px solid rgba(96, 98, 102, 1);
box-shadow: 0px 3px 2px 1px rgba(0, 0, 0, 0.5);
border-radius: 4px;
box-sizing: border-box;
z-index: 2;
overflow-y: scroll;
&:hover {
display: block;
}
&:hover .brand {
background-color: #096;
}
.options-item {
height: 2.9vh;
font-size: 12px;
color: #ffffff;
padding-left: 19px;
position: relative;
}
.active,
.options-item:hover {
background: #1e1e1e;
color: #eb6001;
&::after {
position: absolute;
left: 0;
top: 0;
width: 4px;
height: 100%;
content: '';
background-color: #eb6001;
}
}
.active{
position: sticky;
top: 0;
z-index: 2;
left: 0;
}
}
::-webkit-scrollbar {
background-color: #383737;
width: 6px;
position: absolute;
}
::-webkit-scrollbar-thumb {
background: #464646;
border-radius: 3px;
}
}
.right {
width: 120px;
height: 3.4vh;
background: #383737;
border-radius: 2px;
right: -144px;
.item {
font-size: 12px;
color: #e8e8e8;
}
.active {
font-weight: 500;
font-size: 14px;
color: #eb6001;
}
.line {
border-radius: 2px;
background: #eb6001;
width: 32px;
height: 0.4vh;
position: absolute;
bottom: 0;
transform: translateX(-50%);
transition: all 0.25s;
}
.line-0 {
left: 26%;
}
.line-1 {
left: 76%;
}
}
.item {
width: 50%;
height: 100%;
box-sizing: border-box;
transition: all 0.25s;
&:hover {
opacity: 0.75;
}
}
}
</style>
\ No newline at end of file
<template>
<GlDialog mode='big' :bigTitle="'true'" :visible.sync='showFuncIntro' :hasFooter='false'>
<span v-if='selectedData' slot='custombigtitle'>{{ selectedData.merchantName }}-{{ selectedData.activityName
}}-{{ detailTitle }}</span>
<div class='dialogEncircle '>
<glsx-table
:headerStyle="{ color: '#EB6001',background:'#262525', borderColor: 'black' }"
ref='renewalListRef'
:getListApi='getListApi'
:tableParams='tableParams'
:searchForm='renewalSearchForm'
:pageConf='pageConf'>
<template slot='wechatName' slot-scope='scope'>
<div class='wechatWrap'>
<img v-if='scope.scope.wechatimg' class='wechatimg' :src='scope.scope.wechatimg'>
{{ scope.scope.wechatName }}
</div>
</template>
<template slot='phoneNum' slot-scope='scope'>
{{ scope.scope.phoneNum == 'null' || !scope.scope.phoneNum ? '-' : scope.scope.phoneNum }}
</template>
<template slot='shareName' slot-scope='scope'>
<div class='wechatWrap'>
<img v-if="scope.scope.shareimg !== 'null' && scope.scope.shareimg" class='wechatimg'
:src='scope.scope.shareimg'>
{{ scope.scope.shareName == 'null' || !scope.scope.shareName ? '-' : scope.scope.shareName }}
</div>
</template>
<!-- 转发明细员工-->
<template slot='staff' slot-scope='scope'>
<div class='wechatWrap'>
<img v-if='scope.scope.wechatimg' class='wechatimg' :src='scope.scope.wechatimg'>
{{ !scope.scope.staff ? '-' : scope.scope.staff }}
</div>
</template>
<!-- 转发明细核销激励-->
<template slot='writeoffIncentive' slot-scope='scope'>
{{ scope.scope.writeoffIncentive == 'null' ? '-' : scope.scope.writeoffIncentive }}
</template>
<!-- 转化率-->
<template slot='conversionRate' slot-scope='scope'>
{{ scope.scope.writeoffIncentive == 'null' ? '-' : scope.scope.writeoffIncentive }}
</template>
<template slot='userName' slot-scope='scope'>
{{ scope.scope.userName == 'null' ? '-' : scope.scope.userName }}
</template>
<template slot='licensePlate' slot-scope='scope'>
{{ scope.scope.licensePlate == 'null' ? '-' : scope.scope.licensePlate }}
</template>
<template slot='customerName' slot-scope='scope'>
{{ scope.scope.customerName == 'null' || !scope.scope.customerName ? '-' : scope.scope.customerName }}
</template>
<template slot='other' slot-scope='scope'>
{{ scope.scope.other == 'null' || !scope.scope.other ? '-' : scope.scope.other }}
</template>
<template slot='reference' slot-scope='scope'>
{{ scope.scope.reference == 'null' || !scope.scope.reference ? '-' : scope.scope.reference }}
<span v-if='scope.scope.referencetype && scope.scope.reference'
class='referencetype'>@{{ !scope.scope.referencetype || scope.scope.referencetype == 'null' ? '-' : scope.scope.referencetype
}}</span>
</template>
<template slot='lastFollowup' slot-scope='scope'>
<el-switch
v-model="scope.scope.lastFollowup == '是'"
active-color='#EB6001'
inactive-color='#E8E8EA'>
</el-switch>
</template>
</glsx-table>
</div>
</GlDialog>
</template>
<script>
import { tableDetailMixin } from '@/mixins'
export default {
name: 'ViewDialogTable',
mixins: [tableDetailMixin],
props: {
// showFuncIntro: {
// type: Boolean,
// default: false
// },
selectedData: {
type: Object,
default: {}
}
},
data() {
return {
showFuncIntro: false,
getListApi: this.api.renewal.getDetail,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'totalNum' },
tableParams: null,
renewalSearchForm: {
queryItem: '',
// pagenum: '1',
merchantId: '',
activityName: ''
},
detailTitle: ''
}
},
methods: {
switchSelectedType(type) {
switch (type) {
case 'viewActivity':
this.tableParams = this.accessDetailTable
this.renewalSearchForm.queryItem = 'view'
return '访问明细'
case 'forwardActivity':
this.tableParams = this.forwardingDetailTable
this.renewalSearchForm.queryItem = 'forward'
return '转发明细'
case 'clueActivity':
this.tableParams = this.lineDetailTable
this.renewalSearchForm.queryItem = 'clue'
return '线索明细'
case 'activationActivity':
this.tableParams = this.activationDetailTable
this.renewalSearchForm.queryItem = 'activation'
return '激活明细'
}
}
},
watch: {
selectedData: {
handler(newValue, oldValue) {
console.log(newValue)
this.detailTitle = newValue && this.switchSelectedType(newValue.type)
this.renewalSearchForm.activityName = newValue.activityName
// '活动1'
this.renewalSearchForm.merchantId = newValue.merchantId
// '4419194XX'
this.renewalSearchForm.startDate = newValue.params.startDate
this.renewalSearchForm.endDate = newValue.params.endDate
setTimeout(() => {
this.$refs.renewalListRef?.refreshTable()
this.showFuncIntro = true
}, 500)
},
deep: true,
immediate: false
}
}
}
</script>
<style lang='scss' scoped>
.wechatWrap {
display: flex;
align-items: center;
.wechatimg {
width: 32px;
height: 32px;
margin-right: 5px;
}
}
.referencetype {
color: rgb(235, 96, 1);
}
/deep/ .el-table {
background-color: rgba(38, 38, 38, 0.75);
}
</style>
<!--
* @Description: 一行两个一组
* @Author: huyue
* @Date: 2022-06-23 11:28:03
* @LastEditors: huyue
* @LastEditTime: 2022-06-24 14:57:41
-->
<template>
<div class="line-group">
<template v-for="(i, index) in items">
<div class="box" :key="index" :style="[{ height: height }, { 'margin-bottom': hideMargin ? 0 : '1vh' }]">
<slot :name="i"></slot>
</div>
</template>
</div>
</template>
<script type="text/ecmascript-6">
import datas from '../utils/data'
export default {
name: 'ViewLineGroup',
props: {
height: {
type: String,
default: datas.DefaultData.defaultLineHeight + 'vh'
},
hideMargin: Boolean
},
data() {
return {
items: [1, 2]
}
},
mounted() {
},
methods: {
}
}
</script>
<style scoped lang="scss">
//.line-group {
// display: grid;
// grid-template-columns: repeat(2, 1fr);
// gap: 0 8px;
//}
</style>
<template>
<div class="pie-group">
<template v-for="(i, index) in items">
<div class="box" :key="index">
<slot :name="i"></slot>
</div>
</template>
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: 'ViewPieGroup',
props: {},
data() {
return {
items: [1, 2, 3]
}
},
mounted() {
},
methods: {
}
}
</script>
<style scoped lang="scss">
.pie-group {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 0 8px;
.box {
height: 16.6vh;
}
}
</style>
<template>
<div class="sub-title flex user-select box">
<img src="@/assets/images/title.svg" class="logo">
<div class="text">{{title}}</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'ViewSubTitle',
props: ['title'],
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.sub-title {
// height: 24px;
height: 2.9vh;
font-size: 14px;
margin-bottom: .5vh;
.logo{
width: 14px;
margin: 0 4px 0 6px;
}
.text {
color: transparent;
background: linear-gradient(left, #ff6800, #f5aa01);
-webkit-background-clip: text;
}
}
</style>
<template>
<div class='tabs'>
<div class='tab pointer'>
<div class='tab-left box'>
<div :class="{ 'tab-total-box': true }">
<div class='total-title-box flex'>
<div class='title inline total'>已开通门店
<!-- <transition-number :num='dataOverView.openedStores' class='number-total' />-->
<div class='number-total' v-if='dataOverView'>{{ toThousands(dataOverView.openedStores) }}</div>
</div>
<div
:class="{'title':true,'inline':true, 'active': tabIndex == index}"
v-for='(item,index) in tabTitleList'
@click='clickItemTab(index,item)'
:key='index'>{{ item.title }}
<div class='flex' v-if='dataOverView'>
<div class='transition-number'>{{ toThousands(dataOverView[item.type]) }}</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class='tabs-content box' v-loading='loading'>
<div class='tabs-title title-icon'>
<span>
{{ linaBarTitle }}
</span>
</div>
<line-bar :isDatazoom='true' domId='viewTrendDomId' :lineTitle='linaBarTitle' :dataList='viewTrendList' boxHeight='190px'></line-bar>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import { changeMixin } from '@/mixins'
export default {
name: 'ViewTabs',
mixins: [changeMixin],
data() {
return {
loading:false,
tabHead: [],
tabTitle: '客户总数',
tabType: 'total',
tabIndex: 0,
delayTimer: 3000,
directionTimer: 3000,
pageData: {
total: {},
wechat: {},
wechatGroup: {},
applet: {},
publiccus: {}
},
canvas: null,
req: {},
isGroup: true,
updata: Date.now(),
dataOverView: null,
viewTrendList: null,
linaBarTitle: '',
tabType: '',
tabTitleList: [
{ title: '访问量', type: 'views' },
{ title: '转发量', type: 'forward' },
{ title: '线索量', type: 'clue' },
{ title: '激活量', type: 'activation' }
]
}
},
mounted() {
this.init()
},
methods: {
init() {
this.getOverview()
this.getviewTrend()
},
clickItemTab(index, item) {
const { type, title } = item
this.tabIndex = index
this.getviewTrend(type, title)
},
getOverview() {
// this.loading = true
this.api.renewal.getOverview().then(res => {
if (res.code == 0) {
// this.loading = false
this.dataOverView = res.data.dataList[0]
}
})
},
// 获取浏览量趋势
getviewTrend(type = 'view', title = '访问量') {
this.linaBarTitle = title
if (type == 'views') type = 'view'
let params = { queryItem: type }
this.api.renewal.getviewTrend(params).then(res => {
if (res.code == 0) {
this.viewTrendList = res.data.dataList
}
})
}
}
}
</script>
<style scoped lang='scss'>
.tabs {
//margin-bottom: 0.6vh;
.tab {
//height: 7.8vh;
display: grid;
margin-bottom: 3px;
// overflow: hidden;
.tab-total-box {
height: 100%;
padding-left: 8px;
box-sizing: border-box;
.total-title-box {
.number-total {
font-size: 24px;
color: #eb6001;
font-weight: 700;
width: 40%;
}
.transition-number {
font-size: 14px;
color: #f5aa01;
}
.total {
width: 30%;
}
> div {
box-sizing: border-box;
width: 20%;
padding-left: 10px;
//padding-right: 40px;
height: 100%;
}
}
.total-number-box {
.number-total {
font-size: 24px;
color: #eb6001;
font-weight: 700;
//line-height: 3.7vh;
width: 40%;
}
> div {
width: 15%;
font-size: 14px;
color: #f5aa01;
}
}
}
.active {
background: rgba(235, 96, 1, 0.1);
box-sizing: border-box;
border: 1px solid rgba(235, 96, 1, 0.8);
}
}
&-content {
//height: 24.4vh;
height: 67%;
overflow: hidden;
box-sizing: border-box;
padding: 1vh 8px;
display: flex;
flex-direction: column;
//width: 70%;
.tabs-title {
font-size: 12px;
color: #e8e8e8;
&-info {
font-size: 10px;
color: #eb6001;
line-height: 17px;
}
}
//&-chart {
// height: 20.2vh;
// margin-top: auto;
// justify-content: space-between;
// gap: 0 8px;
//
// .line {
// flex: 7;
// justify-content: center;
//
// .canvas {
// width: 100%;
// height: 100%;
// }
//
// .empty-img {
// max-width: 20vh;
// height: 9.5vh;
// }
// }
//
// .table {
// flex: 3;
// background: #262525;
// position: relative;
//
// .table-position {
// position: absolute;
// top: -20px;
// left: 50%;
// transform: translateX(-50%);
// color: #606266 !important;
// }
//
// &-head {
// display: grid;
// grid-template-columns: repeat(2, 50%);
// height: 2.4vh;
//
// &-item {
// height: 100%;
// font-size: 10px;
// background: #353535;
// color: rgba($color: #fff, $alpha: 0.7);
// justify-content: center;
//
// &:hover {
// opacity: 0.9;
// }
// }
//
// .active {
// background: #eb6001;
// color: #fff;
// }
// }
//
// &-body {
// height: calc(100% - 2.4vh);
//
// &-item {
// //line-height: 3.4vh;
// width: 100%;
// font-size: 10px;
// color: #ffffff;
//
// .table-num {
// width: 22px;
// justify-content: center;
// color: #606266;
// }
//
// .table-key {
// width: calc(100% - 96px);
// //height: 3.6vh;
// }
//
// .tab-value {
// width: 52px;
// margin-left: auto;
// padding-right: 4px;
// }
// }
// }
// }
//
// > div {
// height: 100%;
// }
//}
}
}
</style>
<template>
<div class="content flex">
<div class="logo user-select">
<img src="@/assets/images/logo.svg" alt="logo" />
</div>
<div class="view-title flex user-select">广汇续保数字化数据看板</div>
<div class="time">
<div class="top flex">
<img src="@/assets/images/time.svg" class="icon" />
<div class="now">{{ now }}</div>
<div class="yesterday">数据截止至 {{ yesterday }}</div>
</div>
<!-- <div class="bottom flex">-->
<!-- <div class="merchant">已同步门店数:{{ merchantNum.totalNum }}</div>-->
<!-- <div class="merchant">上月新接入店数:{{merchantNum.increLastMonthNum}}</div>-->
<!-- <div class="merchant">本月新接入店数:{{merchantNum.increThisMonthNum}}</div>-->
<!-- </div>-->
</div>
<!-- <div class="center-control">-->
<!-- <view-control />-->
<!-- </div>-->
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: 'ViewTitle',
data() {
return {
yesterday: '',
now: new Date().format('yyyy-MM-dd hh:mm:ss'),
// merchantNum: {
// totalNum: '--',
// increLastMonthNum: '--',
// increThisMonthNum: '--'
// }
}
},
mounted() {
this.yesterday = new Date(new Date().setDate(new Date().getDate() - 1)).format('yyyy-MM-dd')
this.timer()
// this.getMerchantNum()
},
methods: {
timer() {
setInterval(() => {
this.now = new Date().format('yyyy-MM-dd hh:mm:ss')
}, 1e3)
},
// getMerchantNum() {
// this.api.overview.getMerchantNum({}).then(res => {
// if (res.code === '0') {
// this.merchantNum = res.data.dataList[0]
// }
// })
// }
}
}
</script>
<style scoped lang="scss">
.content {
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 0 24px;
position: relative;
background: #1d1c1c;
z-index: 1000;
.view-title {
color: transparent;
background: linear-gradient(left, #e60115 10%, #eb6001 25%, #f5aa01 50%, #fdf006 100%);
-webkit-background-clip: text;
font-size: 18px;
font-weight: 600;
&::before {
content: '';
display: block;
background: #373739;
width: 1px;
height: 20px;
margin: 0 8px;
}
}
.time {
margin-left: auto;
text-align: right;
font-size: 14px;
color: #ffffff;
.top {
justify-content: flex-end;
.yesterday {
font-size: 10px;
color: #606266;
margin-left: 5px;
}
}
.icon {
width: 16px;
height: 16px;
margin-right: 8px;
}
.bottom {
font-size: 10px;
line-height: 16px;
color: #fff;
.merchant {
color: #eb6001;
margin-right: 10px;
padding-right: 10px;
line-height: 2vh;
position: relative;
&::after {
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
width: 1px;
height: 1.5vh;
content: '';
background-color: #EB6001;
}
&:last-child{
margin-right: 0;
&::after {
width: 0;
}
}
}
}
}
.center-control {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
z-index: 2;
}
}
</style>
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-08 19:20:13
* @LastEditors: limin
* @LastEditTime: 2021-06-25 18:09:28
*/
import Vue from 'vue'
const componentsFiles = require.context(`./`, true, /.vue$/)
componentsFiles.keys().forEach(path => {
const component = componentsFiles(path).default
Vue.component(component.name, component)
})
\ No newline at end of file
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:43:46
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 11:30:04
* @FilePath: \dj-data-view\src\components\barChart.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class='line-box'>
<div :id='domId' class='line-chart' :lineTitle='lineTitle' :style='{ height: boxHeight }'></div>
</div>
</template>
<script>
import datas from '@/utils/data'
import * as echarts from 'echarts'
import { lineAndBarOptions, lineAndBarZoomOptions } from './options'
export default {
name: 'lineBar',
props: {
domId: {
type: String,
default: 'line-chart'
},
lineTitle: {
type: String,
default: ''
},
isDatazoom: {
type: Boolean,
default: false
},
revese: {
type: Boolean,
default: false
},
boxHeight: {
type: String,
default: '13.83vh'
},
storeOrBrandTxt: {
type: String,
default: '品牌'
},
displayName: {
type: Object,
default: () => {
}
},
dataList: {
type: Array,
default: () => []
},
// 0-月表;1-日表
queryType: {
type: Number,
default: 0
},
tooltipFormatterObj: {
type: Array,
default: () => {
return [
{
label: '数量',
attrName: 'num'
},
{
label: '环比',
attrName: 'hrate',
addSymbol: '%'
},
{
label: '同比',
attrName: 'trate',
addSymbol: '%'
}
]
}
}
},
data() {
return {
directionTimer: datas.DefaultData.directionTimer,
delayTimer: datas.DefaultData.delayTimer,
rankFlag: 'top',
lineOptions: [],
rankList: [],
echartsLine: '',
moveAttr: {
// speed: 900,
seriesIndex: 0,
dataIndex: 0
},
timer: null
}
},
watch: {
dataList: {
handler() {
this.lineOptions = this.isDatazoom ? lineAndBarZoomOptions(this.dataList, this.displayName,this.lineTitle) : lineAndBarOptions(this.dataList, this.displayName,this.lineTitle)
this.chartBindEvent()
},
deep: true
}
},
mounted() {
this.lineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.lineDom)
},
methods: {
chartBindEvent() {
this[this.domId].setOption(this.lineOptions)
// if (this.domId === 'glLineBar' || this.domId == 'ghLineBar') (
this[this.domId].on('click', (params) => {
const month = params.name
const type = this.domId
if (this.domId === 'glLineBar') {
(
this.$bus.$emit('updataGLRank', { month, type })
)
}
if (this.domId === 'ghLineBar') {
(
this.$bus.$emit('updataGHRank', { month, type })
)
}
})
// )
}
}
}
</script>
<style lang='scss' scoped>
.line-box {
height: 100%;
color: #ffffff;
.txt-orange {
color: #eb6001;
}
.line-chart {
width: 100%;
}
}
</style>
function getLineOptions(obj) {
const { tooltipFormatter } = obj
var lineOptions = {
tooltip: {
trigger: 'axis',
borderWidth: 0,
backgroundColor: 'rgba(68,68,68,0.80)',
textStyle: {
color: '#FFFFFF',
fontSize: '1.5px'
},
formatter: tooltipFormatter || '',
confine: true
},
grid: {
left: '3%',
right: '4%',
top: '10%',
bottom: '10%',
containLabel: true
},
xAxis: {
type: 'category',
axisLabel: {
color: '#606266',
fontSize: '0.8em'
},
data: []
},
yAxis: {
type: 'value',
splitLine: {
lineStyle: {
color: 'rgba(96,98,102,0.2)'
}
},
splitNumber: 4
},
series: [
{
type: 'line',
symbol: 'circle',
itemStyle: {
color: '#F5AA01'
},
// 平滑曲线
smooth: true,
showSymbol: false,
// 折线背景色
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: 'rgba(254, 84, 0, 0.3)'
},
{
offset: 1,
color: 'rgba(254, 84, 0, 0.01)'
}
]
}
},
data: []
}
]
}
return lineOptions
}
export default getLineOptions
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-08 16:55:43
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
const environment = process.env.VUE_APP_ENV || 'production'
let config = require('./env.' + environment)
module.exports = config
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-28 10:13:38
*/
// 本地环境配置
module.exports = {
envVersion: 'trial',
title: '广汇续保权益数据看板',
request: {
// baseURL: 'http://192.168.3.126:8081', // 本地测试项目地址,
// baseURL: 'http://192.168.1.160:8081', // 本地开发项目地址,
// baseURL: 'http://192.168.1.158:9996',
baseURL: 'http://192.168.1.152:8089',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
response: {
data_key: 'data',
message_key: 'message',
code_key: 'code',
code_success_value: '0',
errId_logout_value: '21',
logout_function: 'reLogin',
code_message_map: {}
},
}
module.exports = {
title: '广汇续保权益数据看板',
request: {
// baseURL: 'http://ghwx.cgacar.com/scrm-wechat' // 生产
baseURL: 'http://cim.chinagrandauto.com/scrm-wechat' // 生产
// baseURL: 'http://cim.chinagrandauto.com' // 生产
},
APPID: 'xxx',
APPSECRET: 'xxx',
cdn: 'https://www.xxx.cn/static'
}
module.exports = {
title: '广汇汽车服务',
request: {
baseURL: 'http://xxxxx' // 项目地址
},
APPID: 'xxx',
APPSECRET: 'xxx',
cdn: 'https://www.xxx.cn/static'
}
\ No newline at end of file
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-30 11:23:25
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
let config = require('./conf.js')
let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) {
if (isEnv) {
let { request } = config
Object.assign(request, { timeout })
return Promise.resolve(config)
}
// /**测试mock */ return window.fetch('https://oss-config.dev.glsx.com.cn/mock/62bd8142304f1311a3b76a04/data-view/config', {}).then(res => res.json())
/**测试mock */ return window.fetch('https://oss-config.dev.glsx.com.cn/mock/64aba6b2356f1a5a63fd0b4e/renewal-interest/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: limin
* @LastEditTime: 2021-06-29 15:35:47
*/
// 兼容 IE
// https://github.com/zloirock/core-js/blob/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md#babelpolyfill
// import 'core-js/stable'
// import 'regenerator-runtime/runtime'
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import api from './api'
import { Util } from './common/util'
import Request from './api/request'
import { fetchConfig, cfg } from '@/config'
import Plugin from 'v-fit-columns';
import '@/assets/css/index.scss'
import './utils/util'
import 'components'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.prototype.$Utils = Util
Vue.prototype.to = function (name, params) {
if (name === -1) {
router.go(-1)
return
}
router.push({ name, params })
}
// 移动端适配 rem
// import 'lib-flexible/flexible.js'
Vue.config.productionTip = false
const isMock = ['prod','production'].includes(process.env.NODE_ENV)
fetchConfig(!isMock).then(res => {
// 从配置服务器获取动态配置
// 设置 js中可以访问 $cdn
Vue.use(cfg)
Vue.use(ElementUI);
Vue.use(Plugin);
// if (res.vconsole) new VConsole()
window.$HTTP = new Request(res.request)
Vue.prototype.api = api
window.vm = new Vue({
el: '#app',
router,
store,
render: h => h(App)
})
})
export default {
watch: {
watchReportParams: {
immediate: true,
handler(newval) {
this && this.init && this.init(newval)
}
}
},
computed: {
watchReportParams() {
return this.$store.state.app.reportParams
}
}
}
import { changeMixin } from './index'
export default {
data() {
return {
clientData: [],
brandList: [],
distributionRank: '',
isBrand: false,
brandName: ''
}
},
mixins: [changeMixin],
created() {
// this.getClientData()
},
methods: {
getClientData() {
let clientApi = !this.isBrand ? 'overalldistribution' : 'merchantOveralldistribution'
const params = {
req: {
queryItem: this.type,
queryTime: this.getCurrentDate()
}
}
if (this.isBrand) params.req.brandName = this.brandName
this.api.customer[clientApi](params).then(res => {
this.clientData = []
this.brandList = []
this.distributionRank = ''
if (res.data.dataList.length > 0) {
let distribution = JSON.parse(res.data.dataList[0].distribution)
const keys = Object.keys(distribution)
keys.forEach((item, index) => {
this.clientData.push({
name: item,
value: distribution[item]
})
})
this.distributionRank = JSON.parse(res.data.dataList[0].distributionRank)
}
})
},
init(newVal) {
this.isBrand = false
if (newVal.brand) {
this.isBrand = true
this.brandName = newVal.brand.name
}
this.getClientData()
},
pieAction(data) {
this.brandList = []
let array = this.distributionRank && this.distributionRank[data.name]
if (array&&array.length > 0) {
for (let i of array) {
this.brandList.push(i && Object.keys(i)[0])
}
}
}
}
}
import changeMixin from './changeMixin'
import clientMixin from './clientMixin'
import salesMixin from './salesMixin'
import tableDetailMixin from './tableDetailMixin'
export {
changeMixin,
clientMixin,
salesMixin,
tableDetailMixin
}
import { changeMixin } from './index'
export default {
data() {
return {
salesData: [],
brandList: [],
typeRanking: '',
isBrand: false,
brandName: ''
}
},
mixins: [changeMixin],
created() {
// this.getSalesData()
},
methods: {
getSalesData() {
let salesApi = !this.isBrand ? 'getSales' : 'getMerchantSales'
const params = {
req: {
queryItem: this.type,
queryTime: this.getCurrentDate(),
queryType: this.watchReportParams.reportType
}
}
if (this.isBrand) params.req.brandName = this.brandName
this.api.sales[salesApi](params).then(res => {
this.salesData = []
this.typeRanking = ''
this.brandList = []
if (res.data.dataList.length > 0) {
let typeNum = JSON.parse(res.data.dataList[0].typeNum)
Object.keys(typeNum).forEach((item, index) => {
this.salesData.push({
name: item,
value: typeNum[item]
})
})
this.typeRanking = JSON.parse(res.data.dataList[0].typeRanking)
}
})
},
init(newVal) {
this.isBrand = false
if (newVal.brand) {
this.isBrand = true
this.brandName = newVal.brand.name
}
this.getSalesData()
},
pieAction(data) {
this.brandList = []
let array = this.typeRanking && this.typeRanking[data.name]
if (array&&array.length > 0) {
for (let i of array) {
this.brandList.push(i && Object.keys(i)[0])
}
}
}
}
}
export default {
data() {
return {
accessDetailTable: {
listName: 'viewDetail',
tableOption: false,
tableColumns: [
{
label: '微信昵称',
prop: 'wechatName',
width: 200,
addHtml: 'wechatName',
line: 1
},
{
label: '手机号',
prop: 'phoneNum',
width: 140,
addHtml: 'phoneNum'
},
{
label: '分享人',
prop: 'shareName',
width: '160',
addHtml: 'shareName'
},
{
label: '访问时长',
prop: 'viewTime'
},
{
label: '进入页面时间',
prop: 'enterPageTime',
width: 220
},
{
label: '离开页面时间',
prop: 'leavingPageTime',
width: 220
},
{
label: '订单状态',
prop: 'orderstatus'
}
]
},
forwardingDetailTable: {
listName: 'forwardDetail',
tableOption: false,
tableColumns: [
{
label: '员工',
prop: 'staff',
width: 220,
line: 1,
addHtml: 'staff'
},
{
label: '转发次数',
prop: 'forwardNum',
width: 100
},
{
label: '访客总数',
prop: 'visitTotal',
width: '120'
},
{
label: '浏览总数',
prop: 'viewTotal'
},
{
label: '成交单量',
prop: 'orderFilled'
},
{
label: '客户回店核销次数',
prop: 'writeoffNum'
},
{
label: '核销激励',
prop: 'writeoffIncentive',
width: '180',
addHtml: 'writeoffIncentive'
},
{
label: '转化率',
prop: 'conversionRate',
width: '180',
addHtml: 'conversionRate'
}
]
},
lineDetailTable: {
listName: 'clueDetail',
tableOption: false,
tableColumns: [
{
label: '微信昵称',
prop: 'wechatName',
width: 200,
line: 1,
addHtml: 'wechatName'
},
{
label: '手机号',
prop: 'phoneNum',
width: 200,
addHtml: 'phoneNum'
},
{
label: '分享人',
prop: 'shareName',
width: 160,
addHtml: 'shareName'
},
{
label: '用户名',
prop: 'userName',
addHtml: 'userName'
},
{
label: '车牌',
prop: 'licensePlate',
addHtml: 'licensePlate'
},
{
label: '浏览次数',
prop: 'viewNum'
},
{
label: '最后浏览时间',
prop: 'lastViewTime',
width: '220'
},
{
label: '最后跟进',
prop: 'lastFollowup',
width: '180',
addHtml: 'lastFollowup'
}
]
},
activationDetailTable: {
listName: 'activationDetail',
tableOption: false,
tableColumns: [
{
label: '客户名称',
prop: 'customerName',
// width: 200,
line: 1,
addHtml: 'customerName'
},
{
label: '手机号',
prop: 'phoneNum',
// width: 180,
addHtml:'phoneNum'
},
{
label: '其他',
prop: 'other',
// width: '150',
addHtml: 'other'
},
{
label: '微信名称',
prop: 'wechatName',
width: 220,
addHtml: 'wechatName',
line: 1
},
{
label: '推荐人',
prop: 'reference',
width: 200,
addHtml: 'reference'
}
]
}
}
}
}
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-09 17:11:43
*/
import router from './router'
import { keeps } from './routes'
export const keepAlives = keeps
router.beforeEach((to, from, next) => {
// 如果用户访问的登录页,直接放行
if (to.path === '/login') return next()
// 从sessionStorage中获取到保存的token值
const tokenStr = window.sessionStorage.getItem('token')
// 没有token,强制跳转到登录页
if (!tokenStr) return next('/login')
next()
})
export default router
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-09 10:59:50
* @LastEditors: limin
* @LastEditTime: 2021-06-29 14:51:39
*/
import Vue from 'vue'
import Router from 'vue-router'
import routes from './routes'
// hack router push callback
const originalPush = Router.prototype.push
Router.prototype.push = function push (location, onResolve, onReject) {
if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
return originalPush.call(this, location).catch(err => err)
}
Vue.use(Router)
const router = createRouter()
function createRouter () {
return new Router({
// mode: 'history', // 如果是 history模式 需要配置vue.config.js publicPath
base: process.env.BASE_URL,
scrollBehavior: function (to, from, savedPosition) {
return savedPosition || { x: 0, y: 0 }
},
routes
})
}
// http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-main/
router.beforeEach((to, from, next) => {
next()
})
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter () {
const newRouter = createRouter()
router.matcher = newRouter.matcher // reset router
}
export default router
\ No newline at end of file
const pages = [
{
name: 'login',
meta: {
// isTab: true,
keepAlive: true,
backgroundColor: '#F7F7F7'
},
children: []
},
{
name: 'home',
meta: {
isTab: true,
keepAlive: true,
backgroundColor: '#F7F7F7'
},
children: []
}
]
const keepAlives = []
const setChildren = (e, parent) => {
let arr = []
e.children.map(child => {
const { children, meta } = child
let url = `${parent}/${child.name}`
let name = url.replace(/\//g, '.')
let route = {
path: `/${url}`,
name,
meta: meta || {},
component: resolve => require([`views/${url}.vue`], resolve)
}
if (meta && meta.keepAlive) keepAlives.push(name)
if (children) route.children = setChildren(child, url)
arr.push(route)
})
return arr
}
const getPages = _ => {
let router = [
{
path: '/',
name: 'login',
redirect: '/login',
component: resolve => require([`views/login/index.vue`], resolve)
},
{
path: '/',
name: 'home',
component: resolve => require([`views/home.vue`], resolve)
}
]
router[1].children = pages.map(e => {
let name = `${e.name}`
let route = {
path: `/${name}`,
name,
meta: e.meta || {},
component: resolve => require([`views/${name}/index.vue`], resolve)
}
if (e.children) route.children = setChildren(e, name)
if (e.meta && e.meta.keepAlive) keepAlives.push(name)
return route
})
return [...router]
}
export const keeps = keepAlives
export default getPages()
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-20 12:49:54
* @FilePath: \gh-hall\src\store\getters.js
*/
const getters = {
app: state => state.app
}
export default getters
import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import app from './modules/app'
// import createPersistedState from "vuex-persistedstate"
Vue.use(Vuex)
const store = new Vuex.Store({
modules: {
app
},
getters
// plugins: [createPersistedState({
// //指定存储模式
// storage: window.sessionStorage
// })]
})
export default store
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-07-06 12:02:21
*/
const state = {
reportParams: {
reportType: 0 //月表0,日表1
}
}
const mutations = {
SET_PAGE_META (state, meta) {
state.pageMeta = meta
},
}
const actions = {
// 设置name
setUserInfo ({ commit }, user) {
commit('SET_USER_INFO', user)
},
}
export default {
state,
mutations,
actions
}
/*
* @Description: 公共数据
* @Author: huyue
* @Date: 2022-06-23 17:38:33
* @LastEditors: huyue
* @LastEditTime: 2022-06-29 19:47:34
*/
const DefaultData = {
defaultLineHeight: '19.8',
defaultPieHeight: '16.6',
directionTimer: 3000,
delayTimer: 3000
}
const Customer = {
age: {
name: '年龄区间',
value: [
{ name: '未知', value: 0 },
{ name: '18~25', value: 1 },
{ name: '26~30', value: 2 },
{ name: '31~35', value: 3 },
{ name: '36~40', value: 4 },
{ name: '41~45', value: 5 },
{ name: '46~50', value: 6 },
{ name: '50+', value: 7 }
]
},
sex: {
name: '性别',
value: [
{ name: '未知', value: 0 },
{ name: '男', value: 1 },
{ name: '女', value: 2 }
]
},
carPeriod: {
name: '购车年限',
value: [
{ name: '未知', value: 0 },
{ name: '1年内', value: 0 },
{ name: '1年', value: 0 },
{ name: '2年', value: 0 },
{ name: '3年', value: 0 },
{ name: '4年', value: 0 },
{ name: '5年', value: 0 },
{ name: '5年+', value: 0 }
]
},
enterCategory: {
name: '进店类型',
value: [
{ name: '展厅客户', value: 15 },
{ name: '网电客户', value: 16 },
{ name: '其他客户', value: 17 }
]
},
infoFrom: {
name: '信息来源',
value: [
{ name: '自然进店', value: 25 },
{ name: '报纸', value: 26 },
{ name: '电台', value: 27 },
{ name: '网络', value: 28 },
{ name: '朋友介绍', value: 31 },
{ name: '广告牌', value: 32 },
{ name: '车展', value: 35 },
{ name: '其他', value: 36 }
]
},
level: {
name: '客户级别',
value: [
{ name: 'H(一周內)', value: 37 },
{ name: 'A(半个月內)', value: 38 },
{ name: 'B(1个月内)', value: 39 },
{ name: 'C(3个月内)', value: 40 },
{ name: 'N(3个月后 )', value: 41 },
{ name: 'F(战败)', value: 42 },
{ name: 'O(订车)', value: 43 }
]
},
valueType: {
name: '价值类型',
value: [
{ name: '重要价值', value: 1 },
{ name: '重要发展', value: 2 },
{ name: '重要召回', value: 3 },
{ name: '重要挽留', value: 4 },
{ name: '一般价值', value: 5 },
{ name: '一般发展', value: 6 },
{ name: '一般召回', value: 7 },
{ name: '一般挽留', value: 8 }
]
}
}
export default Object.freeze({
DefaultData,
Customer
})
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-20 12:49:11
*/
import util from './util'
export { util }
\ No newline at end of file
import Vue from 'vue'
import { Toast, Dialog } from 'vant'
/**
* 日期格式化
* let time = new Date().format('yyyy-MM-dd hh:mm:ss')
*/
Date.prototype.format = function(fmt) {
let o = {
'M+': this.getMonth() + 1, //月份
'd+': this.getDate(), //日
'h+': this.getHours(), //小时
'm+': this.getMinutes(), //分
's+': this.getSeconds(), //秒
//季度
'q+': Math.floor((this.getMonth() + 3) / 3),
S: this.getMilliseconds() //毫秒
}
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
}
for (let k in o) {
if (new RegExp(`(${k})`).test(fmt)) {
fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length))
}
}
return fmt
}
const throttle = (fn, gapTime) => {
if (gapTime == null || gapTime == undefined) {
gapTime = 1500
}
let _lastTime = null
return function() {
let _nowTime = +new Date()
if (_nowTime - _lastTime > gapTime || !_lastTime) {
fn.apply(this, arguments)
_lastTime = _nowTime
}
}
}
/**num:要转换的数值,fixed:精确几位小数 */
const decimal = (num, fixed) => {
let pow = Math.pow(10, fixed)
return Math.round(num * pow) / pow
}
const toTop = () => {
let bodySrcollTop = document.body.scrollTop
if (bodySrcollTop !== 0) {
document.body.scrollTop = 0
return
}
let docSrcollTop = document.documentElement.scrollTop
if (docSrcollTop !== 0) {
document.documentElement.scrollTop = 0
}
}
const getParams = () => {
return window.vm.$route.params
}
const getQuery = name => {
let [url, paramsList] = window.location.href.split('?')
if (!paramsList) return name ? null : {}
let param = paramsList.split('&')
let obj = {}
param.map(e => {
let [key, value] = e.split('=')
obj[key] = value
})
return name ? obj[name] : obj
}
/** 三个数字加一个逗号 */
const numAddSymbol = val => {
return (val + '').replace(/\B(?=(?:\d{3})+\b)/g, ',')
}
// 获取当前时间
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 toThousands = n => {
return n && n.toString().replace(/\d+/, function(m) {
return m.replace(/(\d)(?=(\d{3})+$)/g, function(y) {
return y + ','
})
})
}
const utils = {
getParams,
getQuery,
throttle,
decimal,
toTop,
numAddSymbol,
getCurrentDate,
getNDate,
getNMonth,
debounce,
setChartFontSize,
toThousands
}
Object.keys(utils).map(key => {
Vue.prototype[key] = utils[key]
})
export default utils
<!-- home -->
<template>
<div class="data-view-container">
<transition name="fade">
<keep-alive v-if="$route.meta.keepAlive">
<router-view></router-view>
</keep-alive>
</transition>
<transition name="fade">
<router-view v-if="!$route.meta.keepAlive"></router-view>
</transition>
</div>
</template>
<script>
export default {
data () {
return {
}
},
mounted () { },
methods: {}
}
</script>
<style lang="scss" scoped>
</style>
<template>
<div class="layout">
<view-container>
<template #title>
<view-title>
</view-title>
</template>
<template #content>
<view-content></view-content>
</template>
</view-container>
</div>
</template>
<script>
export default {
name: '',
data () {
return {}
},
mounted () { },
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>
<template>
<div class='login-container'>
<div class='login-top flex'>
<div class='view-title user-select flex'>广汇续保数字化数据看板</div>
</div>
<div class='login-center flex'>
<div class='authorization-wrap'>
<div class='username-wrap flex'>
<img class='user-icon' src='../../../src/assets/images/login/login-user-icon.png'>
<el-input class='user-input' placeholder='请输入用户名' v-model='userName'></el-input>
</div>
<div class='password-wrap flex'>
<img class='user-icon' src='../../../src/assets/images/login/login-psw-icon.png'>
<el-input class='user-input' placeholder='请输入密码' v-model='passWord' show-password></el-input>
</div>
<div class='login-btn' @click='login'>
<!-- <el-button @click='login'>登录</el-button>-->
<div class='login-button'>
<img class='login-button-icon' src='../../../src/assets/images/login/login-button.png'>
<div>登录</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'login',
data() {
return {
userName: '',
passWord: '',
accountPassword: {
'ghxbac': 'ghxbacpw',
'glyunying': 'yunying88'
}
}
},
methods: {
login() {
let user = this.userName
let pwd = this.passWord
if (!user || !pwd) {
this.$message.error('请输入账号密码')
} else {
if (Object.keys(this.accountPassword).includes(user)) {
if (pwd == this.accountPassword[user]) {
window.sessionStorage.setItem('token', 'xixixihhhhhxixixi12345sfascasf')
this.$router.push('./home')
} else {
this.$message.error('密码错误')
}
} else {
this.$message.error('该用户名不存在')
}
}
}
}
}
</script>
<style lang='scss' scoped>
.user-icon {
width: 80px;
height: 80px;
margin-right: 8px;
}
.login-container {
width: 100%;
height: 100%;
background-image: url('./../../assets/images/login/login-bg.png');
background-repeat: no-repeat;
background-size: 100% 100%;
overflow: hidden;
.login-top {
width: 100%;
height: 18vh;
margin-top: 15px;
background-image: url('./../../assets/images/login/login-top.png');
background-repeat: no-repeat;
background-size: 100% 100%;
justify-content: center;
.view-title {
color: transparent;
background: linear-gradient(left, #e60115 10%, #eb6001 25%, #f5aa01 50%, #fdf006 100%);
-webkit-background-clip: text;
font-size: 30px;
font-weight: 600;
margin-top: -9vh;
&::before {
content: '';
display: block;
background: #373739;
width: 1px;
height: 20px;
//margin: 0 8px;
}
}
}
.login-center {
margin: 0 auto;
width: 1068.03px;
height: 500px;
//display: block;
background-image: url('./../../assets/images/login/login-center.png');
background-repeat: no-repeat;
background-size: 100% 100%;
justify-content: center;
align-items: center;
position: relative;
.authorization-wrap {
margin-bottom: 10%;
.password-wrap {
margin-top: 20px;
}
.user-input {
/deep/ .el-input__inner {
background: linear-gradient(269deg, #ff660000 0%, #fb6900c7 51%, #FA6A00 98%);
border: none;
//opacity: 0.67;
color: #FFFFFF;
}
/deep/ .el-input__inner::placeholder {
color: #FFFFFF;
}
}
}
.login-btn {
position: absolute;
bottom: 10%;
width: 312.71px;
height: 89.52px;
background-image: url('./../../assets/images/login/login-bottom.png');
background-repeat: no-repeat;
background-size: 100% 100%;
display: flex;
justify-content: center;
color: #FFFFFF;
font-weight: 600;
font-size: 24px;
text-align: center;
.login-button {
margin-top: 1vh;
.login-button-icon {
width: 28px;
height: 28px;
}
}
}
}
}
</style>
'use strict'
const path = require('path')
const defaultSettings = require('./src/config/conf.js')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const resolve = dir => path.join(__dirname, dir)
// page title
const name = defaultSettings.title || 'vue mobile template'
// 生产环境,测试和正式
const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV)
module.exports = {
publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-lwk/', // 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: '/dj-scrm-wx-work-main/', // 署应用包时的基本 URL。 vue-router history模式使用 微信开发环境需打开
outputDir: `dist`, // 生产环境构建文件的目录
assetsDir: 'static', // outputDir的静态资源(js、css、img、fonts)目录
lintOnSave: !IS_PROD,
productionSourceMap: false, // 如果不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
devServer: {
disableHostCheck: true,
host: '0.0.0.0',
port: 9527, // 端口
open: false, // 启动后打开浏览器.
// public: 'http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-lwk/#/',
overlay: {
// 当出现编译器错误或警告时,在浏览器中显示全屏覆盖层
warnings: false,
errors: true
},
proxy: {
'/dev': {
target: 'http://192.168.1.152:8081',
changeOrigin: true,
ws: true,
pathRewrite: {
'^/dev': ''
},
onProxyReq: (proxyReq, req, res) => {
}
},
'/test': {
target: 'http://192.168.3.126:8081',
changeOrigin: true,
ws: true,
pathRewrite: {
'^/test': ''
},
onProxyReq: (proxyReq, req, res) => {
}
}
}
},
css: {
extract: IS_PROD, // 是否将组件中的 CSS 提取至一个独立的 CSS 文件中 (而不是动态注入到 JavaScript 中的 inline 代码)。
sourceMap: false,
loaderOptions: {
scss: {
// 向全局sass样式传入共享的全局变量, $src可以配置图片cdn前缀
// 详情: https://cli.vuejs.org/guide/css.html#passing-options-to-pre-processor-loaders
prependData: `
$cdn: "${defaultSettings.cdn}";
`
}
}
},
configureWebpack: config => {
config.name = name
config.resolve.modules = ['node_modules', './src/assets/spritesmith']
const Plugins = []
config.plugins = [...config.plugins, ...Plugins]
// 为生产环境修改配置...
// if (IS_PROD) {
// // externals
// config.externals = externals
// }
},
chainWebpack: config => {
config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test
// 别名 alias
config.resolve.alias
.set('@', resolve('src'))
.set('assets', resolve('src/assets'))
.set('api', resolve('src/api'))
.set('views', resolve('src/views'))
.set('components', resolve('src/components'))
.set('plugins', resolve('src/components'))
.set('utils', resolve('src/utils'))
/**
* 添加CDN参数到htmlWebpackPlugin配置中
*/
// config.plugin('html').tap(args => {
// if (IS_PROD) {
// args[0].cdn = cdn.build
// } else {
// args[0].cdn = cdn.dev
// }
// return args
// })
/**
* 设置保留空格
*/
config.module
.rule('vue')
.use('vue-loader')
.loader('vue-loader')
.tap(options => {
options.compilerOptions.preserveWhitespace = true
return options
})
.end()
/**
* 打包分析
*/
if (IS_PROD) {
config.plugin('webpack-report').use(BundleAnalyzerPlugin, [
{
analyzerMode: 'static'
}
])
}
config
// https://webpack.js.org/configuration/devtool/#development
.when(!IS_PROD, config => config.devtool('cheap-source-map'))
config.when(IS_PROD, config => {
config
.plugin('ScriptExtHtmlWebpackPlugin')
.after('html')
.use('script-ext-html-webpack-plugin', [
{
// 将 runtime 作为内联引入不单独存在
inline: /runtime\..*\.js$/
}
])
.end()
config.optimization.splitChunks({
chunks: 'all',
cacheGroups: {
// cacheGroups 下可以可以配置多个组,每个组根据test设置条件,符合test条件的模块
commons: {
name: 'chunk-commons',
test: resolve('src/components'),
minChunks: 3, // 被至少用三次以上打包分离
priority: 5, // 优先级
reuseExistingChunk: true // 表示是否使用已有的 chunk,如果为 true 则表示如果当前的 chunk 包含的模块已经被抽取出去了,那么将不会重新生成新的。
},
node_vendors: {
name: 'chunk-libs',
chunks: 'initial', // 只打包初始时依赖的第三方
test: /[\\/]node_modules[\\/]/,
priority: 10
},
vantUI: {
name: 'chunk-vantUI', // 单独将 vantUI 拆包
priority: 20, // 数字大权重到,满足多个 cacheGroups 的条件时候分到权重高的
test: /[\\/]node_modules[\\/]_?vant(.*)/
}
}
})
config.optimization.runtimeChunk('single')
})
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!