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

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
+33 -13
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"
@@ -31,9 +31,14 @@
</span>
<span slot="detailText" slot-scope="text,record">
<span class="text" :title="text">
{{text && text.length > 18?text.slice(0,17)+'...':text}}
{{text}}
</span>
</span>
<span slot="detail" slot-scope="text,record">
<span class="textName" :title="text">
{{text}}
</span>
</span>
</a-table>
</div>
<div class="page" v-if="dataSource.length > 0">
@@ -76,9 +81,9 @@
type: Boolean,
default: false
},
type:{
type:String,
default:''
type: {
type: String,
default: ''
}
},
data() {
@@ -112,7 +117,7 @@
})
eventBUs.$on('searchReset', target => {
this.searchParmes = {}
this.selectedRowKeys=[]
this.selectedRowKeys = []
this.getData()
this.getTableList()
})
@@ -150,12 +155,18 @@
dataIndex: res.db_field_name,
align: 'center',
ellipsis: true,
sorter: res.sort
sorter: res.sort,
width: 170
})
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: 'detail'
}
this.columns[index].ellipsis = false
} else {
this.columns[index].scopedSlots = {
customRender: 'detailText'
@@ -190,7 +201,7 @@
let pageSize = JSON.parse(JSON.stringify(this.pageSize))
let params = {
...this.searchParmes,
type:this.type,
type: this.type,
orderBy: this.orderBy,
orderByField: this.orderByField,
pageNo: pageNo + '',
@@ -216,7 +227,7 @@
this.pageSize = pageSize
this.getTableList()
},
onSelectChange(value,rows) {
onSelectChange(value, rows) {
this.selectedRowKeys = value
this.$emit('onSelectChange', value, rows)
},
@@ -233,10 +244,6 @@
.table .ant-table-column-title {
font-weight: bold;
}
.ant-table td {
white-space: nowrap;
}
</style>
<style scoped>
.box {
@@ -253,4 +260,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>
+31 -18
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"
@@ -16,9 +16,10 @@
<a v-for="(ol,index) in OperationList"
@click="OperationClick(ol,record)">
<!-- <span class="text">-->
<!-- {{ol.text}}-->
<!-- </span>-->
<span v-if="ol.text==$t('backDocument')&&record.flag==0" class="text" v-has="'split:sarFileSplitInfo:bind'">
<!-- {{ol.text}}-->
<!-- </span>-->
<span v-if="ol.text==$t('backDocument')&&record.flag==0" class="text"
v-has="'split:sarFileSplitInfo:bind'">
{{ol.text}}
</span>
<span v-if="ol.text==$t('view')" class="text" v-has="'split:sarFileSplitItems:page'">
@@ -35,10 +36,11 @@
</span>
</span>
<span slot="detail" slot-scope="text,record">
<a class="text" :title="text" @click="urlClick(text,record)">
<a class="textName" :title="text" @click="urlClick(text,record)">
{{text}}
</a>
</span>
</a-table>
</div>
<div class="page" v-if="dataSource.length > 0">
@@ -82,8 +84,8 @@
default: false
},
infoId: {
type:String,
default:''
type: String,
default: ''
}
},
data() {
@@ -125,9 +127,9 @@
this.getTableList()
},
methods: {
urlClick(text,record) {
if(record.documentId === null) {
this.$message.warning(this.$t('Correspondingstandarddeleted'))
urlClick(text, record) {
if (record.documentId === null) {
this.$message.warning(this.$t('Correspondingstandarddeleted'))
} else {
let newUrl = this.$router.resolve({
path: '/docManage/library/detail',
@@ -158,19 +160,21 @@
dataIndex: res.db_field_name,
align: 'center',
ellipsis: true,
sorter: res.sort
sorter: res.sort,
width: 170
})
if(res.db_field_name==''){
if (res.db_field_name == '') {
// scope.row.itermsConditions ? scope.row.itermsConditions.replace(/<.*?>/ig, ' ') : ''
}
this.columns[index].scopedSlots = {
customRender: 'detailText'
}
if(res.db_field_txt === "编号" || res.db_field_txt === "标题" ){
if (res.db_field_txt == 'number' || res.db_field_txt == 'Title' || res.db_field_txt == '编号' || res.db_field_txt == '标题') {
this.columns[index].scopedSlots = {
customRender: 'detail'
}
this.columns[index].ellipsis = false
}
})
@@ -204,7 +208,7 @@
...this.searchParmes,
orderBy: this.orderBy,
orderByField: this.orderByField,
infoId:this.infoId,
infoId: this.infoId,
pageNo: pageNo + '',
pageSize: pageSize + ''
}
@@ -254,10 +258,6 @@
.table .ant-table-column-title {
font-weight: bold;
}
.ant-table td {
white-space: nowrap;
}
</style>
<style scoped>
.box {
@@ -274,4 +274,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>