|
|
@ -18,7 +18,13 @@ |
|
|
|
header-row-class-name="uTableHeader" |
|
|
|
> |
|
|
|
<!-- :tree-props="treeProps" 与 “height” 不能共存, 此组件暂不支持tree的格式--> |
|
|
|
<u-table-column v-if="selectionTable" fixed="left" type="selection" :reserve-selection="true" /> |
|
|
|
<u-table-column |
|
|
|
v-if="selectionTable" |
|
|
|
fixed="left" |
|
|
|
type="selection" |
|
|
|
:reserve-selection="true" |
|
|
|
:selectable="selectionHandle" |
|
|
|
/> |
|
|
|
<u-table-column v-if="isShowIndex" type="index" fixed="left" label="序号" width="50" /> |
|
|
|
<template v-for="(item, index) in TableSize"> |
|
|
|
<u-table-column |
|
|
@ -130,7 +136,7 @@ |
|
|
|
<u-table-column |
|
|
|
v-if="buttonOperationList_left" |
|
|
|
:fixed="'left'" |
|
|
|
width="auto" |
|
|
|
:width="operationLeftColumnWidth()" |
|
|
|
min-width="120px" |
|
|
|
:align="'center'" |
|
|
|
:header-align="'center'" |
|
|
@ -144,6 +150,7 @@ |
|
|
|
:key="indexButton" |
|
|
|
type="text" |
|
|
|
size="mini" |
|
|
|
:style="{color:itemButton.color || '#409EFF'}" |
|
|
|
@click="buttonOperationClick_left(scope.row, itemButton, indexButton)" |
|
|
|
>{{itemButton.label}}</el-button> |
|
|
|
</template> |
|
|
@ -250,7 +257,7 @@ export default { |
|
|
|
// table是否有border |
|
|
|
tableBorder: { |
|
|
|
type: Boolean, |
|
|
|
default: false, |
|
|
|
default: true, |
|
|
|
}, |
|
|
|
// 是否为第一个浮动,如果是,则item中的fixed无效(应用场景:主列表,因为用户排序不定元素为第一项) |
|
|
|
firstFixed: { |
|
|
@ -332,6 +339,11 @@ export default { |
|
|
|
default: () => { |
|
|
|
return 280; |
|
|
|
} |
|
|
|
}, |
|
|
|
// 多选列处理 |
|
|
|
selectionColumnHandle:{ |
|
|
|
type: Function, |
|
|
|
default: null |
|
|
|
} |
|
|
|
}, |
|
|
|
data() { |
|
|
@ -398,6 +410,19 @@ export default { |
|
|
|
this.setTableHeightHandle() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 多选列处理 |
|
|
|
selectionHandle(row,index){ |
|
|
|
return this.selectionColumnHandle(row,index) |
|
|
|
}, |
|
|
|
// 清除已选(外部使用,勿删) |
|
|
|
clearTableSelection(){ |
|
|
|
this.$refs.multipleTable.clearSelection(); |
|
|
|
}, |
|
|
|
// 左侧操作列宽度适应 |
|
|
|
operationLeftColumnWidth(){ |
|
|
|
if(this.buttonOperationList_left.length == 1){return 120} |
|
|
|
else{return this.buttonOperationList_left.length * 100} |
|
|
|
}, |
|
|
|
// 重新渲染表格 |
|
|
|
doFreshLayout(){ |
|
|
|
if (this.$refs.multipleTable && this.$refs.multipleTable.doLayout) { |
|
|
@ -414,7 +439,7 @@ export default { |
|
|
|
this.$refs.multipleTable.$forceUpdate() |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 获取表格高度 误删 业务当中有用 |
|
|
|
// 获取表格高度 勿删 业务当中有用 |
|
|
|
getTableHeight(){ |
|
|
|
return this.uTableHeight |
|
|
|
}, |
|
|
|