Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
q4speed 2020-04-10 16:23:53 +08:00
commit 1788e22351
31 changed files with 276 additions and 202 deletions

View File

@ -7,9 +7,14 @@
p.create_time, w.id as workspaceId, w.name as workspaceName
from project p
join workspace w on p.workspace_id = w.id
<if test="proRequest.workspaceId != null">
where w.id = #{proRequest.workspaceId}
<where>
<if test="proRequest.name != null and proRequest.name != ''">
and p.name like #{proRequest.name, jdbcType=VARCHAR}
</if>
<if test="proRequest.workspaceId != null">
and w.id = #{proRequest.workspaceId}
</if>
</where>
</select>
</mapper>

View File

@ -1,10 +1,12 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.controller.request.WorkspaceRequest;
import io.metersphere.dto.WorkspaceDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtWorkspaceMapper {
List<WorkspaceDTO> getWorkspaceWithOrg();
List<WorkspaceDTO> getWorkspaceWithOrg(@Param("request") WorkspaceRequest request);
}

View File

@ -5,6 +5,11 @@
<select id="getWorkspaceWithOrg" resultType="io.metersphere.dto.WorkspaceDTO">
select w.id, w.name, w.organization_id as organizationId, w.description, o.name as organizationName
from workspace w join organization o on w.organization_id = o.id
<where>
<if test="request.name != ''">
AND w.name LIKE #{request.name,jdbcType=VARCHAR}
</if>
</where>
</select>
</mapper>

View File

@ -1,15 +0,0 @@
package io.metersphere.commons.annotations;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Documented
@Inherited
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface FuzzyQuery {
}

View File

@ -1,12 +1,8 @@
package io.metersphere.commons.utils;
import io.metersphere.commons.annotations.FuzzyQuery;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.ReflectionUtils;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
public class BeanUtils {
@ -69,38 +65,4 @@ public class BeanUtils {
return null;
}
}
/**
* @param obj
* @return
*/
public static Map<String, Object> objectToMap(Object obj) {
HashMap<String, Object> map = new HashMap<>();
if (obj != null) {
ReflectionUtils.doWithFields(obj.getClass(), field -> {
boolean accessFlag = field.isAccessible();
try {
String varName = field.getName();
field.setAccessible(true);
Object o = field.get(obj);
if (o != null) {
if (field.isAnnotationPresent(FuzzyQuery.class) && o instanceof String) {
String value = "%" + o + "%";
map.put(varName, value);
} else {
map.put(varName, field.get(obj));
}
}
field.setAccessible(accessFlag);
} catch (Exception e) {
} finally {
field.setAccessible(accessFlag);
}
});
}
return map;
}
}

View File

