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

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 Long planId;
private int reviewStatus;
private List<SysRecipesDaily> menus; private List<SysRecipesDaily> menus;
} }

View File

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

View File

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

View File

@ -59,7 +59,8 @@
@click="handleOnResetCurrentDay" @click="handleOnResetCurrentDay"
slot="reference" slot="reference"
> >
{{ `${numDay}` }} <div class="cus_name_hide" :id="`cus_name_${num}`">{{ name }}</div>
<div>{{ `${numDay}` }}</div>
</div> </div>
</el-popover> </el-popover>
</template> </template>
@ -792,4 +793,8 @@ export default {
background: #d66969; background: #d66969;
color: blue; color: blue;
} }
.cus_name_hide {
display: none;
}
</style> </style>

View File

@ -146,6 +146,7 @@ export default {
}, },
handleOnSave() { handleOnSave() {
this.saveRecipes({ this.saveRecipes({
reviewStatus: 3, //
callback: (query) => { callback: (query) => {
// console.log(query); // console.log(query);
let path = "/recipes/build/" + query.name + "/" + query.planId; let path = "/recipes/build/" + query.name + "/" + query.planId;
@ -175,6 +176,7 @@ export default {
this.saveRecipes({ this.saveRecipes({
cusId: 0, cusId: 0,
planId, planId,
reviewStatus: 2, //
callback: () => { callback: () => {
this.$message.success(`另存为模板「${form.name}」成功`); this.$message.success(`另存为模板「${form.name}」成功`);
this.loading = false; this.loading = false;
@ -227,6 +229,12 @@ export default {
this.downloading = false; this.downloading = false;
return; return;
} }
Array.from({ length: this.recipesData.length }).forEach((_, idx) => {
const tmpElm = document.getElementById(`cus_name_${idx}`);
if (tmpElm) {
tmpElm.classList = [];
}
});
recipesDom.style.overflow = "visible"; recipesDom.style.overflow = "visible";
html2canvans(recipesDom, { html2canvans(recipesDom, {
scale: 1.5, scale: 1.5,
@ -243,6 +251,13 @@ export default {
centerContentDom.style.overflow = "auto"; centerContentDom.style.overflow = "auto";
recipesDom.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.downloading = false;
this.$message.success("食谱导出成功"); this.$message.success("食谱导出成功");
}); });