|
|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div :style="{ height: height, width: width }" />
|
|
|
|
|
<!-- <div :style="{ height: height, width: width }" />-->
|
|
|
|
|
<dv-scroll-board :config="config" style="width:900px;height:240px" />
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
@ -7,6 +8,7 @@ import * as echarts from 'echarts';
|
|
|
|
|
import { defineComponent } from 'vue';
|
|
|
|
|
import resize from './dashboard/mixins/resize';
|
|
|
|
|
import {option} from './options/mid_bot_options';
|
|
|
|
|
import { getOutputLog } from '~/src/service/api/produre/workRecords/index';
|
|
|
|
|
export default defineComponent({
|
|
|
|
|
mixins: [resize],
|
|
|
|
|
props: {
|
|
|
|
|
@ -32,6 +34,17 @@ export default defineComponent({
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
config: {
|
|
|
|
|
header: ['工单类型', '机台', '订单编号', '报工数量','报工时间','报工人'],
|
|
|
|
|
headerBGC: 'transparent',
|
|
|
|
|
oddRowBGC: '#011B42',
|
|
|
|
|
evenRowBGC: '#020D29',
|
|
|
|
|
data: [
|
|
|
|
|
],
|
|
|
|
|
index: true,
|
|
|
|
|
columnWidth: [80],
|
|
|
|
|
align: ['center']
|
|
|
|
|
},
|
|
|
|
|
// myChart: null,
|
|
|
|
|
loading: true,
|
|
|
|
|
dataForCount: [],
|
|
|
|
|
@ -41,24 +54,25 @@ export default defineComponent({
|
|
|
|
|
},
|
|
|
|
|
async mounted() {
|
|
|
|
|
// await this.getTypeData()
|
|
|
|
|
this.chartOptions =JSON.parse(JSON.stringify(option))
|
|
|
|
|
// this.chartOptions =JSON.parse(JSON.stringify(option))
|
|
|
|
|
// this.initChart()
|
|
|
|
|
this.getTypeData()
|
|
|
|
|
|
|
|
|
|
setInterval(() => {
|
|
|
|
|
this.getTypeData()
|
|
|
|
|
}, 500000)
|
|
|
|
|
},
|
|
|
|
|
watch : {
|
|
|
|
|
productionData : {
|
|
|
|
|
handler (newValue) {
|
|
|
|
|
console.log('this.chartOptions ==>',this.chartOptions);
|
|
|
|
|
let series1Data = newValue.wiredrawingNumWeek.map(item => item.putNum);
|
|
|
|
|
let series2Data = newValue.wiredrawingNumWeek.map(item => item.outNum);
|
|
|
|
|
let xAxisData = newValue.wiredrawingNumWeek.map(item => item.date);
|
|
|
|
|
this.chartOptions.xAxis.data = xAxisData;
|
|
|
|
|
this.chartOptions.series[0].data = series1Data;
|
|
|
|
|
this.chartOptions.series[1].data = series2Data;
|
|
|
|
|
this.initChart();
|
|
|
|
|
},
|
|
|
|
|
deep : true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// watch : {
|
|
|
|
|
// productionData : {
|
|
|
|
|
// handler (newValue) {
|
|
|
|
|
// this.config.data = newValue.outputLogs && newValue.outputLogs.length && newValue.outputLogs.map(item => {
|
|
|
|
|
// return [item.taskType == '0'?'金属':'板材', item.workstationName, item.orderSn, item.outputWeight, item.createTime, item.createBy]
|
|
|
|
|
// }) || []
|
|
|
|
|
// // this.initChart();
|
|
|
|
|
// },
|
|
|
|
|
// deep : true
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
beforeUnmount() {
|
|
|
|
|
// if (!this.myChart) {
|
|
|
|
|
// return;
|
|
|
|
|
@ -67,14 +81,30 @@ export default defineComponent({
|
|
|
|
|
// this.myChart = null;
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
initChart() {
|
|
|
|
|
let myChart = echarts.init(this.$el);
|
|
|
|
|
myChart.setOption(this.chartOptions);
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
myChart.resize()
|
|
|
|
|
this.$emit('endLoading', 11)
|
|
|
|
|
|
|
|
|
|
async getTypeData () {
|
|
|
|
|
let res = await getOutputLog({
|
|
|
|
|
pageNum : 1,
|
|
|
|
|
pageSize : 10
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.config.data = res && res.rows && res.rows.length && res.rows.map(item => {
|
|
|
|
|
return [item.taskType == '0'?'金属':'板材', item.workstationName, item.orderSn, item.outputWeight, item.createTime, item.createBy]
|
|
|
|
|
}) || []
|
|
|
|
|
},
|
|
|
|
|
// initChart() {
|
|
|
|
|
// let myChart = echarts.init(this.$el);
|
|
|
|
|
// myChart.setOption(this.chartOptions);
|
|
|
|
|
// this.$nextTick(() => {
|
|
|
|
|
// myChart.resize()
|
|
|
|
|
// this.$emit('endLoading', 11)
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.dv-scroll-board .header{
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|