添加图表

master
夜笙歌 3 months ago
parent da14637f0d
commit 03cd1f2572

@ -150,9 +150,9 @@ import {
qualityDefectsStatisticalAnalysisList,
qualityDefectsDetailList
} from '@/api/report/reportAPI'
import { findProductLineList } from '@//api/base/productLine'
import { parseTime } from '@//utils/ruoyi'
import { getCustomData } from '@//api/base/customData'
import {findProductLineList} from '@//api/base/productLine'
import {parseTime} from '@//utils/ruoyi'
import {getCustomData} from '@//api/base/customData'
import Chart from "@/components/board/Chart";
import * as echarts from "echarts";
@ -208,14 +208,14 @@ export default {
//
rules: {},
columns: [
{ key: 0, label: `主键标识`, visible: false },
{ key: 1, label: `工厂`, visible: true },
{ key: 2, label: `产线编号`, visible: false },
{ key: 3, label: `产线名称`, visible: true },
{ key: 4, label: `质检工位编号`, visible: false },
{ key: 5, label: `质检工位名称`, visible: true },
{ key: 6, label: `检测数不合格数`, visible: true },
{ key: 7, label: `合格率(%)`, visible: true }
{key: 0, label: `主键标识`, visible: false},
{key: 1, label: `工厂`, visible: true},
{key: 2, label: `产线编号`, visible: false},
{key: 3, label: `产线名称`, visible: true},
{key: 4, label: `质检工位编号`, visible: false},
{key: 5, label: `质检工位名称`, visible: true},
{key: 6, label: `检测数不合格数`, visible: true},
{key: 7, label: `合格率(%)`, visible: true}
],
// 线
productLineList: [],
@ -226,10 +226,10 @@ export default {
}
},
created() {
findProductLineList({ productLineType: 1 }).then(response => {
findProductLineList({productLineType: 1}).then(response => {
this.productLineList = response.data
})
findProductLineList({ productLineType: 2, stationType: 2 }).then(response => {
findProductLineList({productLineType: 2, stationType: 2}).then(response => {
this.findStationList = response.data
})
//
@ -331,9 +331,13 @@ export default {
xAxis: [
{
type: 'category',
data:response.data.map(val=>val.QUALITY_DEFECT_NAME),
data: response.data.map(val => val.QUALITY_DEFECT_NAME),
axisTick: {
alignWithLabel: true
alignWithLabel: true,
},
axisLabel:{
interval: 0
}
}
],
@ -352,10 +356,11 @@ export default {
normal: {
show: true,
position: "top",
formatter:(e)=>{
if(e.data === 0){
formatter: (e) => {
if (e.data === 0) {
return ''
}else{}
} else {
}
return e.data
},
textStyle: {
@ -380,7 +385,7 @@ export default {
]),
},
},
data: response.data.map(val=>val.SEQ),
data: response.data.map(val => val.DEFECT_NUMBER),
}
]
})
@ -412,7 +417,7 @@ export default {
}
</script>
<style>
.chart1{
.chart1 {
width: 100%;
height: 200px;
margin-top: 12px;

Loading…
Cancel
Save