This commit is contained in:
2020-09-17 18:16:42 +00:00
parent 7a09671bec
commit f41888b88f
4 changed files with 90 additions and 69 deletions

View File

@@ -1,58 +1,73 @@
<template>
<v-row justify="center">
<!-- :max-width="options.width" -->
<v-dialog
scrollable
max-width="600px"
v-model="isVisible"
@keydown.esc="cancel"
:data-cy="!!$ay.dev ? 'reportselector' : false"
>
<v-card elevation="24">
<v-card-title class="headline lighten-2" primary-title>
<span> {{ $ay.t("Report") }} </span>
</v-card-title>
<div>
<v-overlay :value="rendering" z-index="999">
<v-progress-circular indeterminate size="64"></v-progress-circular>
</v-overlay>
<v-row justify="center">
<!-- :max-width="options.width" -->
<v-card-text style="height: 500px;">
<v-list>
<v-list-item
v-for="item in reportList"
:key="item.id"
@click="renderReport(item.id)"
<v-dialog
scrollable
max-width="600px"
v-model="isVisible"
@keydown.esc="cancel"
:data-cy="!!$ay.dev ? 'reportselector' : false"
>
<v-card elevation="24">
<v-card-title class="headline lighten-2" primary-title>
<span> {{ $ay.t("Report") }} </span>
<!-- <template>
<v-progress-linear
indeterminate
color="primary"
rounded
height="6"
:active="rendering"
></v-progress-linear>
</template> -->
</v-card-title>
<v-card-text style="height: 500px;">
<v-list>
<v-list-item
v-for="item in reportList"
:key="item.id"
@click="renderReport(item.id)"
>
<v-list-item-title>{{ item.name }}</v-list-item-title>
<v-list-item-action>
<v-btn icon @click.stop="editReport(item.id)">
<v-icon color="primary">fa-edit</v-icon>
</v-btn>
</v-list-item-action>
</v-list-item>
</v-list>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-btn
v-if="rights.change"
color="primary"
text
@click.native="newReport"
:data-cy="!!$ay.dev ? 'reportselector:ok' : false"
>{{ $ay.t("New") }}</v-btn
>
<v-list-item-title>{{ item.name }}</v-list-item-title>
<v-list-item-action>
<v-btn icon @click.stop="editReport(item.id)">
<v-icon color="primary">fa-edit</v-icon>
</v-btn>
</v-list-item-action>
</v-list-item>
</v-list>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-btn
v-if="rights.change"
color="primary"
text
@click.native="newReport"
:data-cy="!!$ay.dev ? 'reportselector:ok' : false"
>{{ $ay.t("New") }}</v-btn
>
<v-spacer></v-spacer>
<v-btn
color="primary"
text
@click.native="cancel"
:data-cy="!!$ay.dev ? 'reportselector:cancel' : false"
>{{ $ay.t("Cancel") }}</v-btn
>
</v-card-actions>
</v-card>
</v-dialog>
</v-row>
<v-spacer></v-spacer>
<v-btn
color="primary"
text
@click.native="cancel"
:data-cy="!!$ay.dev ? 'reportselector:cancel' : false"
>{{ $ay.t("Cancel") }}</v-btn
>
</v-card-actions>
</v-card>
</v-dialog>
</v-row>
</div>
</template>
<script>
export default {
@@ -67,7 +82,8 @@ export default {
zIndex: 200
},
reportList: [],
selectedReport: null
selectedReport: null,
rendering: false
}),
methods: {
editReport(reportid) {
@@ -94,9 +110,11 @@ export default {
reportDataOptions.ReportId = reportId;
//Meta data from client for use by report script
reportDataOptions.ClientMeta = window.$gz.api.reportClientMetaData();
vm.rendering = true;
let url = "report/render";
let res = await window.$gz.api.upsert(url, reportDataOptions);
let res = await window.$gz.api.upsert(url, reportDataOptions);
vm.rendering = false;
if (res.error) {
this.reject(res);
} else {