From aa2c671bd5cac4247184e603ac5df456f2d7d386 Mon Sep 17 00:00:00 2001 From: xiangxy Date: Thu, 27 Oct 2022 19:24:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/proj/RunOperate.vue | 110 ++++++++++++++++++++-------------- src/router/index.js | 2 +- 2 files changed, 67 insertions(+), 45 deletions(-) diff --git a/src/pages/proj/RunOperate.vue b/src/pages/proj/RunOperate.vue index f6fe34c..fa33478 100644 --- a/src/pages/proj/RunOperate.vue +++ b/src/pages/proj/RunOperate.vue @@ -6,8 +6,8 @@
自动 - 系统运行 - 联机模式 + 系统运行 + 联机模式
@@ -76,45 +76,45 @@
  • - + 1 2
  • - + 1 2 3
  • - + 1
  • - - + + 1 2
  • - + 1 2
  • - + 1 2
  • - + 1 2 3 @@ -122,14 +122,14 @@
  • - + 1 2
  • - + 1 2 @@ -149,13 +149,13 @@
    • - + 1 2
    • - + 1 2
    • @@ -226,6 +226,7 @@ export default { }, data () { return { + flag: false, // 返回标识 暂时不用 opt: '', // 标识 optname: '', interTime: this.$store.getters.setTime, @@ -283,13 +284,13 @@ export default { disabled2: false } }, - // created () { - // this.refresh() - // }, - // beforeDestroy () { - // clearInterval(this.timer) - // this.timer = null - // }, + created () { + this.refresh() + }, + beforeDestroy () { + clearInterval(this.timer) + this.timer = null + }, methods: { refresh () { this._queryDeviceInfo() @@ -301,29 +302,40 @@ export default { async _queryDeviceInfo () { let res = await queryDeviceInfo() if (res.code === '1') { - this.rData = [...res.result] + this.rData = res.result this.val1 = res.result.outer_diameter this.val2 = res.result.length this.val3 = res.result.wall_thickness this.val4 = res.result.color this.val5 = res.result.jackup_num this.val6 = res.result.strap_number + this.val7 = res.result.no_pass_convey_cache_num + this.val8 = res.result.strapping_current_step } else { this.Dialog(res.desc) } }, - async putPoint (name, type, value) { + async putPoint (name, type, value, a) { this.disabled1 = true try { let res = await putPoint(name, type, value) if (res.code === '1') { this.toast('操作成功') + if (!a) { + // 点动不更新 + setTimeout(() => { + this._queryDeviceInfo() + }, 300) + this.flag = true + } } else { this.Dialog(res.desc) + this.flag = false } this.disabled1 = false } catch (err) { console.log(err) + this.flag = false this.disabled1 = false } }, @@ -338,40 +350,47 @@ export default { }, msgSure () { if (this.opt === 1) { - this.val1 = this.val this.putPoint('outer_diameter', '3', this.val) + this.val1 = this.val } if (this.opt === 2) { - this.val2 = this.val this.putPoint('length', '3', this.val) + this.val2 = this.val } if (this.opt === 3) { - this.val3 = this.val this.putPoint('wall_thickness', '3', this.val) + this.val3 = this.val } if (this.opt === 5) { - this.val5 = this.val this.putPoint('jackup_num', '3', this.val) + this.val5 = this.val } if (this.opt === 6) { - this.val6 = this.val this.putPoint('strap_number', '3', this.val) + this.val6 = this.val } if (this.opt === 7) { - this.val7 = this.val this.putPoint('no_pass_convey_cache_num', '3', this.val) + this.val7 = this.val } if (this.opt === 8) { - this.val8 = this.val this.putPoint('strapping_current_step', '3', this.val) + this.val8 = this.val } this.active = false }, msgCancle () { this.active = false }, - handleChange1 () { - this.putPoint('mode', '2', '') + async handleChange1 () { + await this.putPoint('mode', '2', '') + // if (this.flag) { + // if (this.rData.mode === '0') { + // this.rData.mode = '1' + // } else { + // this.rData.mode = '0' + // } + // } }, handleChange_m (name) { this.putPoint(name, '2', '') @@ -382,38 +401,38 @@ export default { handleTouchStart1 (event) { event.preventDefault() let _this = this - _this.putPoint('start', '1', '1') + _this.putPoint('start', '1', '1', 1) }, handleTouchEnd1 (event) { let _this = this - _this.putPoint('start', '1', '0') + _this.putPoint('start', '1', '0', 1) }, handleTouchStart2 (event) { event.preventDefault() let _this = this - _this.putPoint('stop', '1', '1') + _this.putPoint('stop', '1', '1', 1) }, handleTouchEnd2 (event) { let _this = this - _this.putPoint('stop', '1', '0') + _this.putPoint('stop', '1', '0', 1) }, handleTouchStart3 (event) { event.preventDefault() let _this = this - _this.putPoint('strapping_finish', '1', '1') + _this.putPoint('strapping_finish', '1', '1', 1) }, handleTouchEnd3 (event) { let _this = this - _this.putPoint('strapping_finish', '1', '0') + _this.putPoint('strapping_finish', '1', '0', 1) }, handleTouchStart4 (event) { event.preventDefault() let _this = this - _this.putPoint('error_clear', '1', '1') + _this.putPoint('error_clear', '1', '1', 1) }, handleTouchEnd4 (event) { let _this = this - _this.putPoint('error_clear', '1', '0') + _this.putPoint('error_clear', '1', '0', 1) }, toColor (e) { this.putPoint('color', '3', this.val4) @@ -422,6 +441,8 @@ export default { } diff --git a/src/router/index.js b/src/router/index.js index 0aeded4..eaf2d3c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -14,7 +14,7 @@ export default new Router({ routes: [ { path: '/', - redirect: '/RunOperate' + redirect: '/login' }, { path: '/login',