2023-08-24 10:10:09 +00:00
|
|
|
<template>
|
2023-08-29 10:16:00 +00:00
|
|
|
<div class="dev-card">
|
|
|
|
<div class="dev-left">
|
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
<div class="dev-right">
|
|
|
|
<div class="dev-box">
|
|
|
|
<div class="dev-content dev-title">
|
|
|
|
<div class="key" v-for="item in dev_title">{{ item }}</div>
|
|
|
|
</div>
|
2023-09-09 09:03:31 +00:00
|
|
|
<div class="dev-content" v-for="(items, index) in (dev_value as any)">
|
|
|
|
<div v-for="(item,index) in items" :class="{status:index == (items.length - 1)}"
|
|
|
|
:style="{background:index == (items.length - 1)?status_color[item]:''}"
|
|
|
|
>{{ index == (items.length - 1)?'':item}}</div>
|
2023-08-29 10:16:00 +00:00
|
|
|
</div>
|
2023-08-24 10:10:09 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang='ts'>
|
2023-09-08 08:03:33 +00:00
|
|
|
import { defineProps, ref } from 'vue'
|
2023-08-24 10:10:09 +00:00
|
|
|
const prop = defineProps({
|
|
|
|
dev_title: {
|
|
|
|
type: Array,
|
2023-08-29 10:16:00 +00:00
|
|
|
default: ['机架号', '状态', '布料层数', '裁片数量']
|
2023-08-24 10:10:09 +00:00
|
|
|
},
|
|
|
|
dev_value: {
|
2023-09-09 09:03:31 +00:00
|
|
|
type: Array,
|
2023-08-29 10:16:00 +00:00
|
|
|
default: [
|
2023-09-08 08:03:33 +00:00
|
|
|
[102014422, '待机', '40层', '0']
|
2023-08-29 10:16:00 +00:00
|
|
|
]
|
2023-08-24 10:10:09 +00:00
|
|
|
},
|
|
|
|
})
|
2023-09-08 08:03:33 +00:00
|
|
|
const status_color = {
|
|
|
|
'0':'#FF6E76',
|
|
|
|
'1':'#FDDD60',
|
|
|
|
'2':'#7CFFB2',
|
|
|
|
'3':'#FDDD60',
|
|
|
|
}
|
2023-08-24 10:10:09 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.dev-card {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
box-sizing: border-box;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
}
|
2023-08-29 10:16:00 +00:00
|
|
|
|
|
|
|
.dev-left,
|
|
|
|
.dev-right {
|
2023-08-24 10:10:09 +00:00
|
|
|
width: 50%;
|
|
|
|
height: 100%;
|
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
2023-09-06 10:05:57 +00:00
|
|
|
.dev-right {
|
|
|
|
width: 60%;
|
|
|
|
}
|
2023-08-29 10:16:00 +00:00
|
|
|
|
2023-08-24 10:10:09 +00:00
|
|
|
.dev-right {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: space-around;
|
|
|
|
align-items: center;
|
|
|
|
}
|
2023-08-29 10:16:00 +00:00
|
|
|
|
2023-08-24 10:10:09 +00:00
|
|
|
.dev-title {
|
|
|
|
color: #FFF;
|
|
|
|
}
|
2023-08-29 10:16:00 +00:00
|
|
|
|
2023-08-24 10:10:09 +00:00
|
|
|
.dev-box {
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
font-size: 16px;
|
|
|
|
display: flex;
|
|
|
|
justify-content: end;
|
|
|
|
align-items: center;
|
|
|
|
}
|
2023-08-29 10:16:00 +00:00
|
|
|
|
2023-08-24 10:10:09 +00:00
|
|
|
.dev-content {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: space-around;
|
|
|
|
align-items: center;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
.key {
|
|
|
|
width: 75px;
|
|
|
|
height: 35px;
|
|
|
|
line-height: 35px;
|
|
|
|
text-align: center;
|
2023-09-06 10:05:57 +00:00
|
|
|
font-size: 18px;
|
|
|
|
font-weight: 700;
|
|
|
|
color: #02C1D7;
|
|
|
|
/* background: url(@/assets/img/title_bg.svg) no-repeat center center / 100% 100%; */
|
2023-09-08 08:03:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.status {
|
|
|
|
width:24px;
|
|
|
|
height:24px;
|
|
|
|
border-radius: 50%;
|
|
|
|
}
|
|
|
|
</style>
|