yuan
5 天以前 9ea5ff67655241271bdf04bb50ca3a8d60c4e22a
src/views/equipmentManagement/spareParts/index.vue
@@ -29,6 +29,7 @@
                  :tableLoading="loading"
                  :page="pagination"
                  :isShowPagination="true"
                  :row-class-name="rowClassName"
                  @pagination="handleSizeChange"
               >
                  <template #status="{ row }">
@@ -95,7 +96,7 @@
        </el-dialog>
      </el-tab-pane>
      <el-tab-pane label="备件领用记录" name="usage">
      <el-tab-pane label="备件使用记录" name="usage">
        <div class="search_form">
          <el-form :inline="true" :model="usageQuery" class="search-form">
            <el-form-item label="备件名称">
@@ -521,9 +522,17 @@
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;
}
@@ -547,8 +556,17 @@
  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;
}
/* 按钮组样式 */
@@ -567,4 +585,5 @@
  font-size: 12px;
  margin-right: 4px;
}
</style>