|
|
|
@ -19,8 +19,8 @@ |
|
|
|
<el-form :inline="true" v-model="lineForm" label-width="80px"> |
|
|
|
<el-form :inline="true" v-model="lineForm" label-width="80px"> |
|
|
|
<el-row :gutter="24"> |
|
|
|
<el-row :gutter="24"> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="作业中心" prop="workCenterId"> |
|
|
|
<el-form-item label="作业中心" prop="wcId"> |
|
|
|
<el-select v-model="lineForm.workCenterId" placeholder="请选择" style="width: 200px;"> |
|
|
|
<el-select v-model="lineForm.wcId" placeholder="请选择" style="width: 200px;"> |
|
|
|
<el-option v-for="item in workCenterData" :key="item.id" :label="item.wcName" |
|
|
|
<el-option v-for="item in workCenterData" :key="item.id" :label="item.wcName" |
|
|
|
:value="item.id"></el-option> |
|
|
|
:value="item.id"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
@ -46,7 +46,7 @@ |
|
|
|
<div v-if="isShowBox"> |
|
|
|
<div v-if="isShowBox"> |
|
|
|
<el-row :gutter="24" id="chartsContainer1"> |
|
|
|
<el-row :gutter="24" id="chartsContainer1"> |
|
|
|
<el-col :span="12" v-for="(item,index) in lineData" :key="item.id"> |
|
|
|
<el-col :span="12" v-for="(item,index) in lineData" :key="item.id"> |
|
|
|
<div style="width: 100%;height: 240px;" :id="`chart-${index}`"></div> |
|
|
|
<div style="width: 100%;height: 240px;" :id="`chart-${item.id || index}`"></div> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<!-- <el-col :span="12"> |
|
|
|
<!-- <el-col :span="12"> |
|
|
|
<div style="width: 100%;height: 240px;" ref="lineChart2"></div> |
|
|
|
<div style="width: 100%;height: 240px;" ref="lineChart2"></div> |
|
|
|
@ -77,22 +77,22 @@ |
|
|
|
<!-- <div style="width: 33%;margin-bottom: 15px;">槽号:{{ detailForm.slotNo }}</div> |
|
|
|
<!-- <div style="width: 33%;margin-bottom: 15px;">槽号:{{ detailForm.slotNo }}</div> |
|
|
|
<div style="width: 33%;margin-bottom: 15px;">检测成分:{{ detailForm.testName }}</div> --> |
|
|
|
<div style="width: 33%;margin-bottom: 15px;">检测成分:{{ detailForm.testName }}</div> --> |
|
|
|
<div style="width: 33%;">曲线时间范围:{{ detailForm.lineTime }}</div> |
|
|
|
<div style="width: 33%;">曲线时间范围:{{ detailForm.lineTime }}</div> |
|
|
|
<div style="width: 33%;">操作人:{{ detailForm.createTime }}</div> |
|
|
|
<div style="width: 33%;">操作人:{{ detailForm.updateUserRealName }}</div> |
|
|
|
<div style="width: 33%;">曲线生成时间:{{ detailForm.createUser }}</div> |
|
|
|
<div style="width: 33%;">曲线生成时间:{{ detailForm.createTime }}</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style="margin: 20px 0;"> |
|
|
|
<div style="margin: 20px 0;"> |
|
|
|
检测曲线 |
|
|
|
检测曲线 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div id="chartsContainer1"> |
|
|
|
<div id="chartsContainer1" style=""> |
|
|
|
<div style="width: 100%;height: 240px;" v-for="(item,index) in lineData" :key="item.id" :id="`chart-${index}`"></div> |
|
|
|
<div style="width: 100%;height: 240px;margin-top:30px;" v-for="(item,index) in lineData" :key="item.id" :id="`chart-${item.id || index}`"></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import {createLineList,generateLine,getLineList,deleteLine} from '@/api/tankSolutionSystem/resultsCon' |
|
|
|
import {createLineList,generateLine,getLineList,deleteLine,getLineDetail} from '@/api/tankSolutionSystem/resultsCon' |
|
|
|
import {getWorkCenter} from '@/api/tankSolutionSystem/info' |
|
|
|
import {getWorkCenter} from '@/api/tankSolutionSystem/info' |
|
|
|
import { detail } from '@/api/flow/flow' |
|
|
|
import { detail } from '@/api/flow/flow' |
|
|
|
import { exportEchartsToPdf } from '@/utils/exportPdf'; // 引入工具函数 |
|
|
|
import { exportEchartsToPdf } from '@/utils/exportPdf'; // 引入工具函数 |
|
|
|
@ -248,49 +248,13 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
createLine(){ |
|
|
|
createLine(){ |
|
|
|
createLineList({ |
|
|
|
createLineList({ |
|
|
|
workCenterId:this.lineForm.workCenterId, |
|
|
|
workCenterId:this.lineForm.wcId, |
|
|
|
createTimeStart:this.lineForm.timeRange && this.lineForm.timeRange.length != 0 ? this.lineForm.timeRange[0] : '', |
|
|
|
createTimeStart:this.lineForm.timeRange && this.lineForm.timeRange.length != 0 && this.lineForm.timeRange[0] , |
|
|
|
createTimeEnd:this.lineForm.timeRange && this.lineForm.timeRange.length != 0 ? this.lineForm.timeRange[1] : '', |
|
|
|
createTimeEnd:this.lineForm.timeRange && this.lineForm.timeRange.length != 0 && this.lineForm.timeRange[1] , |
|
|
|
}).then(res =>{ |
|
|
|
}).then(res =>{ |
|
|
|
console.log('res--------------',res) |
|
|
|
console.log('res--------------',res) |
|
|
|
this.isShowBox = true |
|
|
|
this.isShowBox = true |
|
|
|
this.lineData = res.data.data.waveData |
|
|
|
this.lineData = res.data.data.waveData |
|
|
|
// this.wareData = res.data.data.records |
|
|
|
|
|
|
|
// this.lineData = [ |
|
|
|
|
|
|
|
// { |
|
|
|
|
|
|
|
// workCenterId:"001", |
|
|
|
|
|
|
|
// workCenterName:"作业中心A", |
|
|
|
|
|
|
|
// workTankId:"002", |
|
|
|
|
|
|
|
// workTankName:"作业槽A", |
|
|
|
|
|
|
|
// testElement:"分析项目A", |
|
|
|
|
|
|
|
// date:['2025-12-05','2025-12-06','2025-12-07','2025-12-08','2025-12-09','2025-12-10',], |
|
|
|
|
|
|
|
// max:['10','10','10','10','10','10',],//如果上限下限不能返回数组,可范围数字10,前端进行处理 |
|
|
|
|
|
|
|
// min: ['5','5','5','5','5','5',], |
|
|
|
|
|
|
|
// targrt:['6','3','2','1','10','15',] |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
// { |
|
|
|
|
|
|
|
// workCenterId:"001", |
|
|
|
|
|
|
|
// workCenterName:"作业中心A", |
|
|
|
|
|
|
|
// workTankId:"002", |
|
|
|
|
|
|
|
// workTankName:"作业槽A", |
|
|
|
|
|
|
|
// testElement:"分析项目B", |
|
|
|
|
|
|
|
// date:['2025-12-05','2025-12-06','2025-12-07','2025-12-08','2025-12-09','2025-12-10',], |
|
|
|
|
|
|
|
// max:['10','10','10','10','10','10',],//如果上限下限不能返回数组,可范围数字10,前端进行处理 |
|
|
|
|
|
|
|
// min: ['5','5','5','5','5','5',], |
|
|
|
|
|
|
|
// targrt:['6','3','2','1','10','15',] |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
// { |
|
|
|
|
|
|
|
// workCenterId:"001", |
|
|
|
|
|
|
|
// workCenterName:"作业中心A", |
|
|
|
|
|
|
|
// workTankId:"003", |
|
|
|
|
|
|
|
// workTankName:"作业槽B", |
|
|
|
|
|
|
|
// testElement:"分析项目C", |
|
|
|
|
|
|
|
// date:['2025-12-05','2025-12-06','2025-12-07','2025-12-08','2025-12-09','2025-12-10',], |
|
|
|
|
|
|
|
// max:['10','10','10','10','10','10',],//如果上限下限不能返回数组,可范围数字10,前端进行处理 |
|
|
|
|
|
|
|
// min: ['5','5','5','5','5','5',], |
|
|
|
|
|
|
|
// targrt:['6','3','2','1','10','15',] |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// ] |
|
|
|
|
|
|
|
this.$nextTick(() =>{ |
|
|
|
this.$nextTick(() =>{ |
|
|
|
this.createChart() |
|
|
|
this.createChart() |
|
|
|
}) |
|
|
|
}) |
|
|
|
@ -298,12 +262,26 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
createChart(){ |
|
|
|
createChart(){ |
|
|
|
|
|
|
|
console.log('this.lineData',this.lineData) |
|
|
|
|
|
|
|
let globalMax = -Infinity; // 初始化一个极小值 |
|
|
|
this.lineData.forEach((item, index) => { |
|
|
|
this.lineData.forEach((item, index) => { |
|
|
|
|
|
|
|
if (item.maxList && item.maxList.length > 0) { |
|
|
|
|
|
|
|
// 找出当前对象 max 数组里的最大值 |
|
|
|
|
|
|
|
const currentMax = Math.max(...item.maxList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 如果比全局最大值大,则更新 |
|
|
|
|
|
|
|
if (currentMax > globalMax) { |
|
|
|
|
|
|
|
globalMax = currentMax; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
console.log('item-----------',item) |
|
|
|
const chartId = `chart-${item.id || index}`; |
|
|
|
const chartId = `chart-${item.id || index}`; |
|
|
|
const chartDom = document.getElementById(chartId); |
|
|
|
const chartDom = document.getElementById(chartId); |
|
|
|
|
|
|
|
console.log('chartDom----------',chartDom) |
|
|
|
if (!chartDom) return; |
|
|
|
if (!chartDom) return; |
|
|
|
// 初始化ECharts实例 |
|
|
|
// 初始化ECharts实例 |
|
|
|
const chart = this.$echarts.init(chartDom); |
|
|
|
const chart = this.$echarts.init(chartDom); |
|
|
|
|
|
|
|
console.log('chart----------',chart) |
|
|
|
|
|
|
|
|
|
|
|
const option = { |
|
|
|
const option = { |
|
|
|
title: { |
|
|
|
title: { |
|
|
|
@ -312,8 +290,8 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
legend: { |
|
|
|
legend: { |
|
|
|
show: true, |
|
|
|
show: true, |
|
|
|
orient: "vertical", |
|
|
|
orient: "horizontal", |
|
|
|
right: 'right' |
|
|
|
right: '0' |
|
|
|
}, |
|
|
|
}, |
|
|
|
grid: { |
|
|
|
grid: { |
|
|
|
containLabel: true, |
|
|
|
containLabel: true, |
|
|
|
@ -350,7 +328,7 @@ export default { |
|
|
|
color: '#000', |
|
|
|
color: '#000', |
|
|
|
fontSize: 14 |
|
|
|
fontSize: 14 |
|
|
|
}, |
|
|
|
}, |
|
|
|
max: parseInt(item.maxList[0]) + 10, |
|
|
|
// max: globalMax + 10, |
|
|
|
axisTick: { |
|
|
|
axisTick: { |
|
|
|
show: false |
|
|
|
show: false |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -414,14 +392,21 @@ export default { |
|
|
|
submit(){ |
|
|
|
submit(){ |
|
|
|
const submitParams = this.lineData.map(item =>{ |
|
|
|
const submitParams = this.lineData.map(item =>{ |
|
|
|
item.workCenterId = item.wcId |
|
|
|
item.workCenterId = item.wcId |
|
|
|
const {wcId,...submitData} = item |
|
|
|
const {...submitData} = item |
|
|
|
return submitData |
|
|
|
return submitData |
|
|
|
}) |
|
|
|
}) |
|
|
|
console.log('submitParams---------',submitParams) |
|
|
|
console.log('submitParams---------',submitParams) |
|
|
|
generateLine(submitParams).then(res =>{ |
|
|
|
let params = { |
|
|
|
|
|
|
|
wcId:this.lineForm.wcId, |
|
|
|
|
|
|
|
createTimeStart:this.lineForm.timeRange && this.lineForm.timeRange.length != 0 && this.lineForm.timeRange[0], |
|
|
|
|
|
|
|
createTimeEnd:this.lineForm.timeRange && this.lineForm.timeRange.length != 0 && this.lineForm.timeRange[1], |
|
|
|
|
|
|
|
copys:submitParams |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
generateLine(params).then(res =>{ |
|
|
|
if(res.data.code == 200){ |
|
|
|
if(res.data.code == 200){ |
|
|
|
this.$message.success('生成曲线成功') |
|
|
|
this.$message.success('生成曲线成功') |
|
|
|
this.lineBox = false |
|
|
|
this.lineBox = false |
|
|
|
|
|
|
|
this.lineData = [] |
|
|
|
this.onLoad() |
|
|
|
this.onLoad() |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
@ -498,51 +483,62 @@ export default { |
|
|
|
done(); |
|
|
|
done(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleView(row) { |
|
|
|
handleView(row) { |
|
|
|
this.detailForm = { |
|
|
|
getLineDetail({ |
|
|
|
workCenterName:'作业中心B', |
|
|
|
id:row.id |
|
|
|
lineTime:'2025-12-01~2025-12-19', |
|
|
|
}).then(res =>{ |
|
|
|
createTime:"111", |
|
|
|
console.log('res-----------',res) |
|
|
|
createUser:"2025-12-19" |
|
|
|
this.detailForm = res.data.data |
|
|
|
} |
|
|
|
this.lineData = res.data.data.taskCopys |
|
|
|
this.lineData = [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
workCenterId:"001", |
|
|
|
|
|
|
|
workCenterName:"作业中心A", |
|
|
|
|
|
|
|
workTankId:"002", |
|
|
|
|
|
|
|
workTankName:"作业槽A", |
|
|
|
|
|
|
|
testElement:"分析项目A", |
|
|
|
|
|
|
|
date:['2025-12-05','2025-12-06','2025-12-07','2025-12-08','2025-12-09','2025-12-10',], |
|
|
|
|
|
|
|
max:['10','10','10','10','10','10',],//如果上限下限不能返回数组,可范围数字10,前端进行处理 |
|
|
|
|
|
|
|
min: ['5','5','5','5','5','5',], |
|
|
|
|
|
|
|
targrt:['6','3','2','1','10','15',] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
workCenterId:"001", |
|
|
|
|
|
|
|
workCenterName:"作业中心A", |
|
|
|
|
|
|
|
workTankId:"002", |
|
|
|
|
|
|
|
workTankName:"作业槽A", |
|
|
|
|
|
|
|
testElement:"分析项目B", |
|
|
|
|
|
|
|
date:['2025-12-05','2025-12-06','2025-12-07','2025-12-08','2025-12-09','2025-12-10',], |
|
|
|
|
|
|
|
max:['10','10','10','10','10','10',],//如果上限下限不能返回数组,可范围数字10,前端进行处理 |
|
|
|
|
|
|
|
min: ['5','5','5','5','5','5',], |
|
|
|
|
|
|
|
targrt:['6','3','2','1','10','15',] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
workCenterId:"001", |
|
|
|
|
|
|
|
workCenterName:"作业中心A", |
|
|
|
|
|
|
|
workTankId:"003", |
|
|
|
|
|
|
|
workTankName:"作业槽B", |
|
|
|
|
|
|
|
testElement:"分析项目C", |
|
|
|
|
|
|
|
date:['2025-12-05','2025-12-06','2025-12-07','2025-12-08','2025-12-09','2025-12-10',], |
|
|
|
|
|
|
|
max:['10','10','10','10','10','10',],//如果上限下限不能返回数组,可范围数字10,前端进行处理 |
|
|
|
|
|
|
|
min: ['5','5','5','5','5','5',], |
|
|
|
|
|
|
|
targrt:['6','3','2','1','10','15',] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
this.detailBox = true |
|
|
|
this.detailBox = true |
|
|
|
this.$nextTick(() =>{ |
|
|
|
this.$nextTick(() =>{ |
|
|
|
this.createChart() |
|
|
|
this.createChart() |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
// this.detailForm = { |
|
|
|
|
|
|
|
// workCenterName:'作业中心B', |
|
|
|
|
|
|
|
// lineTime:'2025-12-01~2025-12-19', |
|
|
|
|
|
|
|
// createTime:"111", |
|
|
|
|
|
|
|
// createUser:"2025-12-19" |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// this.lineData = [ |
|
|
|
|
|
|
|
// { |
|
|
|
|
|
|
|
// workCenterId:"001", |
|
|
|
|
|
|
|
// workCenterName:"作业中心A", |
|
|
|
|
|
|
|
// workTankId:"002", |
|
|
|
|
|
|
|
// workTankName:"作业槽A", |
|
|
|
|
|
|
|
// testElement:"分析项目A", |
|
|
|
|
|
|
|
// date:['2025-12-05','2025-12-06','2025-12-07','2025-12-08','2025-12-09','2025-12-10',], |
|
|
|
|
|
|
|
// max:['10','10','10','10','10','10',],//如果上限下限不能返回数组,可范围数字10,前端进行处理 |
|
|
|
|
|
|
|
// min: ['5','5','5','5','5','5',], |
|
|
|
|
|
|
|
// targrt:['6','3','2','1','10','15',] |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
// { |
|
|
|
|
|
|
|
// workCenterId:"001", |
|
|
|
|
|
|
|
// workCenterName:"作业中心A", |
|
|
|
|
|
|
|
// workTankId:"002", |
|
|
|
|
|
|
|
// workTankName:"作业槽A", |
|
|
|
|
|
|
|
// testElement:"分析项目B", |
|
|
|
|
|
|
|
// date:['2025-12-05','2025-12-06','2025-12-07','2025-12-08','2025-12-09','2025-12-10',], |
|
|
|
|
|
|
|
// max:['10','10','10','10','10','10',],//如果上限下限不能返回数组,可范围数字10,前端进行处理 |
|
|
|
|
|
|
|
// min: ['5','5','5','5','5','5',], |
|
|
|
|
|
|
|
// targrt:['6','3','2','1','10','15',] |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
// { |
|
|
|
|
|
|
|
// workCenterId:"001", |
|
|
|
|
|
|
|
// workCenterName:"作业中心A", |
|
|
|
|
|
|
|
// workTankId:"003", |
|
|
|
|
|
|
|
// workTankName:"作业槽B", |
|
|
|
|
|
|
|
// testElement:"分析项目C", |
|
|
|
|
|
|
|
// date:['2025-12-05','2025-12-06','2025-12-07','2025-12-08','2025-12-09','2025-12-10',], |
|
|
|
|
|
|
|
// max:['10','10','10','10','10','10',],//如果上限下限不能返回数组,可范围数字10,前端进行处理 |
|
|
|
|
|
|
|
// min: ['5','5','5','5','5','5',], |
|
|
|
|
|
|
|
// targrt:['6','3','2','1','10','15',] |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// ] |
|
|
|
|
|
|
|
// this.detailBox = true |
|
|
|
|
|
|
|
// this.$nextTick(() =>{ |
|
|
|
|
|
|
|
// this.createChart() |
|
|
|
|
|
|
|
// }) |
|
|
|
// console.log('row-------------------', row) |
|
|
|
// console.log('row-------------------', row) |
|
|
|
// this.detailForm = row |
|
|
|
// this.detailForm = row |
|
|
|
// let data = row.lineTime.split(' ~ ') |
|
|
|
// let data = row.lineTime.split(' ~ ') |
|
|
|
@ -759,8 +755,8 @@ export default { |
|
|
|
current:this.page.currentPage, |
|
|
|
current:this.page.currentPage, |
|
|
|
size:this.page.pageSize, |
|
|
|
size:this.page.pageSize, |
|
|
|
name:this.query.name, |
|
|
|
name:this.query.name, |
|
|
|
createTimeStart:this.query.createTime && this.query.createTime.length != 0 ? this.query.createTime[0] : '', |
|
|
|
createTimeStart:this.query.createTime && this.query.createTime.length != 0 && this.query.createTime[0], |
|
|
|
createTimeEnd:this.query.createTime && this.query.createTime.length != 0 ? this.query.createTime[1] : '', |
|
|
|
createTimeEnd:this.query.createTime && this.query.createTime.length != 0 && this.query.createTime[1], |
|
|
|
}).then(res =>{ |
|
|
|
}).then(res =>{ |
|
|
|
this.data = res.data.data.records |
|
|
|
this.data = res.data.data.records |
|
|
|
this.page.total = res.data.data.total |
|
|
|
this.page.total = res.data.data.total |
|
|
|
|