update -测温曲线优化

master
yinq 4 months ago
parent 2104a58580
commit 86e4b721f5

@ -42,3 +42,12 @@ export function delTemperatureHistory(objId) {
method: 'delete'
})
}
//测温记录折线图
export function getTestTemp(data) {
return request({
url: '/report/temperatureHistory/testTemp',
method: 'post',
data: data
})
}

@ -272,6 +272,20 @@ export const dynamicRoutes = [
},
],
},
{
path: "/report/temperature-record",
component: Layout,
hidden: true,
permissions: ["report:electricalInspection:list"],
children: [
{
path: "index/:objId(\\d+)",
component: () => import("@/views/report/temperatureRecordReport/tempTest"),
name: "tempTest",
meta: {title: "查看测温报表曲线", activeMenu: "/report/temperatureTest"},
},
],
},
{
path: "/base/bom-info",
component: Layout,

@ -34,7 +34,9 @@
<el-table-column
prop="processName"
label="工序"
width="150">
width="150"
fixed="left"
>
</el-table-column>
<el-table-column :label="i" v-for="(i,k) in tableHead" :key="i">
<el-table-column

@ -58,6 +58,11 @@
label="问题数量"
>
</el-table-column>
<el-table-column
prop="q_rate"
label="问题占比"
>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
@ -121,9 +126,18 @@ export default {
, FACTORY_CODE: this.form.factory, PRODUCT_LINE_CODE: this.form.productionLine
}).then(response => {
//
console.log(response)
this.total = response?.total || 0
this.tableData = response.data
const totalQSum = (response.data || []).reduce((accumulator, { q_SUM = 0 }) => accumulator + q_SUM, 0);
if (totalQSum > 0){
response.data.forEach(e =>{
e.q_rate = (e.q_SUM / totalQSum * 100).toFixed(2) + '%';
})
this.tableData = response.data
}else {
this.tableData = response.data
}
this.$refs.chart1.setData({
tooltip: {
trigger: 'axis',

@ -78,7 +78,13 @@
<el-table-column label="主键" align="center" prop="objId" v-if="columns[0].visible"/>
<el-table-column label="线号" align="center" prop="lineNo" v-if="columns[1].visible"/>
<el-table-column label="工位号" align="center" prop="gongwno" v-if="columns[2].visible"/>
<el-table-column label="产品条码" align="center" prop="cpno" v-if="columns[3].visible" width="200" />
<el-table-column label="产品条码" align="center" prop="cpno" v-if="columns[3].visible" width="200" >
<template slot-scope="scope">
<router-link :to="'/report/temperature-record/index/' + scope.row.objId" class="link-type">
<span>{{ scope.row.cpno }}</span>
</router-link>
</template>
</el-table-column>
<el-table-column label="产品型号" align="center" prop="cpmodel" v-if="columns[4].visible" width="180"/>
<el-table-column label="基准型号" align="center" prop="factorymodel" v-if="columns[5].visible" width="180"/>
<el-table-column label="测试结果" align="center" prop="cpresult" v-if="columns[12].visible"/>

@ -0,0 +1,116 @@
<template>
<div :class="className" :style="{height:height,width:width}"/>
</template>
<script>
import * as echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
import resize from '@/views/dashboard/mixins/resize'
import { getTestTemp } from '@/api/report/temperatureHistory'
import { parseTime } from '@/utils/ruoyi'
const animationDuration = 3000
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '700px'
}
},
data() {
return {
testTime: '',
testTempMes: [],
chart: null,
queryParams: {
objId: null
},
chartOptions: {
xAxis: {
data: [] // x
},
yAxis: {
type: 'value'
},
series: [{
data: [], // y
type: 'line'
}]
}
}
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
created() {
this.queryParams.objId = this.$route.params && this.$route.params.objId
this.openDifference()
},
methods: {
//
openDifference() {
// this.form.cpno = row.cpno;
getTestTemp(this.queryParams).then(response => {
this.reportDetailList = response.data.tempList
this.open = true
this.title = '测温报表曲线'
this.testTime = response.data.tempList[0]
this.initChart()
}
)
},
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.xdata = this.testTime
var series = []
for (var i = 1; i < this.reportDetailList.length; i++) {
series.push({
name: '温度' + [i],
type: 'line',
data: this.reportDetailList[i]
})
}
this.chart.setOption({
xAxis: {
data: this.testTime,
axisLine: {
// show:true,
onZero: false
}
},
legend: {
data: ['温度1', '温度2', '温度3', '温度4', '温度5', '温度6', '温度7', '温度8', '温度9', '温度10', '温度11', '室温']
},
yAxis: {
scale: true,
type: 'value'
},
series: series
})
}
},
mounted() {
this.$nextTick(() => {
// this.initChart()
})
}
}
</script>
Loading…
Cancel
Save