解决全屏对话框浏览器回退问题
This commit is contained in:
parent
18eee8c2a6
commit
1f84e55ce7
|
@ -130,6 +130,7 @@ public class ProjectService {
|
|||
}
|
||||
|
||||
private void checkProjectExist (Project project) {
|
||||
if (project.getName() != null) {
|
||||
ProjectExample example = new ProjectExample();
|
||||
example.createCriteria()
|
||||
.andNameEqualTo(project.getName())
|
||||
|
@ -139,6 +140,7 @@ public class ProjectService {
|
|||
MSException.throwException(Translator.get("project_name_already_exists"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<Project> listAll() {
|
||||
return projectMapper.selectByExample(null);
|
||||
|
|
|
@ -97,6 +97,7 @@ public class TestCaseService {
|
|||
}
|
||||
|
||||
private void checkTestCaseExist (TestCaseWithBLOBs testCase) {
|
||||
if (testCase.getName() != null) {
|
||||
TestCaseExample example = new TestCaseExample();
|
||||
example.createCriteria()
|
||||
.andNameEqualTo(testCase.getName())
|
||||
|
@ -106,6 +107,7 @@ public class TestCaseService {
|
|||
MSException.throwException(Translator.get("test_case_already_exists"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int deleteTestCase(String testCaseId) {
|
||||
TestPlanTestCaseExample example = new TestPlanTestCaseExample();
|
||||
|
|
|
@ -95,6 +95,7 @@ public class TestPlanService {
|
|||
}
|
||||
|
||||
private void checkTestPlanExist (TestPlan testPlan) {
|
||||
if (testPlan.getName() != null) {
|
||||
TestPlanExample example = new TestPlanExample();
|
||||
example.createCriteria()
|
||||
.andNameEqualTo(testPlan.getName())
|
||||
|
@ -104,6 +105,7 @@ public class TestPlanService {
|
|||
MSException.throwException(Translator.get("plan_name_already_exists"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int deleteTestPlan(String planId) {
|
||||
deleteTestCaseByPlanId(planId);
|
||||
|
|
|
@ -232,11 +232,23 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
handleClose(done) {
|
||||
listenGoBack() {
|
||||
//监听浏览器返回操作,关闭该对话框
|
||||
if (window.history && window.history.pushState) {
|
||||
history.pushState(null, null, document.URL);
|
||||
window.addEventListener('popstate', this.goBack, false);
|
||||
}
|
||||
},
|
||||
goBack() {
|
||||
this.handleClose();
|
||||
},
|
||||
handleClose() {
|
||||
//移除监听,防止监听其他页面
|
||||
window.removeEventListener('popstate', this.goBack, false);
|
||||
this.showDialog = false;
|
||||
},
|
||||
cancel() {
|
||||
this.showDialog = false;
|
||||
this.handleClose();
|
||||
this.$emit('refreshTable');
|
||||
},
|
||||
statusChange(status) {
|
||||
|
@ -299,6 +311,7 @@
|
|||
},
|
||||
openTestCaseEdit(testCase) {
|
||||
this.showDialog = true;
|
||||
this.listenGoBack();
|
||||
this.initData(testCase);
|
||||
},
|
||||
initTest() {
|
||||
|
|
|
@ -91,6 +91,16 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
listenGoBack() {
|
||||
//监听浏览器返回操作,关闭该对话框
|
||||
if (window.history && window.history.pushState) {
|
||||
history.pushState(null, null, document.URL);
|
||||
window.addEventListener('popstate', this.goBack, false);
|
||||
}
|
||||
},
|
||||
goBack() {
|
||||
this.handleClose();
|
||||
},
|
||||
open(id, isReport) {
|
||||
if (isReport) {
|
||||
this.isReport = isReport;
|
||||
|
@ -112,6 +122,7 @@
|
|||
this.initComponents();
|
||||
}
|
||||
this.showDialog = true;
|
||||
this.listenGoBack();
|
||||
},
|
||||
initComponents() {
|
||||
this.componentMap.forEach((value, key) =>{
|
||||
|
@ -134,6 +145,7 @@
|
|||
});
|
||||
},
|
||||
handleClose() {
|
||||
window.removeEventListener('popstate', this.goBack, false);
|
||||
this.showDialog = false;
|
||||
},
|
||||
change(evt) {
|
||||
|
@ -221,7 +233,7 @@
|
|||
}
|
||||
this.$post(url + this.type, param, () =>{
|
||||
this.$success(this.$t('commons.save_success'));
|
||||
this.showDialog = false;
|
||||
this.handleClose();
|
||||
this.$emit('refresh');
|
||||
});
|
||||
},
|
||||
|
|
|
@ -78,12 +78,23 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
listenGoBack() {
|
||||
//监听浏览器返回操作,关闭该对话框
|
||||
if (window.history && window.history.pushState) {
|
||||
history.pushState(null, null, document.URL);
|
||||
window.addEventListener('popstate', this.goBack, false);
|
||||
}
|
||||
},
|
||||
goBack() {
|
||||
this.handleClose();
|
||||
},
|
||||
open(id) {
|
||||
if (id) {
|
||||
this.reportId = id;
|
||||
}
|
||||
this.getReport();
|
||||
this.showDialog = true;
|
||||
this.listenGoBack();
|
||||
},
|
||||
getReport() {
|
||||
this.result = this.$get('/case/report/get/' + this.reportId, response => {
|
||||
|
@ -113,6 +124,7 @@
|
|||
});
|
||||
},
|
||||
handleClose() {
|
||||
window.removeEventListener('popstate', this.goBack, false);
|
||||
this.showDialog = false;
|
||||
},
|
||||
handleEdit() {
|
||||
|
|
Loading…
Reference in New Issue