diff --git a/src/views/common/board-part-table.vue b/src/views/common/board-part-table.vue index c1477c9..c09e621 100644 --- a/src/views/common/board-part-table.vue +++ b/src/views/common/board-part-table.vue @@ -2,7 +2,7 @@ * @Author: zwq * @Date: 2022-03-07 15:31:13 * @LastEditors: zwq - * @LastEditTime: 2022-07-01 16:58:50 + * @LastEditTime: 2022-07-05 16:11:42 * @Description: --> @@ -15,12 +15,11 @@ style="width: 100%" > - - - + + + - diff --git a/src/views/common/board-part.vue b/src/views/common/board-part.vue index f945c19..81a3d7d 100644 --- a/src/views/common/board-part.vue +++ b/src/views/common/board-part.vue @@ -2,7 +2,7 @@ * @Author: zwq * @Date: 2022-03-07 15:31:13 * @LastEditors: zwq - * @LastEditTime: 2022-07-01 16:58:00 + * @LastEditTime: 2022-07-05 16:18:48 * @Description: --> @@ -25,13 +25,13 @@ - 1293803 + {{wbData.taskCode}} 加工单编号 - 129 + {{wbData.plcValue}} 工艺号 @@ -39,11 +39,11 @@ - {{ hour }}:{{ minute }}:{{ second }} + {{ wbData.remainingTime}} 剩余时间 @@ -53,7 +53,7 @@ 标识信息卡 - + @@ -63,17 +63,9 @@ import partTable from './board-part-table.vue' export default { components: {partTable}, props: { - tableData: { - type: Array, - default: () => [] - }, - countdown: { + wbData: { type: Object, - default: () => ({ - 'hours': 1, - 'minutes': 10, - 'seconds': 0 - }) + default: () => {} }, imgUrl: { type: String, @@ -82,91 +74,21 @@ export default { }, data () { return { - hours: 1, - minutes: 12, - seconds: 0 } }, created () { - this.hours = this.countdown.hours - this.minutes = this.countdown.minutes - this.seconds = this.countdown.seconds }, mounted () { - this.add() - }, - watch: { - // 监听数值变化 - second: { - handler (newVal) { - this.num(newVal) - } - }, - minute: { - handler (newVal) { - this.num(newVal) - } - }, - hour: { - handler (newVal) { - this.num(newVal) - } - } - }, - computed: { - // 初始化数据 - second () { - return this.num(this.seconds) - }, - minute () { - return this.num(this.minutes) - }, - hour () { - return this.num(this.hours) - } }, methods: { - num (n) { - return n < 10 ? '0' + n : '' + n - }, - // 倒计时函数 - add () { - let time = window.setInterval(() => { - if (this.hours !== 0 && this.minutes === 0 && this.seconds === 0) { - this.hours -= 1 - this.minutes = 59 - this.seconds = 59 - } else if ( - this.hours === 0 && - this.minutes !== 0 && - this.seconds === 0 - ) { - this.minutes -= 1 - this.seconds = 59 - } else if ( - this.hours === 0 && - this.minutes === 0 && - this.seconds === 0 - ) { - this.seconds = 0 - window.clearInterval(time) - } else if ( - this.hours !== 0 && - this.minutes !== 0 && - this.seconds === 0 - ) { - this.minutes -= 1 - this.seconds = 59 - } else { - this.seconds -= 1 - } - }, 1000) - } } } diff --git a/src/views/main.vue b/src/views/main.vue index b47bcf7..52545b7 100644 --- a/src/views/main.vue +++ b/src/views/main.vue @@ -2,7 +2,7 @@ * @Author: zwq * @Date: 2021-11-15 08:20:28 * @LastEditors: zwq - * @LastEditTime: 2022-03-18 14:48:46 + * @LastEditTime: 2022-07-05 15:46:53 * @Description: --> @@ -98,7 +98,7 @@ // }) }, initWebSocket () { // 初始化weosocket - const path = `ws:${this.url}/qj/websocket/${'id'}` + const path = `ws:${this.url}/qj/websocket/1` this.websock = new WebSocket(path) this.websock.onmessage = this.websocketonmessage this.websock.onopen = this.websocketonopen diff --git a/static/img/lu/BMD .png b/static/img/lu/BMD1.png similarity index 100% rename from static/img/lu/BMD .png rename to static/img/lu/BMD1.png