update 产品质量分析

This commit is contained in:
lb 2023-09-04 14:35:13 +08:00
vanhempi 6f71b6a7c0
commit fbd78c6aa5
2 muutettua tiedostoa jossa 86 lisäystä ja 11 poistoa

Näytä tiedosto

@ -6,29 +6,44 @@
-->
<template>
<div class="line-chart">line LineChart</div>
<div class="line-chart"></div>
</template>
<script>
import * as echarts from 'echarts';
export default {
name: 'LineChart',
components: {},
props: ['config'],
data() {
return {
chart: null,
};
chart: null,
};
},
computed: {},
methods: {},
mounted() {
this.init();
},
beforeDestroy() {
if (this.chart) {
this.chart.dispose();
}
},
methods: {
init() {
console.log('thsi el', this.$el);
if (!this.chart) this.chart = echarts.init(this.$el);
this.chart.setOption(this.config);
},
},
};
</script>
<style scoped lang="scss">
.line-chart {
margin: 24px;
padding: 12px;
padding: 0 12px;
background: #e1e1e1;
min-height: 200px;
min-height: 320px;
}
</style>

Näytä tiedosto

@ -29,7 +29,7 @@
@close="dialogClose"
@cancel="dialogClose"
@confirm="dialogClose">
<LineChart :config="lineChartConfig" />
<LineChart v-if="dialogVisible" :config="lineChartConfig" />
</base-dialog>
</div>
</template>
@ -72,8 +72,8 @@ export default {
dateType: 'daterange', // datetimerange
// format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd',
// valueFormat: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'timestamp',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
// valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始日期',
endPlaceholder: '结束日期',
@ -150,7 +150,67 @@ export default {
align: 'center',
},
],
lineChartConfig: {
grid: {
top: 88,
left: 56,
right: 56,
bottom: 56,
},
legend: {
top: 0,
left: 0,
padding: 5,
icon: 'roundRect',
itemWidth: 12,
itemHeight: 12,
itemGap: 20,
textStyle: {
fontSize: 14,
lineHeight: 14
},
},
xAxis: {
type: 'category',
data: ['设备1', '设备2', '设备3', '设备4', '设备5'],
},
yAxis: {
type: 'value',
name: '合格率',
nameLocation: 'end',
nameTextStyle: {
fontSize: 14,
align: 'right'
},
nameGap: 26
},
series: [
{
name: '产线1',
data: [150, 230, 224, 218, 135],
type: 'line',
smooth: true,
},
{
name: '产线2',
data: [111, 224, 42, 11, 24],
type: 'line',
smooth: true,
},
{
name: '产线3',
data: [218, 112, 331, 44, 99],
type: 'line',
smooth: true,
},
{
name: '产线4',
data: [3, 221, 42, 553, 311],
type: 'line',
smooth: true,
},
],
},
//
queryParams: {
pageNo: 1,