| | |
| | | <!-- |
| | | * @Date: 2024-04-18 21:52:18 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-04-21 18:49:27 |
| | | * @LastEditTime: 2024-06-20 23:13:35 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/components/ShiftAlarm.vue |
| | | --> |
| | | <template> |
| | |
| | | <el-row> |
| | | <el-col> |
| | | <el-button-group> |
| | | <el-button @click="btnListActive = item.id" :type="btnListActive == item.id ? 'primary' : ''" |
| | | <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> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | sheetUrl: '/api/blade-mdc/alarm/data-shift-sheet', |
| | | sheetUrl: '/api/mdc/alarm/data-shift-sheet', |
| | | isShowTable: false, |
| | | params: { |
| | | enums: "SHIFT", |
| | |
| | | ], |
| | | } |
| | | }, |
| | | 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 => { |
| | |
| | | }) |
| | | } |
| | | this.btnList = arr; |
| | | this.btnListActive = arr[0].id |
| | | this.change(arr[0]) |
| | | resolve(arr) |
| | | }) |
| | | }, |