yangys
2025-11-18 831cfa4c439c6d073d706a82d2a439f8b1818498
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!--
 * @Author: lzhe lzhe@example.com
 * @Date: 2024-04-26 09:36:18
 * @LastEditors: lzhe lzhe@example.com
 * @LastEditTime: 2024-12-20 14:52:10
 * @FilePath: /smart-web/src/views/mdc/status-record.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
    <el-main style="height: 100%;" class="timeAnalysis">
        <el-card body-style="height: 100%;padding: 0;" style="margin-bottom: 12px;">
            <el-table :data="tableData" border>
                <el-table-column prop="progName" label="程序名称"></el-table-column>
                <el-table-column prop="startTime" label="开始时间"></el-table-column>
                <el-table-column prop="endTime" label="结束时间"></el-table-column>
                <el-table-column prop="duration" label="持续时长"></el-table-column>
                <el-table-column prop="deviceStatus" label="状态"></el-table-column>
            </el-table>
            <el-footer>
                <el-button type="primary" @click="exportBtn">输出</el-button>
            </el-footer>
        </el-card>
    </el-main>
</template>
 
<script>
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
let icons = []
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    icons.push(key)
}
import * as echarts from 'echarts';
export default {
    components: {
        ...ElementPlusIconsVue
    },
    data() {
        return {
            tableData: []
        }
    },
    created() {
        
    },
    mounted() {
        this.getTableData();
    },
    methods: {
        exportBtn() {
            this.$HTTP.get(`/api/workinghour/working-process-export?id=${this.$route.query.id}`).then(res => {
                if (res.code == 200) {
                    this.$TOOL.downFile(res.data.link,res.data.originalName);
                }
            })
        },
        getTableData() {
            this.$HTTP.get(`/api/workinghour/working-process`, {id: this.$route.query.id}).then(res => {
                if (res.code === 200) {
                    this.getprocess(res);
                }
            })
        },
        getprocess(res) {  //颜色状态
            this.$HTTP.get(`/api/smis/global_wcs/list?code=&name=`).then(resp => {
                if (resp.code == 200) {
                    res.data.forEach(item=> {
                        resp.data.forEach(item1=> {
                            if(item.deviceStatus == item1.code) {
                                item.deviceStatus = item1.name;
                            }
                        })
                    })
                    this.tableData = res.data;
                    console.log(JSON.stringify(res.data),111)
                }
            })
        },
    }
}
</script>
 
<style scoped>
    
</style>