slot -> v-slot

This commit is contained in:
chenjianxing 2020-04-03 10:09:55 +08:00
commit b3cc9cd679
50 changed files with 866 additions and 656 deletions

View File

@ -1,5 +1,6 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.base.domain.LoadTestReport;
import io.metersphere.controller.request.ReportRequest;
import io.metersphere.dto.ReportDTO;
import org.apache.ibatis.annotations.Param;
@ -13,4 +14,6 @@ public interface ExtLoadTestReportMapper {
ReportDTO getReportTestAndProInfo(@Param("id") String id);
int appendLine(@Param("testId") String id, @Param("line") String line);
LoadTestReport selectByPrimaryKey(String id);
}

View File

@ -2,6 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="io.metersphere.base.mapper.ext.ExtLoadTestReportMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.LoadTestReport">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="test_id" jdbcType="VARCHAR" property="testId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="status" jdbcType="VARCHAR" property="status" />
</resultMap>
<sql id="Base_Column_List">
id, test_id, name, create_time, update_time, status
</sql>
<select id="getReportList" resultType="io.metersphere.dto.ReportDTO">
select ltr.id, ltr.name, ltr.test_id as testId, ltr.description,
ltr.create_time as createTime, ltr.update_time as updateTime, ltr.status as status, lt.name as testName
@ -28,4 +41,11 @@
WHERE id = #{testId}
</update>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from load_test_report
where id = #{id,jdbcType=VARCHAR}
</select>
</mapper>

View File

