yangys
2024-01-13 f466ae4fdc645c66c9f25e2e4598b9809e2b41af
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
<!--
 * @Date: 2024-01-13 20:46:33
 * @LastEditors: Sneed
 * @LastEditTime: 2024-01-13 21:37:22
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/workshop/device.vue
-->
<template>
    <div class="device-item">
        <el-checkbox class="care" v-model="care" @change="change"></el-checkbox>
        <p>YKX123123213</p>
        <div class="device-item-box">
            <div class="img">
                <span class="img-status" v-if="item.status === 'STOP'">停机</span>
                <span class="img-status run" v-if="item.status === 'RUN'">运行</span>
                <span class="img-status standby" v-if="item.status === 'IDLE'">待机</span>
                <span class="img-status alerm" v-if="item.status === 'ALARM'">报警</span>
                <img src="./img/machine.png" alt="">
            </div>
            <ul>
                <li>
                    <img src="./img/sd.png" alt="">
                    <div>
                        <p>{{ item.cycleCount }}</p>
                        <p>能力利用率</p>
                    </div>
                </li>
                <li>
                    <img src="./img/sd.png" alt="">
                    <div>
                        <p>{{ item.cycleCount }}</p>
                        <p>日利用率</p>
                    </div>
                </li>
                <li>
                    <img src="./img/sd.png" alt="">
                    <div>
                        <p>{{ item.cycleCount }}</p>
                        <p>完工件数</p>
                    </div>
                </li>
            </ul>
        </div>
    </div>
</template>
<script>
import { getRequest,getUrl } from '@/api/Api'
export default {
    props: ['item'],
    data () {
        return {
            care: false,
        }
    },
    methods: {
        change (val) {
            console.log(val)
            getRequest('machineConcern',{concern: val ? 1 : 0,id: this.item.id}).then(res => {
                console.log(res)
            })
        }
    },
}
</script>
<style lang="scss" scoped>
.device-item {
    width: 394px;
    height: 321px;
    border-radius: 10px;
    border: 1px solid #3C4249;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    .care {
        position: absolute;
        right: 5px;
        top: 5px;
        z-index: 999;
    }
    &>p {
        color: #E9FFFF;
        text-shadow: 0px 1px 11px #549BD4;
        background: linear-gradient(180deg, #9AFEFE 0%, #4B78CD 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        text-align: center;
        position: relative;
    }
    &>p:before {
        content: '';
        position: absolute;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
        width: 60px;
        height: 1px;
        background: linear-gradient(270deg, #65A5D6 0%, rgba(11,70,115,0) 100%);
    }
    &>p:after {
        content: '';
        position: absolute;
        top: 50%;
        right: 0;
        transform: translateY(-50%);
        width: 60px;
        height: 1px;
        background: linear-gradient(90deg, #65A5D6 0%, rgba(11,70,115,0) 100%);
    }
    &>div.device-item-box {
        flex: 1 1 auto;
        margin-top: 20px;
        display: flex;
        align-items: center;
        margin-bottom: 20px;
 
        overflow: hidden;
 
        .img {
            width: 50%;
            height: 100%;
            border: 1px solid #444C55;
            border-radius: 10px;
            position: relative;
            .img-status {
                position: absolute;
                font-size: 12px;
                right: 10px;
                top: 10px;
                background: rgba(216,216,216,0.09);
                border-radius: 11px;
                // border: 1px solid #FFFFFF;
                padding: 5px 10px;
            }
            .img-status.standby {
                background: linear-gradient(130deg, #FF3333 0%, #F2BF24 100%);
            }
            .img-status.run {
                background: linear-gradient(130deg, #EAF224 0%, #3DF297 100%);
            }
            .img-status.alerm {
                background: #FF3333;
                color: #fff;
            }
            img {
                position: absolute;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                width: 80%;
            }
        }
 
        ul {
            flex: 1 1 auto;
            height: 100%;
            margin-left: 20px;
            list-style: none;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: space-around;
 
            li {
                width: 100%;
                display: flex;
                font-size: 12px;
                align-items: center;
 
                &>div {
                    margin-left: 20px;
                    ;
                }
 
                p {
                    color: #E9FFFF;
                    text-shadow: 0px 1px 11px #549BD4;
                }
 
                img {
                    width: 40px;
                    height: 40px;
                }
            }
        }
    }
}</style>