Pārlūkot izejas kodu

update 产品质量分析

pull/18/head^2
lb pirms 1 gada
vecāks
revīzija
fbd78c6aa5
2 mainītis faili ar 86 papildinājumiem un 11 dzēšanām
  1. +22
    -7
      src/views/equipment/analysis/quality/components/lineChart.vue
  2. +64
    -4
      src/views/equipment/analysis/quality/index.vue

+ 22
- 7
src/views/equipment/analysis/quality/components/lineChart.vue Parādīt failu

@@ -6,29 +6,44 @@
--> -->


<template> <template>
<div class="line-chart">line LineChart</div>
<div class="line-chart"></div>
</template> </template>


<script> <script>
import * as echarts from 'echarts';

export default { export default {
name: 'LineChart', name: 'LineChart',
components: {}, components: {},
props: ['config'], props: ['config'],
data() { data() {
return { return {
chart: null,
};
chart: null,
};
}, },
computed: {}, 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> </script>


<style scoped lang="scss"> <style scoped lang="scss">
.line-chart { .line-chart {
margin: 24px;
padding: 12px;
padding: 0 12px;
background: #e1e1e1; background: #e1e1e1;
min-height: 200px;
min-height: 320px;
} }
</style> </style>

+ 64
- 4
src/views/equipment/analysis/quality/index.vue Parādīt failu

@@ -29,7 +29,7 @@
@close="dialogClose" @close="dialogClose"
@cancel="dialogClose" @cancel="dialogClose"
@confirm="dialogClose"> @confirm="dialogClose">
<LineChart :config="lineChartConfig" />
<LineChart v-if="dialogVisible" :config="lineChartConfig" />
</base-dialog> </base-dialog>
</div> </div>
</template> </template>
@@ -72,8 +72,8 @@ export default {
dateType: 'daterange', // datetimerange dateType: 'daterange', // datetimerange
// format: 'yyyy-MM-dd HH:mm:ss', // format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
// valueFormat: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'timestamp',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
// valueFormat: 'timestamp',
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始日期', startPlaceholder: '开始日期',
endPlaceholder: '结束日期', endPlaceholder: '结束日期',
@@ -150,7 +150,67 @@ export default {
align: 'center', 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: { queryParams: {
pageNo: 1, pageNo: 1,


Notiek ielāde…
Atcelt
Saglabāt