lilei 2 سال پیش
والد
کامیت
f8908a3ecb
2فایلهای تغییر یافته به همراه4 افزوده شده و 13 حذف شده
  1. 2 12
      src/components/Table/index.js
  2. 2 1
      src/views/expenseManagement/expenseReimbursementDetail/list.vue

+ 2 - 12
src/components/Table/index.js

@@ -349,24 +349,14 @@ export default {
       return {
         // 自定义属性,也就是官方文档中的props,可通过条件来控制样式
         style: {
-          // 设置字体颜色
-          // 'color': record.id === this.leftAlignId ? '#fff' : '',
           //  设置行背景色
-          'background-color': record.id === this.leftAlignId ? '#fff1c5' : ''
-          // 设置字体类型
-          // 'font-family': 'Microsoft YaHei',
-          // // 下划线
-          // 'text-decoration': 'underline',
-          // // 字体样式-斜体
-          // 'font-style': 'italic',
-          // // 字体加粗
-          // 'font-weight': 'bold'
+          'background-color': record[this.rowKeyName] === this.leftAlignId ? '#fff1c5' : ''
         },
         on: {
           // 鼠标单击行
           click: event => {
             // 记录当前点击的行标识
-            this.leftAlignId = record.id
+            this.leftAlignId = record[this.rowKeyName]
           }
         }
       }

+ 2 - 1
src/views/expenseManagement/expenseReimbursementDetail/list.vue

@@ -165,7 +165,8 @@
         ref="table"
         :style="{ height: tableHeight+70+'px' }"
         size="small"
-        :rowKey="(record) => record.id"
+        rowKeyName="no"
+        :rowKey="(record) => record.no"
         :columns="columns"
         :data="loadData"
         :scroll="{ y: tableHeight,x:2250 }"