|
@@ -8,6 +8,8 @@
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
|
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
|
import {query,add,update,del} from '@/api/printTemplate'
|
|
import {query,add,update,del} from '@/api/printTemplate'
|
|
|
|
+import byMonacoEditor from '@/benyun/components/byMonacoEditor/byMonacoEditor.vue'
|
|
|
|
+
|
|
import {preview} from '@/api/print'
|
|
import {preview} from '@/api/print'
|
|
@Component({components:{}})
|
|
@Component({components:{}})
|
|
export default class PrintTemplate extends Vue {
|
|
export default class PrintTemplate extends Vue {
|
|
@@ -187,7 +189,7 @@ export default class PrintTemplate extends Vue {
|
|
[{
|
|
[{
|
|
label:'模板内容',
|
|
label:'模板内容',
|
|
prop:'templateHtml',
|
|
prop:'templateHtml',
|
|
- component:'byMonacoEditor',
|
|
|
|
|
|
+ component:byMonacoEditor,
|
|
}],
|
|
}],
|
|
[{
|
|
[{
|
|
label:'示例数据',
|
|
label:'示例数据',
|
|
@@ -233,7 +235,13 @@ export default class PrintTemplate extends Vue {
|
|
outType:'PDF'
|
|
outType:'PDF'
|
|
}).then((res:any) => {
|
|
}).then((res:any) => {
|
|
this.load=false;
|
|
this.load=false;
|
|
- (window as any).open(res);
|
|
|
|
|
|
+ const blob = new Blob([res],{
|
|
|
|
+ type: "application/pdf;chartset=UTF-8"
|
|
|
|
+ })
|
|
|
|
+ const qrUrl:any =(window as any).URL.createObjectURL(blob);
|
|
|
|
+ (window as any).open(qrUrl);
|
|
|
|
+ // const myWindow =(window as any).open(qrUrl);
|
|
|
|
+ // myWindow.print();
|
|
|
|
|
|
}).catch((err:any)=>{
|
|
}).catch((err:any)=>{
|
|
this.load=false;
|
|
this.load=false;
|