Browse Source

列表添加右侧操作列

master
安虹睿 1 year ago
parent
commit
a4e35a89bd
  1. 15
      Code/Fe/src/components/tablePagination/index.vue
  2. 37
      Code/Fe/src/components/umyTable/index.vue

15
Code/Fe/src/components/tablePagination/index.vue

@ -53,6 +53,8 @@
@inlineDialog="inlineDialog" @inlineDialog="inlineDialog"
:buttonOperationList_left="buttonOperationList_left" :buttonOperationList_left="buttonOperationList_left"
@buttonOperationClick_left="buttonOperationClick_left" @buttonOperationClick_left="buttonOperationClick_left"
:buttonOperationList_right="buttonOperationList_right"
@buttonOperationClick_right="buttonOperationClick_right"
:tableBorder="true" :tableBorder="true"
:firstFixed="true" :firstFixed="true"
:cellStyle = "cellStyle" :cellStyle = "cellStyle"
@ -115,11 +117,16 @@ export default {
return [] return []
} }
}, },
// // ()
buttonOperationList_left:{ buttonOperationList_left:{
type: Array, type: Array,
default: null, default: null,
}, },
// ()
buttonOperationList_right:{
type: Function,
default: null,
},
// //
tableData: { tableData: {
type: Array, type: Array,
@ -341,10 +348,14 @@ export default {
sortChange (data) { sortChange (data) {
this.$emit('sortChange', data) this.$emit('sortChange', data)
}, },
//table //table()
buttonOperationClick_left(row, index, label) { buttonOperationClick_left(row, index, label) {
this.$emit("buttonOperationClick_left", row, index, label); this.$emit("buttonOperationClick_left", row, index, label);
}, },
//table()
buttonOperationClick_right(row, item, index) {
this.$emit("buttonOperationClick_right", row, item, index);
},
// //
// /showSearchOverall // /showSearchOverall
getShowSearchOverall(val){ getShowSearchOverall(val){

37
Code/Fe/src/components/umyTable/index.vue

@ -19,7 +19,7 @@
header-row-class-name="uTableHeader" header-row-class-name="uTableHeader"
> >
<!-- :tree-props="treeProps" height 不能共存 此组件暂不支持tree的格式--> <!-- :tree-props="treeProps" height 不能共存 此组件暂不支持tree的格式-->
<!-- 操作列 --> <!-- 操作列 左侧-->
<u-table-column <u-table-column
v-if="buttonOperationList_left" v-if="buttonOperationList_left"
:fixed="'left'" :fixed="'left'"
@ -40,6 +40,28 @@
>{{itemButton.label}}</el-button> >{{itemButton.label}}</el-button>
</template> </template>
</u-table-column> </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(scope.row)"
v-show="!itemButton.hide"
:key="indexButton"
type="text"
size="mini"
@click="buttonOperationClick_right(scope.row, itemButton, indexButton)"
>{{itemButton.label}}</el-button>
</template>
</u-table-column>
<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" />
<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">
@ -441,11 +463,16 @@ export default {
}, },
}, },
props: { props: {
// //
buttonOperationList_left:{ buttonOperationList_left:{
type: Array, type: Array,
default: null, default: null,
}, },
// ()
buttonOperationList_right:{
type: Function,
default: null,
},
// //
showOverflowTooltip:{ showOverflowTooltip:{
type: Boolean, type: Boolean,
@ -880,10 +907,14 @@ export default {
buttonClick(row, index, label) { buttonClick(row, index, label) {
this.$emit("buttonClick", row, index, label); this.$emit("buttonClick", row, index, label);
}, },
//table //table()
buttonOperationClick_left(row, item, index) { buttonOperationClick_left(row, item, index) {
this.$emit("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);
},
}, },
}; };
</script> </script>

Loading…
Cancel
Save