caichengyu 7 mesiacov pred
rodič
commit
aadc96f5ad

+ 12 - 1
src/views/education/classManageMent/classHoursReview/component/LessonTable.vue

@@ -10,6 +10,7 @@
         padding: '8px',
         color: '#666',
       }"
+        :row-style="setRowStyle"
     >
       <el-table-column label="节/卷" type="expand" width="70px">
         <template slot-scope="scope">
@@ -264,7 +265,7 @@
               </div>
             </div>
           </div>
-          <span v-else> {{ scope2.row[item.prop] }} </span>
+          <span v-else> {{ scope2.row[item.prop] +scope2.row.abnormalSign }} </span>
         </template>
       </el-table-column>
     </el-table>
@@ -400,6 +401,13 @@ export default {
     };
   },
   methods: {
+    setRowStyle({row, rowIndex}) {
+      console.log(row)
+      if (row.abnormalSign==1) { // 例如,根据某条件判断
+        return { backgroundColor: 'rgb(231 60 60)',color:'#ffffff' }; // 自定义背景颜色
+      }
+      return {}; // 默认样式或无样式返回空对象
+    },
     exceed(list) {
       if (list && list.length > 1 && this.erJianErZao) {
         let status = false;
@@ -514,6 +522,9 @@ export default {
 </script>
 
 <style lang="less" scoped>
+.custom-row-class{
+  background-color: rgb(251, 123, 123);
+}
 .exceedStyle {
   background-color: rgb(255, 224, 224);
 }