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

This commit is contained in:
wenyann 2020-06-08 17:45:59 +08:00
commit b53f07cae6
11 changed files with 70 additions and 34 deletions

View File

@ -123,6 +123,10 @@ public class OrganizationService {
list.add(r.getParentId()); list.add(r.getParentId());
} }
}); });
// ignore list size is 0
list.add("no_such_id");
OrganizationExample organizationExample = new OrganizationExample(); OrganizationExample organizationExample = new OrganizationExample();
organizationExample.createCriteria().andIdIn(list); organizationExample.createCriteria().andIdIn(list);
return organizationMapper.selectByExample(organizationExample); return organizationMapper.selectByExample(organizationExample);

View File

@ -195,6 +195,17 @@ public class UserService {
String userId = user.getId(); String userId = user.getId();
UserRoleExample userRoleExample = new UserRoleExample(); UserRoleExample userRoleExample = new UserRoleExample();
userRoleExample.createCriteria().andUserIdEqualTo(userId); userRoleExample.createCriteria().andUserIdEqualTo(userId);
List<UserRole> userRoles = userRoleMapper.selectByExample(userRoleExample);
List<String> list = userRoles.stream().map(UserRole::getSourceId).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(list)) {
if (list.contains(user.getLastWorkspaceId()) || list.contains(user.getLastOrganizationId())) {
user.setLastOrganizationId("");
user.setLastWorkspaceId("");
userMapper.updateByPrimaryKeySelective(user);
}
}
userRoleMapper.deleteByExample(userRoleExample); userRoleMapper.deleteByExample(userRoleExample);
List<Map<String, Object>> roles = user.getRoles(); List<Map<String, Object>> roles = user.getRoles();
if (!roles.isEmpty()) { if (!roles.isEmpty()) {
@ -275,6 +286,14 @@ public class UserService {
UserRoleExample example = new UserRoleExample(); UserRoleExample example = new UserRoleExample();
example.createCriteria().andRoleIdLike("%test%") example.createCriteria().andRoleIdLike("%test%")
.andUserIdEqualTo(userId).andSourceIdEqualTo(workspaceId); .andUserIdEqualTo(userId).andSourceIdEqualTo(workspaceId);
User user = userMapper.selectByPrimaryKey(userId);
if (StringUtils.equals(workspaceId, user.getLastWorkspaceId())) {
user.setLastWorkspaceId("");
user.setLastOrganizationId("");
userMapper.updateByPrimaryKeySelective(user);
}
userRoleMapper.deleteByExample(example); userRoleMapper.deleteByExample(example);
} }
@ -305,6 +324,14 @@ public class UserService {
public void delOrganizationMember(String organizationId, String userId) { public void delOrganizationMember(String organizationId, String userId) {
UserRoleExample userRoleExample = new UserRoleExample(); UserRoleExample userRoleExample = new UserRoleExample();
userRoleExample.createCriteria().andRoleIdLike("%org%").andUserIdEqualTo(userId).andSourceIdEqualTo(organizationId); userRoleExample.createCriteria().andRoleIdLike("%org%").andUserIdEqualTo(userId).andSourceIdEqualTo(organizationId);
User user = userMapper.selectByPrimaryKey(userId);
if (StringUtils.equals(organizationId, user.getLastOrganizationId())) {
user.setLastWorkspaceId("");
user.setLastOrganizationId("");
userMapper.updateByPrimaryKeySelective(user);
}
userRoleMapper.deleteByExample(userRoleExample); userRoleMapper.deleteByExample(userRoleExample);
} }

View File

@ -3,10 +3,10 @@
<ms-main-container v-loading="result.loading"> <ms-main-container v-loading="result.loading">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<ms-performance-report-recent-list/> <ms-performance-test-recent-list/>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<ms-performance-test-recent-list/> <ms-performance-report-recent-list/>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">

View File

@ -301,9 +301,6 @@
}); });
}, },
createTestResourcePool(createTestResourcePoolForm) { createTestResourcePool(createTestResourcePoolForm) {
if (this.result.loading) {
return;
}
this.$refs[createTestResourcePoolForm].validate(valid => { this.$refs[createTestResourcePoolForm].validate(valid => {
if (valid) { if (valid) {
let vri = this.validateResourceInfo(); let vri = this.validateResourceInfo();
@ -340,9 +337,6 @@
this.form.resources = resources; this.form.resources = resources;
}, },
updateTestResourcePool(updateTestResourcePoolForm) { updateTestResourcePool(updateTestResourcePoolForm) {
if (this.result.loading) {
return;
}
this.$refs[updateTestResourcePoolForm].validate(valid => { this.$refs[updateTestResourcePoolForm].validate(valid => {
if (valid) { if (valid) {
let vri = this.validateResourceInfo(); let vri = this.validateResourceInfo();

View File

@ -336,11 +336,11 @@
rule: { rule: {
id: [ id: [
{required: true, message: this.$t('user.input_id'), trigger: 'blur'}, {required: true, message: this.$t('user.input_id'), trigger: 'blur'},
{min: 2, max: 20, message: this.$t('commons.input_limit', [2, 20]), trigger: 'blur'} {min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur'}
], ],
name: [ name: [
{required: true, message: this.$t('user.input_name'), trigger: 'blur'}, {required: true, message: this.$t('user.input_name'), trigger: 'blur'},
{min: 2, max: 20, message: this.$t('commons.input_limit', [2, 20]), trigger: 'blur'}, {min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur'},
{ {
required: true, required: true,
pattern: /^[\u4e00-\u9fa5_a-zA-Z0-9.·-]+$/, pattern: /^[\u4e00-\u9fa5_a-zA-Z0-9.·-]+$/,

View File

@ -1,5 +1,5 @@
<template> <template>
<el-dialog width="30%" :title="$t('test_track.case.import.case_import')" :visible.sync="dialogVisible" <el-dialog class="testcase-import" :title="$t('test_track.case.import.case_import')" :visible.sync="dialogVisible"
@close="init"> @close="init">
<el-row> <el-row>
@ -126,4 +126,9 @@
padding-bottom: 10px; padding-bottom: 10px;
} }
.testcase-import >>> .el-dialog {
width: 400px;
}
</style> </style>

View File

@ -29,23 +29,24 @@
:label="$t('test_track.plan.plan_status')" :label="$t('test_track.plan.plan_status')"
show-overflow-tooltip> show-overflow-tooltip>
<template v-slot:default="scope"> <template v-slot:default="scope">
<el-dropdown class="test-case-status" @command="statusChange"> <div @click.stop="false">
<span class="el-dropdown-link"> <el-dropdown class="test-case-status" @command="statusChange">
<plan-status-table-item :value="scope.row.status"/> <span class="el-dropdown-link">
</span> <plan-status-table-item :value="scope.row.status"/>
<el-dropdown-menu slot="dropdown" chang> </span>
<el-dropdown-item :command="{id: scope.row.id, status: 'Prepare'}"> <el-dropdown-menu slot="dropdown" chang>
{{$t('test_track.plan.plan_status_prepare')}} <el-dropdown-item :command="{id: scope.row.id, status: 'Prepare'}">
</el-dropdown-item> {{$t('test_track.plan.plan_status_prepare')}}
<el-dropdown-item :command="{id: scope.row.id, status: 'Underway'}"> </el-dropdown-item>
{{$t('test_track.plan.plan_status_running')}} <el-dropdown-item :command="{id: scope.row.id, status: 'Underway'}">
</el-dropdown-item> {{$t('test_track.plan.plan_status_running')}}
<el-dropdown-item :command="{id: scope.row.id, status: 'Completed'}"> </el-dropdown-item>
{{$t('test_track.plan.plan_status_completed')}} <el-dropdown-item :command="{id: scope.row.id, status: 'Completed'}">
</el-dropdown-item> {{$t('test_track.plan.plan_status_completed')}}
</el-dropdown-menu> </el-dropdown-item>
</el-dropdown> </el-dropdown-menu>
</el-dropdown>
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column

View File

@ -167,7 +167,7 @@
</el-row> </el-row>
<el-row v-if="testCase.issues && testCase.issues.hasIssues"> <el-row v-if="testCase.issues && testCase.issues.hasIssues">
<el-col :span="20" :offset="1" class="step-edit"> <el-col :span="20" :offset="1" class="issues-edit">
<ckeditor :editor="editor" :disabled="isReadOnly" :config="editorConfig" v-model="testCase.issues.content"/> <ckeditor :editor="editor" :disabled="isReadOnly" :config="editorConfig" v-model="testCase.issues.content"/>
</el-col> </el-col>
</el-row> </el-row>
@ -425,7 +425,7 @@
line-height: 50px; line-height: 50px;
} }
.step-edit >>> p { .issues-edit >>> p {
line-height: 16px; line-height: 16px;
} }
@ -456,5 +456,4 @@
.el-switch >>> .el-switch__label.is-active { .el-switch >>> .el-switch__label.is-active {
color: #409EFF; color: #409EFF;
} }
</style> </style>

View File

@ -86,7 +86,8 @@
column-key="status" column-key="status"
:label="$t('test_track.plan_view.execute_result')"> :label="$t('test_track.plan_view.execute_result')">
<template v-slot:default="scope"> <template v-slot:default="scope">
<el-dropdown class="test-case-status" @command="statusChange"> <div @click.stop="false">
<el-dropdown class="test-case-status" @command="statusChange" >
<span class="el-dropdown-link"> <span class="el-dropdown-link">
<status-table-item :value="scope.row.status"/> <status-table-item :value="scope.row.status"/>
</span> </span>
@ -105,6 +106,7 @@
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div>
</template> </template>
</el-table-column> </el-table-column>

View File

@ -33,8 +33,10 @@ body {
clear: both; clear: both;
} }
/*解决富文本框中link显示问题*/
.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners {
z-index: 10055 !important;
}
.table-card > .el-card__body { .table-card > .el-card__body {
padding-top: 0; padding-top: 0;

View File

@ -18,6 +18,8 @@ export default {
let login = function () { let login = function () {
MessageBox.alert(i18n.t('commons.tips'), i18n.t('commons.prompt'), { MessageBox.alert(i18n.t('commons.tips'), i18n.t('commons.prompt'), {
callback: () => { callback: () => {
axios.get("/signout");
localStorage.setItem('Admin-Token', "{}");
window.location.href = "/login" window.location.href = "/login"
} }
}); });