This commit is contained in:
unknown 2023-11-11 10:10:34 +08:00
commit 9c4e681157
3 changed files with 7 additions and 8 deletions

View File

@ -783,9 +783,9 @@ export default {
clgl_wdyml: this.ruleForm1.clgl_wdyml, clgl_wdyml: this.ruleForm1.clgl_wdyml,
}; };
// //
var json = JSON.parse(sessionStorage.getItem("GYWZ_yx")); var json = JSON.parse(sessionStorage.getItem(this.$store.state.type));
let { data } = await SaveUserAnswer({ let { data } = await SaveUserAnswer({
mark: "GYWZ_yx", mark:this.$store.state.type,
user_id: "USER202307301109254198", user_id: "USER202307301109254198",
mark_value: JSON.stringify({ ...json, ...obj }), mark_value: JSON.stringify({ ...json, ...obj }),
}); });

View File

@ -955,6 +955,8 @@ export default {
type: "success", type: "success",
}); });
this.dialogVisible1 = false; this.dialogVisible1 = false;
} else {
this.$message.error("操作失败");
} }
}, },
// //

View File

@ -221,26 +221,23 @@ export default {
this.ruleForm.dkpz_snckxtb = Boolean(obj.dkpz_snckxtb); this.ruleForm.dkpz_snckxtb = Boolean(obj.dkpz_snckxtb);
} }
}, },
savePort() { async savePort() {
this.ruleForm.dkpz_snckxtb = String(Number(this.ruleForm.dkpz_snckxtb)); this.ruleForm.dkpz_snckxtb = String(Number(this.ruleForm.dkpz_snckxtb));
let datas = localStorage.getItem("CKFWQ_yx"); let datas = localStorage.getItem("CKFWQ_yx");
datas = { ...JSON.parse(datas), ...this.ruleForm }; datas = { ...JSON.parse(datas), ...this.ruleForm };
SaveUserAnswer({ let { data } = await SaveUserAnswer({
mark: "CKFWQ_yx", mark: "CKFWQ_yx",
user_id: `${this.user_id}`, user_id: `${this.user_id}`,
mark_value: JSON.stringify(datas), mark_value: JSON.stringify(datas),
}).then((res) => {
console.log(res);
}); });
if (data.state) { if (data.state) {
localStorage.setItem("CKFWQ_yx", JSON.stringify(datas)); localStorage.setItem("CKFWQ_yx", JSON.stringify(datas));
this.$message({ this.$message({
message: "保存成功", message: "保存成功",
type: "success", type: "success",
}); });
} else { } else {
this.$message.error("错了哦,这是一条错误消息"); this.$message.error("保存失败");
} }
}, },
submitForm(formName) { submitForm(formName) {