[update] 联调企标的部分导出,解决table中每个columns都设置dataIndex会有横向滚动条的问题

This commit is contained in:
lideqin
2023-09-21 17:02:00 +08:00
parent 0396d2ac40
commit d4c30733c4
6 changed files with 26 additions and 13 deletions
+12 -4
View File
@@ -52,7 +52,7 @@
<!-- 不需要更多按钮 -->
<template v-for="(operation, index) in operSpecialJudge(record)">
<a :key="index" @click="operationClick(operation,record)">{{ operation.text }}</a>
<a-divider :key="index" type="vertical" v-if="index !== operSpecialJudge(record).length - 1"/>
<a-divider type="vertical" v-if="index !== operSpecialJudge(record).length - 1"/>
</template>
</template>
</template>
@@ -80,7 +80,7 @@
<template v-else-if="getLineOperationList(record).length > 0">
<template v-for="(operation, index) in getLineOperationList(record)">
<a :key="index" @click="operationClick(operation,record)">{{ operation.text }}</a>
<a-divider :key="index" type="vertical" v-if="index !== getLineOperationList(record).length - 1"/>
<a-divider type="vertical" v-if="index !== getLineOperationList(record).length - 1"/>
</template>
</template>
</template>
@@ -446,8 +446,7 @@ export default {
col = columns.find(col => getKey(col) === key) || {}
}
// 没有开启拖拽 或 没有宽度 或 有定位,都不能拖拽(防止布局异常,至少有一列不设width并且不能有fixed)
// 或者是最后一列也不能拖拽
if (!col.width || !!col.fixed || col.title === columns[columns.length - 1].title) {
if (!col.width || !!col.fixed) {
return <th {...restProps}>{children}</th>
}
// 开始拖拽监听
@@ -484,6 +483,7 @@ export default {
const onDrag = (x) => {
return x >= (col.minWidth || this.columnMinWidth)
}
// 解决都有dataIndex时会有横向滚动条的问题,让最后一列的拖拽容器宽度为0
return (
<th
{...restProps}
@@ -649,5 +649,13 @@ export default {
touch-action: none;
}
}
// 解决每行都有dataIndex时会有横向滚动条的问题
.resize-table-th:last-child {
border-right: none;
.table-draggable-handle {
width: 0px !important;
min-width: 0px !important;
}
}
}
</style>