|
@@ -60,6 +60,7 @@
|
|
|
v-loading="loading"
|
|
|
:data="dataList"
|
|
|
@selection-change="handleSelectionChange"
|
|
|
+ :row-class-name="tableRowClassName"
|
|
|
>
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column
|
|
@@ -238,6 +239,19 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ //标红table指定行
|
|
|
+ tableRowClassName({ row, rowIndex }) {
|
|
|
+ //判断条件(quantityStock ,warningLimit ,quantityStock 列表字段信息)
|
|
|
+ if (rowIndex === 1) {
|
|
|
+ // 后面的css样式
|
|
|
+ return "warning-row";
|
|
|
+ } else if (rowIndex === 2) {
|
|
|
+ // 后面的css样式
|
|
|
+ return "success-row";
|
|
|
+ }
|
|
|
+
|
|
|
+ return "";
|
|
|
+ },
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selectedRows) {
|
|
|
if (selectedRows.length > 1) {
|
|
@@ -311,5 +325,11 @@ export default {
|
|
|
overflow-y: scroll;
|
|
|
}
|
|
|
}
|
|
|
+ .el-table .success-row {
|
|
|
+ // color: rgb(27, 33, 27) !important;
|
|
|
+ }
|
|
|
+ .el-table .warning-row {
|
|
|
+ color: #f51f1f !important;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|