fix save as image

This commit is contained in:
=
2020-09-21 09:02:02 +02:00
parent 2ec4598482
commit 5951ab295c
3 changed files with 10 additions and 10 deletions
@@ -47,9 +47,8 @@ export default class Gantt extends Vue {
(this.$refs.section3 as any).rowHeight;
}
public print() {
public print(r) {
this.ganttOptions.printing = true;
this.$nextTick(() => {
@@ -61,7 +60,7 @@ export default class Gantt extends Vue {
var svgBlob = new Blob([data], { type: 'image/svg+xml;charset=utf-8' });
// var url = DOMURL.createObjectURL(svgBlob);
recipeService.UploadImage(svgBlob, this.panel.nomeRicetta.replace('.rcp', '') + ".svg");
recipeService.UploadImage(svgBlob, (r || this.panel.nomeRicetta).replace('.rcp', '') + ".svg");
this.ganttOptions.printing = false;
// window.open(url, '_blank')
});
@@ -16,8 +16,8 @@ export default class PrintProcesso extends Vue {
}
mounted() {
messageService.subscribeToChannel("print", () => {
(this.$refs.gantt as any).print();
messageService.subscribeToChannel("print", (r) => {
(this.$refs.gantt as any).print(...r);
})
}
}
@@ -94,6 +94,7 @@ export default class AppHeader extends Vue {
public async showSaveAsModal() {
let result = await ModalHelper.ShowModalAsync(saveAsModal, (this.$store.state as AppModel).prod.panel.nomeRicetta);
await recipeService.SaveAs(result);
messageService.publishToChannel('print', result)
}
public async showChangeNoteModal() {
@@ -131,11 +132,11 @@ export default class AppHeader extends Vue {
async saveRecipe() {
ModalHelper.AskConfirm(this.$options.filters.localize("modal_confirm_title", "Richiesta di conferma"),
this.$options.filters.localize("modal_confirm_save_recipe", "Confermi di voler sovrascrivere la ricetta?"),
async () => {
await recipeService.Save();
messageService.publishToChannel('print')
}, () => void (0))
this.$options.filters.localize("modal_confirm_save_recipe", "Confermi di voler sovrascrivere la ricetta?"),
async () => {
await recipeService.Save();
messageService.publishToChannel('print')
}, () => void (0))
}
}