Browse Source

表头颜色

wangzhuo 1 năm trước cách đây
mục cha
commit
40f2063d5a

+ 22 - 1
src/views/iosBasicData/blocations/index.vue

@@ -6,6 +6,8 @@
                :data="data"
                :page.sync="page"
                :permission="permissionList"
+               id="out-table"
+               :header-cell-class-name="headerClassName"
                :before-open="beforeOpen"
                v-model="form"
                ref="crud"
@@ -429,12 +431,31 @@
                 this.$message.success("重置成功");
                 this.$refs[ref].$refs.dialogColumn.columnBox = false;
             }
-      }
+      },
+        // 更改表格颜色
+        headerClassName(tab){
+            //颜色间隔
+            let back = ""
+            if (tab.columnIndex >= 0 && tab.column.level === 1) {
+                if (tab.columnIndex % 2 === 0) {
+                    back = "back-one"
+                } else if (tab.columnIndex % 2 === 1) {
+                    back = "back-two"
+                }
+            }
+            return back;
+        },
     }
   };
 </script>
 
 <style lang="scss" scoped>
+::v-deep#out-table .back-one {
+        background: #ecf5ff !important;
+    }
+    ::v-deep#out-table .back-two {
+        background: #ecf5ff !important;
+    }
 
 /deep/ .el-col-md-8 {
   width: 24.33333%;

+ 23 - 1
src/views/iosBasicData/bserviceterms/index.vue

@@ -6,6 +6,8 @@
                :data="data"
                :page.sync="page"
                :permission="permissionList"
+               id="out-table"
+               :header-cell-class-name="headerClassName"
                :before-open="beforeOpen"
                v-model="form"
                ref="crud"
@@ -398,13 +400,33 @@
                 this.$message.success("重置成功");
                 this.$refs[ref].$refs.dialogColumn.columnBox = false;
             }
-      }
+      },
+        // 更改表格颜色
+        headerClassName(tab){
+            //颜色间隔
+            let back = ""
+            if (tab.columnIndex >= 0 && tab.column.level === 1) {
+                if (tab.columnIndex % 2 === 0) {
+                    back = "back-one"
+                } else if (tab.columnIndex % 2 === 1) {
+                    back = "back-two"
+                }
+            }
+            return back;
+        },
     }
   };
 </script>
 
 <style lang="scss" scoped>
 
+::v-deep#out-table .back-one {
+        background: #ecf5ff !important;
+    }
+    ::v-deep#out-table .back-two {
+        background: #ecf5ff !important;
+    }
+
 /deep/ .el-col-md-8 {
   width: 24.33333%;
 }

+ 22 - 1
src/views/iosBasicData/btrademodes/index.vue

@@ -6,6 +6,8 @@
                :data="data"
                :page.sync="page"
                :permission="permissionList"
+               id="out-table"
+               :header-cell-class-name="headerClassName"
                :before-open="beforeOpen"
                v-model="form"
                ref="crud"
@@ -411,12 +413,31 @@
                 this.$message.success("重置成功");
                 this.$refs[ref].$refs.dialogColumn.columnBox = false;
             }
-      }
+      },
+        // 更改表格颜色
+        headerClassName(tab){
+            //颜色间隔
+            let back = ""
+            if (tab.columnIndex >= 0 && tab.column.level === 1) {
+                if (tab.columnIndex % 2 === 0) {
+                    back = "back-one"
+                } else if (tab.columnIndex % 2 === 1) {
+                    back = "back-two"
+                }
+            }
+            return back;
+        },
     }
   };
 </script>
 
 <style lang="scss" scoped>
+::v-deep#out-table .back-one {
+        background: #ecf5ff !important;
+    }
+    ::v-deep#out-table .back-two {
+        background: #ecf5ff !important;
+    }
 
 /deep/ .el-col-md-8 {
   width: 24.33333%;

+ 22 - 1
src/views/iosBasicData/bunits/index.vue

@@ -6,6 +6,8 @@
                :data="data"
                :page.sync="page"
                :permission="permissionList"
+               id="out-table"
+               :header-cell-class-name="headerClassName"
                :before-open="beforeOpen"
                v-model="form"
                ref="crud"
@@ -417,13 +419,32 @@
                 this.$message.success("重置成功");
                 this.$refs[ref].$refs.dialogColumn.columnBox = false;
             }
-      }
+      },
+        // 更改表格颜色
+        headerClassName(tab){
+            //颜色间隔
+            let back = ""
+            if (tab.columnIndex >= 0 && tab.column.level === 1) {
+                if (tab.columnIndex % 2 === 0) {
+                    back = "back-one"
+                } else if (tab.columnIndex % 2 === 1) {
+                    back = "back-two"
+                }
+            }
+            return back;
+        },
     }
   };
 </script>
 
 <style lang="scss" scoped>
 
+::v-deep#out-table .back-one {
+        background: #ecf5ff !important;
+    }
+    ::v-deep#out-table .back-two {
+        background: #ecf5ff !important;
+    }
 /deep/ .el-col-md-8 {
   width: 24.33333%;
 }