设备管理
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<div v-if="tableData.length">
|
||||
<base-table v-loading="dataListLoading" :span-method="mergeColumnHandler" :table-props="tableProps" :table-data="tableData" />
|
||||
<SearchBar :formConfigs="[{ label: '产线平衡分析图', type: 'title' }]" />
|
||||
<balance-chart ref="lineChart" />
|
||||
<BalanceChart ref="lineChart" />
|
||||
</div>
|
||||
<div v-else class="no-data-bg"></div>
|
||||
<!-- <pagination
|
||||
@@ -19,7 +19,7 @@
|
||||
// import basicPage from '../../mixins/basic-page';
|
||||
import { parseTime } from '../../mixins/code-filter';
|
||||
import { getCT } from '@/api/core/analysis/index';
|
||||
import { getProductionLinePage } from '@/api/core/base/productionLine';
|
||||
import { getCorePLList } from '@/api/base/coreProductionLine';
|
||||
import BalanceChart from '../balanceChart'
|
||||
import { time } from 'echarts';
|
||||
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
|
||||
@@ -68,7 +68,7 @@ export default {
|
||||
spanArr: [],
|
||||
xData: [],
|
||||
yData: [],
|
||||
optionArrUrl: [getProductionLinePage],
|
||||
optionArrUrl: [getCorePLList],
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
@@ -111,7 +111,7 @@ export default {
|
||||
}
|
||||
this.optionArrUrl.forEach((item, index) => {
|
||||
item(params).then((response) => {
|
||||
this.formConfig[index].selectOptions = response.data.list
|
||||
this.formConfig[index].selectOptions = response.data
|
||||
});
|
||||
});
|
||||
},
|
||||
@@ -212,8 +212,10 @@ export default {
|
||||
}
|
||||
this.tableProps = arr
|
||||
|
||||
console.log('表格横坐标', this.xData)
|
||||
this.$refs.lineChart.initChart(this.xData, this.yData)
|
||||
console.log('表格横坐标', this.xData, this.yData)
|
||||
this.$nextTick(() => {
|
||||
this.$refs.lineChart.initChart(this.xData, this.yData)
|
||||
})
|
||||
// this.total = response.data.total;
|
||||
// this.dataListLoading = false;
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-09-13 09:02:25
|
||||
* @LastEditTime: 2023-10-08 16:36:37
|
||||
* @LastEditTime: 2023-11-10 10:48:09
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
@@ -10,7 +10,7 @@
|
||||
<div style="margin: 20px">
|
||||
<el-button v-for="(item, index) in buttonList" :key="index" :class="[item.actived ? 'activeButton': 'normalButton']" @click="changeChart(index)">{{ item.name }}</el-button>
|
||||
</div>
|
||||
<div ref="chartDiv" :class="className" :style="{height:height,width:width}" />
|
||||
<div id="chart" ref="chartDiv" :class="className" :style="{height:height,width:width}" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -48,6 +48,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// this.initChart()
|
||||
},
|
||||
methods: {
|
||||
changeChart(index) {
|
||||
@@ -81,7 +82,8 @@ export default {
|
||||
console.log('看一下数据', this.dataArray)
|
||||
this.xDatas = xData
|
||||
this.chart = echarts.init(this.$refs.chartDiv, 'macarons')
|
||||
this.setOptions(xData, yData[0], lineName)
|
||||
// this.chart = echarts.init(document.getElementById('chart'), 'macarons')
|
||||
// this.setOptions(xData, yData[0], lineName)
|
||||
},
|
||||
setOptions(xData, dataList, lineName) {
|
||||
// let seriesData = []
|
||||
|
||||
@@ -21,6 +21,7 @@ import { parseTime } from '../../mixins/code-filter';
|
||||
import { getYieldAnalysisPageData } from '@/api/core/analysis/index';
|
||||
// import { getProductionLinePage } from '@/api/core/base/productionLine';
|
||||
import lineChart from '../LineChart'
|
||||
import moment from 'moment';
|
||||
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
|
||||
|
||||
// const tableProps = [
|
||||
@@ -62,6 +63,9 @@ export default {
|
||||
recordTime: []
|
||||
},
|
||||
dateLabelList: [],
|
||||
tempTtime: '',
|
||||
day: 0,
|
||||
xData: [],
|
||||
formConfig: [
|
||||
// {
|
||||
// type: 'select',
|
||||
@@ -109,111 +113,77 @@ export default {
|
||||
// });
|
||||
// });
|
||||
// },
|
||||
getData() {
|
||||
// this.listQuery.lineIds = ['1672847052717821953']
|
||||
// this.listQuery.productId = val.productId;
|
||||
// this.listQuery.time = '1694486098000';
|
||||
this.urlOptions.getDataListURL(this.listQuery).then(res => {
|
||||
let arr = [
|
||||
{
|
||||
prop: 'lineName',
|
||||
label: '产线',
|
||||
fixed: 'left'
|
||||
},
|
||||
{
|
||||
prop: 'sum',
|
||||
label: '合计',
|
||||
fixed: 'left'
|
||||
},
|
||||
{
|
||||
prop: res.data ? res.data.nameData[0].name : undefined,
|
||||
label: res.data ? res.data.nameData[0].name : undefined,
|
||||
align: 'center',
|
||||
children:[
|
||||
|
||||
]
|
||||
}
|
||||
]
|
||||
// console.log(res.data.nameData.slice(1))
|
||||
let xData = []
|
||||
let yAllData = []
|
||||
let lineName = []
|
||||
if (res.data) {
|
||||
let tempDateList = []
|
||||
res.data.nameData.forEach(date => {
|
||||
tempDateList.push(date.name)
|
||||
})
|
||||
this.dateLabelList = Array.from(new Set(tempDateList))
|
||||
|
||||
this.dateLabelList.forEach(item => {
|
||||
if (item.indexOf('年') === -1) {
|
||||
// 构造表头
|
||||
const props = {
|
||||
'prop': item,
|
||||
'label': item
|
||||
}
|
||||
arr[2].children.push(props)
|
||||
|
||||
// 构造echarts横坐标
|
||||
xData.push(item)
|
||||
}
|
||||
})
|
||||
// res.data.nameData.slice(1).forEach(item => {
|
||||
// const props = {
|
||||
// 'prop': item.name,
|
||||
// 'label': item.name,
|
||||
// 'align': 'center'
|
||||
// }
|
||||
// arr[2].children.push(props)
|
||||
// })
|
||||
let tableDataArr =[]
|
||||
res.data.data.forEach(item => {
|
||||
let obj = {}
|
||||
obj.lineName= item.lineName,
|
||||
obj.sum= item.sum,
|
||||
item.data.forEach((ele, index) => {
|
||||
// console.log(ele)
|
||||
ele.children.forEach((e) => {
|
||||
console.log(e.dynamicName)
|
||||
obj['' + e.dynamicName + ''] = e.dynamicValue
|
||||
console.log(obj['' + e.dynamicName + '']);
|
||||
})
|
||||
})
|
||||
tableDataArr.push(obj)
|
||||
});
|
||||
this.tableData = tableDataArr
|
||||
this.tableProps = arr
|
||||
|
||||
// let tempList = []
|
||||
// res.data.nameData.slice(1).forEach(item => {
|
||||
// tempList.push(item.name)
|
||||
// // arr[2].children.push(props)
|
||||
// })
|
||||
// xData = Array.from(new Set(tempList))
|
||||
|
||||
res.data.data.forEach(item => {
|
||||
let yData = []
|
||||
lineName.push(item.lineName)
|
||||
// let obj = {}
|
||||
// obj.lineName = item.lineName,
|
||||
// obj.sum = item.sum,
|
||||
item.data.forEach((ele, index) => {
|
||||
// console.log(ele)
|
||||
ele.children.forEach((e) => {
|
||||
// let yData = []
|
||||
yData.push(e.dynamicValue)
|
||||
})
|
||||
})
|
||||
yAllData.push(yData)
|
||||
});
|
||||
console.log(lineName)
|
||||
} else {
|
||||
this.tableProps = arr
|
||||
this.tableData = []
|
||||
xData = []
|
||||
yAllData = []
|
||||
lineName = []
|
||||
// 设置表头和横坐标
|
||||
setHeader() {
|
||||
const month = this.tempTtime.getMonth() + 1
|
||||
let arr = [
|
||||
{
|
||||
prop: 'proName',
|
||||
label: '产品名称',
|
||||
fixed: 'left'
|
||||
},
|
||||
{
|
||||
prop: 'specifications',
|
||||
label: '产品规格',
|
||||
fixed: 'left'
|
||||
},
|
||||
{
|
||||
prop: 'sum',
|
||||
label: '合计',
|
||||
fixed: 'left'
|
||||
},
|
||||
{
|
||||
label: this.tempTtime.getFullYear() + '年' + month + '月',
|
||||
align: 'center',
|
||||
children: []
|
||||
}
|
||||
]
|
||||
for (let d = 1; d <= this.day; d ++) {
|
||||
arr[3].children.push({
|
||||
prop: 'value' + d, label: month + '-' + d
|
||||
})
|
||||
// 横坐标
|
||||
this.xData.push(month + '-' + d)
|
||||
}
|
||||
this.tableProps = arr
|
||||
},
|
||||
getData() {
|
||||
this.urlOptions.getDataListURL(this.listQuery).then(res => {
|
||||
//构造数据
|
||||
if (res.data) {
|
||||
this.setHeader()
|
||||
res.data.forEach(item => {
|
||||
console.log('111', item.recordTime, moment(item.recordTime).format('DD'))
|
||||
this.tableData.push({
|
||||
proName: item.proName,
|
||||
specifications: item.specifications
|
||||
})
|
||||
})
|
||||
}
|
||||
console.log('饿', this.tableData)
|
||||
// res.data.data.forEach(item => {
|
||||
// let yData = []
|
||||
// lineName.push(item.lineName)
|
||||
// // let obj = {}
|
||||
// // obj.lineName = item.lineName,
|
||||
// // obj.sum = item.sum,
|
||||
// item.data.forEach((ele, index) => {
|
||||
// // console.log(ele)
|
||||
// ele.children.forEach((e) => {
|
||||
// // let yData = []
|
||||
// yData.push(e.dynamicValue)
|
||||
// })
|
||||
// })
|
||||
// yAllData.push(yData)
|
||||
// });
|
||||
// console.log(lineName)
|
||||
// } else {
|
||||
// this.tableProps = arr
|
||||
// this.tableData = []
|
||||
// xData = []
|
||||
// yAllData = []
|
||||
// lineName = []
|
||||
// }
|
||||
// res.data.data[0].data[0].children.forEach((item, index) => {
|
||||
// // console.log(item)
|
||||
// yData.push(item.dynamicValue)
|
||||
@@ -221,7 +191,7 @@ export default {
|
||||
// // obj['' + item.dynamicName + ''] = item.dynamicValue
|
||||
// })
|
||||
// console.log(this.yData)
|
||||
this.$refs.lineChart.initChart(xData, yAllData, lineName)
|
||||
// this.$refs.lineChart.initChart(this.xData, yAllData, lineName)
|
||||
// this.total = response.data.total;
|
||||
// this.dataListLoading = false;
|
||||
});
|
||||
@@ -231,23 +201,21 @@ export default {
|
||||
case 'search':
|
||||
// this.listQuery.recordTime = val.time ? new Date(val.time).getTime() : undefined
|
||||
if (val.time) {
|
||||
const tempTtime = new Date(val.time)
|
||||
let day = 0
|
||||
switch (tempTtime.getMonth() + 1) {
|
||||
this.tempTtime = new Date(val.time)
|
||||
switch (this.tempTtime.getMonth() + 1) {
|
||||
case 1, 3, 5, 7, 8, 10, 12:
|
||||
day = 31;
|
||||
this.day = 31;
|
||||
break;
|
||||
case 2:
|
||||
day = 28;
|
||||
this.day = 28;
|
||||
break;
|
||||
case 4, 6, 9, 11:
|
||||
day = 30;
|
||||
this.day = 30;
|
||||
break;
|
||||
}
|
||||
console.log(parseTime(new Date(tempTtime.getFullYear(), 11, 31, 23, 59, 59)))
|
||||
this.listQuery.recordTime = [
|
||||
val.time,
|
||||
parseTime(new Date(tempTtime.getFullYear(), tempTtime.getMonth(), day, 23, 59, 59))
|
||||
parseTime(new Date(this.tempTtime.getFullYear(), this.tempTtime.getMonth(), this.day, 23, 59, 59))
|
||||
]
|
||||
this.getData()
|
||||
} else {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-08-29 14:59:29
|
||||
* @LastEditTime: 2023-10-16 15:10:42
|
||||
* @LastEditTime: 2023-11-07 18:48:35
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
@@ -175,7 +175,7 @@ export default {
|
||||
label: '统计开始时间',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: "yyyy-MM-ddTHH:mm:ss",
|
||||
valueFormat: "yyyy-MM-dd HH:mm:ss",
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
<script>
|
||||
import { getPdlDataOneDay } from '@/api/core/monitoring/data24'
|
||||
import { parseTime } from '../../mixins/code-filter';
|
||||
import { Loading } from 'element-ui';
|
||||
|
||||
export default {
|
||||
name: 'productionLineData24',
|
||||
@@ -105,13 +106,13 @@ export default {
|
||||
let sectionArr= []
|
||||
console.log('打印看下数据list', list)
|
||||
list.forEach((ele, index) => {
|
||||
let tempData = []
|
||||
let tempData = {}
|
||||
tempData[ele.recordTime + '_up'] = ele.inputNum
|
||||
tempData[ele.recordTime + '_down'] = ele.outputNum
|
||||
tempData[ele.recordTime + '_up'] = ele.inputNum
|
||||
tempData['proLineName'] = ele.lineName
|
||||
tempData['workOrderName'] = ele.workOrderName
|
||||
tempData['spec'] = ele.spec
|
||||
tempData['spec'] = ele.specifications
|
||||
this.tableData.push(tempData)
|
||||
console.log('看看数据', this.tableData, tempData)
|
||||
const { proLineName } = tempData
|
||||
|
||||
Reference in New Issue
Block a user