screenFront/src/views/Exhibition/Colombia/component/DevCard.vue
2023-12-27 14:08:10 +08:00

127 lines
2.7 KiB
Vue

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