|
|
@ -83,31 +83,36 @@ const TableRow = {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
onRowClick(event) {
|
|
|
|
onRowClick(event, rowPropFunc = noop) {
|
|
|
|
const { record, index } = this;
|
|
|
|
const { record, index } = this;
|
|
|
|
this.__emit('rowClick', record, index, event);
|
|
|
|
this.__emit('rowClick', record, index, event);
|
|
|
|
|
|
|
|
rowPropFunc(event);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
onRowDoubleClick(event) {
|
|
|
|
onRowDoubleClick(event, rowPropFunc = noop) {
|
|
|
|
const { record, index } = this;
|
|
|
|
const { record, index } = this;
|
|
|
|
this.__emit('rowDoubleClick', record, index, event);
|
|
|
|
this.__emit('rowDoubleClick', record, index, event);
|
|
|
|
|
|
|
|
rowPropFunc(event);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
onContextMenu(event) {
|
|
|
|
onContextMenu(event, rowPropFunc = noop) {
|
|
|
|
const { record, index } = this;
|
|
|
|
const { record, index } = this;
|
|
|
|
this.__emit('rowContextmenu', record, index, event);
|
|
|
|
this.__emit('rowContextmenu', record, index, event);
|
|
|
|
|
|
|
|
rowPropFunc(event);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
onMouseEnter(event) {
|
|
|
|
onMouseEnter(event, rowPropFunc = noop) {
|
|
|
|
const { record, index, rowKey } = this;
|
|
|
|
const { record, index, rowKey } = this;
|
|
|
|
this.__emit('hover', true, rowKey);
|
|
|
|
this.__emit('hover', true, rowKey);
|
|
|
|
this.__emit('rowMouseenter', record, index, event);
|
|
|
|
this.__emit('rowMouseenter', record, index, event);
|
|
|
|
|
|
|
|
rowPropFunc(event);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
onMouseLeave(event) {
|
|
|
|
onMouseLeave(event, rowPropFunc = noop) {
|
|
|
|
const { record, index, rowKey } = this;
|
|
|
|
const { record, index, rowKey } = this;
|
|
|
|
this.__emit('hover', false, rowKey);
|
|
|
|
this.__emit('hover', false, rowKey);
|
|
|
|
this.__emit('rowMouseleave', record, index, event);
|
|
|
|
this.__emit('rowMouseleave', record, index, event);
|
|
|
|
|
|
|
|
rowPropFunc(event);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
setExpandedRowHeight() {
|
|
|
|
setExpandedRowHeight() {
|
|
|
@ -241,15 +246,26 @@ const TableRow = {
|
|
|
|
customClassName,
|
|
|
|
customClassName,
|
|
|
|
customClass,
|
|
|
|
customClass,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
const rowPropEvents = rowProps.on || {};
|
|
|
|
const bodyRowProps = mergeProps(
|
|
|
|
const bodyRowProps = mergeProps(
|
|
|
|
{ ...rowProps, style },
|
|
|
|
{ ...rowProps, style },
|
|
|
|
{
|
|
|
|
{
|
|
|
|
on: {
|
|
|
|
on: {
|
|
|
|
click: this.onRowClick,
|
|
|
|
click: e => {
|
|
|
|
dblclick: this.onRowDoubleClick,
|
|
|
|
this.onRowClick(e, rowPropEvents.click);
|
|
|
|
mouseenter: this.onMouseEnter,
|
|
|
|
},
|
|
|
|
mouseleave: this.onMouseLeave,
|
|
|
|
dblclick: e => {
|
|
|
|
contextmenu: this.onContextMenu,
|
|
|
|
this.onRowDoubleClick(e, rowPropEvents.dblclick);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
mouseenter: e => {
|
|
|
|
|
|
|
|
this.onMouseEnter(e, rowPropEvents.mouseenter);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
mouseleave: e => {
|
|
|
|
|
|
|
|
this.onMouseLeave(e, rowPropEvents.mouseleave);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
contextmenu: e => {
|
|
|
|
|
|
|
|
this.onContextMenu(e, rowPropEvents.contextmenu);
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
class: rowClassName,
|
|
|
|
class: rowClassName,
|
|
|
|
},
|
|
|
|
},
|
|
|
|