Zlpt_Portal/src/components/equipDetailTable.vue

196 lines
4.7 KiB
Vue
Raw Normal View History

2023-12-05 20:50:06 +08:00
<template>
<el-table :data="[props]"
border
:header-cell-class-name="headerClassName"
style="width: 100%">
2023-12-09 11:46:09 +08:00
<el-table-column label="装备" min-width="210" >
2023-12-05 20:50:06 +08:00
<template #default="scope">
<div class="equipData">
<div class="name">
{{ scope.row.name }}
</div>
<div class="desc">
<div class="Img">
<img :src="scope.row.url">
</div>
<div class="state">
<div class="item" v-for="(v,i) in stateList" :key="i">
<div class="label">
{{ v.label }}
</div>
<div class="value">
{{ scope.row[v.key] || '' }}
</div>
</div>
</div>
</div>
</div>
</template>
</el-table-column>
2023-12-09 11:46:09 +08:00
<el-table-column prop="name" label="租金" min-width="80" >
2023-12-05 20:50:06 +08:00
<template #default="scope">
2023-12-09 22:29:42 +08:00
{{ scope.row.price }}/{{ scope.row.unit }}
2023-12-05 20:50:06 +08:00
</template>
</el-table-column>
2023-12-09 11:46:09 +08:00
<el-table-column prop="company" label="供应商" min-width="120" />
2023-12-05 20:50:06 +08:00
</el-table>
</template>
<script lang="ts" setup>
import {ref} from "vue";
const props = defineProps({
2023-12-05 20:57:29 +08:00
/**
* @description 装备名称
* */
2023-12-05 20:50:06 +08:00
name:{
type:String,
default:''
},
2023-12-05 20:57:29 +08:00
/**
* @description 装备图片
* */
2023-12-05 20:50:06 +08:00
url:{
type:String,
default:''
},
2023-12-05 20:57:29 +08:00
/**
* @description 装备编码
* */
2023-12-05 20:50:06 +08:00
code:{
type:String,
default:''
},
2023-12-05 20:57:29 +08:00
/**
* @description 装备类别
* */
2023-12-05 20:50:06 +08:00
type:{
type:String,
default:''
},
2023-12-05 20:57:29 +08:00
/**
* @description 装备组别
* */
2023-12-05 20:50:06 +08:00
group:{
type:String,
default:''
},
2023-12-05 20:57:29 +08:00
/**
* @description 装备品牌
* */
2023-12-05 20:50:06 +08:00
brand:{
type:String,
default:''
},
2023-12-05 20:57:29 +08:00
/**
* @description 装备规格
* */
2023-12-05 20:50:06 +08:00
specifications:{
type:String,
default:''
},
2023-12-05 20:57:29 +08:00
/**
* @description 装备位置
* */
2023-12-05 20:50:06 +08:00
position:{
type:String,
default:''
},
2023-12-05 20:57:29 +08:00
/**
* @description 装备价格
* */
2023-12-05 20:50:06 +08:00
price:{
type: [String, Number],
default:''
},
2023-12-05 20:57:29 +08:00
/**
* @description 装备价格单位
* */
2023-12-05 20:50:06 +08:00
unit: {
type: String,
default:''
},
2023-12-05 20:57:29 +08:00
/**
* @description 装备公司
* */
2023-12-05 20:50:06 +08:00
company: {
type: String,
default:''
}
})
const stateList = ref([
{
label:'装备编号',
key:'code'
},{
label:'装备类别',
key:'type'
},{
label:'装备组别',
key:'group'
},{
label:'品牌',
key:'brand'
},{
label:'设备规格',
key:'specifications'
},{
label:'设备位置',
key:'position'
},
])
const headerClassName = () => {
return 'headerColor'
}
</script>
<style lang="scss" scoped>
:deep() .headerColor{
background: #3E98FF !important;
color: white !important;
}
.equipData{
.name{
font-size: 16px;
font-weight: 600;
color: black;
}
.desc{
display: flex;
margin-top: 10px;
.Img{
width: 150px;
height: 150px;
border-radius: 15px;
display: flex;
align-items: center;
justify-content: center;
background: #e5e5e5;
overflow: hidden;
margin-right: 10px;
img{
width: 100%;
max-height: 100%;
object-fit: contain;
}
}
.state{
flex: 1;
.item{
display: flex;
align-items: center;
.label{
width: 80px;
text-align: right;
color: #858585;
}
.value{
color: black;
}
}
}
}
}
</style>