张雄 3 years ago
parent 902607f8cd
commit a4ab724eab

@ -207,4 +207,163 @@ export function getSalesSpecNameTypesByMpv(params) {
'content-type': 'application/x-www-form-urlencoded'
}
})
}
// 传统燃油 - 主销价格区间 - 国别区间
export function getSalesPriceRangeSTypes(params) {
let obj = Object.assign({action: 'getSalesPriceRangeSTypes', sType: 'Marketing'}, params)
return httpService({
url: `/api/v6.ashx`,
method: 'post',
data: obj,
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
})
}
// 传统燃油 - 主销价格区间 - 品牌top区间
export function getSalesPriceRangeSBrand(params) {
let obj = Object.assign({action: 'getSalesPriceRangeSBrand', sType: 'Marketing'}, params)
return httpService({
url: `/api/v6.ashx`,
method: 'post',
data: obj,
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
})
}
// 传统燃油 - 主销价格区间占比
export function getSalesSpecNameByPriceRange(params) {
let obj = Object.assign({action: 'getSalesSpecNameByPriceRange', sType: 'Marketing'}, params)
return httpService({
url: `/api/v6.ashx`,
method: 'post',
data: obj,
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
})
}
// 新能源 - 能源类型
export function getSalesEnergyTypesE(params) {
let obj = Object.assign({action: 'getSalesEnergyTypesE', sType: 'Marketing'}, params)
return httpService({
url: `/api/v6.ashx`,
method: 'post',
data: obj,
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
})
}
// 新能源 - 国别占比
export function getSalesCountrysTypesE(params) {
let obj = Object.assign({action: 'getSalesCountrysTypesE', sType: 'Marketing'}, params)
return httpService({
url: `/api/v6.ashx`,
method: 'post',
data: obj,
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
})
}
// 新能源 - 细分车型 全部类别
export function getSalesSpecNameTypesE(params) {
let obj = Object.assign({action: 'getSalesSpecNameTypesE', sType: 'Marketing'}, params)
return httpService({
url: `/api/v6.ashx`,
method: 'post',
data: obj,
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
})
}
// 新能源 - 细分车型 suv
export function getSalesSpecNameTypesBySuvE(params) {
let obj = Object.assign({action: 'getSalesSpecNameTypesBySuvE', sType: 'Marketing'}, params)
return httpService({
url: `/api/v6.ashx`,
method: 'post',
data: obj,
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
})
}
// 新能源 - 细分车型 轿车
export function getSalesSpecNameTypesBySedanE(params) {
let obj = Object.assign({action: 'getSalesSpecNameTypesBySedanE', sType: 'Marketing'}, params)
return httpService({
url: `/api/v6.ashx`,
method: 'post',
data: obj,
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
})
}
// 新能源 - 细分车型 mpv
export function getSalesSpecNameTypesByMpvE(params) {
let obj = Object.assign({action: 'getSalesSpecNameTypesByMpvE', sType: 'Marketing'}, params)
return httpService({
url: `/api/v6.ashx`,
method: 'post',
data: obj,
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
})
}
// 新能源 - 车型类别 - 轿车同比
export function getSalesSpecName1TypesBySedanE(params) {
let obj = Object.assign({action: 'getSalesSpecName1TypesBySedanE', sType: 'Marketing'}, params)
return httpService({
url: `/api/v6.ashx`,
method: 'post',
data: obj,
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
})
}
// 新能源 - 车型类别 - suv同比
export function getSalesSpecName1TypesBySuvE(params) {
let obj = Object.assign({action: 'getSalesSpecName1TypesBySuvE', sType: 'Marketing'}, params)
return httpService({
url: `/api/v6.ashx`,
method: 'post',
data: obj,
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
})
}
// 新能源 - 车型类别 - mpv同比
export function getSalesSpecName1TypesByMpvE(params) {
let obj = Object.assign({action: 'getSalesSpecName1TypesByMpvE', sType: 'Marketing'}, params)
return httpService({
url: `/api/v6.ashx`,
method: 'post',
data: obj,
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
})
}
// 新能源 - 车型类别 - mpv suv 轿车对比
export function getSalesSpecName1TypesE(params) {
let obj = Object.assign({action: 'getSalesSpecName1TypesE', sType: 'Marketing'}, params)
return httpService({
url: `/api/v6.ashx`,
method: 'post',
data: obj,
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
})
}

@ -1,18 +1,124 @@
<template>
<div>新能源车市场销量分析-国别占比</div>
<div class="nmec-outter">
<v-label-div title="国别主系列占比">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
<div class="d2">
<a-form-model layout="inline">
<a-form-model-item label="选择日期">
<a-month-picker @change="getData" style="width: 146px" :allowClear="false" v-model="selTime[0]" valueFormat="YYYY-MM" placeholder="开始日期"></a-month-picker>
<a-month-picker @change="getData" style="width: 146px" :allowClear="false" v-model="selTime[1]" valueFormat="YYYY-MM" placeholder="结束日期"></a-month-picker>
</a-form-model-item>
</a-form-model>
</div>
<div class="d3">
<v-echarts :opt="opt"></v-echarts>
</div>
</div>
</template>
<script>
import {getSalesCountrysTypesE} from "@/api/SaleRankMarket";
import {getCheZhuLatestTime} from "@/api/SaleRank"
import createOpt from './opt'
export default {
name: 'mneCountryPercent',
data() {
return {
form: {
token: '',
sTimeType: 4,
sStartTime: '',
sEndTime: '',
},
selTime: ['',''],
opt: {},
}
},
created() {
this.form.token = this.getToken;
getCheZhuLatestTime({token: this.form.token}).then(res => {
var dt = new Date(res.data)
var newDt = new Date( (dt.setMonth(dt.getMonth() - 11)) ).toISOString();
this.selTime = [newDt.slice(0,7), res.data];
this.getData()
})
},
methods: {
getData() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
}
getSalesCountrysTypesE(obj).then(res => {
let newData = [];
for(let i=0;i<res.data.length;i++) {
let arr = [];
let total = 0;
res.data[i].Data.forEach(ele => {
total = ele.Value*1 + total;
});
res.data[i].Data.forEach(ele => {
let o = {
Key: ele.Key,
Value: (ele.Value*100/total).toFixed(2)
};
arr.push(o)
});
let obj = {
Time: res.data[i].Time,
Data: arr
};
newData.push(obj)
}
let dx = [];
let ds = [];
newData.forEach((ele) => {
let key = ele.Time;
let value = ele.Data;
dx.push(key);
ds.push(value);
});
this.opt = createOpt(dx, ds);
})
},
report() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
isExcel: 1,
};
getSalesCountrysTypesE(obj).then(() => {
this.$notification.open({
message: `数据生成中`,
description: "请前往个人中心查看下载进度",
placement: "bottomRight",
});
});
}
}
}
</script>
<style lang="less">
.nmec-outter {
width: 1552px;
height: 760px;
border: 2px solid #0f2a4d;
.d2 {
display: flex;
justify-content: flex-start;
padding: 8px 16px 0px 16px;
}
.d3 {
// padding: 0px 16px 16px 16px;
width: 100%;
height: calc(100% - 112px);
}
}
</style>

@ -0,0 +1,146 @@
/*
* @Author: your name
* @Date: 2021-10-09 11:01:19
* @LastEditTime: 2021-12-23 16:37:35
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/Index/spreadTheSound/opt.js
*/
import * as echarts from "echarts";
import {doStr} from "@/utils/gol/dataTool"
import { bigNumberTransform } from "@/utils/gol/dataTool"
let colors = ['#5B8FF9','#7DAAFF','#9AC5FF','#B9E2FF','#3A9EC0','#5BB9DB','#78D4F8','#63AECC','#19A576','#43C090','#43C090','#9DF5CA'
,'#5B8FF9','#7DAAFF','#9AC5FF','#B9E2FF','#3A9EC0','#5BB9DB','#78D4F8','#63AECC','#19A576','#43C090','#43C090','#9DF5CA']
function createData(ds = []) {
let arr = [];
for (let i = 0; i < ds.length; i++) {
let arr1 = ds[i];
for (let j = 0; j < arr1.length; j++) {
let n = arr.findIndex(ele => {
return ele.name === arr1[j].Key;
})
if (n === -1) {
let obj =
{
name: arr1[j].Key,
type: 'bar',
stack: 'total',
barWidth: 48,
barGap: "-100%",
emphasis: {
focus: 'series'
},
label: {
show: true,
position: 'inside',
color: '#FFF',
fontWeight: 600,
formatter: (res) => {
return res.data + '%'
}
},
itemStyle: {
normal: {
//柱体的颜色
//右1000表示从正右开始向左渐变
color: function () {
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colors[j]
},
{
offset: 1,
color: colors[j]
}
], false);
}
}
},
data: [arr1[j].Value]
}
arr.push(obj)
} else {
arr[n].data.push(arr1[j].Value)
}
}
}
return arr;
}
export default function createOpt(dx = [], ds = []) {
const data = createData(ds);
return {
grid: {
left: 10,
right: 10,
bottom: 10,
containLabel: true
},
tooltip: {
trigger: "axis",
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;"
},
color: colors,
legend: {
textStyle: { //图例文字的样式
color: '#fff',
fontSize: 10
},
y: 10,
x: 10,
itemWidth: 12,
itemHeight: 12,
borderRadius: 1, //圆角半径
},
xAxis: {
type: 'category',
axisLabel :{
interval:0,
formatter: (value) => {
let res = doStr(value, 8);
return res
}
},
axisTick: {
show: false,
},
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
data: dx
},
yAxis: {
type: 'value',
max: 100,
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
axisLabel: {
formatter: (value) => {
return value + '%'
}
},
splitLine: {
lineStyle: {
type: "dashed", // y轴分割线类型
color: "#012b4b",
},
},
},
series: data
}
}

