feat: 样式调整

This commit is contained in:
caoqianming 2024-12-27 20:15:55 +08:00
parent 1747bc6a91
commit 6404fd33f1
4 changed files with 42 additions and 19 deletions

View File

@ -170,7 +170,7 @@
</div> </div>
</template> </template>
<script> <script>
const colors = ["#647bfe", "#8698fe", "#a9b6fe", "#91CC75", "#EE6666"]; const colors = ["#5b9bd5", "#ed7d31", "#70ad47", "#ffc000", "#4472c4"];
let tooltip = { let tooltip = {
show: true, show: true,
trigger: "axis", trigger: "axis",
@ -182,8 +182,8 @@ let tooltip = {
triggerOn: "mousemove", triggerOn: "mousemove",
}; };
let grid = { let grid = {
right: "10%", right: "11%",
left: "4%", left: "11%",
top: "20%", top: "20%",
}; };
let toolbox = { let toolbox = {
@ -242,7 +242,24 @@ let yAxis = [
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {
color: colors[3], color: colors[2],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "台时(t/h)",
position: "left",
alignTicks: true,
nameRotate: 30,
offset: 60,
axisLine: {
show: true,
lineStyle: {
color: colors[1],
}, },
}, },
axisLabel: { axisLabel: {
@ -375,7 +392,7 @@ export default {
{ {
name: "台时产量", name: "台时产量",
type: "bar", type: "bar",
yAxisIndex: 0, yAxisIndex: 3,
data: [], data: [],
}, },
{ {

View File

@ -25,7 +25,7 @@
> >
<thead class="myTableHead"> <thead class="myTableHead">
<tr> <tr>
<th colspan="10">生料工序生产报告</th> <th colspan="10">生料辅料工序生产报告</th>
</tr> </tr>
<tr> <tr>
<th colspan="2">参数</th> <th colspan="2">参数</th>
@ -295,8 +295,8 @@ let tooltip = {
// alwaysShowContent:true, // alwaysShowContent:true,
}; };
let grid = { let grid = {
right: "10%", right: "11%",
left: "10%", left: "11%",
top: "15%", top: "15%",
}; };
let toolbox = { let toolbox = {
@ -409,7 +409,10 @@ export default {
tooltip: tooltip, tooltip: tooltip,
grid: grid, grid: grid,
toolbox: toolbox, toolbox: toolbox,
legend: legend, legend: {
top: "2%",
data: ["总产量", "分布电耗"],
},
xAxis: { xAxis: {
axisTick: { axisTick: {
show: true, show: true,
@ -996,14 +999,14 @@ export default {
data.forEach((item) => { data.forEach((item) => {
let ind = item.hour; let ind = item.hour;
seriesData0[ind] = item.total_production; seriesData0[ind] = item.total_production;
seriesData1[ind] = Number(item.production_hour).toFixed(2); // seriesData1[ind] = Number(item.production_hour).toFixed(2);
seriesData2[ind] = item.run_rate; // seriesData2[ind] = item.run_rate;
seriesData3[ind] = item.elec_consume_unit; seriesData3[ind] = item.elec_consume_unit;
}); });
let options = { ...that.option1 }; let options = { ...that.option1 };
options.series[0].data = seriesData0; options.series[0].data = seriesData0;
options.series[1].data = seriesData1; // options.series[1].data = seriesData1;
options.series[2].data = seriesData2; // options.series[2].data = seriesData2;
options.series[3].data = seriesData3; options.series[3].data = seriesData3;
let hourXAxis = []; let hourXAxis = [];
for (let i = 0; i < 24; i++) { for (let i = 0; i < 24; i++) {

View File

@ -425,7 +425,10 @@ export default {
tooltip: tooltip, tooltip: tooltip,
grid: grid, grid: grid,
toolbox: toolbox, toolbox: toolbox,
legend: legend, legend: {
top: "2%",
data: ["总产量", "分布电耗", "成本"],
},
xAxis: { xAxis: {
axisTick: { axisTick: {
show: true, show: true,
@ -1070,15 +1073,15 @@ export default {
data.forEach((item) => { data.forEach((item) => {
let ind = item.hour; let ind = item.hour;
seriesData0[ind] = item.total_production; seriesData0[ind] = item.total_production;
seriesData1[ind] = Number(item.production_hour).toFixed(2); // seriesData1[ind] = Number(item.production_hour).toFixed(2);
seriesData2[ind] = item.run_rate; // seriesData2[ind] = item.run_rate;
seriesData3[ind] = item.elec_consume_unit; seriesData3[ind] = item.elec_consume_unit;
seriesData4[ind] = item.production_cost_unit; seriesData4[ind] = item.production_cost_unit;
}); });
let options = { ...that.option1 }; let options = { ...that.option1 };
options.series[0].data = seriesData0; options.series[0].data = seriesData0;
options.series[1].data = seriesData1; // options.series[1].data = seriesData1;
options.series[2].data = seriesData2; // options.series[2].data = seriesData2;
options.series[3].data = seriesData3; options.series[3].data = seriesData3;
options.series[4].data = seriesData4; options.series[4].data = seriesData4;
let hourXAxis = []; let hourXAxis = [];

View File

@ -24,7 +24,7 @@
> >
<thead class="myTableHead"> <thead class="myTableHead">
<tr> <tr>
<th colspan="10">生料工序生产报告</th> <th colspan="10">生料辅料工序生产报告</th>
</tr> </tr>
<tr> <tr>
<th colspan="2">参数</th> <th colspan="2">参数</th>