update frontend

This commit is contained in:
Himit_ZH 2022-01-17 19:26:00 +08:00
parent c7af23949c
commit e398987f74
1 changed files with 46 additions and 40 deletions

View File

@ -1332,25 +1332,26 @@ export default {
myMessage.error(this.error.tags);
return;
}
let isChangeModeCode =
this.spjRecord.spjLanguage != this.problem.spjLanguage ||
this.spjRecord.spjCode != this.problem.spjCode;
if (this.problem.judgeMode != 'default') {
if (!this.problem.spjCode) {
this.error.spj =
this.$i18n.t('m.Spj_Or_Interactive_Code') +
' ' +
this.$i18n.t('m.is_required');
myMessage.error(this.error.spj);
} else if (!this.problem.spjCompileOk && isChangeModeCode) {
this.error.spj = this.$i18n.t(
'm.Spj_Or_Interactive_Code_not_Compile_Success'
);
}
if (this.error.spj) {
myMessage.error(this.error.spj);
return;
if (!this.problem.isRemote) {
let isChangeModeCode =
this.spjRecord.spjLanguage != this.problem.spjLanguage ||
this.spjRecord.spjCode != this.problem.spjCode;
if (this.problem.judgeMode != 'default') {
if (!this.problem.spjCode) {
this.error.spj =
this.$i18n.t('m.Spj_Or_Interactive_Code') +
' ' +
this.$i18n.t('m.is_required');
myMessage.error(this.error.spj);
} else if (!this.problem.spjCompileOk && isChangeModeCode) {
this.error.spj = this.$i18n.t(
'm.Spj_Or_Interactive_Code_not_Compile_Success'
);
}
if (this.error.spj) {
myMessage.error(this.error.spj);
return;
}
}
}
@ -1414,30 +1415,35 @@ export default {
}
}
let problemDto = {}; //
if (this.problem.judgeMode != 'default') {
if (isChangeModeCode) {
problemDto['changeModeCode'] = true;
if (!this.problem.isRemote) {
let problemDto = {}; //
if (this.problem.judgeMode != 'default') {
if (isChangeModeCode) {
problemDto['changeModeCode'] = true;
}
} else {
// spj
if (!this.spjRecord.spjCode) {
problemDto['changeModeCode'] = true;
this.problem.spjCode = null;
this.problem.spjLanguage = null;
}
}
} else {
// spj
if (!this.spjRecord.spjCode) {
problemDto['changeModeCode'] = true;
this.problem.spjCode = null;
this.problem.spjLanguage = null;
if (this.userExtraFile && Object.keys(this.userExtraFile).length != 0) {
this.problem.userExtraFile = JSON.stringify(this.userExtraFile);
} else {
this.problem.userExtraFile = null;
}
}
if (this.userExtraFile && Object.keys(this.userExtraFile).length != 0) {
this.problem.userExtraFile = JSON.stringify(this.userExtraFile);
} else {
this.problem.userExtraFile = null;
}
if (this.judgeExtraFile && Object.keys(this.judgeExtraFile).length != 0) {
this.problem.judgeExtraFile = JSON.stringify(this.judgeExtraFile);
} else {
this.problem.judgeExtraFile = null;
if (
this.judgeExtraFile &&
Object.keys(this.judgeExtraFile).length != 0
) {
this.problem.judgeExtraFile = JSON.stringify(this.judgeExtraFile);
} else {
this.problem.judgeExtraFile = null;
}
}
problemDto['problem'] = Object.assign({}, this.problem); //