This commit is contained in:
@@ -9,6 +9,7 @@ todo: chunk-vendors has fa-brands in it which is fucking huge, what else is in t
|
|||||||
This could be a big breaking change so need to do it carefully and all at once as it's own project
|
This could be a big breaking change so need to do it carefully and all at once as it's own project
|
||||||
Definitely need to do though, it will save a lot of size to just include the actual icons I'm using which is a handful
|
Definitely need to do though, it will save a lot of size to just include the actual icons I'm using which is a handful
|
||||||
|
|
||||||
|
todo: Why is the delete button pushed to be exposed all the time, surely it's not that commonly used?
|
||||||
|
|
||||||
REPORTING
|
REPORTING
|
||||||
|
|
||||||
|
|||||||
@@ -34,18 +34,12 @@
|
|||||||
<v-btn value="rawData" v-if="reportData != null">
|
<v-btn value="rawData" v-if="reportData != null">
|
||||||
{{ $ay.t("ReportEditorData") }}
|
{{ $ay.t("ReportEditorData") }}
|
||||||
</v-btn>
|
</v-btn>
|
||||||
|
|
||||||
<v-btn value="test" v-if="reportData != null">
|
|
||||||
{{ $ay.t("ReportEditorTestRun") }}
|
|
||||||
</v-btn>
|
|
||||||
</v-btn-toggle>
|
</v-btn-toggle>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" v-show="view == 'edit'">
|
<v-col cols="12" v-show="view == 'edit'">
|
||||||
<div id="editContainer"></div>
|
<div id="editContainer"></div>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" v-show="view == 'test'">
|
|
||||||
<div id="testContainer">test</div>
|
|
||||||
</v-col>
|
|
||||||
<v-col cols="12" v-show="view == 'properties'">
|
<v-col cols="12" v-show="view == 'properties'">
|
||||||
<v-form ref="form">
|
<v-form ref="form">
|
||||||
<v-row>
|
<v-row>
|
||||||
@@ -125,6 +119,7 @@
|
|||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import * as monaco from "monaco-editor";
|
import * as monaco from "monaco-editor";
|
||||||
|
|
||||||
//jsreport demo
|
//jsreport demo
|
||||||
//https://playground.jsreport.net/w/admin/hBfqC7af
|
//https://playground.jsreport.net/w/admin/hBfqC7af
|
||||||
//jsreport text editor source
|
//jsreport text editor source
|
||||||
@@ -408,9 +403,6 @@ Handlebars.registerHelper('loud', function (aString) {
|
|||||||
case "properties":
|
case "properties":
|
||||||
//no state to save here
|
//no state to save here
|
||||||
break;
|
break;
|
||||||
case "testrun":
|
|
||||||
//no state to save here
|
|
||||||
break;
|
|
||||||
case "template":
|
case "template":
|
||||||
vm.editData.template.state = currentState;
|
vm.editData.template.state = currentState;
|
||||||
break;
|
break;
|
||||||
@@ -433,11 +425,6 @@ Handlebars.registerHelper('loud', function (aString) {
|
|||||||
case "properties":
|
case "properties":
|
||||||
vm.view = "properties";
|
vm.view = "properties";
|
||||||
break;
|
break;
|
||||||
case "test":
|
|
||||||
//render to the div
|
|
||||||
testRender(vm);
|
|
||||||
vm.view = "test";
|
|
||||||
break;
|
|
||||||
case "template":
|
case "template":
|
||||||
editor.setModel(vm.editData.template.model);
|
editor.setModel(vm.editData.template.model);
|
||||||
editor.restoreViewState(vm.editData.template.state);
|
editor.restoreViewState(vm.editData.template.state);
|
||||||
@@ -672,6 +659,48 @@ Handlebars.registerHelper('loud', function (aString) {
|
|||||||
});
|
});
|
||||||
let url = "report/duplicate/" + vm.$route.params.recordid;
|
let url = "report/duplicate/" + vm.$route.params.recordid;
|
||||||
|
|
||||||
|
try {
|
||||||
|
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
||||||
|
let res = await window.$gz.api.upsert(url);
|
||||||
|
if (res.error) {
|
||||||
|
vm.formState.serverError = res.error;
|
||||||
|
window.$gz.form.setErrorBoxErrors(vm);
|
||||||
|
} else {
|
||||||
|
//Navigate to new record
|
||||||
|
this.$router.push({
|
||||||
|
name: "ay-report-edit",
|
||||||
|
params: {
|
||||||
|
recordid: res.data.id,
|
||||||
|
obj: res.data // Pass data object to new form
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (ex) {
|
||||||
|
window.$gz.errorHandler.handleFormError(ex, vm);
|
||||||
|
} finally {
|
||||||
|
window.$gz.form.setFormState({
|
||||||
|
vm: vm,
|
||||||
|
loading: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async render() {
|
||||||
|
let vm = this;
|
||||||
|
//test open new window for test url
|
||||||
|
window.open("http://localhost:7575/api/v8/report/poc", "_blank");
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
return;
|
||||||
|
if (vm.$route.params.recordid == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.$gz.form.setFormState({
|
||||||
|
vm: vm,
|
||||||
|
loading: true
|
||||||
|
});
|
||||||
|
let url = "report/duplicate/" + vm.$route.params.recordid;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
||||||
let res = await window.$gz.api.upsert(url);
|
let res = await window.$gz.api.upsert(url);
|
||||||
@@ -726,6 +755,9 @@ async function clickHandler(menuItem) {
|
|||||||
case "duplicate":
|
case "duplicate":
|
||||||
m.vm.duplicate();
|
m.vm.duplicate();
|
||||||
break;
|
break;
|
||||||
|
case "report":
|
||||||
|
m.vm.render();
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
window.$gz.eventBus.$emit(
|
window.$gz.eventBus.$emit(
|
||||||
@@ -762,11 +794,19 @@ function generateMenu(vm) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
menuOptions.menuItems.push({
|
||||||
|
title: "Report",
|
||||||
|
icon: "fa-file-alt",
|
||||||
|
key: FORM_KEY + ":report",
|
||||||
|
surface: true,
|
||||||
|
vm: vm
|
||||||
|
});
|
||||||
|
|
||||||
if (vm.rights.delete && vm.$route.params.recordid != 0) {
|
if (vm.rights.delete && vm.$route.params.recordid != 0) {
|
||||||
menuOptions.menuItems.push({
|
menuOptions.menuItems.push({
|
||||||
title: "Delete",
|
title: "Delete",
|
||||||
icon: "fa-trash-alt",
|
icon: "fa-trash-alt",
|
||||||
surface: true,
|
surface: false,
|
||||||
key: FORM_KEY + ":delete",
|
key: FORM_KEY + ":delete",
|
||||||
vm: vm
|
vm: vm
|
||||||
});
|
});
|
||||||
@@ -867,11 +907,4 @@ async function fetchReportData(vm) {
|
|||||||
vm.reportData = res.data;
|
vm.reportData = res.data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
//
|
|
||||||
//
|
|
||||||
async function testRender(vm) {
|
|
||||||
alert("TEST RENDER");
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user