diff --git a/stdiet-ui/src/components/TemplateDialog/index.vue b/stdiet-ui/src/components/TemplateDialog/index.vue index 8c700337a..4e918a5a2 100644 --- a/stdiet-ui/src/components/TemplateDialog/index.vue +++ b/stdiet-ui/src/components/TemplateDialog/index.vue @@ -30,26 +30,26 @@ - + - - - - - + + + + { if (valid && this.checkFormat(this.form.keyWordArray)) { - this.form.keyWord = (this.form.keyWordArray != null && this.form.keyWordArray.length > 0) ? this.form.keyWordArray.join(",") : null; - this.form.keyWord = this.form.keyWord.replace(",",","); + this.form.keyWord = + this.form.keyWordArray != null && this.form.keyWordArray.length > 0 + ? this.form.keyWordArray.join(",").replaceAll(",", ",") + : null; + // this.form.keyWord = (this.form.keyWord || "").replace(",", ","); this.$emit("onConfirm", this.form); this.visible = false; } @@ -145,29 +151,33 @@ export default { nutritionistId: null, remark: null, keyWordArray: null, - keyWord: null + keyWord: null, }; this.resetForm("form"); }, cancel() { this.visible = false; }, - checkFormat(keyWordArray){ + checkFormat(keyWordArray) { let flag = true; let msg = ""; - if(keyWordArray != null && keyWordArray.length > 0){ - keyWordArray.forEach((item,index) => { - if(item.indexOf(",") != -1 || item.indexOf(",") != -1 || item.indexOf(" ") != -1){ - msg = "关键词中不能含有逗号和空格"; - flag = false; - } - }); + if (keyWordArray != null && keyWordArray.length > 0) { + keyWordArray.forEach((item, index) => { + if ( + item.indexOf(",") != -1 || + item.indexOf(",") != -1 || + item.indexOf(" ") != -1 + ) { + msg = "关键词中不能含有逗号和空格"; + flag = false; + } + }); } - if(!flag){ - this.msgError(msg); + if (!flag) { + this.msgError(msg); } return flag; - } + }, }, }; diff --git a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesHeaderCom/index.vue b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesHeaderCom/index.vue index 8f713478a..0ff8f9c41 100644 --- a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesHeaderCom/index.vue +++ b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesHeaderCom/index.vue @@ -252,7 +252,7 @@ export default { } const tmpNum = document.getElementById(`day_num_${idx}`); if (tmpNum) { - tmpNum.innerText = `第${startNum + idx}天`; + tmpNum.innerText = `第${parseInt(startNum) + idx}天`; } });