feat(admin): highlight active goods in the list

- Add a done callback to the goods list request
- Highlight rows with status 1 using a green gradient background
- Remove default border for highlighted rows
This commit is contained in:
wolfcode
2025-07-18 15:29:17 +08:00
parent e12dead6c8
commit bfa96c13d4

View File

@@ -81,6 +81,17 @@ define(["jquery", "easy-admin"], function ($, ea) {
'delete']
}
]],
done: (res) => {
// 状态为1的商品背景高亮 展示写法 可根据自己项目自定义
$.each(res.data, function (idx, item) {
if (item.status === 1) {
$(`tr[data-index="${idx}"]`).css({
'background': 'linear-gradient(to left, #77eb7c, #bbffbe, #ffffff, transparent)',
'border': 'none',
})
}
})
}
});
ea.listen();