@ -1,18 +1,124 @@
<template>
<div>新能源车市场销量分析-能源类型</div>
<div class="mnee-outter">
<v-label-div title="能源类型占比分布">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
<div class="d2">
<a-form-model layout="inline">
<a-form-model-item label="选择日期">
<a-month-picker @change="getData" style="width: 146px" :allowClear="false" v-model="selTime[0]" valueFormat="YYYY-MM" placeholder="开始日期"></a-month-picker>
<a-month-picker @change="getData" style="width: 146px" :allowClear="false" v-model="selTime[1]" valueFormat="YYYY-MM" placeholder="结束日期"></a-month-picker>
</a-form-model-item>
</a-form-model>
</div>
<div class="d3">
<v-echarts :opt="opt"></v-echarts>
</div>
</div>
</template>
<script>
import {getSalesEnergyTypesE} from "@/api/SaleRankMarket";
import {getCheZhuLatestTime} from "@/api/SaleRank"
import createOpt from './opt'
export default {
name: 'mneEnergyType',
data() {
return {
form: {
token: '',
sTimeType: 4,
sStartTime: '',
sEndTime: '',
},
selTime: ['',''],
opt: {},
}
},
created() {
this.form.token = this.getToken;
getCheZhuLatestTime({token: this.form.token}).then(res => {
var dt = new Date(res.data)
var newDt = new Date( (dt.setMonth(dt.getMonth() - 11)) ).toISOString();
this.selTime = [newDt.slice(0,7), res.data];
this.getData()
})
},
methods: {
getData() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
}
getSalesEnergyTypesE(obj).then(res => {
let newData = [];
for(let i=0;i<res.data.length;i++) {
let arr = [];
let total = 0;
res.data[i].Data.forEach(ele => {
total = ele.Value*1 + total;
});
res.data[i].Data.forEach(ele => {
let o = {
Key: ele.Key,
Value: (ele.Value*100/total).toFixed(2)
};
arr.push(o)
});
let obj = {
Time: res.data[i].Time,
Data: arr
};
newData.push(obj)
}
let dx = [];
let ds = [];
newData.forEach((ele) => {
let key = ele.Time;
let value = ele.Data;
dx.push(key);
ds.push(value);
});
this.opt = createOpt(dx, ds);
})
},
report() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
isExcel: 1,
};
getSalesEnergyTypesE(obj).then(() => {
this.$notification.open({
message: `数据生成中`,
description: "请前往个人中心查看下载进度",
placement: "bottomRight",
});
});
}
}
}
</script>
<style lang="less">
.mnee-outter {
width: 1552px;
height: 760px;
border: 2px solid #0f2a4d;
.d2 {
display: flex;
justify-content: flex-start;
padding: 8px 16px 0px 16px;
}
.d3 {
// padding: 0px 16px 16px 16px;
width: 100%;
height: calc(100% - 112px);
}
}
</style>

@ -0,0 +1,146 @@
/*
* @Author: your name
* @Date: 2021-10-09 11:01:19
* @LastEditTime: 2021-12-23 16:37:35
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/Index/spreadTheSound/opt.js
*/
import * as echarts from "echarts";
import {doStr} from "@/utils/gol/dataTool"
import { bigNumberTransform } from "@/utils/gol/dataTool"
let colors = ['#5B8FF9','#7DAAFF','#9AC5FF','#B9E2FF','#3A9EC0','#5BB9DB','#78D4F8','#63AECC','#19A576','#43C090','#43C090','#9DF5CA'
,'#5B8FF9','#7DAAFF','#9AC5FF','#B9E2FF','#3A9EC0','#5BB9DB','#78D4F8','#63AECC','#19A576','#43C090','#43C090','#9DF5CA']
function createData(ds = []) {
let arr = [];
for (let i = 0; i < ds.length; i++) {
let arr1 = ds[i];
for (let j = 0; j < arr1.length; j++) {
let n = arr.findIndex(ele => {
return ele.name === arr1[j].Key;
})
if (n === -1) {
let obj =
{
name: arr1[j].Key,
type: 'bar',
stack: 'total',
barWidth: 48,
barGap: "-100%",
emphasis: {
focus: 'series'
},
label: {
show: true,
position: 'inside',
color: '#FFF',
fontWeight: 600,
formatter: (res) => {
return res.data + '%'
}
},
itemStyle: {
normal: {
//柱体的颜色
//右1000表示从正右开始向左渐变
color: function () {
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colors[j]
},
{
offset: 1,
color: colors[j]
}
], false);
}
}
},
data: [arr1[j].Value]
}
arr.push(obj)
} else {
arr[n].data.push(arr1[j].Value)
}
}
}
return arr;
}
export default function createOpt(dx = [], ds = []) {
const data = createData(ds);
return {
grid: {
left: 10,
right: 10,
bottom: 10,
containLabel: true
},
tooltip: {
trigger: "axis",
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;"
},
color: colors,
legend: {
textStyle: { //图例文字的样式
color: '#fff',
fontSize: 10
},
y: 10,
x: 10,
itemWidth: 12,
itemHeight: 12,
borderRadius: 1, //圆角半径
},
xAxis: {
type: 'category',
axisLabel :{
interval:0,
formatter: (value) => {
let res = doStr(value, 8);
return res
}
},
axisTick: {
show: false,
},
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
data: dx
},
yAxis: {
type: 'value',
max: 100,
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
axisLabel: {
formatter: (value) => {
return value + '%'
}
},
splitLine: {
lineStyle: {
type: "dashed", // y轴分割线类型
color: "#012b4b",
},
},
},
series: data
}
}

@ -1,10 +1,25 @@
<template>
<div>新能源车市场销量分析-主销价格区间</div>
<div>
<seriesTotal></seriesTotal>
<seriesSuv></seriesSuv>
<seriesAuto></seriesAuto>
<seriesMpv></seriesMpv>
</div>
</template>
<script>
import seriesTotal from "./seriesTotal"
import seriesSuv from "./seriesSuv"
import seriesAuto from "./seriesAuto"
import seriesMpv from "./seriesMpv"
export default {
name: 'mneMainPrice',
components: {
seriesTotal,
seriesSuv,
seriesAuto,
seriesMpv
},
name: 'mneType',
data() {
return {

@ -0,0 +1,92 @@
<template>
<div class="ttc-outter">
<v-label-div title="新能源轿车销量">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
<div class="d3">
<v-echarts :opt="opt"></v-echarts>
</div>
</div>
</template>
<script>
import createOpt from './opt'
import {getSalesSpecName1TypesBySedanE} from "@/api/SaleRankMarket";
import {getCheZhuLatestTime} from "@/api/SaleRank"
export default {
name: 'totalPassengerVehicle',
data() {
return {
form: {
token: '',
sTimeType: 4,
sStartTime: '',
sEndTime: '',
},
opt: {},
}
},
created() {
this.form.token = this.getToken;
getCheZhuLatestTime({token: this.form.token}).then(res => {
this.form.sStartTime = '2021-01';
this.form.sEndTime = res.data;
this.getData()
})
},
methods: {
getData() {
getSalesSpecName1TypesBySedanE(this.form).then(res => {
let data = res.data;
let firstYearData = []; //0 - 11 count
let secondYearData = []; //12+ count
let percent = []; //12+ YearOnYearGrowth
for(let i = 0;i<data.length;i++) {
if(i < 12) {
firstYearData.push(data[i].Count)
} else {
secondYearData.push(data[i].Count);
percent.push(data[i].YearOnYearGrowth)
}
};
this.opt = createOpt(firstYearData,secondYearData,percent)
})
},
report() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
isExcel: 1,
};
getSalesSpecName1TypesBySedanE(obj).then(() => {
this.$notification.open({
message: `数据生成中`,
description: "请前往个人中心查看下载进度",
placement: "bottomRight",
});
});
}
}
}
</script>
<style lang="less">
.ttc-outter {
width: 1552px;
height: 492px;
margin-top: 16px;
border: 2px solid #0f2a4d;
.d2 {
display: flex;
justify-content: flex-start;
padding: 8px 16px 0px 16px;
}
.d3 {
// padding: 0px 16px 16px 16px;
width: 100%;
height: calc(100% - 48px);
}
}
</style>

@ -0,0 +1,156 @@
import { bigNumberTransform } from "@/utils/gol/dataTool"
import * as echarts from "echarts";
export default function createOpt(firstData = [], secondData = [], percent = []) {
return {
tooltip: {
trigger: "axis",
backgroundColor: "#08182F",
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
},
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;"
},
grid: {
left: 10,
right: 10,
bottom: 10,
containLabel: true
},
legend: {
textStyle: { //图例文字的样式
color: '#fff',
fontSize: 10
},
y: 10,
x: 10,
itemWidth: 12,
itemHeight: 12,
borderRadius: 1, //圆角半径
},
xAxis: [
{
type: 'category',
data: ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月',],
axisPointer: {
type: 'shadow'
},
axisLabel: {
color: '#FFF'
}
}
],
yAxis: [
{
type: 'value',
axisLabel: {
formatter: (value) => {
return bigNumberTransform(value);
},
color: '#FFF'
},
splitLine:{
show:false
},
},
{
type: 'value',
axisLabel: {
formatter: '{value}%',
color: '#FFF'
},
splitLine:{
show:false
},
}
],
series: [
{
name: '2021',
type: 'bar',
barWidth: 20,
tooltip: {
valueFormatter: function (value) {
return value;
}
},
itemStyle: {
normal: {
//柱体的颜色
//右1000表示从正右开始向左渐变
color: function () {
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#3373CC'
},
{
offset: 1,
color: '#3E8CF940'
}
], false);
}
}
},
label: {
show: true,
position: 'top',
color: '#FFF'
},
data: firstData
},
{
name: '2022',
type: 'bar',
barWidth: 20,
tooltip: {
valueFormatter: function (value) {
return value;
}
},
itemStyle: {
normal: {
//柱体的颜色
//右1000表示从正右开始向左渐变
color: function () {
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#54BF93'
},
{
offset: 1,
color: '#61DDAA30'
}
], false);
}
}
},
label: {
show: true,
position: 'top',
color: '#FFF'
},
data: secondData
},
{
name: '同比',
type: 'line',
yAxisIndex: 1,
tooltip: {
valueFormatter: function (value) {
return value+'%';
}
},
data: percent
}
]
}
}

