Browse Source

调整表格拖动错位

qymljy 3 months ago
parent
commit
13fd05c891
1 changed files with 30 additions and 26 deletions
  1. 30 26
      src/HDrpManagement/orderManage/details/tabs/table.vue

+ 30 - 26
src/HDrpManagement/orderManage/details/tabs/table.vue

@@ -2,7 +2,7 @@
   <div>
     <!-- :header-cell-style="{background:'#EEEEEE',color:'#333'}" -->
     <el-table  ref="table" :fit="tool.calculatedColumnWidth($refs.table,layout)" :row-class-name="tableClassName" highlight-current-row :data="data"  size="mini"  :height="height" @row-click="rowClick" style="width:100%;" :header-cell-style="{height:'40px',color:'#606266',fontWeight:'400',fontSize:'14px'}"
-              :cell-style="{height:'40px',color:'#666666',fontWeight:'400'}" border @selection-change="selectionChange" >
+              :cell-style="{height:'40px',color:'#666666',fontWeight:'400'}" border @selection-change="selectionChange" @header-dragend="headerDragend">
       <el-table-column
           type="selection"
           width="35" fixed v-if="checkbox">
@@ -96,7 +96,11 @@ export default {
     selectionChange(row){
       this.$emit('selectionChange',row)
     },
-
+    headerDragend() {
+      if (this.$refs.table && this.$refs.table.doLayout) {
+        this.$refs.table.doLayout();
+      }
+    },
   },
   mounted () {
   }
@@ -113,28 +117,28 @@ export default {
 }
 </style>
 <style scoped>
-/* 设置滚动条常显示 */
->>>.el-table__body-wrapper {
-  overflow: scroll;
-}
-/* 解决横向滚动条被固定列遮住的问题 */
->>>.el-table__fixed, >>>.el-table__fixed-right {
-  height: calc(100% - 15px) !important;
-}
-/* 解决横向滚动条滑至最右时,列对不齐的问题 */
->>>.el-table__header-wrapper{
-  padding-right: 15px !important;
-}
-/* 解决竖向滚动条被固定列遮住的问题 */
->>>.el-table__fixed-right {
-  right: 15px !important;
-}
-/* 解决竖向滚动条滑至底部时,行对不齐的问题 */
->>>.el-table__fixed-body-wrapper .el-table__body {
-  padding-bottom: 15px;
-}
-/* 解决滑动横向滚动条时,表头最右侧会露出其他列表头的内容,形成的“样式穿透”问题 */
->>>.el-table__fixed-right-patch {
-  width: 15px !important;
-}
+/*!* 设置滚动条常显示 *!*/
+/*>>>.el-table__body-wrapper {*/
+/*  overflow: scroll;*/
+/*}*/
+/*!* 解决横向滚动条被固定列遮住的问题 *!*/
+/*>>>.el-table__fixed, >>>.el-table__fixed-right {*/
+/*  height: calc(100% - 15px) !important;*/
+/*}*/
+/*!* 解决横向滚动条滑至最右时,列对不齐的问题 *!*/
+/*>>>.el-table__header-wrapper{*/
+/*  padding-right: 15px !important;*/
+/*}*/
+/*!* 解决竖向滚动条被固定列遮住的问题 *!*/
+/*>>>.el-table__fixed-right {*/
+/*  right: 15px !important;*/
+/*}*/
+/*!* 解决竖向滚动条滑至底部时,行对不齐的问题 *!*/
+/*>>>.el-table__fixed-body-wrapper .el-table__body {*/
+/*  padding-bottom: 15px;*/
+/*}*/
+/*!* 解决滑动横向滚动条时,表头最右侧会露出其他列表头的内容,形成的“样式穿透”问题 *!*/
+/*>>>.el-table__fixed-right-patch {*/
+/*  width: 15px !important;*/
+/*}*/
 </style>