Merge remote-tracking branch 'origin/master'

This commit is contained in:
song.tianyang 2021-03-20 16:48:15 +08:00
commit 787909a415
17 changed files with 139 additions and 74 deletions

View File

@ -372,20 +372,20 @@
<select id="getTestPlanCase" resultType="int"> <select id="getTestPlanCase" resultType="int">
select count(s) select count(s)
from ( from (
select id as s select tptc.id as s
from test_plan_test_case tptc from test_plan_test_case tptc join test_case on tptc.case_id = test_case.id
where tptc.plan_id = #{planId} where tptc.plan_id = #{planId}
union all union all
select id as s select tpas.id as s
from test_plan_api_scenario tpas from test_plan_api_scenario tpas join api_scenario on tpas.api_scenario_id = api_scenario.id
where tpas.test_plan_id = #{planId} where tpas.test_plan_id = #{planId} and api_scenario.status != 'Trash'
union all union all
select id as s select tpac.id as s
from test_plan_api_case tpac from test_plan_api_case tpac join api_test_case on tpac.api_case_id = api_test_case.id
where tpac.test_plan_id = #{planId} where tpac.test_plan_id = #{planId}
union all union all
select id as s select tplc.id as s
from test_plan_load_case tplc from test_plan_load_case tplc join load_test on tplc.load_case_id = load_test.id
where tplc.test_plan_id = #{planId} where tplc.test_plan_id = #{planId}
) as temp ) as temp
</select> </select>

View File