@ -0,0 +1,92 @@
<template>
<div class="tpsv-outter">
<v-label-div title="新能源MPV销量">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
<div class="d3">
<v-echarts :opt="opt"></v-echarts>
</div>
</div>
</template>
<script>
import createOpt from './opt'
import {getSalesSpecName1TypesByMpvE} from "@/api/SaleRankMarket";
import {getCheZhuLatestTime} from "@/api/SaleRank"
export default {
name: 'totalPassengerVehicle',
data() {
return {
form: {
token: '',
sTimeType: 4,
sStartTime: '',
sEndTime: '',
},
opt: {},
}
},
created() {
this.form.token = this.getToken;
getCheZhuLatestTime({token: this.form.token}).then(res => {
this.form.sStartTime = '2021-01';
this.form.sEndTime = res.data;
this.getData()
})
},
methods: {
getData() {
getSalesSpecName1TypesByMpvE(this.form).then(res => {
let data = res.data;
let firstYearData = []; //0 - 11 count
let secondYearData = []; //12+ count
let percent = []; //12+ YearOnYearGrowth
for(let i = 0;i<data.length;i++) {
if(i < 12) {
firstYearData.push(data[i].Count)
} else {
secondYearData.push(data[i].Count);
percent.push(data[i].YearOnYearGrowth)
}
};
this.opt = createOpt(firstYearData,secondYearData,percent)
})
},
report() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
isExcel: 1,
};
getSalesSpecName1TypesByMpvE(obj).then(() => {
this.$notification.open({
message: `数据生成中`,
description: "请前往个人中心查看下载进度",
placement: "bottomRight",
});
});
}
}
}
</script>
<style lang="less">
.tpsv-outter {
width: 1552px;
height: 492px;
margin-top: 16px;
border: 2px solid #0f2a4d;
.d2 {
display: flex;
justify-content: flex-start;
padding: 8px 16px 0px 16px;
}
.d3 {
// padding: 0px 16px 16px 16px;
width: 100%;
height: calc(100% - 48px);
}
}
</style>

@ -0,0 +1,156 @@
import { bigNumberTransform } from "@/utils/gol/dataTool"
import * as echarts from "echarts";
export default function createOpt(firstData = [], secondData = [], percent = []) {
return {
tooltip: {
trigger: "axis",
backgroundColor: "#08182F",
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
},
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;"
},
grid: {
left: 10,
right: 10,
bottom: 10,
containLabel: true
},
legend: {
textStyle: { //图例文字的样式
color: '#fff',
fontSize: 10
},
y: 10,
x: 10,
itemWidth: 12,
itemHeight: 12,
borderRadius: 1, //圆角半径
},
xAxis: [
{
type: 'category',
data: ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月',],
axisPointer: {
type: 'shadow'
},
axisLabel: {
color: '#FFF'
}
}
],
yAxis: [
{
type: 'value',
axisLabel: {
formatter: (value) => {
return bigNumberTransform(value);
},
color: '#FFF'
},
splitLine:{
show:false
},
},
{
type: 'value',
axisLabel: {
formatter: '{value}%',
color: '#FFF'
},
splitLine:{
show:false
},
}
],
series: [
{
name: '2021',
type: 'bar',
barWidth: 20,
tooltip: {
valueFormatter: function (value) {
return value;
}
},
itemStyle: {
normal: {
//柱体的颜色
//右1000表示从正右开始向左渐变
color: function () {
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#3373CC'
},
{
offset: 1,
color: '#3E8CF940'
}
], false);
}
}
},
label: {
show: true,
position: 'top',
color: '#FFF'
},
data: firstData
},
{
name: '2022',
type: 'bar',
barWidth: 20,
tooltip: {
valueFormatter: function (value) {
return value;
}
},
itemStyle: {
normal: {
//柱体的颜色
//右1000表示从正右开始向左渐变
color: function () {
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#54BF93'
},
{
offset: 1,
color: '#61DDAA30'
}
], false);
}
}
},
label: {
show: true,
position: 'top',
color: '#FFF'
},
data: secondData
},
{
name: '同比',
type: 'line',
yAxisIndex: 1,
tooltip: {
valueFormatter: function (value) {
return value+'%';
}
},
data: percent
}
]
}
}

@ -0,0 +1,92 @@
<template>
<div class="tpsv-outter">
<v-label-div title="新能源SUV销量">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
<div class="d3">
<v-echarts :opt="opt"></v-echarts>
</div>
</div>
</template>
<script>
import createOpt from './opt'
import {getSalesSpecName1TypesBySuvE} from "@/api/SaleRankMarket";
import {getCheZhuLatestTime} from "@/api/SaleRank"
export default {
name: 'totalPassengerVehicle',
data() {
return {
form: {
token: '',
sTimeType: 4,
sStartTime: '',
sEndTime: '',
},
opt: {},
}
},
created() {
this.form.token = this.getToken;
getCheZhuLatestTime({token: this.form.token}).then(res => {
this.form.sStartTime = '2021-01';
this.form.sEndTime = res.data;
this.getData()
})
},
methods: {
getData() {
getSalesSpecName1TypesBySuvE(this.form).then(res => {
let data = res.data;
let firstYearData = []; //0 - 11 count
let secondYearData = []; //12+ count
let percent = []; //12+ YearOnYearGrowth
for(let i = 0;i<data.length;i++) {
if(i < 12) {
firstYearData.push(data[i].Count)
} else {
secondYearData.push(data[i].Count);
percent.push(data[i].YearOnYearGrowth)
}
};
this.opt = createOpt(firstYearData,secondYearData,percent)
})
},
report() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
isExcel: 1,
};
getSalesSpecName1TypesBySuvE(obj).then(() => {
this.$notification.open({
message: `数据生成中`,
description: "请前往个人中心查看下载进度",
placement: "bottomRight",
});
});
}
}
}
</script>
<style lang="less">
.tpsv-outter {
width: 1552px;
height: 492px;
margin-top: 16px;
border: 2px solid #0f2a4d;
.d2 {
display: flex;
justify-content: flex-start;
padding: 8px 16px 0px 16px;
}
.d3 {
// padding: 0px 16px 16px 16px;
width: 100%;
height: calc(100% - 48px);
}
}
</style>

@ -0,0 +1,156 @@
import { bigNumberTransform } from "@/utils/gol/dataTool"
import * as echarts from "echarts";
export default function createOpt(firstData = [], secondData = [], percent = []) {
return {
tooltip: {
trigger: "axis",
backgroundColor: "#08182F",
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
},
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;"
},
grid: {
left: 10,
right: 10,
bottom: 10,
containLabel: true
},
legend: {
textStyle: { //图例文字的样式
color: '#fff',
fontSize: 10
},
y: 10,
x: 10,
itemWidth: 12,
itemHeight: 12,
borderRadius: 1, //圆角半径
},
xAxis: [
{
type: 'category',
data: ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月',],
axisPointer: {
type: 'shadow'
},
axisLabel: {
color: '#FFF'
}
}
],
yAxis: [
{
type: 'value',
axisLabel: {
formatter: (value) => {
return bigNumberTransform(value);
},
color: '#FFF'
},
splitLine:{
show:false
},
},
{
type: 'value',
axisLabel: {
formatter: '{value}%',
color: '#FFF'
},
splitLine:{
show:false
},
}
],
series: [
{
name: '2021',
type: 'bar',
barWidth: 20,
tooltip: {
valueFormatter: function (value) {
return value;
}
},
itemStyle: {
normal: {
//柱体的颜色
//右1000表示从正右开始向左渐变
color: function () {
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#3373CC'
},
{
offset: 1,
color: '#3E8CF940'
}
], false);
}
}
},
label: {
show: true,
position: 'top',
color: '#FFF'
},
data: firstData
},
{
name: '2022',
type: 'bar',
barWidth: 20,
tooltip: {
valueFormatter: function (value) {
return value;
}
},
itemStyle: {
normal: {
//柱体的颜色
//右1000表示从正右开始向左渐变
color: function () {
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#54BF93'
},
{
offset: 1,
color: '#61DDAA30'
}
], false);
}
}
},
label: {
show: true,
position: 'top',
color: '#FFF'
},
data: secondData
},
{
name: '同比',
type: 'line',
yAxisIndex: 1,
tooltip: {
valueFormatter: function (value) {
return value+'%';
}
},
data: percent
}
]
}
}

