[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)"> <template v-for="(operation, index) in operSpecialJudge(record)">
<a :key="index" @click="operationClick(operation,record)">{{ operation.text }}</a> <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> </template>
</template> </template>
@@ -80,7 +80,7 @@
<template v-else-if="getLineOperationList(record).length > 0"> <template v-else-if="getLineOperationList(record).length > 0">
<template v-for="(operation, index) in getLineOperationList(record)"> <template v-for="(operation, index) in getLineOperationList(record)">
<a :key="index" @click="operationClick(operation,record)">{{ operation.text }}</a> <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> </template>
</template> </template>
@@ -446,8 +446,7 @@ export default {
col = columns.find(col => getKey(col) === key) || {} col = columns.find(col => getKey(col) === key) || {}
} }
// 没有开启拖拽 或 没有宽度 或 有定位,都不能拖拽(防止布局异常,至少有一列不设width并且不能有fixed) // 没有开启拖拽 或 没有宽度 或 有定位,都不能拖拽(防止布局异常,至少有一列不设width并且不能有fixed)
// 或者是最后一列也不能拖拽 if (!col.width || !!col.fixed) {
if (!col.width || !!col.fixed || col.title === columns[columns.length - 1].title) {
return <th {...restProps}>{children}</th> return <th {...restProps}>{children}</th>
} }
// 开始拖拽监听 // 开始拖拽监听
@@ -484,6 +483,7 @@ export default {
const onDrag = (x) => { const onDrag = (x) => {
return x >= (col.minWidth || this.columnMinWidth) return x >= (col.minWidth || this.columnMinWidth)
} }
// 解决都有dataIndex时会有横向滚动条的问题,让最后一列的拖拽容器宽度为0
return ( return (
<th <th
{...restProps} {...restProps}
@@ -649,5 +649,13 @@ export default {
touch-action: none; touch-action: none;
} }
} }
// 解决每行都有dataIndex时会有横向滚动条的问题
.resize-table-th:last-child {
border-right: none;
.table-draggable-handle {
width: 0px !important;
min-width: 0px !important;
}
}
} }
</style> </style>
@@ -300,7 +300,8 @@ export default {
], ],
url: { url: {
list: '/enterprise/inspect/page', list: '/enterprise/inspect/page',
exportPostponeDataUrl: '', // 导出延期数据 exportXlsUrl: '/enterprise/inspect/exportData',
exportPostponeDataUrl: '/enterprise/inspect/exportDataWithDelay', // 导出延期数据
exportRectificationPlanUrl: '' // 导出整改计划 exportRectificationPlanUrl: '' // 导出整改计划
}, },
operationList: [ operationList: [
@@ -396,7 +396,8 @@ export default {
} }
], ],
url: { url: {
list: '/enterprise/plan/page' list: '/enterprise/plan/page',
exportXlsUrl: '/enterprise/plan/exportData'
} }
} }
}, },
@@ -178,7 +178,8 @@ export default {
} }
], ],
url: { url: {
list: '/enterprise/declare/page' list: '/enterprise/declare/page',
exportXlsUrl: '/enterprise/declare/exportData'
} }
} }
}, },
@@ -53,9 +53,9 @@
<!-- 标题字段 --> <!-- 标题字段 -->
<template v-slot:titleSlot="{text, record}"> <template v-slot:titleSlot="{text, record}">
<a-tooltip overlay-class-name="tooltip-style"> <a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ record.title || record.title === 0 ? record.title : global.emptyLine }}</template> <template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<a v-if="record.title && record.source !== '4'" class="link-a" @click="handleGoDetail(record)">{{ record.title }}</a> <a v-if="text && record.source !== '4'" class="link-a" @click="handleGoDetail(record)">{{ text }}</a>
<div v-else class="table-text">{{ record.title || record.title === 0 ? record.title : global.emptyLine }}</div> <div v-else class="table-text">{{ text || text === 0 ? text : global.emptyLine }}</div>
</a-tooltip> </a-tooltip>
</template> </template>
@@ -93,6 +93,7 @@ export default {
title: this.$t('personalCenter.receivedShare.title'), title: this.$t('personalCenter.receivedShare.title'),
align: 'center', align: 'center',
width: 180, width: 180,
dataIndex: 'rubric',
scopedSlots: { customRender: 'titleSlot' } scopedSlots: { customRender: 'titleSlot' }
}, },
{ {
@@ -53,9 +53,9 @@
<!-- 标题字段 --> <!-- 标题字段 -->
<template v-slot:titleSlot="{text, record}"> <template v-slot:titleSlot="{text, record}">
<a-tooltip overlay-class-name="tooltip-style"> <a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ record.title || record.title === 0 ? record.title : global.emptyLine }}</template> <template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<a v-if="record.title && record.source !== '4'" class="link-a" @click="handleGoDetail(record)">{{ record.title }}</a> <a v-if="text && record.source !== '4'" class="link-a" @click="handleGoDetail(record)">{{ text }}</a>
<div v-else class="table-text">{{ record.title || record.title === 0 ? record.title : global.emptyLine }}</div> <div v-else class="table-text">{{ text || text === 0 ? text : global.emptyLine }}</div>
</a-tooltip> </a-tooltip>
</template> </template>
@@ -93,6 +93,7 @@ export default {
title: this.$t('personalCenter.sentShare.title'), title: this.$t('personalCenter.sentShare.title'),
align: 'center', align: 'center',
width: 180, width: 180,
dataIndex: 'rubric',
scopedSlots: { customRender: 'titleSlot' } scopedSlots: { customRender: 'titleSlot' }
}, },
{ {