This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div v-resize="onResize">
|
||||
{{ formState }}
|
||||
<!-- {{ formState }} -->
|
||||
<v-row>
|
||||
<v-col cols="12" sm="6" class="py-2">
|
||||
<v-btn-toggle
|
||||
@@ -31,8 +31,8 @@
|
||||
Helpers
|
||||
</v-btn>
|
||||
|
||||
<v-btn value="rawData">
|
||||
Data
|
||||
<v-btn value="rawData" v-if="reportData != null">
|
||||
{{ $ay.t("ReportEditorData") }}
|
||||
</v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
@@ -175,9 +175,9 @@ export default {
|
||||
window.$gz.eventBus.$on("menu-click", clickHandler);
|
||||
|
||||
//route params MUST have source data
|
||||
if (!vm.$route.params.reportDataOptions) {
|
||||
throw "ay-report-edit::created - missing reportDataOptions route parameter";
|
||||
}
|
||||
// if (!vm.$route.params.reportDataOptions) {
|
||||
// throw "ay-report-edit::created - missing reportDataOptions route parameter";
|
||||
// }
|
||||
|
||||
//id 0 means create a new record don't load one
|
||||
if (vm.$route.params.recordid != 0) {
|
||||
@@ -216,10 +216,12 @@ export default {
|
||||
"javascript"
|
||||
);
|
||||
|
||||
vm.editData.rawData.model = monaco.editor.createModel(
|
||||
JSON.stringify(vm.reportData, null, "\t"),
|
||||
"json"
|
||||
);
|
||||
if (vm.reportData != null) {
|
||||
vm.editData.rawData.model = monaco.editor.createModel(
|
||||
JSON.stringify(vm.reportData, null, "\t"),
|
||||
"json"
|
||||
);
|
||||
}
|
||||
|
||||
vm.editData.jsHelpers.model = monaco.editor.createModel(
|
||||
vm.obj.jsHelpers,
|
||||
@@ -324,8 +326,8 @@ export default {
|
||||
name: "report",
|
||||
active: true,
|
||||
notes: "",
|
||||
roles: null,
|
||||
objectType: 124927, //all except customers
|
||||
roles: 124927, //all except customers
|
||||
objectType: 0,
|
||||
template: `console.log('hello world');`,
|
||||
style: `.example {
|
||||
color: blue;
|
||||
@@ -717,32 +719,7 @@ async function clickHandler(menuItem) {
|
||||
case "duplicate":
|
||||
m.vm.duplicate();
|
||||
break;
|
||||
case "report":
|
||||
if (m.id != null) {
|
||||
//last report selected
|
||||
m.vm.$router.push({
|
||||
name: "ay-report",
|
||||
params: { recordid: m.id, ayatype: window.$gz.type.Widget }
|
||||
});
|
||||
} else {
|
||||
//general report selector chosen
|
||||
let res = await m.vm.$refs.reportSelector.open();
|
||||
|
||||
//if null for no selection
|
||||
//just bail out
|
||||
if (res == null) {
|
||||
return;
|
||||
}
|
||||
//persist last report selected
|
||||
window.$gz.form.setLastReport(FORM_KEY, res);
|
||||
|
||||
//Now open the report viewer...
|
||||
m.vm.$router.push({
|
||||
name: "ay-report",
|
||||
params: { recordid: res.id, ayatype: window.$gz.type.Widget }
|
||||
});
|
||||
}
|
||||
break;
|
||||
default:
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-warning",
|
||||
@@ -845,6 +822,7 @@ async function fetchTranslatedText(vm) {
|
||||
"ReportDesignReport",
|
||||
"ReportName",
|
||||
"ReportEditorProperties",
|
||||
"ReportEditorData",
|
||||
"ReportNotes",
|
||||
"ReportTemplate",
|
||||
"AuthorizationRoles"
|
||||
@@ -862,7 +840,9 @@ async function fetchReportData(vm) {
|
||||
|
||||
let reportDataOptions = vm.$route.params.reportDataOptions;
|
||||
if (!reportDataOptions) {
|
||||
throw "ay-report-edit:fetchReportData - route parameter reportDataOptions is missing or empty, unable to init report designer";
|
||||
vm.reportData = null;
|
||||
return;
|
||||
// throw "ay-report-edit:fetchReportData - route parameter reportDataOptions is missing or empty, unable to init report designer";
|
||||
}
|
||||
if (reportDataOptions.ObjectType == null) {
|
||||
throw "ay-report-edit:fetchReportData - route parameter ObjectType is missing or empty, unable to init report designer";
|
||||
|
||||
Reference in New Issue
Block a user