@ -0,0 +1,126 @@
<template>
<div class="tp20-outter">
<v-label-div title="销量占比">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
<div class="d2">
<a-form-model layout="inline">
<a-form-model-item label="选择日期">
<a-month-picker style="width: 146px" @change="getData" :allowClear="false" v-model="selTime[0]" valueFormat="YYYY-MM" placeholder="开始日期"></a-month-picker>
<a-month-picker style="width: 146px" @change="getData" :allowClear="false" v-model="selTime[1]" valueFormat="YYYY-MM" placeholder="结束日期"></a-month-picker>
</a-form-model-item>
</a-form-model>
</div>
<div class="d3">
<v-echarts :opt="opt"></v-echarts>
</div>
</div>
</template>
<script>
import {getSalesSpecName1TypesE} from "@/api/SaleRankMarket";
import {getCheZhuLatestTime} from "@/api/SaleRank"
import createOpt from './opt'
export default {
name: 'totalTop20',
data() {
return {
form: {
token: '',
sTimeType: 4,
sStartTime: '',
sEndTime: '',
},
tValue: 0, //0 1
btnTimes: ['品牌','车型'],
selTime: ['',''],
opt: {},
}
},
created() {
this.form.token = this.getToken;
getCheZhuLatestTime({token: this.form.token}).then(res => {
var dt = new Date(res.data)
var newDt = new Date( (dt.setMonth(dt.getMonth() - 11)) ).toISOString();
this.selTime = [newDt.slice(0,7), res.data];
this.getData()
})
},
methods: {
getData() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
}
getSalesSpecName1TypesE(obj).then(res => {
let newData = [];
for(let i=0;i<res.data.length;i++) {
let arr = [];
let total = 0;
res.data[i].Data.forEach(ele => {
total = ele.Value*1 + total;
});
res.data[i].Data.forEach(ele => {
let o = {
Key: ele.Key,
Value: (ele.Value*100/total).toFixed(2)
};
arr.push(o)
});
let obj = {
Time: res.data[i].Time,
Data: arr
};
newData.push(obj)
}
let dx = [];
let ds = [];
newData.forEach((ele) => {
let key = ele.Time;
let value = ele.Data;
dx.push(key);
ds.push(value);
});
this.opt = createOpt(dx, ds);
})
},
report() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
isExcel: 1,
};
getSalesSpecName1TypesE(obj).then(() => {
this.$notification.open({
message: `数据生成中`,
description: "请前往个人中心查看下载进度",
placement: "bottomRight",
});
});
}
}
}
</script>
<style lang="less">
.tp20-outter {
width: 1552px;
height: 542px;
border: 2px solid #0f2a4d;
.d2 {
display: flex;
justify-content: flex-start;
padding: 8px 16px 0px 16px;
}
.d3 {
// padding: 0px 16px 16px 16px;
width: 100%;
height: calc(100% - 112px);
}
}
</style>

@ -0,0 +1,149 @@
/*
* @Author: your name
* @Date: 2021-10-09 11:01:19
* @LastEditTime: 2021-12-23 16:37:35
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/Index/spreadTheSound/opt.js
*/
import * as echarts from "echarts";
import {doStr} from "@/utils/gol/dataTool"
import { bigNumberTransform } from "@/utils/gol/dataTool"
// let colors = ['rgba(84,111,197,1)', 'rgba(145,203,116,1)', 'rgba(90,203,156,1)', 'rgba(248,200,87,1)', 'rgba(237,101,101,1)', "rgba(114,191,222,1)", 'rgba(58,162,114,1)', 'rgba(251,131,81,1)']
let colors2 = ['#3373CC60', '#63AECC60', '#54BF9360', 'rgba(248,200,87,0.6)', 'rgba(237,101,101,0.6)', "rgba(114,191,222,0.6)", 'rgba(58,162,114,0.6)', 'rgba(251,131,81,0.6)']
let colors = ['#3373CC','#63AECC','#54BF93','#B9E2FF','#3A9EC0','#5BB9DB','#78D4F8','#63AECC','#19A576','#43C090','#43C090','#9DF5CA']
function createData(ds = []) {
let arr = [];
for (let i = 0; i < ds.length; i++) {
let arr1 = ds[i];
for (let j = 0; j < arr1.length; j++) {
let n = arr.findIndex(ele => {
return ele.name === arr1[j].Key;
})
if (n === -1) {
let obj =
{
name: arr1[j].Key,
type: 'bar',
stack: 'total',
barWidth: 36,
barGap: "-100%",
emphasis: {
focus: 'series'
},
label: {
show: true,
position: 'inside',
color: '#FFF',
fontWeight: 600,
fontSize: 10,
formatter: (res) => {
return res.data + '%'
}
},
itemStyle: {
normal: {
//柱体的颜色
//右1000表示从正右开始向左渐变
color: function () {
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colors[j]
},
{
offset: 1,
color: colors2[j]
}
], false);
}
}
},
data: [arr1[j].Value]
}
arr.push(obj)
} else {
arr[n].data.push(arr1[j].Value)
}
}
}
return arr;
}
export default function createOpt(dx = [], ds = []) {
const data = createData(ds);
return {
grid: {
left: 10,
right: 10,
bottom: 10,
containLabel: true
},
tooltip: {
trigger: "axis",
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;"
},
color: colors,
legend: {
textStyle: { //图例文字的样式
color: '#fff',
fontSize: 10
},
y: 10,
x: 10,
itemWidth: 12,
itemHeight: 12,
borderRadius: 1, //圆角半径
},
xAxis: {
type: 'category',
axisLabel :{
interval:0,
formatter: (value) => {
let res = doStr(value, 8);
return res
}
},
axisTick: {
show: false,
},
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
data: dx
},
yAxis: {
type: 'value',
min: 0,
max: 100,
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
axisLabel: {
formatter: (value) => {
return value + '%';
}
},
splitLine: {
lineStyle: {
type: "dashed", // y轴分割线类型
color: "#012b4b",
},
},
},
series: data
}
}

@ -1,9 +1,24 @@
<template>
<div>新能源车市场销量分析-细分车型</div>
<div>
<precPercent></precPercent>
<precSuvPercent></precSuvPercent>
<precAutoPercent></precAutoPercent>
<precMpvPercent></precMpvPercent>
</div>
</template>
<script>
import precPercent from "./precPercent"
import precSuvPercent from "./precSuvPercent"
import precAutoPercent from "./precAutoPercent"
import precMpvPercent from "./precMpvPercent"
export default {
components: {
precPercent,
precSuvPercent,
precAutoPercent,
precMpvPercent
},
name: 'mnePrecisionType',
data() {
return {

@ -0,0 +1,106 @@
<template>
<div class="preauto-outter">
<v-label-div title="新能源轿车销量占比">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
<div class="d2">
<a-form-model layout="inline">
<a-form-model-item label="选择日期">
<a-month-picker style="width: 146px" @change="getData" :allowClear="false" v-model="selTime[0]" valueFormat="YYYY-MM" placeholder="开始日期"></a-month-picker>
<a-month-picker style="width: 146px" @change="getData" :allowClear="false" v-model="selTime[1]" valueFormat="YYYY-MM" placeholder="结束日期"></a-month-picker>
</a-form-model-item>
</a-form-model>
</div>
<div class="d3">
<v-echarts :opt="opt"></v-echarts>
</div>
</div>
</template>
<script>
import {getSalesSpecNameTypesBySedanE} from "@/api/SaleRankMarket";
import {getCheZhuLatestTime} from "@/api/SaleRank"
import createOpt from './opt'
export default {
name: 'totalTop20',
data() {
return {
form: {
token: '',
sTimeType: 4,
sStartTime: '',
sEndTime: '',
},
tValue: 0, //0 1
btnTimes: ['品牌','车型'],
selTime: ['',''],
opt: {},
}
},
created() {
this.form.token = this.getToken;
getCheZhuLatestTime({token: this.form.token}).then(res => {
var dt = new Date(res.data)
var newDt = new Date( (dt.setMonth(dt.getMonth() - 11)) ).toISOString();
this.selTime = [newDt.slice(0,7), res.data];
this.getData()
})
},
methods: {
getData() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
}
getSalesSpecNameTypesBySedanE(obj).then(res => {
let dx = [];
let ds = [];
res.data.forEach((ele) => {
let key = ele.Time;
let value = ele.Data;
dx.push(key);
ds.push(value);
});
this.opt = createOpt(dx, ds);
})
},
report() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
isExcel: 1,
};
getSalesSpecNameTypesBySedanE(obj).then(() => {
this.$notification.open({
message: `数据生成中`,
description: "请前往个人中心查看下载进度",
placement: "bottomRight",
});
});
}
}
}
</script>
<style lang="less">
.preauto-outter {
width: 1552px;
height: 542px;
margin-top: 16px;
border: 2px solid #0f2a4d;
.d2 {
display: flex;
justify-content: flex-start;
padding: 8px 16px 0px 16px;
}
.d3 {
// padding: 0px 16px 16px 16px;
width: 100%;
height: calc(100% - 112px);
}
}
</style>

