修改全局的标题和编号两行展示

This commit is contained in:
qq787203167
2022-06-01 15:17:22 +08:00
parent 10dc66663c
commit 288380a38f
10 changed files with 209 additions and 82 deletions
+31 -10
View File
@@ -6,7 +6,7 @@
rowKey="id"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:pagination="false"
:scroll="{x: true}"
:scroll="{x: '100%'}"
:data-source="dataSource"
:loading="loading"
:columns="columns"
@@ -32,11 +32,16 @@
<span slot="detailClick" slot-scope="text,record">
<a class="text" :title="text" @click="detailClick(record)">{{text}}</a>
</span>
<!-- <span slot="detailText" slot-scope="text,record">-->
<!-- <span class="text" :title="text">-->
<!-- {{text.length > 18?text.slice(0,17)+'...':text}}-->
<!-- </span>-->
<!-- </span>-->
<span slot="detailName" slot-scope="text,record">
<span class="textName" :title="text">
{{text}}
</span>
</span>
<!-- <span slot="detailText" slot-scope="text,record">-->
<!-- <span class="text" :title="text">-->
<!-- {{text.length > 18?text.slice(0,17)+'...':text}}-->
<!-- </span>-->
<!-- </span>-->
</a-table>
</div>
@@ -141,12 +146,18 @@
dataIndex: res.db_field_name,
align: 'center',
ellipsis: true,
width:170,
sorter: res.sort
})
if (res.click) {
this.columns[index].scopedSlots = {
customRender: 'detailClick'
}
} else if (res.db_field_txt == 'number' || res.db_field_txt == 'Title' || res.db_field_txt == '编号' || res.db_field_txt == '标题') {
this.columns[index].scopedSlots = {
customRender: 'detailName'
}
this.columns[index].ellipsis = false
} else {
this.columns[index].scopedSlots = {
customRender: 'detailText'
@@ -210,7 +221,7 @@
this.pageSize = pageSize
this.getTableList()
},
onSelectChange(value,rows) {
onSelectChange(value, rows) {
this.selectedRowKeys = value
this.$emit('onSelectChange', value, rows)
},
@@ -228,9 +239,6 @@
font-weight: bold;
}
.ant-table td {
white-space: nowrap;
}
</style>
<style scoped>
.box {
@@ -247,4 +255,17 @@
text-align: right;
margin-top: 20px;
}
.textName {
width: 100%;
overflow: hidden;
display: -webkit-box;
text-overflow: ellipsis;
/*! autoprefixer: off */
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
/*! autoprefixer: on;*/
text-justify: inter-ideograph;
word-break: break-all
}
</style>