|
|
@ -19,9 +19,9 @@ |
|
|
|
header-row-class-name="uTableHeader" |
|
|
|
> |
|
|
|
<!-- :tree-props="treeProps" 与 “height” 不能共存, 此组件暂不支持tree的格式--> |
|
|
|
<!-- 操作列 --> |
|
|
|
<!-- 操作列 (左侧)--> |
|
|
|
<u-table-column |
|
|
|
v-if="buttonOperationList" |
|
|
|
v-if="buttonOperationList_left" |
|
|
|
:fixed="'left'" |
|
|
|
:width="120" |
|
|
|
:align="'center'" |
|
|
@ -32,11 +32,32 @@ |
|
|
|
</template> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button |
|
|
|
v-for="(itemButton, indexButton) in buttonOperationList" |
|
|
|
v-for="(itemButton, indexButton) in buttonOperationList_left" |
|
|
|
:key="indexButton" |
|
|
|
type="text" |
|
|
|
size="mini" |
|
|
|
@click="buttonOperationClick(scope.row, itemButton, indexButton)" |
|
|
|
@click="buttonOperationClick_left(scope.row, itemButton, indexButton)" |
|
|
|
>{{itemButton.label}}</el-button> |
|
|
|
</template> |
|
|
|
</u-table-column> |
|
|
|
<!-- 操作列 (右侧)--> |
|
|
|
<u-table-column |
|
|
|
v-if="buttonOperationList_right" |
|
|
|
:fixed="'right'" |
|
|
|
:width="120" |
|
|
|
:align="'center'" |
|
|
|
:header-align="'center'" |
|
|
|
> |
|
|
|
<template #header> |
|
|
|
<span>操作</span> |
|
|
|
</template> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button |
|
|
|
v-for="(itemButton, indexButton) in buttonOperationList_right" |
|
|
|
:key="indexButton" |
|
|
|
type="text" |
|
|
|
size="mini" |
|
|
|
@click="buttonOperationClick_right(scope.row, itemButton, indexButton)" |
|
|
|
>{{itemButton.label}}</el-button> |
|
|
|
</template> |
|
|
|
</u-table-column> |
|
|
@ -442,8 +463,13 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
props: { |
|
|
|
// 操作列按钮 |
|
|
|
buttonOperationList:{ |
|
|
|
// 操作列按钮(左侧) |
|
|
|
buttonOperationList_left:{ |
|
|
|
type: Array, |
|
|
|
default: null, |
|
|
|
}, |
|
|
|
// 操作列按钮(右侧) |
|
|
|
buttonOperationList_right:{ |
|
|
|
type: Array, |
|
|
|
default: null, |
|
|
|
}, |
|
|
@ -881,9 +907,13 @@ export default { |
|
|
|
buttonClick(row, index, label) { |
|
|
|
this.$emit("buttonClick", row, index, label); |
|
|
|
}, |
|
|
|
//点击table操作列按钮 |
|
|
|
buttonOperationClick(row, item, index) { |
|
|
|
this.$emit("buttonOperationClick", row, item, index); |
|
|
|
//点击table操作列(左侧)按钮 |
|
|
|
buttonOperationClick_left(row, item, index) { |
|
|
|
this.$emit("buttonOperationClick_left", row, item, index); |
|
|
|
}, |
|
|
|
//点击table操作列(右侧)按钮 |
|
|
|
buttonOperationClick_right(row, item, index) { |
|
|
|
this.$emit("buttonOperationClick_right", row, item, index); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|