1
lzhe
2024-06-05 dcf9c9e0410fe1186239e3f8d6f7bdc789c08010
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<!--
 * @Date: 2024-04-17 22:17:37
 * @LastEditors: Sneed
 * @LastEditTime: 2024-04-22 19:07:49
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/configComp/Efficiency.vue
-->
<template>
    <el-main>
        <el-row>
            <el-col>
                <el-card style="max-width: 480px">
                    <template #header>
                        <div class="card-header">
                            用时分析(用时分布)
                        </div>
                    </template>
                    <el-row>
                        <el-col :span="18" style="display: flex;align-items: center">
                            排除班次内休息时间
                        </el-col>
                        <el-col :span="4">
                            <el-switch @change="save()" :active-value="1" :inactive-value="0"
                                v-model="mdc_open_type.TIME_USED_ANALYSIS" />
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="18" style="display: flex;align-items: center">
                            排除班次对外时间(包括班次内未定义时间)
                        </el-col>
                        <el-col :span="4">
                            <el-switch @change="save(true)" :active-value="1" :inactive-value="0"
                                v-model="mdc_open_shift.TIME_USED_ANALYSIS" />
                        </el-col>
                    </el-row>
                </el-card>
                <el-card style="max-width: 480px">
                    <template #header>
                        <div class="card-header">
                            效率分析
                        </div>
                    </template>
                    <el-row>
                        <el-col style="font-weight: blod;font-size: 14px">运行率</el-col>
                        <el-col :span="18" style="display: flex;align-items: center">
                            排除班次内休息时间
                        </el-col>
                        <el-col :span="4">
                            <el-switch @change="save()" :active-value="1" :inactive-value="0"
                                v-model="mdc_open_type.RUNNING" />
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="18" style="display: flex;align-items: center">
                            排除班次对外时间(包括班次内未定义时间)
                        </el-col>
                        <el-col :span="4">
                            <el-switch @change="save(true)" :active-value="1" :inactive-value="0"
                                v-model="mdc_open_shift.RUNNING" />
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col style="font-weight: blod;font-size: 14px">报警率</el-col>
                        <el-col :span="18" style="display: flex;align-items: center">
                            排除班次内休息时间
                        </el-col>
                        <el-col :span="4">
                            <el-switch @change="save()" :active-value="1" :inactive-value="0"
                                v-model="mdc_open_type.ALARM" />
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="18" style="display: flex;align-items: center">
                            排除班次对外时间(包括班次内未定义时间)
                        </el-col>
                        <el-col :span="4">
                            <el-switch @change="save(true)" :active-value="1" :inactive-value="0"
                                v-model="mdc_open_shift.ALARM" />
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col style="font-weight: blod;font-size: 14px">稼动率</el-col>
                        <el-col :span="18" style="display: flex;align-items: center">
                            排除班次内休息时间
                        </el-col>
                        <el-col :span="4">
                            <el-switch @change="save()" :active-value="1" :inactive-value="0"
                                v-model="mdc_open_type.OEE" />
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="18" style="display: flex;align-items: center">
                            排除班次对外时间(包括班次内未定义时间)
                        </el-col>
                        <el-col :span="4">
                            <el-switch @change="save(true)" :active-value="1" :inactive-value="0"
                                v-model="mdc_open_shift.OEE" />
                        </el-col>
                    </el-row>
                </el-card>
                <el-card style="max-width: 480px">
                    <template #header>
                        <div class="card-header">
                            产量统计
                        </div>
                    </template>
                    <el-row>
                        <el-col :span="18" style="display: flex;align-items: center">
                            排除班次内休息时间
                        </el-col>
                        <el-col :span="4">
                            <el-switch @change="save()" :active-value="1" :inactive-value="0"
                                v-model="mdc_open_type.OUT_PUT" />
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="18" style="display: flex;align-items: center">
                            排除班次对外时间(包括班次内未定义时间)
                        </el-col>
                        <el-col :span="4">
                            <el-switch @change="save(true)" :active-value="1" :inactive-value="0"
                                v-model="mdc_open_shift.OUT_PUT" />
                        </el-col>
                    </el-row>
                </el-card>
                <el-card style="max-width: 480px">
                    <template #header>
                        <div class="card-header">
                            报警统计
                        </div>
                    </template>
                    <el-row>
                        <el-col :span="18" style="display: flex;align-items: center">
                            排除班次内休息时间
                        </el-col>
                        <el-col :span="4">
                            <el-switch @change="save()" :active-value="1" :inactive-value="0"
                                v-model="mdc_open_type.ALARM_ANALYSIS" />
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="18" style="display: flex;align-items: center">
                            排除班次对外时间(包括班次内未定义时间)
                        </el-col>
                        <el-col :span="4">
                            <el-switch @change="save(true)" :active-value="1" :inactive-value="0"
                                v-model="mdc_open_shift.ALARM_ANALYSIS" />
                        </el-col>
                    </el-row>
                </el-card>
            </el-col>
        </el-row>
    </el-main>
</template>
 
<script>
export default {
    data() {
        return {
            mdc_open_typeId: '',
            mdc_open_type: {
                TIME_USED_ANALYSIS: 0,
                RUNNING: 0,
                ALARM: 0,
                OEE: 0,
                OUT_PUT: 0,
                ALARM_ANALYSIS: 0,
            },
            mdc_open_shiftId: '',
            mdc_open_shift: {
                TIME_USED_ANALYSIS: 0,
                RUNNING: 0,
                ALARM: 0,
                OEE: 0,
                OUT_PUT: 0,
                ALARM_ANALYSIS: 0,
            }
        }
    },
    created() {
        this.init()
    },
    methods: {
        init() {
            this.$HTTP.get('/api/blade-system/param/detail?paramKey=mdc_open_shift').then(res => {
                if (res.code === 200) {
                    this.mdc_open_shiftId = res.data.id
                    JSON.parse(res.data.paramValue).forEach(v => {
                        this.mdc_open_shift[v.type] = v.open
                    })
                }
            })
            this.$HTTP.get('/api/blade-system/param/detail?paramKey=mdc_open_type').then(res => {
                if (res.code === 200) {
                    this.mdc_open_typeId = res.data.id
                    JSON.parse(res.data.paramValue).forEach(v => {
                        this.mdc_open_type[v.type] = v.open
                    })
                }
            })
        },
        save(flag) {
            let data = {
 
            }
            if (flag) {
                data.paramKey = 'mdc_open_shift'
                data.id = this.mdc_open_shiftId
                let paramValue = Object.keys(this.mdc_open_shift).map(v => {
                    return {
                        type: v,
                        open: this.mdc_open_shift[v]
                    }
                })
                data.paramValue = JSON.stringify(paramValue)
            } else {
                data.paramKey = 'mdc_open_type'
                data.id = this.mdc_open_typeId
                let paramValue = Object.keys(this.mdc_open_type).map(v => {
                    return {
                        type: v,
                        open: this.mdc_open_type[v]
                    }
                })
                data.paramValue = JSON.stringify(paramValue)
            }
            this.$HTTP.post('/api/blade-system/param/submit', data).then(res => {
                if (res.code == 200) {
                    this.$message.success(`操作成功`)
                    this.init()
                }
            })
        },
    }
}
</script>
 
<style lang="scss" scoped></style>