@ -0,0 +1,147 @@
/*
* @Author: your name
* @Date: 2021-10-09 11:01:19
* @LastEditTime: 2021-12-23 16:37:35
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/Index/spreadTheSound/opt.js
*/
import * as echarts from "echarts";
import {doStr} from "@/utils/gol/dataTool"
import { bigNumberTransform } from "@/utils/gol/dataTool"
let colors2 = ['#3373CC60', '#63AECC60', '#54BF9360', '#CC9D1260', '#FFDE9560', '#78D4F860', 'rgba(58,162,114,0.6)', 'rgba(251,131,81,0.6)']
let colors = ['#3373CC','#63AECC','#54BF93','#CC9D12','#FFDE95','#78D4F8','#63AECC','#19A576','#43C090','#43C090','#9DF5CA']
function createData(ds = []) {
let arr = [];
for (let i = 0; i < ds.length; i++) {
let arr1 = ds[i];
for (let j = 0; j < arr1.length; j++) {
let n = arr.findIndex(ele => {
return ele.name === arr1[j].Key;
})
if (n === -1) {
let obj =
{
name: arr1[j].Key,
type: 'bar',
stack: 'total',
barWidth: 30,
barGap: "-100%",
emphasis: {
focus: 'series'
},
label: {
show: true,
position: 'inside',
color: '#FFF',
fontWeight: 600,
fontSize: 10,
formatter: (res) => {
return res.data + '%'
}
},
itemStyle: {
normal: {
//柱体的颜色
//右1000表示从正右开始向左渐变
color: function () {
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colors[j]
},
{
offset: 1,
color: colors2[j]
}
], false);
}
}
},
data: [arr1[j].Value]
}
arr.push(obj)
} else {
arr[n].data.push(arr1[j].Value)
}
}
}
return arr;
}
export default function createOpt(dx = [], ds = []) {
const data = createData(ds);
return {
grid: {
left: 10,
right: 10,
bottom: 10,
containLabel: true
},
tooltip: {
trigger: "axis",
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;"
},
color: colors,
legend: {
textStyle: { //图例文字的样式
color: '#fff',
fontSize: 10
},
y: 10,
x: 10,
itemWidth: 12,
itemHeight: 12,
borderRadius: 1, //圆角半径
},
xAxis: {
type: 'category',
axisLabel :{
interval:0,
formatter: (value) => {
let res = doStr(value, 8);
return res
}
},
axisTick: {
show: false,
},
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
data: dx
},
yAxis: {
type: 'value',
min: 0,
max: 100,
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
axisLabel: {
formatter: (value) => {
return value + '%';
}
},
splitLine: {
lineStyle: {
type: "dashed", // y轴分割线类型
color: "#012b4b",
},
},
},
series: data
}
}

@ -0,0 +1,106 @@
<template>
<div class="prempv-outter">
<v-label-div title="新能源MPV销量占比">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
<div class="d2">
<a-form-model layout="inline">
<a-form-model-item label="选择日期">
<a-month-picker style="width: 146px" @change="getData" :allowClear="false" v-model="selTime[0]" valueFormat="YYYY-MM" placeholder="开始日期"></a-month-picker>
<a-month-picker style="width: 146px" @change="getData" :allowClear="false" v-model="selTime[1]" valueFormat="YYYY-MM" placeholder="结束日期"></a-month-picker>
</a-form-model-item>
</a-form-model>
</div>
<div class="d3">
<v-echarts :opt="opt"></v-echarts>
</div>
</div>
</template>
<script>
import {getSalesSpecNameTypesByMpvE} from "@/api/SaleRankMarket";
import {getCheZhuLatestTime} from "@/api/SaleRank"
import createOpt from './opt'
export default {
name: 'totalTop20',
data() {
return {
form: {
token: '',
sTimeType: 4,
sStartTime: '',
sEndTime: '',
},
tValue: 0, //0 1
btnTimes: ['品牌','车型'],
selTime: ['',''],
opt: {},
}
},
created() {
this.form.token = this.getToken;
getCheZhuLatestTime({token: this.form.token}).then(res => {
var dt = new Date(res.data)
var newDt = new Date( (dt.setMonth(dt.getMonth() - 11)) ).toISOString();
this.selTime = [newDt.slice(0,7), res.data];
this.getData()
})
},
methods: {
getData() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
}
getSalesSpecNameTypesByMpvE(obj).then(res => {
let dx = [];
let ds = [];
res.data.forEach((ele) => {
let key = ele.Time;
let value = ele.Data;
dx.push(key);
ds.push(value);
});
this.opt = createOpt(dx, ds);
})
},
report() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
isExcel: 1,
};
getSalesSpecNameTypesByMpvE(obj).then(() => {
this.$notification.open({
message: `数据生成中`,
description: "请前往个人中心查看下载进度",
placement: "bottomRight",
});
});
}
}
}
</script>
<style lang="less">
.prempv-outter {
width: 1552px;
height: 542px;
margin-top: 16px;
border: 2px solid #0f2a4d;
.d2 {
display: flex;
justify-content: flex-start;
padding: 8px 16px 0px 16px;
}
.d3 {
// padding: 0px 16px 16px 16px;
width: 100%;
height: calc(100% - 112px);
}
}
</style>

@ -0,0 +1,147 @@
/*
* @Author: your name
* @Date: 2021-10-09 11:01:19
* @LastEditTime: 2021-12-23 16:37:35
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/Index/spreadTheSound/opt.js
*/
import * as echarts from "echarts";
import {doStr} from "@/utils/gol/dataTool"
import { bigNumberTransform } from "@/utils/gol/dataTool"
let colors2 = ['#3373CC60', '#63AECC60', '#54BF9360', '#CC9D1260', '#FFDE9560', '#78D4F860', 'rgba(58,162,114,0.6)', 'rgba(251,131,81,0.6)']
let colors = ['#3373CC','#63AECC','#54BF93','#CC9D12','#FFDE95','#78D4F8','#63AECC','#19A576','#43C090','#43C090','#9DF5CA']
function createData(ds = []) {
let arr = [];
for (let i = 0; i < ds.length; i++) {
let arr1 = ds[i];
for (let j = 0; j < arr1.length; j++) {
let n = arr.findIndex(ele => {
return ele.name === arr1[j].Key;
})
if (n === -1) {
let obj =
{
name: arr1[j].Key,
type: 'bar',
stack: 'total',
barWidth: 30,
barGap: "-100%",
emphasis: {
focus: 'series'
},
label: {
show: true,
position: 'inside',
color: '#FFF',
fontWeight: 600,
fontSize: 10,
formatter: (res) => {
return res.data + '%'
}
},
itemStyle: {
normal: {
//柱体的颜色
//右1000表示从正右开始向左渐变
color: function () {
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colors[j]
},
{
offset: 1,
color: colors2[j]
}
], false);
}
}
},
data: [arr1[j].Value]
}
arr.push(obj)
} else {
arr[n].data.push(arr1[j].Value)
}
}
}
return arr;
}
export default function createOpt(dx = [], ds = []) {
const data = createData(ds);
return {
grid: {
left: 10,
right: 10,
bottom: 10,
containLabel: true
},
tooltip: {
trigger: "axis",
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;"
},
color: colors,
legend: {
textStyle: { //图例文字的样式
color: '#fff',
fontSize: 10
},
y: 10,
x: 10,
itemWidth: 12,
itemHeight: 12,
borderRadius: 1, //圆角半径
},
xAxis: {
type: 'category',
axisLabel :{
interval:0,
formatter: (value) => {
let res = doStr(value, 8);
return res
}
},
axisTick: {
show: false,
},
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
data: dx
},
yAxis: {
type: 'value',
min: 0,
max: 100,
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
axisLabel: {
formatter: (value) => {
return value + '%';
}
},
splitLine: {
lineStyle: {
type: "dashed", // y轴分割线类型
color: "#012b4b",
},
},
},
series: data
}
}

@ -0,0 +1,105 @@
<template>
<div class="precp-outter">
<v-label-div title="细分车型占比">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
<div class="d2">
<a-form-model layout="inline">
<a-form-model-item label="选择日期">
<a-month-picker style="width: 146px" @change="getData" :allowClear="false" v-model="selTime[0]" valueFormat="YYYY-MM" placeholder="开始日期"></a-month-picker>
<a-month-picker style="width: 146px" @change="getData" :allowClear="false" v-model="selTime[1]" valueFormat="YYYY-MM" placeholder="结束日期"></a-month-picker>
</a-form-model-item>
</a-form-model>
</div>
<div class="d3">
<v-echarts :opt="opt"></v-echarts>
</div>
</div>
</template>
<script>
import {getSalesSpecNameTypesE} from "@/api/SaleRankMarket";
import {getCheZhuLatestTime} from "@/api/SaleRank"
import createOpt from './opt'
export default {
name: 'totalTop20',
data() {
return {
form: {
token: '',
sTimeType: 4,
sStartTime: '',
sEndTime: '',
},
tValue: 0, //0 1
btnTimes: ['品牌','车型'],
selTime: ['',''],
opt: {},
}
},
created() {
this.form.token = this.getToken;
getCheZhuLatestTime({token: this.form.token}).then(res => {
var dt = new Date(res.data)
var newDt = new Date( (dt.setMonth(dt.getMonth() - 11)) ).toISOString();
this.selTime = [newDt.slice(0,7), res.data];
this.getData()
})
},
methods: {
getData() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
}
getSalesSpecNameTypesE(obj).then(res => {
let dx = [];
let ds = [];
res.data.forEach((ele) => {
let key = ele.Time;
let value = ele.Data;
dx.push(key);
ds.push(value);
});
this.opt = createOpt(dx, ds);
})
},
report() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
isExcel: 1,
};
getSalesSpecNameTypesE(obj).then(() => {
this.$notification.open({
message: `数据生成中`,
description: "请前往个人中心查看下载进度",
placement: "bottomRight",
});
});
}
}
}
</script>
<style lang="less">
.precp-outter {
width: 1552px;
height: 798px;
border: 2px solid #0f2a4d;
.d2 {
display: flex;
justify-content: flex-start;
padding: 8px 16px 0px 16px;
}
.d3 {
// padding: 0px 16px 16px 16px;
width: 100%;
height: calc(100% - 112px);
}
}
</style>