@ -13,6 +13,7 @@ public class ShiroUtils {
public static void loadBaseFilterChain(Map<String, String> filterChainDefinitionMap){ public static void loadBaseFilterChain(Map<String, String> filterChainDefinitionMap){
filterChainDefinitionMap.put("/resource/**", "anon"); filterChainDefinitionMap.put("/resource/**", "anon");
filterChainDefinitionMap.put("/login", "anon");
filterChainDefinitionMap.put("/signin", "anon"); filterChainDefinitionMap.put("/signin", "anon");
filterChainDefinitionMap.put("/ldap/signin", "anon"); filterChainDefinitionMap.put("/ldap/signin", "anon");
filterChainDefinitionMap.put("/ldap/open", "anon"); filterChainDefinitionMap.put("/ldap/open", "anon");

View File

@ -20,8 +20,8 @@ public class TestCaseExcelData {
private String priority; private String priority;
@ExcelIgnore @ExcelIgnore
private String tags; private String tags;
@ExcelIgnore // @ExcelIgnore
private String method; // private String method;
@ExcelIgnore @ExcelIgnore
private String prerequisite; private String prerequisite;
@ExcelIgnore @ExcelIgnore

View File

@ -45,10 +45,10 @@ public class TestCaseExcelDataCn extends TestCaseExcelData {
@Length(min = 0, max = 1000) @Length(min = 0, max = 1000)
private String tags; private String tags;
@NotBlank(message = "{cannot_be_null}") // @NotBlank(message = "{cannot_be_null}")
@ExcelProperty("测试方式") // @ExcelProperty("测试方式")
@Pattern(regexp = "(^manual$)|(^auto$)", message = "{test_case_method_validate}") // @Pattern(regexp = "(^manual$)|(^auto$)", message = "{test_case_method_validate}")
private String method; // private String method;
@ColumnWidth(50) @ColumnWidth(50)
@ExcelProperty("前置条件") @ExcelProperty("前置条件")

View File

@ -45,10 +45,10 @@ public class TestCaseExcelDataTw extends TestCaseExcelData {
@Length(min = 0, max = 1000) @Length(min = 0, max = 1000)
private String tags; private String tags;
@NotBlank(message = "{cannot_be_null}") // @NotBlank(message = "{cannot_be_null}")
@ExcelProperty("測試方式") // @ExcelProperty("測試方式")
@Pattern(regexp = "(^manual$)|(^auto$)", message = "{test_case_method_validate}") // @Pattern(regexp = "(^manual$)|(^auto$)", message = "{test_case_method_validate}")
private String method; // private String method;
@ColumnWidth(50) @ColumnWidth(50)
@ExcelProperty("前置條件") @ExcelProperty("前置條件")

View File

@ -46,10 +46,10 @@ public class TestCaseExcelDataUs extends TestCaseExcelData {
@Length(min = 0, max = 1000) @Length(min = 0, max = 1000)
private String tags; private String tags;
@NotBlank(message = "{cannot_be_null}") // @NotBlank(message = "{cannot_be_null}")
@ExcelProperty("Method") // @ExcelProperty("Method")
@Pattern(regexp = "(^manual$)|(^auto$)", message = "{test_case_method_validate}") // @Pattern(regexp = "(^manual$)|(^auto$)", message = "{test_case_method_validate}")
private String method; // private String method;
@ColumnWidth(50) @ColumnWidth(50)
@ExcelProperty("Prerequisite") @ExcelProperty("Prerequisite")

View File

@ -53,9 +53,9 @@ public class TestCaseDataListener extends EasyExcelListener<TestCaseExcelData> {
} }
} }
if (StringUtils.equals(data.getType(), TestCaseConstants.Type.Functional.getValue()) && StringUtils.equals(data.getMethod(), TestCaseConstants.Method.Auto.getValue())) { // if (StringUtils.equals(data.getType(), TestCaseConstants.Type.Functional.getValue()) && StringUtils.equals(data.getMethod(), TestCaseConstants.Method.Auto.getValue())) {
stringBuilder.append(Translator.get("functional_method_tip") + "; "); // stringBuilder.append(Translator.get("functional_method_tip") + "; ");
} // }
if (!userIds.contains(data.getMaintainer())) { if (!userIds.contains(data.getMaintainer())) {
stringBuilder.append(Translator.get("user_not_exists") + "" + data.getMaintainer() + "; "); stringBuilder.append(Translator.get("user_not_exists") + "" + data.getMaintainer() + "; ");

View File

@ -33,9 +33,7 @@ public class TestPlanApiCaseController {
@PostMapping("/relevance/list/{goPage}/{pageSize}") @PostMapping("/relevance/list/{goPage}/{pageSize}")
public Pager<List<ApiTestCaseDTO>> relevanceList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ApiTestCaseRequest request) { public Pager<List<ApiTestCaseDTO>> relevanceList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ApiTestCaseRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true); return testPlanApiCaseService.relevanceList(goPage, pageSize, request);
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
return PageUtils.setPageInfo(page, testPlanApiCaseService.relevanceList(request));
} }
@GetMapping("/delete/{id}") @GetMapping("/delete/{id}")

View File

@ -131,8 +131,8 @@ public class TestCaseService {
.andNodePathEqualTo(testCase.getNodePath()) .andNodePathEqualTo(testCase.getNodePath())
.andTypeEqualTo(testCase.getType()) .andTypeEqualTo(testCase.getType())
.andMaintainerEqualTo(testCase.getMaintainer()) .andMaintainerEqualTo(testCase.getMaintainer())
.andPriorityEqualTo(testCase.getPriority()) .andPriorityEqualTo(testCase.getPriority());
.andMethodEqualTo(testCase.getMethod()); // .andMethodEqualTo(testCase.getMethod());
// if (StringUtils.isNotBlank(testCase.getNodeId())) { // if (StringUtils.isNotBlank(testCase.getNodeId())) {
// criteria.andNodeIdEqualTo(testCase.getTestId()); // criteria.andNodeIdEqualTo(testCase.getTestId());
@ -432,7 +432,7 @@ public class TestCaseService {
List<TestCaseExcelData> list = new ArrayList<>(); List<TestCaseExcelData> list = new ArrayList<>();
StringBuilder path = new StringBuilder(""); StringBuilder path = new StringBuilder("");
List<String> types = TestCaseConstants.Type.getValues(); List<String> types = TestCaseConstants.Type.getValues();
List<String> methods = TestCaseConstants.Method.getValues(); // List<String> methods = TestCaseConstants.Method.getValues();
SessionUser user = SessionUtils.getUser(); SessionUser user = SessionUtils.getUser();
for (int i = 1; i <= 5; i++) { for (int i = 1; i <= 5; i++) {
TestCaseExcelData data = new TestCaseExcelData(); TestCaseExcelData data = new TestCaseExcelData();
@ -442,11 +442,11 @@ public class TestCaseService {
data.setPriority("P" + i % 4); data.setPriority("P" + i % 4);
String type = types.get(i % 3); String type = types.get(i % 3);
data.setType(type); data.setType(type);
if (StringUtils.equals(TestCaseConstants.Type.Functional.getValue(), type)) { // if (StringUtils.equals(TestCaseConstants.Type.Functional.getValue(), type)) {
data.setMethod(TestCaseConstants.Method.Manual.getValue()); // data.setMethod(TestCaseConstants.Method.Manual.getValue());
} else { // } else {
data.setMethod(methods.get(i % 2)); // data.setMethod(methods.get(i % 2));
} // }
data.setPrerequisite(Translator.get("preconditions_optional")); data.setPrerequisite(Translator.get("preconditions_optional"));
data.setStepDesc("1. " + Translator.get("step_tip_separate") + data.setStepDesc("1. " + Translator.get("step_tip_separate") +
"\n2. " + Translator.get("step_tip_order") + "\n3. " + Translator.get("step_tip_optional")); "\n2. " + Translator.get("step_tip_order") + "\n3. " + Translator.get("step_tip_optional"));
@ -461,7 +461,7 @@ public class TestCaseService {
explain.setName(Translator.get("do_not_modify_header_order")); explain.setName(Translator.get("do_not_modify_header_order"));
explain.setNodePath(Translator.get("module_created_automatically")); explain.setNodePath(Translator.get("module_created_automatically"));
explain.setType(Translator.get("options") + "functional、performance、api"); explain.setType(Translator.get("options") + "functional、performance、api");
explain.setMethod(Translator.get("options") + "manual、auto"); // explain.setMethod(Translator.get("options") + "manual、auto");
explain.setPriority(Translator.get("options") + "P0、P1、P2、P3"); explain.setPriority(Translator.get("options") + "P0、P1、P2、P3");
explain.setMaintainer(Translator.get("please_input_workspace_member")); explain.setMaintainer(Translator.get("please_input_workspace_member"));
@ -483,7 +483,11 @@ public class TestCaseService {
private List<TestCaseExcelData> generateTestCaseExcel(TestCaseBatchRequest request) { private List<TestCaseExcelData> generateTestCaseExcel(TestCaseBatchRequest request) {
ServiceUtils.getSelectAllIds(request, request.getCondition(), ServiceUtils.getSelectAllIds(request, request.getCondition(),
(query) -> extTestCaseMapper.selectIds(query)); (query) -> extTestCaseMapper.selectIds(query));
List<OrderRequest> orderList = ServiceUtils.getDefaultOrder(request.getOrders()); QueryTestCaseRequest condition = request.getCondition();
List<OrderRequest> orderList = new ArrayList<>();
if (condition != null) {
orderList = ServiceUtils.getDefaultOrder(condition.getOrders());
}
OrderRequest order = new OrderRequest(); OrderRequest order = new OrderRequest();
order.setName("sort"); order.setName("sort");
order.setType("desc"); order.setType("desc");
@ -499,10 +503,10 @@ public class TestCaseService {
data.setNodePath(t.getNodePath()); data.setNodePath(t.getNodePath());
data.setPriority(t.getPriority()); data.setPriority(t.getPriority());
data.setType(t.getType()); data.setType(t.getType());
data.setMethod(t.getMethod()); // data.setMethod(t.getMethod());
data.setPrerequisite(t.getPrerequisite()); data.setPrerequisite(t.getPrerequisite());
data.setTags(t.getTags()); data.setTags(t.getTags());
if (t.getMethod().equals("manual")) { if (StringUtils.equals(t.getMethod(), "manual") || StringUtils.isBlank(t.getMethod())) {
String steps = t.getSteps(); String steps = t.getSteps();
String setp = ""; String setp = "";
setp = steps; setp = steps;
@ -530,19 +534,19 @@ public class TestCaseService {
result.setLength(0); result.setLength(0);
data.setRemark(t.getRemark()); data.setRemark(t.getRemark());
} else if (t.getMethod().equals("auto") && t.getType().equals("api")) { } else if ("auto".equals(t.getMethod()) && "api".equals(t.getType())) {
data.setStepDesc(""); data.setStepDesc("");
data.setStepResult(""); data.setStepResult("");
if (t.getTestId() != null && t.getTestId().equals("other")) { if (t.getTestId() != null && "other".equals(t.getTestId())) {
data.setRemark(t.getOtherTestName()); data.setRemark(t.getOtherTestName());
} else { } else {
data.setRemark("[" + t.getApiName() + "]" + "\n" + t.getRemark()); data.setRemark("[" + t.getApiName() + "]" + "\n" + t.getRemark());
} }
} else if (t.getMethod().equals("auto") && t.getType().equals("performance")) { } else if ("auto".equals(t.getMethod()) && "performance".equals(t.getType())) {
data.setStepDesc(""); data.setStepDesc("");
data.setStepResult(""); data.setStepResult("");
if (t.getTestId() != null && t.getTestId().equals("other")) { if (t.getTestId() != null && "other".equals(t.getTestId())) {
data.setRemark(t.getOtherTestName()); data.setRemark(t.getOtherTestName());
} else { } else {
data.setRemark(t.getPerformName()); data.setRemark(t.getPerformName());

View File

@ -2,6 +2,8 @@ package io.metersphere.track.service;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.api.dto.definition.ApiTestCaseDTO; import io.metersphere.api.dto.definition.ApiTestCaseDTO;
import io.metersphere.api.dto.definition.ApiTestCaseRequest; import io.metersphere.api.dto.definition.ApiTestCaseRequest;
import io.metersphere.api.dto.definition.RunDefinitionRequest; import io.metersphere.api.dto.definition.RunDefinitionRequest;
@ -18,7 +20,10 @@ import io.metersphere.base.domain.TestPlanApiCase;
import io.metersphere.base.domain.TestPlanApiCaseExample; import io.metersphere.base.domain.TestPlanApiCaseExample;
import io.metersphere.base.mapper.TestPlanApiCaseMapper; import io.metersphere.base.mapper.TestPlanApiCaseMapper;
import io.metersphere.base.mapper.ext.ExtTestPlanApiCaseMapper; import io.metersphere.base.mapper.ext.ExtTestPlanApiCaseMapper;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.commons.utils.ServiceUtils; import io.metersphere.commons.utils.ServiceUtils;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.track.request.testcase.TestPlanApiCaseBatchRequest; import io.metersphere.track.request.testcase.TestPlanApiCaseBatchRequest;
import org.apache.jmeter.testelement.TestElement; import org.apache.jmeter.testelement.TestElement;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
@ -61,13 +66,15 @@ public class TestPlanApiCaseService {
return extTestPlanApiCaseMapper.getExecResultByPlanId(plan); return extTestPlanApiCaseMapper.getExecResultByPlanId(plan);
} }
public List<ApiTestCaseDTO> relevanceList(ApiTestCaseRequest request) { public Pager<List<ApiTestCaseDTO>> relevanceList(int goPage, int pageSize, ApiTestCaseRequest request) {
List<String> ids = apiTestCaseService.selectIdsNotExistsInPlan(request.getProjectId(), request.getPlanId()); List<String> ids = apiTestCaseService.selectIdsNotExistsInPlan(request.getProjectId(), request.getPlanId());
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
if (CollectionUtils.isEmpty(ids)) { if (CollectionUtils.isEmpty(ids)) {
return new ArrayList<>(); return PageUtils.setPageInfo(page, new ArrayList<>());
} }
request.setIds(ids); request.setIds(ids);
return apiTestCaseService.listSimple(request); request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
return PageUtils.setPageInfo(page, apiTestCaseService.listSimple(request));
} }
public int delete(String id) { public int delete(String id) {

View File

@ -1,13 +1,19 @@
package io.metersphere.track.service; package io.metersphere.track.service;
import io.metersphere.api.dto.automation.ScenarioStatus;
import io.metersphere.base.domain.*; import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.*; import io.metersphere.base.mapper.*;
import io.metersphere.base.mapper.ext.ExtTestCaseMapper; import io.metersphere.base.mapper.ext.ExtTestCaseMapper;
import io.metersphere.base.mapper.ext.ExtTestPlanTestCaseMapper;
import io.metersphere.commons.constants.TestPlanTestCaseStatus;
import io.metersphere.commons.utils.DateUtils; import io.metersphere.commons.utils.DateUtils;
import io.metersphere.commons.utils.MathUtils;
import io.metersphere.performance.base.ChartsData; import io.metersphere.performance.base.ChartsData;
import io.metersphere.track.dto.TestPlanDTOWithMetric;
import io.metersphere.track.response.BugStatustics; import io.metersphere.track.response.BugStatustics;
import io.metersphere.track.response.TestPlanBugCount; import io.metersphere.track.response.TestPlanBugCount;
import io.metersphere.track.response.TrackCountResult; import io.metersphere.track.response.TrackCountResult;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -28,13 +34,13 @@ public class TrackService {
@Resource @Resource
private TestPlanMapper testPlanMapper; private TestPlanMapper testPlanMapper;
@Resource @Resource
private TestPlanTestCaseMapper testPlanTestCaseMapper; private ExtTestPlanTestCaseMapper extTestPlanTestCaseMapper;
@Resource @Resource
private TestPlanLoadCaseMapper testPlanLoadCaseMapper; private TestPlanApiCaseService testPlanApiCaseService;
@Resource @Resource
private TestPlanApiCaseMapper testPlanApiCaseMapper; private TestPlanScenarioCaseService testPlanScenarioCaseService;
@Resource @Resource
private TestPlanApiScenarioMapper testPlanApiScenarioMapper; private TestPlanLoadCaseService testPlanLoadCaseService;
public List<TrackCountResult> countPriority(String projectId) { public List<TrackCountResult> countPriority(String projectId) {
return extTestCaseMapper.countPriority(projectId); return extTestCaseMapper.countPriority(projectId);
@ -132,11 +138,13 @@ public class TrackService {
int planBugSize = getPlanBugSize(plan.getId()); int planBugSize = getPlanBugSize(plan.getId());
testPlanBug.setBugSize(planBugSize); testPlanBug.setBugSize(planBugSize);
testPlanBug.setPassRage(getPlanPassRage(plan.getId(), planCaseSize)); double planPassRage = getPlanPassRage(plan.getId());
testPlanBug.setPassRage(planPassRage + "%");
list.add(testPlanBug); list.add(testPlanBug);
totalBugSize += planBugSize; totalBugSize += planBugSize;
totalCaseSize += planCaseSize; totalCaseSize += planCaseSize;
} }
bugStatustics.setList(list); bugStatustics.setList(list);
@ -156,13 +164,52 @@ public class TrackService {
return extTestCaseMapper.getTestPlanBug(planId); return extTestCaseMapper.getTestPlanBug(planId);
} }
private String getPlanPassRage(String planId, int totalSize) { private double getPlanPassRage(String planId) {
if (totalSize == 0) { TestPlanDTOWithMetric testPlan = new TestPlanDTOWithMetric();
return "-"; testPlan.setTested(0);
} testPlan.setPassed(0);
int passSize = extTestCaseMapper.getTestPlanPassCase(planId); testPlan.setTotal(0);
float rage = (float) passSize * 100 / totalSize;
DecimalFormat df = new DecimalFormat("0.0"); List<String> functionalExecResults = extTestPlanTestCaseMapper.getExecResultByPlanId(planId);
return df.format(rage) + "%"; functionalExecResults.forEach(item -> {
if (!StringUtils.equals(item, TestPlanTestCaseStatus.Prepare.name())
&& !StringUtils.equals(item, TestPlanTestCaseStatus.Underway.name())) {
testPlan.setTested(testPlan.getTested() + 1);
if (StringUtils.equals(item, TestPlanTestCaseStatus.Pass.name())) {
testPlan.setPassed(testPlan.getPassed() + 1);
}
}
});
List<String> apiExecResults = testPlanApiCaseService.getExecResultByPlanId(planId);
apiExecResults.forEach(item -> {
if (StringUtils.isNotBlank(item)) {
testPlan.setTested(testPlan.getTested() + 1);
if (StringUtils.equals(item, "success")) {
testPlan.setPassed(testPlan.getPassed() + 1);
}
}
});
List<String> scenarioExecResults = testPlanScenarioCaseService.getExecResultByPlanId(planId);
scenarioExecResults.forEach(item -> {
if (StringUtils.isNotBlank(item)) {
testPlan.setTested(testPlan.getTested() + 1);
if (StringUtils.equals(item, ScenarioStatus.Success.name())) {
testPlan.setPassed(testPlan.getPassed() + 1);
}
}
});
List<String> loadResults = testPlanLoadCaseService.getStatus(planId);
loadResults.forEach(item -> {
if (StringUtils.isNotBlank(item)) {
testPlan.setTested(testPlan.getTested() + 1);
if (StringUtils.equals(item, "success")) {
testPlan.setPassed(testPlan.getPassed() + 1);
}
}
});
return MathUtils.getPercentWithDecimal(testPlan.getTested() == 0 ? 0 : testPlan.getPassed() * 1.0 / testPlan.getTested());
} }
} }

View File

@ -175,3 +175,5 @@ CREATE TABLE IF NOT EXISTS `esb_api_params`
-- add execution_times testPlan -- add execution_times testPlan
alter table test_plan alter table test_plan
add execution_times int null; add execution_times int null;
alter table test_case modify method varchar(15) null comment 'Test case method type';

View File

@ -103,16 +103,16 @@ export default {
.active { .active {
border: solid 1px #6d317c; border: solid 1px #6d317c;
background-color: var(--color); background-color: var(--primary_color);
color: #FFFFFF; color: #FFFFFF;
} }
.case-button { .case-button {
border-left: solid 1px var(--color); border-left: solid 1px var(--primary_color);
} }
.item{ .item{
border: solid 1px var(--color); border: solid 1px var(--primary_color);
} }
</style> </style>

View File

@ -10,7 +10,7 @@
</template> </template>
<search-list :current-project.sync="currentProject"/> <search-list :current-project.sync="currentProject"/>
<el-divider/> <el-divider/>
<el-menu-item :index="'/setting/project/create'"> <el-menu-item :index="'/setting/project/create'" v-permission="['test_manager','test_user']">
<font-awesome-icon :icon="['fa', 'plus']"/> <font-awesome-icon :icon="['fa', 'plus']"/>
<span style="padding-left: 7px;">{{ $t("project.create") }}</span> <span style="padding-left: 7px;">{{ $t("project.create") }}</span>
</el-menu-item> </el-menu-item>

View File

@ -10,7 +10,7 @@
@dataChange="changePlan"/> @dataChange="changePlan"/>
</template> </template>
<template v-slot:menu> <template v-slot:menu>
<el-menu v-if="isMenuShow" active-text-color="#6d317c" :default-active="activeIndex" <el-menu v-if="isMenuShow" :active-text-color="color" :default-active="activeIndex"
class="el-menu-demo header-menu" mode="horizontal" @select="handleSelect"> class="el-menu-demo header-menu" mode="horizontal" @select="handleSelect">
<el-menu-item index="functional">功能测试用例</el-menu-item> <el-menu-item index="functional">功能测试用例</el-menu-item>
<el-menu-item index="api">接口测试用例</el-menu-item> <el-menu-item index="api">接口测试用例</el-menu-item>
@ -71,6 +71,9 @@
computed: { computed: {
planId: function () { planId: function () {
return this.$route.params.planId; return this.$route.params.planId;
},
color: function () {
return `var(--primary_color)`
} }
}, },
watch: { watch: {

View File

@ -9,7 +9,7 @@
@dataChange="changeReview"/> @dataChange="changeReview"/>
</template> </template>
<template v-slot:menu> <template v-slot:menu>
<el-menu v-if="isMenuShow" active-text-color="#6d317c" <el-menu v-if="isMenuShow" :active-text-color="color"
class="el-menu-demo header-menu" mode="horizontal" @select="handleSelect" class="el-menu-demo header-menu" mode="horizontal" @select="handleSelect"
:default-active="activeIndex"> :default-active="activeIndex">
<el-menu-item index="functional">功能测试用例</el-menu-item> <el-menu-item index="functional">功能测试用例</el-menu-item>
@ -78,6 +78,9 @@ export default {
computed: { computed: {
reviewId: function () { reviewId: function () {
return this.$route.params.reviewId; return this.$route.params.reviewId;
},
color: function () {
return `var(--primary_color)`
} }
}, },
mounted() { mounted() {

View File

@ -62,19 +62,19 @@ html,body {
/* <-- 表格拖拽表头调整宽度,在 t-bable 上添加 border 属性,并添加 adjust-table 类名 */ /* <-- 表格拖拽表头调整宽度,在 t-bable 上添加 border 属性,并添加 adjust-table 类名 */
.adjust-table td { .adjust-table td {
border-right: 0; border-right: 0 !important;
} }
.adjust-table th { .adjust-table th {
border-right-color: white; border-right-color: white !important;
} }
.adjust-table { .adjust-table {
border-color: white; border-color: white !important;
} }
.adjust-table:after { .adjust-table:after {
background-color: white; background-color: white !important;
} }
.adjust-table th:not([class*="el-table-column--selection"]):hover:after { .adjust-table th:not([class*="el-table-column--selection"]):hover:after {
@ -84,11 +84,11 @@ html,body {
right: 0; right: 0;
height: 50%; height: 50%;
width: 2px; width: 2px;
background-color: #EBEEF5; background-color: #EBEEF5 !important;
} }
.adjust-table tr:hover td { .adjust-table tr:hover td {
border-right: 0; border-right: 0 !important;
} }
/* 表格拖拽表头调整宽度 --> */ /* 表格拖拽表头调整宽度 --> */