Feature: 为表格增删添加动画 & 修改表格颜色

This commit is contained in:
2025-07-11 17:16:47 +08:00
parent 5d358aeb66
commit 1fc9e226a7
2 changed files with 25 additions and 3 deletions

View File

@ -129,6 +129,7 @@
<v-table <v-table
fixed-header fixed-header
theme="primary"
> >
<thead> <thead>
<tr> <tr>
@ -139,17 +140,18 @@
<th>{{ $t('paperWidth') }}</th> <th>{{ $t('paperWidth') }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <transition-group name="fade" tag="tbody">
<tr v-for="(record, index) in recordList" :key="index"> <tr v-for="(record, index) in recordList" :key="index" class="table-row-item">
<td>{{ record.layer }}</td> <td>{{ record.layer }}</td>
<td>{{ record.grammage.value.toFixed(2) }} {{ record.grammage.unit }}</td> <td>{{ record.grammage.value.toFixed(2) }} {{ record.grammage.unit }}</td>
<td>{{ record.cumulativeThickness.value.toFixed(2) }} {{ record.cumulativeThickness.unit }}</td> <td>{{ record.cumulativeThickness.value.toFixed(2) }} {{ record.cumulativeThickness.unit }}</td>
<td>{{ record.angle.value.toFixed(2) }} {{ record.angle.unit }}</td> <td>{{ record.angle.value.toFixed(2) }} {{ record.angle.unit }}</td>
<td>{{ record.paperWidth.value.toFixed(2) }} {{ record.paperWidth.unit }}</td> <td>{{ record.paperWidth.value.toFixed(2) }} {{ record.paperWidth.unit }}</td>
</tr> </tr>
</tbody> </transition-group>
</v-table> </v-table>
</v-card> </v-card>
</v-col> </v-col>
</v-row> </v-row>
</div> </div>
@ -220,3 +222,22 @@
recordList.value.pop() recordList.value.pop()
} }
</script> </script>
<style scoped>
.table-row-item {
/* ensure rows still render as table rows */
display: table-row;
}
/* enter/leave transitions */
.fade-enter-active,
.fade-leave-active {
transition: all 300ms ease;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
transform: translateY(-10px);
}
</style>

View File

@ -22,6 +22,7 @@ const jinshenLightTheme: ThemeDefinition = {
info: '#2196F3', // Light Blue info: '#2196F3', // Light Blue
success: '#4CAF50', // Green success: '#4CAF50', // Green
warning: '#FB8C00', // Orange warning: '#FB8C00', // Orange
surface: '#FFFFFF', // White
}, },
} }