导出图片切换名字&生成模板自动已审核
This commit is contained in:
		| @@ -59,7 +59,8 @@ | ||||
|               @click="handleOnResetCurrentDay" | ||||
|               slot="reference" | ||||
|             > | ||||
|               {{ `第${numDay}天` }} | ||||
|               <div class="cus_name_hide" :id="`cus_name_${num}`">{{ name }}</div> | ||||
|               <div>{{ `第${numDay}天` }}</div> | ||||
|             </div> | ||||
|           </el-popover> | ||||
|         </template> | ||||
| @@ -792,4 +793,8 @@ export default { | ||||
|   background: #d66969; | ||||
|   color: blue; | ||||
| } | ||||
|  | ||||
| .cus_name_hide { | ||||
|   display: none; | ||||
| } | ||||
| </style> | ||||
|   | ||||
| @@ -146,6 +146,7 @@ export default { | ||||
|     }, | ||||
|     handleOnSave() { | ||||
|       this.saveRecipes({ | ||||
|         reviewStatus: 3, // 制作中 | ||||
|         callback: (query) => { | ||||
|           // console.log(query); | ||||
|           let path = "/recipes/build/" + query.name + "/" + query.planId; | ||||
| @@ -175,6 +176,7 @@ export default { | ||||
|           this.saveRecipes({ | ||||
|             cusId: 0, | ||||
|             planId, | ||||
|             reviewStatus: 2, // 已审核 | ||||
|             callback: () => { | ||||
|               this.$message.success(`另存为模板「${form.name}」成功`); | ||||
|               this.loading = false; | ||||
| @@ -227,6 +229,12 @@ export default { | ||||
|           this.downloading = false; | ||||
|           return; | ||||
|         } | ||||
|         Array.from({ length: this.recipesData.length }).forEach((_, idx) => { | ||||
|           const tmpElm = document.getElementById(`cus_name_${idx}`); | ||||
|           if (tmpElm) { | ||||
|             tmpElm.classList = []; | ||||
|           } | ||||
|         }); | ||||
|         recipesDom.style.overflow = "visible"; | ||||
|         html2canvans(recipesDom, { | ||||
|           scale: 1.5, | ||||
| @@ -243,6 +251,13 @@ export default { | ||||
|           centerContentDom.style.overflow = "auto"; | ||||
|           recipesDom.style.overflow = "auto"; | ||||
|  | ||||
|           Array.from({ length: this.recipesData.length }).forEach((_, idx) => { | ||||
|             const tmpElm = document.getElementById(`cus_name_${idx}`); | ||||
|             if (tmpElm) { | ||||
|               tmpElm.classList = ["cus_name_hide"]; | ||||
|             } | ||||
|           }); | ||||
|  | ||||
|           this.downloading = false; | ||||
|           this.$message.success("食谱导出成功"); | ||||
|         }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user