|
|
@@ -2,7 +2,7 @@ |
|
|
|
<div class="app-container"> |
|
|
|
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> |
|
|
|
<base-table v-loading="dataListLoading" :span-method="mergeColumnHandler" :table-props="tableProps" :table-data="tableData" /> |
|
|
|
<line-chart ref="lineChart" /> |
|
|
|
<balance-chart ref="lineChart" /> |
|
|
|
<!-- <pagination |
|
|
|
:limit.sync="listQuery.pageSize" |
|
|
|
:page.sync="listQuery.pageNo" |
|
|
@@ -16,7 +16,7 @@ |
|
|
|
import { parseTime } from '../../mixins/code-filter'; |
|
|
|
import { getCT } from '@/api/core/analysis/index'; |
|
|
|
import { getProductionLinePage } from '@/api/core/base/productionLine'; |
|
|
|
import lineChart from '../LineChart' |
|
|
|
import BalanceChart from '../balanceChart' |
|
|
|
import { time } from 'echarts'; |
|
|
|
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection'; |
|
|
|
|
|
|
@@ -43,7 +43,7 @@ import { time } from 'echarts'; |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
lineChart, |
|
|
|
BalanceChart |
|
|
|
}, |
|
|
|
// mixins: [basicPage], |
|
|
|
data() { |
|
|
@@ -103,8 +103,8 @@ export default { |
|
|
|
getArr() { |
|
|
|
const params = { |
|
|
|
page: 1, |
|
|
|
limit: 500, |
|
|
|
}; |
|
|
|
limit: 500 |
|
|
|
} |
|
|
|
this.optionArrUrl.forEach((item, index) => { |
|
|
|
item(params).then((response) => { |
|
|
|
this.formConfig[index].selectOptions = response.data.list |
|
|
@@ -126,7 +126,6 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log('打印数组长度', this.spanArr) |
|
|
|
}, |
|
|
|
/** 合并table列的规则 */ |
|
|
|
mergeColumnHandler({ row, column, rowIndex, columnIndex }) { |
|
|
@@ -145,6 +144,11 @@ export default { |
|
|
|
// this.listQuery.lineId = '1672847052717821953' |
|
|
|
// this.listQuery.startTime = '1693497600000'; |
|
|
|
// this.listQuery.endTime = '1693843200000'; |
|
|
|
this.tableData.splice(0) |
|
|
|
this.xData.splice(0) |
|
|
|
this.yData.splice(0) |
|
|
|
this.tableProps.splice(0) |
|
|
|
this.spanArr.splice(0) |
|
|
|
this.urlOptions.getDataListURL(this.listQuery).then(res => { |
|
|
|
console.log(res) |
|
|
|
let arr = [ |
|
|
@@ -162,23 +166,33 @@ export default { |
|
|
|
let sectionArr= [] |
|
|
|
res.data.data.forEach((ele, index) => { |
|
|
|
let tempData = [] |
|
|
|
ele.data.forEach(item => { |
|
|
|
let eqData = [] |
|
|
|
let plData = [] |
|
|
|
ele.data.forEach((item, index) => { |
|
|
|
item.children.forEach(params => { |
|
|
|
if (params.dynamicName === '设备CT') { |
|
|
|
tempData[item.dynamicName + '_eq'] = params.dynamicValue |
|
|
|
eqData[index] = params.dynamicValue |
|
|
|
} else { |
|
|
|
tempData[item.dynamicName + '_pl'] = params.dynamicValue |
|
|
|
plData[index] = params.dynamicValue |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
const equipment = { |
|
|
|
name: ele.equName, |
|
|
|
eqData: eqData, |
|
|
|
plData: plData |
|
|
|
} |
|
|
|
tempData['equName'] = ele.equName |
|
|
|
tempData['sectionName'] = ele.sectionName |
|
|
|
this.tableData.push(tempData) |
|
|
|
const { sectionName } = tempData |
|
|
|
sectionArr.push(sectionName) |
|
|
|
this.yData.push(equipment) |
|
|
|
console.log('看看equ', this.yData) |
|
|
|
}) |
|
|
|
this.setRowSpan(sectionArr) |
|
|
|
console.log('工段名称列表', sectionArr) |
|
|
|
res.data.nameData.forEach(item => { |
|
|
|
this.timeList.push(item.name) |
|
|
|
}) |
|
|
@@ -194,24 +208,13 @@ export default { |
|
|
|
] |
|
|
|
} |
|
|
|
arr.push(subprop) |
|
|
|
this.xData.push(times) |
|
|
|
} |
|
|
|
} |
|
|
|
this.tableProps = arr |
|
|
|
|
|
|
|
let xData = [] |
|
|
|
res.data.nameData.forEach(item => { |
|
|
|
xData.push(item.name) |
|
|
|
// arr[2].children.push(props) |
|
|
|
}) |
|
|
|
let yData = [] |
|
|
|
res.data.data[0].data[0].children.forEach((item, index) => { |
|
|
|
// console.log(item) |
|
|
|
yData.push(item.dynamicValue) |
|
|
|
// let data = 'data' + Number(index+1) |
|
|
|
// obj['' + item.dynamicName + ''] = item.dynamicValue |
|
|
|
}) |
|
|
|
console.log(this.yData) |
|
|
|
this.$refs.lineChart.initChart(xData, yData) |
|
|
|
console.log('表格横坐标', this.xData) |
|
|
|
this.$refs.lineChart.initChart(this.xData, this.yData) |
|
|
|
// this.total = response.data.total; |
|
|
|
// this.dataListLoading = false; |
|
|
|
}); |
|
|
|