style(接口测试): 接口自动化样式调整

This commit is contained in:
RubyLiu 2023-06-26 19:53:12 +08:00 committed by 刘瑞斌
parent 3ff5c7d548
commit e901a35105
3 changed files with 90 additions and 68 deletions

View File

@ -401,8 +401,6 @@ export default {
} }
.metric-icon-box { .metric-icon-box {
text-align: left;
height: 20px;
margin: 0 10px; margin: 0 10px;
} }

View File

@ -84,8 +84,8 @@
<el-card> <el-card>
<!-- header 调试部分 --> <!-- header 调试部分 -->
<div class="ms-debug-div" @click="showAll" ref="debugHeader"> <div class="ms-debug-div" @click="showAll" ref="debugHeader">
<el-row style="margin: 5px"> <div class="debug-header" style="margin: 5px">
<el-col :span="1" class="ms-col-one ms-font" v-show="scenarioDefinition.length > 1"> <div class="ms-col-one mt-2" v-show="scenarioDefinition.length > 1">
<el-tooltip <el-tooltip
:content="$t('test_track.case.batch_operate')" :content="$t('test_track.case.batch_operate')"
placement="top" placement="top"
@ -105,28 +105,27 @@
v-prevent-re-click v-prevent-re-click
@click="cancelBatchProcessing" /> @click="cancelBatchProcessing" />
</el-tooltip> </el-tooltip>
</el-col> </div>
<el-col :span="2" class="ms-col-one ms-font"> <div class="ms-col-one mt-2">
{{ $t('api_test.automation.step_total') }}{{ scenarioDefinition.length }} <div class="ml-10">{{ $t('api_test.automation.step_total') }}{{ scenarioDefinition.length }}</div>
</el-col> <div class="ml-10">
<el-col :span="2" class="ms-col-one ms-font">
<el-link class="head" @click="showScenarioParameters" <el-link class="head" @click="showScenarioParameters"
>{{ $t('api_test.automation.scenario_total') }} >{{ $t('api_test.automation.scenario_total') }}
</el-link> </el-link>
{{ getVariableSize() }} {{ getVariableSize() }}
</el-col> </div>
<el-col :span="2" class="ms-col-one ms-font"> <div class="ml-10">
<el-checkbox v-model="enableCookieShare"> <el-checkbox v-model="enableCookieShare">
<span style="font-size: 13px">{{ $t('api_test.scenario.share_cookie') }}</span> <span style="font-size: 13px">{{ $t('api_test.scenario.share_cookie') }}</span>
</el-checkbox> </el-checkbox>
</el-col> </div>
<el-col :span="3" class="ms-col-one ms-font"> <div class="ml-10">
<el-checkbox v-model="onSampleError"> <el-checkbox v-model="onSampleError">
<span style="font-size: 13px">{{ $t('commons.failure_continues') }}</span> <span style="font-size: 13px">{{ $t('commons.failure_continues') }}</span>
</el-checkbox> </el-checkbox>
</el-col> </div>
</div>
<el-col :span="13"> <div class="ms-col-one">
<env-popover <env-popover
:env-map="projectEnvMap" :env-map="projectEnvMap"
:project-ids="projectIds" :project-ids="projectIds"
@ -142,8 +141,10 @@
@saveRefresh="setDomain" @saveRefresh="setDomain"
:has-option-group="true" :has-option-group="true"
ref="envPopover" ref="envPopover"
class="ms-message-right" /> class="ml-10"
<el-tooltip v-if="!debugLoading" content="Ctrl + R" placement="top"> />
<el-tooltip class="mt-2 ml-10" v-if="!debugLoading" content="Ctrl + R" placement="top">
<el-dropdown <el-dropdown
split-button split-button
type="primary" type="primary"
@ -152,20 +153,20 @@
size="mini" size="mini"
:disabled="scenarioDefinition.length < 1" :disabled="scenarioDefinition.length < 1"
@command="handleCommand" @command="handleCommand"
v-permission="[ v-permission="['PROJECT_API_SCENARIO:READ+DEBUG', 'PROJECT_API_SCENARIO:READ+RUN']">
'PROJECT_API_SCENARIO:READ+DEBUG',
'PROJECT_API_SCENARIO:READ+RUN'
]">
{{ $t('api_test.request.debug') }} {{ $t('api_test.request.debug') }}
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item>{{ $t('api_test.automation.generate_report') }}</el-dropdown-item> <el-dropdown-item>{{ $t('api_test.automation.generate_report') }}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</el-tooltip> </el-tooltip>
<el-button size="mini" type="primary" v-else @click="stop">{{ $t('report.stop_btn') }}</el-button> <el-button class="mt-2" size="mini" type="primary" v-else @click="stop">{{
$t('report.stop_btn')
}}</el-button>
<el-button <el-button
id="inputDelay" id="inputDelay"
class="ml-10"
type="primary" type="primary"
size="mini" size="mini"
v-prevent-re-click v-prevent-re-click
@ -201,7 +202,6 @@
margin-right: 5px; margin-right: 5px;
cursor: pointer; cursor: pointer;
position: relative; position: relative;
top: 3px;
" "
@click="saveFollow" /> @click="saveFollow" />
</el-tooltip> </el-tooltip>
@ -226,6 +226,7 @@
>{{ $t('operating_log.change_history') }} >{{ $t('operating_log.change_history') }}
</el-link> </el-link>
<!-- 版本历史 --> <!-- 版本历史 -->
<div class="history">
<mx-version-history <mx-version-history
v-xpack v-xpack
ref="versionHistory" ref="versionHistory"
@ -237,15 +238,18 @@
@checkout="checkout" @checkout="checkout"
@create="create" @create="create"
@del="del" /> @del="del" />
</el-col> </div>
</div>
</div>
<div class="ms-full-screen">
<el-tooltip <el-tooltip
effect="dark" effect="dark"
:content="$t('commons.full_screen_editing')" :content="$t('commons.full_screen_editing')"
placement="top-start" placement="top-start"
style="margin-top: 6px"> class="ms-full-screen">
<font-awesome-icon class="alt-ico" :icon="['fa', 'expand-alt']" size="lg" @click="fullScreen" /> <font-awesome-icon class="alt-ico" :icon="['fa', 'expand-alt']" size="lg" @click="fullScreen" />
</el-tooltip> </el-tooltip>
</el-row> </div>
</div> </div>
<div class="card-content"> <div class="card-content">
@ -1114,7 +1118,7 @@ export default {
} }
}, },
evaluationParent(node, status) { evaluationParent(node, status) {
if(node.data.code === "ERROR") { if (node.data.code === 'ERROR') {
return; return;
} }
if (node.data.code === 'FAKE_ERROR') { if (node.data.code === 'FAKE_ERROR') {
@ -1138,7 +1142,7 @@ export default {
let id = item.data.id || item.data.resourceId; let id = item.data.id || item.data.resourceId;
if (id + '_' + item.data.parentIndex === resourceId) { if (id + '_' + item.data.parentIndex === resourceId) {
item.data.testing = false; item.data.testing = false;
item.data.code = status ? "SUCCESS" : "ERROR"; item.data.code = status ? 'SUCCESS' : 'ERROR';
this.evaluationParent(item.parent, status); this.evaluationParent(item.parent, status);
} }
if (item.childNodes && item.childNodes.length > 0) { if (item.childNodes && item.childNodes.length > 0) {
@ -1721,7 +1725,7 @@ export default {
}); });
}, },
runDebug(runScenario) { runDebug(runScenario) {
if (!hasPermissions('PROJECT_API_SCENARIO:READ+DEBUG','PROJECT_API_SCENARIO:READ+RUN')) { if (!hasPermissions('PROJECT_API_SCENARIO:READ+DEBUG', 'PROJECT_API_SCENARIO:READ+RUN')) {
return; return;
} }
this.mergeScenario(this.scenarioDefinition); this.mergeScenario(this.scenarioDefinition);
@ -1964,7 +1968,7 @@ export default {
return new Promise((resolve) => { return new Promise((resolve) => {
const encoder = new TextEncoder(); const encoder = new TextEncoder();
const bytes = encoder.encode(definition, 'utf-8'); const bytes = encoder.encode(definition, 'utf-8');
getApiScenarioEnv(bytes ).then((res) => { getApiScenarioEnv(bytes).then((res) => {
if (res.data && res.data.data) { if (res.data && res.data.data) {
this.projectIds = new Set(res.data.data.projectIds); this.projectIds = new Set(res.data.data.projectIds);
this.projectIds.add(this.projectId); this.projectIds.add(this.projectId);
@ -2624,7 +2628,7 @@ export default {
}; };
</script> </script>
<style scoped> <style lang="scss" scoped>
.card-content { .card-content {
height: calc(100vh - 170px); height: calc(100vh - 170px);
overflow-y: auto; overflow-y: auto;
@ -2635,19 +2639,34 @@ export default {
} }
.ms-debug-div { .ms-debug-div {
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
align-items: center;
border: 1px #dcdfe6 solid; border: 1px #dcdfe6 solid;
border-radius: 4px; border-radius: 4px;
margin-right: 0px; margin-right: 0px;
}
.ms-font { .debug-header {
display: flex;
flex-flow: row nowrap;
align-items: center;
justify-content: space-between;
.ms-col-one {
display: flex;
align-items: center;
color: #303133; color: #303133;
font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', Arial, sans-serif; font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', Arial, sans-serif;
font-size: 13px; font-size: 13px;
} .history {
display: flex;
.ms-col-one { align-items: center;
margin-top: 5px; }
}
}
.ms-full-screen {
margin-top: 0px;
}
} }
#fab { #fab {
@ -2759,11 +2778,15 @@ export default {
height: 20px; height: 20px;
float: right; float: right;
} }
.ml-10 {
.ms-message-right { margin-left: 10px;
margin-right: 10px; }
.ml-5 {
margin-left: 5px;
}
.mt-2 {
margin-top: 2px;
} }
.custom-node_e { .custom-node_e {
color: #7c3985; color: #7c3985;
font-size: 20px; font-size: 20px;

View File

@ -1457,6 +1457,7 @@ export default {
height: 36px; height: 36px;
background-color: #fff; background-color: #fff;
font-size: 12px; font-size: 12px;
padding-left: 5px;
} }
.ms-div { .ms-div {