修复没有清空 vm 导致的上个页面数据带到下个页面的问题
This commit is contained in:
@@ -79,6 +79,20 @@ require(["jquery", "avalon", "editor", "uploader", "bsAlert", "csrfToken", "tagE
|
||||
|
||||
if (avalon.vmodels.addProblem) {
|
||||
var vm = avalon.vmodels.addProblem;
|
||||
vm.title = "";
|
||||
vm.timeLimit = 1000;
|
||||
vm.memoryLimit = 128;
|
||||
vm.samples = [{input: "", output: "", "visible": true}];
|
||||
vm.visible = true;
|
||||
vm.difficulty = "1";
|
||||
vm.tags = [];
|
||||
vm.inputDescription = "";
|
||||
vm.outputDescription = "";
|
||||
vm.testCaseId = "";
|
||||
vm.testCaseList = [];
|
||||
vm.uploadSuccess = false;
|
||||
vm.source = "";
|
||||
vm.uploadProgress = 0;
|
||||
}
|
||||
else
|
||||
var vm = avalon.define({
|
||||
@@ -135,7 +149,7 @@ require(["jquery", "avalon", "editor", "uploader", "bsAlert", "csrfToken", "tagE
|
||||
vm.testCaseId = response.data.test_case_id;
|
||||
vm.uploadSuccess = true;
|
||||
vm.testCaseList = [];
|
||||
for(var key in response.data.file_list){
|
||||
for (var key in response.data.file_list) {
|
||||
vm.testCaseList.push({
|
||||
input: response.data.file_list[key].input_name,
|
||||
output: response.data.file_list[key].output_name
|
||||
|
||||
Reference in New Issue
Block a user