@ -23,7 +23,7 @@ import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping(value = "/functional/plan")
@RequestMapping(value = "/functional/test")
@RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER, RoleConstants.TEST_VIEWER}, logical = Logical.OR)
public class FunctionalTestController {
@Resource

View File

@ -10,7 +10,7 @@ import io.metersphere.commons.utils.Pager;
import io.metersphere.controller.request.testplan.*;
import io.metersphere.dto.LoadTestDTO;
import io.metersphere.service.FileService;
import io.metersphere.service.LoadTestService;
import io.metersphere.service.PerformanceTestService;
import io.metersphere.user.SessionUtils;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
@ -24,11 +24,11 @@ import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping(value = "/testplan")
@RequestMapping(value = "performance")
@RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER, RoleConstants.TEST_VIEWER}, logical = Logical.OR)
public class LoadTestController {
public class PerformanceTestController {
@Resource
private LoadTestService loadTestService;
private PerformanceTestService performanceTestService;
@Resource
private FileService fileService;
@ -38,14 +38,14 @@ public class LoadTestController {
QueryTestPlanRequest request = new QueryTestPlanRequest();
request.setWorkspaceId(currentWorkspaceId);
PageHelper.startPage(1, count, true);
return loadTestService.recentTestPlans(request);
return performanceTestService.recentTestPlans(request);
}
@PostMapping("/list/{goPage}/{pageSize}")
public Pager<List<LoadTestDTO>> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryTestPlanRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
return PageUtils.setPageInfo(page, loadTestService.list(request));
return PageUtils.setPageInfo(page, performanceTestService.list(request));
}
@PostMapping(value = "/save", consumes = {"multipart/form-data"})
@ -53,7 +53,7 @@ public class LoadTestController {
@RequestPart("request") SaveTestPlanRequest request,
@RequestPart(value = "file") List<MultipartFile> files
) {
return loadTestService.save(request, files);
return performanceTestService.save(request, files);
}
@PostMapping(value = "/edit", consumes = {"multipart/form-data"})
@ -61,32 +61,32 @@ public class LoadTestController {
@RequestPart("request") EditTestPlanRequest request,
@RequestPart(value = "file", required = false) List<MultipartFile> files
) {
return loadTestService.edit(request, files);
return performanceTestService.edit(request, files);
}
@GetMapping("/get/{testId}")
public LoadTestDTO get(@PathVariable String testId) {
return loadTestService.get(testId);
return performanceTestService.get(testId);
}
@GetMapping("/get-advanced-config/{testId}")
public String getAdvancedConfiguration(@PathVariable String testId) {
return loadTestService.getAdvancedConfiguration(testId);
return performanceTestService.getAdvancedConfiguration(testId);
}
@GetMapping("/get-load-config/{testId}")
public String getLoadConfiguration(@PathVariable String testId) {
return loadTestService.getLoadConfiguration(testId);
return performanceTestService.getLoadConfiguration(testId);
}
@PostMapping("/delete")
public void delete(@RequestBody DeleteTestPlanRequest request) {
loadTestService.delete(request);
performanceTestService.delete(request);
}
@PostMapping("/run")
public void run(@RequestBody RunTestPlanRequest request) {
boolean started = loadTestService.run(request);
boolean started = performanceTestService.run(request);
if (!started) {
MSException.throwException("Start engine error, please check log.");
}

View File

@ -82,4 +82,9 @@ public class ReportController {
return reportService.getLoadChartData(reportId);
}
@GetMapping("/{reportId}")
public LoadTestReport getLoadTestReport(@PathVariable String reportId) {
return reportService.getLoadTestReport(reportId);
}
}

View File

@ -11,7 +11,7 @@ import io.metersphere.commons.constants.TestStatus;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.CommonBeanFactory;
import io.metersphere.config.JmeterProperties;
import io.metersphere.service.LoadTestService;
import io.metersphere.service.PerformanceTestService;
import io.metersphere.service.TestResourcePoolService;
import io.metersphere.service.TestResourceService;
import org.apache.commons.collections.CollectionUtils;
@ -25,7 +25,7 @@ public abstract class AbstractEngine implements Engine {
private Long startTime;
private String reportId;
protected LoadTestWithBLOBs loadTest;
protected LoadTestService loadTestService;
protected PerformanceTestService performanceTestService;
protected Integer threadNum;
protected List<TestResource> resourceList;
@ -46,7 +46,7 @@ public abstract class AbstractEngine implements Engine {
}
this.loadTest = loadTest;
this.loadTestService = CommonBeanFactory.getBean(LoadTestService.class);
this.performanceTestService = CommonBeanFactory.getBean(PerformanceTestService.class);
threadNum = getThreadNum(loadTest);
String resourcePoolId = loadTest.getTestResourcePoolId();
@ -67,7 +67,7 @@ public abstract class AbstractEngine implements Engine {
}
protected Integer getRunningThreadNum() {
List<LoadTestWithBLOBs> loadTests = loadTestService.selectByTestResourcePoolId(loadTest.getTestResourcePoolId());
List<LoadTestWithBLOBs> loadTests = performanceTestService.selectByTestResourcePoolId(loadTest.getTestResourcePoolId());
// 使用当前资源池正在运行的测试占用的并发数
return loadTests.stream()
.filter(t -> TestStatus.Running.name().equals(t.getStatus()))

View File

@ -29,7 +29,7 @@ import java.util.stream.Collectors;
@Service
@Transactional(rollbackFor = Exception.class)
public class LoadTestService {
public class PerformanceTestService {
private static final String HEADERS = "timestamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,sentBytes,grpThreads,allThreads,URL,Latency,IdleTime,Connect";
@Resource

View File

@ -5,6 +5,7 @@ import io.metersphere.base.domain.LoadTestReportExample;
import io.metersphere.base.domain.LoadTestReportWithBLOBs;
import io.metersphere.base.mapper.LoadTestReportMapper;
import io.metersphere.base.mapper.ext.ExtLoadTestReportMapper;
import io.metersphere.commons.exception.MSException;
import io.metersphere.controller.request.ReportRequest;
import io.metersphere.dto.ReportDTO;
import io.metersphere.report.JtlResolver;
@ -13,6 +14,7 @@ import io.metersphere.report.base.Errors;
import io.metersphere.report.base.TestOverview;
import io.metersphere.report.dto.ErrorsTop5DTO;
import io.metersphere.report.dto.RequestStatisticsDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -83,4 +85,16 @@ public class ReportService {
ChartsData chartsData = JtlResolver.getLoadChartData(content);
return chartsData;
}
// public void checkReportStatus(String id) {
// LoadTestReportWithBLOBs loadTestReport = loadTestReportMapper.selectByPrimaryKey(id);
// String status=loadTestReport.getStatus();
// if (StringUtils.equals("Error",status)) {
// MSException.throwException("test run error!");
// }
// }
public LoadTestReport getLoadTestReport(String id) {
return extLoadTestReportMapper.selectByPrimaryKey(id);
}
}

View File

@ -9,7 +9,7 @@
<el-submenu v-if="isCurrentWorkspaceUser"
index="3" popper-class="submenu" v-permission="['test_manager']" >
<template slot="title">{{$t('commons.project')}}</template>
<template v-slot:title>{{$t('commons.project')}}</template>
<performance-recent-project v-if="beaseUrl == 'performance'"/>
<functional-recent-project v-if="beaseUrl == 'functional'"/>
<track-recent-project v-if="beaseUrl == 'tack'"/>
@ -25,22 +25,22 @@
<el-submenu v-if="isCurrentWorkspaceUser && (beaseUrl == 'performance' || beaseUrl == 'functional')"
index="4" popper-class="submenu" v-permission="['test_manager', 'test_user']">
<template slot="title">{{$t('commons.test')}}</template>
<template v-slot:title>{{$t('commons.test')}}</template>
<performance-recent-test-plan v-if="beaseUrl == 'performance'"/>
<functional-recent-test-plan v-if="beaseUrl == 'functional'"/>
<el-divider/>
<el-menu-item :index="'/' + beaseUrl + '/plan/all'">
<el-menu-item :index="'/' + beaseUrl + '/test/all'">
<font-awesome-icon :icon="['fa', 'list-ul']"/>
<span style="padding-left: 5px;">{{$t('commons.show_all')}}</span>
</el-menu-item>
<el-menu-item :index="'/' + beaseUrl + '/plan/create'">
<el-menu-item :index="'/' + beaseUrl + '/test/create'">
<el-button type="text">{{$t('load_test.create')}}</el-button>
</el-menu-item>
</el-submenu>
<el-submenu v-if="isCurrentWorkspaceUser && (beaseUrl == 'performance' || beaseUrl == 'functional')"
index="5" popper-class="submenu" v-permission="['test_manager', 'test_user', 'test_viewer']">
<template slot="title">{{$t('commons.report')}}</template>
<template v-slot:title>{{$t('commons.report')}}</template>
<performance-recent-report v-if="beaseUrl == 'performance'"/>
<functional-recent-report v-if="beaseUrl == 'functional'"/>
<el-divider/>
@ -52,7 +52,7 @@
<el-submenu v-if="isCurrentWorkspaceUser && beaseUrl == 'track'"
index="6" popper-class="submenu" v-permission="['test_manager', 'test_user']">
<template slot="title">{{$t('test_track.test_case')}}</template>
<template v-slot:title>{{$t('test_track.test_case')}}</template>
<recent-case-plan/>
<el-divider/>
<el-menu-item :index="'/' + beaseUrl + '/case/all'">
@ -66,7 +66,7 @@
<el-submenu v-if="isCurrentWorkspaceUser && beaseUrl == 'track'"
index="7" popper-class="submenu" v-permission="['test_manager', 'test_user', 'test_viewer']">
<template slot="title">{{$t('test_track.test_plan')}}</template>
<template v-slot:title>{{$t('test_track.test_plan')}}</template>
<el-divider/>
<el-menu-item :index="'/' + beaseUrl + '/plan/all'">
<font-awesome-icon :icon="['fa', 'list-ul']"/>
@ -78,7 +78,7 @@
</el-submenu>
<router-link v-if="isCurrentWorkspaceUser && (beaseUrl == 'performance' || beaseUrl == 'functional')"
class="header-bottom" :to="'/' + beaseUrl + '/plan/create'" v-permission="['test_user','test_manager']">
class="header-bottom" :to="'/' + beaseUrl + '/test/create'" v-permission="['test_user','test_manager']">
<el-button type="primary" size="small">{{$t('load_test.create')}}</el-button>
</router-link>
@ -89,8 +89,8 @@
<script>
import PerformanceRecentTestPlan from "../../performance/plan/PerformanceRecentTestPlan";
import FunctionalRecentTestPlan from "../../functional/plan/FunctionalRecentTestPlan";
import PerformanceRecentTestPlan from "../../performance/test/PerformanceRecentTestPlan";
import FunctionalRecentTestPlan from "../../functional/test/FunctionalRecentTestPlan";
import PerformanceRecentProject from "../../performance/project/PerformanceRecentProject";
import FunctionalRecentProject from "../../functional/project/FunctionalRecentProject";
import PerformanceRecentReport from "../../performance/report/PerformanceRecentReport";

View File

@ -7,7 +7,7 @@
text-color="#fff">
<el-submenu index="1" popper-class="submenu"
v-permission="['org_admin', 'test_manager', 'test_user', 'test_viewer']">
<template slot="title">{{$t('commons.organization')}}{{currentOrganizationName}}</template>
<template v-slot:title>{{$t('commons.organization')}}{{currentOrganizationName}}</template>
<label v-for="(item,index) in organizationList" :key="index">
<el-menu-item @click="changeOrg(item)">{{item.name}}
<i class="el-icon-check"
@ -16,7 +16,7 @@
</label>
</el-submenu>
<el-submenu index="2" popper-class="submenu" v-permission="['test_manager', 'test_user', 'test_viewer']">
<template slot="title">{{$t('commons.workspace')}}{{currentWorkspaceName}}</template>
<template v-slot:title>{{$t('commons.workspace')}}{{currentWorkspaceName}}</template>
<label v-for="(item,index) in workspaceList" :key="index">
<el-menu-item @click="changeWs(item)">
{{item.name}}
@ -32,10 +32,12 @@
<span class="dropdown-link">
{{currentUser.name}}<i class="el-icon-caret-bottom el-icon--right"/>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="personal">个人信息</el-dropdown-item>
<el-dropdown-item command="logout">退出系统</el-dropdown-item>
</el-dropdown-menu>
<template v-slot:dropdown>
<el-dropdown-menu>
<el-dropdown-item command="personal">个人信息</el-dropdown-item>
<el-dropdown-item command="logout">退出系统</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</el-col>
</el-row>

View File

@ -3,8 +3,8 @@ import VueRouter from 'vue-router'
import RouterSidebar from "./RouterSidebar";
import Setting from "../../settings/Setting";
import User from "../../settings/system/User";
import EditPerformanceTestPlan from "../../performance/plan/EditPerformanceTestPlan";
import PerformanceTestPlan from "../../performance/plan/PerformanceTestPlan";
import EditPerformanceTestPlan from "../../performance/test/EditPerformanceTestPlan";
import PerformanceTestPlan from "../../performance/test/PerformanceTestPlan";
import Organization from "../../settings/system/Organization";
import OrganizationMember from "../../settings/organization/OrganizationMember";
import Member from "../../settings/workspace/WorkspaceMember";
@ -18,9 +18,9 @@ import PerformanceTestReport from "../../performance/report/PerformanceTestRepor
import FunctionalTestReport from "../../functional/report/FunctionalTestReport";
import FunctionalTest from "../../functional/FunctionalTest";
import PerformanceTest from "../../performance/PerformanceTest";
import EditFunctionalTestPlan from "../../functional/plan/EditFunctionalTestPlan";
import EditFunctionalTestPlan from "../../functional/test/EditFunctionalTestPlan";
import PerformanceTestHome from "../../performance/home/PerformanceTestHome";
import FunctionalTestPlan from "../../functional/plan/FunctionalTestPlan";
import FunctionalTestPlan from "../../functional/test/FunctionalTestPlan";
import FunctionalTestHome from "../../functional/home/FunctionalTestHome";
import PerformanceReportView from "../../performance/report/PerformanceReportView";
import FunctionalReportView from "../../functional/report/FunctionalReportView";
@ -95,12 +95,12 @@ const router = new VueRouter({
component: FunctionalTestHome,
},
{
path: 'plan/create',
path: 'test/create',
name: "createFucTest",
component: EditFunctionalTestPlan,
},
{
path: "plan/edit/:testId",
path: "test/edit/:testId",
name: "editFucTest",
component: EditFunctionalTestPlan,
props: {
@ -112,7 +112,7 @@ const router = new VueRouter({
}
},
{
path: "plan/:projectId",
path: "test/:projectId",
name: "fucPlan",
component: FunctionalTestPlan
},
@ -147,12 +147,12 @@ const router = new VueRouter({
component: PerformanceTestHome,
},
{
path: 'plan/create',
path: 'test/create',
name: "createPerTest",
component: EditPerformanceTestPlan,
},
{
path: "plan/edit/:testId",
path: "test/edit/:testId",
name: "editPerTest",
component: EditPerformanceTestPlan,
props: {
@ -164,7 +164,7 @@ const router = new VueRouter({
}
},
{
path: "plan/:projectId",
path: "test/:projectId",
name: "perPlan",
component: PerformanceTestPlan
},

View File

@ -3,7 +3,7 @@
<div class="main-content">
<el-card>
<div slot="header">
<template v-slot:header>
<el-row type="flex" justify="space-between" align="middle">
<span class="title">{{$t('commons.report')}}</span>
<span class="search">
@ -13,7 +13,7 @@
v-model="condition" @change="search" clearable/>
</span>
</el-row>
</div>
</template>
<el-table :data="tableData" class="test-content">
<el-table-column
@ -36,21 +36,21 @@
<el-table-column
width="250"
:label="$t('commons.create_time')">
<template slot-scope="scope">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column
width="250"
:label="$t('commons.update_time')">
<template slot-scope="scope">
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column
width="150"
:label="$t('commons.operating')">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="handleEdit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="handleDelete(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
</template>

View File

@ -5,14 +5,16 @@
<el-row>
<el-col :span="10">
<el-input :placeholder="$t('load_test.input_name')" v-model="testPlan.name" class="input-with-select">
<el-select v-model="testPlan.projectId" slot="prepend" :placeholder="$t('load_test.select_project')">
<el-option
v-for="item in projects"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<template v-slot:prepend>
<el-select v-model="testPlan.projectId" :placeholder="$t('load_test.select_project')">
<el-option
v-for="item in projects"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</template>
</el-input>
</el-col>
<el-button type="primary" plain @click="save">{{$t('commons.save')}}</el-button>
@ -48,9 +50,9 @@
result: {},
testPlan: {},
listProjectPath: "/project/listAll",
savePath: "/functional/plan/save",
editPath: "/functional/plan/edit",
runPath: "/functional/plan/run",
savePath: "/functional/test/save",
editPath: "/functional/test/edit",
runPath: "/functional/test/run",
projects: [],
active: '0',
tabs: [{
@ -73,7 +75,7 @@
}
let testId = to.path.split('/')[4]; // find testId
if (testId) {
this.$get('/functional/plan/get/' + testId, response => {
this.$get('/functional/test/get/' + testId, response => {
this.testPlan = response.data;
});
}
@ -83,7 +85,7 @@
created() {
let testId = this.$route.path.split('/')[4];
if (testId) {
this.$get('/functional/plan/get/' + testId, response => {
this.$get('/functional/test/get/' + testId, response => {
this.testPlan = response.data;
});
}
@ -109,7 +111,7 @@
type: 'success'
});
this.$refs.runtimeConfig.cancelAllEdit();
this.$router.push({path: '/functional/plan/all'})
this.$router.push({path: '/functional/test/all'})
});
},
saveAndRun() {
@ -163,7 +165,7 @@
};
},
cancel() {
this.$router.push({path: '/functional/plan/all'})
this.$router.push({path: '/functional/test/all'})
},
validTestPlan() {
if (!this.testPlan.name) {

View File

@ -4,7 +4,7 @@
<i class="el-icon-time"/>
{{$t('load_test.recent')}}
</div>
<el-menu-item :key="t.id" v-for="t in recentTestPlans" :index="'/functional/plan/edit/' + t.id">
<el-menu-item :key="t.id" v-for="t in recentTestPlans" :index="'/functional/test/edit/' + t.id">
{{ t.name }}
</el-menu-item>
</el-menu>
@ -19,7 +19,7 @@
mounted() {
if (hasRoles(ROLE_TEST_VIEWER, ROLE_TEST_USER, ROLE_TEST_MANAGER)) {
this.$get('/testplan/recent/5', (response) => {
this.$get('/performance/recent/5', (response) => {
this.recentTestPlans = response.data;
});
}

View File

@ -2,17 +2,19 @@
<div class="testplan-container" v-loading="result.loading">
<div class="main-content">
<el-card>
<div slot="header">
<el-row type="flex" justify="space-between" align="middle">
<span class="title">{{$t('commons.test')}}</span>
<span class="search">
<template v-slot:header>
<div>
<el-row type="flex" justify="space-between" align="middle">
<span class="title">{{$t('commons.test')}}</span>
<span class="search">
<el-input type="text" size="small" :placeholder="$t('load_test.search_by_name')"
prefix-icon="el-icon-search"
maxlength="60"
v-model="condition" @change="search" clearable/>
</span>
</el-row>
</div>
</el-row>
</div>
</template>
<el-table :data="tableData" class="test-content">
<el-table-column
prop="name"
@ -34,21 +36,21 @@
<el-table-column
width="250"
:label="$t('commons.create_time')">
<template slot-scope="scope">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column
width="250"
:label="$t('commons.update_time')">
<template slot-scope="scope">
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column
width="150"
:label="$t('commons.operating')">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="handleEdit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="handleDelete(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
</template>
@ -81,8 +83,8 @@
data() {
return {
result: {},
queryPath: "/functional/plan/list",
deletePath: "/functional/plan/delete",
queryPath: "/functional/test/list",
deletePath: "/functional/test/delete",
condition: "",
projectId: null,
tableData: [],
@ -139,7 +141,7 @@
},
handleEdit(testPlan) {
this.$router.push({
path: '/functional/plan/edit/' + testPlan.id,
path: '/functional/test/edit/' + testPlan.id,
})
},
handleDelete(testPlan) {

View File

@ -12,7 +12,9 @@
:file-list="fileList">
<i class="el-icon-upload"/>
<div class="el-upload__text" v-html="$t('load_test.upload_tips')"></div>
<div class="el-upload__tip" slot="tip">{{$t('load_test.upload_type')}}</div>
<template v-slot:tip>
<div class="el-upload__tip">{{$t('load_test.upload_type')}}</div>
</template>
</el-upload>
<el-table class="basic-config" :data="tableData">
@ -30,7 +32,7 @@
</el-table-column>
<el-table-column
:label="$t('load_test.last_modify_time')">
<template slot-scope="scope">
<template v-slot:default="scope">
<i class="el-icon-time"/>
<span class="last-modified">{{ scope.row.lastModified | timestampFormatDate }}</span>
</template>
@ -41,7 +43,7 @@
</el-table-column>
<el-table-column
:label="$t('commons.operating')">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="handleDownload(scope.row)" :disabled="!scope.row.id" type="primary" icon="el-icon-download"
size="mini" circle/>
<el-button @click="handleDelete(scope.row, scope.$index)" type="danger" icon="el-icon-delete" size="mini"
@ -61,9 +63,9 @@
data() {
return {
result: {},
getFileMetadataPath: "/functional/plan/file/metadata",
jmxDownloadPath: '/functional/plan/file/download',
jmxDeletePath: '/functional/plan/file/delete',
getFileMetadataPath: "/functional/test/file/metadata",
jmxDownloadPath: '/functional/test/file/download',
jmxDeletePath: '/functional/test/file/delete',
fileList: [],
tableData: [],
};

View File

@ -6,7 +6,7 @@
</div>
<el-menu-item :key="p.id" v-for="p in recentProjects"
:index="'/performance/plan/' + p.id" :route="{name:'perPlan', params:{projectId:p.id, projectName:p.name}}">
:index="'/performance/test/' + p.id" :route="{name:'perPlan', params:{projectId:p.id, projectName:p.name}}">
{{ p.name }}
</el-menu-item>
</el-menu>

View File

@ -35,16 +35,16 @@
<el-tabs v-model="active" type="border-card" :stretch="true">
<el-tab-pane :label="$t('report.test_overview')">
<ms-report-test-overview :id="reportId"/>
<ms-report-test-overview :id="reportId" :status="status"/>
</el-tab-pane>
<el-tab-pane :label="$t('report.test_request_statistics')">
<ms-report-request-statistics :id="reportId"/>
<ms-report-request-statistics :id="reportId" :status="status"/>
</el-tab-pane>
<el-tab-pane :label="$t('report.test_error_log')">
<ms-report-error-log :id="reportId"/>
<ms-report-error-log :id="reportId" :status="status"/>
</el-tab-pane>
<el-tab-pane :label="$t('report.test_log_details')">
<ms-report-log-details :id="reportId"/>
<ms-report-log-details :id="reportId" :status="status"/>
</el-tab-pane>
</el-tabs>
@ -72,6 +72,7 @@
result: {},
active: '0',
reportId: '',
status: '',
reportName: '',
testName: '',
projectName: ''
@ -91,8 +92,23 @@
}
}
},
created() {
mounted() {
this.reportId = this.$route.path.split('/')[4];
this.$get("report/" + this.reportId, res => {
let data = res.data;
this.status = data.status;
if (data.status === "Error") {
this.$message({
type: 'warning',
message: "报告生成错误,无法查看!"
});
} else if (data.status === "Starting") {
this.$message({
type: 'info',
message: "报告生成中...."
});
}
})
this.initBreadcrumb();
},
watch: {
@ -107,6 +123,7 @@
this.projectName = data.projectName;
}
});
window.location.reload();
}
}
}

View File

@ -3,17 +3,19 @@
<div class="main-content">
<el-card>
<div slot="header">
<el-row type="flex" justify="space-between" align="middle">
<span class="title">{{$t('commons.report')}}</span>
<span class="search">
<template v-slot:header>
<div>
<el-row type="flex" justify="space-between" align="middle">
<span class="title">{{$t('commons.report')}}</span>
<span class="search">
<el-input type="text" size="small" :placeholder="$t('report.search_by_name')"
prefix-icon="el-icon-search"
maxlength="60"
v-model="condition" @change="search" clearable/>
</span>
</el-row>
</div>
</el-row>
</div>
</template>
<el-table :data="tableData" class="test-content">
<el-table-column
@ -30,21 +32,21 @@
<el-table-column
width="250"
:label="$t('commons.create_time')">
<template slot-scope="scope">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column
width="250"
:label="$t('commons.update_time')">
<template slot-scope="scope">
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column
prop="status"
:label="$t('commons.status')">
<template slot-scope="{row}">
<template v-slot:default="{row}">
<el-tag size="mini" type="primary" v-if="row.status === 'Starting'">
{{ row.status }}
</el-tag>
@ -52,7 +54,9 @@
{{ row.status }}
</el-tag>
<el-tooltip placement="top" v-else-if="row.status === 'Error'" effect="light">
<div slot="content">{{row.description}}</div>
<template v-slot:content>
<div>{{row.description}}</div>
</template>
<el-tag size="mini" type="danger">
{{ row.status }}
</el-tag>
@ -65,7 +69,7 @@
<el-table-column
width="150"
:label="$t('commons.operating')">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="handleEdit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="handleDelete(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
</template>
@ -145,6 +149,19 @@
this.multipleSelection = val;
},
handleEdit(report) {
if (report.status === "Error") {
this.$message({
type: 'warning',
message: "报告生成错误,无法查看!"
});
return false
} else if (report.status === "Starting") {
this.$message({
type: 'info',
message: "报告生成中..."
});
return false
}
this.$router.push({
path: '/performance/report/view/' + report.id
})

View File

@ -161,27 +161,15 @@
return sums;
}
},
created() {
this.initTableData();
this.getSummaries()
},
props: ['id'],
watch: {
'$route'(to) {
if (to.name === "perReportView") {
let reportId = to.path.split('/')[4];
if(reportId){
this.$get("/report/content/errors/" + reportId, res => {
this.tableData = res.data;
})
this.$get("/report/content/errors_top5/" + reportId, res => {
this.errorTop5 = res.data.errorsTop5List;
this.errorTotal = res.data
})
}
status() {
if ("Completed" === this.status) {
this.initTableData()
this.getSummaries()
}
}
}
},
props: ['id','status']
}
</script>

View File

@ -106,24 +106,15 @@
return sums;
}
},
created() {
this.initTableData()
this.getSummaries()
},
props: ['id'],
watch: {
'$route'(to) {
if (to.name === "perReportView") {
let reportId = to.path.split('/')[4];
if(reportId){
this.$get("/report/content/" + reportId, res => {
this.tableData = res.data.requestStatisticsList;
this.totalInfo = res.data;
})
}
status() {
if ("Completed" === this.status) {
this.initTableData()
this.getSummaries()
}
}
}
},
props: ['id','status']
}
</script>

View File

@ -79,7 +79,51 @@
avgResponseTime: "0",
responseTime90: "0",
avgBandwidth: "0",
option: {},
option: {
legend: {
top: 20,
data: ['Users', 'Hits/s', 'Error(s)']
},
xAxis: {
type: 'category',
},
yAxis: [{
name: 'User',
type: 'value',
min: 0,
splitNumber: 5,
// interval: 10 / 5
},
{
name: 'Hits/s',
type: 'value',
splitNumber: 5,
min: 0,
// max: 5,
// interval: 5 / 5
}
],
series: [
{
name: 'Users',
color: '#0CA74A',
type: 'line',
yAxisIndex: 0
},
{
name: 'Hits/s',
color: '#65A2FF',
type: 'line',
yAxisIndex: 1
},
{
name: 'Error(s)',
color: '#E6113C',
type: 'line',
yAxisIndex: 1
}
]
},
option2: {
legend: {
top: 20,
@ -87,8 +131,7 @@
},
xAxis: {
type: 'category',
data: ["2020-03-25 10:22:01", "2020-03-25 10:22:02", "2020-03-25 10:22:04", "2020-03-25 10:22:06",
"2020-03-25 10:22:07", "2020-03-25 10:22:08", "2020-03-25 10:22:09", "2020-03-25 10:22:10", "2020-03-25 10:22:11", "2020-03-25 10:22:12"]
data: []
},
yAxis: [{
name: 'User',
@ -103,13 +146,13 @@
{
name: 'Users',
color: '#0CA74A',
data: [20, 40, 40, 40, 40, 40, 40],
data: [],
type: 'line',
},
{
name: 'Response Time',
color: '#99743C',
data: [15, 38, 35, 39, 36, 37, 5],
data: [],
type: 'line',
}
]
@ -156,11 +199,15 @@
type: 'value',
min: 0,
splitNumber: 5,
interval: 10 / 5
// interval: 10 / 5
},
{
name: 'Hits/s',
type: 'value'
type: 'value',
splitNumber: 5,
min: 0,
// max: 5,
// interval: 5 / 5
}
],
series: [
@ -187,38 +234,33 @@
let map = this._jsonToMap(data.serices);
let xAxis = data.xAxis;
this.$set(option.xAxis, "data", xAxis.split(','));
let user = map.get("users").slice(0);
let hit = map.get("hits").slice(0);
user.sort(function (a,b) {
return parseInt(a) - parseInt(b);
})
hit.sort(function (a,b) {
return parseFloat(a) - parseFloat(b);
})
this.$set(option.yAxis[0], "max",user[user.length-1]);
this.$set(option.yAxis[0], "interval", user[user.length-1]/5);
this.$set(option.yAxis[1], "max", hit[hit.length-1]);
this.$set(option.yAxis[1], "interval", hit[hit.length-1]/5);
this.$set(option.series[0], "data", map.get("users"));
this.$set(option.series[1], "data", map.get("hits"));
this.$set(option.series[2], "data", map.get("errors"));
return option;
}
},
created() {
this.initTableData()
},
props: ['id'],
watch: {
'$route'(to) {
if (to.name === "perReportView") {
let reportId = to.path.split('/')[4];
if(reportId){
this.$get("/report/content/testoverview/" + reportId, res => {
let data = res.data;
this.maxUsers = data.maxUsers;
this.avgThroughput = data.avgThroughput;
this.errors = data.errors;
this.avgResponseTime = data.avgResponseTime;
this.responseTime90 = data.responseTime90;
this.avgBandwidth = data.avgBandwidth;
})
this.$get("/report/content/load_chart/" + reportId, res => {
let data = res.data;
this.option1 = this.generateOption(data);
})
}
status() {
if ("Completed" === this.status) {
this.initTableData()
}
}
}
},
props: ['id', 'status']
}
</script>

View File

@ -5,14 +5,16 @@
<el-row>
<el-col :span="10">
<el-input :placeholder="$t('load_test.input_name')" v-model="testPlan.name" class="input-with-select">
<el-select v-model="testPlan.projectId" slot="prepend" :placeholder="$t('load_test.select_project')">
<el-option
v-for="item in projects"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<template v-slot:prepend>
<el-select v-model="testPlan.projectId" :placeholder="$t('load_test.select_project')">
<el-option
v-for="item in projects"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</template>
</el-input>
</el-col>
<el-button type="primary" plain @click="save">{{$t('commons.save')}}</el-button>
@ -54,9 +56,9 @@
result: {},
testPlan: {},
listProjectPath: "/project/listAll",
savePath: "/testplan/save",
editPath: "/testplan/edit",
runPath: "/testplan/run",
savePath: "/performance/save",
editPath: "/performance/edit",
runPath: "/performance/run",
projects: [],
active: '0',
tabs: [{
@ -88,7 +90,7 @@
let testId = to.path.split('/')[4]; // find testId
if (testId) {
this.result = this.$get('/testplan/get/' + testId, response => {
this.result = this.$get('/performance/get/' + testId, response => {
if (response.data) {
this.testPlan = response.data;
}
@ -100,7 +102,7 @@
created() {
let testId = this.$route.path.split('/')[4];
if (testId) {
this.result = this.$get('/testplan/get/' + testId, response => {
this.result = this.$get('/performance/get/' + testId, response => {
this.testPlan = response.data;
});
}
@ -126,7 +128,7 @@
type: 'success'
});
this.$refs.advancedConfig.cancelAllEdit();
this.$router.push({path: '/performance/plan/all'})
this.$router.push({path: '/performance/test/all'})
});
},
saveAndRun() {
@ -188,7 +190,7 @@
};
},
cancel() {
this.$router.push({path: '/performance/plan/all'})
this.$router.push({path: '/performance/test/all'})
},
validTestPlan() {
if (!this.testPlan.name) {

View File

@ -4,7 +4,7 @@
<i class="el-icon-time"/>
{{$t('load_test.recent')}}
</div>
<el-menu-item :key="t.id" v-for="t in recentTestPlans" :index="'/performance/plan/edit/' + t.id">
<el-menu-item :key="t.id" v-for="t in recentTestPlans" :index="'/performance/test/edit/' + t.id">
{{ t.name }}
</el-menu-item>
</el-menu>
@ -20,7 +20,7 @@
const roles = rolesString.split(',');
if (roles.indexOf(ROLE_TEST_MANAGER) > -1 || roles.indexOf(ROLE_TEST_USER) > -1 || roles.indexOf(ROLE_TEST_VIEWER) > -1) {
this.$get('/testplan/recent/5', (response) => {
this.$get('/performance/recent/5', (response) => {
this.recentTestPlans = response.data;
});
}

View File

@ -2,17 +2,19 @@
<div class="testplan-container" v-loading="result.loading">
<div class="main-content">
<el-card>
<div slot="header">
<el-row type="flex" justify="space-between" align="middle">
<span class="title">{{$t('commons.test')}}</span>
<span class="search">
<template v-slot:header>
<div>
<el-row type="flex" justify="space-between" align="middle">
<span class="title">{{$t('commons.test')}}</span>
<span class="search">
<el-input type="text" size="small" :placeholder="$t('load_test.search_by_name')"
prefix-icon="el-icon-search"
maxlength="60"
v-model="condition" @change="search" clearable/>
</span>
</el-row>
</div>
</el-row>
</div>
</template>
<el-table :data="tableData" class="test-content">
<el-table-column
prop="name"
@ -34,21 +36,21 @@
<el-table-column
width="250"
:label="$t('commons.create_time')">
<template slot-scope="scope">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column
width="250"
:label="$t('commons.update_time')">
<template slot-scope="scope">
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column
width="150"
:label="$t('commons.operating')">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="handleEdit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="handleDelete(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
</template>
@ -81,8 +83,8 @@
data() {
return {
result: {},
queryPath: "/testplan/list",
deletePath: "/testplan/delete",
queryPath: "/performance/list",
deletePath: "/performance/delete",
condition: "",
projectId: null,
tableData: [],
@ -139,7 +141,7 @@
},
handleEdit(testPlan) {
this.$router.push({
path: '/performance/plan/edit/' + testPlan.id,
path: '/performance/test/edit/' + testPlan.id,
})
},
handleDelete(testPlan) {

View File

@ -15,7 +15,7 @@
<el-table-column
:label="$t('load_test.domain')"
show-overflow-tooltip>
<template slot-scope="{row}">
<template v-slot:default="{row}">
<template v-if="row.edit">
<el-input v-model="row.domain" class="edit-input" size="mini"/>
</template>
@ -25,7 +25,7 @@
<el-table-column
:label="$t('load_test.enable')"
show-overflow-tooltip>
<template slot-scope="{row}">
<template v-slot:default="{row}">
<el-switch
:disabled="!row.edit"
size="mini"
@ -38,7 +38,7 @@
<el-table-column
:label="$t('load_test.ip')"
show-overflow-tooltip>
<template slot-scope="{row}">
<template v-slot:default="{row}">
<template v-if="row.edit">
<el-input v-model="row.ip" class="edit-input" size="mini"/>
</template>
@ -46,7 +46,7 @@
</template>
</el-table-column>
<el-table-column align="center">
<template slot-scope="{row, $index}">
<template v-slot:default="{row, $index}">
<template v-if="row.edit">
<el-button
class="cancel-btn"
@ -99,7 +99,7 @@
<el-table-column
:label="$t('load_test.param_name')"
show-overflow-tooltip>
<template slot-scope="{row}">
<template v-slot:default="{row}">
<template v-if="row.edit">
<el-input v-model="row.name" class="edit-input" size="mini"/>
</template>
@ -109,7 +109,7 @@
<el-table-column
:label="$t('load_test.enable')"
show-overflow-tooltip>
<template slot-scope="{row}">
<template v-slot:default="{row}">
<el-switch
:disabled="!row.edit"
size="mini"
@ -122,7 +122,7 @@
<el-table-column
:label="$t('load_test.param_value')"
show-overflow-tooltip>
<template slot-scope="{row}">
<template v-slot:default="{row}">
<template v-if="row.edit">
<el-input v-model="row.value" class="edit-input" size="mini"/>
</template>
@ -130,7 +130,7 @@
</template>
</el-table-column>
<el-table-column align="center">
<template slot-scope="{row, $index}">
<template v-slot:default="{row, $index}">
<template v-if="row.edit">
<el-button
class="cancel-btn"
@ -245,7 +245,7 @@
});
},
getAdvancedConfig(testId) {
this.$get('/testplan/get-advanced-config/' + testId, (response) => {
this.$get('/performance/get-advanced-config/' + testId, (response) => {
if (response.data) {
let data = JSON.parse(response.data);
this.timeout = data.timeout || 10;

View File

@ -13,7 +13,9 @@
:file-list="fileList">
<i class="el-icon-upload"/>
<div class="el-upload__text" v-html="$t('load_test.upload_tips')"></div>
<div class="el-upload__tip" slot="tip">{{$t('load_test.upload_type')}}</div>
<template v-slot:tip>
<div class="el-upload__tip">{{$t('load_test.upload_type')}}</div>
</template>
</el-upload>
<el-table class="basic-config" :data="tableData">
@ -31,14 +33,14 @@
</el-table-column>
<el-table-column
:label="$t('load_test.last_modify_time')">
<template slot-scope="scope">
<template v-slot:default="scope">
<i class="el-icon-time"/>
<span class="last-modified">{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column
:label="$t('commons.operating')">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="handleDownload(scope.row)" :disabled="!scope.row.id" type="primary" icon="el-icon-download"
size="mini" circle/>
<el-button @click="handleDelete(scope.row, scope.$index)" type="danger" icon="el-icon-delete" size="mini"
@ -58,9 +60,9 @@
data() {
return {
result: {},
getFileMetadataPath: "/testplan/file/metadata",
jmxDownloadPath: '/testplan/file/download',
jmxDeletePath: '/testplan/file/delete',
getFileMetadataPath: "/performance/file/metadata",
jmxDownloadPath: '/performance/file/download',
jmxDeletePath: '/performance/file/delete',
fileList: [],
tableData: [],
uploadList: [],

View File

@ -155,7 +155,7 @@
getLoadConfig(testId) {
if (testId) {
this.$get('/testplan/get-load-config/' + testId, (response) => {
this.$get('/performance/get-load-config/' + testId, (response) => {
if (response.data) {
let data = JSON.parse(response.data);

View File

@ -2,7 +2,7 @@
<div class="project-container">
<div class="main-content">
<el-card v-loading="result.loading">
<div slot="header">
<template v-slot:header>
<el-row type="flex" justify="space-between" align="middle">
<span class="title">
{{$t('commons.project')}}
@ -14,13 +14,13 @@
maxlength="60" v-model="condition" clearable/>
</span>
</el-row>
</div>
</template>
<el-table :data="items" style="width: 100%">
<el-table-column prop="name" :label="$t('commons.name')"/>
<el-table-column prop="description" :label="$t('commons.description')"/>
<el-table-column prop="workspaceName" label="所属工作空间"/>
<el-table-column>
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="edit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="del(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
</template>
@ -54,9 +54,11 @@
<el-input type="textarea" v-model="form.description"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submit('form')" size="medium">{{$t('commons.save')}}</el-button>
</div>
<template v-slot:footer>
<div class="dialog-footer">
<el-button type="primary" @click="submit('form')" size="medium">{{$t('commons.save')}}</el-button>
</div>
</template>
</el-dialog>
</div>
</div>
@ -65,7 +67,7 @@
<script>
import MsCreateBox from "../settings/CreateBox";
import {Message} from "element-ui";
import {TokenKey,CURRENT_PROJECT} from "../../../common/constants";
import {CURRENT_PROJECT, TokenKey} from "../../../common/constants";
export default {
name: "MsProject",

View File

@ -1,7 +1,7 @@
<template>
<el-menu menu-trigger="click" :default-active="$route.path" router>
<el-submenu index="1" v-permission="['admin']">
<template slot="title">
<template v-slot:title>
<font-awesome-icon class="icon account" :icon="['far', 'address-card']" size="lg"/>
<span>{{$t('commons.system')}}</span>
</template>
@ -12,7 +12,7 @@
</el-submenu>
<el-submenu index="2" v-permission="['org_admin']" v-if="isCurrentOrganizationAdmin">
<template slot="title">
<template v-slot:title>
<font-awesome-icon class="icon organization" :icon="['far', 'building']" size="lg"/>
<span>{{$t('commons.organization')}}</span>
</template>
@ -23,7 +23,7 @@
</el-submenu>
<el-submenu index="3" v-permission="['test_manager','test_user','test_viewer']" v-if="isCurrentWorkspaceUser">
<template slot="title">
<template v-slot:title>
<font-awesome-icon class="icon workspace" :icon="['far', 'list-alt']" size="lg"/>
<span>{{$t('commons.workspace')}}</span>
</template>
@ -31,7 +31,7 @@
</el-submenu>
<el-submenu index="4">
<template slot="title">
<template v-slot:title>
<font-awesome-icon class="icon" :icon="['far', 'user']" size="lg"/>
<span>{{$t('commons.personal_info')}}</span>
</template>

View File

@ -1,31 +1,33 @@
<template>
<div v-loading="result.loading">
<el-card>
<div slot="header">
<el-row type="flex" justify="space-between" align="middle">
<template v-slot:header>
<div >
<el-row type="flex" justify="space-between" align="middle">
<span class="title">{{$t('commons.member')}}
<ms-create-box :tips="btnTips" :exec="create"/>
</span>
<span class="search">
<span class="search">
<el-input type="text" size="small" :placeholder="$t('member.search_by_name')"
prefix-icon="el-icon-search"
maxlength="60" v-model="condition" @change="search" clearable/>
</span>
</el-row>
</div>
</el-row>
</div>
</template>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="name" :label="$t('commons.username')"/>
<el-table-column prop="email" :label="$t('commons.email')"/>
<el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column prop="roles" :label="$t('commons.role')" width="140">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-tag v-for="(role, index) in scope.row.roles" :key="index" size="mini" effect="dark">
{{ role.name }}
</el-tag>
</template>
</el-table-column>
<el-table-column>
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="edit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="del(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
</template>
@ -75,9 +77,11 @@
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
<el-dialog :title="$t('member.modify')" :visible.sync="updateVisible" width="30%" :destroy-on-close="true" @close="closeFunc">
@ -105,9 +109,11 @@
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="updateOrgMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateOrgMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
</div>
</template>

View File

@ -1,28 +1,30 @@
<template>
<div>
<el-card v-loading="result.loading">
<div slot="header">
<el-row type="flex" justify="space-between" align="middle">
<template v-slot:header>
<div>
<el-row type="flex" justify="space-between" align="middle">
<span class="title">{{$t('commons.workspace')}}
<ms-create-box :tips="btnTips" :exec="create"/>
</span>
<span class="search">
<span class="search">
<el-input type="text" size="small" :placeholder="$t('workspace.search_by_name')"
prefix-icon="el-icon-search"
maxlength="60" v-model="condition" clearable/>
</span>
</el-row>
</div>
</el-row>
</div>
</template>
<el-table :data="items" style="width: 100%">
<el-table-column prop="name" :label="$t('commons.name')"/>
<el-table-column prop="description" :label="$t('commons.description')"/>
<el-table-column :label="$t('commons.member')">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button type="text" class="member-size" @click="cellClick(scope.row)">{{scope.row.memberSize}}</el-button>
</template>
</el-table-column>
<el-table-column>
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="edit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="del(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
</template>
@ -56,9 +58,11 @@
<el-input type="textarea" v-model="form.description"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submit('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="submit('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
<!-- dialog of workspace member -->
@ -80,14 +84,14 @@
<el-table-column prop="email" :label="$t('commons.email')"/>
<el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column :label="$t('commons.role')" width="120">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-tag v-for="(role, index) in scope.row.roles" :key="index" size="mini" effect="dark" type="success">
{{ role.name }}
</el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="editMember(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="delMember(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
</template>
@ -138,9 +142,11 @@
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
<!-- update workspace member dialog -->
@ -169,9 +175,11 @@
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="updateOrgMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateOrgMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
</div>

View File

@ -2,11 +2,13 @@
<div v-loading="result.loading">
<el-card>
<div slot="header">
<el-row type="flex" justify="space-between" align="middle">
<span class="title">{{$t('commons.personal_info')}}</span>
</el-row>
</div>
<template v-slot:header>
<div>
<el-row type="flex" justify="space-between" align="middle">
<span class="title">{{$t('commons.personal_info')}}</span>
</el-row>
</div>
</template>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="id" label="ID"/>
@ -14,12 +16,12 @@
<el-table-column prop="email" :label="$t('commons.email')"/>
<el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column prop="createTime" :label="$t('commons.create_time')" width="180">
<template slot-scope="scope">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="edit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
</template>
</el-table-column>
@ -40,9 +42,11 @@
<el-input v-model="form.phone" autocomplete="off"/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="updateUser('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateUser('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
</el-card>

View File

@ -2,29 +2,31 @@
<div v-loading="result.loading">
<el-card>
<div slot="header">
<el-row type="flex" justify="space-between" align="middle">
<template v-slot:header>
<div>
<el-row type="flex" justify="space-between" align="middle">
<span class="title">{{$t('commons.organization')}}
<ms-create-box :tips="btnTips" :exec="create"/>
</span>
<span class="search">
<span class="search">
<el-input type="text" size="small" :placeholder="$t('organization.search_by_name')" prefix-icon="el-icon-search"
maxlength="60" v-model="condition" clearable/>
maxlength="60" v-model="condition" clearable/>
</span>
</el-row>
</div>
</el-row>
</div>
</template>
<!-- system menu organization table-->
<el-table :data="tableData" style="width: 100%">
<el-table-column type="selection" width="55"/>
<el-table-column prop="name" :label="$t('commons.name')"/>
<el-table-column prop="description" :label="$t('commons.description')"/>
<el-table-column :label="$t('commons.member')">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button type="text" class="member-size" @click="cellClick(scope.row)">{{scope.row.memberSize}}</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="edit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="del(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
</template>
@ -67,14 +69,14 @@
<el-table-column prop="email" :label="$t('commons.email')"/>
<el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column :label="$t('commons.role')" width="140">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-tag v-for="(role, index) in scope.row.roles" :key="index" size="mini" effect="dark">
{{ role.name }}
</el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="editMember(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="delMember(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
</template>
@ -109,9 +111,11 @@
<el-input v-model="form.description" autocomplete="off"/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="createOrganization('createOrganization')" size="medium">{{$t('commons.save')}}</el-button>
</span>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="createOrganization('createOrganization')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
<!-- update organization form -->
@ -124,9 +128,11 @@
<el-input v-model="form.description" autocomplete="off"/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="updateOrganization('updateOrganizationForm')" size="medium">{{$t('organization.modify')}}</el-button>
</span>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateOrganization('updateOrganizationForm')" size="medium">{{$t('organization.modify')}}</el-button>
</span>
</template>
</el-dialog>
<!-- add organization member form -->
@ -155,9 +161,11 @@
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
<!-- update organization member form -->
@ -186,9 +194,11 @@
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="updateOrgMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateOrgMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
</div>

View File

@ -1,32 +1,34 @@
<template>
<div>
<el-card v-loading="result.loading">
<div slot="header">
<el-row type="flex" justify="space-between" align="middle">
<template v-slot:header>
<div>
<el-row type="flex" justify="space-between" align="middle">
<span class="title">
{{$t('commons.workspace')}}
<ms-create-box :tips="btnTips" :exec="create"/>
</span>
<span class="search">
<span class="search">
<el-input type="text" size="small"
:placeholder="$t('workspace.search_by_name')"
prefix-icon="el-icon-search"
maxlength="60" v-model="condition" clearable/>
</span>
</el-row>
</div>
</el-row>
</div>
</template>
<!-- workspace table -->
<el-table :data="items" style="width: 100%">
<el-table-column prop="name" :label="$t('commons.name')"/>
<el-table-column prop="description" :label="$t('commons.description')"/>
<el-table-column prop="organizationName" :label="$t('workspace.organization_name')"/>
<el-table-column :label="$t('commons.member')">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button type="text" class="member-size" @click="cellClick(scope.row)">{{scope.row.memberSize}}</el-button>
</template>
</el-table-column>
<el-table-column>
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="edit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="del(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
</template>
@ -71,9 +73,11 @@
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submit('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="submit('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
<!-- update workspace dialog -->
@ -96,9 +100,12 @@
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="updateWorkspace('updateForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateWorkspace('updateForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
<!-- dialog of workspace member -->
@ -120,14 +127,14 @@
<el-table-column prop="email" :label="$t('commons.email')"/>
<el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column :label="$t('commons.role')" width="120">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-tag v-for="(role, index) in scope.row.roles" :key="index" size="mini" effect="dark" type="success">
{{ role.name }}
</el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="editMember(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="delMember(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
</template>
@ -178,9 +185,11 @@
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
<!-- update workspace member dialog -->
@ -209,9 +218,12 @@
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="updateOrgMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateOrgMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
</div>

View File

@ -2,28 +2,30 @@
<div v-loading="loading">
<el-card>
<div slot="header">
<el-row type="flex" justify="space-between" align="middle">
<template v-slot:header>
<div>
<el-row type="flex" justify="space-between" align="middle">
<span class="title">测试资源池
<ms-create-box :tips="btnTips" :exec="create"/>
</span>
<span class="search">
<span class="search">
<el-input type="text" size="small" placeholder="根据名称搜索" prefix-icon="el-icon-search"
maxlength="60" v-model="condition" @change="search" clearable/>
</span>
</el-row>
</div>
</el-row>
</div>
</template>
<el-table :data="items" style="width: 100%">
<el-table-column prop="name" label="名称"/>
<el-table-column prop="description" label="描述"/>
<el-table-column prop="type" label="类型">
<template slot-scope="scope">
<template v-slot:default="scope">
<span v-if="scope.row.type === 'NODE'">独立节点</span>
<span v-if="scope.row.type === 'K8S'">Kubernetes</span>
</template>
</el-table-column>
<el-table-column prop="status" label="启用/禁用">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-switch v-model="scope.row.status"
active-color="#13ce66"
inactive-color="#ff4949"
@ -34,17 +36,17 @@
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="180">
<template slot-scope="scope">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column prop="updateTime" label="更新时间" width="180">
<template slot-scope="scope">
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column>
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="edit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="del(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
</template>
@ -138,10 +140,12 @@
</div>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="createTestResourcePool('createTestResourcePoolForm')"
size="medium">创建</el-button>
</span>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="createTestResourcePool('createTestResourcePoolForm')"
size="medium">创建</el-button>
</span>
</template>
</el-dialog>
<el-dialog title="修改资源池" :visible.sync="updateVisible" width="70%" :destroy-on-close="true"
@ -209,10 +213,12 @@
</div>
</div>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="updateTestResourcePool('updateTestResourcePoolForm')"
size="medium">修改</el-button>
</span>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateTestResourcePool('updateTestResourcePoolForm')"
size="medium">修改</el-button>
</span>
</template>
</el-dialog>
</div>

View File

@ -2,18 +2,20 @@
<div v-loading="result.loading">
<el-card>
<div slot="header">
<el-row type="flex" justify="space-between" align="middle">
<template v-slot:header>
<div>
<el-row type="flex" justify="space-between" align="middle">
<span class="title">{{$t('commons.member')}}
<ms-create-box :tips="btnTips" :exec="create"/>
</span>
<span class="search">
<span class="search">
<el-input type="text" size="small" :placeholder="$t('member.search_by_name')"
prefix-icon="el-icon-search" maxlength="60" @change="search"
v-model="condition" clearable/>
</span>
</el-row>
</div>
</el-row>
</div>
</template>
<el-table :data="tableData" style="width: 100%">
<el-table-column type="selection" width="55"/>
<el-table-column prop="id" label="ID"/>
@ -21,7 +23,7 @@
<el-table-column prop="email" :label="$t('commons.email')"/>
<el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column prop="status" :label="$t('commons.status')" width="100">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-switch v-model="scope.row.status"
active-color="#13ce66"
inactive-color="#ff4949"
@ -32,12 +34,12 @@
</template>
</el-table-column>
<el-table-column prop="createTime" :label="$t('commons.create_time')" width="180">
<template slot-scope="scope">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="edit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="del(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
</template>
@ -79,9 +81,11 @@
<el-input v-model="form.phone" autocomplete="off"/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="createUser('createUserForm')" size="medium">创建</el-button>
</span>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="createUser('createUserForm')" size="medium">创建</el-button>
</span>
</template>
</el-dialog>
<el-dialog :title="$t('user.modify')" :visible.sync="updateVisible" width="30%" :destroy-on-close="true" @close="closeFunc">
@ -99,9 +103,11 @@
<el-input v-model="form.phone" autocomplete="off"/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="updateUser('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateUser('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
</div>

View File

@ -1,30 +1,32 @@
<template>
<div v-loading="result.loading">
<el-card>
<div slot="header">
<el-row type="flex" justify="space-between" align="middle" v-permission="['test_manager']">
<template v-slot:header>
<div>
<el-row type="flex" justify="space-between" align="middle" v-permission="['test_manager']">
<span class="title">{{$t('commons.member')}}
<ms-create-box :tips="btnTips" :exec="create"/>
</span>
<span class="search">
<span class="search">
<el-input type="text" size="small" placeholder="根据用户名搜索" prefix-icon="el-icon-search"
maxlength="60" v-model="condition" @change="search" clearable/>
</span>
</el-row>
</div>
</el-row>
</div>
</template>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="name" :label="$t('commons.username')"/>
<el-table-column prop="email" :label="$t('commons.email')"/>
<el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column prop="roles" label="角色" width="120">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-tag v-for="(role, index) in scope.row.roles" :key="index" size="mini" effect="dark" type="success">
{{ role.name }}
</el-tag>
</template>
</el-table-column>
<el-table-column>
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="edit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle v-permission="['test_manager']"/>
<el-button @click="del(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle v-permission="['test_manager']"/>
</template>
@ -74,9 +76,11 @@
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
<el-dialog title="修改成员" :visible.sync="updateVisible" width="30%" :destroy-on-close="true" @close="closeFunc">
@ -104,9 +108,11 @@
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="updateWorkspaceMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateWorkspaceMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
</div>

View File

@ -4,7 +4,7 @@
<i class="el-icon-time"/>
{{$t('load_test.recent')}}
</div>
<el-menu-item :key="t.id" v-for="t in recentTestPlans" :index="'/performance/plan/edit/' + t.id">
<el-menu-item :key="t.id" v-for="t in recentTestPlans" :index="'/performance/test/edit/' + t.id">
{{ t.name }}
</el-menu-item>
</el-menu>
@ -20,7 +20,7 @@
const roles = rolesString.split(',');
if (roles.indexOf(ROLE_TEST_MANAGER) > -1 || roles.indexOf(ROLE_TEST_USER) > -1 || roles.indexOf(ROLE_TEST_VIEWER) > -1) {
this.$get('/testplan/recent/5', (response) => {
this.$get('/performance/recent/5', (response) => {
this.recentTestPlans = response.data;
});
}

View File

@ -6,7 +6,7 @@
<el-menu :unique-opened="true" mode="horizontal" active-text-color="write"
class="project_menu">
<el-submenu index="1" popper-class="submenu">
<template slot="title">
<template v-slot:title>
{{currentProject == null ? '' : currentProject.name}}
</template>
<div style="height:400px;">

View File

@ -3,56 +3,62 @@
<div>
<el-input :placeholder="$t('test_track.search_module')" v-model="filterText"
size="small">
<el-button slot="append" icon="el-icon-folder-add" @click="openEditNodeDialog('add')"></el-button>
<template v-slot:append>
<el-button icon="el-icon-folder-add" @click="openEditNodeDialog('add')"></el-button>
</template>
</el-input>
<el-tree
class="filter-tree node-tree"
:data="treeNodes"
node-key="id"
@node-drag-end="handleDragEnd"
:filter-node-method="filterNode"
:expand-on-click-node="false"
draggable
ref="tree">
class="filter-tree node-tree"
:data="treeNodes"
node-key="id"
@node-drag-end="handleDragEnd"
:filter-node-method="filterNode"
:expand-on-click-node="false"
draggable
ref="tree">
<span class="custom-tree-node father" slot-scope="{ node, data }" @click="selectNode(node)">
<template v-slot:default="{node,data}">
<span class="custom-tree-node father" @click="selectNode(node)">
<span>{{node.label}}</span>
<el-dropdown class="node-dropdown child">
<span class="el-dropdown-link">
<i class="el-icon-folder-add"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>
<div @click="openEditNodeDialog('edit', data)">{{$t('test_track.rename')}}</div>
</el-dropdown-item>
<el-dropdown-item >
<div @click="openEditNodeDialog('add', data)">{{$t('test_track.add_submodule')}}</div>
</el-dropdown-item>
<el-dropdown-item>
<div @click="remove(node, data)">{{$t('commons.delete')}}</div>
</el-dropdown-item>
</el-dropdown-menu>
<span class="el-dropdown-link">
<i class="el-icon-folder-add"></i>
</span>
<el-dropdown-menu v-slot:default>
<el-dropdown-item>
<div @click="openEditNodeDialog('edit', data)">{{$t('test_track.rename')}}</div>
</el-dropdown-item>
<el-dropdown-item>
<div @click="openEditNodeDialog('add', data)">{{$t('test_track.add_submodule')}}</div>
</el-dropdown-item>
<el-dropdown-item>
<div @click="remove(node, data)">{{$t('commons.delete')}}</div>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</span>
</template>
</el-tree>
<el-dialog :title="$t('test_track.add_module')" :visible.sync="dialogFormVisible" width="500px">
<el-row type="flex" justify="center">
<el-col :span="18">
<el-form :model="form">
<el-form-item :label="$t('test_track.module_name')" :label-width="formLabelWidth">
<el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item>
</el-form>
</el-col>
</el-row>
<el-row type="flex" justify="center">
<el-col :span="18">
<el-form :model="form">
<el-form-item :label="$t('test_track.module_name')" :label-width="formLabelWidth">
<el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item>
</el-form>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">{{$t('test_track.cancel')}}</el-button>
<el-button type="primary" @click="editNode">{{$t('test_track.confirm')}}</el-button>
</div>
<template v-slot:footer>
<div class="dialog-footer">
<el-button @click="dialogFormVisible = false">{{$t('test_track.cancel')}}</el-button>
<el-button type="primary" @click="editNode">{{$t('test_track.confirm')}}</el-button>
</div>
</template>
</el-dialog>
</div>
@ -63,146 +69,147 @@
import {CURRENT_PROJECT} from '../../../../../common/constants';
export default {
name: "NodeTree",
data() {
return {
filterText: '',
defaultProps: {
children: 'children',
label: 'label'
},
form: {
name: '',
},
formLabelWidth: '80px',
dialogTableVisible: false,
dialogFormVisible: false,
editType: '',
editData: {},
treeNodes: [],
defaultKeys: []
};
export default {
name: "NodeTree",
data() {
return {
filterText: '',
defaultProps: {
children: 'children',
label: 'label'
},
form: {
name: '',
},
formLabelWidth: '80px',
dialogTableVisible: false,
dialogFormVisible: false,
editType: '',
editData: {},
treeNodes: [],
defaultKeys: []
};
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
}
},
created() {
this.getNodeTree();
},
methods: {
handleDragEnd(draggingNode, dropNode, dropType, ev) {
let param = {};
param.id = draggingNode.data.id;
if (dropType === 'inner') {
param.pId = dropNode.data.id;
param.level = dropNode.data.level + 1;
} else {
if (dropNode.parent.id === 0) {
param.pId = 0;
param.level = 1;
} else {
param.pId = dropNode.parent.data.id;
param.level = dropNode.parent.data.level + 1;
}
}
this.$post('/case/node/edit', param);
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
remove(node, data) {
this.$alert(this.$t('test_track.delete_module_confirm') + data.label + "" +
this.$t('test_track.delete_module_resource') + "", '', {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {
let nodeIds = [];
this.getChildNodeId(node, nodeIds);
this.$post("/case/node/delete", nodeIds, () => {
const parent = node.parent;
const children = parent.data.children || parent.data;
const index = children.findIndex(d => d.id === data.id);
children.splice(index, 1);
this.$emit("refresh");
});
}
}
});
},
selectNode(node) {
let nodeIds = [];
this.getChildNodeId(node, nodeIds);
this.$emit("nodeSelectEvent", nodeIds);
},
getChildNodeId(rootNode, nodeIds) {
//ID
nodeIds.push(rootNode.data.id);
for (let i = 0; i < rootNode.childNodes.length; i++) {
this.getChildNodeId(rootNode.childNodes[i], nodeIds);
}
return nodeIds;
},
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
editNode() {
this.saveNode(this.editType, this.editData);
this.dialogFormVisible = false;
},
openEditNodeDialog(type, data) {
this.editType = type;
this.editData = data;
this.dialogFormVisible = true;
},
getNodeTree() {
if (localStorage.getItem(CURRENT_PROJECT)) {
let projectId = JSON.parse(localStorage.getItem(CURRENT_PROJECT)).id;
this.$get("/case/node/list/" + projectId, response => {
this.treeNodes = response.data;
});
}
},
created() {
this.getNodeTree();
},
methods: {
handleDragEnd(draggingNode, dropNode, dropType, ev) {
let param = {};
param.id = draggingNode.data.id;
if(dropType === 'inner'){
param.pId = dropNode.data.id;
param.level = dropNode.data.level + 1;
} else {
if(dropNode.parent.id === 0){
param.pId = 0;
param.level = 1;
saveNode(type, pNode) {
let param = {};
let url = '';
if (type === 'add') {
url = '/case/node/add';
param.level = 1;
if (pNode) {
//
param.pId = pNode.id;
param.level = pNode.level + 1;
}
} else if (type === 'edit') {
url = '/case/node/edit';
param.id = this.editData.id
}
param.name = this.form.name;
param.label = this.form.name;
if (localStorage.getItem(CURRENT_PROJECT)) {
param.projectId = JSON.parse(localStorage.getItem(CURRENT_PROJECT)).id;
}
this.$post(url, param, response => {
if (type === 'edit') {
this.editData.label = param.label;
}
if (type === 'add') {
param.id = response.data;
if (pNode) {
this.$refs.tree.append(param, pNode);
} else {
param.pId = dropNode.parent.data.id;
param.level = dropNode.parent.data.level + 1;
this.treeNodes.push(param);
}
}
this.$post('/case/node/edit', param);
},
remove(node, data) {
this.$alert(this.$t('test_track.delete_module_confirm') + data.label + "" +
this.$t('test_track.delete_module_resource') + "", '', {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {
let nodeIds = [];
this.getChildNodeId(node, nodeIds);
this.$post("/case/node/delete", nodeIds, () => {
const parent = node.parent;
const children = parent.data.children || parent.data;
const index = children.findIndex(d => d.id === data.id);
children.splice(index, 1);
this.$emit("refresh");
});
}
}
});
},
selectNode(node) {
let nodeIds = [];
this.getChildNodeId(node, nodeIds);
this.$emit("nodeSelectEvent", nodeIds);
},
getChildNodeId(rootNode, nodeIds) {
//ID
nodeIds.push(rootNode.data.id);
for (let i = 0; i < rootNode.childNodes.length; i++){
this.getChildNodeId(rootNode.childNodes[i], nodeIds);
}
return nodeIds;
},
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
editNode() {
this.saveNode(this.editType, this.editData);
this.dialogFormVisible = false;
},
openEditNodeDialog(type, data) {
this.editType = type;
this.editData = data;
this.dialogFormVisible = true;
},
getNodeTree() {
if(localStorage.getItem(CURRENT_PROJECT)) {
let projectId = JSON.parse(localStorage.getItem(CURRENT_PROJECT)).id;
this.$get("/case/node/list/" + projectId, response => {
this.treeNodes = response.data;
});
}
},
saveNode(type, pNode) {
let param = {};
let url = '';
if(type === 'add'){
url = '/case/node/add';
param.level = 1;
if(pNode){
//
param.pId = pNode.id;
param.level = pNode.level + 1;
}
} else if(type === 'edit'){
url = '/case/node/edit';
param.id = this.editData.id
}
param.name = this.form.name;
param.label = this.form.name;
if(localStorage.getItem(CURRENT_PROJECT)) {
param.projectId = JSON.parse(localStorage.getItem(CURRENT_PROJECT)).id;
}
this.$post(url, param, response => {
if(type === 'edit'){
this.editData.label = param.label;
} if(type === 'add') {
param.id = response.data;
if(pNode){
this.$refs.tree.append(param, pNode);
} else {
this.treeNodes.push(param);
}
}
});
this.form.name = '';
},
}
});
this.form.name = '';
},
}
}
</script>
<style scoped>
@ -211,6 +218,7 @@
cursor: pointer;
color: #409EFF;
}
.el-icon-arrow-down {
font-size: 12px;
}
@ -229,12 +237,12 @@
margin-top: 15px;
}
.father .child{
display:none;
.father .child {
display: none;
}
.father:hover .child{
display:block;
.father:hover .child {
display: block;
}
</style>

View File

@ -107,7 +107,7 @@
highlight-current-row>
<el-table-column :label="$t('test_track.number')" prop="num" min-width="15%"></el-table-column>
<el-table-column :label="$t('test_track.step_desc')" prop="desc" min-width="35%">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-input
size="small"
v-model="scope.row.desc"
@ -117,7 +117,7 @@
</template>
</el-table-column>
<el-table-column :label="$t('test_track.expected_results')" prop="result" min-width="35%">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-input
size="small"
v-model="scope.row.result"
@ -127,7 +127,7 @@
</template>
</el-table-column>
<el-table-column :label="$t('commons.input_content')" min-width="15%">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button
type="primary"
icon="el-icon-plus"
@ -161,17 +161,19 @@
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
@click="dialogFormVisible = false">
{{$t('test_track.cancel')}}
</el-button>
<el-button
type="primary"
@click="saveCase">
{{$t('test_track.confirm')}}
</el-button>
</div>
<template v-slot:footer>
<div class="dialog-footer">
<el-button
@click="dialogFormVisible = false">
{{$t('test_track.cancel')}}
</el-button>
<el-button
type="primary"
@click="saveCase">
{{$t('test_track.confirm')}}
</el-button>
</div>
</template>
</el-dialog>
</div>
@ -183,7 +185,7 @@
import {CURRENT_PROJECT} from '../../../../../common/constants';
export default {
export default {
name: "TestCaseEdit",
data() {
return {

View File

@ -2,33 +2,35 @@
<el-main>
<el-card>
<div slot="header">
<el-row type="flex" justify="space-between" align="middle">
<el-col :span="5">
<span class="title">{{$t('test_track.test_case')}}</span>
</el-col>
<template v-slot:header>
<div>
<el-row type="flex" justify="space-between" align="middle">
<el-col :span="5">
<span class="title">{{$t('test_track.test_case')}}</span>
</el-col>
<el-col :span="1" :offset="8">
<el-button icon="el-icon-circle-plus-outline" size="small" round
@click="$emit('openTestCaseEditDialog')" >{{$t('commons.create')}}</el-button>
</el-col>
<el-col :span="1" :offset="8">
<el-button icon="el-icon-circle-plus-outline" size="small" round
@click="$emit('openTestCaseEditDialog')" >{{$t('commons.create')}}</el-button>
</el-col>
<el-col :span="1" >
<el-button
icon="el-icon-refresh" size="small" round
@click="initTableData()">{{$t('commons.refresh')}}</el-button>
</el-col>
<el-col :span="1" >
<el-button
icon="el-icon-refresh" size="small" round
@click="initTableData()">{{$t('commons.refresh')}}</el-button>
</el-col>
<el-col :span="5">
<el-col :span="5">
<span class="search">
<el-input type="text" size="small" :placeholder="$t('load_test.search_by_name')"
prefix-icon="el-icon-search"
maxlength="60"
v-model="condition" @change="search" clearable/>
</span>
</el-col>
</el-row>
</div>
</el-col>
</el-row>
</div>
</template>
<el-table
:data="tableData"
@ -50,7 +52,7 @@
:label="$t('test_track.type')"
width="120"
show-overflow-tooltip>
<template slot-scope="scope">
<template v-slot:default="scope">
<span v-if="scope.row.type == 'functional'">{{$t('commons.functional')}}</span>
<span v-if="scope.row.type == 'performance'">{{$t('commons.performance')}}</span>
<span v-if="scope.row.type == 'interface'">{{$t('commons.interface')}}</span>
@ -61,7 +63,7 @@
:label="$t('test_track.method')"
width="120"
show-overflow-tooltip>
<template slot-scope="scope">
<template v-slot:default="scope">
<span v-if="scope.row.method == 'manual'">{{$t('test_track.manual')}}</span>
<span v-if="scope.row.method == 'auto'">{{$t('test_track.auto')}}</span>
</template>
@ -75,21 +77,21 @@
<el-table-column
width="160"
:label="$t('commons.create_time')">
<template slot-scope="scope">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column
width="160"
:label="$t('commons.update_time')">
<template slot-scope="scope">
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column
width="100"
:label="$t('commons.operating')">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="handleEdit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="handleDelete(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
</template>
@ -121,7 +123,7 @@
<script>
import {CURRENT_PROJECT} from '../../../../../common/constants';
export default {
export default {
name: "TestCaseList",
data() {
return {

View File

@ -4,17 +4,17 @@
<el-input :placeholder="$t('test_track.search_module')" v-model="filterText" size="small"></el-input>
<el-tree
class="filter-tree node-tree"
:data="treeNodes"
node-key="id"
@node-drag-end="handleDragEnd"
:filter-node-method="filterNode"
:expand-on-click-node="false"
draggable
ref="tree">
<span class="custom-tree-node father" slot-scope="{node}" @click="selectNode(node)">
{{node.label}}
</span>
class="filter-tree node-tree"
:data="treeNodes"
node-key="id"
@node-drag-end="handleDragEnd"
:filter-node-method="filterNode"
:expand-on-click-node="false"
draggable
ref="tree">
<template @click="selectNode(node)" v-slot:default="{node}">
{{node.label}}
</template>
</el-tree>
</div>
@ -42,10 +42,18 @@
Array
},
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
selectNode(node) {
let nodeIds = [];
this.getChildNodeId(node, nodeIds);
this.$emit("nodeSelectEvent", nodeIds);
},
getChildNodeId(rootNode, nodeIds) {
//ID
nodeIds.push(rootNode.data.id);
for (let i = 0; i < rootNode.childNodes.length; i++) {
this.getChildNodeId(rootNode.childNodes[i], nodeIds);
}
return nodeIds;
},
methods: {
handleDragEnd(draggingNode, dropNode, dropType, ev) {
@ -99,6 +107,7 @@
cursor: pointer;
color: #409EFF;
}
.el-icon-arrow-down {
font-size: 12px;
}
@ -117,12 +126,12 @@
margin-top: 15px;
}
.father .child{
display:none;
.father .child {
display: none;
}
.father:hover .child{
display:block;
.father:hover .child {
display: block;
}
</style>

View File

@ -1,34 +1,36 @@
<template>
<el-main>
<el-main class="main-content">
<el-card>
<div slot="header">
<el-row type="flex" justify="space-between" align="middle">
<el-col :span="5">
<span class="title">{{$t('test_track.test_case')}}</span>
</el-col>
<template v-slot:header>
<div>
<el-row type="flex" justify="space-between" align="middle">
<el-col :span="5">
<span class="title">{{$t('test_track.test_case')}}</span>
</el-col>
<el-col :span="1" :offset="6">
<el-button icon="el-icon-circle-plus-outline" size="small" round
@click="$emit('openTestCaseRelevanceDialog')" >关联测试用例</el-button>
</el-col>
<el-col :span="1" :offset="6">
<el-button icon="el-icon-circle-plus-outline" size="small" round
@click="$emit('openTestCaseRelevanceDialog')" >关联测试用例</el-button>
</el-col>
<el-col :span="1" >
<el-button
icon="el-icon-refresh" size="small" round
@click="initTableData()">{{$t('commons.refresh')}}</el-button>
</el-col>
<el-col :span="1" >
<el-button
icon="el-icon-refresh" size="small" round
@click="initTableData()">{{$t('commons.refresh')}}</el-button>
</el-col>
<el-col :span="5">
<el-col :span="5">
<span class="search">
<el-input type="text" size="small" :placeholder="$t('load_test.search_by_name')"
prefix-icon="el-icon-search"
maxlength="60"
v-model="condition" @change="search" clearable/>
</span>
</el-col>
</el-row>
</div>
</el-col>
</el-row>
</div>
</template>
<el-table
:data="tableData"
@ -50,7 +52,7 @@
:label="$t('test_track.type')"
width="120"
show-overflow-tooltip>
<template slot-scope="scope">
<template v-slot:default="scope">
<span v-if="scope.row.type == 'functional'">{{$t('commons.functional')}}</span>
<span v-if="scope.row.type == 'performance'">{{$t('commons.performance')}}</span>
<span v-if="scope.row.type == 'interface'">{{$t('commons.interface')}}</span>
@ -61,7 +63,7 @@
:label="$t('test_track.method')"
width="120"
show-overflow-tooltip>
<template slot-scope="scope">
<template v-slot:default="scope">
<span v-if="scope.row.method == 'manual'">{{$t('test_track.manual')}}</span>
<span v-if="scope.row.method == 'auto'">{{$t('test_track.auto')}}</span>
</template>
@ -75,21 +77,21 @@
<el-table-column
width="160"
:label="$t('commons.create_time')">
<template slot-scope="scope">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column
width="160"
:label="$t('commons.update_time')">
<template slot-scope="scope">
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column
width="100"
:label="$t('commons.operating')">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="handleEdit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="handleDelete(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
</template>
@ -122,7 +124,7 @@
import {CURRENT_PROJECT} from '../../../../../common/constants';
import PlanNodeTree from './PlanNodeTree';
export default {
export default {
name: "TestCaseList",
components: {PlanNodeTree},
data() {
@ -212,4 +214,11 @@
float: right;
}
.main-content {
margin: 0 auto;
width: 100%;
max-width: 1200px;
}
</style>

View File

@ -30,7 +30,10 @@
prop="name"
label="用例名称"
style="width: 100%">
<template slot-scope="scope">
<template v-slot:header>
用例名称
</template>
<template v-slot:default="scope">
{{scope.row.name}}
</template>
</el-table-column>
@ -40,17 +43,19 @@
</el-container>
</el-container>
<div slot="footer" class="dialog-footer">
<el-button
@click="dialogFormVisible = false">
{{$t('test_track.cancel')}}
</el-button>
<el-button
type="primary"
@click="saveCaseRelevance">
{{$t('test_track.confirm')}}
</el-button>
</div>
<template v-slot:footer>
<div class="dialog-footer">
<el-button
@click="dialogFormVisible = false">
{{$t('test_track.cancel')}}
</el-button>
<el-button
type="primary"
@click="saveCaseRelevance">
{{$t('test_track.confirm')}}
</el-button>
</div>
</template>
</el-dialog>
</div>

View File

@ -77,17 +77,19 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
@click="dialogFormVisible = false">
{{$t('test_track.cancel')}}
</el-button>
<el-button
type="primary"
@click="savePlan">
{{$t('test_track.confirm')}}
</el-button>
</div>
<template v-slot:footer>
<div class="dialog-footer">
<el-button
@click="dialogFormVisible = false">
{{$t('test_track.cancel')}}
</el-button>
<el-button
type="primary"
@click="savePlan">
{{$t('test_track.confirm')}}
</el-button>
</div>
</template>
</el-dialog>
</div>

View File

@ -3,33 +3,35 @@
<div class="testplan-container">
<el-main class="main-content">
<el-card>
<div slot="header">
<el-row type="flex" justify="space-between" align="middle">
<el-col :span="5">
<span class="title">{{$t('test_track.test_plan')}}</span>
</el-col>
<template v-slot:header>
<div>
<el-row type="flex" justify="space-between" align="middle">
<el-col :span="5">
<span class="title">{{$t('test_track.test_plan')}}</span>
</el-col>
<el-col :span="1" :offset="8">
<el-button icon="el-icon-circle-plus-outline" size="small" round
@click="$emit('openTestPlanEditDialog')" >{{$t('commons.create')}}</el-button>
</el-col>
<el-col :span="1" :offset="8">
<el-button icon="el-icon-circle-plus-outline" size="small" round
@click="$emit('openTestPlanEditDialog')" >{{$t('commons.create')}}</el-button>
</el-col>
<el-col :span="1" >
<el-button
icon="el-icon-refresh" size="small" round
@click="initTableData()">{{$t('commons.refresh')}}</el-button>
</el-col>
<el-col :span="1" >
<el-button
icon="el-icon-refresh" size="small" round
@click="initTableData()">{{$t('commons.refresh')}}</el-button>
</el-col>
<el-col :span="5">
<el-col :span="5">
<span class="search">
<el-input type="text" size="small" :placeholder="$t('load_test.search_by_name')"
prefix-icon="el-icon-search"
maxlength="60"
v-model="condition" @change="search" clearable/>
</span>
</el-col>
</el-row>
</div>
</el-col>
</el-row>
</div>
</template>
<el-table
:data="tableData"
@ -52,7 +54,7 @@
:label="$t('test_track.plan_status')"
width="130"
show-overflow-tooltip>
<template slot-scope="scope">
<template v-slot:default="scope">
<span v-if="scope.row.status == 'Prepare'">{{$t('test_track.plan_status_prepare')}}</span>
<span v-if="scope.row.status == 'Running'">{{$t('test_track.plan_status_running')}}</span>
<span v-if="scope.row.status == 'Completed'">{{$t('test_track.plan_status_completed')}}</span>
@ -63,7 +65,7 @@
:label="$t('test_track.plan_stage')"
width="130"
show-overflow-tooltip>
<template slot-scope="scope">
<template v-slot:default="scope">
<span v-if="scope.row.stage == 'smoke'">{{$t('test_track.smoke_test')}}</span>
<span v-if="scope.row.stage == 'functional'">{{$t('test_track.functional_test')}}</span>
<span v-if="scope.row.stage == 'integration'">{{$t('test_track.integration_testing')}}</span>
@ -80,21 +82,21 @@
<el-table-column
width="160"
:label="$t('commons.create_time')">
<template slot-scope="scope">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column
width="160"
:label="$t('commons.update_time')">
<template slot-scope="scope">
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column
width="160"
:label="$t('commons.operating')">
<template slot-scope="scope">
<template v-slot:default="scope">
<el-button @click="handleEdit(scope.row)"
@click.stop="deleteVisible = true" type="primary"
icon="el-icon-edit" size="mini" circle/>

View File

@ -6,7 +6,7 @@
</div>
<el-menu-item :key="p.id" v-for="p in recentProjects"
:index="'/performance/plan/' + p.id" :route="{name:'perPlan', params:{projectId:p.id, projectName:p.name}}">
:index="'/performance/test/' + p.id" :route="{name:'perPlan', params:{projectId:p.id, projectName:p.name}}">
{{ p.name }}
</el-menu-item>
</el-menu>