修复图片导出问题

This commit is contained in:
huangdeliang 2021-08-06 14:52:53 +08:00
parent 34bc27681d
commit 5bbcc13821
2 changed files with 51 additions and 41 deletions

View File

@ -80,7 +80,7 @@ export default {
nutritionistId: null, nutritionistId: null,
remark: null, remark: null,
keyWordArray: null, keyWordArray: null,
keyWord: null keyWord: null,
}, },
// //
rules: { rules: {
@ -96,13 +96,13 @@ export default {
keyOptions: [ keyOptions: [
{ {
dictLabel: "1-7", dictLabel: "1-7",
dictValue: "1-7" dictValue: "1-7",
}, },
{ {
dictLabel: "高血压", dictLabel: "高血压",
dictValue: "高血压" dictValue: "高血压",
} },
] ],
}; };
}, },
computed: { computed: {
@ -120,7 +120,10 @@ export default {
this.reset(); this.reset();
if (data) { if (data) {
this.title = "修改模板"; this.title = "修改模板";
data.keyWordArray = (data.keyWord != null && data.keyWord != "") ? data.keyWord.split(",") : null; data.keyWordArray =
data.keyWord != null && data.keyWord != ""
? data.keyWord.split(",")
: null;
this.form = data; this.form = data;
} else { } else {
this.title = "创建模板"; this.title = "创建模板";
@ -129,8 +132,11 @@ export default {
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid && this.checkFormat(this.form.keyWordArray)) { 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 = this.form.keyWord.replace("",","); 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.$emit("onConfirm", this.form);
this.visible = false; this.visible = false;
} }
@ -145,7 +151,7 @@ export default {
nutritionistId: null, nutritionistId: null,
remark: null, remark: null,
keyWordArray: null, keyWordArray: null,
keyWord: null keyWord: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -157,7 +163,11 @@ export default {
let msg = ""; let msg = "";
if (keyWordArray != null && keyWordArray.length > 0) { if (keyWordArray != null && keyWordArray.length > 0) {
keyWordArray.forEach((item, index) => { keyWordArray.forEach((item, index) => {
if(item.indexOf(",") != -1 || item.indexOf("") != -1 || item.indexOf(" ") != -1){ if (
item.indexOf(",") != -1 ||
item.indexOf("") != -1 ||
item.indexOf(" ") != -1
) {
msg = "关键词中不能含有逗号和空格"; msg = "关键词中不能含有逗号和空格";
flag = false; flag = false;
} }
@ -167,7 +177,7 @@ export default {
this.msgError(msg); this.msgError(msg);
} }
return flag; return flag;
} },
}, },
}; };
</script> </script>

View File

@ -252,7 +252,7 @@ export default {
} }
const tmpNum = document.getElementById(`day_num_${idx}`); const tmpNum = document.getElementById(`day_num_${idx}`);
if (tmpNum) { if (tmpNum) {
tmpNum.innerText = `${startNum + idx}`; tmpNum.innerText = `${parseInt(startNum) + idx}`;
} }
}); });