[update] 解决columns每一个都写dataIndex会有一个横向滚动条的问题

This commit is contained in:
lideqin
2023-09-21 14:56:48 +08:00
parent 4beca1ec6f
commit 02a9f8e792
6 changed files with 16 additions and 44 deletions
+2 -1
View File
@@ -446,7 +446,8 @@ export default {
col = columns.find(col => getKey(col) === key) || {}
}
// 没有开启拖拽 或 没有宽度 或 有定位,都不能拖拽(防止布局异常,至少有一列不设width并且不能有fixed)
if (!col.width || !!col.fixed) {
// 或者是最后一列也不能拖拽
if (!col.width || !!col.fixed || col.title === columns[columns.length - 1].title) {
return <th {...restProps}>{children}</th>
}
// 开始拖拽监听
@@ -53,11 +53,6 @@
</a-button>
<a-button icon="upload" type="primary" ghost v-has="'enterpriseStandardLibrary:publicize:fileExport'"
@click="handleFileExport($t('enterpriseStandardLibrary.publicize.fileExportName'))">{{ $t('exportWithFile') }}</a-button>
<!-- 模板下载-->
<a-button type="primary" icon="download" ghost v-has="'enterpriseStandardLibrary:publicize:templateDownload'"
@click="downTemplate('enterpriseStandardLibrary.publicize.templateName')">
{{ $t('templateDownload') }}
</a-button>
</div>
<div>
@@ -87,15 +82,17 @@
<template v-slot:enterpriseStandardName="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<a class="link-a" @click="handleGoDetail(record)">{{ text }}</a>
<a v-if="text" class="link-a" @click="handleGoDetail(record)">{{ text }}</a>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template>
<!-- 相关材料 -->
<template v-slot:relatedMaterial="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ record.declareFileName || record.declareFileName === 0 ? record.declareFileName : global.emptyLine }}</template>
<a class="link-a" @click="handleRelatedMaterialClick(record)">{{ record.declareFileName }}</a>
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<a v-if="text" class="link-a" @click="handleRelatedMaterialClick(record)">{{ text }}</a>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template>
@@ -176,6 +173,7 @@ export default {
title: this.$t('enterpriseStandardLibrary.publicize.relatedMaterial'),
align: 'center',
width: 180,
dataIndex: 'declareFileName',
scopedSlots: { customRender: 'relatedMaterial' }
}
],
@@ -89,13 +89,6 @@
<div class="table-text">{{ text || text === 0 ? text : global.emptyLine }}</div>
</a-tooltip>
</template>
<!-- 主起草单位 为了去掉横向滚动条 -->
<template slot="mainDraftingUnit" slot-scope="{record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ record.mainDraftingUnit || record.mainDraftingUnit === 0 ? record.mainDraftingUnit : global.emptyLine }}</template>
<div class="table-text">{{ record.mainDraftingUnit || record.mainDraftingUnit === 0 ? record.mainDraftingUnit : global.emptyLine }}</div>
</a-tooltip>
</template>
</j-table>
</div>
@@ -170,7 +163,8 @@ export default {
title: this.$t('enterpriseStandardLibrary.reviewPlan.mainDraftingUnit'),
align: 'center',
width: 180,
scopedSlots: { customRender: 'mainDraftingUnit' }
dataIndex: 'mainDraftingUnit',
scopedSlots: { customRender: 'text' }
}
],
labelCol: {
@@ -36,14 +36,6 @@
</a-tooltip>
</template>
<!--浏览时间单独写出来是解决会有滚动条的问题-->
<template slot="browsingTime" slot-scope="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ record.browsingTime || record.browsingTime === 0 ? record.browsingTime : global.emptyLine }}</template>
<div class="table-text">{{ record.browsingTime || record.browsingTime === 0 ? record.browsingTime : global.emptyLine }}</div>
</a-tooltip>
</template>
</j-table>
</div>
</a-card>
@@ -80,7 +72,8 @@ export default {
title: this.$t('personalCenter.browsingHistory.browsingTime'),
align: 'center',
width: 180,
scopedSlots: { customRender: 'browsingTime' }
dataIndex: 'browsingTime',
scopedSlots: { customRender: 'text' }
}
],
url: {
@@ -59,14 +59,6 @@
</a-tooltip>
</template>
<!-- 接收时间单独写出来是解决会有滚动条的问题 -->
<template slot="receiptTime" slot-scope="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ record.sharingTime || record.sharingTime === 0 ? record.sharingTime : global.emptyLine }}</template>
<div class="table-text">{{ record.sharingTime || record.sharingTime === 0 ? record.sharingTime : global.emptyLine }}</div>
</a-tooltip>
</template>
</j-table>
</div>
</a-card>
@@ -114,7 +106,8 @@ export default {
title: this.$t('personalCenter.receivedShare.receiptTime'),
align: 'center',
width: 180,
scopedSlots: { customRender: 'receiptTime' }
dataIndex: 'sharingTime',
scopedSlots: { customRender: 'text' }
}
],
url: {
@@ -59,14 +59,6 @@
</a-tooltip>
</template>
<!-- 转发时间单独写出来是解决会有滚动条的问题 -->
<template slot="transmitTime" slot-scope="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ record.sharingTime || record.sharingTime === 0 ? record.sharingTime : global.emptyLine }}</template>
<div class="table-text">{{ record.sharingTime || record.sharingTime === 0 ? record.sharingTime : global.emptyLine }}</div>
</a-tooltip>
</template>
</j-table>
</div>
</a-card>
@@ -114,7 +106,8 @@ export default {
title: this.$t('personalCenter.sentShare.transmitTime'),
align: 'center',
width: 180,
scopedSlots: { customRender: 'transmitTime' }
dataIndex: 'sharingTime',
scopedSlots: { customRender: 'text' }
}
],
url: {