绿色表示实际值,红色表示预测值
过拟合了好像
// 用户名转成小写对比
handleLowercase(itemUserName, userName) {
let itemName = itemUserName && itemUserName.toLowerCase();
let uName = userName && userName.toLowerCase();
if (itemName === uName) {
return true;
} else {
return false;
}
},
// 关注问题【主动】
focusClick: _.debounce(function () {
window.csdn.report.reportClick({ spm: "3001.5819" });
if (!this.UserName) {
window.csdn.loginBox.show();
return false;
}
let paramsData = {
username: this.UserName,
questionId: this.questionData.id,
status: this.isFocused ? 0 : 1,
};
this.focusAction(paramsData)
.then((res) => {
if (res.code === 200) {
this.$message({
message: this.isFocused ? "问题取消关注成功~" : "问题关注成功~",
type: "success",
offset: 40,
});
this.isFocused = !this.isFocused;
// 关注成功操作触发微信公众号弹出操作
if (this.isFocused) {
setTimeout(() => {
// this.weChatOAShow = true
this.subTitle = "问题有新的动态会在第一时间通知您";
this.footerTips = "";
this.getWeChatImg(5);
}, 1000);
}
this.$forceUpdate();
} else {
this.$message({
message:
res.message ||
(this.isFocused ? "问题取消关注失败~" : "问题关注失败~"),
type: "warning",
offset: 40,
});
}
})
.catch((err) => {
this.$message({
message: err.message || "请求异常~",
type: "warning",
offset: 40,
});
});
}, 1000),