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