fix(测试跟踪): 用例编辑步骤按钮修改

This commit is contained in:
song-cc-rock 2023-04-21 17:41:33 +08:00 committed by jianxing
parent efebac1430
commit b63af54422
4 changed files with 10 additions and 75 deletions

View File

@ -4,6 +4,7 @@ import test_track from "./track/en-US";
const message = {
commons: {
insert: "Insert",
pre_page: "Pre page",
next_page: "Next page",
already_pre_page: "It's already page one",

View File

@ -4,6 +4,7 @@ import test_track from "./track/zh-CN";
const message = {
commons: {
insert: "插入",
pre_page: "上一页",
next_page: "下一页",
already_pre_page: "已经是第一页",

View File

@ -4,6 +4,7 @@ import test_track from "./track/zh-TW";
const message = {
commons: {
insert: "插入",
pre_page: "上一頁",
next_page: "下一頁",
already_pre_page: "已經是第一頁",

View File

@ -54,67 +54,14 @@
/>
</template>
</el-table-column>
<el-table-column :label="$t('commons.operating')" min-width="8%">
<el-table-column :label="$t('commons.operating')" min-width="12%">
<template v-slot:default="scope">
<el-popover
placement="bottom-start"
trigger="hover"
popper-class="case-step-item-popover"
:visible-arrow="false"
>
<div class="opt-row">
<div
class="add-row sub-opt-row"
:class="{'disable-row' : readOnly}"
@click="handleAddStep(scope.$index, scope.row)"
>
<div class="icon">
<i class="el-icon-plus"></i>
</div>
<div class="title">{{ $t("case.insert_steps") }}</div>
</div>
<div class="split"></div>
<div
class="copy-row sub-opt-row"
:class="{'disable-row' : readOnly}"
@click="handleCopyStep(scope.$index, scope.row)"
>
<div class="icon">
<i class="el-icon-copy-document"></i>
</div>
<div class="title">{{ $t("case.copy_this_step") }}</div>
</div>
<div class="split"></div>
<div
class="delete-row sub-opt-row"
@click="handleDeleteStep(scope.$index, scope.row)"
:class="
readOnly || (scope.$index == 0 && form.steps.length <= 1)
? 'opt-readonly disable-row'
: ''
"
>
<div class="icon">
<i class="el-icon-delete"></i>
</div>
<div class="title">{{ $t("commons.delete") }}</div>
</div>
</div>
<i slot="reference" class="el-icon-more"></i>
</el-popover>
<el-link type="primary" :disabled="readOnly" class="opt-item" :underline="false" @click="handleAddStep(scope.$index, scope.row)">{{ $t("commons.insert") }}</el-link>
<el-link type="primary" :disabled="readOnly" class="opt-item" :underline="false" @click="handleCopyStep(scope.$index, scope.row)">{{ $t("commons.copy") }}</el-link>
<el-link type="primary" :disabled="readOnly || (scope.$index === 0 && form.steps.length <= 1)" class="opt-item delete-item" :underline="false" @click="handleDeleteStep(scope.$index, scope.row)">{{ $t("commons.delete") }}</el-link>
</template>
</el-table-column>
</el-table>
<div class="add-step-row" :class="{'disable-row' : readOnly}">
<div class="add-step-hover" style="display: flex; padding-right: 1rem">
<div class="add-icon" @click="handleAddStepStandAlone">
<i class="el-icon-plus"></i>
</div>
<div class="add-label" @click="handleAddStepStandAlone">
{{ $t("case.add_steps") }}
</div>
</div>
</div>
</el-form-item>
</template>
@ -170,17 +117,6 @@ export default {
this.saveCase();
}, 500);
},
handleAddStepStandAlone() {
if (this.readOnly) {
return;
}
let step = {};
let index = this.form.steps.length || 0;
step.num = index + 1;
step.desc = "";
step.result = "";
this.form.steps.splice(index + 1, 0, step);
},
handleAddStep(index, data) {
let step = {};
step.num = data.num + 1;
@ -408,12 +344,8 @@ i.el-icon-more:hover {
background-color: transparent;
padding: 0;
}
.opt-readonly {
pointer-events: none;
color: #fab6b6;
cursor: not-allowed;
}
.add-step-hover:hover{
background-color: rgba(117, 36, 101, 0.1);
.opt-item {
margin-right: 10px;
}
</style>