gaoshp
2024-11-03 3e091224ab26252d8624b42b461ba773ee8bee0f
src/views/mdc/alarm-statistics.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-04-09 22:11:21
 * @LastEditors: Sneed
 * @LastEditTime: 2024-06-20 23:54:23
 * @LastEditTime: 2024-06-22 18:50:49
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/alarm-statistics.vue
 * 效率分析
-->
@@ -26,7 +26,8 @@
                        </el-main>
                        <el-footer>
                            <el-button type="primary" @click="query()">查询</el-button>
                            <el-button @click="exportExcel">导出</el-button>
                            <!-- <el-button @click="exportExcel">导出</el-button> -->
                            <exportDialog ref="export" @export="exportExcel"></exportDialog>
                        </el-footer>
                    </el-container>
                </el-aside>
@@ -34,12 +35,12 @@
                    <el-main>
                        <el-tabs tab-position="top" v-model="activeName" type="card">
                            <el-tab-pane label="按班次统计" name="shift">
                                <Shift colname="产量" url="/api/blade-mdc/alarm/summary-shift-graph" ref="shift"
                                <Shift colname="产量" url="/api/mdc/alarm/summary-shift-graph" ref="shift"
                                    v-if="activeName == 'shift'">
                                </Shift>
                            </el-tab-pane>
                            <el-tab-pane label="按时间周期统计" name="time">
                                <Time url="/api/blade-mdc/alarm/summary-graph" ref="time" v-if="activeName == 'time'">
                                <Time url="/api/mdc/alarm/summary-graph" ref="time" v-if="activeName == 'time'">
                                </Time>
                            </el-tab-pane>
                        </el-tabs>
@@ -55,12 +56,13 @@
import MYTree from './MYTree.vue'
import Shift from './components/ShiftAlarm.vue'
import Time from './components/TimeAlarm.vue'
import exportDialog from '@/layout/components/exportDialog.vue'
export default {
    components: {
        MYTree,
        Shift,
        Time
        Time,
        exportDialog
    },
    watch: {
        activeName() {
@@ -100,8 +102,27 @@
        // })
    },
    methods: {
        exportExcel(statisticalMethod) {
            let { start, end } = this.$refs.export.format(this.time[0], this.time[1], statisticalMethod)
            this.$HTTP.post(`/api/mdc/alarm/export-alarm`, {
                startTime: start,
                endTime: end,
                enums: statisticalMethod,
                month: 0,
                queryTime: '',
                shiftIndex: 1,
                week: 0,
                year: 0,
                workstationId: this.treeChecked.toString()
            }).then(res => {
                if (res.success) {
                    window.open(res.data.link)
                } else {
                    this.$message.error(res.msg)
                }
            })
        },
        query(firstWorkKey) {
            console.log('------')
            let workstationId = firstWorkKey ? [firstWorkKey] : [...this.treeChecked]
            this.$nextTick(() => {
                this.$refs[this.activeName].init({