This commit is contained in:
shiziyuan9527 2021-03-18 10:14:53 +08:00
commit ab9a4f3514
5 changed files with 81 additions and 50 deletions

@ -1 +1 @@
Subproject commit adefde265ff12d4ea909353c3f46008f8a8e17e7 Subproject commit efd6af73b7c5cc53cd4515772000bc1436c49837

View File

@ -1,23 +1,25 @@
<template> <template>
<el-card class="api-component"> <el-card>
<div class="header" @click="active(data)"> <div class="header" @click="active(data)">
<slot name="beforeHeaderLeft"> <slot name="beforeHeaderLeft">
<div v-if="data.index" class="el-step__icon is-text" style="margin-right: 10px;" :style="{'color': color, 'background-color': backgroundColor}"> <div v-if="data.index" class="el-step__icon is-text" style="margin-right: 10px;" :style="{'color': color, 'background-color': backgroundColor}">
<div class="el-step__icon-inner">{{data.index}}</div> <div class="el-step__icon-inner">{{data.index}}</div>
</div> </div>
<el-tag class="ms-left-buttion" size="small" :style="{'color': color, 'background-color': backgroundColor}">{{title}}</el-tag> <el-tag class="ms-left-btn" size="small" :style="{'color': color, 'background-color': backgroundColor}">{{title}}</el-tag>
<el-tag size="mini" v-if="data.method">{{data.method}}</el-tag> <el-tag size="mini" v-if="data.method">{{data.method}}</el-tag>
</slot> </slot>
<span @click.stop> <span>
<slot name="headerLeft"> <slot name="headerLeft">
<i class="icon el-icon-arrow-right" :class="{'is-active': data.active}" <i class="icon el-icon-arrow-right" :class="{'is-active': data.active}"
@click="active(data)" v-if="data.type!='scenario' && !isMax "/> @click="active(data)" v-if="data.type!='scenario' && data.type!='JmeterElement' && !isMax " @click.stop/>
<el-input :draggable="draggable" v-if="isShowInput && isShowNameInput" size="mini" v-model="data.name" class="name-input" <span @click.stop v-if="isShowInput && isShowNameInput">
<el-input :draggable="draggable" size="mini" v-model="data.name" class="name-input"
@blur="isShowInput = false" :placeholder="$t('commons.input_name')" ref="nameEdit" :disabled="data.disabled"/> @blur="isShowInput = false" :placeholder="$t('commons.input_name')" ref="nameEdit" :disabled="data.disabled"/>
<span v-else> </span>
<span :class="isMax?'ms-step-name':'scenario-name'" v-else>
{{data.name}} {{data.name}}
<i class="el-icon-edit" style="cursor:pointer" @click="editName" v-tester v-if="data.referenced!='REF' && !data.disabled"/> <i class="el-icon-edit" style="cursor:pointer" @click="editName" v-tester v-if="data.referenced!='REF' && !data.disabled" @click.stop/>
</span> </span>
</slot> </slot>
<slot name="behindHeaderLeft" v-if="!isMax"></slot> <slot name="behindHeaderLeft" v-if="!isMax"></slot>
@ -159,7 +161,8 @@
margin-right: 5px; margin-right: 5px;
} }
.ms-left-buttion { .ms-left-btn {
font-size: 13px;
margin-right: 15px; margin-right: 15px;
} }
@ -173,15 +176,24 @@
margin-right: 10px; margin-right: 10px;
} }
.node-title { .ms-step-name {
display: inline-block; display: inline-block;
margin: 0px; font-size: 13px;
margin: 0 5px;
overflow-x: hidden; overflow-x: hidden;
padding-bottom: 0; padding-bottom: 0;
text-overflow: ellipsis; text-overflow: ellipsis;
vertical-align: middle; vertical-align: middle;
white-space: nowrap; white-space: nowrap;
width: 100px; width: 180px;
}
.scenario-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 13px;
width: 100%;
} }
/deep/ .el-step__icon { /deep/ .el-step__icon {

View File

@ -5,7 +5,9 @@
<ms-aside-container> <ms-aside-container>
<!-- 场景步骤内容 --> <!-- 场景步骤内容 -->
<div v-loading="loading"> <div v-loading="loading">
<el-tree node-key="resourceId" :props="props" :data="scenarioDefinition" <el-tree node-key="resourceId"
:props="props"
:data="scenarioDefinition"
:default-expanded-keys="expandedNode" :default-expanded-keys="expandedNode"
:expand-on-click-node="false" :expand-on-click-node="false"
highlight-current highlight-current
@ -14,12 +16,21 @@
:allow-drop="allowDrop" @node-drag-end="allowDrag" @node-click="nodeClick" v-if="!loading" draggable> :allow-drop="allowDrop" @node-drag-end="allowDrag" @node-click="nodeClick" v-if="!loading" draggable>
<span class="custom-tree-node father" slot-scope="{ node, data}"> <span class="custom-tree-node father" slot-scope="{ node, data}">
<!-- 步骤组件--> <!-- 步骤组件-->
<ms-component-config :isMax="true" :type="data.type" :scenario="data" :response="response" :currentScenario="currentScenario" <ms-component-config
:currentEnvironmentId="currentEnvironmentId" :node="node" :project-list="projectList" :env-map="projectEnvMap" :isMax="true"
@remove="remove" @copyRow="copyRow" @suggestClick="suggestClick" @refReload="refReload" @openScenario="openScenario"/> :type="data.type"
:scenario="data"
:response="response"
:currentScenario="currentScenario"
:currentEnvironmentId="currentEnvironmentId"
:node="node"
:project-list="projectList"
:env-map="projectEnvMap"
@remove="remove" @copyRow="copyRow"
@suggestClick="suggestClick"
@refReload="refReload" @openScenario="openScenario"/>
</span> </span>
</el-tree> </el-tree>
<div @click="fabClick"> <div @click="fabClick">
<vue-fab id="fab" mainBtnColor="#783887" size="small" :global-options="globalOptions" <vue-fab id="fab" mainBtnColor="#783887" size="small" :global-options="globalOptions"
:click-auto-close="false"> :click-auto-close="false">
@ -41,7 +52,8 @@
<ms-main-container> <ms-main-container>
<!-- 第一层当前节点内容--> <!-- 第一层当前节点内容-->
<ms-component-config :isMax="false" <ms-component-config
:isMax="false"
:showBtn="false" :showBtn="false"
:type="selectedTreeNode.type" :type="selectedTreeNode.type"
:scenario="selectedTreeNode" :scenario="selectedTreeNode"
@ -57,7 +69,8 @@
<!-- 请求下还有的子步骤--> <!-- 请求下还有的子步骤-->
<div v-if="selectedTreeNode && selectedTreeNode.hashTree && showNode(selectedTreeNode)"> <div v-if="selectedTreeNode && selectedTreeNode.hashTree && showNode(selectedTreeNode)">
<div v-for="item in selectedTreeNode.hashTree" :key="item.id" class="ms-col-one"> <div v-for="item in selectedTreeNode.hashTree" :key="item.id" class="ms-col-one">
<ms-component-config :showBtn="false" <ms-component-config
:showBtn="false"
:isMax="false" :isMax="false"
:type="item.type" :type="item.type"
:scenario="item" :scenario="item"
@ -70,10 +83,8 @@
@remove="remove" @copyRow="copyRow" @suggestClick="suggestClick" @remove="remove" @copyRow="copyRow" @suggestClick="suggestClick"
@refReload="refReload" @openScenario="openScenario" @refReload="refReload" @openScenario="openScenario"
v-if="selectedTreeNode && selectedNode"/> v-if="selectedTreeNode && selectedNode"/>
</div> </div>
</div> </div>
</ms-main-container> </ms-main-container>
</ms-container> </ms-container>

View File

@ -43,6 +43,14 @@
position: relative; position: relative;
} }
.scenario-aside {
position: relative;
border-radius: 4px;
border: 1px solid #EBEEF5;
box-sizing: border-box;
}
.hiddenBottom i { .hiddenBottom i {
margin-left: -2px; margin-left: -2px;
} }

@ -1 +1 @@
Subproject commit b2571e06e8b211821409115cc2c4a7c52cbac1db Subproject commit f2781219889c2f993436bcc3ea90038f588fa73e