From 3f4328357a4bb89a3256b834e1ef2b07fc3c3d0e Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期日, 29 九月 2024 14:11:04 +0800
Subject: [PATCH] 1
---
src/views/mdc/components/ShiftAlarm.vue | 44 +++++++++++++++++++++++++-------------------
1 files changed, 25 insertions(+), 19 deletions(-)
diff --git a/src/views/mdc/components/ShiftAlarm.vue b/src/views/mdc/components/ShiftAlarm.vue
index b8f7cc2..0b67709 100644
--- a/src/views/mdc/components/ShiftAlarm.vue
+++ b/src/views/mdc/components/ShiftAlarm.vue
@@ -1,7 +1,7 @@
<!--
* @Date: 2024-04-18 21:52:18
* @LastEditors: Sneed
- * @LastEditTime: 2024-04-23 19:45:00
+ * @LastEditTime: 2024-06-20 23:13:35
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/components/ShiftAlarm.vue
-->
<template>
@@ -9,8 +9,8 @@
<el-row>
<el-col>
<el-button-group>
- <el-button size="small" @click="btnListActive = item.id"
- :type="btnListActive == item.id ? 'primary' : ''" v-for="item in btnList" :key="item.id">{{
+ <el-button size="small" @click="change(item)" :type="btnListActive == item.id ? 'primary' : ''"
+ v-for="item in btnList" :key="item.id">{{
item.title }}</el-button>
</el-button-group>
</el-col>
@@ -80,26 +80,32 @@
],
}
},
- watch: {
- btnListActive(val) {
+ // watch: {
+ // btnListActive(val) {
+ // this.queryChart({
+ // ...this.params,
+ // })
+ // }
+ // },
+ methods: {
+ change(item) {
+ this.btnListActive = item.id
this.queryChart({
...this.params,
})
- }
- },
- methods: {
+ },
init(params) {
- this.params = {
- ...this.params,
- ...params,
- workstationId: params.workstationId.toString()
- }
- this.getTime({
- endDate: params.endDate,
- startDate: params.startDate,
- }).then(res => {
+ this.btnListActive = ''
+ this.$nextTick(() => {
+ this.params = {
+ ...this.params,
+ workstationId: params.workstationId.toString()
+ }
+ this.getTime({
+ endDate: params.endDate,
+ startDate: params.startDate,
+ })
})
-
},
getTime(data) {
return new Promise(resolve => {
@@ -117,7 +123,7 @@
})
}
this.btnList = arr;
- this.btnListActive = arr[0].id
+ this.change(arr[0])
resolve(arr)
})
},
--
Gitblit v1.9.3