修改列表的操作按钮
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
</a>
|
||||
</span>
|
||||
<span slot="detailClick" slot-scope="text,record">
|
||||
<a class="text" @click="detailClick(record)">{{text}}</a>
|
||||
<a class="text" :title="text" @click="detailClick(record)">{{text}}</a>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
@@ -110,6 +110,14 @@
|
||||
this.getTableList()
|
||||
},
|
||||
methods: {
|
||||
|
||||
getTextWith(text, fontStyle) {
|
||||
var canvas = document.createElement('canvas')
|
||||
var context = canvas.getContext('2d')
|
||||
context.font = fontStyle || '14px' // 设置字体样式
|
||||
var dimension = context.measureText(text)
|
||||
return dimension.width + 40
|
||||
},
|
||||
getData() {
|
||||
let params = {
|
||||
flag: this.flag
|
||||
@@ -134,10 +142,12 @@
|
||||
})
|
||||
let width = 0
|
||||
if (this.OperationList.length > 0) {
|
||||
this.OperationList.forEach((res) => {
|
||||
width += res.text.length * 5 + width
|
||||
})
|
||||
for (let i = 0; i < this.OperationList.length; i++) {
|
||||
console.log(width)
|
||||
width += this.getTextWith(this.OperationList[i].text)
|
||||
}
|
||||
}
|
||||
console.log(width)
|
||||
if (this.showAction) {
|
||||
this.columns.push({
|
||||
title: this.$t('operation'),
|
||||
@@ -171,7 +181,7 @@
|
||||
this.dataSource = res.result.records
|
||||
this.total = res.result.total
|
||||
this.loading = false
|
||||
}else{
|
||||
} else {
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
@@ -192,7 +202,7 @@
|
||||
this.$emit(ol.ClickEvent, item)
|
||||
},
|
||||
detailClick(item, index) {
|
||||
this.$emit('detailClick',item)
|
||||
this.$emit('detailClick', item)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
{
|
||||
text: '删除',
|
||||
ClickEvent: 'deleteTable'
|
||||
}
|
||||
},
|
||||
],
|
||||
selectedRowKeys: [],
|
||||
loading: false,
|
||||
|
||||
Reference in New Issue
Block a user