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">
@blur="isShowInput = false" :placeholder="$t('commons.input_name')" ref="nameEdit" :disabled="data.disabled"/> <el-input :draggable="draggable" size="mini" v-model="data.name" class="name-input"
<span v-else> @blur="isShowInput = false" :placeholder="$t('commons.input_name')" ref="nameEdit" :disabled="data.disabled"/>
</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,21 +5,32 @@
<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
@node-expand="nodeExpand" @node-expand="nodeExpand"
@node-collapse="nodeCollapse" @node-collapse="nodeCollapse"
: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"
</span> :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>
</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,39 +52,39 @@
<ms-main-container> <ms-main-container>
<!-- 第一层当前节点内容--> <!-- 第一层当前节点内容-->
<ms-component-config :isMax="false" <ms-component-config
:showBtn="false" :isMax="false"
:type="selectedTreeNode.type" :showBtn="false"
:scenario="selectedTreeNode" :type="selectedTreeNode.type"
:response="response" :scenario="selectedTreeNode"
:currentScenario="currentScenario" :response="response"
:currentEnvironmentId="currentEnvironmentId" :currentScenario="currentScenario"
:node="selectedNode" :currentEnvironmentId="currentEnvironmentId"
:project-list="projectList" :node="selectedNode"
:env-map="projectEnvMap" :project-list="projectList"
:draggable="false" :env-map="projectEnvMap"
@remove="remove" @copyRow="copyRow" @suggestClick="suggestClick" @refReload="refReload" @openScenario="openScenario" :draggable="false"
v-if="selectedTreeNode && selectedNode"/> @remove="remove" @copyRow="copyRow" @suggestClick="suggestClick" @refReload="refReload" @openScenario="openScenario"
v-if="selectedTreeNode && selectedNode"/>
<!-- 请求下还有的子步骤--> <!-- 请求下还有的子步骤-->
<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
:isMax="false" :showBtn="false"
:type="item.type" :isMax="false"
:scenario="item" :type="item.type"
:response="response" :scenario="item"
:currentScenario="currentScenario" :response="response"
:currentEnvironmentId="currentEnvironmentId" :currentScenario="currentScenario"
:project-list="projectList" :currentEnvironmentId="currentEnvironmentId"
:env-map="projectEnvMap" :project-list="projectList"
:draggable="false" :env-map="projectEnvMap"
@remove="remove" @copyRow="copyRow" @suggestClick="suggestClick" :draggable="false"
@refReload="refReload" @openScenario="openScenario" @remove="remove" @copyRow="copyRow" @suggestClick="suggestClick"
v-if="selectedTreeNode && selectedNode"/> @refReload="refReload" @openScenario="openScenario"
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