@ -0,0 +1,147 @@
/*
* @Author: your name
* @Date: 2021-10-09 11:01:19
* @LastEditTime: 2021-12-23 16:37:35
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/Index/spreadTheSound/opt.js
*/
import * as echarts from "echarts";
import {doStr} from "@/utils/gol/dataTool"
import { bigNumberTransform } from "@/utils/gol/dataTool"
let colors = ['#5B8FF9','#7DAAFF','#9AC5FF','#B9E2FF','#3A9EC0','#5BB9DB','#78D4F8','#63AECC','#19A576','#43C090',
'#62DDAA','#9DF5CA','#9DF5CA','#FFD470','#FFDE95','#FFEBBF','#E19D62','#F7B075','#FDC388','#FDD69B']
function createData(ds = []) {
let arr = [];
for (let i = 0; i < ds.length; i++) {
let arr1 = ds[i];
for (let j = 0; j < arr1.length; j++) {
let n = arr.findIndex(ele => {
return ele.name === arr1[j].Key;
})
if (n === -1) {
let obj =
{
name: arr1[j].Key,
type: 'bar',
stack: 'total',
barWidth: 36,
barGap: "-100%",
emphasis: {
focus: 'series'
},
label: {
show: true,
position: 'inside',
color: '#FFF',
fontWeight: 600,
fontSize: 12,
formatter: (res) => {
return res.data + '%'
}
},
itemStyle: {
normal: {
//柱体的颜色
//右1000表示从正右开始向左渐变
color: function () {
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colors[j]
},
{
offset: 1,
color: colors[j]
}
], false);
}
}
},
data: [arr1[j].Value]
}
arr.push(obj)
} else {
arr[n].data.push(arr1[j].Value)
}
}
}
return arr;
}
export default function createOpt(dx = [], ds = []) {
const data = createData(ds);
return {
grid: {
left: 10,
right: 10,
bottom: 10,
containLabel: true
},
tooltip: {
trigger: "axis",
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;"
},
color: colors,
legend: {
textStyle: { //图例文字的样式
color: '#fff',
fontSize: 10
},
y: 10,
x: 10,
itemWidth: 12,
itemHeight: 12,
borderRadius: 1, //圆角半径
},
xAxis: {
type: 'category',
axisLabel :{
interval:0,
formatter: (value) => {
let res = doStr(value, 8);
return res
}
},
axisTick: {
show: false,
},
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
data: dx
},
yAxis: {
type: 'value',
min: 0,
max: 100,
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
axisLabel: {
formatter: (value) => {
return value + '%';
}
},
splitLine: {
lineStyle: {
type: "dashed", // y轴分割线类型
color: "#012b4b",
},
},
},
series: data
}
}

@ -0,0 +1,106 @@
<template>
<div class="presuv-outter">
<v-label-div title="新能源SUV销量占比">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
<div class="d2">
<a-form-model layout="inline">
<a-form-model-item label="选择日期">
<a-month-picker style="width: 146px" @change="getData" :allowClear="false" v-model="selTime[0]" valueFormat="YYYY-MM" placeholder="开始日期"></a-month-picker>
<a-month-picker style="width: 146px" @change="getData" :allowClear="false" v-model="selTime[1]" valueFormat="YYYY-MM" placeholder="结束日期"></a-month-picker>
</a-form-model-item>
</a-form-model>
</div>
<div class="d3">
<v-echarts :opt="opt"></v-echarts>
</div>
</div>
</template>
<script>
import {getSalesSpecNameTypesBySuvE} from "@/api/SaleRankMarket";
import {getCheZhuLatestTime} from "@/api/SaleRank"
import createOpt from './opt'
export default {
name: 'totalTop20',
data() {
return {
form: {
token: '',
sTimeType: 4,
sStartTime: '',
sEndTime: '',
},
tValue: 0, //0 1
btnTimes: ['品牌','车型'],
selTime: ['',''],
opt: {},
}
},
created() {
this.form.token = this.getToken;
getCheZhuLatestTime({token: this.form.token}).then(res => {
var dt = new Date(res.data)
var newDt = new Date( (dt.setMonth(dt.getMonth() - 11)) ).toISOString();
this.selTime = [newDt.slice(0,7), res.data];
this.getData()
})
},
methods: {
getData() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
}
getSalesSpecNameTypesBySuvE(obj).then(res => {
let dx = [];
let ds = [];
res.data.forEach((ele) => {
let key = ele.Time;
let value = ele.Data;
dx.push(key);
ds.push(value);
});
this.opt = createOpt(dx, ds);
})
},
report() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
isExcel: 1,
};
getSalesSpecNameTypesBySuvE(obj).then(() => {
this.$notification.open({
message: `数据生成中`,
description: "请前往个人中心查看下载进度",
placement: "bottomRight",
});
});
}
}
}
</script>
<style lang="less">
.presuv-outter {
width: 1552px;
height: 542px;
margin-top: 16px;
border: 2px solid #0f2a4d;
.d2 {
display: flex;
justify-content: flex-start;
padding: 8px 16px 0px 16px;
}
.d3 {
// padding: 0px 16px 16px 16px;
width: 100%;
height: calc(100% - 112px);
}
}
</style>

@ -0,0 +1,147 @@
/*
* @Author: your name
* @Date: 2021-10-09 11:01:19
* @LastEditTime: 2021-12-23 16:37:35
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/Index/spreadTheSound/opt.js
*/
import * as echarts from "echarts";
import {doStr} from "@/utils/gol/dataTool"
import { bigNumberTransform } from "@/utils/gol/dataTool"
let colors2 = ['#3373CC60', '#63AECC60', '#54BF9360', '#CC9D1260', '#FFDE9560', "rgba(114,191,222,0.6)", 'rgba(58,162,114,0.6)', 'rgba(251,131,81,0.6)']
let colors = ['#3373CC','#63AECC','#54BF93','#CC9D12','#FFDE95','#FFDE95','#78D4F8','#63AECC','#19A576','#43C090','#43C090','#9DF5CA']
function createData(ds = []) {
let arr = [];
for (let i = 0; i < ds.length; i++) {
let arr1 = ds[i];
for (let j = 0; j < arr1.length; j++) {
let n = arr.findIndex(ele => {
return ele.name === arr1[j].Key;
})
if (n === -1) {
let obj =
{
name: arr1[j].Key,
type: 'bar',
stack: 'total',
barWidth: 30,
barGap: "-100%",
emphasis: {
focus: 'series'
},
label: {
show: true,
position: 'inside',
color: '#FFF',
fontWeight: 600,
fontSize: 10,
formatter: (res) => {
return res.data + '%'
}
},
itemStyle: {
normal: {
//柱体的颜色
//右1000表示从正右开始向左渐变
color: function () {
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colors[j]
},
{
offset: 1,
color: colors2[j]
}
], false);
}
}
},
data: [arr1[j].Value]
}
arr.push(obj)
} else {
arr[n].data.push(arr1[j].Value)
}
}
}
return arr;
}
export default function createOpt(dx = [], ds = []) {
const data = createData(ds);
return {
grid: {
left: 10,
right: 10,
bottom: 10,
containLabel: true
},
tooltip: {
trigger: "axis",
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;"
},
color: colors,
legend: {
textStyle: { //图例文字的样式
color: '#fff',
fontSize: 10
},
y: 10,
x: 10,
itemWidth: 12,
itemHeight: 12,
borderRadius: 1, //圆角半径
},
xAxis: {
type: 'category',
axisLabel :{
interval:0,
formatter: (value) => {
let res = doStr(value, 8);
return res
}
},
axisTick: {
show: false,
},
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
data: dx
},
yAxis: {
type: 'value',
min: 0,
max: 100,
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
axisLabel: {
formatter: (value) => {
return value + '%';
}
},
splitLine: {
lineStyle: {
type: "dashed", // y轴分割线类型
color: "#012b4b",
},
},
},
series: data
}
}

@ -1,6 +1,8 @@
<template>
<div class="mscet-outter">
<v-label-div title="国别占比分布"></v-label-div>
<v-label-div title="国别占比分布">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
<div class="d2">
<a-form-model layout="inline">
<a-form-model-item label="选择日期">
@ -83,6 +85,22 @@ export default {
this.opt = createOpt(dx, ds);
})
},
report() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
isExcel: 1,
};
getSalesCountrysTypes(obj).then(() => {
this.$notification.open({
message: `数据生成中`,
description: "请前往个人中心查看下载进度",
placement: "bottomRight",
});
});
}
}
}
</script>

@ -1,18 +1,124 @@
<template>
<div>传统燃油车市场销量分析-主销价格占比</div>
<div class="mscet-outter">
<v-label-div title="车型主销价格占比">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
<div class="d2">
<a-form-model layout="inline">
<a-form-model-item label="选择日期">
<a-month-picker @change="getData" style="width: 146px" :allowClear="false" v-model="selTime[0]" valueFormat="YYYY-MM" placeholder="开始日期"></a-month-picker>
<a-month-picker @change="getData" style="width: 146px" :allowClear="false" v-model="selTime[1]" valueFormat="YYYY-MM" placeholder="结束日期"></a-month-picker>
</a-form-model-item>
</a-form-model>
</div>
<div class="d3">
<v-echarts :opt="opt"></v-echarts>
</div>
</div>
</template>
<script>
import {getSalesSpecNameByPriceRange} from "@/api/SaleRankMarket";
import {getCheZhuLatestTime} from "@/api/SaleRank"
import createOpt from './opt'
export default {
name: 'mstMPPercent',
name: 'totalTop20',
data() {
return {
form: {
token: '',
sTimeType: 4,
sStartTime: '',
sEndTime: '',
},
selTime: ['',''],
opt: {},
}
},
created() {
this.form.token = this.getToken;
getCheZhuLatestTime({token: this.form.token}).then(res => {
var dt = new Date(res.data)
var newDt = new Date( (dt.setMonth(dt.getMonth() - 11)) ).toISOString();
this.selTime = [newDt.slice(0,7), res.data];
this.getData()
})
},
methods: {
getData() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
}
getSalesSpecNameByPriceRange(obj).then(res => {
let newData = [];
for(let i=0;i<res.data.length;i++) {
let arr = [];
let total = 0;
res.data[i].Data.forEach(ele => {
total = ele.Value*1 + total;
});
res.data[i].Data.forEach(ele => {
let o = {
Key: ele.Key,
Value: (ele.Value*100/total).toFixed(2)
};
arr.push(o)
});
let obj = {
Time: res.data[i].Key,
Data: arr
};
newData.push(obj)
}
let dx = [];
let ds = [];
newData.forEach((ele) => {
let key = ele.Time;
let value = ele.Data;
dx.push(key);
ds.push(value);
});
this.opt = createOpt(dx, ds);
})
},
report() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
isExcel: 1,
};
getSalesSpecNameByPriceRange(obj).then(() => {
this.$notification.open({
message: `数据生成中`,
description: "请前往个人中心查看下载进度",
placement: "bottomRight",
});
});
}
}
}
</script>
<style lang="less">
.mscet-outter {
width: 1552px;
height: 760px;
border: 2px solid #0f2a4d;
.d2 {
display: flex;
justify-content: flex-start;
padding: 8px 16px 0px 16px;
}
.d3 {
// padding: 0px 16px 16px 16px;
width: 100%;
height: calc(100% - 112px);
}
}
</style>

