|
|
|
@ -1,8 +1,8 @@
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<div id="big-data-container" class="big-data-container">
|
|
|
|
|
<div id="big-data-container" class="big-data-container" ref="appRef">
|
|
|
|
|
<dv-loading v-if="loading">Loading...</dv-loading>
|
|
|
|
|
<dv-full-screen-container v-else>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<div class="header">
|
|
|
|
|
<div class="header-item">
|
|
|
|
|
<h3 class="version">CHANKO V1.0.0</h3>
|
|
|
|
@ -27,7 +27,7 @@
|
|
|
|
|
<div class="oee">
|
|
|
|
|
<div class="chart" v-for="(machine, index) in machineList" :key="index">
|
|
|
|
|
<!-- {{machine.name + "--" + machine.oee}} -->
|
|
|
|
|
<Gauge :option="machineOption(machine,index)" ref="vgauge"></Gauge>
|
|
|
|
|
<Gauge :option="machineOption(machine, index)" ref="vgauge"></Gauge>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="machine">
|
|
|
|
@ -165,11 +165,11 @@
|
|
|
|
|
</div>
|
|
|
|
|
</dv-border-box-13>
|
|
|
|
|
</div>
|
|
|
|
|
</dv-full-screen-container>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import easyFlowMixin from '../../../mixin'
|
|
|
|
|
import Gauge from "@/components/echarts/Gauge.vue";
|
|
|
|
|
import Bar from "@/components/echarts/Bar.vue";
|
|
|
|
|
import Line from "@/components/echarts/Line.vue";
|
|
|
|
@ -183,6 +183,7 @@ export default {
|
|
|
|
|
Line,
|
|
|
|
|
Number
|
|
|
|
|
},
|
|
|
|
|
mixins: [easyFlowMixin],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
loading: true,
|
|
|
|
@ -236,29 +237,29 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
console.log(this.$refs.vline); // !! undefine 问题解决不了
|
|
|
|
|
console.log("数据加载中...");
|
|
|
|
|
// console.log(this.$refs.vline); // !! undefine 问题解决不了
|
|
|
|
|
// console.log("数据加载中...");
|
|
|
|
|
this.onLoading();
|
|
|
|
|
this.datetime = this.base.getDate(true);
|
|
|
|
|
setInterval(() => {
|
|
|
|
|
this.datetime = this.base.getDate(true);
|
|
|
|
|
});
|
|
|
|
|
window.addEventListener('beforeunload', this.clearTimer); // 监听页面刷新或关闭
|
|
|
|
|
// this.datetime = this.base.getDate(true);
|
|
|
|
|
// setInterval(() => {
|
|
|
|
|
// this.datetime = this.base.getDate(true);
|
|
|
|
|
// });
|
|
|
|
|
// window.addEventListener('beforeunload', this.clearTimer); // 监听页面刷新或关闭
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
onLoading() {
|
|
|
|
|
this.getMachineData();
|
|
|
|
|
this.getWeekProcessData();
|
|
|
|
|
this.getWeekWorkData();
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
}, 3000);
|
|
|
|
|
// 10分钟定时发送请求数据
|
|
|
|
|
this.timer = setInterval(() => {
|
|
|
|
|
this.getMachineData(true);
|
|
|
|
|
this.getWeekProcessData(true);
|
|
|
|
|
this.getWeekWorkData(true);
|
|
|
|
|
}, 10000);
|
|
|
|
|
// this.getMachineData();
|
|
|
|
|
// this.getWeekProcessData();
|
|
|
|
|
// this.getWeekWorkData();
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
// }, 3000);
|
|
|
|
|
// // 10分钟定时发送请求数据
|
|
|
|
|
// this.timer = setInterval(() => {
|
|
|
|
|
// this.getMachineData(true);
|
|
|
|
|
// this.getWeekProcessData(true);
|
|
|
|
|
// this.getWeekWorkData(true);
|
|
|
|
|
// }, 10000);
|
|
|
|
|
},
|
|
|
|
|
changeDevice(value) {
|
|
|
|
|
this.gdfrom.configId = value;
|
|
|
|
@ -297,8 +298,8 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
this.machineList = machineList;
|
|
|
|
|
// console.log(this.machineList);
|
|
|
|
|
if(rerender) {
|
|
|
|
|
for(let index in this.machineList) {
|
|
|
|
|
if (rerender) {
|
|
|
|
|
for (let index in this.machineList) {
|
|
|
|
|
let machineOption = this.machineOption(this.machineList[index]);
|
|
|
|
|
this.$refs.vgauge[index].initGauge(machineOption);
|
|
|
|
|
}
|
|
|
|
|