gaoluyang
2025-03-19 f04ad56230f4c4845dbfac3d5eaacb62f851685c
表格封装表头宽度问题
已修改1个文件
27 ■■■■ 文件已修改
src/components/Table/lims-table.vue 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Table/lims-table.vue
@@ -13,6 +13,7 @@
        :filter-method="item.filterHandler" :filter-multiple="item.filterMultiple" :filtered-value="item.filteredValue"
        :filters="item.filters" :fixed="item.fixed" :label="item.label" :prop="item.prop"
        :show-overflow-tooltip="true"
                       min-width="200"
        :sortable="item.sortable ? true : false" :type="item.type" :width="item.dataType == 'action' ? btnWidth : getTitleWidth(item)" align="center">
        <!-- <div class="123" v-if="item.type == ''"> -->
        <template v-if="item.hasOwnProperty('colunmTemplate')" :slot="item.colunmTemplate" slot-scope="scope">
@@ -311,7 +312,7 @@
        const span = document.createElement('span');
        span.innerText = row.label;
        document.body.appendChild(span);
        const width = `${span.offsetWidth + 30}px`;
        const width = `${span.offsetWidth + 50}px`;
        document.body.removeChild(span);
        return width;
@@ -464,28 +465,6 @@
          };
        }
      }
      // // 特殊的合并行
      // if (
      //   this.data.spanConfig != undefined &&
      //   this.data.spanConfig.special &&
      //   this.data.spanConfig.special.main &&
      //   this.data.spanConfig.special.rows &&
      //   this.data.spanConfig.special.rows.length > 0
      // ) {
      //   let i = null;
      //   let obj = this.data.spanConfig.special.rows.find((item, index) => {
      //     i = index;
      //     return item.index == columnIndex;
      //   });
      //   if (obj) {
      //     const _row = this.specialSpanList[i].arr[rowIndex];
      //     const _col = _row > 0 ? 1 : 0;
      //     return {
      //       rowspan: _row,
      //       colspan: _col,
      //     };
      //   }
      // }
    },
  },
};
@@ -501,7 +480,7 @@
  cursor: pointer;
}
>>>.cell {
  padding: 0px !important;
  padding: 0 !important;
}
.cell {
  white-space: nowrap;