@ -6,11 +6,13 @@ import io.metersphere.base.domain.Organization;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.controller.request.OrganizationRequest;
import io.metersphere.dto.OrganizationMemberDTO;
import io.metersphere.service.OrganizationService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@ -23,26 +25,34 @@ public class OrganizationController {
@PostMapping("/add")
@RequiresRoles(RoleConstants.ADMIN)
public Organization addOrganization(@RequestBody Organization organization) { return organizationService.addOrganization(organization); }
public Organization addOrganization(@RequestBody Organization organization) {
return organizationService.addOrganization(organization);
}
@GetMapping("/list")
@RequiresRoles(value = {RoleConstants.ADMIN, RoleConstants.ORG_ADMIN, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
public List<Organization> getOrganizationList() { return organizationService.getOrganizationList(); }
public List<Organization> getOrganizationList() {
return organizationService.getOrganizationList(new OrganizationRequest());
}
@PostMapping("/list/{goPage}/{pageSize}")
@RequiresRoles(value = {RoleConstants.ADMIN, RoleConstants.ORG_ADMIN}, logical = Logical.OR)
public Pager<List<Organization>> getOrganizationList(@PathVariable int goPage, @PathVariable int pageSize) {
public Pager<List<Organization>> getOrganizationList(@RequestBody OrganizationRequest request, @PathVariable int goPage, @PathVariable int pageSize) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, organizationService.getOrganizationList());
return PageUtils.setPageInfo(page, organizationService.getOrganizationList(request));
}
@GetMapping("/delete/{organizationId}")
@RequiresRoles(RoleConstants.ADMIN)
public void deleteOrganization(@PathVariable(value = "organizationId") String organizationId) { organizationService.deleteOrganization(organizationId); }
public void deleteOrganization(@PathVariable(value = "organizationId") String organizationId) {
organizationService.deleteOrganization(organizationId);
}
@PostMapping("/update")
@RequiresRoles(value = {RoleConstants.ADMIN, RoleConstants.ORG_ADMIN}, logical = Logical.OR)
public void updateOrganization(@RequestBody Organization organization) { organizationService.updateOrganization(organization); }
public void updateOrganization(@RequestBody Organization organization) {
organizationService.updateOrganization(organization);
}
@GetMapping("/list/userorg/{userId}")
public List<Organization> getOrganizationListByUserId(@PathVariable String userId) {

View File

@ -7,7 +7,6 @@ import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.controller.request.WorkspaceRequest;
import io.metersphere.dto.OrganizationMemberDTO;
import io.metersphere.dto.WorkspaceDTO;
import io.metersphere.dto.WorkspaceMemberDTO;
import io.metersphere.service.WorkspaceService;
@ -73,9 +72,9 @@ public class WorkspaceController {
@PostMapping("list/all/{goPage}/{pageSize}")
@RequiresRoles(RoleConstants.ADMIN)
public Pager<List<WorkspaceDTO>> getAllWorkspaceList(@PathVariable int goPage, @PathVariable int pageSize) {
public Pager<List<WorkspaceDTO>> getAllWorkspaceList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody WorkspaceRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, workspaceService.getAllWorkspaceList());
return PageUtils.setPageInfo(page, workspaceService.getAllWorkspaceList(request));
}
@GetMapping("/list/userworkspace/{userId}")

View File

@ -0,0 +1,13 @@
package io.metersphere.controller.request;
public class OrganizationRequest {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -2,6 +2,15 @@ package io.metersphere.controller.request;
public class ProjectRequest {
private String workspaceId;
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getWorkspaceId() {
return workspaceId;

View File

@ -1,10 +1,7 @@
package io.metersphere.controller.request;
import io.metersphere.commons.annotations.FuzzyQuery;
public class WorkspaceRequest {
private String organizationId;
@FuzzyQuery
private String name;
public String getOrganizationId() {

View File

@ -7,6 +7,7 @@ import io.metersphere.report.base.*;
import io.metersphere.report.dto.ErrorsTop5DTO;
import io.metersphere.report.dto.RequestStatisticsDTO;
import org.apache.commons.lang3.StringUtils;
import java.io.Reader;
import java.io.StringReader;
import java.math.BigDecimal;
@ -18,6 +19,7 @@ import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.Collectors;
@ -426,9 +428,14 @@ public class JtlResolver {
reportTimeInfo.setStartTime(startTime);
reportTimeInfo.setEndTime(endTime);
// todo 时间问题
long seconds = Duration.between(Instant.ofEpochMilli(Long.parseLong(startTimeStamp)), Instant.ofEpochMilli(Long.parseLong(endTimeStamp))).getSeconds();
reportTimeInfo.setDuration(String.valueOf(seconds));
String duration;
if (seconds / 60 == 0) {
duration = String.valueOf(1);
} else {
duration = String.valueOf(seconds / 60);
}
reportTimeInfo.setDuration(duration);
return reportTimeInfo;
}

View File

@ -8,6 +8,7 @@ import io.metersphere.base.mapper.ext.ExtOrganizationMapper;
import io.metersphere.base.mapper.ext.ExtUserRoleMapper;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.exception.MSException;
import io.metersphere.controller.request.OrganizationRequest;
import io.metersphere.dto.OrganizationMemberDTO;
import io.metersphere.dto.UserRoleHelpDTO;
import io.metersphere.i18n.Translator;
@ -48,8 +49,13 @@ public class OrganizationService {
return organization;
}
public List<Organization> getOrganizationList() {
return organizationMapper.selectByExample(null);
public List<Organization> getOrganizationList(OrganizationRequest request) {
OrganizationExample example = new OrganizationExample();
OrganizationExample.Criteria criteria = example.createCriteria();
if (StringUtils.isNotBlank(request.getName())) {
criteria.andNameLike(StringUtils.wrapIfMissing(request.getName(), "%"));
}
return organizationMapper.selectByExample(example);
}
public void deleteOrganization(String organizationId) {
@ -57,6 +63,7 @@ public class OrganizationService {
}
public void updateOrganization(Organization organization) {
organization.setCreateTime(null);
organization.setUpdateTime(System.currentTimeMillis());
organizationMapper.updateByPrimaryKeySelective(organization);
}

View File

@ -47,6 +47,9 @@ public class ProjectService {
}
public List<ProjectDTO> getProjectList(ProjectRequest request) {
if (StringUtils.isNotBlank(request.getName())) {
request.setName(StringUtils.wrapIfMissing(request.getName(), "%"));
}
return extProjectMapper.getProjectWithWorkspace(request);
}

View File

@ -77,13 +77,16 @@ public class WorkspaceService {
criteria.andOrganizationIdEqualTo(request.getOrganizationId());
}
if (StringUtils.isNotBlank(request.getName())) {
criteria.andNameLike(request.getName());
criteria.andNameLike(StringUtils.wrapIfMissing(request.getName(), "%"));
}
return workspaceMapper.selectByExample(example);
}
public List<WorkspaceDTO> getAllWorkspaceList() {
return extWorkspaceMapper.getWorkspaceWithOrg();
public List<WorkspaceDTO> getAllWorkspaceList(WorkspaceRequest request) {
if (StringUtils.isNotBlank(request.getName())) {
request.setName(StringUtils.wrapIfMissing(request.getName(), "%"));
}
return extWorkspaceMapper.getWorkspaceWithOrg(request);
}
public void deleteWorkspace(String workspaceId) {
@ -225,6 +228,7 @@ public class WorkspaceService {
}
public void updateWorkspacebyAdmin(Workspace workspace) {
workspace.setCreateTime(null);
workspace.setUpdateTime(System.currentTimeMillis());
workspaceMapper.updateByPrimaryKeySelective(workspace);
}

View File

@ -20,7 +20,7 @@
</el-col>
<el-col :span="8">
<span class="ms-report-time-desc">
持续时间 {{minutes}} 分钟 {{seconds}}
持续时间 {{minutes}} 分钟
</span>
<span class="ms-report-time-desc">
开始时间 {{startTime}}
@ -79,7 +79,6 @@
startTime: '0',
endTime: '0',
minutes: '0',
seconds: '0'
}
},
methods: {
@ -102,9 +101,7 @@
if(data){
this.startTime = data.startTime;
this.endTime = data.endTime;
let duration = data.duration;
this.minutes = Math.floor(duration / 60);
this.seconds = duration % 60;
this.minutes = data.duration;
}
})
}
@ -147,7 +144,7 @@
if(data){
this.startTime = data.startTime;
this.endTime = data.endTime;
this.duration = data.duration;
this.minutes = data.duration;
}
})
window.location.reload();

View File

@ -192,6 +192,7 @@
font-size: 20px;
color: #8492a6;
display: block;
text-align: center;
margin-bottom: 8px;
}
</style>

View File

@ -59,10 +59,10 @@
<el-row>
<el-col :span="12">
<chart ref="chart1" :options="loadOption" :autoresize="true"></chart>
<chart ref="chart1" :options="loadOption" class="chart-config" :autoresize="true"></chart>
</el-col>
<el-col :span="12">
<chart ref="chart2" :options="resOption" :autoresize="true"></chart>
<chart ref="chart2" :options="resOption" class="chart-config" :autoresize="true"></chart>
</el-col>
</el-row>
</div>
@ -276,4 +276,8 @@
border-left-width: 3px;
}
.chart-config {
width: 100%;
}
</style>

View File

@ -11,6 +11,7 @@
<span class="search">
<el-input type="text" size="small" :placeholder="$t('project.search_by_name')"
prefix-icon="el-icon-search"
@change="search"
maxlength="60" v-model="condition" clearable/>
</span>
</el-row>
@ -56,7 +57,9 @@
</el-form>
<template v-slot:footer>
<div class="dialog-footer">
<el-button type="primary" @click="submit('form')" size="medium">{{$t('commons.save')}}</el-button>
<el-button type="primary" onkeydown="return false;" @click="submit('form')" size="medium">
{{$t('commons.save')}}
</el-button>
</div>
</template>
</el-dialog>
@ -172,9 +175,12 @@
}).catch(() => {
});
},
search() {
this.list();
},
list() {
let url = "/project/list/" + this.currentPage + '/' + this.pageSize;
this.result = this.$post(url, {}, (response) => {
this.result = this.$post(url, {name: this.condition}, (response) => {
let data = response.data;
this.items = data.listObject;
this.total = data.itemCount;

View File

@ -28,8 +28,8 @@
</el-table-column>
<el-table-column>
<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/>
<el-button @click="edit(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="del(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete" size="mini" circle/>
</template>
</el-table-column>
</el-table>
@ -79,7 +79,8 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
<el-button type="primary" onkeydown="return false;"
@click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
@ -111,7 +112,8 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateOrgMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
<el-button type="primary" onkeydown="return false;"
@click="updateOrgMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>

View File

@ -9,7 +9,7 @@
</span>
<span class="search">
<el-input type="text" size="small" :placeholder="$t('workspace.search_by_name')"
prefix-icon="el-icon-search"
prefix-icon="el-icon-search" @change="search"
maxlength="60" v-model="condition" clearable/>
</span>
</el-row>
@ -20,13 +20,16 @@
<el-table-column prop="description" :label="$t('commons.description')"/>
<el-table-column :label="$t('commons.member')">
<template v-slot:default="scope">
<el-button type="text" class="member-size" @click="cellClick(scope.row)">{{scope.row.memberSize}}</el-button>
<el-button type="text" class="member-size" @click="cellClick(scope.row)">{{scope.row.memberSize}}
</el-button>
</template>
</el-table-column>
<el-table-column>
<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/>
<el-button @click="edit(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit" size="mini"
circle/>
<el-button @click="del(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete" size="mini"
circle/>
</template>
</el-table-column>
</el-table>
@ -60,7 +63,8 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="submit('form')" size="medium">{{$t('commons.save')}}</el-button>
<el-button type="primary" onkeydown="return false;"
@click="submit('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
@ -92,8 +96,10 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<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/>
<el-button @click="editMember(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit"
size="mini" circle/>
<el-button @click="delMember(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete"
size="mini" circle/>
</template>
</el-table-column>
</el-table>
@ -117,10 +123,13 @@
</el-dialog>
<!-- add workspace member dialog -->
<el-dialog :title="$t('member.create')" :visible.sync="addMemberVisible" width="30%" :destroy-on-close="true" @close="closeFunc">
<el-form :model="memberForm" ref="form" :rules="wsMemberRule" label-position="right" label-width="100px" size="small">
<el-dialog :title="$t('member.create')" :visible.sync="addMemberVisible" width="30%" :destroy-on-close="true"
@close="closeFunc">
<el-form :model="memberForm" ref="form" :rules="wsMemberRule" label-position="right" label-width="100px"
size="small">
<el-form-item :label="$t('commons.member')" prop="userIds">
<el-select v-model="memberForm.userIds" multiple :placeholder="$t('member.please_choose_member')" class="select-width">
<el-select v-model="memberForm.userIds" multiple :placeholder="$t('member.please_choose_member')"
class="select-width">
<el-option
v-for="item in memberForm.userList"
:key="item.id"
@ -132,7 +141,8 @@
</el-select>
</el-form-item>
<el-form-item :label="$t('commons.role')" prop="roleIds">
<el-select v-model="memberForm.roleIds" multiple :placeholder="$t('role.please_choose_role')" class="select-width">
<el-select v-model="memberForm.roleIds" multiple :placeholder="$t('role.please_choose_role')"
class="select-width">
<el-option
v-for="item in memberForm.roles"
:key="item.id"
@ -144,13 +154,15 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
<el-button type="primary" onkeydown="return false;"
@click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
<!-- update workspace member dialog -->
<el-dialog :title="$t('member.modify')" :visible.sync="updateMemberVisible" width="30%" :destroy-on-close="true" @close="closeFunc">
<el-dialog :title="$t('member.modify')" :visible.sync="updateMemberVisible" width="30%" :destroy-on-close="true"
@close="closeFunc">
<el-form :model="memberForm" label-position="right" label-width="100px" size="small" ref="updateUserForm">
<el-form-item label="ID" prop="id">
<el-input v-model="memberForm.id" autocomplete="off" :disabled="true"/>
@ -165,7 +177,8 @@
<el-input v-model="memberForm.phone" autocomplete="off"/>
</el-form-item>
<el-form-item :label="$t('commons.role')" prop="roleIds">
<el-select v-model="memberForm.roleIds" multiple :placeholder="$t('role.please_choose_role')" class="select-width">
<el-select v-model="memberForm.roleIds" multiple :placeholder="$t('role.please_choose_role')"
class="select-width">
<el-option
v-for="item in memberForm.allroles"
:key="item.id"
@ -177,7 +190,8 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateOrgMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
<el-button type="primary" onkeydown="return false;"
@click="updateOrgMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
@ -250,6 +264,9 @@
});
},
search() {
this.list();
},
list() {
let url = '/workspace/list/' + this.currentPage + '/' + this.pageSize;
let lastOrganizationId = this.currentUser.lastOrganizationId;

View File

@ -44,7 +44,8 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateUser('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
<el-button type="primary" onkeydown="return false;"
@click="updateUser('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>

View File

@ -9,7 +9,8 @@
<ms-create-box :tips="btnTips" :exec="create"/>
</span>
<span class="search">
<el-input type="text" size="small" :placeholder="$t('organization.search_by_name')" prefix-icon="el-icon-search"
<el-input type="text" size="small" :placeholder="$t('organization.search_by_name')"
prefix-icon="el-icon-search" @change="search"
maxlength="60" v-model="condition" clearable/>
</span>
</el-row>
@ -22,13 +23,14 @@
<el-table-column prop="description" :label="$t('commons.description')"/>
<el-table-column :label="$t('commons.member')">
<template v-slot:default="scope">
<el-button type="text" class="member-size" @click="cellClick(scope.row)">{{scope.row.memberSize}}</el-button>
<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 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/>
<el-button @click="edit(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="del(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete" size="mini" circle/>
</template>
</el-table-column>
</el-table>
@ -77,8 +79,8 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<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/>
<el-button @click="editMember(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="delMember(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete" size="mini" circle/>
</template>
</el-table-column>
</el-table>
@ -102,8 +104,10 @@
</el-dialog>
<!-- add organization form -->
<el-dialog :title="$t('organization.create')" :visible.sync="createVisible" width="30%" @closed="closeFunc" :destroy-on-close="true">
<el-form :model="form" label-position="right" label-width="100px" size="small" :rules="rule" ref="createOrganization">
<el-dialog :title="$t('organization.create')" :visible.sync="createVisible" width="30%" @closed="closeFunc"
:destroy-on-close="true">
<el-form :model="form" label-position="right" label-width="100px" size="small" :rules="rule"
ref="createOrganization">
<el-form-item :label="$t('commons.name')" prop="name">
<el-input v-model="form.name" autocomplete="off"/>
</el-form-item>
@ -113,14 +117,17 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="createOrganization('createOrganization')" size="medium">{{$t('commons.save')}}</el-button>
<el-button type="primary" onkeydown="return false;"
@click="createOrganization('createOrganization')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
<!-- update organization form -->
<el-dialog :title="$t('organization.modify')" :visible.sync="updateVisible" width="30%" :destroy-on-close="true" @close="closeFunc">
<el-form :model="form" label-position="right" label-width="100px" size="small" :rules="rule" ref="updateOrganizationForm">
<el-dialog :title="$t('organization.modify')" :visible.sync="updateVisible" width="30%" :destroy-on-close="true"
@close="closeFunc">
<el-form :model="form" label-position="right" label-width="100px" size="small" :rules="rule"
ref="updateOrganizationForm">
<el-form-item :label="$t('commons.name')" prop="name">
<el-input v-model="form.name" autocomplete="off"/>
</el-form-item>
@ -130,16 +137,20 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateOrganization('updateOrganizationForm')" size="medium">{{$t('organization.modify')}}</el-button>
<el-button type="primary" onkeydown="return false;"
@click="updateOrganization('updateOrganizationForm')" size="medium">{{$t('organization.modify')}}</el-button>
</span>
</template>
</el-dialog>
<!-- add organization member form -->
<el-dialog :title="$t('member.create')" :visible.sync="addMemberVisible" width="30%" :destroy-on-close="true" @close="closeFunc">
<el-form :model="memberForm" ref="form" :rules="orgMemberRule" label-position="right" label-width="100px" size="small">
<el-dialog :title="$t('member.create')" :visible.sync="addMemberVisible" width="30%" :destroy-on-close="true"
@close="closeFunc">
<el-form :model="memberForm" ref="form" :rules="orgMemberRule" label-position="right" label-width="100px"
size="small">
<el-form-item :label="$t('commons.member')" prop="userIds">
<el-select v-model="memberForm.userIds" multiple :placeholder="$t('member.please_choose_member')" class="select-width">
<el-select v-model="memberForm.userIds" multiple :placeholder="$t('member.please_choose_member')"
class="select-width">
<el-option
v-for="item in memberForm.userList"
:key="item.id"
@ -151,7 +162,8 @@
</el-select>
</el-form-item>
<el-form-item :label="$t('commons.role')" prop="roleIds">
<el-select v-model="memberForm.roleIds" multiple :placeholder="$t('role.please_choose_role')" class="select-width">
<el-select v-model="memberForm.roleIds" multiple :placeholder="$t('role.please_choose_role')"
class="select-width">
<el-option
v-for="item in memberForm.roles"
:key="item.id"
@ -163,13 +175,15 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
<el-button type="primary" onkeydown="return false;"
@click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
<!-- update organization member form -->
<el-dialog :title="$t('member.modify')" :visible.sync="updateMemberVisible" width="30%" :destroy-on-close="true" @close="closeFunc">
<el-dialog :title="$t('member.modify')" :visible.sync="updateMemberVisible" width="30%" :destroy-on-close="true"
@close="closeFunc">
<el-form :model="memberForm" label-position="right" label-width="100px" size="small" ref="updateUserForm">
<el-form-item label="ID" prop="id">
<el-input v-model="memberForm.id" autocomplete="off" :disabled="true"/>
@ -184,7 +198,8 @@
<el-input v-model="memberForm.phone" autocomplete="off"/>
</el-form-item>
<el-form-item :label="$t('commons.role')" prop="roleIds">
<el-select v-model="memberForm.roleIds" multiple :placeholder="$t('role.please_choose_role')" class="select-width">
<el-select v-model="memberForm.roleIds" multiple :placeholder="$t('role.please_choose_role')"
class="select-width">
<el-option
v-for="item in memberForm.allroles"
:key="item.id"
@ -196,7 +211,8 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateOrgMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
<el-button type="primary" onkeydown="return false;"
@click="updateOrgMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
@ -386,8 +402,14 @@
}
})
},
search() {
this.initTableData();
},
initTableData() {
this.result = this.$post(this.buildPagePath(this.queryPath),{},response => {
let param = {
name: this.condition
};
this.result = this.$post(this.buildPagePath(this.queryPath), param, response => {
let data = response.data;
this.tableData = data.listObject;
for (let i = 0; i < this.tableData.length; i++) {

View File

@ -11,7 +11,7 @@
<span class="search">
<el-input type="text" size="small"
:placeholder="$t('workspace.search_by_name')"
prefix-icon="el-icon-search"
prefix-icon="el-icon-search" @change="search"
maxlength="60" v-model="condition" clearable/>
</span>
</el-row>
@ -77,7 +77,7 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="submit('form')" size="medium">{{$t('commons.save')}}</el-button>
<el-button type="primary" onkeydown="return false;" @click="submit('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
@ -105,7 +105,7 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateWorkspace('updateForm')"
<el-button type="primary" @click="updateWorkspace('updateForm')" onkeydown="return false;"
size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
@ -139,8 +139,8 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<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/>
<el-button @click="editMember(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="delMember(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete" size="mini" circle/>
</template>
</el-table-column>
</el-table>
@ -195,7 +195,7 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
<el-button type="primary" onkeydown="return false;" @click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
@ -230,7 +230,7 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateOrgMember('updateUserForm')"
<el-button type="primary" @click="updateOrgMember('updateUserForm')" onkeydown="return false;"
size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
@ -353,6 +353,9 @@
this.memberLineData = [];
this.list();
},
search() {
this.list();
},
list() {
let url = '/workspace/list/all/' + this.currentPage + '/' + this.pageSize;
this.result = this.$post(url, {name: this.condition}, response => {

View File

@ -284,7 +284,6 @@
},
methods: {
initTableData() {
this.loading = true;
let param = {
name: this.condition
};
@ -293,7 +292,6 @@
let data = response.data;
this.items = data.listObject;
this.total = data.itemCount;
this.loading = false;
})
},
changeResourceType() {

View File

@ -83,7 +83,8 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="createUser('createUserForm')" size="medium">创建</el-button>
<el-button type="primary" onkeydown="return false;"
@click="createUser('createUserForm')" size="medium">创建</el-button>
</span>
</template>
</el-dialog>
@ -105,7 +106,8 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateUser('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
<el-button type="primary" onkeydown="return false;"
@click="updateUser('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>

View File

@ -27,8 +27,8 @@
</el-table-column>
<el-table-column>
<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']"/>
<el-button @click="edit(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit" size="mini" circle v-permission="['test_manager']"/>
<el-button @click="del(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete" size="mini" circle v-permission="['test_manager']"/>
</template>
</el-table-column>
</el-table>
@ -78,7 +78,8 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
<el-button type="primary" onkeydown="return false;"
@click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
@ -110,7 +111,8 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateWorkspaceMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
<el-button type="primary" onkeydown="return false;"
@click="updateWorkspaceMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>

View File

@ -7,11 +7,7 @@
<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="2" :offset="10">
<el-button icon="el-icon-circle-plus-outline" size="small" round
@click="$emit('openTestCaseEditDialog')" >{{$t('commons.create')}}</el-button>
<ms-create-box :tips="$t('test_track.create')" :exec="testCaseCreate"/>
</el-col>
<el-col :span="5">
@ -108,8 +104,11 @@
<script>
import MsCreateBox from '../../../settings/CreateBox';
export default {
name: "TestCaseList",
components: {MsCreateBox},
data() {
return {
result: {},
@ -160,6 +159,9 @@
buildPagePath(path) {
return path + "/" + this.currentPage + "/" + this.pageSize;
},
testCaseCreate() {
this.$emit('openTestCaseEditDialog');
},
handleSizeChange(size) {
this.pageSize = size;
this.initTableData();
@ -175,7 +177,7 @@
this.$emit('testCaseEdit', testCase);
},
handleDelete(testCase) {
this.$alert(this.$t('load_test.delete_confirm') + testCase.name + "", '', {
this.$alert(this.$t('test_track.case_delete_confirm') + testCase.name + "", '', {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {

View File

@ -21,7 +21,7 @@
<el-submenu v-if="isCurrentWorkspaceUser"
index="6" popper-class="submenu" v-permission="['test_manager', 'test_user']">
<template v-slot:title>{{$t('test_track.test_case')}}</template>
<ms-recent-list :options="testRecent"/>
<ms-recent-list :options="caseRecent"/>
<el-divider/>
<ms-show-all :index="'/track/case/all'"/>
<el-menu-item :index="testCaseEditPath" class="blank_item"></el-menu-item>
@ -34,7 +34,7 @@
<el-divider/>
<ms-show-all :index="'/track/plan/all'"/>
<el-menu-item :index="testPlanViewPath" class="blank_item"></el-menu-item>
<ms-create-button :index="'/track/plan/create'" :title="$t('project.create')"/>
<ms-create-button :index="'/track/plan/create'" :title="$t('test_track.create_plan')"/>
</el-submenu>
</el-menu>
</el-col>
@ -69,8 +69,8 @@
return {name: 'testCase', params: {projectId: item.id, projectName: item.name}}
}
},
testRecent: {
title: this.$t('load_test.recent'),
caseRecent: {
title: this.$t('test_track.recent_case'),
url: "/test/case/recent/5",
index: function (item) {
return '/track/case/edit/' + item.id;
@ -78,7 +78,7 @@
router: function (item) {}
},
planRecent: {
title: this.$t('report.recent'),
title: this.$t('test_track.recent_plan'),
url: "/test/plan/recent/5",
index: function (item) {
return '/track/plan/view/' + item.id;

View File

@ -8,14 +8,9 @@
<el-row type="flex" justify="space-between" align="middle">
<el-col :span="5">
<span class="title">{{$t('test_track.test_plan')}}</span>
<ms-create-box :tips="$t('test_track.create_plan')" :exec="testPlanCreate"/>
</el-col>
<el-col :span="2" :offset="10">
<el-button icon="el-icon-circle-plus-outline" size="small" round
@click="$emit('openTestPlanEditDialog')" >{{$t('commons.create')}}</el-button>
</el-col>
<el-col :span="5">
<span class="search">
<el-input type="text" size="small" :placeholder="$t('load_test.search_by_name')"
@ -117,8 +112,11 @@
</template>
<script>
import MsCreateBox from '../../../settings/CreateBox';
export default {
name: "TestPlanList",
components: {MsCreateBox},
data() {
return {
result: {},
@ -154,6 +152,9 @@
buildPagePath(path) {
return path + "/" + this.currentPage + "/" + this.pageSize;
},
testPlanCreate() {
this.$emit('openTestPlanEditDialog');
},
handleSizeChange(size) {
this.pageSize = size;
this.initTableData();
@ -169,7 +170,7 @@
this.$emit('testPlanEdit', testPlan);
},
handleDelete(testPlan) {
this.$alert(this.$t('load_test.delete_confirm') + testPlan.name + "", '', {
this.$alert(this.$t('test_track.plan_delete_confirm') + testPlan.name + "", '', {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {

View File

@ -228,7 +228,7 @@ export default {
'executor': 'executor',
'execute_result': 'Execute result',
'case_type': 'Case type',
'pass': 'Success',
'pass': 'Pass',
'failure': 'Failure',
'blocking': 'Blocking',
'skip': 'Skip',
@ -239,6 +239,10 @@ export default {
'confirm_cancel_relevance': 'Confirm cancel relevance',
'plan': 'Plan',
'project': 'Project',
'recent_plan': 'Recent plan',
'recent_case': 'Recent case',
'plan_delete_confirm': 'Confirm delete test plan: ',
'case_delete_confirm': 'Confirm delete test case: ',
},
test_resource_pool: {
'type': 'type',

View File

@ -205,7 +205,7 @@ export default {
'add_submodule': '添加子模块',
'add_module': '添加模块',
'module_name': '模块名称',
'create_plan': '建测试计划',
'create_plan': '建测试计划',
'plan_name': '计划名称',
'plan_project': '所属项目',
'plan_stage': '测试阶段',
@ -228,7 +228,7 @@ export default {
'executor': '执行人',
'execute_result': '执行结果',
'case_type': '用例类型',
'pass': '成功',
'pass': '通过',
'failure': '失败',
'blocking': '阻塞',
'skip': '跳过',
@ -239,6 +239,10 @@ export default {
'confirm_cancel_relevance': '确认取消关联',
'plan': '计划',
'project': '项目',
'recent_plan': '最近的计划',
'recent_case': '最近的用例',
'plan_delete_confirm': '确认删除测试计划: ',
'case_delete_confirm': '确认删除测试用例: ',
},
test_resource_pool: {
'type': '类型',