|
@@ -40,12 +40,14 @@ const echartsRef5 = ref(null);
|
|
|
const isForbidden = ref(false);
|
|
const isForbidden = ref(false);
|
|
|
const currentYear = new Date().getFullYear();
|
|
const currentYear = new Date().getFullYear();
|
|
|
const lastYear = currentYear - 1;
|
|
const lastYear = currentYear - 1;
|
|
|
|
|
+const lastLastYear = lastYear - 1;
|
|
|
const setChartOption1 = async (res) => {
|
|
const setChartOption1 = async (res) => {
|
|
|
if (res.code != 200) ElMessage.error(res.msg);
|
|
if (res.code != 200) ElMessage.error(res.msg);
|
|
|
- const a = res.data.filter(item => item.lastQuarterCurrentTotal - item.lastQuarterLastTotal < 0)
|
|
|
|
|
- const names = a.map(q => q.enterpriseName + ' 同比率' + (((q.lastQuarterCurrentTotal - q.lastQuarterLastTotal) / q.lastQuarterLastTotal) * 100).toFixed(2) + '%').reverse();
|
|
|
|
|
|
|
+ const a = res.data.filter(item => item.lastQuarterLastTotal - item.lastLastQuarterLastTotal < 0)
|
|
|
|
|
+ const names = a.map(q => q.enterpriseName + ' 同比率' + (((q.lastQuarterLastTotal - q.lastLastQuarterLastTotal) / q.lastLastQuarterLastTotal) * 100).toFixed(2) + '%').reverse();
|
|
|
const currentYearData = a.map(q => q.lastQuarterCurrentTotal?.toFixed(0)).reverse();
|
|
const currentYearData = a.map(q => q.lastQuarterCurrentTotal?.toFixed(0)).reverse();
|
|
|
const lastYearData = a.map(q => q.lastQuarterLastTotal?.toFixed(0)).reverse();
|
|
const lastYearData = a.map(q => q.lastQuarterLastTotal?.toFixed(0)).reverse();
|
|
|
|
|
+ const lastLastYearData = a.map(q => q.lastLastQuarterLastTotal?.toFixed(0)).reverse();
|
|
|
const chart = echarts.init(echartsRef.value);
|
|
const chart = echarts.init(echartsRef.value);
|
|
|
chart.setOption({
|
|
chart.setOption({
|
|
|
title: {
|
|
title: {
|
|
@@ -58,7 +60,7 @@ const setChartOption1 = async (res) => {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
legend: {
|
|
legend: {
|
|
|
- data: [lastYear.toString(), currentYear.toString()]
|
|
|
|
|
|
|
+ data: [lastLastYear.toString(),lastYear.toString(),currentYear.toString()]
|
|
|
},
|
|
},
|
|
|
grid: {
|
|
grid: {
|
|
|
left: '3%',
|
|
left: '3%',
|
|
@@ -75,6 +77,11 @@ const setChartOption1 = async (res) => {
|
|
|
data: names
|
|
data: names
|
|
|
},
|
|
},
|
|
|
series: [
|
|
series: [
|
|
|
|
|
+ {
|
|
|
|
|
+ name: lastLastYear.toString(),
|
|
|
|
|
+ type: 'bar',
|
|
|
|
|
+ data: lastLastYearData,
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
name: lastYear.toString(),
|
|
name: lastYear.toString(),
|
|
|
type: 'bar',
|
|
type: 'bar',
|
|
@@ -84,11 +91,12 @@ const setChartOption1 = async (res) => {
|
|
|
name: currentYear.toString(),
|
|
name: currentYear.toString(),
|
|
|
type: 'bar',
|
|
type: 'bar',
|
|
|
data: currentYearData
|
|
data: currentYearData
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
],
|
|
],
|
|
|
color: [
|
|
color: [
|
|
|
'#fa8c89',
|
|
'#fa8c89',
|
|
|
'#6bbefa',
|
|
'#6bbefa',
|
|
|
|
|
+ '#6e58d4'
|
|
|
],
|
|
],
|
|
|
dataZoom: [{ // 这是一个 dataZoom 组件,可以控制 x 轴或 y 轴的区域缩放
|
|
dataZoom: [{ // 这是一个 dataZoom 组件,可以控制 x 轴或 y 轴的区域缩放
|
|
|
type: 'inside', // 这里设置为 slider 类型,表示使用滑动条形式的 dataZoom 组件
|
|
type: 'inside', // 这里设置为 slider 类型,表示使用滑动条形式的 dataZoom 组件
|
|
@@ -103,10 +111,11 @@ const setChartOption1 = async (res) => {
|
|
|
}
|
|
}
|
|
|
const setChartOption3 = async (res) => {
|
|
const setChartOption3 = async (res) => {
|
|
|
if (res.code != 200) ElMessage.error(res.msg);
|
|
if (res.code != 200) ElMessage.error(res.msg);
|
|
|
- const a = res.data.filter(item => item.lastQuarterCurrentTotal - item.lastQuarterLastTotal < 0)
|
|
|
|
|
- const names = a.map(q => q.enterpriseName + ' 同比率' + (((q.lastQuarterCurrentTotal - q.lastQuarterLastTotal) / q.lastQuarterLastTotal) * 100).toFixed(2) + '%').reverse();
|
|
|
|
|
|
|
+ const a = res.data.filter(item => item.lastQuarterLastTotal - item.lastLastQuarterLastTotal < 0)
|
|
|
|
|
+ const names = a.map(q => q.enterpriseName + ' 同比率' + (((q.lastQuarterLastTotal - q.lastLastQuarterLastTotal) / q.lastLastQuarterLastTotal) * 100).toFixed(2) + '%').reverse();
|
|
|
const currentYearData = a.map(q => q.lastQuarterCurrentTotal?.toFixed(0)).reverse();
|
|
const currentYearData = a.map(q => q.lastQuarterCurrentTotal?.toFixed(0)).reverse();
|
|
|
const lastYearData = a.map(q => q.lastQuarterLastTotal?.toFixed(0)).reverse();
|
|
const lastYearData = a.map(q => q.lastQuarterLastTotal?.toFixed(0)).reverse();
|
|
|
|
|
+ const lastLastYearData = a.map(q => q.lastLastQuarterLastTotal?.toFixed(0)).reverse();
|
|
|
const chart = echarts.init(echartsRef3.value);
|
|
const chart = echarts.init(echartsRef3.value);
|
|
|
chart.setOption({
|
|
chart.setOption({
|
|
|
title: {
|
|
title: {
|
|
@@ -119,7 +128,7 @@ const setChartOption3 = async (res) => {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
legend: {
|
|
legend: {
|
|
|
- data: [lastYear.toString(), currentYear.toString()]
|
|
|
|
|
|
|
+ data: [lastLastYear.toString(),lastYear.toString(),currentYear.toString()]
|
|
|
},
|
|
},
|
|
|
grid: {
|
|
grid: {
|
|
|
left: '3%',
|
|
left: '3%',
|
|
@@ -136,6 +145,11 @@ const setChartOption3 = async (res) => {
|
|
|
data: names
|
|
data: names
|
|
|
},
|
|
},
|
|
|
series: [
|
|
series: [
|
|
|
|
|
+ {
|
|
|
|
|
+ name: lastLastYear.toString(),
|
|
|
|
|
+ type: 'bar',
|
|
|
|
|
+ data: lastLastYearData,
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
name: lastYear.toString(),
|
|
name: lastYear.toString(),
|
|
|
type: 'bar',
|
|
type: 'bar',
|
|
@@ -145,11 +159,12 @@ const setChartOption3 = async (res) => {
|
|
|
name: currentYear.toString(),
|
|
name: currentYear.toString(),
|
|
|
type: 'bar',
|
|
type: 'bar',
|
|
|
data: currentYearData
|
|
data: currentYearData
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
],
|
|
],
|
|
|
color: [
|
|
color: [
|
|
|
'#fa8c89',
|
|
'#fa8c89',
|
|
|
'#6bbefa',
|
|
'#6bbefa',
|
|
|
|
|
+ '#6e58d4'
|
|
|
],
|
|
],
|
|
|
dataZoom: [{ // 这是一个 dataZoom 组件,可以控制 x 轴或 y 轴的区域缩放
|
|
dataZoom: [{ // 这是一个 dataZoom 组件,可以控制 x 轴或 y 轴的区域缩放
|
|
|
type: 'inside', // 这里设置为 slider 类型,表示使用滑动条形式的 dataZoom 组件
|
|
type: 'inside', // 这里设置为 slider 类型,表示使用滑动条形式的 dataZoom 组件
|
|
@@ -164,10 +179,11 @@ const setChartOption3 = async (res) => {
|
|
|
}
|
|
}
|
|
|
const setChartOption4 = async (res) => {
|
|
const setChartOption4 = async (res) => {
|
|
|
if (res.code != 200) ElMessage.error(res.msg);
|
|
if (res.code != 200) ElMessage.error(res.msg);
|
|
|
- const a = res.data.filter(item => item.lastQuarterCurrentTotal - item.lastQuarterLastTotal < 0)
|
|
|
|
|
- const names = a.map(q => q.enterpriseName + ' 同比率' + (((q.lastQuarterCurrentTotal - q.lastQuarterLastTotal) / q.lastQuarterLastTotal) * 100).toFixed(2) + '%').reverse();
|
|
|
|
|
|
|
+ const a = res.data.filter(item => item.lastQuarterLastTotal - item.lastLastQuarterLastTotal < 0)
|
|
|
|
|
+ const names = a.map(q => q.enterpriseName + ' 同比率' + (((q.lastQuarterLastTotal - q.lastLastQuarterLastTotal) / q.lastLastQuarterLastTotal) * 100).toFixed(2) + '%').reverse();
|
|
|
const currentYearData = a.map(q => q.lastQuarterCurrentTotal?.toFixed(0)).reverse();
|
|
const currentYearData = a.map(q => q.lastQuarterCurrentTotal?.toFixed(0)).reverse();
|
|
|
const lastYearData = a.map(q => q.lastQuarterLastTotal?.toFixed(0)).reverse();
|
|
const lastYearData = a.map(q => q.lastQuarterLastTotal?.toFixed(0)).reverse();
|
|
|
|
|
+ const lastLastYearData = a.map(q => q.lastLastQuarterLastTotal?.toFixed(0)).reverse();
|
|
|
const chart = echarts.init(echartsRef4.value);
|
|
const chart = echarts.init(echartsRef4.value);
|
|
|
chart.setOption({
|
|
chart.setOption({
|
|
|
title: {
|
|
title: {
|
|
@@ -180,7 +196,7 @@ const setChartOption4 = async (res) => {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
legend: {
|
|
legend: {
|
|
|
- data: [lastYear.toString(), currentYear.toString()]
|
|
|
|
|
|
|
+ data: [lastLastYear.toString(),lastYear.toString(),currentYear.toString()]
|
|
|
},
|
|
},
|
|
|
grid: {
|
|
grid: {
|
|
|
left: '3%',
|
|
left: '3%',
|
|
@@ -197,6 +213,11 @@ const setChartOption4 = async (res) => {
|
|
|
data: names
|
|
data: names
|
|
|
},
|
|
},
|
|
|
series: [
|
|
series: [
|
|
|
|
|
+ {
|
|
|
|
|
+ name: lastLastYear.toString(),
|
|
|
|
|
+ type: 'bar',
|
|
|
|
|
+ data: lastLastYearData,
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
name: lastYear.toString(),
|
|
name: lastYear.toString(),
|
|
|
type: 'bar',
|
|
type: 'bar',
|
|
@@ -206,11 +227,12 @@ const setChartOption4 = async (res) => {
|
|
|
name: currentYear.toString(),
|
|
name: currentYear.toString(),
|
|
|
type: 'bar',
|
|
type: 'bar',
|
|
|
data: currentYearData
|
|
data: currentYearData
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
],
|
|
],
|
|
|
color: [
|
|
color: [
|
|
|
'#fa8c89',
|
|
'#fa8c89',
|
|
|
'#6bbefa',
|
|
'#6bbefa',
|
|
|
|
|
+ '#6e58d4'
|
|
|
],
|
|
],
|
|
|
dataZoom: [{ // 这是一个 dataZoom 组件,可以控制 x 轴或 y 轴的区域缩放
|
|
dataZoom: [{ // 这是一个 dataZoom 组件,可以控制 x 轴或 y 轴的区域缩放
|
|
|
type: 'inside', // 这里设置为 slider 类型,表示使用滑动条形式的 dataZoom 组件
|
|
type: 'inside', // 这里设置为 slider 类型,表示使用滑动条形式的 dataZoom 组件
|
|
@@ -225,13 +247,14 @@ const setChartOption4 = async (res) => {
|
|
|
}
|
|
}
|
|
|
const setChartOption5 = async (res) => {
|
|
const setChartOption5 = async (res) => {
|
|
|
if (res.code != 200) ElMessage.error(res.msg);
|
|
if (res.code != 200) ElMessage.error(res.msg);
|
|
|
- const a = res.data.filter(item => item.lastQuarterCurrentTotal - item.lastQuarterLastTotal < 0)
|
|
|
|
|
- const names = a.map(q => q.enterpriseName + ' 同比率' + (((q.lastQuarterCurrentTotal - q.lastQuarterLastTotal) / q.lastQuarterLastTotal) * 100).toFixed(2) + '%').reverse();
|
|
|
|
|
|
|
+ const a = res.data.filter(item => item.lastQuarterLastTotal - item.lastLastQuarterLastTotal < 0)
|
|
|
|
|
+ const names = a.map(q => q.enterpriseName + ' 同比率' + (((q.lastQuarterLastTotal - q.lastLastQuarterLastTotal) / q.lastLastQuarterLastTotal) * 100).toFixed(2) + '%').reverse();
|
|
|
const currentYearData = a.map(q => q.lastQuarterCurrentTotal?.toFixed(0)).reverse();
|
|
const currentYearData = a.map(q => q.lastQuarterCurrentTotal?.toFixed(0)).reverse();
|
|
|
- if(currentYearData[0] == null || currentYearData == undefined || currentYearData[0] == 0){
|
|
|
|
|
- isForbidden.value = true;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if(currentYearData[0] == null || currentYearData == undefined || currentYearData[0] == 0){
|
|
|
|
|
+ // isForbidden.value = true;
|
|
|
|
|
+ // }
|
|
|
const lastYearData = a.map(q => q.lastQuarterLastTotal?.toFixed(0)).reverse();
|
|
const lastYearData = a.map(q => q.lastQuarterLastTotal?.toFixed(0)).reverse();
|
|
|
|
|
+ const lastLastYearData = a.map(q => q.lastLastQuarterLastTotal?.toFixed(0)).reverse();
|
|
|
const chart = echarts.init(echartsRef5.value);
|
|
const chart = echarts.init(echartsRef5.value);
|
|
|
chart.setOption({
|
|
chart.setOption({
|
|
|
title: {
|
|
title: {
|
|
@@ -244,7 +267,7 @@ const setChartOption5 = async (res) => {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
legend: {
|
|
legend: {
|
|
|
- data: [lastYear.toString(), currentYear.toString()]
|
|
|
|
|
|
|
+ data: [lastLastYear.toString(),lastYear.toString(),currentYear.toString()]
|
|
|
},
|
|
},
|
|
|
grid: {
|
|
grid: {
|
|
|
left: '3%',
|
|
left: '3%',
|
|
@@ -261,6 +284,11 @@ const setChartOption5 = async (res) => {
|
|
|
data: names
|
|
data: names
|
|
|
},
|
|
},
|
|
|
series: [
|
|
series: [
|
|
|
|
|
+ {
|
|
|
|
|
+ name: lastLastYear.toString(),
|
|
|
|
|
+ type: 'bar',
|
|
|
|
|
+ data: lastLastYearData,
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
name: lastYear.toString(),
|
|
name: lastYear.toString(),
|
|
|
type: 'bar',
|
|
type: 'bar',
|
|
@@ -270,11 +298,12 @@ const setChartOption5 = async (res) => {
|
|
|
name: currentYear.toString(),
|
|
name: currentYear.toString(),
|
|
|
type: 'bar',
|
|
type: 'bar',
|
|
|
data: currentYearData
|
|
data: currentYearData
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
],
|
|
],
|
|
|
color: [
|
|
color: [
|
|
|
'#fa8c89',
|
|
'#fa8c89',
|
|
|
'#6bbefa',
|
|
'#6bbefa',
|
|
|
|
|
+ '#6e58d4'
|
|
|
],
|
|
],
|
|
|
dataZoom: [{ // 这是一个 dataZoom 组件,可以控制 x 轴或 y 轴的区域缩放
|
|
dataZoom: [{ // 这是一个 dataZoom 组件,可以控制 x 轴或 y 轴的区域缩放
|
|
|
type: 'inside', // 这里设置为 slider 类型,表示使用滑动条形式的 dataZoom 组件
|
|
type: 'inside', // 这里设置为 slider 类型,表示使用滑动条形式的 dataZoom 组件
|
|
@@ -289,10 +318,11 @@ const setChartOption5 = async (res) => {
|
|
|
}
|
|
}
|
|
|
const setChartOption2 = async (res) => {
|
|
const setChartOption2 = async (res) => {
|
|
|
if (res.code != 200) ElMessage.error(res.msg);
|
|
if (res.code != 200) ElMessage.error(res.msg);
|
|
|
- const a = res.data.filter(item => item.currentYearTotal - item.lastYearTotal < 0)
|
|
|
|
|
- const names = a.map(q => q.enterpriseName + " 同比率" + (((q.currentYearTotal - q.lastYearTotal) / q.lastYearTotal) * 100).toFixed(2) + "%").reverse();
|
|
|
|
|
- const currentYearTotalData = res.data.map(q => q.currentYearTotal?.toFixed(0)).reverse();
|
|
|
|
|
- const lastYearTotalData = res.data.map(q => q.lastYearTotal?.toFixed(0)).reverse();
|
|
|
|
|
|
|
+ const a = res.data.filter(item => item.lastYearTotal - item.lastLastYearTotal < 0)
|
|
|
|
|
+ const names = a.map(q => q.enterpriseName + " 同比率" + (((q.lastYearTotal - q.lastLastYearTotal) / q.lastLastYearTotal) * 100).toFixed(2) + "%").reverse();
|
|
|
|
|
+ const currentYearTotalData = a.map(q => q.currentYearTotal?.toFixed(0)).reverse();
|
|
|
|
|
+ const lastYearTotalData = a.map(q => q.lastYearTotal?.toFixed(0)).reverse();
|
|
|
|
|
+ const lastLastYearTotalData = a.map(q => q.lastLastYearTotal?.toFixed(0)).reverse();
|
|
|
const chart = echarts.init(echartsRef2.value);
|
|
const chart = echarts.init(echartsRef2.value);
|
|
|
chart.setOption({
|
|
chart.setOption({
|
|
|
title: {
|
|
title: {
|
|
@@ -318,7 +348,7 @@ const setChartOption2 = async (res) => {
|
|
|
'#c4ccd3'
|
|
'#c4ccd3'
|
|
|
],
|
|
],
|
|
|
legend: {
|
|
legend: {
|
|
|
- data: [lastYear.toString(), currentYear.toString()]
|
|
|
|
|
|
|
+ data: [lastLastYear.toString(),lastYear.toString(),currentYear.toString()]
|
|
|
},
|
|
},
|
|
|
grid: {
|
|
grid: {
|
|
|
left: '3%',
|
|
left: '3%',
|
|
@@ -335,6 +365,11 @@ const setChartOption2 = async (res) => {
|
|
|
data: names
|
|
data: names
|
|
|
},
|
|
},
|
|
|
series: [
|
|
series: [
|
|
|
|
|
+ {
|
|
|
|
|
+ name: lastLastYear.toString(),
|
|
|
|
|
+ type: 'bar',
|
|
|
|
|
+ data: lastLastYearTotalData
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
name: lastYear.toString(),
|
|
name: lastYear.toString(),
|
|
|
type: 'bar',
|
|
type: 'bar',
|
|
@@ -344,7 +379,7 @@ const setChartOption2 = async (res) => {
|
|
|
name: currentYear.toString(),
|
|
name: currentYear.toString(),
|
|
|
type: 'bar',
|
|
type: 'bar',
|
|
|
data: currentYearTotalData
|
|
data: currentYearTotalData
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
],
|
|
],
|
|
|
dataZoom: [{ // 这是一个 dataZoom 组件,可以控制 x 轴或 y 轴的区域缩放
|
|
dataZoom: [{ // 这是一个 dataZoom 组件,可以控制 x 轴或 y 轴的区域缩放
|
|
|
type: 'inside', // 这里设置为 slider 类型,表示使用滑动条形式的 dataZoom 组件
|
|
type: 'inside', // 这里设置为 slider 类型,表示使用滑动条形式的 dataZoom 组件
|