@ -0,0 +1,146 @@
/*
* @Author: your name
* @Date: 2021-10-09 11:01:19
* @LastEditTime: 2021-12-23 16:37:35
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/Index/spreadTheSound/opt.js
*/
import * as echarts from "echarts";
import {doStr} from "@/utils/gol/dataTool"
import { bigNumberTransform } from "@/utils/gol/dataTool"
let colors = ['#5B8FF9','#7DAAFF','#9AC5FF','#B9E2FF','#3A9EC0','#5BB9DB','#78D4F8','#63AECC','#19A576','#43C090','#43C090','#9DF5CA'
,'#5B8FF9','#7DAAFF','#9AC5FF','#B9E2FF','#3A9EC0','#5BB9DB','#78D4F8','#63AECC','#19A576','#43C090','#43C090','#9DF5CA']
function createData(ds = []) {
let arr = [];
for (let i = 0; i < ds.length; i++) {
let arr1 = ds[i];
for (let j = 0; j < arr1.length; j++) {
let n = arr.findIndex(ele => {
return ele.name === arr1[j].Key;
})
if (n === -1) {
let obj =
{
name: arr1[j].Key,
type: 'bar',
stack: 'total',
barWidth: 48,
barGap: "-100%",
emphasis: {
focus: 'series'
},
label: {
show: true,
position: 'inside',
color: '#FFF',
fontWeight: 600,
formatter: (res) => {
return res.data + '%'
}
},
itemStyle: {
normal: {
//柱体的颜色
//右1000表示从正右开始向左渐变
color: function () {
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colors[j]
},
{
offset: 1,
color: colors[j]
}
], false);
}
}
},
data: [arr1[j].Value]
}
arr.push(obj)
} else {
arr[n].data.push(arr1[j].Value)
}
}
}
return arr;
}
export default function createOpt(dx = [], ds = []) {
const data = createData(ds);
return {
grid: {
left: 10,
right: 10,
bottom: 10,
containLabel: true
},
tooltip: {
trigger: "axis",
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;"
},
color: colors,
legend: {
textStyle: { //图例文字的样式
color: '#fff',
fontSize: 10
},
y: 10,
x: 10,
itemWidth: 12,
itemHeight: 12,
borderRadius: 1, //圆角半径
},
xAxis: {
type: 'category',
axisLabel :{
interval:0,
formatter: (value) => {
let res = doStr(value, 8);
return res
}
},
axisTick: {
show: false,
},
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
data: dx
},
yAxis: {
type: 'value',
max: 100,
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
axisLabel: {
formatter: (value) => {
return value + '%'
}
},
splitLine: {
lineStyle: {
type: "dashed", // y轴分割线类型
color: "#012b4b",
},
},
},
series: data
}
}

@ -1,9 +1,18 @@
<template>
<div>传统燃油车市场销量分析-主销价格区间</div>
<div>
<mainCountry></mainCountry>
<mainBrand></mainBrand>
</div>
</template>
<script>
import mainCountry from "./mainCountry"
import mainBrand from "./mainBrand"
export default {
components: {
mainCountry,
mainBrand
},
name: 'mstMainPrice',
data() {
return {

@ -0,0 +1,127 @@
<template>
<div class="preauto-outter">
<v-label-div title="品牌销量top10主销价格区间占比">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
<!-- <div class="d2">
<a-form-model layout="inline">
<a-form-model-item label="选择日期">
<a-month-picker style="width: 146px" @change="getData" :allowClear="false" v-model="selTime[0]" valueFormat="YYYY-MM" placeholder="开始日期"></a-month-picker>
<a-month-picker style="width: 146px" @change="getData" :allowClear="false" v-model="selTime[1]" valueFormat="YYYY-MM" placeholder="结束日期"></a-month-picker>
</a-form-model-item>
</a-form-model>
</div> -->
<div class="d3">
<v-echarts :opt="opt"></v-echarts>
</div>
</div>
</template>
<script>
import {getSalesPriceRangeSBrand} from "@/api/SaleRankMarket";
import {getCheZhuLatestTime} from "@/api/SaleRank"
import createOpt from './opt'
export default {
name: 'totalTop20',
data() {
return {
form: {
token: '',
sTimeType: 4,
sStartTime: '',
sEndTime: '',
},
tValue: 0, //0 1
btnTimes: ['品牌','车型'],
selTime: ['',''],
opt: {},
}
},
created() {
this.form.token = this.getToken;
getCheZhuLatestTime({token: this.form.token}).then(res => {
var dt = new Date(res.data)
var newDt = new Date( (dt.setMonth(dt.getMonth() - 11)) ).toISOString();
this.selTime = [newDt.slice(0,7), res.data];
this.getData()
})
},
methods: {
getData() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
}
getSalesPriceRangeSBrand(obj).then(res => {
let newData = [];
for(let i=0;i<res.data.length;i++) {
let arr = [];
let total = 0;
res.data[i].Data.forEach(ele => {
total = ele.Value*1 + total;
});
res.data[i].Data.forEach(ele => {
let o = {
Key: ele.Key,
Value: (ele.Value*100/total).toFixed(2)
};
arr.push(o)
});
let obj = {
Key: res.data[i].Key,
Data: arr
};
newData.push(obj)
}
let dx = [];
let ds = [];
newData.forEach((ele) => {
let key = ele.Key;
let value = ele.Data;
dx.push(key);
ds.push(value);
});
this.opt = createOpt(dx, ds);
})
},
report() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
isExcel: 1,
};
getSalesPriceRangeSBrand(obj).then(() => {
this.$notification.open({
message: `数据生成中`,
description: "请前往个人中心查看下载进度",
placement: "bottomRight",
});
});
}
}
}
</script>
<style lang="less">
.preauto-outter {
width: 1552px;
height: 542px;
margin-top: 16px;
border: 2px solid #0f2a4d;
.d2 {
display: flex;
justify-content: flex-start;
padding: 8px 16px 0px 16px;
}
.d3 {
// padding: 0px 16px 16px 16px;
width: 100%;
height: calc(100% - 112px);
}
}
</style>

@ -0,0 +1,137 @@
/*
* @Author: your name
* @Date: 2021-10-09 11:01:19
* @LastEditTime: 2021-12-23 16:37:35
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/Index/spreadTheSound/opt.js
*/
import * as echarts from "echarts";
import {doStr} from "@/utils/gol/dataTool"
import { bigNumberTransform } from "@/utils/gol/dataTool"
let colors = ['#5B8FF9','#7DAAFF','#9AC5FF','#B9E2FF','#3A9EC0','#5BB9DB','#78D4F8','#63AECC','#19A576','#43C090','#43C090','#9DF5CA'
,'#5B8FF9','#7DAAFF','#9AC5FF','#B9E2FF','#3A9EC0','#5BB9DB','#78D4F8','#63AECC','#19A576','#43C090','#43C090','#9DF5CA']
function createData(ds = []) {
let arr = [];
for (let i = 0; i < ds.length; i++) {
let arr1 = ds[i];
for (let j = 0; j < arr1.length; j++) {
let n = arr.findIndex(ele => {
return ele.name === arr1[j].Key;
})
if (n === -1) {
let obj =
{
name: arr1[j].Key,
type: 'bar',
stack: 'total',
barWidth: 24,
barGap: "-100%",
emphasis: {
focus: 'series'
},
itemStyle: {
normal: {
//柱体的颜色
//右1000表示从正右开始向左渐变
color: function () {
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colors[j]
},
{
offset: 1,
color: colors[j]
}
], false);
}
}
},
data: [arr1[j].Value]
}
arr.push(obj)
} else {
arr[n].data.push(arr1[j].Value)
}
}
}
return arr;
}
export default function createOpt(dx = [], ds = []) {
const data = createData(ds);
return {
grid: {
left: 10,
right: 10,
bottom: 10,
containLabel: true
},
tooltip: {
trigger: "axis",
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;"
},
color: colors,
legend: {
textStyle: { //图例文字的样式
color: '#fff',
fontSize: 10
},
y: 10,
x: 10,
itemWidth: 12,
itemHeight: 12,
borderRadius: 1, //圆角半径
},
xAxis: {
type: 'category',
axisLabel :{
interval:0,
formatter: (value) => {
let res = doStr(value, 8);
return res
}
},
axisTick: {
show: false,
},
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
data: dx
},
yAxis: {
type: 'value',
min: 0,
max: 100,
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
axisLabel: {
formatter: (value) => {
return value + '%';
}
},
splitLine: {
lineStyle: {
type: "dashed", // y轴分割线类型
color: "#012b4b",
},
},
},
series: data
}
}

