| | |
| | | :tableLoading="loading" |
| | | :page="pagination" |
| | | :isShowPagination="true" |
| | | :row-class-name="rowClassName" |
| | | @pagination="handleSizeChange" |
| | | > |
| | | <template #status="{ row }"> |
| | |
| | | onMounted(() => { |
| | | fetchListData(); |
| | | }); |
| | | |
| | | // 根据数量进行判断背景颜色 |
| | | const rowClassName = ({ row }) => { |
| | | const num = Number(row.quantity); |
| | | if (num <= 1) return 'row-qty-low'; |
| | | if (num >= 8) return 'row-qty-high'; |
| | | return 'row-qty-mid'; |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | <style> |
| | | .spare-part-category { |
| | | padding: 20px; |
| | | } |
| | |
| | | font-weight: 600; |
| | | } |
| | | |
| | | .el-table__row:hover > td { |
| | | background-color: #fafafa; |
| | | .el-table .row-qty-low td.el-table__cell, |
| | | .el-table .row-qty-low:hover > td.el-table__cell { |
| | | background-color: #fde8e8 !important; |
| | | } |
| | | .el-table .row-qty-mid td.el-table__cell, |
| | | .el-table .row-qty-mid:hover > td.el-table__cell { |
| | | background-color: #f0f4f8 !important; |
| | | } |
| | | .el-table .row-qty-high td.el-table__cell, |
| | | .el-table .row-qty-high:hover > td.el-table__cell { |
| | | background-color: #e8f5e9 !important; |
| | | } |
| | | |
| | | /* 按钮组样式 */ |
| | |
| | | font-size: 12px; |
| | | margin-right: 4px; |
| | | } |
| | | |
| | | </style> |