Selaa lähdekoodia

warning list add

zhangjie 5 vuotta sitten
vanhempi
commit
723b8dca19

+ 3 - 0
src/assets/styles/element-ui-costom.scss

@@ -255,6 +255,9 @@
   th {
     border-color: $--color-border-light !important;
   }
+  .el-table__row.row-danger {
+    color: $--color-danger;
+  }
 }
 // el-checkbox
 .el-checkbox {

+ 26 - 17
src/modules/exam-center/views/CardManage.vue

@@ -46,7 +46,13 @@
     </div>
 
     <div class="part-box">
-      <el-table ref="TableList" :data="cards" border stripe>
+      <el-table
+        ref="TableList"
+        :data="cards"
+        :row-class-name="tableRowClassName"
+        border
+        stripe
+      >
         <el-table-column prop="cardCode" label="题卡ID"></el-table-column>
         <el-table-column label="科目(编码)">
           <template slot-scope="scope">
@@ -75,22 +81,22 @@
         ></el-table-column>
         <el-table-column label="操作" align="center" width="120">
           <template slot-scope="scope">
-            <div v-if="scope.row.cardStatus === 0">
-              <el-button
-                class="btn-table-icon"
-                type="text"
-                icon="icon icon-edit"
-                @click="toEdit(scope.row)"
-                title="编辑"
-              ></el-button>
-              <el-button
-                class="btn-table-icon"
-                type="text"
-                icon="icon icon-delete"
-                @click="toDelete(scope.row)"
-                title="删除"
-              ></el-button>
-            </div>
+            <el-button
+              class="btn-table-icon"
+              type="text"
+              icon="icon icon-edit"
+              @click="toEdit(scope.row)"
+              title="编辑"
+              v-if="scope.row.cardStatus === 0"
+            ></el-button>
+            <el-button
+              class="btn-table-icon"
+              type="text"
+              icon="icon icon-delete"
+              @click="toDelete(scope.row)"
+              title="删除"
+              v-if="scope.row.cardStatus === 0"
+            ></el-button>
             <el-button
               class="btn-table-icon"
               type="text"
@@ -168,6 +174,9 @@ export default {
       this.current = page;
       this.getList();
     },
+    tableRowClassName({ row }) {
+      return row.warning ? "row-danger" : "";
+    },
     toAdd() {
       this.$refs.CardOptionDialog.open();
     },

+ 10 - 1
src/modules/exam-center/views/WaitTask.vue

@@ -26,7 +26,13 @@
     </div>
 
     <div class="part-box">
-      <el-table ref="TableList" :data="tasks" border stripe>
+      <el-table
+        ref="TableList"
+        :data="tasks"
+        :row-class-name="tableRowClassName"
+        border
+        stripe
+      >
         <el-table-column prop="examCode" label="考试ID"></el-table-column>
         <el-table-column prop="examName" label="考试名称"></el-table-column>
         <el-table-column prop="courseNameCode" label="科目名称(编码)">
@@ -113,6 +119,9 @@ export default {
         };
       });
     },
+    tableRowClassName({ row }) {
+      return row.warning ? "row-danger" : "";
+    },
     toDetail(row) {
       this.$router.push({
         name: "WaitTaskDetail",