Browse Source

1、底层组件新增 高亮

41235 1 year ago
parent
commit
c2e261d36d
1 changed files with 27 additions and 1 deletions
  1. 27 1
      src/components/byTable/index.vue

+ 27 - 1
src/components/byTable/index.vue

@@ -106,7 +106,7 @@
       <el-table ref="hocElTable" :data="source" v-if="!hideTable" style="width: 100%" v-bind="$attrs" v-on="tableEvents" row-key="id" :tree-props="{
           children: 'children',
           hasChildren: 'hasChildren',
-        }" :height="tableHeight">
+        }" :height="tableHeight" :row-class-name="updateTableRowClassName">
         <el-table-column v-for="(item, index) in configData" :key="index" v-bind="getAttrsValue(item)" :type="item.type || ''" :selectable="
             (rowData, rowIndex) => isSelectable(rowData, rowIndex, item)
           ">
@@ -482,6 +482,22 @@ export default defineComponent({
     };
     const hocElTable = ref();
 
+    const updateTableRowClassName = (row) =>{
+      let result = "";
+
+      proxy.$emit(
+          "updateTableRowClassName",
+          row,(val) => {
+            console.log(12312,'12312312')
+            result = val;
+          }
+      );
+
+
+      return result;
+    }
+
+
     return {
       configData,
       getParent,
@@ -510,8 +526,10 @@ export default defineComponent({
       isMore,
       changeStatData,
       hocElTable,
+      updateTableRowClassName
     };
   },
+
 });
 </script>
 <style>
@@ -533,6 +551,12 @@ export default defineComponent({
 .el-table .cell {
   line-height: 34px;
 }
+
+
+
+.el-table .error-row {
+  background: rgba(245, 108, 108, 0.68);
+}
 </style>
 <style lang="scss" scoped>
 .sortableActive {
@@ -808,4 +832,6 @@ export default defineComponent({
   color: #000 !important;
   font-size: 14px !important;
 }
+
+
 </style>