tft-fe/src/views/qualityManagement/components/defectScatterPlotTotal.vue

134 lines
3.3 KiB
Vue
Raw Normal View History

2023-01-03 09:33:30 +08:00
<template>
2023-02-21 16:34:49 +08:00
<div class="bottom-box">
<div class="bottom-left">
2023-01-03 09:33:30 +08:00
<ul class="dataTab">
2023-02-21 16:34:49 +08:00
<div class="title">颗粒数据</div>
2023-03-09 17:01:02 +08:00
<li v-for="(item, index) in leftList" :key="index">
2023-01-03 09:33:30 +08:00
<p class="tabHead">{{ item.name }}</p>
<p class="tabValue" :title="item.value">{{ item.value }}</p>
2023-01-03 09:33:30 +08:00
</li>
</ul>
2023-02-21 16:34:49 +08:00
</div>
<div class="bottom-right">
2023-01-03 09:33:30 +08:00
<ul class="dataTab">
2023-02-21 16:34:49 +08:00
<div class="title">面检数据</div>
2023-03-09 17:01:02 +08:00
<li v-for="(item, index) in rightList" :key="index">
2023-01-03 09:33:30 +08:00
<p class="tabHead">{{ item.name }}</p>
<p class="tabValue" :title="item.value">{{ item.value }}</p>
2023-01-03 09:33:30 +08:00
</li>
</ul>
2023-02-21 16:34:49 +08:00
</div>
</div>
2023-01-03 09:33:30 +08:00
</template>
<script>
export default {
name: 'DefectScatterPlot',
data() {
return {
2023-03-09 17:01:02 +08:00
leftList: [
{ name: 'S', value: null, key: 's' },
{ name: 'M', value: null, key: 'm' },
{ name: 'L', value: null, key: 'l' },
{ name: 'XL', value: null, key: 'xl' }
2023-01-03 09:33:30 +08:00
],
2023-03-09 17:01:02 +08:00
rightList: [
{ name: '气泡', value: null, key: 'bl' },
{ name: '变形', value: null, key: 'distortion' },
{ name: '纤维', value: null, key: 'fiber' },
{ name: '划伤', value: null, key: 'scratch' },
{ name: '点状缺陷', value: null, key: 'tin' },
{ name: '结石', value: null, key: 'stone' },
{ name: '铂金', value: null, key: 'pt' },
{ name: '结节', value: null, key: 'knot' },
{ name: '拖尾', value: null, key: 'tail' },
{ name: 'ADG', value: null, key: 'adg' },
{ name: '锡缺陷(顶部)', value: null, key: 'top' },
{ name: '锡缺陷(底部)', value: null, key: 'bottom' },
{ name: '无法识别', value: null, key: 'iisrest' }
2023-01-03 09:33:30 +08:00
]
}
2023-03-09 17:01:02 +08:00
},
methods: {
2023-04-26 15:27:00 +08:00
init(detailObj) {
console.log(detailObj)
2023-03-09 17:01:02 +08:00
for (let i = 0; i < this.leftList.length; i++) {
2023-04-26 15:27:00 +08:00
this.leftList[i].value = detailObj[this.leftList[i].key]
? detailObj[this.leftList[i].key]
2023-03-09 17:01:02 +08:00
: null
}
for (let i = 0; i < this.rightList.length; i++) {
2023-04-26 15:27:00 +08:00
this.rightList[i].value = detailObj[this.rightList[i].key]
? detailObj[this.rightList[i].key]
2023-03-09 17:01:02 +08:00
: null
}
}
2023-01-03 09:33:30 +08:00
}
}
</script>
<style lang="scss" scoped>
2023-02-21 16:34:49 +08:00
.bottom-box {
overflow-x: auto;
display: flex;
.bottom-left,
.bottom-right {
display: inline-block;
}
.bottom-left {
width: 290px;
margin-right: 8px;
.dataTab {
li {
width: 65px;
}
}
}
.bottom-right {
width: calc(100% - 300px);
.dataTab {
li {
width: 7.7%;
min-width: 60px;
}
}
}
}
2023-01-03 09:33:30 +08:00
.title {
2023-02-21 16:34:49 +08:00
display: inline-block;
height: 66px;
width: 30px;
2023-01-03 09:33:30 +08:00
font-size: 14px;
2023-02-21 16:34:49 +08:00
line-height: 14px;
2023-01-03 09:33:30 +08:00
font-weight: 500;
2023-02-21 16:34:49 +08:00
padding: 5px 8px 0px;
2023-01-03 09:33:30 +08:00
color: rgba(0, 0, 0, 0.85);
background-color: #fafafa;
border-top-left-radius: 5px;
2023-02-21 16:34:49 +08:00
border-bottom-left-radius: 5px;
2023-01-03 09:33:30 +08:00
}
.dataTab {
display: flex;
flex-flow: row nowrap;
li {
font-size: 14px;
border-right: 1px solid #e8e8e8;
border-bottom: 1px solid #e8e8e8;
p {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.tabHead {
2023-02-21 16:34:49 +08:00
height: 31px;
2023-01-03 09:33:30 +08:00
background: #e9ebf0;
}
.tabHead,
.tabValue {
2023-02-21 16:34:49 +08:00
padding: 8px;
2023-01-03 09:33:30 +08:00
}
.tabValue {
height: 35px;
}
}
}
</style>