refactor: 代码规范
This commit is contained in:
parent
47f0333392
commit
8e95fa87bc
|
@ -49,7 +49,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue