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> </script>
<style scoped> <style scoped>

View File

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