|
|
|
|
@ -9,7 +9,8 @@
|
|
|
|
|
<div class="axle-container">
|
|
|
|
|
<div class="axle-side left">
|
|
|
|
|
<div v-for="record in getLeftAxles(equipment)" :key="`${record.axle_number}-${record.update_time}`"
|
|
|
|
|
class="axle-item" :class="{ 'running': record.status === '1' }">
|
|
|
|
|
class="axle-item"
|
|
|
|
|
:class="getCompletionClass(record.degree_of_completion)">
|
|
|
|
|
<div class="axle-number">{{ record.axle_number }}</div>
|
|
|
|
|
<div class="axle-spec">{{ record.specification }}</div>
|
|
|
|
|
<div class="axle-model">{{ record.model }}</div>
|
|
|
|
|
@ -18,7 +19,8 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="axle-side right">
|
|
|
|
|
<div v-for="record in getRightAxles(equipment)" :key="`${record.axle_number}-${record.update_time}`"
|
|
|
|
|
class="axle-item" :class="{ 'running': record.status === '1' }">
|
|
|
|
|
class="axle-item"
|
|
|
|
|
:class="getCompletionClass(record.degree_of_completion)">
|
|
|
|
|
<div class="axle-number">{{ record.axle_number }}</div>
|
|
|
|
|
<div class="axle-spec">{{ record.specification }}</div>
|
|
|
|
|
<div class="axle-model">{{ record.model }}</div>
|
|
|
|
|
@ -64,6 +66,15 @@ const getRightAxles = (equipment) => {
|
|
|
|
|
return axle.includes('右') || axle.includes('right');
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 根据完成度返回对应的CSS类名
|
|
|
|
|
const getCompletionClass = (degree) => {
|
|
|
|
|
const percentage = degree * 100;
|
|
|
|
|
if (percentage < 25) return 'completion-low';
|
|
|
|
|
if (percentage < 75) return 'completion-medium';
|
|
|
|
|
if (percentage < 100) return 'completion-high';
|
|
|
|
|
return 'completion-full';
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
@ -114,16 +125,32 @@ const getRightAxles = (equipment) => {
|
|
|
|
|
padding: 8px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
background-color: #f5f7fa;
|
|
|
|
|
border: 1px solid #e4e7ed;
|
|
|
|
|
border: 2px solid #e4e7ed;
|
|
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.axle-item.running {
|
|
|
|
|
background-color: #f0f9ff;
|
|
|
|
|
border-color: #409eff;
|
|
|
|
|
/* 0% - 25% 完成度 - 浅绿色边框 */
|
|
|
|
|
.axle-item.completion-low {
|
|
|
|
|
border-color: #b3e19d;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.axle-item.completion-low::before {
|
|
|
|
|
content: '';
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: 0;
|
|
|
|
|
top: 0;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
width: 4px;
|
|
|
|
|
background-color: #b3e19d;
|
|
|
|
|
border-radius: 4px 0 0 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 25% - 75% 完成度 - 中等绿色边框 */
|
|
|
|
|
.axle-item.completion-medium {
|
|
|
|
|
border-color: #67c23a;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.axle-item.running::before {
|
|
|
|
|
.axle-item.completion-medium::before {
|
|
|
|
|
content: '';
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: 0;
|
|
|
|
|
@ -134,6 +161,38 @@ const getRightAxles = (equipment) => {
|
|
|
|
|
border-radius: 4px 0 0 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 75% - 100% 完成度 - 深绿色边框 */
|
|
|
|
|
.axle-item.completion-high {
|
|
|
|
|
border-color: #529b2e;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.axle-item.completion-high::before {
|
|
|
|
|
content: '';
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: 0;
|
|
|
|
|
top: 0;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
width: 4px;
|
|
|
|
|
background-color: #529b2e;
|
|
|
|
|
border-radius: 4px 0 0 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 100%及以上完成度 - 最深绿色边框 */
|
|
|
|
|
.axle-item.completion-full {
|
|
|
|
|
border-color: #387c2a;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.axle-item.completion-full::before {
|
|
|
|
|
content: '';
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: 0;
|
|
|
|
|
top: 0;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
width: 4px;
|
|
|
|
|
background-color: #387c2a;
|
|
|
|
|
border-radius: 4px 0 0 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.axle-number {
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
margin-bottom: 4px;
|
|
|
|
|
|