PMCORE-3102

This commit is contained in:
Henry Jordan
2021-09-24 17:10:33 +00:00
parent a1ddfe3b4d
commit d7722df0ca
6 changed files with 110 additions and 7 deletions

View File

@@ -2,7 +2,9 @@ import api from "../../api/index";
export default {
data() {
return {
random: 1
random: 1,
idContextMenu: "pm-ad-context-menu",
contextMenuItems: []
};
},
methods: {
@@ -41,6 +43,46 @@ export default {
}
this.columns = cols;
this.random = _.random(0, 10000000000);
},
/**
* Row click event handler
* @param {*} event
*/
configRowClick(event) {
if (event.event.button === 2) {
this.onRowContextMenu(event);
} else {
this.onRowClick(event);
}
},
/**
* Context Menu event handler
* @param {*} event
*/
onRowContextMenu(event) {
this.$refs[this.idContextMenu].showMenu(event.event, event.row);
},
/**
* Row click event handler
* @param {*} event
*/
onRowClick(event) {
var self = this;
self.clickCount += 1;
if (self.clickCount === 1) {
self.singleClickTimer = setTimeout(function () {
self.clickCount = 0;
}, 400);
} else if (self.clickCount === 2) {
clearTimeout(self.singleClickTimer);
self.clickCount = 0;
self.openCaseDetail(event.row);
}
},
/**
* Handler for item context menu clicked
*/
contextMenuItemClicked(event) {
}
}
}