Pārlūkot izejas kodu

系统消息 新增调整 客户管理 选中高亮

LAPTOP-FO2T5SIU\35838 4 mēneši atpakaļ
vecāks
revīzija
848a8c5984

+ 27 - 3
src/views/customerManagement/numberManagement/index.vue

@@ -132,12 +132,12 @@
           ref="multipleTable"
           ref="multipleTable"
           v-loading="loading"
           v-loading="loading"
           :data="AllData"
           :data="AllData"
-          row-class-name="g_table_row"
+          :row-class-name="rowStyle"
           border
           border
           :header-cell-style="{background:'#f2f2f2'}"
           :header-cell-style="{background:'#f2f2f2'}"
           :cell-style="{ textAlign: 'center' }"
           :cell-style="{ textAlign: 'center' }"
-          highlight-current-row
           @selection-change="handleSelectionChange"
           @selection-change="handleSelectionChange"
+          @row-click="handleRowClick"
         >
         >
 
 
           <el-table-column
           <el-table-column
@@ -348,7 +348,8 @@ export default {
             importType: '',
             importType: '',
             importTitle: '',
             importTitle: '',
             uploadTitle: [],
             uploadTitle: [],
-            excelFlag: false
+            excelFlag: false,
+            ids: []
         }
         }
     },
     },
     mounted() {
     mounted() {
@@ -632,6 +633,22 @@ export default {
                 _this.excelFlag = false
                 _this.excelFlag = false
             })
             })
         },
         },
+        handleSelectionChange(val) {
+            this.multipleSelection = val
+            this.ids = val.map(item => item.id)
+        },
+        handleRowClick(row) {
+            this.$refs.multipleTable.toggleRowSelection(row)
+        },
+        // 当前数据行背景样式
+        rowStyle({ row }) {
+            var arr = this.ids
+            for (let i = 0; i < arr.length; i++) {
+                if (row.id === arr[i]) {
+                    return 'rowStyle'
+                }
+            }
+        },
 
 
         baseRequest(opUrl, postData) {
         baseRequest(opUrl, postData) {
             return this.$channel.globeRequest('CustomerManagementController', opUrl, postData, '')
             return this.$channel.globeRequest('CustomerManagementController', opUrl, postData, '')
@@ -708,5 +725,12 @@ export default {
     background-color: #ff4949;
     background-color: #ff4949;
     color: #fff;
     color: #fff;
 }
 }
+::v-deep .rowStyle {
+    background-color: #e8f7fd !important;
+    color: #1890ff;
+}
+::v-deep .el-table tbody tr:hover > td {
+    background-color: #e8f7fd !important;
+}
 
 
 </style>
 </style>

+ 13 - 13
src/views/sysMsg/index.vue

@@ -272,19 +272,19 @@ export default {
                 }).catch(() => {
                 }).catch(() => {
                 })
                 })
             } else {
             } else {
-                this.baseRequest('getByStaging', {}).then((res) => {
-                    if (res.data) {
-                        const { data } = res
-                        _this.form = Object.assign({}, _this.form, res.data)
-                        if (_this.form.annex) { _this.fileList = JSON.parse(_this.form.annex) }
-                    }
-                    if (this.form.id) {
-                        this.isAdd = false
-                    } else {
-                        this.isAdd = true
-                    }
-                }).catch(() => {
-                })
+                // this.baseRequest('getByStaging', {}).then((res) => {
+                //     if (res.data) {
+                //         const { data } = res
+                //         _this.form = Object.assign({}, _this.form, res.data)
+                //         if (_this.form.annex) { _this.fileList = JSON.parse(_this.form.annex) }
+                //     }
+                //     if (this.form.id) {
+                //         this.isAdd = false
+                //     } else {
+                //         this.isAdd = true
+                //     }
+                // }).catch(() => {
+                // })
             }
             }
         },
         },
         /* 删除*/
         /* 删除*/