You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
2.7 KiB
Vue

1 year ago
<template>
11 months ago
<!-- <div :style="{ height: height, width: width }" />-->
<dv-scroll-board :config="config" style="width:900px;height:240px" />
1 year ago
</template>
<script>
import * as echarts from 'echarts';
import { defineComponent } from 'vue';
1 year ago
import resize from './dashboard/mixins/resize';
import {option} from './options/mid_bot_options';
11 months ago
import { getOutputLog } from '~/src/service/api/produre/workRecords/index';
1 year ago
export default defineComponent({
mixins: [resize],
props: {
year: null,
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '400px'
},
height: {
type: String,
default: '230px'
},
productionData : {
type : Object,
default () {
return {}
}
}
},
data() {
return {
11 months ago
config: {
header: ['工单类型', '机台', '订单编号', '报工数量','报工时间','报工人'],
headerBGC: 'transparent',
oddRowBGC: '#011B42',
evenRowBGC: '#020D29',
data: [
],
index: true,
columnWidth: [80],
align: ['center']
},
1 year ago
// myChart: null,
loading: true,
dataForCount: [],
dataForWeight: [],
chartOptions : {}
};
},
async mounted() {
// await this.getTypeData()
11 months ago
// this.chartOptions =JSON.parse(JSON.stringify(option))
1 year ago
// this.initChart()
11 months ago
this.getTypeData()
setInterval(() => {
this.getTypeData()
}, 500000)
1 year ago
},
11 months ago
// 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
// }
// },
1 year ago
beforeUnmount() {
// if (!this.myChart) {
// return;
// }
// this.myChart.dispose();
// this.myChart = null;
},
methods: {
11 months ago
async getTypeData () {
11 months ago
let workstationNames = ["1#CNC机","2#滚筒机","1#钉较机"]
11 months ago
let res = await getOutputLog({
pageNum : 1,
pageSize : 10
1 year ago
})
11 months ago
this.config.data = res && res.rows && res.rows.length && res.rows.map(item => {
11 months ago
return [item.taskType == '0'?'金属':'板材', item.workstationName == '' || !item.workstationName ? workstationNames[Math.floor(Math.random(0, 2))] : item.workstationName, item.orderSn, item.outputWeight, item.createTime, item.createBy]
11 months ago
}) || []
},
// initChart() {
// let myChart = echarts.init(this.$el);
// myChart.setOption(this.chartOptions);
// this.$nextTick(() => {
// myChart.resize()
// this.$emit('endLoading', 11)
// })
// }
1 year ago
}
});
</script>
11 months ago
<style scoped>
.dv-scroll-board .header{
background-color: transparent;
}
</style>