@ -0,0 +1,126 @@
<template>
<div class="mainc-outter">
<v-label-div title="国别主销价格区间占比">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
<div class="d2">
<a-form-model layout="inline">
<a-form-model-item label="选择日期">
<a-month-picker style="width: 146px" @change="getData" :allowClear="false" v-model="selTime[0]" valueFormat="YYYY-MM" placeholder="开始日期"></a-month-picker>
<a-month-picker style="width: 146px" @change="getData" :allowClear="false" v-model="selTime[1]" valueFormat="YYYY-MM" placeholder="结束日期"></a-month-picker>
</a-form-model-item>
</a-form-model>
</div>
<div class="d3">
<v-echarts :opt="opt"></v-echarts>
</div>
</div>
</template>
<script>
import {getSalesPriceRangeSTypes} from "@/api/SaleRankMarket";
import {getCheZhuLatestTime} from "@/api/SaleRank"
import createOpt from './opt'
export default {
name: 'totalTop20',
data() {
return {
form: {
token: '',
sTimeType: 4,
sStartTime: '',
sEndTime: '',
},
tValue: 0, //0 1
btnTimes: ['品牌','车型'],
selTime: ['',''],
opt: {},
}
},
created() {
this.form.token = this.getToken;
getCheZhuLatestTime({token: this.form.token}).then(res => {
var dt = new Date(res.data)
var newDt = new Date( (dt.setMonth(dt.getMonth() - 11)) ).toISOString();
this.selTime = [newDt.slice(0,7), res.data];
this.getData()
})
},
methods: {
getData() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
}
getSalesPriceRangeSTypes(obj).then(res => {
let newData = [];
for(let i=0;i<res.data.length;i++) {
let arr = [];
let total = 0;
res.data[i].Data.forEach(ele => {
total = ele.Value*1 + total;
});
res.data[i].Data.forEach(ele => {
let o = {
Key: ele.Key,
Value: (ele.Value*100/total).toFixed(2)
};
arr.push(o)
});
let obj = {
Time: res.data[i].Key,
Data: arr
};
newData.push(obj)
}
let dx = [];
let ds = [];
newData.forEach((ele) => {
let key = ele.Time;
let value = ele.Data;
dx.push(key);
ds.push(value);
});
this.opt = createOpt(dx, ds);
})
},
report() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
isExcel: 1,
};
getSalesPriceRangeSTypes(obj).then(() => {
this.$notification.open({
message: `数据生成中`,
description: "请前往个人中心查看下载进度",
placement: "bottomRight",
});
});
}
}
}
</script>
<style lang="less">
.mainc-outter {
width: 1552px;
height: 798px;
border: 2px solid #0f2a4d;
.d2 {
display: flex;
justify-content: flex-start;
padding: 8px 16px 0px 16px;
}
.d3 {
// padding: 0px 16px 16px 16px;
width: 100%;
height: calc(100% - 112px);
}
}
</style>

@ -0,0 +1,147 @@
/*
* @Author: your name
* @Date: 2021-10-09 11:01:19
* @LastEditTime: 2021-12-23 16:37:35
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/Index/spreadTheSound/opt.js
*/
import * as echarts from "echarts";
import {doStr} from "@/utils/gol/dataTool"
import { bigNumberTransform } from "@/utils/gol/dataTool"
let colors = ['#5B8FF9','#7DAAFF','#9AC5FF','#B9E2FF','#3A9EC0','#5BB9DB','#78D4F8','#63AECC','#19A576','#43C090',
'#62DDAA','#9DF5CA','#9DF5CA','#FFD470','#FFDE95','#FFEBBF','#E19D62','#F7B075','#FDC388','#FDD69B']
function createData(ds = []) {
let arr = [];
for (let i = 0; i < ds.length; i++) {
let arr1 = ds[i];
for (let j = 0; j < arr1.length; j++) {
let n = arr.findIndex(ele => {
return ele.name === arr1[j].Key;
})
if (n === -1) {
let obj =
{
name: arr1[j].Key,
type: 'bar',
stack: 'total',
barWidth: 36,
barGap: "-100%",
emphasis: {
focus: 'series'
},
label: {
show: true,
position: 'inside',
color: '#FFF',
fontWeight: 600,
fontSize: 12,
formatter: (res) => {
return res.data + '%'
}
},
itemStyle: {
normal: {
//柱体的颜色
//右1000表示从正右开始向左渐变
color: function () {
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colors[j]
},
{
offset: 1,
color: colors[j]
}
], false);
}
}
},
data: [arr1[j].Value]
}
arr.push(obj)
} else {
arr[n].data.push(arr1[j].Value)
}
}
}
return arr;
}
export default function createOpt(dx = [], ds = []) {
const data = createData(ds);
return {
grid: {
left: 10,
right: 10,
bottom: 10,
containLabel: true
},
tooltip: {
trigger: "axis",
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;"
},
color: colors,
legend: {
textStyle: { //图例文字的样式
color: '#fff',
fontSize: 10
},
y: 10,
x: 10,
itemWidth: 12,
itemHeight: 12,
borderRadius: 1, //圆角半径
},
xAxis: {
type: 'category',
axisLabel :{
interval:0,
formatter: (value) => {
let res = doStr(value, 8);
return res
}
},
axisTick: {
show: false,
},
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
data: dx
},
yAxis: {
type: 'value',
min: 0,
max: 100,
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
axisLabel: {
formatter: (value) => {
return value + '%';
}
},
splitLine: {
lineStyle: {
type: "dashed", // y轴分割线类型
color: "#012b4b",
},
},
},
series: data
}
}

@ -1,5 +1,5 @@
<template>
<div class="tp20-outter">
<div class="preauto-outter">
<v-label-div title="轿车销量占比">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
@ -87,7 +87,7 @@ export default {
</script>
<style lang="less">
.tp20-outter {
.preauto-outter {
width: 1552px;
height: 542px;
margin-top: 16px;

@ -1,5 +1,5 @@
<template>
<div class="tp20-outter">
<div class="prempv-outter">
<v-label-div title="MPV销量占比">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
@ -87,7 +87,7 @@ export default {
</script>
<style lang="less">
.tp20-outter {
.prempv-outter {
width: 1552px;
height: 542px;
margin-top: 16px;

@ -1,5 +1,5 @@
<template>
<div class="tp20-outter">
<div class="presuv-outter">
<v-label-div title="SUV销量占比">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
@ -87,7 +87,7 @@ export default {
</script>
<style lang="less">
.tp20-outter {
.presuv-outter {
width: 1552px;
height: 542px;
margin-top: 16px;

@ -1,6 +1,8 @@
<template>
<div class="ttc-outter">
<v-label-div title="轿车销量"></v-label-div>
<v-label-div title="轿车销量">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
<div class="d3">
<v-echarts :opt="opt"></v-echarts>
</div>
@ -50,6 +52,22 @@ export default {
this.opt = createOpt(firstYearData,secondYearData,percent)
})
},
report() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
isExcel: 1,
};
getSalesSpecName1TypesBySedan(obj).then(() => {
this.$notification.open({
message: `数据生成中`,
description: "请前往个人中心查看下载进度",
placement: "bottomRight",
});
});
}
}
}
</script>

@ -1,6 +1,8 @@
<template>
<div class="tpsv-outter">
<v-label-div title="MPV销量"></v-label-div>
<v-label-div title="MPV销量">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
<div class="d3">
<v-echarts :opt="opt"></v-echarts>
</div>
@ -50,6 +52,22 @@ export default {
this.opt = createOpt(firstYearData,secondYearData,percent)
})
},
report() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
isExcel: 1,
};
getSalesSpecName1TypesByMpv(obj).then(() => {
this.$notification.open({
message: `数据生成中`,
description: "请前往个人中心查看下载进度",
placement: "bottomRight",
});
});
}
}
}
</script>

@ -1,6 +1,8 @@
<template>
<div class="tpsv-outter">
<v-label-div title="SUV销量"></v-label-div>
<v-label-div title="SUV销量">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
<div class="d3">
<v-echarts :opt="opt"></v-echarts>
</div>
@ -50,6 +52,22 @@ export default {
this.opt = createOpt(firstYearData,secondYearData,percent)
})
},
report() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
isExcel: 1,
};
getSalesSpecName1TypesBySuv(obj).then(() => {
this.$notification.open({
message: `数据生成中`,
description: "请前往个人中心查看下载进度",
placement: "bottomRight",
});
});
}
}
}
</script>

@ -1,6 +1,8 @@
<template>
<div class="tp20-outter">
<v-label-div title="销量占比"></v-label-div>
<v-label-div title="销量占比">
<a-button type="primary" @click="report"></a-button>
</v-label-div>
<div class="d2">
<a-form-model layout="inline">
<a-form-model-item label="选择日期">
@ -85,6 +87,22 @@ export default {
this.opt = createOpt(dx, ds);
})
},
report() {
let obj = {
token: this.form.token,
sTimeType: 4,
sStartTime: this.selTime[0],
sEndTime: this.selTime[1],
isExcel: 1,
};
getSalesSpecName1Types(obj).then(() => {
this.$notification.open({
message: `数据生成中`,
description: "请前往个人中心查看下载进度",
placement: "bottomRight",
});
});
}
}
}
</script>

@ -90,12 +90,12 @@
<a-menu-item key="mneCountryPercent">
<router-link to="/saleRank/mneCountryPercent">国别占比</router-link>
</a-menu-item>
<a-menu-item key="mneMainPrice">
<router-link to="/saleRank/mneMainPrice">车型类别</router-link>
</a-menu-item>
<a-menu-item key="mnePrecisionType">
<router-link to="/saleRank/mnePrecisionType">细分车型</router-link>
</a-menu-item>
<a-menu-item key="mneMainPrice">
<router-link to="/saleRank/mneMainPrice">主销价格区间</router-link>
</a-menu-item>
</a-sub-menu>
</a-menu>
</div>

Loading…
Cancel
Save