Browse Source

联锁管理列表颜色

yuhan 9 months ago
parent
commit
5026490023
1 changed files with 22 additions and 0 deletions
  1. 22 0
      src/views/module_interLock/InterlockSummary/InterlockSummaryList.vue

+ 22 - 0
src/views/module_interLock/InterlockSummary/InterlockSummaryList.vue

@@ -72,6 +72,7 @@
         :loading="loading"
         :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
         class="j-table-force-nowrap"
+        :customRow="customRow"
         @change="handleTableChange">
 
         <template slot="htmlSlot" slot-scope="text">
@@ -296,6 +297,7 @@
         },
         dictOptions:{},
         superFieldList:[],
+        mouseSummaryid: '',
       }
     },
     created() {
@@ -307,6 +309,26 @@
       },
     },
     methods: {
+      // 合并后悬浮行背景色一起显示
+      customRow(record, index) {
+        return {
+          style: {
+          //样式
+            'background-color': record.summaryid === this.mouseSummaryid ? '#e6faff' : ''
+          },
+          on: {
+            // 鼠标移入
+            mouseenter: event => {
+              // 维护一个变量记录当前行id 因为我是根据id来进行行合并的 
+              this.mouseSummaryid = record.summaryid
+            },
+            //移除 清除id 还原样式
+            mouseleave: (event) => {
+              this.mouseSummaryid = ''
+            }
+          }
+        }
+      },
       // 处理父组件传过来的数据
       getDataList(){
         console.log(111,this.selectData)