报表样式

This commit is contained in:
朱菊兰 2024-06-13 17:12:50 +08:00
parent 05b5814907
commit 2ab8acd4ca
12 changed files with 206 additions and 103 deletions

View File

@ -114,15 +114,14 @@ export default {
color: ["#FFCE6A", "#8EF0AB", "#288AFF"], color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
xData: ["成都", "邯郸", "瑞昌"], xData: ["成都", "邯郸", "瑞昌"],
yName: "单位/%", yName: "单位/%",
yAxisLabel: {
formatter: function (value) {
return value + ".00%";
},
},
series: [ series: [
{ {
name: "2024年4月目标值", name: "2024年4月目标值",
data: [85, 85, 85], data: [
{ name: "%", value: 85 },
{ name: "%", value: 85 },
{ name: "%", value: 85 },
],
type: "line", type: "line",
symbol: "circle", symbol: "circle",
symbolSize: 6, symbolSize: 6,
@ -136,7 +135,11 @@ export default {
}, },
{ {
name: "2023年4月", name: "2023年4月",
data: [57.5, 21.66, 18.4], data: [
{ name: "%", value: 57.5 },
{ name: "%", value: 21.66 },
{ name: "%", value: 18.4 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {
@ -150,7 +153,11 @@ export default {
}, },
{ {
name: "2024年4月", name: "2024年4月",
data: [23.33, 7.02, 80.2], data: [
{ name: "%", value: 23.33 },
{ name: "%", value: 7.02 },
{ name: "%", value: 80.2 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {

View File

@ -114,11 +114,6 @@ export default {
color: ["#FFCE6A", "#8EF0AB", "#288AFF"], color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
xData: ["成都", "邯郸", "瑞昌"], xData: ["成都", "邯郸", "瑞昌"],
yName: "单位/片", yName: "单位/片",
yAxisLabel: {
formatter: function (value) {
return value;
},
},
series: [ series: [
{ {
name: "2024年4月目标值", name: "2024年4月目标值",

View File

@ -114,11 +114,6 @@ export default {
color: ["#FFCE6A", "#8EF0AB", "#288AFF"], color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
xData: ["成都", "邯郸", "瑞昌"], xData: ["成都", "邯郸", "瑞昌"],
yName: "单位/片", yName: "单位/片",
yAxisLabel: {
formatter: function (value) {
return value;
},
},
series: [ series: [
{ {
name: "2024年4月目标值", name: "2024年4月目标值",

View File

@ -114,15 +114,14 @@ export default {
color: ["#FFCE6A", "#8EF0AB", "#288AFF"], color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
xData: ["成都", "邯郸", "瑞昌"], xData: ["成都", "邯郸", "瑞昌"],
yName: "单位/%", yName: "单位/%",
yAxisLabel: {
formatter: function (value) {
return value + ".00%";
},
},
series: [ series: [
{ {
name: "2024年4月目标值", name: "2024年4月目标值",
data: [85, 85, 85], data: [
{ name: "%", value: 85 },
{ name: "%", value: 85 },
{ name: "%", value: 85 },
],
type: "line", type: "line",
symbol: "circle", symbol: "circle",
symbolSize: 6, symbolSize: 6,
@ -136,7 +135,11 @@ export default {
}, },
{ {
name: "2023年4月", name: "2023年4月",
data: [57.5, 21.66, 18.4], data: [
{ name: "%", value: 57.5 },
{ name: "%", value: 21.66 },
{ name: "%", value: 18.4 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {
@ -150,7 +153,11 @@ export default {
}, },
{ {
name: "2024年4月", name: "2024年4月",
data: [23.33, 7.02, 80.2], data: [
{ name: "%", value: 23.33 },
{ name: "%", value: 7.02 },
{ name: "%", value: 80.2 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {

View File

@ -1,6 +1,13 @@
<template> <template>
<div> <div>
<!-- 暂无数据 -->
<div
class="no-data-bg"
style="position: relative; left: 50%; transform: translateX(-50%)"
v-show="this.chartMsg.series.length === 0"
></div>
<!-- 图例 --> <!-- 图例 -->
<div v-show="this.chartMsg.series.length > 0">
<div class="legend"> <div class="legend">
<span class="item" v-for="item in legendList" :key="item.id"> <span class="item" v-for="item in legendList" :key="item.id">
<span <span
@ -26,6 +33,7 @@
:style="{ width: '100%', height: chartHeight + 'px' }" :style="{ width: '100%', height: chartHeight + 'px' }"
></div> ></div>
</div> </div>
</div>
</template> </template>
<script> <script>
import * as echarts from "echarts"; import * as echarts from "echarts";
@ -53,14 +61,18 @@ export default {
}, },
}, },
formatter: function (params) { formatter: function (params) {
console.log(params); var res = `<span style='color:rgba(0,0,0,0.8)'>${params[0].axisValueLabel}</span>`;
var res = `<span style='color:rgba(0,0,0,0.8)'>${params[0].name}</span>`;
for (var i = 0, l = params.length; i < l; i++) { for (var i = 0, l = params.length; i < l; i++) {
res += res +=
"<br/>" + "<br/>" +
`<span style='display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${params[i].color}'></span>` + `<span style='display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${params[i].color}'></span>` +
`<span style='display:inline-block;width:150px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[i].seriesName}</span>` + `<span style='display:inline-block;width:150px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[i].seriesName}</span>` +
`<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${params[i].value}</span>`; `<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${
params[i].name === "%"
? (params[i].value ? params[i].value.toFixed(2) : 0.0) +
params[i].name
: params[i].value
}</span>`;
} }
return res; return res;
}, },
@ -121,7 +133,7 @@ export default {
}, },
chartMsg: { chartMsg: {
handler(newVal) { handler(newVal) {
this.getMes(); this.canvasReset();
}, },
deep: true, deep: true,
}, },
@ -144,7 +156,23 @@ export default {
this.option.color = this.chartMsg.color; this.option.color = this.chartMsg.color;
this.option.xAxis.data = this.chartMsg.xData; this.option.xAxis.data = this.chartMsg.xData;
this.option.yAxis.name = this.chartMsg.yName; this.option.yAxis.name = this.chartMsg.yName;
this.option.yAxis.axisLabel = this.chartMsg.yAxisLabel; if (
this.chartMsg.series.length > 0 &&
this.chartMsg.series[0].data[0].name === "%"
) {
this.option.yAxis.axisLabel = {
formatter: function (value) {
return value + ".00%";
},
};
} else {
this.option.yAxis.axisLabel = {
formatter: function (value) {
return value;
},
};
}
// this.option.yAxis.axisLabel = this.chartMsg.yAxisLabel;
this.option.series = this.chartMsg.series; this.option.series = this.chartMsg.series;
this.myChart.setOption(this.option); this.myChart.setOption(this.option);
}, },

View File

@ -114,15 +114,14 @@ export default {
color: ["#FFCE6A", "#8EF0AB", "#288AFF"], color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
xData: ["成都", "邯郸", "瑞昌"], xData: ["成都", "邯郸", "瑞昌"],
yName: "单位/%", yName: "单位/%",
yAxisLabel: {
formatter: function (value) {
return value + ".00%";
},
},
series: [ series: [
{ {
name: "2024年4月目标值", name: "2024年4月目标值",
data: [85, 85, 85], data: [
{ name: "%", value: 85 },
{ name: "%", value: 85 },
{ name: "%", value: 85 },
],
type: "line", type: "line",
symbol: "circle", symbol: "circle",
symbolSize: 6, symbolSize: 6,
@ -136,7 +135,11 @@ export default {
}, },
{ {
name: "2023年4月", name: "2023年4月",
data: [57.5, 21.66, 18.4], data: [
{ name: "%", value: 57.5 },
{ name: "%", value: 21.66 },
{ name: "%", value: 18.4 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {
@ -150,7 +153,11 @@ export default {
}, },
{ {
name: "2024年4月", name: "2024年4月",
data: [23.33, 7.02, 80.2], data: [
{ name: "%", value: 23.33 },
{ name: "%", value: 7.02 },
{ name: "%", value: 80.2 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {

View File

@ -114,11 +114,6 @@ export default {
color: ["#FFCE6A", "#8EF0AB", "#288AFF"], color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
xData: ["成都", "邯郸", "瑞昌"], xData: ["成都", "邯郸", "瑞昌"],
yName: "单位/片", yName: "单位/片",
yAxisLabel: {
formatter: function (value) {
return value;
},
},
series: [ series: [
{ {
name: "2024年4月目标值", name: "2024年4月目标值",
@ -212,10 +207,58 @@ export default {
}, },
getSearch(val) { getSearch(val) {
console.log(val); console.log(val);
console.log("========================="); console.log("==========下面是测试代码,需删除");
this.chartMsg.series = [];
}, },
handleExport() { handleExport() {
console.log("导出"); console.log("导出=====下面是测试代码,需删除");
this.chartMsg.series = [
{
name: "2024年4月目标值1",
// data: [3000, 2000, 3000],
// data: [6800, 5000, 8900],
// data: [12000, 17000, 19000],
data: [560000, 540000, 600000],
type: "line",
symbol: "circle",
symbolSize: 6,
label: {
show: true,
color: "#FFAE17",
},
},
{
name: "2023年4月",
// data: [2100, 800, 1500],
// data: [9500, 7200, 9901],
// data: [14666, 15000, 17888],
data: [550000, 456666, 590000],
type: "bar",
barWidth: 20,
label: {
show: true,
// position: [-5, -16],
// position: [-5, -16],
// position: [-10, -16],
position: [-17, -16],
color: "#68C483",
},
},
{
name: "2024年4月",
// data: [2100, 900, 1300],
// data: [9100, 7300, 9700],
// data: [14666, 15300, 18000],
data: [556666, 456666, 650000],
type: "bar",
barWidth: 20,
label: {
show: true,
position: [0, -16],
color: "#288AFF",
},
},
];
}, },
}, },
}; };

View File

@ -114,15 +114,14 @@ export default {
color: ["#FFCE6A", "#8EF0AB", "#288AFF"], color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
xData: ["成都", "邯郸", "瑞昌"], xData: ["成都", "邯郸", "瑞昌"],
yName: "单位/%", yName: "单位/%",
yAxisLabel: {
formatter: function (value) {
return value + ".00%";
},
},
series: [ series: [
{ {
name: "2024年4月目标值", name: "2024年4月目标值",
data: [85, 85, 85], data: [
{ name: "%", value: 85 },
{ name: "%", value: 85 },
{ name: "%", value: 85 },
],
type: "line", type: "line",
symbol: "circle", symbol: "circle",
symbolSize: 6, symbolSize: 6,
@ -136,7 +135,11 @@ export default {
}, },
{ {
name: "2023年4月", name: "2023年4月",
data: [57.5, 21.66, 18.4], data: [
{ name: "%", value: 57.5 },
{ name: "%", value: 21.66 },
{ name: "%", value: 18.4 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {
@ -150,7 +153,11 @@ export default {
}, },
{ {
name: "2024年4月", name: "2024年4月",
data: [23.33, 7.02, 80.2], data: [
{ name: "%", value: 23.33 },
{ name: "%", value: 7.02 },
{ name: "%", value: 80.2 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {

View File

@ -114,11 +114,6 @@ export default {
color: ["#FFCE6A", "#8EF0AB", "#288AFF"], color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
xData: ["成都", "邯郸", "瑞昌"], xData: ["成都", "邯郸", "瑞昌"],
yName: "单位/片", yName: "单位/片",
yAxisLabel: {
formatter: function (value) {
return value;
},
},
series: [ series: [
{ {
name: "2024年4月目标值", name: "2024年4月目标值",

View File

@ -114,11 +114,6 @@ export default {
color: ["#FFCE6A", "#8EF0AB", "#288AFF"], color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
xData: ["成都", "邯郸", "瑞昌"], xData: ["成都", "邯郸", "瑞昌"],
yName: "单位/片", yName: "单位/片",
yAxisLabel: {
formatter: function (value) {
return value;
},
},
series: [ series: [
{ {
name: "2024年4月目标值", name: "2024年4月目标值",

View File

@ -11,7 +11,7 @@
/> />
</div> </div>
<div class="containerBottom"> <div class="containerBottom">
<div class="smallTitle">标准组件良率对标</div> <div class="smallTitle">芯片良率对标</div>
<base-table <base-table
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.current" :page="listQuery.current"
@ -114,15 +114,14 @@ export default {
color: ["#FFCE6A", "#8EF0AB", "#288AFF"], color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
xData: ["成都", "邯郸", "瑞昌"], xData: ["成都", "邯郸", "瑞昌"],
yName: "单位/%", yName: "单位/%",
yAxisLabel: {
formatter: function (value) {
return value + ".00%";
},
},
series: [ series: [
{ {
name: "2024年4月目标值", name: "2024年4月目标值",
data: [85, 85, 85], data: [
{ name: "%", value: 85 },
{ name: "%", value: 85 },
{ name: "%", value: 85 },
],
type: "line", type: "line",
symbol: "circle", symbol: "circle",
symbolSize: 6, symbolSize: 6,
@ -136,7 +135,11 @@ export default {
}, },
{ {
name: "2023年4月", name: "2023年4月",
data: [57.5, 21.66, 18.4], data: [
{ name: "%", value: 57.5 },
{ name: "%", value: 21.66 },
{ name: "%", value: 18.4 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {
@ -150,7 +153,11 @@ export default {
}, },
{ {
name: "2024年4月", name: "2024年4月",
data: [23.33, 7.02, 80.2], data: [
{ name: "%", value: 23.33 },
{ name: "%", value: 7.02 },
{ name: "%", value: 80.2 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {

View File

@ -60,7 +60,13 @@ const tableProps = [
}, },
{ {
prop: "mubiao", prop: "mubiao",
label: "目标值", label: "月目标值",
minWidth: 150,
showOverflowtooltip: true,
},
{
prop: "mubiao2",
label: "年目标值",
minWidth: 150, minWidth: 150,
showOverflowtooltip: true, showOverflowtooltip: true,
}, },
@ -115,15 +121,14 @@ export default {
color: ["#8EF0AB", "#63BDFF", "#288AFF", "#7164FF"], color: ["#8EF0AB", "#63BDFF", "#288AFF", "#7164FF"],
xData: ["成都", "邯郸", "瑞昌"], xData: ["成都", "邯郸", "瑞昌"],
yName: "单位/%", yName: "单位/%",
yAxisLabel: {
formatter: function (value) {
return value + ".00%";
},
},
series: [ series: [
{ {
name: "2023年4月", name: "2023年4月",
data: [12.64, 12.29, 12.33], data: [
{ name: "%", value: 12.64444444 },
{ name: "%", value: 12.29 },
{ name: "%", value: 12.33 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
barGap: 0.5, barGap: 0.5,
@ -139,7 +144,11 @@ export default {
}, },
{ {
name: "2024年4月", name: "2024年4月",
data: [14.92, 15.31, 15.36], data: [
{ name: "%", value: 14.92 },
{ name: "%", value: 15.31 },
{ name: "%", value: 15.36 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {
@ -154,7 +163,11 @@ export default {
}, },
{ {
name: "2024年4月目标值", name: "2024年4月目标值",
data: [15.36, 15.52, 15.63], data: [
{ name: "%", value: 15.36 },
{ name: "%", value: 15.52 },
{ name: "%", value: 15.63 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {
@ -169,7 +182,11 @@ export default {
}, },
{ {
name: "2024年目标值", name: "2024年目标值",
data: [15.63, 15.69, 15.78], data: [
{ name: "%", value: 15.63 },
{ name: "%", value: 15.69 },
{ name: "%", value: 15.78 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {