【新增】模板接口对接
This commit is contained in:
		| @@ -68,7 +68,7 @@ | ||||
|                 <div>文字素材</div> | ||||
|               </div> | ||||
|               <div class="print-images"> | ||||
|                 <p v-for="(item, index) in 20" @click="addText(`EVATOST CONSULTING LTD CONSULTING CONSULTING CONSULTING CONSULTING`)" :key="index">EVATOST CONSULTING LTD</p> | ||||
|                 <p v-for="(item, index) in 20" @click="addText(`EVATOST CONSULTING LTD CONSULTING CONSULTING CONSULTING CONSULTING`, false)" :key="index">EVATOST CONSULTING LTD</p> | ||||
|               </div> | ||||
|             </el-popover> | ||||
|           </div> | ||||
| @@ -279,6 +279,8 @@ | ||||
|         this.buildLeftElement() | ||||
|         this.buildDesigner() | ||||
|       } | ||||
|  | ||||
|       this.getConfig() | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
| @@ -287,6 +289,12 @@ | ||||
|         this.isShowDynamicForm = true | ||||
|       }, | ||||
|  | ||||
|       getConfig() { | ||||
|         this.$http.post(`/api/material/getPage`).then(res => { | ||||
|  | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       addImage(src) { | ||||
|         this.panel.addPrintImage({ | ||||
|           options: { | ||||
| @@ -303,12 +311,12 @@ | ||||
|         el.design(void 0, designPaper) | ||||
|       }, | ||||
|  | ||||
|       addText(text) { | ||||
|       addText(text, isSetField = true) { | ||||
|         this.panel.addPrintText({ | ||||
|           options: { | ||||
|             field: text || '', | ||||
|             testData: text || '', | ||||
|             title: '', | ||||
|             field: isSetField ? text : '', | ||||
|             testData: isSetField ? text : '', | ||||
|             title: isSetField ? '' : text, | ||||
|             left: 70.5, | ||||
|             top: 58.5, | ||||
|             width: 140, | ||||
| @@ -435,11 +443,26 @@ | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       getHtml() { | ||||
|       save() { | ||||
|         const html = this.elementToString(this.hiprintTemplate.getHtml(this.printData)) | ||||
|         const json = this.hiprintTemplate.getJson() | ||||
|  | ||||
|         return { | ||||
|           html, | ||||
|           json, | ||||
|           params: JSON.stringify(this.dynamicFromList) | ||||
|         } | ||||
|       }, | ||||
|  | ||||
|       preview() { | ||||
|         this.html = this.elementToString(this.hiprintTemplate.getHtml(this.printData)) | ||||
|         this.isShowPreview = true | ||||
|       }, | ||||
|  | ||||
|       getHtml() { | ||||
|         return this.elementToString(this.hiprintTemplate.getHtml(this.printData)) | ||||
|       }, | ||||
|  | ||||
|       clearPaper() { | ||||
|         this.hiprintTemplate.clear() | ||||
|       }, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user