This commit is contained in:
2020-07-01 15:53:31 +00:00
parent b1b9439ca9
commit d149c2b471

View File

@@ -1,22 +1,112 @@
<template>
<div>WHAT IS THIS FOR?</div>
<div>
<gz-data-table
formKey="adm-history"
:dataListKey="dataListKey"
:dataListFilter="dataListFilter"
:dataListSort="dataListSort"
:showSelect="false"
:singleSelect="false"
:reload="reload"
v-on:selection-change="handleSelected"
>
</gz-data-table>
</div>
</template>
<script>
import UnderConstruction from "../components/underconstruction.vue";
//NOTE: I don't recall what this is suppo;sed to be fore, there is already a general History view for viewing object history timelines (event log)
const FORM_KEY = "adm-history";
export default {
components: {
//UnderConstruction
async created() {
this.rights = window.$gz.role.getRights(window.$gz.type.Global);
window.$gz.eventBus.$on("menu-click", clickHandler);
//await fetchTranslatedText(this);
generateMenu(this);
},
beforeCreate() {
window.$gz.eventBus.$emit("menu-change", {
isMain: true,
icon: "fa-history",
title: "History",
helpUrl: "form-adm-history",
hideSearch: true
});
beforeDestroy() {
window.$gz.eventBus.$off("menu-click", clickHandler);
},
data() {
return {
uploadFiles: [],
currentListViewId: 1,
dataListKey: "EventDataList",
dataListFilter: "",
dataListSort: "",
rights: window.$gz.role.defaultRightsObject(),
reload: false,
uploading: false
};
},
methods: {
handleSelected(selectedItems) {
console.log(selectedItems);
}
}
};
/////////////////////////////
//
//
function clickHandler(menuItem) {
if (!menuItem) {
return;
}
let m = window.$gz.menu.parseMenuItem(menuItem);
if (m.owner == FORM_KEY && !m.disabled) {
switch (m.key) {
// case "new":
// m.vm.$router.push({
// name: "adm-translation",
// params: { recordid: 0 }
// });
// break;
default:
window.$gz.eventBus.$emit(
"notify-warning",
FORM_KEY + "::context click: [" + m.key + "]"
);
}
}
}
//////////////////////
//
//
function generateMenu(vm) {
let menuOptions = {
isMain: true,
icon: "fa-history",
title: "History",
helpUrl: "form-adm-history",
hideSearch: true,
menuItems: []
};
// //STUB REPORTS
// //Report not Print, print is a further option
// menuOptions.menuItems.push({
// title: "Report",
// icon: "fa-file-alt",
// key: FORM_KEY + ":report",
// vm: vm
// });
// menuOptions.menuItems.push({
// title: "stub: Last report used",
// icon: "fa-file-alt",
// key: FORM_KEY + ":report:STUBlastusedreportid",
// vm: vm
// });
window.$gz.eventBus.$emit("menu-change", menuOptions);
}
// //////////////////////////////////////////////////////////
// //
// // Ensures UI translated text is available
// //
// async function fetchTranslatedText(vm) {
// await window.$gz.translation.cacheTranslations(["ReadOnly"]);
// }
</script>