refactor: 代码规范

This commit is contained in:
shiziyuan9527 2021-04-07 11:27:44 +08:00 committed by BugKing
parent 47f0333392
commit 8e95fa87bc
2 changed files with 7 additions and 7 deletions

View File

@ -49,7 +49,7 @@ export default {
}
}
}
};
</script>
<style scoped>

View File

@ -5,12 +5,12 @@
<el-option v-for="(environment, index) in pe.envs" :key="index"
:label="environment.name + (environment.config.httpConfig.socket ? (': ' + environment.config.httpConfig.protocol + '://' + environment.config.httpConfig.socket) : '')"
:value="environment.id"/>
<el-button class="ms-scenario-button" size="mini" type="primary" @click="openEnvironmentConfig(pe.id, pe['selectEnv'])">
<el-button class="ms-scenario-button" size="mini" type="primary" @click="openEnvironmentConfig(pe.id)">
{{ $t('api_test.environment.environment_config') }}
</el-button>
<template v-slot:empty>
<div class="empty-environment">
<el-button class="ms-scenario-button" size="mini" type="primary" @click="openEnvironmentConfig(pe.id, pe['selectEnv'])">
<el-button class="ms-scenario-button" size="mini" type="primary" @click="openEnvironmentConfig(pe.id)">
{{ $t('api_test.environment.environment_config') }}
</el-button>
</div>
@ -70,7 +70,7 @@ export default {
temp.selectEnv = envs.filter(e => e.id === envId).length === 0 ? null : envId;
});
}
})
});
},
open() {
this.data = [];
@ -82,12 +82,12 @@ export default {
const project = this.projectList.find(p => p.id === id);
return project ? project.name : "";
},
openEnvironmentConfig(projectId, envId) {
openEnvironmentConfig(projectId) {
if (!projectId) {
this.$error(this.$t('api_test.select_project'));
return;
}
this.$refs.environmentConfig.open(projectId, envId);
this.$refs.environmentConfig.open(projectId);
},
handleConfirm() {
let map = new Map();
@ -140,7 +140,7 @@ export default {
// todo
}
}
}
};
</script>
<style scoped>