导出图片切换名字&生成模板自动已审核

This commit is contained in:
huangdeliang 2021-04-07 16:57:52 +08:00
parent f2946fea59
commit 73d716126c
5 changed files with 25 additions and 2 deletions

View File

@ -13,5 +13,7 @@ public class SysRecipes {
private Long planId;
private int reviewStatus;
private List<SysRecipesDaily> menus;
}

View File

@ -53,7 +53,7 @@ public class SysRecipesServiceImpl implements ISysRecipesService {
// 更新食谱计划
SysRecipesPlan sysRecipesPlan = new SysRecipesPlan();
sysRecipesPlan.setId(sysRecipes.getPlanId());
sysRecipesPlan.setReviewStatus(3);// 设置制作中
sysRecipesPlan.setReviewStatus(sysRecipes.getReviewStatus());// 设置制作中
sysRecipesPlan.setRecipesId(sysRecipes.getId());
sysRecipesPlanMapper.updateSysRecipesPlan(sysRecipesPlan);
}

View File

@ -311,6 +311,7 @@ const actions = {
const { recipesData, cusId, planId } = state;
const params = {
cusId: payload.cusId !== undefined ? payload.cusId : cusId,
reviewStatus: payload.reviewStatus,
planId: payload.planId || planId,
menus: recipesData.map((menu, idx) => ({
numDay: menu.numDay,

View File

@ -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>

View File

@ -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("食谱导出成功");
});