parent
2b2ebb6823
commit
dac8ef1e48
|
@ -90,6 +90,10 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
registerEvents() {
|
registerEvents() {
|
||||||
ApiEvent.$on(LIST_CHANGE, () => {
|
ApiEvent.$on(LIST_CHANGE, () => {
|
||||||
|
// todo 这里偶尔会有 refs 为空的情况
|
||||||
|
if (!this.$refs.projectRecent) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$refs.projectRecent.recent();
|
this.$refs.projectRecent.recent();
|
||||||
this.$refs.testRecent.recent();
|
this.$refs.testRecent.recent();
|
||||||
this.$refs.reportRecent.recent();
|
this.$refs.reportRecent.recent();
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import MsApiScenarioConfig from "./components/ApiScenarioConfig";
|
import MsApiScenarioConfig from "./components/ApiScenarioConfig";
|
||||||
import {Test, Scenario} from "./model/ScenarioModel"
|
import {Scenario, Test} from "./model/ScenarioModel"
|
||||||
import MsApiReportStatus from "../report/ApiReportStatus";
|
import MsApiReportStatus from "../report/ApiReportStatus";
|
||||||
import MsApiReportDialog from "./ApiReportDialog";
|
import MsApiReportDialog from "./ApiReportDialog";
|
||||||
import {checkoutTestManagerOrTestUser, downloadFile, getUUID} from "@/common/js/utils";
|
import {checkoutTestManagerOrTestUser, downloadFile, getUUID} from "@/common/js/utils";
|
||||||
|
@ -368,11 +368,25 @@ export default {
|
||||||
this.debugReportId = response.data;
|
this.debugReportId = response.data;
|
||||||
this.resetBodyFile();
|
this.resetBodyFile();
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
|
handleEvent(event) {
|
||||||
|
if (event.keyCode === 83 && event.ctrlKey) {
|
||||||
|
console.log('拦截到 ctrl + s');//ctrl+s
|
||||||
|
this.saveTest();
|
||||||
|
event.preventDefault();
|
||||||
|
event.returnValue = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.init();
|
this.init();
|
||||||
|
//
|
||||||
|
document.addEventListener('keydown', this.handleEvent)
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
document.removeEventListener('keydown', this.handleEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -98,6 +98,10 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
registerEvents() {
|
registerEvents() {
|
||||||
PerformanceEvent.$on(LIST_CHANGE, () => {
|
PerformanceEvent.$on(LIST_CHANGE, () => {
|
||||||
|
// todo 这里偶尔会有 refs 为空的情况
|
||||||
|
if (!this.$refs.projectRecent) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$refs.projectRecent.recent();
|
this.$refs.projectRecent.recent();
|
||||||
this.$refs.testRecent.recent();
|
this.$refs.testRecent.recent();
|
||||||
this.$refs.reportRecent.recent();
|
this.$refs.reportRecent.recent();
|
||||||
|
|
|
@ -150,6 +150,10 @@ export default {
|
||||||
},
|
},
|
||||||
registerEvents() {
|
registerEvents() {
|
||||||
TrackEvent.$on(LIST_CHANGE, () => {
|
TrackEvent.$on(LIST_CHANGE, () => {
|
||||||
|
// todo 这里偶尔会有 refs 为空的情况
|
||||||
|
if (!this.$refs.projectRecent) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$refs.projectRecent.recent();
|
this.$refs.projectRecent.recent();
|
||||||
this.$refs.planRecent.recent();
|
this.$refs.planRecent.recent();
|
||||||
this.$refs.caseRecent.recent();
|
this.$refs.caseRecent.recent();
|
||||||
|
|
Loading…
Reference in New Issue